diff options
author | Benjamin Coenen <[email protected]> | 2020-05-01 15:26:30 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-05-01 15:26:30 +0100 |
commit | dc34162450797f5756ce2b44f1a3fe73d8e2dce4 (patch) | |
tree | 0883abc2d87f8b9704b49f5662da04b73ffedbf6 /crates/ra_syntax/src/ast/generated | |
parent | bbe22640b8d52354c3de3e126c9fcda5b1b174fd (diff) | |
parent | a5f2b16366f027ad60c58266a66eb7fbdcbda9f9 (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
Diffstat (limited to 'crates/ra_syntax/src/ast/generated')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 2cb3ad011..81260680f 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -476,16 +476,6 @@ impl LoopExpr { | |||
476 | } | 476 | } |
477 | 477 | ||
478 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 478 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
479 | pub struct TryBlockExpr { | ||
480 | pub(crate) syntax: SyntaxNode, | ||
481 | } | ||
482 | impl ast::AttrsOwner for TryBlockExpr {} | ||
483 | impl TryBlockExpr { | ||
484 | pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) } | ||
485 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } | ||
486 | } | ||
487 | |||
488 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
489 | pub struct ForExpr { | 479 | pub struct ForExpr { |
490 | pub(crate) syntax: SyntaxNode, | 480 | pub(crate) syntax: SyntaxNode, |
491 | } | 481 | } |
@@ -554,6 +544,7 @@ impl ast::AttrsOwner for BlockExpr {} | |||
554 | impl BlockExpr { | 544 | impl BlockExpr { |
555 | pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } | 545 | pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } |
556 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 546 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
547 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } | ||
557 | pub fn block(&self) -> Option<Block> { support::child(&self.syntax) } | 548 | pub fn block(&self) -> Option<Block> { support::child(&self.syntax) } |
558 | } | 549 | } |
559 | 550 | ||
@@ -1249,6 +1240,7 @@ pub struct PathSegment { | |||
1249 | } | 1240 | } |
1250 | impl PathSegment { | 1241 | impl PathSegment { |
1251 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } | 1242 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
1243 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } | ||
1252 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } | 1244 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
1253 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 1245 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
1254 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } | 1246 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } |
@@ -1473,7 +1465,6 @@ pub enum Expr { | |||
1473 | FieldExpr(FieldExpr), | 1465 | FieldExpr(FieldExpr), |
1474 | AwaitExpr(AwaitExpr), | 1466 | AwaitExpr(AwaitExpr), |
1475 | TryExpr(TryExpr), | 1467 | TryExpr(TryExpr), |
1476 | TryBlockExpr(TryBlockExpr), | ||
1477 | CastExpr(CastExpr), | 1468 | CastExpr(CastExpr), |
1478 | RefExpr(RefExpr), | 1469 | RefExpr(RefExpr), |
1479 | PrefixExpr(PrefixExpr), | 1470 | PrefixExpr(PrefixExpr), |
@@ -1956,17 +1947,6 @@ impl AstNode for LoopExpr { | |||
1956 | } | 1947 | } |
1957 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1948 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1958 | } | 1949 | } |
1959 | impl AstNode for TryBlockExpr { | ||
1960 | fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_BLOCK_EXPR } | ||
1961 | fn cast(syntax: SyntaxNode) -> Option<Self> { | ||
1962 | if Self::can_cast(syntax.kind()) { | ||
1963 | Some(Self { syntax }) | ||
1964 | } else { | ||
1965 | None | ||
1966 | } | ||
1967 | } | ||
1968 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
1969 | } | ||
1970 | impl AstNode for ForExpr { | 1950 | impl AstNode for ForExpr { |
1971 | fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_EXPR } | 1951 | fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_EXPR } |
1972 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1952 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
@@ -3308,9 +3288,6 @@ impl From<AwaitExpr> for Expr { | |||
3308 | impl From<TryExpr> for Expr { | 3288 | impl From<TryExpr> for Expr { |
3309 | fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) } | 3289 | fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) } |
3310 | } | 3290 | } |
3311 | impl From<TryBlockExpr> for Expr { | ||
3312 | fn from(node: TryBlockExpr) -> Expr { Expr::TryBlockExpr(node) } | ||
3313 | } | ||
3314 | impl From<CastExpr> for Expr { | 3291 | impl From<CastExpr> for Expr { |
3315 | fn from(node: CastExpr) -> Expr { Expr::CastExpr(node) } | 3292 | fn from(node: CastExpr) -> Expr { Expr::CastExpr(node) } |
3316 | } | 3293 | } |
@@ -3341,9 +3318,8 @@ impl AstNode for Expr { | |||
3341 | TUPLE_EXPR | ARRAY_EXPR | PAREN_EXPR | PATH_EXPR | LAMBDA_EXPR | IF_EXPR | 3318 | TUPLE_EXPR | ARRAY_EXPR | PAREN_EXPR | PATH_EXPR | LAMBDA_EXPR | IF_EXPR |
3342 | | LOOP_EXPR | FOR_EXPR | WHILE_EXPR | CONTINUE_EXPR | BREAK_EXPR | LABEL | 3319 | | LOOP_EXPR | FOR_EXPR | WHILE_EXPR | CONTINUE_EXPR | BREAK_EXPR | LABEL |
3343 | | BLOCK_EXPR | RETURN_EXPR | MATCH_EXPR | RECORD_LIT | CALL_EXPR | INDEX_EXPR | 3320 | | BLOCK_EXPR | RETURN_EXPR | MATCH_EXPR | RECORD_LIT | CALL_EXPR | INDEX_EXPR |
3344 | | METHOD_CALL_EXPR | FIELD_EXPR | AWAIT_EXPR | TRY_EXPR | TRY_BLOCK_EXPR | 3321 | | METHOD_CALL_EXPR | FIELD_EXPR | AWAIT_EXPR | TRY_EXPR | CAST_EXPR | REF_EXPR |
3345 | | CAST_EXPR | REF_EXPR | PREFIX_EXPR | RANGE_EXPR | BIN_EXPR | LITERAL | MACRO_CALL | 3322 | | PREFIX_EXPR | RANGE_EXPR | BIN_EXPR | LITERAL | MACRO_CALL | BOX_EXPR => true, |
3346 | | BOX_EXPR => true, | ||
3347 | _ => false, | 3323 | _ => false, |
3348 | } | 3324 | } |
3349 | } | 3325 | } |
@@ -3371,7 +3347,6 @@ impl AstNode for Expr { | |||
3371 | FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }), | 3347 | FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }), |
3372 | AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }), | 3348 | AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }), |
3373 | TRY_EXPR => Expr::TryExpr(TryExpr { syntax }), | 3349 | TRY_EXPR => Expr::TryExpr(TryExpr { syntax }), |
3374 | TRY_BLOCK_EXPR => Expr::TryBlockExpr(TryBlockExpr { syntax }), | ||
3375 | CAST_EXPR => Expr::CastExpr(CastExpr { syntax }), | 3350 | CAST_EXPR => Expr::CastExpr(CastExpr { syntax }), |
3376 | REF_EXPR => Expr::RefExpr(RefExpr { syntax }), | 3351 | REF_EXPR => Expr::RefExpr(RefExpr { syntax }), |
3377 | PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }), | 3352 | PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }), |
@@ -3408,7 +3383,6 @@ impl AstNode for Expr { | |||
3408 | Expr::FieldExpr(it) => &it.syntax, | 3383 | Expr::FieldExpr(it) => &it.syntax, |
3409 | Expr::AwaitExpr(it) => &it.syntax, | 3384 | Expr::AwaitExpr(it) => &it.syntax, |
3410 | Expr::TryExpr(it) => &it.syntax, | 3385 | Expr::TryExpr(it) => &it.syntax, |
3411 | Expr::TryBlockExpr(it) => &it.syntax, | ||
3412 | Expr::CastExpr(it) => &it.syntax, | 3386 | Expr::CastExpr(it) => &it.syntax, |
3413 | Expr::RefExpr(it) => &it.syntax, | 3387 | Expr::RefExpr(it) => &it.syntax, |
3414 | Expr::PrefixExpr(it) => &it.syntax, | 3388 | Expr::PrefixExpr(it) => &it.syntax, |
@@ -3889,11 +3863,6 @@ impl std::fmt::Display for LoopExpr { | |||
3889 | std::fmt::Display::fmt(self.syntax(), f) | 3863 | std::fmt::Display::fmt(self.syntax(), f) |
3890 | } | 3864 | } |
3891 | } | 3865 | } |
3892 | impl std::fmt::Display for TryBlockExpr { | ||
3893 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
3894 | std::fmt::Display::fmt(self.syntax(), f) | ||
3895 | } | ||
3896 | } | ||
3897 | impl std::fmt::Display for ForExpr { | 3866 | impl std::fmt::Display for ForExpr { |
3898 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 3867 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { |
3899 | std::fmt::Display::fmt(self.syntax(), f) | 3868 | std::fmt::Display::fmt(self.syntax(), f) |