comparison src/jscomp.sml @ 973:e30c2409c9d0

More interpreter debugging
author Adam Chlipala <adamc@hcoop.net>
date Tue, 22 Sep 2009 13:41:23 -0400
parents 8371d12ae63f
children b851675a2c3d
comparison
equal deleted inserted replaced
972:733f67bb64e7 973:e30c2409c9d0
688 | "-" => "neg" 688 | "-" => "neg"
689 | _ => raise Fail "Jscomp: Unknown unary operator" 689 | _ => raise Fail "Jscomp: Unknown unary operator"
690 690
691 val (e, st) = jsE inner (e, st) 691 val (e, st) = jsE inner (e, st)
692 in 692 in
693 (strcat [str ("{c:\"f\",f:" ^ name ^ ",:a:cons("), 693 (strcat [str ("{c:\"f\",f:" ^ name ^ ",a:cons("),
694 e, 694 e,
695 str ",null)}"], 695 str ",null)}"],
696 st) 696 st)
697 end 697 end
698 | EBinop (s, e1, e2) => 698 | EBinop (s, e1, e2) =>
726 val (es, st) = 726 val (es, st) =
727 foldr (fn ((x, e, _), (es, st)) => 727 foldr (fn ((x, e, _), (es, st)) =>
728 let 728 let
729 val (e, st) = jsE inner (e, st) 729 val (e, st) = jsE inner (e, st)
730 in 730 in
731 (strcat [str ("cons({n:\"" ^ x ^ ",v:"), 731 (strcat [str ("cons({n:\"" ^ x ^ "\",v:"),
732 e, 732 e,
733 str "},", 733 str "},",
734 es, 734 es,
735 str ")"], 735 str ")"],
736 st) 736 st)