Improve error message when the lexer sees a bad character

This commit is contained in:
Tim Chevalier 2011-03-24 10:37:05 -07:00 committed by Graydon Hoare
parent c0f66a5240
commit 2bd78c176d

View File

@ -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