diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 15:24:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 15:24:20 +0100 |
commit | 282702c2877e3f9002308b1b63fc472b5e799c56 (patch) | |
tree | e8ddcc0575b012ab6e8fd099746f571cc4bf304c /crates/ra_syntax/src/ast/generated | |
parent | 323fd64abde2aced9427e4470b626a898b80a783 (diff) | |
parent | 6f8aa75329d0a4e588e58b8f22f7932bf3d3a706 (diff) |
Merge #5595
5595: Rename RecordLit -> RecordExpr r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/generated')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index efe0cbe3a..9f9c06e50 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -909,30 +909,32 @@ impl MatchGuard { | |||
909 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 909 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
910 | } | 910 | } |
911 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 911 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
912 | pub struct RecordLit { | 912 | pub struct RecordExpr { |
913 | pub(crate) syntax: SyntaxNode, | 913 | pub(crate) syntax: SyntaxNode, |
914 | } | 914 | } |
915 | impl RecordLit { | 915 | impl RecordExpr { |
916 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 916 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
917 | pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) } | 917 | pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> { |
918 | support::child(&self.syntax) | ||
919 | } | ||
918 | } | 920 | } |
919 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 921 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
920 | pub struct RecordFieldList { | 922 | pub struct RecordExprFieldList { |
921 | pub(crate) syntax: SyntaxNode, | 923 | pub(crate) syntax: SyntaxNode, |
922 | } | 924 | } |
923 | impl RecordFieldList { | 925 | impl RecordExprFieldList { |
924 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 926 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
925 | pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) } | 927 | pub fn fields(&self) -> AstChildren<RecordExprField> { support::children(&self.syntax) } |
926 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } | 928 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
927 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } | 929 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } |
928 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 930 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
929 | } | 931 | } |
930 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 932 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
931 | pub struct RecordField { | 933 | pub struct RecordExprField { |
932 | pub(crate) syntax: SyntaxNode, | 934 | pub(crate) syntax: SyntaxNode, |
933 | } | 935 | } |
934 | impl ast::AttrsOwner for RecordField {} | 936 | impl ast::AttrsOwner for RecordExprField {} |
935 | impl RecordField { | 937 | impl RecordExprField { |
936 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 938 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
937 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 939 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
938 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 940 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
@@ -1345,7 +1347,7 @@ pub enum Expr { | |||
1345 | BlockExpr(BlockExpr), | 1347 | BlockExpr(BlockExpr), |
1346 | ReturnExpr(ReturnExpr), | 1348 | ReturnExpr(ReturnExpr), |
1347 | MatchExpr(MatchExpr), | 1349 | MatchExpr(MatchExpr), |
1348 | RecordLit(RecordLit), | 1350 | RecordExpr(RecordExpr), |
1349 | CallExpr(CallExpr), | 1351 | CallExpr(CallExpr), |
1350 | IndexExpr(IndexExpr), | 1352 | IndexExpr(IndexExpr), |
1351 | MethodCallExpr(MethodCallExpr), | 1353 | MethodCallExpr(MethodCallExpr), |
@@ -2357,8 +2359,8 @@ impl AstNode for MatchGuard { | |||
2357 | } | 2359 | } |
2358 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2360 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2359 | } | 2361 | } |
2360 | impl AstNode for RecordLit { | 2362 | impl AstNode for RecordExpr { |
2361 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_LIT } | 2363 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR } |
2362 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2364 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2363 | if Self::can_cast(syntax.kind()) { | 2365 | if Self::can_cast(syntax.kind()) { |
2364 | Some(Self { syntax }) | 2366 | Some(Self { syntax }) |
@@ -2368,8 +2370,8 @@ impl AstNode for RecordLit { | |||
2368 | } | 2370 | } |
2369 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2371 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2370 | } | 2372 | } |
2371 | impl AstNode for RecordFieldList { | 2373 | impl AstNode for RecordExprFieldList { |
2372 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_LIST } | 2374 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD_LIST } |
2373 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2375 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2374 | if Self::can_cast(syntax.kind()) { | 2376 | if Self::can_cast(syntax.kind()) { |
2375 | Some(Self { syntax }) | 2377 | Some(Self { syntax }) |
@@ -2379,8 +2381,8 @@ impl AstNode for RecordFieldList { | |||
2379 | } | 2381 | } |
2380 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2382 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2381 | } | 2383 | } |
2382 | impl AstNode for RecordField { | 2384 | impl AstNode for RecordExprField { |
2383 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD } | 2385 | fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_EXPR_FIELD } |
2384 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2386 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2385 | if Self::can_cast(syntax.kind()) { | 2387 | if Self::can_cast(syntax.kind()) { |
2386 | Some(Self { syntax }) | 2388 | Some(Self { syntax }) |
@@ -3119,8 +3121,8 @@ impl From<ReturnExpr> for Expr { | |||
3119 | impl From<MatchExpr> for Expr { | 3121 | impl From<MatchExpr> for Expr { |
3120 | fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) } | 3122 | fn from(node: MatchExpr) -> Expr { Expr::MatchExpr(node) } |
3121 | } | 3123 | } |
3122 | impl From<RecordLit> for Expr { | 3124 | impl From<RecordExpr> for Expr { |
3123 | fn from(node: RecordLit) -> Expr { Expr::RecordLit(node) } | 3125 | fn from(node: RecordExpr) -> Expr { Expr::RecordExpr(node) } |
3124 | } | 3126 | } |
3125 | impl From<CallExpr> for Expr { | 3127 | impl From<CallExpr> for Expr { |
3126 | fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) } | 3128 | fn from(node: CallExpr) -> Expr { Expr::CallExpr(node) } |
@@ -3172,7 +3174,7 @@ impl AstNode for Expr { | |||
3172 | match kind { | 3174 | match kind { |
3173 | TUPLE_EXPR | ARRAY_EXPR | PAREN_EXPR | PATH_EXPR | LAMBDA_EXPR | IF_EXPR | 3175 | TUPLE_EXPR | ARRAY_EXPR | PAREN_EXPR | PATH_EXPR | LAMBDA_EXPR | IF_EXPR |
3174 | | LOOP_EXPR | FOR_EXPR | WHILE_EXPR | CONTINUE_EXPR | BREAK_EXPR | LABEL | 3176 | | LOOP_EXPR | FOR_EXPR | WHILE_EXPR | CONTINUE_EXPR | BREAK_EXPR | LABEL |
3175 | | BLOCK_EXPR | RETURN_EXPR | MATCH_EXPR | RECORD_LIT | CALL_EXPR | INDEX_EXPR | 3177 | | BLOCK_EXPR | RETURN_EXPR | MATCH_EXPR | RECORD_EXPR | CALL_EXPR | INDEX_EXPR |
3176 | | METHOD_CALL_EXPR | FIELD_EXPR | AWAIT_EXPR | TRY_EXPR | EFFECT_EXPR | CAST_EXPR | 3178 | | METHOD_CALL_EXPR | FIELD_EXPR | AWAIT_EXPR | TRY_EXPR | EFFECT_EXPR | CAST_EXPR |
3177 | | REF_EXPR | PREFIX_EXPR | RANGE_EXPR | BIN_EXPR | LITERAL | MACRO_CALL | BOX_EXPR => { | 3179 | | REF_EXPR | PREFIX_EXPR | RANGE_EXPR | BIN_EXPR | LITERAL | MACRO_CALL | BOX_EXPR => { |
3178 | true | 3180 | true |
@@ -3197,7 +3199,7 @@ impl AstNode for Expr { | |||
3197 | BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }), | 3199 | BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }), |
3198 | RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }), | 3200 | RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }), |
3199 | MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }), | 3201 | MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }), |
3200 | RECORD_LIT => Expr::RecordLit(RecordLit { syntax }), | 3202 | RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }), |
3201 | CALL_EXPR => Expr::CallExpr(CallExpr { syntax }), | 3203 | CALL_EXPR => Expr::CallExpr(CallExpr { syntax }), |
3202 | INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }), | 3204 | INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }), |
3203 | METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }), | 3205 | METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }), |
@@ -3234,7 +3236,7 @@ impl AstNode for Expr { | |||
3234 | Expr::BlockExpr(it) => &it.syntax, | 3236 | Expr::BlockExpr(it) => &it.syntax, |
3235 | Expr::ReturnExpr(it) => &it.syntax, | 3237 | Expr::ReturnExpr(it) => &it.syntax, |
3236 | Expr::MatchExpr(it) => &it.syntax, | 3238 | Expr::MatchExpr(it) => &it.syntax, |
3237 | Expr::RecordLit(it) => &it.syntax, | 3239 | Expr::RecordExpr(it) => &it.syntax, |
3238 | Expr::CallExpr(it) => &it.syntax, | 3240 | Expr::CallExpr(it) => &it.syntax, |
3239 | Expr::IndexExpr(it) => &it.syntax, | 3241 | Expr::IndexExpr(it) => &it.syntax, |
3240 | Expr::MethodCallExpr(it) => &it.syntax, | 3242 | Expr::MethodCallExpr(it) => &it.syntax, |
@@ -3893,17 +3895,17 @@ impl std::fmt::Display for MatchGuard { | |||
3893 | std::fmt::Display::fmt(self.syntax(), f) | 3895 | std::fmt::Display::fmt(self.syntax(), f) |
3894 | } | 3896 | } |
3895 | } | 3897 | } |
3896 | impl std::fmt::Display for RecordLit { | 3898 | impl std::fmt::Display for RecordExpr { |
3897 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3899 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3898 | std::fmt::Display::fmt(self.syntax(), f) | 3900 | std::fmt::Display::fmt(self.syntax(), f) |
3899 | } | 3901 | } |
3900 | } | 3902 | } |
3901 | impl std::fmt::Display for RecordFieldList { | 3903 | impl std::fmt::Display for RecordExprFieldList { |
3902 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3904 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3903 | std::fmt::Display::fmt(self.syntax(), f) | 3905 | std::fmt::Display::fmt(self.syntax(), f) |
3904 | } | 3906 | } |
3905 | } | 3907 | } |
3906 | impl std::fmt::Display for RecordField { | 3908 | impl std::fmt::Display for RecordExprField { |
3907 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3909 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3908 | std::fmt::Display::fmt(self.syntax(), f) | 3910 | std::fmt::Display::fmt(self.syntax(), f) |
3909 | } | 3911 | } |