changeset 1366:1595a738e4e9

JavaScript compilation of time comparison; fix lexing of XML that includes open parens
author Adam Chlipala <adam@chlipala.net>
date Fri, 24 Dec 2010 18:55:13 -0500
parents b02cb9da5686
children 8301ee4ab58c
files src/settings.sml src/urweb.lex
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/settings.sml	Fri Dec 24 18:08:29 2010 -0500
+++ b/src/settings.sml	Fri Dec 24 18:55:13 2010 -0500
@@ -211,7 +211,11 @@
                           ("toupper", "toUpper"),
 
                           ("checkUrl", "checkUrl"),
-                          ("bless", "bless")]
+                          ("bless", "bless"),
+
+                          ("eq_time", "eq"),
+                          ("lt_time", "lt"),
+                          ("le_time", "le")]
 val jsFuncs = ref jsFuncsBase
 fun setJsFuncs ls = jsFuncs := foldl (fn ((k, v), m) => M.insert (m, k, v)) jsFuncsBase ls
 fun jsFunc x = M.find (!jsFuncs, x)
--- a/src/urweb.lex	Fri Dec 24 18:08:29 2010 -0500
+++ b/src/urweb.lex	Fri Dec 24 18:55:13 2010 -0500
@@ -172,7 +172,7 @@
 ws = [\ \t\012];
 intconst = [0-9]+;
 realconst = [0-9]+\.[0-9]*;
-notags = ([^<{\n(]|(\([^\*]))+;
+notags = ([^<{\n(]|(\([^\*<{\n]))+;
 xcom = ([^\-]|(-[^\-]))+;
 oint = [0-9][0-9][0-9];
 xint = x[0-9a-fA-F][0-9a-fA-F];
@@ -338,6 +338,8 @@
 
 <XML> {notags}        => (Tokens.NOTAGS (unescape (yypos, yypos + size yytext) yytext, yypos, yypos + size yytext));
 
+<XML> "("             => (Tokens.NOTAGS ("(", yypos, yypos + size yytext));
+
 <XML> .               => (ErrorMsg.errorAt' (yypos, yypos)
                           ("illegal XML character: \"" ^ yytext ^ "\"");
                           continue ());