File tree 3 files changed +14
-3
lines changed
3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: c274d16b7fdac7a1006dd43a1e27c54c46285540
2
+ refs/heads/master: 7b12924813912b4f8ca196ae3cd0c87985d6961e
Original file line number Diff line number Diff line change @@ -886,10 +886,11 @@ fn parse_bottom_expr(p: &parser) -> @ast::expr {
886
886
p. bump ( ) ;
887
887
alt p. peek ( ) {
888
888
token:: LIT_STR ( s) {
889
+ let sp = p. get_span ( ) ;
889
890
p. bump ( ) ;
890
891
let lit =
891
892
@{ node: ast:: lit_str ( p. get_str ( s) , ast:: sk_unique) ,
892
- span: p . get_span ( ) } ;
893
+ span: sp } ;
893
894
ex = ast:: expr_lit ( lit) ;
894
895
}
895
896
_ { ex = ast:: expr_uniq ( parse_expr ( p) ) ; }
Original file line number Diff line number Diff line change @@ -1468,7 +1468,17 @@ fn print_literal(s: &ps, lit: &@ast::lit) {
1468
1468
maybe_print_comment ( s, lit. span . lo ) ;
1469
1469
alt next_lit( s) {
1470
1470
some ( lt) {
1471
- if lt. pos == lit. span . lo { word ( s. s , lt. lit ) ; s. cur_lit += 1 u; ret; }
1471
+ if lt. pos == lit. span . lo {
1472
+ // FIXME: This is a hack until istrs replace strings, since
1473
+ // istrs are prefixed with a token that is not part of the literal
1474
+ alt lit. node {
1475
+ ast:: lit_str ( _, ast:: sk_unique. ) { word ( s. s , "~" ) ; }
1476
+ _ { }
1477
+ }
1478
+ word ( s. s , lt. lit ) ;
1479
+ s. cur_lit += 1 u;
1480
+ ret;
1481
+ }
1472
1482
}
1473
1483
_ { }
1474
1484
}
You can’t perform that action at this time.
0 commit comments