comparison src/jscomp.sml @ 651:bab524996fca

Noisy demo
author Adam Chlipala <adamc@hcoop.net>
date Tue, 10 Mar 2009 17:29:03 -0400
parents 96ebc6bdb5a0
children b0c1a46b1f15
comparison
equal deleted inserted replaced
650:fcf0bd3d1667 651:bab524996fca
893 | EClosure _ => unsupported "EClosure" 893 | EClosure _ => unsupported "EClosure"
894 | EQuery _ => unsupported "Query" 894 | EQuery _ => unsupported "Query"
895 | EDml _ => unsupported "DML" 895 | EDml _ => unsupported "DML"
896 | ENextval _ => unsupported "Nextval" 896 | ENextval _ => unsupported "Nextval"
897 | EUnurlify _ => unsupported "EUnurlify" 897 | EUnurlify _ => unsupported "EUnurlify"
898 (*| EJavaScript (_, e as (EAbs _, _), _) =>
899 let
900 val (e, st) = jsE inner (e, st)
901 in
902 (strcat [str "\"cr(\"+ca(",
903 e,
904 str ")+\")\""],
905 st)
906 end*)
907 | EJavaScript (_, e, _) => 898 | EJavaScript (_, e, _) =>
908 let 899 let
909 val (e, st) = jsE inner (e, st) 900 val (e, st) = jsE inner (e, st)
910 in 901 in
911 (strcat [str "\"cr(\"+ca(function(){return ", 902 (strcat [str "\"cr(\"+ca(function(){return ",
980 in 971 in
981 (EJavaScript (m, orig, SOME (strcat (#2 e) (locals @ [e]))), st) 972 (EJavaScript (m, orig, SOME (strcat (#2 e) (locals @ [e]))), st)
982 end 973 end
983 in 974 in
984 case e of 975 case e of
985 EJavaScript (m, orig as (EAbs (_, t, _, e), _), NONE) => 976 EJavaScript (m, orig, NONE) =>
986 doCode m 1 (t :: env) orig e
987 | EJavaScript (m, orig, NONE) =>
988 doCode m 0 env orig orig 977 doCode m 0 env orig orig
989 | _ => (e, st) 978 | _ => (e, st)
990 end, 979 end,
991 decl = fn (_, e, st) => (e, st), 980 decl = fn (_, e, st) => (e, st),
992 bind = fn (env, U.Decl.RelE (_, t)) => t :: env 981 bind = fn (env, U.Decl.RelE (_, t)) => t :: env