aboutsummaryrefslogtreecommitdiff
path: root/src/boot/fe
diff options
context:
space:
mode:
authorTim Chevalier <[email protected]>2011-03-24 10:37:05 -0700
committerGraydon Hoare <[email protected]>2011-03-24 12:37:12 -0700
commit2bd78c176dc638773c527d85160e284bcaf0a5b6 (patch)
tree4d14ca5b85f3496e2395cdaef2025f3656ab8eef /src/boot/fe
parentAdd .def.in files that I forgot to stage. Should put out burning tinderboxes ... (diff)
downloadrust-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.mll3
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