1. camlspotter
  2. spotlib

Commits

camlspotter  committed 2436a3c

fix

  • Participants
  • Parent commits 5677ae6
  • Branches default

Comments (0)

Files changed (2)

File OMakefile

View file
 
 MyOCamlProgram(gen_phantom, $(PHANTOM_GEN))
 
-phantom2.ml: phantom2_head.ml phantom2_tail.ml gen_phantom.run
-    ./gen_phantom.run ml > $@
-
-phantom2.mli: phantom2_head.mli phantom2_tail.mli gen_phantom.run
-    ./gen_phantom.run mli > $@
-
-clean:
-	rm -f phantom2.ml phantom2.mli
+# phantom2.ml: phantom2_head.ml phantom2_tail.ml gen_phantom.run
+#     ./gen_phantom.run ml > $@
+# 
+# phantom2.mli: phantom2_head.mli phantom2_tail.mli gen_phantom.run
+#     ./gen_phantom.run mli > $@
+# 
+# clean:
+# 	rm -f phantom2.ml phantom2.mli

File gen_phantom.ml

View file
            t) (Xlist.from_to 1 n)
 
 let max = 3
-
 let type_ts ppf n =
   let kwd = if n = 0 then "type" else "and" in
   fprintf ppf "%s %a = <@." kwd ts n;
            (fun ppf i -> fprintf ppf "v%d" i)) (Xlist.from_to 1 n)
   
 let def_ts ppf n =
-  let kwd = if n = 0 then "let rec" else "and" in
-  fprintf ppf "%s %a = object@." kwd call n;
+  fprintf ppf "let %a = object@." call n;
   fprintf ppf "  method list = %a@." def_list n;
   fprintf ppf "  method array = %a@." def_array n;
   fprintf ppf "  method get = %a@." def_get n;
         for i = 0 to max do
           type_ts std_formatter i
         done;
-        for i = 0 to max do
+        for i = max downto 0 do
           def_ts std_formatter i
         done;
         cat "phantom2_tail.ml"