summaryrefslogtreecommitdiff
path: root/src/urweb.lex
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 19:28:25 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 19:28:25 -0400
commit07f80839011b33db760cdac421ccea6226b07111 (patch)
tree426b37ee6b714afc0a597600850846d73c9d41a7 /src/urweb.lex
parentaca4dfb6dc232643850cda851bed1421acfc693a (diff)
Lexing some more string escape sequences; JS versions of number read; fix problem with signature unification; escape < more often in Jscomp
Diffstat (limited to 'src/urweb.lex')
-rw-r--r--src/urweb.lex17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/urweb.lex b/src/urweb.lex
index b2f715d5..c23dfe62 100644
--- a/src/urweb.lex
+++ b/src/urweb.lex
@@ -193,11 +193,15 @@ notags = [^<{\n]+;
<COMMENT> "*)" => (if exitComment () then YYBEGIN INITIAL else ();
continue ());
-<INITIAL> "#\"" => (YYBEGIN CHAR; strEnder := #"\""; strStart := pos yypos; str := []; continue());
-<CHAR> "\\\"" => (str := #"\"" :: !str; continue());
-<CHAR> "\\'" => (str := #"'" :: !str; continue());
-<CHAR> "\n" => (newline yypos;
+<STRING,CHAR> "\\\"" => (str := #"\"" :: !str; continue());
+<STRING,CHAR> "\\'" => (str := #"'" :: !str; continue());
+<STRING,CHAR> "\\n" => (str := #"\n" :: !str; continue());
+<STRING,CHAR> "\\t" => (str := #"\t" :: !str; continue());
+<STRING,CHAR> "\n" => (newline yypos;
str := #"\n" :: !str; continue());
+
+<INITIAL> "#\"" => (YYBEGIN CHAR; strEnder := #"\""; strStart := pos yypos; str := []; continue());
+
<CHAR> . => (let
val ch = String.sub (yytext, 0)
in
@@ -220,10 +224,7 @@ notags = [^<{\n]+;
<INITIAL> "\"" => (YYBEGIN STRING; strEnder := #"\""; strStart := pos yypos; str := []; continue());
<INITIAL> "'" => (YYBEGIN STRING; strEnder := #"'"; strStart := pos yypos; str := []; continue());
-<STRING> "\\\"" => (str := #"\"" :: !str; continue());
-<STRING> "\\'" => (str := #"'" :: !str; continue());
-<STRING> "\n" => (newline yypos;
- str := #"\n" :: !str; continue());
+
<STRING> . => (let
val ch = String.sub (yytext, 0)
in