summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-12-24 18:55:13 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2010-12-24 18:55:13 -0500
commit43323a06bfe156d4fe39e50bb96898bb985e41a6 (patch)
tree236e0f667ec8db7a6605a4dcb8571a481038441f
parent3fb7afdd3043b1b0cbaa6e15386bc5862d84d5be (diff)
JavaScript compilation of time comparison; fix lexing of XML that includes open parens
-rw-r--r--src/settings.sml6
-rw-r--r--src/urweb.lex4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/settings.sml b/src/settings.sml
index 97c39abf..5b4bbe2c 100644
--- a/src/settings.sml
+++ b/src/settings.sml
@@ -211,7 +211,11 @@ val jsFuncsBase = basisM [("alert", "alert"),
("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)
diff --git a/src/urweb.lex b/src/urweb.lex
index fa8c5dde..371d69a7 100644
--- a/src/urweb.lex
+++ b/src/urweb.lex
@@ -172,7 +172,7 @@ cid = [A-Z][A-Za-z0-9_]*;
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 @@ xint = x[0-9a-fA-F][0-9a-fA-F];
<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 ());