aboutsummaryrefslogtreecommitdiff
path: root/xtask/src
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/ast_src.rs8
-rw-r--r--xtask/src/codegen/rust.ungram32
2 files changed, 20 insertions, 20 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index fe8381e41..56e3f4b0a 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -101,8 +101,8 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
101 "EXTERN_CRATE", 101 "EXTERN_CRATE",
102 "MODULE", 102 "MODULE",
103 "USE", 103 "USE",
104 "STATIC_DEF", 104 "STATIC",
105 "CONST_DEF", 105 "CONST",
106 "TRAIT_DEF", 106 "TRAIT_DEF",
107 "IMPL_DEF", 107 "IMPL_DEF",
108 "TYPE_ALIAS", 108 "TYPE_ALIAS",
@@ -179,12 +179,12 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
179 "BIN_EXPR", 179 "BIN_EXPR",
180 "EXTERN_BLOCK", 180 "EXTERN_BLOCK",
181 "EXTERN_ITEM_LIST", 181 "EXTERN_ITEM_LIST",
182 "ENUM_VARIANT", 182 "VARIANT",
183 "RECORD_FIELD_LIST", 183 "RECORD_FIELD_LIST",
184 "RECORD_FIELD", 184 "RECORD_FIELD",
185 "TUPLE_FIELD_LIST", 185 "TUPLE_FIELD_LIST",
186 "TUPLE_FIELD", 186 "TUPLE_FIELD",
187 "ENUM_VARIANT_LIST", 187 "VARIANT_LIST",
188 "ITEM_LIST", 188 "ITEM_LIST",
189 "ASSOC_ITEM_LIST", 189 "ASSOC_ITEM_LIST",
190 "ATTR", 190 "ATTR",
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index 9c6797cb7..ef7c3e50e 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -4,7 +4,7 @@ SourceFile =
4 Item* 4 Item*
5 5
6Item = 6Item =
7 ConstDef 7 Const
8| Enum 8| Enum
9| ExternBlock 9| ExternBlock
10| ExternCrate 10| ExternCrate
@@ -12,7 +12,7 @@ Item =
12| ImplDef 12| ImplDef
13| MacroCall 13| MacroCall
14| Module 14| Module
15| StaticDef 15| Static
16| Struct 16| Struct
17| TraitDef 17| TraitDef
18| TypeAlias 18| TypeAlias
@@ -100,18 +100,26 @@ FieldList =
100 100
101Enum = 101Enum =
102 Attr* Visibility? 'enum' Name GenericParamList? WhereClause? 102 Attr* Visibility? 'enum' Name GenericParamList? WhereClause?
103 variant_list:EnumVariantList 103 VariantList
104 104
105EnumVariantList = 105VariantList =
106 '{' variants:EnumVariant* '}' 106 '{' (Variant (',' Variant)* ','?)? '}'
107 107
108EnumVariant = 108Variant =
109 Attr* Visibility? Name FieldList ('=' Expr)? 109 Attr* Visibility? Name FieldList ('=' Expr)?
110 110
111Union = 111Union =
112 Attr* Visibility? 'union' Name GenericParamList? WhereClause? 112 Attr* Visibility? 'union' Name GenericParamList? WhereClause?
113 RecordFieldList 113 RecordFieldList
114 114
115Const =
116 Attr* Visibility? 'default'? 'const' (Name | '_') ':' ascribed_type:TypeRef
117 '=' body:Expr ';'
118
119Static =
120 Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef
121 '=' body:Expr ';'
122
115TraitDef = 123TraitDef =
116 Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name GenericParamList 124 Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name GenericParamList
117 (':' TypeBoundList?)? WhereClause 125 (':' TypeBoundList?)? WhereClause
@@ -120,14 +128,6 @@ TraitDef =
120AssocItemList = 128AssocItemList =
121 '{' AssocItem* '}' 129 '{' AssocItem* '}'
122 130
123ConstDef =
124 Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef
125 '=' body:Expr ';'
126
127StaticDef =
128 Attr* Visibility? 'static'? 'mut'? 'static' Name ':' ascribed_type:TypeRef
129 '=' body:Expr ';'
130
131ImplDef = 131ImplDef =
132 Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' GenericParamList? '!'? 'for' 132 Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' GenericParamList? '!'? 'for'
133 WhereClause? 133 WhereClause?
@@ -475,11 +475,11 @@ TypeRef =
475AssocItem = 475AssocItem =
476 Fn 476 Fn
477| TypeAlias 477| TypeAlias
478| ConstDef 478| Const
479| MacroCall 479| MacroCall
480 480
481ExternItem = 481ExternItem =
482 Fn | StaticDef 482 Fn | Static
483 483
484AttrInput = 484AttrInput =
485 Literal 485 Literal