diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-08-24 21:03:51 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-08-24 22:28:12 -0700 |
| commit | 5e22fb9c7f94c76e1e7e17709884198ec4ba3fcb (patch) | |
| tree | 3f8504b434daa0eea689faf3c09177ccd551d545 /src/libsyntax | |
| parent | c7a3d0eb5820e63225b45a2e2c8c4e9b8f658601 (diff) | |
Remove match check
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/auto_serialize.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 2 |
6 files changed, 8 insertions, 11 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 22f696d6ed8..2bd08d2b282 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -348,7 +348,7 @@ enum expr_ { Same semantics as while(true) { body }, but typestate knows that the (implicit) condition is always true. */ expr_loop(blk, option<ident>), - expr_match(@expr, ~[arm], alt_mode), + expr_match(@expr, ~[arm]), expr_fn(proto, fn_decl, blk, capture_clause), expr_fn_block(fn_decl, blk, capture_clause), // Inner expr is always an expr_fn_block. We need the wrapping node to diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs index beb255d2cb6..f95a689f9c2 100644 --- a/src/libsyntax/ext/auto_serialize.rs +++ b/src/libsyntax/ext/auto_serialize.rs @@ -250,7 +250,7 @@ impl ext_ctxt: ext_ctxt_helpers { self.stmt( self.expr( span, - ast::expr_match(v, arms, ast::alt_exhaustive))) + ast::expr_match(v, arms))) } fn lit_str(span: span, s: @~str) -> @ast::expr { @@ -944,7 +944,7 @@ fn deser_enum(cx: ext_ctxt, tps: deser_tps_map, e_name: ast::ident, // Generate code like: let e_name = cx.lit_str(e_span, @cx.str_of(e_name)); let alt_expr = cx.expr(e_span, - ast::expr_match(#ast{__i}, arms, ast::alt_exhaustive)); + ast::expr_match(#ast{__i}, arms)); let var_lambda = #ast{ |__i| $(alt_expr) }; let read_var = #ast{ $(cx.clone(d)).read_enum_variant($(var_lambda)) }; let read_lambda = cx.lambda(cx.expr_blk(read_var)); diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 360605aab2c..ed41d6da694 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -456,9 +456,9 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ { expr_loop(fld.fold_block(body), option::map(opt_ident, |x| fld.fold_ident(x))) } - expr_match(expr, arms, mode) => { + expr_match(expr, arms) => { expr_match(fld.fold_expr(expr), - vec::map(arms, |x| fld.fold_arm(x)), mode) + vec::map(arms, |x| fld.fold_arm(x))) } expr_fn(proto, decl, body, captures) => { expr_fn(proto, fold_fn_decl(decl, fld), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index ff06c14c4fb..4656fc6b6fa 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1668,8 +1668,6 @@ struct parser { fn parse_alt_expr() -> @expr { let lo = self.last_span.lo; - let mode = if self.eat_keyword(~"check") { alt_check } - else { alt_exhaustive }; let discriminant = self.parse_expr(); self.expect(token::LBRACE); let mut arms: ~[arm] = ~[]; @@ -1701,7 +1699,7 @@ struct parser { } let mut hi = self.span.hi; self.bump(); - return self.mk_expr(lo, hi, expr_match(discriminant, arms, mode)); + return self.mk_expr(lo, hi, expr_match(discriminant, arms)); } fn parse_expr() -> @expr { diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 29c41949e21..835d71135d5 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1128,11 +1128,10 @@ fn print_expr(s: ps, &&expr: @ast::expr) { option::iter(opt_ident, |ident| {print_ident(s, ident); space(s.s)}); print_block(s, blk); } - ast::expr_match(expr, arms, mode) => { + ast::expr_match(expr, arms) => { cbox(s, alt_indent_unit); ibox(s, 4u); word_nbsp(s, ~"match"); - if mode == ast::alt_check { word_nbsp(s, ~"check"); } print_maybe_parens_discrim(s, expr); space(s.s); bopen(s); diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 56d3d3a26f4..bc98e40594a 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -430,7 +430,7 @@ fn visit_expr<E>(ex: @expr, e: E, v: vt<E>) { } expr_while(x, b) => { v.visit_expr(x, e, v); v.visit_block(b, e, v); } expr_loop(b, _) => v.visit_block(b, e, v), - expr_match(x, arms, _) => { + expr_match(x, arms) => { v.visit_expr(x, e, v); for arms.each |a| { v.visit_arm(a, e, v); } } |
