Commit 09de9094 authored by Julien Lopez's avatar Julien Lopez
Browse files

Fix commit b9452c22

parent b9452c22
...@@ -186,6 +186,8 @@ let regexp qname = (ncname ':')? ncname ...@@ -186,6 +186,8 @@ let regexp qname = (ncname ':')? ncname
(* Should be [^ xml_letter ] *) (* Should be [^ xml_letter ] *)
let regexp not_xml_letter = [^ 'A'-'Z' 'a'-'z' '0'-'9' '_' ] let regexp not_xml_letter = [^ 'A'-'Z' 'a'-'z' '0'-'9' '_' ]
let regexp character = _ | '\\' ['\\' '"' '\''] | "\\n" | "\\t" | "\\r"
| '\\' 'x' ['0'-'9' 'a'-'f' 'A'-'F']+ ';' | '\\' ['0'-'9']+ ';'
let illegal lexbuf = let illegal lexbuf =
error error
...@@ -226,7 +228,7 @@ let rec token = lexer ...@@ -226,7 +228,7 @@ let rec token = lexer
string (L.lexeme_start lexbuf) '"' lexbuf; string (L.lexeme_start lexbuf) '"' lexbuf;
let s = get_stored_string () in let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING s) return_loc start (L.lexeme_end lexbuf) (STRING s)
| "'" [^ "'"]+ "'" -> | "'" character "'" ->
L.rollback lexbuf; L.rollback lexbuf;
(fun _ -> lexer (fun _ -> lexer
| "'" -> let start = L.lexeme_start lexbuf in | "'" -> let start = L.lexeme_start lexbuf in
...@@ -280,7 +282,7 @@ and token2 = lexer ...@@ -280,7 +282,7 @@ and token2 = lexer
string (L.lexeme_start lexbuf) '"' lexbuf; string (L.lexeme_start lexbuf) '"' lexbuf;
let s = get_stored_string () in let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING s) return_loc start (L.lexeme_end lexbuf) (STRING s)
| "'" [^ "'"]+ "'--'" [^ "'"]+ "'" | "'" character "'--'" character "'"
| "'" [^ '\'']+ "'" not_xml_letter -> | "'" [^ '\'']+ "'" not_xml_letter ->
L.rollback lexbuf; L.rollback lexbuf;
(fun _ -> lexer (fun _ -> lexer
...@@ -345,7 +347,7 @@ and token2toplevel = lexer ...@@ -345,7 +347,7 @@ and token2toplevel = lexer
string (L.lexeme_start lexbuf) '"' lexbuf; string (L.lexeme_start lexbuf) '"' lexbuf;
let s = get_stored_string () in let s = get_stored_string () in
return_loc start (L.lexeme_end lexbuf) (STRING s) return_loc start (L.lexeme_end lexbuf) (STRING s)
| "'" [^ "'"]+ "'--'" [^ "'"]+ "'" | "'" character "'--'" character "'"
| "'" ((";"[^ ";'"]) | [^ ";'"])* ";"? "'" not_xml_letter -> | "'" ((";"[^ ";'"]) | [^ ";'"])* ";"? "'" not_xml_letter ->
L.rollback lexbuf; L.rollback lexbuf;
(fun _ -> lexer (fun _ -> lexer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment