File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 6f5853f5a1767e0c418fd5f348a795b76d701b3e
5
+ refs/heads/try: 15985277b98e53014b52c1e243eefcfb0335089f
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ fn gather_anti_quotes<N: qq_helper>(lo: uint, node: N) -> aq_ctxt
103
103
with * default_visitor ( ) } ;
104
104
let cx = @{ lo: lo, mutable gather: [ ] } ;
105
105
node. visit ( cx, mk_vt ( v) ) ;
106
+ // FIXME: Maybe this is an overkill (merge_sort), it might be better
107
+ // to just keep the gather array in sorted order ...
108
+ cx. gather = std:: sort:: merge_sort ( { |a, b| a. lo < b. lo } , copy cx. gather ) ;
106
109
ret cx;
107
110
}
108
111
@@ -200,9 +203,11 @@ fn finish<T: qq_helper>
200
203
let qcx = gather_anti_quotes ( sp. lo , node) ;
201
204
let cx = qcx;
202
205
203
- // assert that the vector is sorted by position:
204
206
uint:: range ( 1 u, vec:: len ( cx. gather ) ) { |i|
205
207
assert cx. gather [ i-1 u] . lo < cx. gather [ i] . lo ;
208
+ // ^^ check that the vector is sorted
209
+ assert cx. gather [ i-1 u] . hi <= cx. gather [ i] . lo ;
210
+ // ^^ check that the spans are non-overlapping
206
211
}
207
212
208
213
let str2 = "" ;
Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ fn main() {
91
91
92
92
let crate = #ast( crate ) { fn a ( ) { } } ;
93
93
check_pp( crate , pprust:: print_crate_, "fn a() { }\n " ) ;
94
+
95
+ // issue #1926
96
+ let s = #ast ( expr) { __s} ;
97
+ let e = #ast ( expr) { __e} ;
98
+ let call = #ast ( expr) { $( s) . foo { |__e| $( e) } } ;
99
+ check_pp ( call, pprust:: print_expr, "__s.foo {|__e| __e }" )
94
100
}
95
101
96
102
fn check_pp < T > ( expr : T , f : fn ( pprust:: ps , T ) , expect : str ) {
You can’t perform that action at this time.
0 commit comments