diff src/urweb.lex @ 838:5154a047c6bc

Lexing some more string escape sequences; JS versions of number read; fix problem with signature unification; escape < more often in Jscomp
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Jun 2009 19:28:25 -0400
parents 395a5d450cc0
children d1b6acaec265
line wrap: on
line diff
--- a/src/urweb.lex	Tue Jun 02 15:43:18 2009 -0400
+++ b/src/urweb.lex	Tue Jun 02 19:28:25 2009 -0400
@@ -193,11 +193,15 @@
 <COMMENT> "*)"        => (if exitComment () then YYBEGIN INITIAL else ();
 			  continue ());
 
+<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> "\\\""         => (str := #"\"" :: !str; continue());
-<CHAR> "\\'"          => (str := #"'" :: !str; continue());
-<CHAR> "\n"           => (newline yypos;
-			  str := #"\n" :: !str; continue());
+
 <CHAR> .              => (let
                               val ch = String.sub (yytext, 0)
                           in
@@ -220,10 +224,7 @@
 
 <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