Skip to content

Commit 8b94ef0

Browse files
committed
libsyntax: fix the span in parse_bottom_expr's INTERPOLATED handler
1 parent d204386 commit 8b94ef0

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,23 @@ enum view_item_parse_mode {
127127
The important thing is to make sure that lookahead doesn't balk
128128
at INTERPOLATED tokens */
129129
macro_rules! maybe_whole_expr (
130-
($p:expr) => ( match *$p.token {
131-
INTERPOLATED(token::nt_expr(e)) => {
132-
$p.bump();
133-
return e;
134-
}
135-
INTERPOLATED(token::nt_path(pt)) => {
136-
$p.bump();
137-
return $p.mk_expr($p.span.lo, $p.span.lo,
138-
expr_path(pt));
139-
}
140-
_ => ()
141-
})
130+
($p:expr) => (
131+
match *$p.token {
132+
INTERPOLATED(token::nt_expr(e)) => {
133+
$p.bump();
134+
return e;
135+
}
136+
INTERPOLATED(token::nt_path(pt)) => {
137+
$p.bump();
138+
return $p.mk_expr(
139+
$p.span.lo,
140+
$p.span.hi,
141+
expr_path(pt)
142+
);
143+
}
144+
_ => ()
145+
}
146+
)
142147
)
143148

144149
macro_rules! maybe_whole (

0 commit comments

Comments
 (0)