diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-07-20 15:52:38 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-07-20 16:02:53 -0700 |
| commit | 8a7f2e0fe5d4fccd9796795fa76ac749e3444de1 (patch) | |
| tree | 4abfe4de5a1296d3bd9975588b66efbc41cc5166 /src/comp/syntax/parse | |
| parent | 67e9fe512ce7cf7dbd7748e7270f555258ddadab (diff) | |
| download | rust-8a7f2e0fe5d4fccd9796795fa76ac749e3444de1.tar.gz rust-8a7f2e0fe5d4fccd9796795fa76ac749e3444de1.zip | |
Parse nil literals (including in patterns)
Closes #622.
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 724fcd75386..1e33e223d82 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -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); } } } |
