mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Improve error message when the lexer sees a bad character
This commit is contained in:
parent
c0f66a5240
commit
2bd78c176d
@ -297,7 +297,8 @@ rule token = parse
|
||||
| '\'' { char lexbuf }
|
||||
| '"' { let buf = Buffer.create 32 in
|
||||
str buf lexbuf }
|
||||
|
||||
| _ as c { let s = Char.escaped c in
|
||||
fail lexbuf ("Bad character: " ^ s) }
|
||||
| eof { EOF }
|
||||
|
||||
and str buf = parse
|
||||
|
Loading…
Reference in New Issue
Block a user