summaryrefslogtreecommitdiffstats
path: root/parsing/lexer.mll
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2008-10-08 13:09:39 +0000
committerDamien Doligez <damien.doligez-inria.fr>2008-10-08 13:09:39 +0000
commit2b0441401a9686529cfe8d97cf73ecc09a51bef5 (patch)
tree1e1bf18bb6810b34696e0e4329a60c3f6c1bcabb /parsing/lexer.mll
parent29e590ccb9fe1a9330a6809a972a0e84e80653f7 (diff)
merge changes between 3.10.2 and the end of branch 3.10
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9079 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing/lexer.mll')
-rw-r--r--parsing/lexer.mll8
1 files changed, 5 insertions, 3 deletions
diff --git a/parsing/lexer.mll b/parsing/lexer.mll
index d856efff4..c2e693dc4 100644
--- a/parsing/lexer.mll
+++ b/parsing/lexer.mll
@@ -136,9 +136,11 @@ let char_for_decimal_code lexbuf i =
let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
(Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48) in
- if (c < 0 || c > 255) && not (in_comment ())
- then raise (Error(Illegal_escape (Lexing.lexeme lexbuf),
- Location.curr lexbuf))
+ if (c < 0 || c > 255) then
+ if in_comment ()
+ then 'x'
+ else raise (Error(Illegal_escape (Lexing.lexeme lexbuf),
+ Location.curr lexbuf))
else Char.chr c
let char_for_hexadecimal_code lexbuf i =