mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Introduce GenericParam
This commit is contained in:
parent
917c89c103
commit
3dce34aaf8
5 changed files with 170 additions and 103 deletions
|
@ -154,6 +154,25 @@ ExternItemList =
|
|||
ExternItem =
|
||||
Fn | Static | MacroCall
|
||||
|
||||
GenericParamList =
|
||||
'<' (GenericParam (',' GenericParam)* ','?)? '>'
|
||||
|
||||
GenericParam =
|
||||
LifetimeParam
|
||||
| TypeParam
|
||||
| ConstParam
|
||||
|
||||
TypeParam =
|
||||
Attr* Name (':' TypeBoundList?)?
|
||||
('=' default_type:TypeRef)?
|
||||
|
||||
ConstParam =
|
||||
Attr* 'const' Name ':' ascribed_type:TypeRef
|
||||
('=' default_val:Expr)?
|
||||
|
||||
LifetimeParam =
|
||||
Attr* 'lifetime'
|
||||
|
||||
ParenType =
|
||||
'(' TypeRef ')'
|
||||
|
||||
|
@ -400,24 +419,6 @@ MacroStmts =
|
|||
Attr =
|
||||
'#' '!'? '[' Path ('=' input:AttrInput)? ']'
|
||||
|
||||
GenericParamList =
|
||||
'<'
|
||||
TypeParam*
|
||||
LifetimeParam*
|
||||
ConstParam*
|
||||
'>'
|
||||
|
||||
TypeParam =
|
||||
Attr* Name (':' TypeBoundList?)?
|
||||
('=' default_type:TypeRef)?
|
||||
|
||||
ConstParam =
|
||||
Attr* 'const' Name ':' ascribed_type:TypeRef
|
||||
('=' default_val:Expr)?
|
||||
|
||||
LifetimeParam =
|
||||
Attr* 'lifetime'
|
||||
|
||||
TypeBound =
|
||||
'lifetime' | 'const'? TypeRef
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue