diff options
| author | Graydon Hoare <[email protected]> | 2010-12-14 16:59:13 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-12-14 16:59:13 -0800 |
| commit | a7eb1ac90f4aa033cd7a52dd2de6dea21c13d6d5 (patch) | |
| tree | 5b510788c9715d4be1986e410d9b1c50fb2dff96 /src | |
| parent | Teach fold about objs. (diff) | |
| download | rust-a7eb1ac90f4aa033cd7a52dd2de6dea21c13d6d5.tar.xz rust-a7eb1ac90f4aa033cd7a52dd2de6dea21c13d6d5.zip | |
Move call_expr parse rule to the place where it needs to be to understand complex calls.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/front/parser.rs | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 5fd90508..84a5c305 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -392,20 +392,6 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr { auto n = parse_name(p, i); hi = n.span; ex = ast.expr_name(n, none[ast.def], ast.ann_none); - alt (p.peek()) { - case (token.LPAREN) { - // Call expr. - auto pf = parse_expr; - auto es = parse_seq[@ast.expr](token.LPAREN, - token.RPAREN, - some(token.COMMA), - pf, p); - ex = ast.expr_call(@spanned(lo, hi, ex), - es.node, ast.ann_none); - hi = es.span; - } - case (_) { /* fall through */ } - } } case (token.LPAREN) { @@ -488,6 +474,19 @@ impure fn parse_path_expr(parser p) -> @ast.expr { auto hi = e.span; while (true) { alt (p.peek()) { + + case (token.LPAREN) { + // Call expr. + auto pf = parse_expr; + auto es = parse_seq[@ast.expr](token.LPAREN, + token.RPAREN, + some(token.COMMA), + pf, p); + hi = es.span; + auto e_ = ast.expr_call(e, es.node, ast.ann_none); + e = @spanned(lo, hi, e_); + } + case (token.DOT) { p.bump(); alt (p.peek()) { |