diff options
Diffstat (limited to 'xtask/src')
-rw-r--r-- | xtask/src/ast_src.rs | 3 | ||||
-rw-r--r-- | xtask/src/codegen/rust.ungram | 29 |
2 files changed, 17 insertions, 15 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 83449437b..bcd92c3bc 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs | |||
@@ -186,6 +186,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { | |||
186 | "TUPLE_FIELD_DEF", | 186 | "TUPLE_FIELD_DEF", |
187 | "ENUM_VARIANT_LIST", | 187 | "ENUM_VARIANT_LIST", |
188 | "ITEM_LIST", | 188 | "ITEM_LIST", |
189 | "ASSOC_ITEM_LIST", | ||
189 | "ATTR", | 190 | "ATTR", |
190 | "META_ITEM", // not an item actually | 191 | "META_ITEM", // not an item actually |
191 | "USE_TREE", | 192 | "USE_TREE", |
@@ -193,7 +194,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { | |||
193 | "PATH", | 194 | "PATH", |
194 | "PATH_SEGMENT", | 195 | "PATH_SEGMENT", |
195 | "LITERAL", | 196 | "LITERAL", |
196 | "ALIAS", | 197 | "RENAME", |
197 | "VISIBILITY", | 198 | "VISIBILITY", |
198 | "WHERE_CLAUSE", | 199 | "WHERE_CLAUSE", |
199 | "WHERE_PRED", | 200 | "WHERE_PRED", |
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index a93cb3815..76c070402 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram | |||
@@ -19,6 +19,13 @@ Item = | |||
19 | | UnionDef | 19 | | UnionDef |
20 | | UseItem | 20 | | UseItem |
21 | 21 | ||
22 | Module = | ||
23 | Attr* Visibility? 'mod' Name | ||
24 | (ItemList | ';') | ||
25 | |||
26 | ItemList = | ||
27 | '{' Attr* Item* '}' | ||
28 | |||
22 | FnDef = | 29 | FnDef = |
23 | Attr* Visibility? Abi? 'const' 'default' 'async' 'unsafe' 'fn' Name TypeParamList? | 30 | Attr* Visibility? Abi? 'const' 'default' 'async' 'unsafe' 'fn' Name TypeParamList? |
24 | ParamList RetType? | 31 | ParamList RetType? |
@@ -67,17 +74,10 @@ EnumVariant = | |||
67 | TraitDef = | 74 | TraitDef = |
68 | Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name TypeParamList | 75 | Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name TypeParamList |
69 | (':' TypeBoundList?)? WhereClause | 76 | (':' TypeBoundList?)? WhereClause |
70 | ItemList | 77 | AssocItemList |
71 | 78 | ||
72 | Module = | 79 | AssocItemList = |
73 | Attr* Visibility? 'mod' Name | 80 | '{' AssocItem* '}' |
74 | (ItemList | ';') | ||
75 | |||
76 | ItemList = | ||
77 | '{' | ||
78 | AssocItem* | ||
79 | Item* | ||
80 | '}' | ||
81 | 81 | ||
82 | ConstDef = | 82 | ConstDef = |
83 | Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef | 83 | Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef |
@@ -94,7 +94,7 @@ TypeAliasDef = | |||
94 | ImplDef = | 94 | ImplDef = |
95 | Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' TypeParamList? '!'? 'for' | 95 | Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' TypeParamList? '!'? 'for' |
96 | WhereClause? | 96 | WhereClause? |
97 | ItemList | 97 | AssocItemList |
98 | 98 | ||
99 | ParenType = | 99 | ParenType = |
100 | '(' TypeRef ')' | 100 | '(' TypeRef ')' |
@@ -396,16 +396,16 @@ UseItem = | |||
396 | Attr* Visibility? 'use' UseTree ';' | 396 | Attr* Visibility? 'use' UseTree ';' |
397 | 397 | ||
398 | UseTree = | 398 | UseTree = |
399 | Path ('::' ('*' | UseTreeList)) Alias? | 399 | Path ('::' ('*' | UseTreeList)) Rename? |
400 | 400 | ||
401 | UseTreeList = | 401 | UseTreeList = |
402 | '{' UseTree* '}' | 402 | '{' UseTree* '}' |
403 | 403 | ||
404 | Alias = | 404 | Rename = |
405 | 'as' Name | 405 | 'as' Name |
406 | 406 | ||
407 | ExternCrateItem = | 407 | ExternCrateItem = |
408 | Attr* Visibility? 'extern' 'crate' (NameRef | 'self') Alias? ';' | 408 | Attr* Visibility? 'extern' 'crate' (NameRef | 'self') Rename? ';' |
409 | 409 | ||
410 | Path = | 410 | Path = |
411 | (qualifier:Path '::')? segment:PathSegment | 411 | (qualifier:Path '::')? segment:PathSegment |
@@ -467,6 +467,7 @@ AssocItem = | |||
467 | FnDef | 467 | FnDef |
468 | | TypeAliasDef | 468 | | TypeAliasDef |
469 | | ConstDef | 469 | | ConstDef |
470 | | MacroCall | ||
470 | 471 | ||
471 | ExternItem = | 472 | ExternItem = |
472 | FnDef | StaticDef | 473 | FnDef | StaticDef |