Skip to content

Commit 5109d1a

Browse files
committed
Correct span for ExprFnBlock, ExprMethodCall, ExprParen
1 parent 104002b commit 5109d1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libsyntax/parse/parser.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ impl Parser {
17711771
self.commit_expr_expecting(*es.last().unwrap(), token::RPAREN);
17721772

17731773
return if es.len() == 1 && !trailing_comma {
1774-
self.mk_expr(lo, self.span.hi, ExprParen(es[0]))
1774+
self.mk_expr(lo, hi, ExprParen(es[0]))
17751775
}
17761776
else {
17771777
self.mk_expr(lo, hi, ExprTup(es))
@@ -1994,7 +1994,7 @@ impl Parser {
19941994
seq_sep_trailing_disallowed(token::COMMA),
19951995
|p| p.parse_expr()
19961996
);
1997-
hi = self.span.hi;
1997+
hi = self.last_span.hi;
19981998

19991999
es.unshift(e);
20002000
let nd = self.mk_method_call(i, tys, es, NoSugar);
@@ -2510,7 +2510,7 @@ impl Parser {
25102510
parse_decl: |&mut Parser| -> P<FnDecl>,
25112511
parse_body: |&mut Parser| -> @Expr)
25122512
-> @Expr {
2513-
let lo = self.last_span.lo;
2513+
let lo = self.span.lo;
25142514
let decl = parse_decl(self);
25152515
let body = parse_body(self);
25162516
let fakeblock = P(ast::Block {

0 commit comments

Comments
 (0)