comparison src/jscomp.sml @ 603:b1064de2b1f9

dlist example working
author Adam Chlipala <adamc@hcoop.net>
date Fri, 16 Jan 2009 15:49:10 -0500
parents 7c3c21eb5b4c
children 330a7de47914
comparison
equal deleted inserted replaced
602:1d34d916c206 603:b1064de2b1f9
484 included = IS.add (#included st, n), 484 included = IS.add (#included st, n),
485 injectors = #injectors st, 485 injectors = #injectors st,
486 maxName = #maxName st} 486 maxName = #maxName st}
487 487
488 val (e, st) = jsExp mode skip [] 0 (e, st) 488 val (e, st) = jsExp mode skip [] 0 (e, st)
489 val () = Print.prefaces "Pre-e" [("e", MonoPrint.p_exp MonoEnv.empty e)]
490 val e = deStrcat 0 e 489 val e = deStrcat 0 e
491 490
492 val sc = "_n" ^ Int.toString n ^ "=" ^ e ^ ";\n" 491 val sc = "_n" ^ Int.toString n ^ "=" ^ e ^ ";\n"
493 in 492 in
494 {decls = #decls st, 493 {decls = #decls st,
757 e2, 756 e2,
758 str ")"], st) 757 str ")"], st)
759 end 758 end
760 759
761 | EJavaScript (Source _, _, SOME _) => (e, st) 760 | EJavaScript (Source _, _, SOME _) => (e, st)
762 | EJavaScript (_, _, SOME e) => ((EFfiApp ("Basis", "jsifyString", [e]), loc), st) 761 | EJavaScript (_, _, SOME e) =>
762 (strcat [str "\"cr(\"+ca(function(){return ",
763 e,
764 str "})+\")\""],
765 st)
763 766
764 | EClosure _ => unsupported "EClosure" 767 | EClosure _ => unsupported "EClosure"
765 | EQuery _ => unsupported "Query" 768 | EQuery _ => unsupported "Query"
766 | EDml _ => unsupported "DML" 769 | EDml _ => unsupported "DML"
767 | ENextval _ => unsupported "Nextval" 770 | ENextval _ => unsupported "Nextval"
768 | EUnurlify _ => unsupported "EUnurlify" 771 | EUnurlify _ => unsupported "EUnurlify"
769 | EJavaScript (_, e, _) => 772 | EJavaScript (_, e, _) =>
770 let 773 let
771 val (e, st) = jsE inner (e, st) 774 val (e, st) = jsE inner (e, st)
772 in 775 in
773 ((EFfiApp ("Basis", "jsifyString", [e]), loc), st) 776 (strcat [str "\"cr(\"+ca(function(){return ",
777 e,
778 str "})+\")\""],
779 st)
774 end 780 end
775 781
776 | ESignalReturn e => 782 | ESignalReturn e =>
777 let 783 let
778 val (e, st) = jsE inner (e, st) 784 val (e, st) = jsE inner (e, st)