diff options
Diffstat (limited to 'crates/syntax/src')
-rw-r--r-- | crates/syntax/src/ast/generated/nodes.rs | 10 | ||||
-rw-r--r-- | crates/syntax/src/parsing/text_tree_sink.rs | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs index 064931aec..6097178b6 100644 --- a/crates/syntax/src/ast/generated/nodes.rs +++ b/crates/syntax/src/ast/generated/nodes.rs | |||
@@ -1336,6 +1336,7 @@ pub enum Expr { | |||
1336 | Literal(Literal), | 1336 | Literal(Literal), |
1337 | LoopExpr(LoopExpr), | 1337 | LoopExpr(LoopExpr), |
1338 | MacroCall(MacroCall), | 1338 | MacroCall(MacroCall), |
1339 | MacroStmts(MacroStmts), | ||
1339 | MatchExpr(MatchExpr), | 1340 | MatchExpr(MatchExpr), |
1340 | MethodCallExpr(MethodCallExpr), | 1341 | MethodCallExpr(MethodCallExpr), |
1341 | ParenExpr(ParenExpr), | 1342 | ParenExpr(ParenExpr), |
@@ -3034,6 +3035,9 @@ impl From<LoopExpr> for Expr { | |||
3034 | impl From<MacroCall> for Expr { | 3035 | impl From<MacroCall> for Expr { |
3035 | fn from(node: MacroCall) -> Expr { Expr::MacroCall(node) } | 3036 | fn from(node: MacroCall) -> Expr { Expr::MacroCall(node) } |
3036 | } | 3037 | } |
3038 | impl From<MacroStmts> for Expr { | ||
3039 | fn from(node: MacroStmts) -> Expr { Expr::MacroStmts(node) } | ||
3040 | } | ||
3037 | impl From<MatchExpr> for Expr { | 3041 | impl From<MatchExpr> for Expr { |
3038 | fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) } | 3042 | fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) } |
3039 | } | 3043 | } |
@@ -3078,8 +3082,8 @@ impl AstNode for Expr { | |||
3078 | match kind { | 3082 | match kind { |
3079 | ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR | 3083 | ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR |
3080 | | CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR | 3084 | | CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR |
3081 | | IF_EXPR | INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MATCH_EXPR | 3085 | | IF_EXPR | INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MACRO_STMTS |
3082 | | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR | 3086 | | MATCH_EXPR | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR |
3083 | | RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR | 3087 | | RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR |
3084 | | YIELD_EXPR => true, | 3088 | | YIELD_EXPR => true, |
3085 | _ => false, | 3089 | _ => false, |
@@ -3105,6 +3109,7 @@ impl AstNode for Expr { | |||
3105 | LITERAL => Expr::Literal(Literal { syntax }), | 3109 | LITERAL => Expr::Literal(Literal { syntax }), |
3106 | LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }), | 3110 | LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }), |
3107 | MACRO_CALL => Expr::MacroCall(MacroCall { syntax }), | 3111 | MACRO_CALL => Expr::MacroCall(MacroCall { syntax }), |
3112 | MACRO_STMTS => Expr::MacroStmts(MacroStmts { syntax }), | ||
3108 | MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }), | 3113 | MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }), |
3109 | METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }), | 3114 | METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }), |
3110 | PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }), | 3115 | PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }), |
@@ -3142,6 +3147,7 @@ impl AstNode for Expr { | |||
3142 | Expr::Literal(it) => &it.syntax, | 3147 | Expr::Literal(it) => &it.syntax, |
3143 | Expr::LoopExpr(it) => &it.syntax, | 3148 | Expr::LoopExpr(it) => &it.syntax, |
3144 | Expr::MacroCall(it) => &it.syntax, | 3149 | Expr::MacroCall(it) => &it.syntax, |
3150 | Expr::MacroStmts(it) => &it.syntax, | ||
3145 | Expr::MatchExpr(it) => &it.syntax, | 3151 | Expr::MatchExpr(it) => &it.syntax, |
3146 | Expr::MethodCallExpr(it) => &it.syntax, | 3152 | Expr::MethodCallExpr(it) => &it.syntax, |
3147 | Expr::ParenExpr(it) => &it.syntax, | 3153 | Expr::ParenExpr(it) => &it.syntax, |
diff --git a/crates/syntax/src/parsing/text_tree_sink.rs b/crates/syntax/src/parsing/text_tree_sink.rs index d5ddc076f..bb10f20c9 100644 --- a/crates/syntax/src/parsing/text_tree_sink.rs +++ b/crates/syntax/src/parsing/text_tree_sink.rs | |||
@@ -147,8 +147,8 @@ fn n_attached_trivias<'a>( | |||
147 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, | 147 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, |
148 | ) -> usize { | 148 | ) -> usize { |
149 | match kind { | 149 | match kind { |
150 | MACRO_CALL | MACRO_RULES | CONST | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT | 150 | MACRO_CALL | MACRO_RULES | CONST | TYPE_ALIAS | STRUCT | UNION | ENUM | VARIANT | FN |
151 | | MODULE | RECORD_FIELD | STATIC | USE => { | 151 | | TRAIT | MODULE | RECORD_FIELD | STATIC | USE => { |
152 | let mut res = 0; | 152 | let mut res = 0; |
153 | let mut trivias = trivias.enumerate().peekable(); | 153 | let mut trivias = trivias.enumerate().peekable(); |
154 | 154 | ||