diff options
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 2eb4b14d2..33d5578e7 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -3114,6 +3114,9 @@ impl TypeArgList { | |||
3114 | pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { | 3114 | pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { |
3115 | AstChildren::new(&self.syntax) | 3115 | AstChildren::new(&self.syntax) |
3116 | } | 3116 | } |
3117 | pub fn const_arg(&self) -> AstChildren<ConstArg> { | ||
3118 | AstChildren::new(&self.syntax) | ||
3119 | } | ||
3117 | } | 3120 | } |
3118 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3121 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3119 | pub struct TypeArg { | 3122 | pub struct TypeArg { |
@@ -3196,6 +3199,36 @@ impl AstNode for LifetimeArg { | |||
3196 | } | 3199 | } |
3197 | impl LifetimeArg {} | 3200 | impl LifetimeArg {} |
3198 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3201 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3202 | pub struct ConstArg { | ||
3203 | pub(crate) syntax: SyntaxNode, | ||
3204 | } | ||
3205 | impl AstNode for ConstArg { | ||
3206 | fn can_cast(kind: SyntaxKind) -> bool { | ||
3207 | match kind { | ||
3208 | CONST_ARG => true, | ||
3209 | _ => false, | ||
3210 | } | ||
3211 | } | ||
3212 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
3213 | if Self::can_cast(syntax.kind()) { | ||
3214 | Some(Self { syntax }) | ||
3215 | } else { | ||
3216 | None | ||
3217 | } | ||
3218 | } | ||
3219 | fn syntax(&self) -> &SyntaxNode { | ||
3220 | &self.syntax | ||
3221 | } | ||
3222 | } | ||
3223 | impl ConstArg { | ||
3224 | pub fn literal(&self) -> Option<Literal> { | ||
3225 | AstChildren::new(&self.syntax).next() | ||
3226 | } | ||
3227 | pub fn block_expr(&self) -> Option<BlockExpr> { | ||
3228 | AstChildren::new(&self.syntax).next() | ||
3229 | } | ||
3230 | } | ||
3231 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
3199 | pub struct MacroItems { | 3232 | pub struct MacroItems { |
3200 | pub(crate) syntax: SyntaxNode, | 3233 | pub(crate) syntax: SyntaxNode, |
3201 | } | 3234 | } |