aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-28 12:21:37 +0100
committerAleksey Kladov <[email protected]>2018-08-28 12:21:37 +0100
commit6c41a205a908eb94f139f968f803e728fc3418c6 (patch)
treea57ecdabdb29151a05c8b6be3e06009f464e2941 /crates/libsyntax2/src/ast
parent288c9d1ac625c4fa451bdb8ff54830fb9f9795e0 (diff)
join any block
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs
index 6181aada8..b24fd2aba 100644
--- a/crates/libsyntax2/src/ast/generated.rs
+++ b/crates/libsyntax2/src/ast/generated.rs
@@ -339,6 +339,7 @@ pub enum Expr<'a> {
339 PrefixExpr(PrefixExpr<'a>), 339 PrefixExpr(PrefixExpr<'a>),
340 RangeExpr(RangeExpr<'a>), 340 RangeExpr(RangeExpr<'a>),
341 BinExpr(BinExpr<'a>), 341 BinExpr(BinExpr<'a>),
342 Literal(Literal<'a>),
342} 343}
343 344
344impl<'a> AstNode<'a> for Expr<'a> { 345impl<'a> AstNode<'a> for Expr<'a> {
@@ -375,6 +376,7 @@ impl<'a> AstNode<'a> for Expr<'a> {
375 PREFIX_EXPR => Some(Expr::PrefixExpr(PrefixExpr { syntax })), 376 PREFIX_EXPR => Some(Expr::PrefixExpr(PrefixExpr { syntax })),
376 RANGE_EXPR => Some(Expr::RangeExpr(RangeExpr { syntax })), 377 RANGE_EXPR => Some(Expr::RangeExpr(RangeExpr { syntax })),
377 BIN_EXPR => Some(Expr::BinExpr(BinExpr { syntax })), 378 BIN_EXPR => Some(Expr::BinExpr(BinExpr { syntax })),
379 LITERAL => Some(Expr::Literal(Literal { syntax })),
378 _ => None, 380 _ => None,
379 } 381 }
380 } 382 }
@@ -411,6 +413,7 @@ impl<'a> AstNode<'a> for Expr<'a> {
411 Expr::PrefixExpr(inner) => inner.syntax(), 413 Expr::PrefixExpr(inner) => inner.syntax(),
412 Expr::RangeExpr(inner) => inner.syntax(), 414 Expr::RangeExpr(inner) => inner.syntax(),
413 Expr::BinExpr(inner) => inner.syntax(), 415 Expr::BinExpr(inner) => inner.syntax(),
416 Expr::Literal(inner) => inner.syntax(),
414 } 417 }
415 } 418 }
416} 419}
@@ -726,6 +729,24 @@ impl<'a> LetStmt<'a> {
726 } 729 }
727} 730}
728 731
732// Literal
733#[derive(Debug, Clone, Copy)]
734pub struct Literal<'a> {
735 syntax: SyntaxNodeRef<'a>,
736}
737
738impl<'a> AstNode<'a> for Literal<'a> {
739 fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> {
740 match syntax.kind() {
741 LITERAL => Some(Literal { syntax }),
742 _ => None,
743 }
744 }
745 fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
746}
747
748impl<'a> Literal<'a> {}
749
729// LoopExpr 750// LoopExpr
730#[derive(Debug, Clone, Copy)] 751#[derive(Debug, Clone, Copy)]
731pub struct LoopExpr<'a> { 752pub struct LoopExpr<'a> {