changeset 1177:26fed2c4f5be

Louder jscomp; toUpper/Lower fix for JavaScript
author Adam Chlipala <adamc@hcoop.net>
date Thu, 04 Mar 2010 13:47:16 -0500
parents 51e596feec37
children 6373a0432338
files lib/js/urweb.js lib/ur/top.ur lib/ur/top.urs src/jscomp.sml
diffstat 4 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Tue Mar 02 16:00:48 2010 -0500
+++ b/lib/js/urweb.js	Thu Mar 04 13:47:16 2010 -0500
@@ -33,8 +33,8 @@
 function isBlank(c) { return c == ' ' || c == '\t'; }
 function isSpace(c) { return isBlank(c) || c == '\r' || c == '\n'; }
 function isXdigit(c) { return isDigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); }
-function toLower(c) { return c.toLowercase(); }
-function toUpper(c) { return c.toUppercase(); }
+function toLower(c) { return c.toLowerCase(); }
+function toUpper(c) { return c.toUpperCase(); }
 
 
 // Lists
--- a/lib/ur/top.ur	Tue Mar 02 16:00:48 2010 -0500
+++ b/lib/ur/top.ur	Thu Mar 04 13:47:16 2010 -0500
@@ -215,6 +215,14 @@
           <xml>{f [nm] [t] [rest] ! r1 r2 r3}{acc}</xml>)
       <xml/>
 
+fun query1 [t ::: Name] [fs ::: {Type}] [state ::: Type] (q : sql_query [t = fs] [])
+           (f : $fs -> state -> transaction state) (i : state) =
+    query q (fn r => f r.t) i
+
+fun query1' [t ::: Name] [fs ::: {Type}] [state ::: Type] (q : sql_query [t = fs] [])
+            (f : $fs -> state -> state) (i : state) =
+    query q (fn r s => return (f r.t s)) i
+
 fun queryL [tables] [exps] [tables ~ exps] (q : sql_query tables exps) =
     query q
     (fn r ls => return (r :: ls))
--- a/lib/ur/top.urs	Tue Mar 02 16:00:48 2010 -0500
+++ b/lib/ur/top.urs	Thu Mar 04 13:47:16 2010 -0500
@@ -129,6 +129,18 @@
                   sql_query tables exps
                   -> transaction (list $(exps ++ map (fn fields :: {Type} => $fields) tables))
 
+val query1 : t ::: Name -> fs ::: {Type} -> state ::: Type
+             -> sql_query [t = fs] []
+             -> ($fs -> state -> transaction state)
+             -> state
+             -> transaction state
+
+val query1' : t ::: Name -> fs ::: {Type} -> state ::: Type
+              -> sql_query [t = fs] []
+              -> ($fs -> state -> state)
+              -> state
+              -> transaction state
+
 val queryI : tables ::: {{Type}} -> exps ::: {Type}
              -> [tables ~ exps] =>
              sql_query tables exps
--- a/src/jscomp.sml	Tue Mar 02 16:00:48 2010 -0500
+++ b/src/jscomp.sml	Thu Mar 04 13:47:16 2010 -0500
@@ -1,4 +1,4 @@
-(* Copyright (c) 2008, Adam Chlipala
+(* Copyright (c) 2008-2010, Adam Chlipala
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1173,7 +1173,9 @@
                | EJavaScript (m, e') =>
                  (foundJavaScript := true;
                   jsExp m outer (e', st)
-                  handle CantEmbed t => ((*Print.preface ("Can't embed", MonoPrint.p_typ MonoEnv.empty t);*)
+                  handle CantEmbed t => ((*ErrorMsg.errorAt loc "Unable to embed type in JavaScript";*)
+                                         Print.preface ("Can't embed type in JavaScript",
+                                                        MonoPrint.p_typ MonoEnv.empty t);
                                          (e, st)))
 
                | ESignalReturn e =>