Commits

j...@vmware  committed 6de1b4e

recursive module

  • Participants
  • Parent commits fa41b0c
  • Branches default

Comments (0)

Files changed (7)

File 0SPOT

Empty file removed.

File ocamlspot/tests/.depend

 test14.cmx: 
 test16.cmo: test15.cmi 
 test16.cmx: test15.cmi 
+test17.cmo: 
+test17.cmx: 
+test18.cmo: 
+test18.cmx: 
+test19.cmo: 
+test19.cmx: 
+test20.cmo: test18.cmo 
+test20.cmx: test18.cmx 
 test3.cmo: 
 test3.cmx: 
-test5.cmo: 
-test5.cmx: 
+test5.cmo: dir1/test4.cmo 
+test5.cmx: dir1/test4.cmx 
 test7.cmo: 
 test7.cmx: 
 test8.cmo: test7.cmo 

File ocamlspot/tests/Makefile

 # Requires unix!
 COMPFLAGS= $(INCLUDES_DEP) -I $(OTHERS)/unix
 
-all: test.cmo test1.cmo test2.cmo test3.cmo dir1/test4.cmo test5.cmo dir2/test6.cmo test7.cmo test8.cmo test9.cmo test10.cmo test11.cmo test12.cmo test13.cmo test14.cmo test16.cmo test17.cmo test18.cmo test19.cmo test20.cmo
+include Makefile.targets
+
+all: test2.cmo $(TARGETS) 
 
 test2.cmo: test.cmo
 	$(OCAMLC) -pack -o $@ $<
 beforedepend::
 
 depend: beforedepend
-	$(CAMLRUN) ../../tools/ocamldep $(INCLUDES) *.mli *.ml */*.mli */*.ml > .depend
+	$(CAMLRUN) ../../tools/ocamldep $(INCLUDES) -I dir1 -I dir2 *.mli *.ml */*.mli */*.ml > .depend
+
+Makefile.targets: *.ml *.mli */*.ml
+	echo TARGETS= \\ > $@
+	ls *.ml *.mli | sed -e 's/mli/cmi/' -e 's/ml/cmo/' -e 's/$$/ \\/'	 >> $@
 
 .PHONY: clean install installopt beforedepend depend
 

File ocamlspot/tests/Makefile.targets

+TARGETS= \
+module_use.cmo \
+recmodule.cmo \
+test.cmo \
+test1.cmo \
+test10.cmo \
+test11.cmo \
+test12.cmo \
+test13.cmo \
+test14.cmo \
+test15.cmi \
+test16.cmo \
+test17.cmo \
+test18.cmo \
+test19.cmo \
+test20.cmo \
+test3.cmo \
+test5.cmo \
+test7.cmo \
+test8.cmo \
+test9.cmo \

File ocamlspot/tests/module_use.ml

+(* F => *) module F (A : sig end) = struct end (* <= F *) 
+
+(* N => *) module N = struct end (* <= N *)
+
+module M = F (* ? F *) (N (* ? N *))

File ocamlspot/tests/recmodule.ml

+module rec M : sig val f : unit -> unit end = (* M => *) struct
+
+  include N (* ? N *)
+
+  let (* M.f => *) f (* <= M.f *) () = N.g (* ? N.g *) ()
+
+end (* <= M *) and N : sig val g : unit -> unit end = (* N => *) struct
+
+  include M (* ? M *) 
+
+  let (* N.g => *) g (* <= N.g *) () = M.f (* ? M.f *) ()
+
+end (* <= N *)

File typing/typemod.ml

         let modl = type_module  (anchor_submodule name anchor) env smodl in
         let mty = enrich_module_type anchor name modl.mod_type env in
         let (id, newenv) = Env.enter_module name mty env in
+	(* CRv2 jfuruse: pos for name? *)
 	Spot.Annot.record loc 
 	  (Spot.Annot.Str 
 	     (Spot.Abstraction.Str_module 
                 enrich_module_type anchor (Ident.name id) modl.mod_type newenv in
               (id, mty, modl, mty'))
            decls sbind in
+	(* CRv2 jfuruse: pos for name? *)
 	List.iter (fun (id, _, modl, _) ->
-	  Spot.Annot.record loc 
+	  Spot.Annot.record modl.mod_loc
 	    (Spot.Annot.Str 
 	       (Spot.Abstraction.Str_module 
 		  (id,