From 2e66cedc8b1d1b4e40b7dca568fc02038da0cce8 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 6 Oct 2021 18:15:06 +0200 Subject: [PATCH] Add support for `let ... else` --- lib/ungrammar/Cargo.toml | 2 +- lib/ungrammar/rust.ungram | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ungrammar/Cargo.toml b/lib/ungrammar/Cargo.toml index 25a10b3a54..f0172821bf 100644 --- a/lib/ungrammar/Cargo.toml +++ b/lib/ungrammar/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ungrammar" description = "A DSL for describing concrete syntax trees" -version = "1.14.6" +version = "1.14.7" license = "MIT OR Apache-2.0" repository = "https://github.com/matklad/ungrammar" edition = "2018" diff --git a/lib/ungrammar/rust.ungram b/lib/ungrammar/rust.ungram index 81323d27ca..c9a36079f2 100644 --- a/lib/ungrammar/rust.ungram +++ b/lib/ungrammar/rust.ungram @@ -315,7 +315,9 @@ Stmt = LetStmt = Attr* 'let' Pat (':' Type)? - '=' initializer:Expr ';' + '=' initializer:Expr + ('else' else_branch:BlockExpr)? + ';' ExprStmt = Expr ';'?