diff options
| author | Graydon Hoare <[email protected]> | 2010-10-22 15:37:42 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-10-22 15:37:42 -0700 |
| commit | 6d47d2abdee023f46b35b95e26e418ab9d67d39c (patch) | |
| tree | 1de9d41c4903b1fd1f8b6cf233d68c8fb7a4d7c4 /src/comp/front/parser.rs | |
| parent | rustboot: If the user tries to instantiate a non-parametric type with type pa... (diff) | |
| download | rust-6d47d2abdee023f46b35b95e26e418ab9d67d39c.tar.xz rust-6d47d2abdee023f46b35b95e26e418ab9d67d39c.zip | |
Implement check-exprs, un-xfail 5 rustc tests.
Diffstat (limited to 'src/comp/front/parser.rs')
| -rw-r--r-- | src/comp/front/parser.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 96158f1b..42ffc4c6 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -690,6 +690,22 @@ io fn parse_stmt(parser p) -> @ast.stmt { ret @spanned(lo, hi, ast.stmt_log(e)); } + case (token.CHECK) { + p.bump(); + alt (p.peek()) { + case (token.LPAREN) { + auto e = parse_expr(p); + auto hi = p.get_span(); + expect(p, token.SEMI); + ret @spanned(lo, hi, ast.stmt_check_expr(e)); + } + case (_) { + p.get_session().unimpl("constraint-check stmt"); + } + } + } + + case (token.LET) { auto decl = parse_let(p); auto hi = p.get_span(); |