about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2011-07-25 13:42:38 -0700
committerMichael Sullivan <sully@msully.net>2011-07-25 13:42:38 -0700
commit6bcdb48e352b04bfbf43cfe00d1817e43c635635 (patch)
treee59553d48705b9ea91fae82474ad310afdd1932d /src/comp/syntax/parse
parent01675f34e06f5e59c71d28179dd4f62fe5437403 (diff)
downloadrust-6bcdb48e352b04bfbf43cfe00d1817e43c635635.tar.gz
rust-6bcdb48e352b04bfbf43cfe00d1817e43c635635.zip
Disallow block as a variable name in preparation for it becoming a keyword.
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/parser.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 221c97b8dac..a91a95dd77f 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -174,6 +174,7 @@ fn bad_expr_word_table() -> hashmap[str, ()] {
     words.insert("fn", ());
     words.insert("pred", ());
     words.insert("iter", ());
+    words.insert("block", ());
     words.insert("import", ());
     words.insert("export", ());
     words.insert("let", ());
@@ -1407,8 +1408,8 @@ fn parse_alt_expr(&parser p) -> @ast::expr {
         if (p.peek() == token::LPAREN) { parens = true; p.bump(); }
         auto pats = parse_pats(p);
         if (parens) { expect(p, token::RPAREN); }
-        auto block = parse_block(p);
-        arms += ~[rec(pats=pats, block=block)];
+        auto blk = parse_block(p);
+        arms += ~[rec(pats=pats, block=blk)];
     }
     auto hi = p.get_hi_pos();
     p.bump();