Parse nil literals (including in patterns)

Closes #622.
This commit is contained in:
Tim Chevalier 2011-07-20 15:52:38 -07:00
parent 67e9fe512c
commit 8a7f2e0fe5
2 changed files with 13 additions and 0 deletions

View File

@ -653,6 +653,11 @@ fn parse_lit(&parser p) -> ast::lit {
p.bump();
lit = ast::lit_str(p.get_str(s), ast::sk_rc);
}
case (token::LPAREN) {
p.bump();
expect(p, token::RPAREN);
lit = ast::lit_nil;
}
case (?t) { unexpected(p, t); }
}
}

View File

@ -0,0 +1,8 @@
// xfail-stage0
fn main() {
auto x = ();
alt (x) {
case (()) {
}
}
}