diff options
Diffstat (limited to 'xtask/src/codegen/rust.ungram')
-rw-r--r-- | xtask/src/codegen/rust.ungram | 32 |
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 | ||
6 | Item = | 6 | Item = |
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 | ||
101 | Enum = | 101 | Enum = |
102 | Attr* Visibility? 'enum' Name GenericParamList? WhereClause? | 102 | Attr* Visibility? 'enum' Name GenericParamList? WhereClause? |
103 | variant_list:EnumVariantList | 103 | VariantList |
104 | 104 | ||
105 | EnumVariantList = | 105 | VariantList = |
106 | '{' variants:EnumVariant* '}' | 106 | '{' (Variant (',' Variant)* ','?)? '}' |
107 | 107 | ||
108 | EnumVariant = | 108 | Variant = |
109 | Attr* Visibility? Name FieldList ('=' Expr)? | 109 | Attr* Visibility? Name FieldList ('=' Expr)? |
110 | 110 | ||
111 | Union = | 111 | Union = |
112 | Attr* Visibility? 'union' Name GenericParamList? WhereClause? | 112 | Attr* Visibility? 'union' Name GenericParamList? WhereClause? |
113 | RecordFieldList | 113 | RecordFieldList |
114 | 114 | ||
115 | Const = | ||
116 | Attr* Visibility? 'default'? 'const' (Name | '_') ':' ascribed_type:TypeRef | ||
117 | '=' body:Expr ';' | ||
118 | |||
119 | Static = | ||
120 | Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef | ||
121 | '=' body:Expr ';' | ||
122 | |||
115 | TraitDef = | 123 | TraitDef = |
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 = | |||
120 | AssocItemList = | 128 | AssocItemList = |
121 | '{' AssocItem* '}' | 129 | '{' AssocItem* '}' |
122 | 130 | ||
123 | ConstDef = | ||
124 | Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef | ||
125 | '=' body:Expr ';' | ||
126 | |||
127 | StaticDef = | ||
128 | Attr* Visibility? 'static'? 'mut'? 'static' Name ':' ascribed_type:TypeRef | ||
129 | '=' body:Expr ';' | ||
130 | |||
131 | ImplDef = | 131 | ImplDef = |
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 = | |||
475 | AssocItem = | 475 | AssocItem = |
476 | Fn | 476 | Fn |
477 | | TypeAlias | 477 | | TypeAlias |
478 | | ConstDef | 478 | | Const |
479 | | MacroCall | 479 | | MacroCall |
480 | 480 | ||
481 | ExternItem = | 481 | ExternItem = |
482 | Fn | StaticDef | 482 | Fn | Static |
483 | 483 | ||
484 | AttrInput = | 484 | AttrInput = |
485 | Literal | 485 | Literal |