Skip to content

Commit

Permalink
Diagnose weird indenting issue with call to assert_seqs_equal as inte…
Browse files Browse the repository at this point in the history
…nded

behavior due to macro call
  • Loading branch information
parno committed Dec 13, 2023
1 parent f16d857 commit 32fdf49
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions examples/wip.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
verus! {

// Why the extra newline for the semi-colon?
// Answer: The parser sees the `;` as redundant and treats it as a separate statement
fn test() -> u64 {
proof { assert_sets_equal!(a, b); };
proof {
assert_sets_equal!(a, b);
assert_sets_equal!(c, d);
};
5

// Weird indenting of the last line
// Answer: This is because we don't format inside macro calls
proof fn test() {
assert_seqs_equal!(v@,
old(v)@.subrange(0, start as int) +
old(v)@.subrange(start as int + deleted as int,
old(v)@.len() as int));
}


/*
// The first set of &&& get out-dented, while the second one is absorbed into a single line
fn clone_value() -> (out: u8)
Expand All @@ -28,13 +26,5 @@ fn clone_value() -> (out: u8)
{
}
// Weird indenting of the last line
proof fn test() {
assert_seqs_equal!(v@,
old(v)@.subrange(0, start as int) +
old(v)@.subrange(start as int + deleted as int,
old(v)@.len() as int));
}
*/
} // verus!

0 comments on commit 32fdf49

Please sign in to comment.