mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-02 00:27:31 +00:00
fix: Add trait alias grammar to rust.ungram
This commit is contained in:
parent
add85397ae
commit
6674bd898e
6 changed files with 37 additions and 22 deletions
|
@ -239,8 +239,11 @@ Static =
|
|||
Trait =
|
||||
Attr* Visibility?
|
||||
'unsafe'? 'auto'?
|
||||
'trait' Name GenericParamList? (':' TypeBoundList?)? WhereClause?
|
||||
AssocItemList
|
||||
'trait' Name GenericParamList?
|
||||
(
|
||||
(':' TypeBoundList?)? WhereClause? AssocItemList
|
||||
| '=' TypeBoundList? WhereClause? ';'
|
||||
)
|
||||
|
||||
AssocItemList =
|
||||
'{' Attr* AssocItem* '}'
|
||||
|
|
|
@ -407,6 +407,8 @@ impl Trait {
|
|||
pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) }
|
||||
pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) }
|
||||
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
|
||||
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
|
||||
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue