diff options
| author | Tim Chevalier <[email protected]> | 2011-03-24 10:37:05 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-24 12:37:12 -0700 |
| commit | 2bd78c176dc638773c527d85160e284bcaf0a5b6 (patch) | |
| tree | 4d14ca5b85f3496e2395cdaef2025f3656ab8eef /src/boot/fe | |
| parent | Add .def.in files that I forgot to stage. Should put out burning tinderboxes ... (diff) | |
| download | rust-2bd78c176dc638773c527d85160e284bcaf0a5b6.tar.xz rust-2bd78c176dc638773c527d85160e284bcaf0a5b6.zip | |
Improve error message when the lexer sees a bad character
Diffstat (limited to 'src/boot/fe')
| -rw-r--r-- | src/boot/fe/lexer.mll | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/boot/fe/lexer.mll b/src/boot/fe/lexer.mll index 84aeb9ab..b84e5906 100644 --- a/src/boot/fe/lexer.mll +++ b/src/boot/fe/lexer.mll @@ -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 |