@@ -2322,18 +2322,29 @@ impl<'a> Parser<'a> {
2322
2322
-> PResult < ' a , P < Expr > > {
2323
2323
let attrs = try!( self . parse_or_use_outer_attributes ( already_parsed_attrs) ) ;
2324
2324
2325
+ let interp = if let token:: Interpolated ( ..) = self . token {
2326
+ true
2327
+ } else {
2328
+ false
2329
+ } ;
2325
2330
let b = try!( self . parse_bottom_expr ( ) ) ;
2326
- self . parse_dot_or_call_expr_with ( b, attrs)
2331
+ let lo = if interp {
2332
+ self . last_span . lo
2333
+ } else {
2334
+ b. span . lo
2335
+ } ;
2336
+ self . parse_dot_or_call_expr_with ( b, lo, attrs)
2327
2337
}
2328
2338
2329
2339
pub fn parse_dot_or_call_expr_with ( & mut self ,
2330
2340
e0 : P < Expr > ,
2341
+ lo : BytePos ,
2331
2342
attrs : ThinAttributes )
2332
2343
-> PResult < ' a , P < Expr > > {
2333
2344
// Stitch the list of outer attributes onto the return value.
2334
2345
// A little bit ugly, but the best way given the current code
2335
2346
// structure
2336
- self . parse_dot_or_call_expr_with_ ( e0)
2347
+ self . parse_dot_or_call_expr_with_ ( e0, lo )
2337
2348
. map ( |expr|
2338
2349
expr. map ( |mut expr| {
2339
2350
expr. attrs . update ( |a| a. prepend ( attrs) ) ;
@@ -2408,9 +2419,8 @@ impl<'a> Parser<'a> {
2408
2419
} )
2409
2420
}
2410
2421
2411
- fn parse_dot_or_call_expr_with_ ( & mut self , e0 : P < Expr > ) -> PResult < ' a , P < Expr > > {
2422
+ fn parse_dot_or_call_expr_with_ ( & mut self , e0 : P < Expr > , lo : BytePos ) -> PResult < ' a , P < Expr > > {
2412
2423
let mut e = e0;
2413
- let lo = e. span . lo ;
2414
2424
let mut hi;
2415
2425
loop {
2416
2426
// expr.f
@@ -3828,7 +3838,8 @@ impl<'a> Parser<'a> {
3828
3838
let e = self . mk_mac_expr ( span. lo , span. hi ,
3829
3839
mac. and_then ( |m| m. node ) ,
3830
3840
None ) ;
3831
- let e = try!( self . parse_dot_or_call_expr_with ( e, attrs) ) ;
3841
+ let lo = e. span . lo ;
3842
+ let e = try!( self . parse_dot_or_call_expr_with ( e, lo, attrs) ) ;
3832
3843
let e = try!( self . parse_assoc_expr_with ( 0 , LhsExpr :: AlreadyParsed ( e) ) ) ;
3833
3844
try!( self . handle_expression_like_statement (
3834
3845
e,
0 commit comments