about summary refs log tree commit diff
path: root/src/comp/front
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-12-14 16:59:13 -0800
committerGraydon Hoare <graydon@mozilla.com>2010-12-14 16:59:13 -0800
commita7eb1ac90f4aa033cd7a52dd2de6dea21c13d6d5 (patch)
tree5b510788c9715d4be1986e410d9b1c50fb2dff96 /src/comp/front
parente0998847bee42134b0de48a82412503ca72a7fb9 (diff)
Move call_expr parse rule to the place where it needs to be to understand complex calls.
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/parser.rs27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 5fd90508aef..84a5c305245 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()) {