Minor gramamr reorder

This commit is contained in:
Aleksey Kladov 2020-07-31 19:49:26 +02:00
parent 5cade89d73
commit 572f1c08b6
2 changed files with 529 additions and 530 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,9 @@
Name =
'ident'
NameRef =
'ident' | 'int_number'
Path = Path =
(qualifier:Path '::')? segment:PathSegment (qualifier:Path '::')? segment:PathSegment
@ -29,6 +35,21 @@ LifetimeArg =
ConstArg = ConstArg =
Expr Expr
MacroCall =
Attr* Path '!' Name? TokenTree ';'?
TokenTree =
'(' ')'
| '{' '}'
| '[' ']'
MacroItems =
Item*
MacroStmts =
statements:Stmt*
Expr?
SourceFile = SourceFile =
'shebang'? 'shebang'?
Attr* Attr*
@ -475,41 +496,37 @@ TypeBound =
'lifetime' 'lifetime'
| '?'? Type | '?'? Type
OrPat = Pat =
Pat* BindPat
| BoxPat
ParenPat = | DotDotPat
'(' Pat ')' | LiteralPat
| MacroPat
RefPat = | OrPat
'&' 'mut'? Pat | ParenPat
| PathPat
BoxPat = | PlaceholderPat
'box' Path | RangePat
| RecordPat
BindPat = | RefPat
Attr* 'ref'? 'mut'? Name ('@' Pat)? | SlicePat
| TuplePat
PlaceholderPat = | TupleStructPat
'_'
DotDotPat =
'..'
PathPat =
Path
SlicePat =
'[' args:Pat* ']'
RangePat =
'..' | '..='
LiteralPat = LiteralPat =
Literal Literal
MacroPat = PathPat =
MacroCall Path
PlaceholderPat =
'_'
RangePat =
start:Pat op:('..' | '..=') end:Pat
RefPat =
'&' 'mut'? Pat
RecordPat = RecordPat =
Path RecordFieldPatList Path RecordFieldPatList
@ -522,46 +539,31 @@ RecordFieldPatList =
'}' '}'
RecordFieldPat = RecordFieldPat =
Attr* NameRef ':' Pat Attr* (NameRef ':')? Pat
OrPat =
Pat*
ParenPat =
'(' Pat ')'
BoxPat =
'box' Path
BindPat =
Attr* 'ref'? 'mut'? Name ('@' Pat)?
DotDotPat =
'..'
SlicePat =
'[' args:Pat* ']'
MacroPat =
MacroCall
TupleStructPat = TupleStructPat =
Path '(' args:Pat* ')' Path '(' args:Pat* ')'
TuplePat = TuplePat =
'(' args:Pat* ')' '(' args:Pat* ')'
Name =
'ident'
NameRef =
'ident' | 'int_number'
MacroCall =
Attr* Path '!' Name? TokenTree ';'?
TokenTree =
'(' ')' | '{' '}' | '[' ']'
MacroItems =
Item*
MacroStmts =
statements:Stmt*
Expr?
Pat =
OrPat
| ParenPat
| RefPat
| BoxPat
| BindPat
| PlaceholderPat
| DotDotPat
| PathPat
| RecordPat
| TupleStructPat
| TuplePat
| SlicePat
| RangePat
| LiteralPat
| MacroPat