Skip to content

Commit

Permalink
Support the macro_pat parsing object (#101)
Browse files Browse the repository at this point in the history
This PR adds support for the `macro_pat` capture during patterns matches.
  • Loading branch information
jaybosamiya-ms authored Oct 7, 2024
2 parents 27fe344 + 6c4dcba commit 90130f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ fn to_doc<'a>(
Rule::path_pat => map_to_doc(ctx, arena, pair),
Rule::box_pat => map_to_doc(ctx, arena, pair),
Rule::rest_pat => map_to_doc(ctx, arena, pair),
Rule::macro_pat => unsupported(pair),
Rule::macro_pat => map_to_doc(ctx, arena, pair),
Rule::const_block_pat => unsupported(pair),

//************************//
Expand Down
16 changes: 15 additions & 1 deletion tests/verus-consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,13 @@ verus!{
cong;
done;
");
fn foo(x: usize) {
match x {
inj_ord_choice_pat!((_,x), *, *) => (),
inj_ord_choice_pat!(*, (_,x), *) => (),
inj_ord_choice_pat!(*, *, _) => (),
};
}
}
"#;

Expand All @@ -505,6 +511,14 @@ verus!{
cong;
done;
");
fn foo(x: usize) {
match x {
inj_ord_choice_pat!((_,x), *, *) => (),
inj_ord_choice_pat!(*, (_,x), *) => (),
inj_ord_choice_pat!(*, *, _) => (),
};
}
} // verus!
"###);
Expand Down

0 comments on commit 90130f5

Please sign in to comment.