about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorAustin Seipp <as@hacks.yi.org>2012-01-09 19:15:17 -0600
committerBrian Anderson <banderson@mozilla.com>2012-01-09 19:27:05 -0800
commita94b1ccacbc2869b6a67afcda98d7495c0086eb3 (patch)
tree46c25968d972b54ef5acb86a7c18ed1bcf541f3e /src/comp/syntax
parentaeae04cb49a3af321e75f839d409768014bd5169 (diff)
downloadrust-a94b1ccacbc2869b6a67afcda98d7495c0086eb3.tar.gz
rust-a94b1ccacbc2869b6a67afcda98d7495c0086eb3.zip
Change all uses of 'when' in alt-patterns to 'if'
Issue #1396
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/parse/lexer.rs2
-rw-r--r--src/comp/syntax/parse/parser.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs
index bee3d7783cb..21340168a23 100644
--- a/src/comp/syntax/parse/lexer.rs
+++ b/src/comp/syntax/parse/lexer.rs
@@ -182,7 +182,7 @@ fn scan_digits(rdr: reader, radix: uint) -> str {
         let c = rdr.curr();
         if c == '_' { rdr.bump(); cont; }
         alt char::maybe_digit(c) {
-          some(d) when (d as uint) < radix {
+          some(d) if (d as uint) < radix {
             str::push_byte(rslt, c as u8);
             rdr.bump();
           }
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 2eeb5cbf136..b163ae172da 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -753,7 +753,7 @@ fn mk_pexpr(p: parser, lo: uint, hi: uint, node: ast::expr_) -> pexpr {
 
 fn to_expr(e: pexpr) -> @ast::expr {
     alt e.node {
-      ast::expr_tup(es) when vec::len(es) == 1u { es[0u] }
+      ast::expr_tup(es) if vec::len(es) == 1u { es[0u] }
       _ { *e }
     }
 }
@@ -1020,7 +1020,7 @@ fn parse_dot_or_call_expr_with(p: parser, e0: pexpr) -> pexpr {
     while !expr_is_complete(p, e) {
         alt p.peek() {
           // expr(...)
-          token::LPAREN. when permits_call(p) {
+          token::LPAREN. if permits_call(p) {
             let es = parse_seq(token::LPAREN, token::RPAREN,
                                seq_sep(token::COMMA), parse_expr, p);
             hi = es.span.hi;
@@ -1029,7 +1029,7 @@ fn parse_dot_or_call_expr_with(p: parser, e0: pexpr) -> pexpr {
           }
 
           // expr {|| ... }
-          token::LBRACE. when is_bar(p.look_ahead(1u)) && permits_call(p) {
+          token::LBRACE. if is_bar(p.look_ahead(1u)) && permits_call(p) {
             p.bump();
             let blk = parse_fn_block_expr(p);
             alt e.node {