about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-02-20 21:04:05 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-02-25 21:00:53 -0800
commit8b94ef0302c898b0643810c9a31978684b607a37 (patch)
tree1c0b6045abf38a174604711a18a8c1d69ab6edfd /src/libsyntax
parentd20438695e133586d230e7e687473ad39acc52d3 (diff)
downloadrust-8b94ef0302c898b0643810c9a31978684b607a37.tar.gz
rust-8b94ef0302c898b0643810c9a31978684b607a37.zip
libsyntax: fix the span in parse_bottom_expr's INTERPOLATED handler
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/parse/parser.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 9bac163dab6..69790e00779 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -127,18 +127,23 @@ enum view_item_parse_mode {
 The important thing is to make sure that lookahead doesn't balk
 at INTERPOLATED tokens */
 macro_rules! maybe_whole_expr (
-    ($p:expr) => ( match *$p.token {
-      INTERPOLATED(token::nt_expr(e)) => {
-        $p.bump();
-        return e;
-      }
-      INTERPOLATED(token::nt_path(pt)) => {
-        $p.bump();
-        return $p.mk_expr($p.span.lo, $p.span.lo,
-                       expr_path(pt));
-      }
-      _ => ()
-    })
+    ($p:expr) => (
+        match *$p.token {
+            INTERPOLATED(token::nt_expr(e)) => {
+                $p.bump();
+                return e;
+            }
+            INTERPOLATED(token::nt_path(pt)) => {
+                $p.bump();
+                return $p.mk_expr(
+                    $p.span.lo,
+                    $p.span.hi,
+                    expr_path(pt)
+                );
+            }
+        _ => ()
+        }
+    )
 )
 
 macro_rules! maybe_whole (