comparison src/monoize.sml @ 578:1e589a60b86f

Harmonized source-setting between server and client
author Adam Chlipala <adamc@hcoop.net>
date Tue, 30 Dec 2008 11:33:31 -0500
parents 3d56940120b1
children 57f476c934da
comparison
equal deleted inserted replaced
577:3d56940120b1 578:1e589a60b86f
974 val t = monoType env t 974 val t = monoType env t
975 in 975 in
976 ((L'.EAbs ("x", t, (L'.TFun ((L'.TRecord [], loc), (L'.TSource, loc)), loc), 976 ((L'.EAbs ("x", t, (L'.TFun ((L'.TRecord [], loc), (L'.TSource, loc)), loc),
977 (L'.EAbs ("_", (L'.TRecord [], loc), (L'.TSource, loc), 977 (L'.EAbs ("_", (L'.TRecord [], loc), (L'.TSource, loc),
978 (L'.EFfiApp ("Basis", "new_client_source", 978 (L'.EFfiApp ("Basis", "new_client_source",
979 [(L'.EJavaScript (L'.File, (L'.ERel 1, loc)), loc)]), loc)), loc)), 979 [(L'.EJavaScript (L'.File, (L'.ERel 1, loc), NONE), loc)]),
980 loc)), loc)),
980 loc), 981 loc),
981 fm) 982 fm)
982 end 983 end
983 | L.ECApp ((L.EFfi ("Basis", "set"), _), t) => 984 | L.ECApp ((L.EFfi ("Basis", "set"), _), t) =>
984 let 985 let
988 (L'.TFun (t, (L'.TFun ((L'.TRecord [], loc), (L'.TRecord [], loc)), loc)), loc), 989 (L'.TFun (t, (L'.TFun ((L'.TRecord [], loc), (L'.TRecord [], loc)), loc)), loc),
989 (L'.EAbs ("v", t, (L'.TFun ((L'.TRecord [], loc), (L'.TRecord [], loc)), loc), 990 (L'.EAbs ("v", t, (L'.TFun ((L'.TRecord [], loc), (L'.TRecord [], loc)), loc),
990 (L'.EAbs ("_", (L'.TRecord [], loc), (L'.TRecord [], loc), 991 (L'.EAbs ("_", (L'.TRecord [], loc), (L'.TRecord [], loc),
991 (L'.EFfiApp ("Basis", "set_client_source", 992 (L'.EFfiApp ("Basis", "set_client_source",
992 [(L'.ERel 2, loc), 993 [(L'.ERel 2, loc),
993 (L'.EJavaScript (L'.File, (L'.ERel 1, loc)), loc)]), 994 (L'.EJavaScript (L'.File, (L'.ERel 1, loc), NONE), loc)]),
994 loc)), loc)), loc)), loc), 995 loc)), loc)), loc)), loc),
995 fm) 996 fm)
996 end 997 end
997 998
998 | L.EApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "return"), _), _), _), t), _), 999 | L.EApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "return"), _), _), _), t), _),
1799 in 1800 in
1800 ((L'.EStrcat (s, 1801 ((L'.EStrcat (s,
1801 (L'.EStrcat ( 1802 (L'.EStrcat (
1802 (L'.EPrim (Prim.String s'), loc), 1803 (L'.EPrim (Prim.String s'), loc),
1803 (L'.EStrcat ( 1804 (L'.EStrcat (
1804 (L'.EJavaScript (L'.Attribute, e), loc), 1805 (L'.EJavaScript (L'.Attribute, e, NONE), loc),
1805 (L'.EPrim (Prim.String "'"), loc)), loc)), 1806 (L'.EPrim (Prim.String "'"), loc)), loc)),
1806 loc)), loc), 1807 loc)), loc),
1807 fm) 1808 fm)
1808 end 1809 end
1809 | _ => 1810 | _ =>
1885 (L'.EFfiApp ("Basis", "get_script", [(L'.ERecord [], loc)]), 1886 (L'.EFfiApp ("Basis", "get_script", [(L'.ERecord [], loc)]),
1886 loc)), loc)) 1887 loc)), loc))
1887 1888
1888 | "dyn" => 1889 | "dyn" =>
1889 (case #1 attrs of 1890 (case #1 attrs of
1890 (*L'.ERecord [("Signal", (L'.EApp ((L'.EAbs (_, _, _, (L'.ESignalReturn (L'.ERel 0, _), _)), _), 1891 L'.ERecord [("Signal", (L'.EApp ((L'.EAbs (_, _, _, (L'.ESignalReturn (L'.ERel 0, _), _)), _),
1891 e), _), _)] => (e, fm) *) 1892 e), _), _)] => (e, fm)
1892 1893 | L'.ERecord [("Signal", e, _)] =>
1893 L'.ERecord [("Signal", e, _)] =>
1894 ((L'.EStrcat 1894 ((L'.EStrcat
1895 ((L'.EPrim (Prim.String "<script type=\"text/javascript\">dyn("), loc), 1895 ((L'.EPrim (Prim.String "<script type=\"text/javascript\">dyn("), loc),
1896 (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc), 1896 (L'.EStrcat ((L'.EJavaScript (L'.Script, e, NONE), loc),
1897 (L'.EPrim (Prim.String ")</script>"), loc)), loc)), loc), 1897 (L'.EPrim (Prim.String ")</script>"), loc)), loc)), loc),
1898 fm) 1898 fm)
1899 | _ => raise Fail "Monoize: Bad dyn attributes") 1899 | _ => raise Fail "Monoize: Bad dyn attributes")
1900 1900
1901 | "submit" => normal ("input type=\"submit\"", NONE, NONE) 1901 | "submit" => normal ("input type=\"submit\"", NONE, NONE)