Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/generated/nodes.rs')
| -rw-r--r-- | crates/syntax/src/ast/generated/nodes.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs index f69c873663..15b8371c3e 100644 --- a/crates/syntax/src/ast/generated/nodes.rs +++ b/crates/syntax/src/ast/generated/nodes.rs @@ -722,10 +722,20 @@ impl LetStmt { pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } + pub fn let_else(&self) -> Option<LetElse> { support::child(&self.syntax) } pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct LetElse { + pub(crate) syntax: SyntaxNode, +} +impl LetElse { + pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) } + pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ArrayExpr { pub(crate) syntax: SyntaxNode, } @@ -2304,6 +2314,17 @@ impl AstNode for LetStmt { } fn syntax(&self) -> &SyntaxNode { &self.syntax } } +impl AstNode for LetElse { + fn can_cast(kind: SyntaxKind) -> bool { kind == LET_ELSE } + fn cast(syntax: SyntaxNode) -> Option<Self> { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + fn syntax(&self) -> &SyntaxNode { &self.syntax } +} impl AstNode for ArrayExpr { fn can_cast(kind: SyntaxKind) -> bool { kind == ARRAY_EXPR } fn cast(syntax: SyntaxNode) -> Option<Self> { @@ -4320,6 +4341,11 @@ impl std::fmt::Display for LetStmt { std::fmt::Display::fmt(self.syntax(), f) } } +impl std::fmt::Display for LetElse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self.syntax(), f) + } +} impl std::fmt::Display for ArrayExpr { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) |