diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2018-07-21 18:47:02 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2018-08-19 16:30:53 -0700 |
| commit | f2445fb5075fa35d9b387d40bf6053007e63361e (patch) | |
| tree | 82c5b10a462c2a0ab686b5913d7c8a1c564f8bf9 /src/libsyntax | |
| parent | f28f648a9699db67b86735f97d609c3dd06f9ded (diff) | |
| download | rust-f2445fb5075fa35d9b387d40bf6053007e63361e.tar.gz rust-f2445fb5075fa35d9b387d40bf6053007e63361e.zip | |
Rename `Catch` variants to `TryBlock`
(Not `Try` since `QuestionMark` is using that.)
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/classify.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/util/parser.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 2 |
8 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index e53f3ea9036..0f2afde8f9e 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -987,7 +987,7 @@ impl Expr { ExprKind::Match(..) => ExprPrecedence::Match, ExprKind::Closure(..) => ExprPrecedence::Closure, ExprKind::Block(..) => ExprPrecedence::Block, - ExprKind::Catch(..) => ExprPrecedence::Catch, + ExprKind::TryBlock(..) => ExprPrecedence::TryBlock, ExprKind::Async(..) => ExprPrecedence::Async, ExprKind::Assign(..) => ExprPrecedence::Assign, ExprKind::AssignOp(..) => ExprPrecedence::AssignOp, @@ -1108,8 +1108,8 @@ pub enum ExprKind { /// created during lowering cannot be made the parent of any other /// preexisting defs. Async(CaptureBy, NodeId, P<Block>), - /// A catch block (`catch { ... }`) - Catch(P<Block>), + /// A try block (`try { ... }`) + TryBlock(P<Block>), /// An assignment (`a = foo()`) Assign(P<Expr>, P<Expr>), diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index e8245a553eb..32769130940 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1734,7 +1734,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { e.span, "yield syntax is experimental"); } - ast::ExprKind::Catch(_) => { + ast::ExprKind::TryBlock(_) => { gate_feature_post!(&self, catch_expr, e.span, "`catch` expression is experimental"); } ast::ExprKind::IfLet(ref pats, ..) | ast::ExprKind::WhileLet(ref pats, ..) => { diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 3209939d9b1..632dd5c3309 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -1351,7 +1351,7 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span, attrs}: Expr, folder: &mu } ExprKind::Yield(ex) => ExprKind::Yield(ex.map(|x| folder.fold_expr(x))), ExprKind::Try(ex) => ExprKind::Try(folder.fold_expr(ex)), - ExprKind::Catch(body) => ExprKind::Catch(folder.fold_block(body)), + ExprKind::TryBlock(body) => ExprKind::TryBlock(folder.fold_block(body)), }, id: folder.new_id(id), span: folder.new_span(span), diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs index 531483e7de1..99f9d0511fe 100644 --- a/src/libsyntax/parse/classify.rs +++ b/src/libsyntax/parse/classify.rs @@ -31,7 +31,7 @@ pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool { ast::ExprKind::WhileLet(..) | ast::ExprKind::Loop(..) | ast::ExprKind::ForLoop(..) | - ast::ExprKind::Catch(..) => false, + ast::ExprKind::TryBlock(..) => false, _ => true, } } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 345464c6664..fdb9f80b7c6 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3458,7 +3458,7 @@ impl<'a> Parser<'a> { { let (iattrs, body) = self.parse_inner_attrs_and_block()?; attrs.extend(iattrs); - Ok(self.mk_expr(span_lo.to(body.span), ExprKind::Catch(body), attrs)) + Ok(self.mk_expr(span_lo.to(body.span), ExprKind::TryBlock(body), attrs)) } // `match` token already eaten diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 54ce06f61ef..f8d01fee950 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2379,7 +2379,7 @@ impl<'a> State<'a> { self.print_expr_maybe_paren(e, parser::PREC_POSTFIX)?; self.s.word("?")? } - ast::ExprKind::Catch(ref blk) => { + ast::ExprKind::TryBlock(ref blk) => { self.head("do catch")?; self.s.space()?; self.print_block_with_attrs(blk, attrs)? diff --git a/src/libsyntax/util/parser.rs b/src/libsyntax/util/parser.rs index 67bc6f947b5..6866806cd7c 100644 --- a/src/libsyntax/util/parser.rs +++ b/src/libsyntax/util/parser.rs @@ -273,7 +273,7 @@ pub enum ExprPrecedence { Loop, Match, Block, - Catch, + TryBlock, Struct, Async, } @@ -332,7 +332,7 @@ impl ExprPrecedence { ExprPrecedence::Loop | ExprPrecedence::Match | ExprPrecedence::Block | - ExprPrecedence::Catch | + ExprPrecedence::TryBlock | ExprPrecedence::Async | ExprPrecedence::Struct => PREC_PAREN, } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 51be129737e..e57d692faae 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -809,7 +809,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) { ExprKind::Try(ref subexpression) => { visitor.visit_expr(subexpression) } - ExprKind::Catch(ref body) => { + ExprKind::TryBlock(ref body) => { visitor.visit_block(body) } } |
