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 =
Lifetime
| ('~' 'const' | 'const')? 'async'? '?'? Type
| 'use' GenericParamList?
//************************//
// Patterns //

View file

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