Skip to content

Commit 4a2a17d

Browse files
committed
---
yaml --- r: 1433 b: refs/heads/master c: 88f0463 h: refs/heads/master i: 1431: 33175b7 v: v3
1 parent 5fcb2f4 commit 4a2a17d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
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: dbf53b4c37f9f2a1cda43aa8320ceb4c4460051e
2+
refs/heads/master: 88f0463c2bd6e7fd2af461afc5e83bd3417e3bc5

trunk/src/comp/front/parser.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,23 @@ impure fn parse_alt_expr(parser p) -> @ast.expr {
11701170
auto block = parse_block(p);
11711171
arms += vec(rec(pat=pat, block=block, index=index));
11721172
}
1173+
1174+
// FIXME: this is a vestigial form left over from
1175+
// rustboot, we're keeping it here for source-compat
1176+
// for the time being but it should be flushed out
1177+
// once we've bootstrapped. When we see 'else {' here,
1178+
// we pretend we saw 'case (_) {'. It has the same
1179+
// meaning, and only exists due to the cexp/pexp split
1180+
// in rustboot, which we're not maintaining.
1181+
1182+
case (token.ELSE) {
1183+
p.bump();
1184+
auto hi = p.get_span();
1185+
auto pat = @spanned(lo, hi, ast.pat_wild(ast.ann_none));
1186+
auto index = index_arm(pat);
1187+
auto block = parse_block(p);
1188+
arms += vec(rec(pat=pat, block=block, index=index));
1189+
}
11731190
case (token.RBRACE) { /* empty */ }
11741191
case (?tok) {
11751192
p.err("expected 'case' or '}' when parsing 'alt' statement " +

0 commit comments

Comments
 (0)