feat: add use type bound grammar

This commit is contained in:
winstxnhdw 2024-07-22 00:00:59 +01:00
parent eb5da56d83
commit fa3484f39f
2 changed files with 5 additions and 0 deletions

View file

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

View file

@ -1788,6 +1788,8 @@ pub struct TypeBound {
pub(crate) syntax: SyntaxNode, pub(crate) syntax: SyntaxNode,
} }
impl TypeBound { impl TypeBound {
#[inline]
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
#[inline] #[inline]
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) } pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
#[inline] #[inline]
@ -1799,6 +1801,8 @@ impl TypeBound {
#[inline] #[inline]
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]) }
#[inline] #[inline]
pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
#[inline]
pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) } pub fn tilde_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![~]) }
} }