Skip to content

Commit 0be3bdb

Browse files
Austin Seippbrson
authored andcommitted
---
yaml --- r: 7142 b: refs/heads/master c: 9211348 h: refs/heads/master v: v3
1 parent 2463818 commit 0be3bdb

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fbad0204e477537e350963014af936b1646d6d7a
2+
refs/heads/master: 92113489893105d5432df2fd8f727fa2ca8cec51

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,11 @@ fn parse_alt_expr(p: parser) -> @ast::expr {
13891389
while p.peek() != token::RBRACE {
13901390
let pats = parse_pats(p);
13911391
let guard = none;
1392-
if eat_word(p, "when") { guard = some(parse_expr(p)); }
1392+
if eat_word(p, "when") {
1393+
guard = some(parse_expr(p));
1394+
} else if eat_word(p, "if") {
1395+
guard = some(parse_expr(p));
1396+
}
13931397
let blk = parse_block(p);
13941398
arms += [{pats: pats, guard: guard, body: blk}];
13951399
}

trunk/src/comp/syntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
843843
}
844844
space(s.s);
845845
alt arm.guard {
846-
some(e) { word_space(s, "when"); print_expr(s, e); space(s.s); }
846+
some(e) { word_space(s, "if"); print_expr(s, e); space(s.s); }
847847
none. { }
848848
}
849849
print_possibly_embedded_block(s, arm.body, block_normal,

0 commit comments

Comments
 (0)