From 6bcdb48e352b04bfbf43cfe00d1817e43c635635 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Mon, 25 Jul 2011 13:42:38 -0700 Subject: Disallow block as a variable name in preparation for it becoming a keyword. --- src/comp/syntax/parse/parser.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/comp/syntax/parse') 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(); -- cgit 1.4.1-3-g733a5