update grammer to support associated const equality

This commit is contained in:
XFFXFF 2022-04-17 12:03:52 +08:00
parent 53afd2a707
commit bdecd9374e
2 changed files with 2 additions and 1 deletions

View file

@ -51,7 +51,7 @@ TypeArg =
Type Type
AssocTypeArg = AssocTypeArg =
NameRef GenericParamList? (':' TypeBoundList | '=' Type) NameRef GenericParamList? (':' TypeBoundList | ('=' Type | ConstArg))
LifetimeArg = LifetimeArg =
Lifetime Lifetime

View file

@ -123,6 +123,7 @@ impl AssocTypeArg {
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) } pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]