Skip to content

Commit 04e6163

Browse files
committed
---
yaml --- r: 11177 b: refs/heads/master c: f9a63ef h: refs/heads/master i: 11175: 7f24746 v: v3
1 parent 1daea04 commit 04e6163

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d808df893a085205cb6e113ce98ac09accbc595a
2+
refs/heads/master: f9a63efb8214a36b13545b158bf27c1b6540b650
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/comp/syntax/parse/lexer.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ impl reader for reader {
4343
let next = str::char_range_at(*self.src, self.pos);
4444
self.pos = next.next;
4545
self.curr = next.ch;
46-
} else { self.curr = -1 as char; }
46+
} else {
47+
if (self.curr != -1 as char) {
48+
self.col += 1u;
49+
self.chpos += 1u;
50+
self.curr = -1 as char;
51+
}
52+
}
4753
}
4854
fn fatal(m: str) -> ! {
4955
self.span_diagnostic.span_fatal(

trunk/src/test/run-pass/qquote.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ fn main() {
7676

7777
let pat = #ast(pat){some(_)};
7878
check_pp(pat, pprust::print_pat, "some(_)");
79+
80+
// issue #1785
81+
let x = #ast{1};
82+
let test1 = #ast{1+$(x)};
83+
check_pp(test1, pprust::print_expr, "1 + 1");
7984
}
8085

8186
fn check_pp<T>(expr: T, f: fn(pprust::ps, T), expect: str) {

0 commit comments

Comments
 (0)