diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-08 13:49:21 -0800 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2013-01-08 13:49:21 -0800 |
| commit | 2791877009996dba1a4c7b84fbd7af01ac36bd04 (patch) | |
| tree | 4ce8b2220f434828c27481f66adfa7d49bd012c3 /src/libsyntax | |
| parent | dd73dd0e37d17ecfec4fb9a38d4cfd68dcf299eb (diff) | |
| parent | 816cb8c5350084e04770b9c3a133400923bd2e1b (diff) | |
| download | rust-2791877009996dba1a4c7b84fbd7af01ac36bd04.tar.gz rust-2791877009996dba1a4c7b84fbd7af01ac36bd04.zip | |
Merge pull request #4388 from lkuper/alt-to-match
Rename identifiers that still use 'alt' to use 'match'
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index c7b4a2b239a..724e2fc9dba 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -245,7 +245,7 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher]) /* at end of sequence */ if idx >= len { - // can't move out of `alt`s, so: + // can't move out of `match`es, so: if is_some(ei.up) { // hack: a matcher sequence is repeating iff it has a // parent (the top level is just a container) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f85ca3fefef..f32a782622a 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -940,7 +940,7 @@ impl Parser { } else if self.eat_keyword(~"loop") { return self.parse_loop_expr(); } else if self.eat_keyword(~"match") { - return self.parse_alt_expr(); + return self.parse_match_expr(); } else if self.eat_keyword(~"fn") { let opt_proto = self.parse_fn_ty_proto(); let proto = match opt_proto { @@ -1722,7 +1722,7 @@ impl Parser { return expr_rec(fields, base); } - fn parse_alt_expr() -> @expr { + fn parse_match_expr() -> @expr { let lo = self.last_span.lo; let discriminant = self.parse_expr(); self.expect(token::LBRACE); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index ad4080c3094..239cff22cc0 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -83,7 +83,7 @@ fn rust_printer(writer: io::Writer, intr: @ident_interner) -> ps { } const indent_unit: uint = 4u; -const alt_indent_unit: uint = 2u; +const match_indent_unit: uint = 2u; const default_columns: uint = 78u; @@ -1251,7 +1251,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) { print_block(s, (*blk)); } ast::expr_match(expr, ref arms) => { - cbox(s, alt_indent_unit); + cbox(s, match_indent_unit); ibox(s, 4); word_nbsp(s, ~"match"); print_expr(s, expr); @@ -1260,7 +1260,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) { let len = (*arms).len(); for (*arms).eachi |i, arm| { space(s.s); - cbox(s, alt_indent_unit); + cbox(s, match_indent_unit); ibox(s, 0u); let mut first = true; for arm.pats.each |p| { @@ -1293,7 +1293,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) { ast::expr_block(ref blk) => { // the block will close the pattern's ibox print_block_unclosed_indent( - s, (*blk), alt_indent_unit); + s, (*blk), match_indent_unit); } _ => { end(s); // close the ibox for the pattern @@ -1310,10 +1310,10 @@ fn print_expr(s: ps, &&expr: @ast::expr) { } } else { // the block will close the pattern's ibox - print_block_unclosed_indent(s, arm.body, alt_indent_unit); + print_block_unclosed_indent(s, arm.body, match_indent_unit); } } - bclose_(s, expr.span, alt_indent_unit); + bclose_(s, expr.span, match_indent_unit); } ast::expr_fn(proto, decl, ref body, cap_clause) => { // containing cbox, will be closed by print-block at } |
