diff options
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 2 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 4 | ||||
| -rw-r--r-- | src/comp/front/token.rs | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 61450a1b..d41e6d60 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -258,7 +258,7 @@ tag expr_ { expr_tup(vec[elt], ann); expr_rec(vec[field], option.t[@expr], ann); expr_call(@expr, vec[@expr], ann); - expr_call_self(@expr, vec[@expr], ann); + expr_call_self(ident, vec[@expr], ann); expr_bind(@expr, vec[option.t[@expr]], ann); expr_spawn(spawn_dom, option.t[str], @expr, vec[@expr], ann); expr_binary(binop, @expr, @expr, ann); diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 1e0a9042..31e470be 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -887,10 +887,12 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr { } case (token.SELF) { + log "parsing a self-call..."; + p.bump(); expect(p, token.DOT); // The rest is a call expression. - auto e = parse_bottom_expr(p); + auto e = parse_ident(p); auto pf = parse_expr; auto es = parse_seq[@ast.expr](token.LPAREN, token.RPAREN, diff --git a/src/comp/front/token.rs b/src/comp/front/token.rs index 5ac9d662..dcfafadf 100644 --- a/src/comp/front/token.rs +++ b/src/comp/front/token.rs @@ -348,6 +348,8 @@ fn to_str(token t) -> str { /* Object type */ case (OBJ) { ret "obj"; } + case (SELF) { ret "self"; } + /* Comm and task types */ case (CHAN) { ret "chan"; } |