mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 05:08:52 +00:00
Simplify trait gramamr
This commit is contained in:
parent
9818108798
commit
81359af733
3 changed files with 7 additions and 7 deletions
|
@ -267,7 +267,6 @@ impl Impl {
|
||||||
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
|
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
|
||||||
pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
|
pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
|
||||||
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
|
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
|
||||||
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
|
|
||||||
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
|
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
|
||||||
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
|
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
|
||||||
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
|
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
|
||||||
|
|
|
@ -591,6 +591,8 @@ fn lower_rule(acc: &mut Vec<Field>, grammar: &Grammar, label: Option<&String>, r
|
||||||
| "index"
|
| "index"
|
||||||
| "base"
|
| "base"
|
||||||
| "value"
|
| "value"
|
||||||
|
| "target_type"
|
||||||
|
| "target_trait"
|
||||||
);
|
);
|
||||||
if manually_implemented {
|
if manually_implemented {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -194,12 +194,11 @@ AssocItem =
|
||||||
| TypeAlias
|
| TypeAlias
|
||||||
|
|
||||||
Impl =
|
Impl =
|
||||||
Attr* Visibility?
|
Attr* Visibility?
|
||||||
'default'? 'unsafe'? 'impl' 'const'? GenericParamList? (
|
'default'? 'unsafe'? 'impl' 'const'? GenericParamList?
|
||||||
Type
|
('!'? target_trait:Type 'for')? target_type:Type
|
||||||
| '!'? Type 'for' Type
|
WhereClause?
|
||||||
) WhereClause?
|
AssocItemList
|
||||||
AssocItemList
|
|
||||||
|
|
||||||
ExternBlock =
|
ExternBlock =
|
||||||
Attr* Abi ExternItemList
|
Attr* Abi ExternItemList
|
||||||
|
|
Loading…
Reference in a new issue