Skip to content

Commit e85dd88

Browse files
committed
Update grammar.md
Update grammar.md to reflect the changes to `if let` and `while let`.
1 parent 6c7410b commit e85dd88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/grammar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,15 +661,15 @@ match_pat : pat [ '|' pat ] * [ "if" expr ] ? ;
661661
### If let expressions
662662

663663
```antlr
664-
if_let_expr : "if" "let" pat '=' expr '{' block '}'
664+
if_let_expr : "if" "let" pat [ '|' pat ] * '=' expr '{' block '}'
665665
else_tail ? ;
666666
else_tail : "else" [ if_expr | if_let_expr | '{' block '}' ] ;
667667
```
668668

669669
### While let loops
670670

671671
```antlr
672-
while_let_expr : "while" "let" pat '=' expr '{' block '}' ;
672+
while_let_expr : "while" "let" pat [ '|' pat ] * '=' expr '{' block '}' ;
673673
```
674674

675675
### Return expressions

0 commit comments

Comments
 (0)