Unnamed repository; edit this file 'description' to name the repository.
Add inline const expression and pattern
| -rw-r--r-- | lib/ungrammar/Cargo.toml | 2 | ||||
| -rw-r--r-- | lib/ungrammar/rust.ungram | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/ungrammar/Cargo.toml b/lib/ungrammar/Cargo.toml index 1ba385676d..10aff55025 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.4.0" +version = "1.5.0" license = "MIT OR Apache-2.0" repository = "https://github.com/matklad/ungrammar" authors = ["Aleksey Kladov <[email protected]>"] diff --git a/lib/ungrammar/rust.ungram b/lib/ungrammar/rust.ungram index fdb381f98d..a954d9efd2 100644 --- a/lib/ungrammar/rust.ungram +++ b/lib/ungrammar/rust.ungram @@ -372,13 +372,13 @@ BlockExpr = '}' RefExpr = - Attr* '&' ('raw' |'mut' | 'const') Expr + Attr* '&' ('raw' | 'mut' | 'const') Expr TryExpr = Attr* Expr '?' EffectExpr = - Attr* Label? ('try' | 'unsafe' | 'async') BlockExpr + Attr* Label? ('try' | 'unsafe' | 'async' | 'const') BlockExpr PrefixExpr = Attr* op:('-' | '!' | '*') Expr @@ -582,6 +582,7 @@ Pat = | SlicePat | TuplePat | TupleStructPat +| ConstBlockPat LiteralPat = Literal @@ -636,3 +637,6 @@ RestPat = MacroPat = MacroCall + +ConstBlockPat = + 'const' BlockExpr |