Finalize Path grammar

This commit is contained in:
Aleksey Kladov 2020-07-31 18:27:23 +02:00
parent 8d28289d0f
commit 54fd09a9ca
2 changed files with 479 additions and 475 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,33 @@
Path =
(qualifier:Path '::')? segment:PathSegment
PathSegment =
'::' | 'crate' | 'self' | 'super'
| (NameRef ('::'? TypeArgList)?)
| NameRef ParamList RetType?
| '<' PathType ('as' PathType)? '>'
TypeArgList =
'::'? '<'
TypeArg*
LifetimeArg*
AssocTypeArg*
ConstArg*
'>'
TypeArg =
Type
AssocTypeArg =
NameRef (':' TypeBoundList | '=' Type)
LifetimeArg =
'lifetime'
ConstArg =
Literal | BlockExpr BlockExpr
SourceFile =
'shebang'?
Attr*
@ -521,33 +551,6 @@ MacroStmts =
statements:Stmt*
Expr?
Path =
(qualifier:Path '::')? segment:PathSegment
PathSegment =
'::' | 'crate' | 'self' | 'super'
| '<' NameRef TypeArgList ParamList RetType PathType '>'
TypeArgList =
'::'? '<'
TypeArg*
LifetimeArg*
AssocTypeArg*
ConstArg*
'>'
TypeArg =
Type
AssocTypeArg =
NameRef (':' TypeBoundList | '=' Type)
LifetimeArg =
'lifetime'
ConstArg =
Literal | BlockExpr BlockExpr
Pat =
OrPat
| ParenPat