Skip to content

Commit deb3600

Browse files
bors[bot]Veykril
andauthored
Merge #46
46: Fix some rust.ungram inconsistencies r=Veykril a=Veykril Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 parents 4b6c84d + 800de58 commit deb3600

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

rust.ungram

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Item =
102102
| Use
103103

104104
MacroRules =
105-
Attr* Visibility?
105+
Attr*
106106
'macro_rules' '!' Name
107107
TokenTree
108108

@@ -173,7 +173,7 @@ TypeAlias =
173173
Attr* Visibility?
174174
'default'?
175175
'type' Name GenericParamList? (':' TypeBoundList?)? WhereClause?
176-
'=' Type ';'
176+
('=' Type)? ';'
177177

178178
Struct =
179179
Attr* Visibility?
@@ -210,7 +210,7 @@ VariantList =
210210

211211
Variant =
212212
Attr* Visibility?
213-
Name FieldList ('=' Expr)?
213+
Name FieldList? ('=' Expr)?
214214

215215
Union =
216216
Attr* Visibility?
@@ -229,17 +229,17 @@ Const =
229229
Attr* Visibility?
230230
'default'?
231231
'const' (Name | '_') ':' Type
232-
'=' body:Expr ';'
232+
('=' body:Expr)? ';'
233233

234234
Static =
235235
Attr* Visibility?
236-
'static'? 'mut'? Name ':' Type
237-
'=' body:Expr ';'
236+
'static' 'mut'? Name ':' Type
237+
('=' body:Expr)? ';'
238238

239239
Trait =
240240
Attr* Visibility?
241241
'unsafe'? 'auto'?
242-
'trait' Name GenericParamList (':' TypeBoundList?)? WhereClause
242+
'trait' Name GenericParamList? (':' TypeBoundList?)? WhereClause?
243243
AssocItemList
244244

245245
AssocItemList =
@@ -258,7 +258,7 @@ Impl =
258258
AssocItemList
259259

260260
ExternBlock =
261-
Attr* Abi ExternItemList
261+
Attr* 'unsafe'? Abi ExternItemList
262262

263263
ExternItemList =
264264
'{' Attr* ExternItem* '}'
@@ -292,7 +292,7 @@ WhereClause =
292292
'where' predicates:(WherePred (',' WherePred)* ','?)
293293

294294
WherePred =
295-
('for' GenericParamList)? (Lifetime | Type) ':' TypeBoundList
295+
('for' GenericParamList)? (Lifetime | Type) ':' TypeBoundList?
296296

297297
Visibility =
298298
'pub' ('(' 'in'? Path ')')?

0 commit comments

Comments
 (0)