aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen/rust.ungram
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/codegen/rust.ungram')
-rw-r--r--xtask/src/codegen/rust.ungram32
1 files changed, 16 insertions, 16 deletions
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