diff options
author | Adam Chlipala <adam@chlipala.net> | 2010-12-24 18:55:13 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2010-12-24 18:55:13 -0500 |
commit | 928db0bf3aa8a149d0e1632f07eb7672ec65add3 (patch) | |
tree | 236e0f667ec8db7a6605a4dcb8571a481038441f | |
parent | 318b5ebe2d34aa2bd2496765695308976da9ea1e (diff) |
JavaScript compilation of time comparison; fix lexing of XML that includes open parens
-rw-r--r-- | src/settings.sml | 6 | ||||
-rw-r--r-- | src/urweb.lex | 4 |
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 ()); |