Disallow block as a variable name in preparation for it becoming a keyword.

This commit is contained in:
Michael Sullivan
2011-07-25 13:42:38 -07:00
parent 01675f34e0
commit 6bcdb48e35
6 changed files with 48 additions and 47 deletions

View File

@@ -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();