parent
379194753c
commit
3eef8d1419
2 changed files with 12 additions and 1 deletions
|
@ -43,7 +43,13 @@ impl reader for reader {
|
|||
let next = str::char_range_at(*self.src, self.pos);
|
||||
self.pos = next.next;
|
||||
self.curr = next.ch;
|
||||
} else { self.curr = -1 as char; }
|
||||
} else {
|
||||
if (self.curr != -1 as char) {
|
||||
self.col += 1u;
|
||||
self.chpos += 1u;
|
||||
self.curr = -1 as char;
|
||||
}
|
||||
}
|
||||
}
|
||||
fn fatal(m: str) -> ! {
|
||||
self.span_diagnostic.span_fatal(
|
||||
|
|
|
@ -76,6 +76,11 @@ fn main() {
|
|||
|
||||
let pat = #ast(pat){some(_)};
|
||||
check_pp(pat, pprust::print_pat, "some(_)");
|
||||
|
||||
// issue #1785
|
||||
let x = #ast{1};
|
||||
let test1 = #ast{1+$(x)};
|
||||
check_pp(test1, pprust::print_expr, "1 + 1");
|
||||
}
|
||||
|
||||
fn check_pp<T>(expr: T, f: fn(pprust::ps, T), expect: str) {
|
||||
|
|
Loading…
Reference in a new issue