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 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) }

View file

@ -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;

View file

@ -195,10 +195,9 @@ AssocItem =
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 =