diff options
| author | varkor <github@varkor.com> | 2019-09-26 17:34:50 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-09-26 18:21:10 +0100 |
| commit | 21bf983acbb5d7ac8fb9462cbf2cc4c280abd857 (patch) | |
| tree | a92c4cc5a421c256847c345f861bee2b074c89ae /src/libsyntax/parse/parser | |
| parent | c3d8791373005ef08c876aa649ede245efd2352d (diff) | |
| download | rust-21bf983acbb5d7ac8fb9462cbf2cc4c280abd857.tar.gz rust-21bf983acbb5d7ac8fb9462cbf2cc4c280abd857.zip | |
Rename `Stmt.node` to `Stmt.kind`
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/stmt.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/parse/parser/stmt.rs b/src/libsyntax/parse/parser/stmt.rs index 02da56f6e35..855b03ddd6f 100644 --- a/src/libsyntax/parse/parser/stmt.rs +++ b/src/libsyntax/parse/parser/stmt.rs @@ -44,7 +44,7 @@ impl<'a> Parser<'a> { Ok(Some(if self.eat_keyword(kw::Let) { Stmt { id: DUMMY_NODE_ID, - node: StmtKind::Local(self.parse_local(attrs.into())?), + kind: StmtKind::Local(self.parse_local(attrs.into())?), span: lo.to(self.prev_span), } } else if let Some(macro_def) = self.eat_macro_def( @@ -54,7 +54,7 @@ impl<'a> Parser<'a> { )? { Stmt { id: DUMMY_NODE_ID, - node: StmtKind::Item(macro_def), + kind: StmtKind::Item(macro_def), span: lo.to(self.prev_span), } // Starts like a simple path, being careful to avoid contextual keywords @@ -86,7 +86,7 @@ impl<'a> Parser<'a> { return Ok(Some(Stmt { id: DUMMY_NODE_ID, - node: StmtKind::Expr(expr), + kind: StmtKind::Expr(expr), span: lo.to(self.prev_span), })); } @@ -107,7 +107,7 @@ impl<'a> Parser<'a> { span: lo.to(hi), prior_type_ascription: self.last_type_ascription, }; - let node = if delim == MacDelimiter::Brace || + let kind = if delim == MacDelimiter::Brace || self.token == token::Semi || self.token == token::Eof { StmtKind::Mac(P((mac, style, attrs.into()))) } @@ -137,7 +137,7 @@ impl<'a> Parser<'a> { Stmt { id: DUMMY_NODE_ID, span: lo.to(hi), - node, + kind, } } else { // FIXME: Bad copy of attrs @@ -150,7 +150,7 @@ impl<'a> Parser<'a> { Some(i) => Stmt { id: DUMMY_NODE_ID, span: lo.to(i.span), - node: StmtKind::Item(i), + kind: StmtKind::Item(i), }, None => { let unused_attrs = |attrs: &[Attribute], s: &mut Self| { @@ -180,7 +180,7 @@ impl<'a> Parser<'a> { return Ok(Some(Stmt { id: DUMMY_NODE_ID, span: lo.to(last_semi), - node: StmtKind::Semi(self.mk_expr(lo.to(last_semi), + kind: StmtKind::Semi(self.mk_expr(lo.to(last_semi), ExprKind::Tup(Vec::new()), ThinVec::new() )), @@ -198,7 +198,7 @@ impl<'a> Parser<'a> { Stmt { id: DUMMY_NODE_ID, span: lo.to(e.span), - node: StmtKind::Expr(e), + kind: StmtKind::Expr(e), } } } @@ -400,7 +400,7 @@ impl<'a> Parser<'a> { self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Ignore); Some(Stmt { id: DUMMY_NODE_ID, - node: StmtKind::Expr(DummyResult::raw_expr(self.token.span, true)), + kind: StmtKind::Expr(DummyResult::raw_expr(self.token.span, true)), span: self.token.span, }) } @@ -431,7 +431,7 @@ impl<'a> Parser<'a> { None => return Ok(None), }; - match stmt.node { + match stmt.kind { StmtKind::Expr(ref expr) if self.token != token::Eof => { // expression without semicolon if classify::expr_requires_semi_to_be_stmt(expr) { @@ -443,7 +443,7 @@ impl<'a> Parser<'a> { self.recover_stmt(); // Don't complain about type errors in body tail after parse error (#57383). let sp = expr.span.to(self.prev_span); - stmt.node = StmtKind::Expr(DummyResult::raw_expr(sp, true)); + stmt.kind = StmtKind::Expr(DummyResult::raw_expr(sp, true)); } } } |
