about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-07-20 15:52:38 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2011-07-20 16:02:53 -0700
commit8a7f2e0fe5d4fccd9796795fa76ac749e3444de1 (patch)
tree4abfe4de5a1296d3bd9975588b66efbc41cc5166 /src/comp/syntax/parse
parent67e9fe512ce7cf7dbd7748e7270f555258ddadab (diff)
downloadrust-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.rs5
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); }
         }
     }