rustc: Implement optional fat-arrow syntax for alt (transitional change)

This commit is contained in:
Patrick Walton
2012-06-04 18:34:10 -07:00
parent 7803488a43
commit ae6d8d1b4d
3 changed files with 9 additions and 1 deletions

View File

@@ -1281,6 +1281,7 @@ class parser {
let pats = self.parse_pats();
let mut guard = none;
if self.eat_keyword("if") { guard = some(self.parse_expr()); }
if self.token == token::FAT_ARROW { self.bump(); }
let blk = self.parse_block();
arms += [{pats: pats, guard: guard, body: blk}];
}