diff options
| author | Graydon Hoare <[email protected]> | 2011-02-24 16:42:04 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-02-24 16:42:04 -0800 |
| commit | 9acf4b912717831f628ad078f28c597e10d7ec93 (patch) | |
| tree | 3e06c9d9cd6946aa333380d3b5f403dfb54eb3d2 /src/comp/front/parser.rs | |
| parent | Factor crate expr evaluator out of parser, expand to simple scalars and ops, ... (diff) | |
| download | rust-9acf4b912717831f628ad078f28c597e10d7ec93.tar.xz rust-9acf4b912717831f628ad078f28c597e10d7ec93.zip | |
Handle the mutant 'let'-block directive in rustboot, temporarily.
Diffstat (limited to 'src/comp/front/parser.rs')
| -rw-r--r-- | src/comp/front/parser.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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] { |