diff options
| author | Kevin Atkinson <kevina@cs.utah.edu> | 2012-02-10 17:27:35 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-02-14 19:37:33 -0800 |
| commit | a803a14b56752a977d2766b96dae76162cb6fd85 (patch) | |
| tree | 4fd0eebaa3224fd5f55d99c5b43916a5007f5647 /src/comp | |
| parent | 3eef8d14197d5166286f6a4dbc4b604e52581618 (diff) | |
Bug fix to accept $ in 0th pos, (ie #ast{$(x) + ...}).
Note: part from Niko Matsakis commit: rewrite assert to accept a $ in 0th pos.
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/syntax/ext/qquote.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/comp/syntax/ext/qquote.rs b/src/comp/syntax/ext/qquote.rs index c30762f11c4..6afb3fa3f75 100644 --- a/src/comp/syntax/ext/qquote.rs +++ b/src/comp/syntax/ext/qquote.rs @@ -184,11 +184,12 @@ fn finish<T: qq_helper> let sp = node.span(); let qcx = gather_anti_quotes(sp.lo, node); let cx = qcx; - let prev = 0u; - for {lo: lo, _} in cx.gather { - assert lo > prev; - prev = lo; + + // assert that the vector is sorted by position: + uint::range(1u, vec::len(cx.gather)) {|i| + assert cx.gather[i-1u].lo < cx.gather[i].lo; } + let str2 = ""; enum state {active, skip(uint), blank}; let state = active; |
