Skip to content

Commit

Permalink
fix: add a check for if token in patterns parser
Browse files Browse the repository at this point in the history
  • Loading branch information
dzvon committed Dec 15, 2022
1 parent 95671d5 commit 6a295fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/parser/src/grammar/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ fn pattern_single_r(p: &mut Parser<'_>, recovery_set: TokenSet) {
// ^
// `[0..]`
// ^
if matches!(p.current(), T![=] | T![,] | T![:] | T![')'] | T!['}'] | T![']']) {
if matches!(
p.current(),
T![=] | T![,] | T![:] | T![')'] | T!['}'] | T![']'] | T![if]
) {
// test half_open_range_pat
// fn f() {
// let 0 .. = 1u32;
Expand Down

0 comments on commit 6a295fc

Please sign in to comment.