Add parse support for expr_ext.

This commit is contained in:
Graydon Hoare 2011-02-14 16:33:25 -08:00
parent 59bce06a96
commit 890d027b65
2 changed files with 12 additions and 0 deletions

View file

@ -164,6 +164,7 @@ tag expr_ {
expr_field(@expr, ident, ann);
expr_index(@expr, @expr, ann);
expr_path(path, option.t[def], ann);
expr_ext(vec[@expr], option.t[@expr], ann);
}
type lit = spanned[lit_];

View file

@ -586,6 +586,17 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr {
ex = ast.expr_bind(e, es.node, ast.ann_none);
}
case (token.POUND) {
p.bump();
auto pf = parse_expr;
auto es = parse_seq[@ast.expr](token.LPAREN,
token.RPAREN,
some(token.COMMA),
pf, p);
hi = es.span;
ex = ast.expr_ext(es.node, none[@ast.expr], ast.ann_none);
}
case (_) {
auto lit = parse_lit(p);
hi = lit.span;