diff options
Diffstat (limited to 'parsing/lexer.mll')
-rw-r--r-- | parsing/lexer.mll | 8 |
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 = |