Skip to content

Commit

Permalink
Merge #47
Browse files Browse the repository at this point in the history
47: Support destructuring assignments (RFC 2909) r=Veykril a=ChayimFriedman2

The supported patterns are already valid as expressions, except the rest pattern (`..`) and the wildcard pattern (`_`).

(We really should separate `rust.ungram` into the rust-analyzer repository, it blocks every syntax change).

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
  • Loading branch information
bors[bot] and ChayimFriedman2 committed Feb 26, 2022
2 parents c391a33 + 039a274 commit 61e218c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "ungrammar"
description = "A DSL for describing concrete syntax trees"
version = "1.15.0"
version = "1.16.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/matklad/ungrammar"
edition = "2018"
Expand Down
6 changes: 5 additions & 1 deletion rust.ungram
Expand Up @@ -358,6 +358,7 @@ Expr =
| WhileExpr
| YieldExpr
| LetExpr
| UnderscoreExpr

Literal =
Attr* value:(
Expand Down Expand Up @@ -426,7 +427,7 @@ RecordExprFieldList =
'{'
Attr*
fields:(RecordExprField (',' RecordExprField)* ','?)?
('..' spread:Expr)?
('..' spread:Expr?)?
'}'

RecordExprField =
Expand Down Expand Up @@ -500,6 +501,9 @@ YieldExpr =
LetExpr =
Attr* 'let' Pat '=' Expr

UnderscoreExpr =
Attr* '_'

AwaitExpr =
Attr* Expr '.' 'await'

Expand Down

0 comments on commit 61e218c

Please sign in to comment.