mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Finalize Path grammar
This commit is contained in:
parent
8d28289d0f
commit
54fd09a9ca
2 changed files with 479 additions and 475 deletions
File diff suppressed because it is too large
Load diff
|
@ -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 =
|
SourceFile =
|
||||||
'shebang'?
|
'shebang'?
|
||||||
Attr*
|
Attr*
|
||||||
|
@ -521,33 +551,6 @@ MacroStmts =
|
||||||
statements:Stmt*
|
statements:Stmt*
|
||||||
Expr?
|
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 =
|
Pat =
|
||||||
OrPat
|
OrPat
|
||||||
| ParenPat
|
| ParenPat
|
||||||
|
|
Loading…
Reference in a new issue