Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lexer: improve errors #9308

Merged
merged 3 commits into from
Sep 20, 2013
Merged

lexer: improve errors #9308

merged 3 commits into from
Sep 20, 2013

Commits on Sep 19, 2013

  1. lexer: show correct span on lexical errors

    Previously, the lexer calling `rdr.fatal(...)` would report the span of
    the last complete token, instead of a span within the erroneous token
    (besides one span fixed in 1ac90bb).
    
    This commit adds a wrapper around `rdr.fatal(...)` that sets the span
    explicilty, so that all fatal errors in `libsyntax/parse/lexer.rs` now
    report the offending code more precisely. A number of tests try to
    verify that, though the `compile-fail` testing setup can only check that
    the spans are on the right lines, and the "unterminated string/block
    comment" errors can't have the line marked at all, so that's incomplete.
    
    Closes rust-lang#9149.
    ben0x539 committed Sep 19, 2013
    Configuration menu
    Copy the full SHA
    1019177 View commit details
    Browse the repository at this point in the history
  2. lexer: report problematic chars verbatim or as escape sequence

    ... instead of giving their numeric codepoint, following the lead of
    fdaae34. So the error message for, say, '\_' mentions _ instead of 95,
    and '\●' now mentions \u25cf.
    ben0x539 committed Sep 19, 2013
    Configuration menu
    Copy the full SHA
    8009c97 View commit details
    Browse the repository at this point in the history
  3. 5 Configuration menu
    Copy the full SHA
    567c567 View commit details
    Browse the repository at this point in the history