aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated/nodes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/generated/nodes.rs')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs35
1 files changed, 14 insertions, 21 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 186db538b..158544fa2 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -582,9 +582,7 @@ pub struct BinExpr {
582 pub(crate) syntax: SyntaxNode, 582 pub(crate) syntax: SyntaxNode,
583} 583}
584impl ast::AttrsOwner for BinExpr {} 584impl ast::AttrsOwner for BinExpr {}
585impl BinExpr { 585impl BinExpr {}
586 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
587}
588#[derive(Debug, Clone, PartialEq, Eq, Hash)] 586#[derive(Debug, Clone, PartialEq, Eq, Hash)]
589pub struct BoxExpr { 587pub struct BoxExpr {
590 pub(crate) syntax: SyntaxNode, 588 pub(crate) syntax: SyntaxNode,
@@ -680,9 +678,7 @@ impl ast::AttrsOwner for IfExpr {}
680impl IfExpr { 678impl IfExpr {
681 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) } 679 pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
682 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } 680 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
683 pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
684 pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) } 681 pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
685 pub fn if_expr(&self) -> Option<IfExpr> { support::child(&self.syntax) }
686} 682}
687#[derive(Debug, Clone, PartialEq, Eq, Hash)] 683#[derive(Debug, Clone, PartialEq, Eq, Hash)]
688pub struct IndexExpr { 684pub struct IndexExpr {
@@ -690,7 +686,6 @@ pub struct IndexExpr {
690} 686}
691impl ast::AttrsOwner for IndexExpr {} 687impl ast::AttrsOwner for IndexExpr {}
692impl IndexExpr { 688impl IndexExpr {
693 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
694 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } 689 pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
695 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } 690 pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
696} 691}
@@ -704,11 +699,11 @@ impl Label {
704 } 699 }
705} 700}
706#[derive(Debug, Clone, PartialEq, Eq, Hash)] 701#[derive(Debug, Clone, PartialEq, Eq, Hash)]
707pub struct LambdaExpr { 702pub struct ClosureExpr {
708 pub(crate) syntax: SyntaxNode, 703 pub(crate) syntax: SyntaxNode,
709} 704}
710impl ast::AttrsOwner for LambdaExpr {} 705impl ast::AttrsOwner for ClosureExpr {}
711impl LambdaExpr { 706impl ClosureExpr {
712 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } 707 pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
713 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } 708 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
714 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) } 709 pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
@@ -778,9 +773,7 @@ pub struct RangeExpr {
778 pub(crate) syntax: SyntaxNode, 773 pub(crate) syntax: SyntaxNode,
779} 774}
780impl ast::AttrsOwner for RangeExpr {} 775impl ast::AttrsOwner for RangeExpr {}
781impl RangeExpr { 776impl RangeExpr {}
782 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
783}
784#[derive(Debug, Clone, PartialEq, Eq, Hash)] 777#[derive(Debug, Clone, PartialEq, Eq, Hash)]
785pub struct RecordExpr { 778pub struct RecordExpr {
786 pub(crate) syntax: SyntaxNode, 779 pub(crate) syntax: SyntaxNode,
@@ -1351,7 +1344,7 @@ pub enum Expr {
1351 IfExpr(IfExpr), 1344 IfExpr(IfExpr),
1352 IndexExpr(IndexExpr), 1345 IndexExpr(IndexExpr),
1353 Label(Label), 1346 Label(Label),
1354 LambdaExpr(LambdaExpr), 1347 ClosureExpr(ClosureExpr),
1355 Literal(Literal), 1348 Literal(Literal),
1356 LoopExpr(LoopExpr), 1349 LoopExpr(LoopExpr),
1357 MacroCall(MacroCall), 1350 MacroCall(MacroCall),
@@ -2101,8 +2094,8 @@ impl AstNode for Label {
2101 } 2094 }
2102 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2095 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2103} 2096}
2104impl AstNode for LambdaExpr { 2097impl AstNode for ClosureExpr {
2105 fn can_cast(kind: SyntaxKind) -> bool { kind == LAMBDA_EXPR } 2098 fn can_cast(kind: SyntaxKind) -> bool { kind == CLOSURE_EXPR }
2106 fn cast(syntax: SyntaxNode) -> Option<Self> { 2099 fn cast(syntax: SyntaxNode) -> Option<Self> {
2107 if Self::can_cast(syntax.kind()) { 2100 if Self::can_cast(syntax.kind()) {
2108 Some(Self { syntax }) 2101 Some(Self { syntax })
@@ -3114,8 +3107,8 @@ impl From<IndexExpr> for Expr {
3114impl From<Label> for Expr { 3107impl From<Label> for Expr {
3115 fn from(node: Label) -> Expr { Expr::Label(node) } 3108 fn from(node: Label) -> Expr { Expr::Label(node) }
3116} 3109}
3117impl From<LambdaExpr> for Expr { 3110impl From<ClosureExpr> for Expr {
3118 fn from(node: LambdaExpr) -> Expr { Expr::LambdaExpr(node) } 3111 fn from(node: ClosureExpr) -> Expr { Expr::ClosureExpr(node) }
3119} 3112}
3120impl From<Literal> for Expr { 3113impl From<Literal> for Expr {
3121 fn from(node: Literal) -> Expr { Expr::Literal(node) } 3114 fn from(node: Literal) -> Expr { Expr::Literal(node) }
@@ -3167,7 +3160,7 @@ impl AstNode for Expr {
3167 match kind { 3160 match kind {
3168 ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR 3161 ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR
3169 | CAST_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR | IF_EXPR 3162 | CAST_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR | IF_EXPR
3170 | INDEX_EXPR | LABEL | LAMBDA_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MATCH_EXPR 3163 | INDEX_EXPR | LABEL | CLOSURE_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MATCH_EXPR
3171 | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR 3164 | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
3172 | RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR => true, 3165 | RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR => true,
3173 _ => false, 3166 _ => false,
@@ -3190,7 +3183,7 @@ impl AstNode for Expr {
3190 IF_EXPR => Expr::IfExpr(IfExpr { syntax }), 3183 IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
3191 INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }), 3184 INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }),
3192 LABEL => Expr::Label(Label { syntax }), 3185 LABEL => Expr::Label(Label { syntax }),
3193 LAMBDA_EXPR => Expr::LambdaExpr(LambdaExpr { syntax }), 3186 CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
3194 LITERAL => Expr::Literal(Literal { syntax }), 3187 LITERAL => Expr::Literal(Literal { syntax }),
3195 LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }), 3188 LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
3196 MACRO_CALL => Expr::MacroCall(MacroCall { syntax }), 3189 MACRO_CALL => Expr::MacroCall(MacroCall { syntax }),
@@ -3227,7 +3220,7 @@ impl AstNode for Expr {
3227 Expr::IfExpr(it) => &it.syntax, 3220 Expr::IfExpr(it) => &it.syntax,
3228 Expr::IndexExpr(it) => &it.syntax, 3221 Expr::IndexExpr(it) => &it.syntax,
3229 Expr::Label(it) => &it.syntax, 3222 Expr::Label(it) => &it.syntax,
3230 Expr::LambdaExpr(it) => &it.syntax, 3223 Expr::ClosureExpr(it) => &it.syntax,
3231 Expr::Literal(it) => &it.syntax, 3224 Expr::Literal(it) => &it.syntax,
3232 Expr::LoopExpr(it) => &it.syntax, 3225 Expr::LoopExpr(it) => &it.syntax,
3233 Expr::MacroCall(it) => &it.syntax, 3226 Expr::MacroCall(it) => &it.syntax,
@@ -3757,7 +3750,7 @@ impl std::fmt::Display for Label {
3757 std::fmt::Display::fmt(self.syntax(), f) 3750 std::fmt::Display::fmt(self.syntax(), f)
3758 } 3751 }
3759} 3752}
3760impl std::fmt::Display for LambdaExpr { 3753impl std::fmt::Display for ClosureExpr {
3761 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3754 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3762 std::fmt::Display::fmt(self.syntax(), f) 3755 std::fmt::Display::fmt(self.syntax(), f)
3763 } 3756 }