Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/ungrammar/rust.ungram')
| -rw-r--r-- | lib/ungrammar/rust.ungram | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/ungrammar/rust.ungram b/lib/ungrammar/rust.ungram index d2ef552ae9..7d7f184852 100644 --- a/lib/ungrammar/rust.ungram +++ b/lib/ungrammar/rust.ungram @@ -357,6 +357,7 @@ Expr = | TupleExpr | WhileExpr | YieldExpr +| LetExpr Literal = Attr* value:( @@ -448,13 +449,9 @@ ClosureExpr = body:Expr IfExpr = - Attr* 'if' Condition then_branch:BlockExpr + Attr* 'if' condition:Expr then_branch:BlockExpr ('else' else_branch:(IfExpr | BlockExpr))? -Condition = - 'let' Pat '=' Expr -| Expr - LoopExpr = Attr* Label? 'loop' loop_body:BlockExpr @@ -464,7 +461,7 @@ ForExpr = loop_body:BlockExpr WhileExpr = - Attr* Label? 'while' Condition + Attr* Label? 'while' condition:Expr loop_body:BlockExpr Label = @@ -492,7 +489,7 @@ MatchArm = Attr* Pat guard:MatchGuard? '=>' Expr ','? MatchGuard = - 'if' ('let' Pat '=')? Expr + 'if' condition:Expr ReturnExpr = Attr* 'return' Expr? @@ -500,6 +497,9 @@ ReturnExpr = YieldExpr = Attr* 'yield' Expr? +LetExpr = + Attr* 'let' Pat '=' Expr + AwaitExpr = Attr* Expr '.' 'await' |