diff options
| author | bors <bors@rust-lang.org> | 2013-06-11 08:01:50 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-11 08:01:50 -0700 |
| commit | bf41586a1835790b7294c658f4dae484f738ce03 (patch) | |
| tree | ee5a9f07ed6b50bb3743deacddccd3e17527543c /src/libsyntax/parse | |
| parent | 075da9c3e9f326589056abd6edf1f196f6b2e244 (diff) | |
| parent | 3f62f9bccd618b74761dd8bd7710970445d7a2f9 (diff) | |
| download | rust-bf41586a1835790b7294c658f4dae484f738ce03.tar.gz rust-bf41586a1835790b7294c658f4dae484f738ce03.zip | |
auto merge of #7058 : Blei/rust/fix-7048, r=bstrie
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 002a6caf85c..474e93ed11a 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -772,7 +772,11 @@ fn next_token_inner(rdr: @mut StringReader) -> token::Token { '/' => { return binop(rdr, token::SLASH); } '^' => { return binop(rdr, token::CARET); } '%' => { return binop(rdr, token::PERCENT); } - c => { rdr.fatal(fmt!("unknown start of token: %d", c as int)); } + c => { + // So the error span points to the unrecognized character + rdr.peek_span = codemap::mk_sp(rdr.last_pos, rdr.pos); + rdr.fatal(fmt!("unknown start of token: %d", c as int)); + } } } |
