diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2003-03-31 16:13:17 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2003-03-31 16:13:17 +0000 |
commit | 97247d3dbe0df05ba83cb3f3ba3b19665b7efbf1 (patch) | |
tree | 9bd950d609baee68974fd5ed5a6e02edd94cdb0e | |
parent | f5c51505edd6a1f55b5f98742d5cf58c1f5195f6 (diff) |
(* f '\x00' '"' *)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5469 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | parsing/lexer.mll | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/parsing/lexer.mll b/parsing/lexer.mll index 40bffe914..8fedd63c1 100644 --- a/parsing/lexer.mll +++ b/parsing/lexer.mll @@ -284,13 +284,13 @@ rule token = parse CHAR (Lexing.lexeme_char lexbuf 1) } | "'" [^ '\\' '\'' '\010' '\013'] "'" { CHAR(Lexing.lexeme_char lexbuf 1) } - | "'" '\\' ['\\' '\'' '"' 'n' 't' 'b' 'r'] "'" + | "'\\" ['\\' '\'' '"' 'n' 't' 'b' 'r'] "'" { CHAR(char_for_backslash (Lexing.lexeme_char lexbuf 2)) } - | "'" '\\' ['0'-'9'] ['0'-'9'] ['0'-'9'] "'" + | "'\\" ['0'-'9'] ['0'-'9'] ['0'-'9'] "'" { CHAR(char_for_decimal_code lexbuf 2) } - | "'" '\\' 'x' ['0'-'9' 'a'-'f' 'A'-'F'] ['0'-'9' 'a'-'f' 'A'-'F'] "'" + | "'\\" 'x' ['0'-'9' 'a'-'f' 'A'-'F'] ['0'-'9' 'a'-'f' 'A'-'F'] "'" { CHAR(char_for_hexadecimal_code lexbuf 3) } - | "'" '\\' _ + | "'\\" _ { let l = Lexing.lexeme lexbuf in let esc = String.sub l 1 (String.length l - 1) in raise (Error(Illegal_escape esc, Location.curr lexbuf)) @@ -417,6 +417,8 @@ and comment = parse { comment lexbuf } | "'\\" ['0'-'9'] ['0'-'9'] ['0'-'9'] "'" { comment lexbuf } + | "'\\" 'x' ['0'-'9' 'a'-'f' 'A'-'F'] ['0'-'9' 'a'-'f' 'A'-'F'] "'" + { comment lexbuf } | eof { match !comment_start_loc with | [] -> assert false |