Update grammar

Bounds are CONSTNESS ASYNCNESS POLARITY
This commit is contained in:
Michael Goulet 2024-02-16 16:16:34 +00:00
parent 3e4deab3d8
commit 36020bb512
2 changed files with 3 additions and 2 deletions

View file

@ -614,7 +614,7 @@ TypeBoundList =
TypeBound =
Lifetime
| ('?' | '~' 'const')? Type
| ('~' 'const' | 'const')? 'async'? '?'? Type
//************************//
// Patterns //

View file

@ -1410,9 +1410,10 @@ pub struct TypeBound {
}
impl TypeBound {
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
pub fn question_mark_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![?]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}