Skip to content

Commit 3aaae2a

Browse files
committed
Teach rustc to parse call exprs.
1 parent eec259f commit 3aaae2a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/comp/front/parser.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,19 @@ io fn parse_bottom_expr(parser p) -> @ast.expr {
268268
auto n = parse_name(p, i);
269269
hi = n.span;
270270
ex = ast.expr_name(n, none[ast.def], none[@ast.ty]);
271+
alt (p.peek()) {
272+
case (token.LPAREN) {
273+
// Call expr.
274+
auto pf = parse_expr;
275+
auto es = parse_seq[@ast.expr](token.LPAREN,
276+
token.RPAREN,
277+
some(token.COMMA),
278+
pf, p);
279+
ex = ast.expr_call(@spanned(lo, hi, ex),
280+
es.node, none[@ast.ty]);
281+
hi = es.span;
282+
}
283+
}
271284
}
272285

273286
case (token.LPAREN) {

0 commit comments

Comments
 (0)