From 9acf4b912717831f628ad078f28c597e10d7ec93 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 24 Feb 2011 16:42:04 -0800 Subject: Handle the mutant 'let'-block directive in rustboot, temporarily. --- src/comp/front/parser.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/comp') diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 3579a3a0..4817d960 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -2168,10 +2168,25 @@ impure fn parse_crate_directive(parser p) -> ast.crate_directive } } } + + case (token.LET) { + p.bump(); + expect(p, token.LPAREN); + auto id = parse_ident(p); + expect(p, token.EQ); + auto x = parse_expr(p); + expect(p, token.RPAREN); + expect(p, token.LBRACE); + auto v = parse_crate_directives(p, token.RBRACE); + hi = p.get_span(); + expect(p, token.RBRACE); + ret spanned(lo, hi, ast.cdir_let(id, x, v)); + } } fail; } + impure fn parse_crate_directives(parser p, token.token term) -> vec[@ast.crate_directive] { -- cgit v1.2.3