comparison src/jscomp.sml @ 980:134e8a4de36b

demo/more compiles; small problem left with foreign keys in Grid1
author Adam Chlipala <adamc@hcoop.net>
date Thu, 24 Sep 2009 11:15:21 -0400
parents e1f3f1ea8cff
children dfe34fad749d
comparison
equal deleted inserted replaced
979:3612ff0c6a10 980:134e8a4de36b
684 | EUnop (s, e) => 684 | EUnop (s, e) =>
685 let 685 let
686 val name = case s of 686 val name = case s of
687 "!" => "not" 687 "!" => "not"
688 | "-" => "neg" 688 | "-" => "neg"
689 | _ => raise Fail "Jscomp: Unknown unary operator" 689 | _ => raise Fail ("Jscomp: Unknown unary operator " ^ s)
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,
705 | "*" => "times" 705 | "*" => "times"
706 | "/" => "div" 706 | "/" => "div"
707 | "%" => "mod" 707 | "%" => "mod"
708 | "<" => "lt" 708 | "<" => "lt"
709 | "<=" => "le" 709 | "<=" => "le"
710 | _ => raise Fail "Jscomp: Unknown binary operator" 710 | "strcmp" => "strcmp"
711 | _ => raise Fail ("Jscomp: Unknown binary operator " ^ s)
711 712
712 val (e1, st) = jsE inner (e1, st) 713 val (e1, st) = jsE inner (e1, st)
713 val (e2, st) = jsE inner (e2, st) 714 val (e2, st) = jsE inner (e2, st)
714 in 715 in
715 (strcat [str ("{c:\"f\",f:" ^ name ^ ",a:cons("), 716 (strcat [str ("{c:\"f\",f:" ^ name ^ ",a:cons("),