Simplify trait gramamr

This commit is contained in:
Aleksey Kladov 2020-07-31 20:22:20 +02:00
parent 9818108798
commit 81359af733
3 changed files with 7 additions and 7 deletions

View file

@ -267,7 +267,6 @@ impl Impl {
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 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 for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }

View file

@ -591,6 +591,8 @@ fn lower_rule(acc: &mut Vec<Field>, grammar: &Grammar, label: Option<&String>, r
| "index"
| "base"
| "value"
| "target_type"
| "target_trait"
);
if manually_implemented {
return;

View file

@ -194,12 +194,11 @@ AssocItem =
| TypeAlias
Impl =
Attr* Visibility?
'default'? 'unsafe'? 'impl' 'const'? GenericParamList? (
Type
| '!'? Type 'for' Type
) WhereClause?
AssocItemList
Attr* Visibility?
'default'? 'unsafe'? 'impl' 'const'? GenericParamList?
('!'? target_trait:Type 'for')? target_type:Type
WhereClause?
AssocItemList
ExternBlock =
Attr* Abi ExternItemList