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