Skip to content

Commit 7479c18

Browse files
1 parent 42810d7 commit 7479c18

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ungrammar"
33
description = "A DSL for describing concrete syntax trees"
4-
version = "1.14.9"
4+
version = "1.15.0"
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/matklad/ungrammar"
77
edition = "2018"

rust.ungram

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ Expr =
357357
| TupleExpr
358358
| WhileExpr
359359
| YieldExpr
360+
| LetExpr
360361

361362
Literal =
362363
Attr* value:(
@@ -448,13 +449,9 @@ ClosureExpr =
448449
body:Expr
449450

450451
IfExpr =
451-
Attr* 'if' Condition then_branch:BlockExpr
452+
Attr* 'if' condition:Expr then_branch:BlockExpr
452453
('else' else_branch:(IfExpr | BlockExpr))?
453454

454-
Condition =
455-
'let' Pat '=' Expr
456-
| Expr
457-
458455
LoopExpr =
459456
Attr* Label? 'loop'
460457
loop_body:BlockExpr
@@ -464,7 +461,7 @@ ForExpr =
464461
loop_body:BlockExpr
465462

466463
WhileExpr =
467-
Attr* Label? 'while' Condition
464+
Attr* Label? 'while' condition:Expr
468465
loop_body:BlockExpr
469466

470467
Label =
@@ -492,14 +489,17 @@ MatchArm =
492489
Attr* Pat guard:MatchGuard? '=>' Expr ','?
493490

494491
MatchGuard =
495-
'if' ('let' Pat '=')? Expr
492+
'if' condition:Expr
496493

497494
ReturnExpr =
498495
Attr* 'return' Expr?
499496

500497
YieldExpr =
501498
Attr* 'yield' Expr?
502499

500+
LetExpr =
501+
Attr* 'let' Pat '=' Expr
502+
503503
AwaitExpr =
504504
Attr* Expr '.' 'await'
505505

0 commit comments

Comments
 (0)