summaryrefslogtreecommitdiff
path: root/src/urweb.lex
diff options
context:
space:
mode:
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