Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/ungrammar/rust.ungram')
-rw-r--r--lib/ungrammar/rust.ungram21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/ungrammar/rust.ungram b/lib/ungrammar/rust.ungram
index e0142b64cd..fdff06a0f2 100644
--- a/lib/ungrammar/rust.ungram
+++ b/lib/ungrammar/rust.ungram
@@ -26,6 +26,9 @@ Name =
NameRef =
'ident' | 'int_number'
+Lifetime =
+ 'lifetime_ident'
+
Path =
(qualifier:Path '::')? segment:PathSegment
@@ -52,7 +55,7 @@ AssocTypeArg =
NameRef (':' TypeBoundList | '=' Type)
LifetimeArg =
- 'lifetime'
+ Lifetime
ConstArg =
Expr
@@ -147,7 +150,7 @@ ParamList =
SelfParam =
Attr* (
- ('&' 'lifetime'?)? 'mut'? 'self'
+ ('&' Lifetime?)? 'mut'? 'self'
| 'mut'? 'self' ':' Type
)
@@ -275,13 +278,13 @@ ConstParam =
('=' default_val:Expr)?
LifetimeParam =
- Attr* 'lifetime' (':' TypeBoundList?)?
+ Attr* Lifetime (':' TypeBoundList?)?
WhereClause =
'where' predicates:(WherePred (',' WherePred)* ','?)
WherePred =
- ('for' GenericParamList)? ('lifetime' | Type) ':' TypeBoundList
+ ('for' GenericParamList)? (Lifetime | Type) ':' TypeBoundList
Visibility =
'pub' ('('
@@ -453,13 +456,13 @@ WhileExpr =
loop_body:BlockExpr
Label =
- 'lifetime' ':'
+ Lifetime ':'
BreakExpr =
- Attr* 'break' 'lifetime'? Expr?
+ Attr* 'break' Lifetime? Expr?
ContinueExpr =
- Attr* 'continue' 'lifetime'?
+ Attr* 'continue' Lifetime?
RangeExpr =
Attr* start:Expr? op:('..' | '..=') end:Expr?
@@ -523,7 +526,7 @@ PtrType =
'*' ('const' | 'mut') Type
RefType =
- '&' 'lifetime'? 'mut'? Type
+ '&' Lifetime? 'mut'? Type
ArrayType =
'[' Type ';' Expr ']'
@@ -550,7 +553,7 @@ TypeBoundList =
bounds:(TypeBound ('+' TypeBound)* '+'?)
TypeBound =
- 'lifetime'
+ Lifetime
| '?'? Type
//************************//