File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1170,6 +1170,23 @@ impure fn parse_alt_expr(parser p) -> @ast.expr {
1170
1170
auto block = parse_block ( p) ;
1171
1171
arms += vec ( rec ( pat=pat, block=block, index=index) ) ;
1172
1172
}
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
+ }
1173
1190
case ( token. RBRACE ) { /* empty */ }
1174
1191
case ( ?tok) {
1175
1192
p. err ( "expected 'case' or '}' when parsing 'alt' statement " +
You can’t perform that action at this time.
0 commit comments