Unnamed repository; edit this file 'description' to name the repository.
Merge rust-analyzer/ungrammar#24
24: Fix incorrect rust.ungram rules for `Impl` and `RecordExprField` r=matklad a=Veykril
Regarding RecordExprField see https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/RecordExprField.20parse.20vs.20ungrammar.20definition
Regarding `const` position in `Impl` see https://github.com/oli-obk/rfcs/blob/const_generic_const_fn_bounds/text/0000-const-generic-const-fn-bounds.md#generic-bounds
Co-authored-by: Lukas Wirth <[email protected]>
| -rw-r--r-- | lib/ungrammar/Cargo.toml | 2 | ||||
| -rw-r--r-- | lib/ungrammar/rust.ungram | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ungrammar/Cargo.toml b/lib/ungrammar/Cargo.toml index 252ce0eb07..bf4a6fa0ab 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.9.2" +version = "1.9.3" 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 0e91b7a849..fbbc3161c0 100644 --- a/lib/ungrammar/rust.ungram +++ b/lib/ungrammar/rust.ungram @@ -251,7 +251,7 @@ AssocItem = Impl = Attr* Visibility? 'default'? 'unsafe'? - 'impl' 'const'? GenericParamList? ('!'? trait:Type 'for')? self_ty:Type WhereClause? + 'impl' GenericParamList? ('const'? '!'? trait:Type 'for')? self_ty:Type WhereClause? AssocItemList ExternBlock = @@ -418,7 +418,7 @@ RecordExprFieldList = '}' RecordExprField = - Attr* NameRef (':' Expr)? + Attr* (NameRef ':')? Expr CallExpr = Attr* Expr ArgList |