diff -Naur ocaml-3.11.0/.depend ocaml-3.11.0-enhtop+/.depend --- ocaml-3.11.0/.depend 2008-10-15 09:12:58.000000000 -0400 +++ ocaml-3.11.0-enhtop+/.depend 2009-03-24 10:55:08.035481797 -0400 @@ -789,7 +789,7 @@ toplevel/topdirs.cmi: parsing/longident.cmi toplevel/toploop.cmi: utils/warnings.cmi typing/types.cmi typing/path.cmi \ parsing/parsetree.cmi typing/outcometree.cmi parsing/longident.cmi \ - parsing/location.cmi typing/env.cmi + parsing/location.cmi typing/ident.cmi typing/env.cmi toplevel/topmain.cmi: toplevel/trace.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \ typing/env.cmi @@ -797,6 +797,16 @@ utils/misc.cmi typing/ident.cmi bytecomp/bytesections.cmi toplevel/expunge.cmx: bytecomp/symtable.cmx bytecomp/runtimedef.cmx \ utils/misc.cmx typing/ident.cmx bytecomp/bytesections.cmx +toplevel/genprinttyp.cmo: typing/types.cmi typing/primitive.cmi \ + typing/predef.cmi typing/path.cmi typing/outcometree.cmi \ + typing/oprint.cmi utils/misc.cmi parsing/longident.cmi typing/ident.cmi \ + typing/env.cmi typing/ctype.cmi utils/clflags.cmi typing/btype.cmi \ + parsing/asttypes.cmi +toplevel/genprinttyp.cmx: typing/types.cmx typing/primitive.cmx \ + typing/predef.cmx typing/path.cmx typing/outcometree.cmi \ + typing/oprint.cmx utils/misc.cmx parsing/longident.cmx typing/ident.cmx \ + typing/env.cmx typing/ctype.cmx utils/clflags.cmx typing/btype.cmx \ + parsing/asttypes.cmi toplevel/genprintval.cmo: typing/types.cmi typing/printtyp.cmi \ typing/predef.cmi typing/path.cmi typing/outcometree.cmi utils/misc.cmi \ parsing/longident.cmi typing/ident.cmi typing/env.cmi typing/datarepr.cmi \ @@ -847,14 +857,22 @@ toplevel/opttopmain.cmi toplevel/opttopstart.cmo: toplevel/opttopmain.cmi toplevel/opttopstart.cmx: toplevel/opttopmain.cmx +toplevel/topdirext.cmo: typing/types.cmi toplevel/trace.cmi toplevel/toploop.cmi \ + bytecomp/symtable.cmi typing/path.cmi typing/outcometree.cmi utils/misc.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi utils/config.cmi \ + toplevel/topdirext.cmi +toplevel/topdirext.cmx: typing/types.cmx toplevel/trace.cmx toplevel/toploop.cmx \ + bytecomp/symtable.cmx typing/path.cmx typing/outcometree.cmi utils/misc.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx utils/config.cmx \ + toplevel/topdirext.cmi toplevel/topdirs.cmo: utils/warnings.cmi typing/types.cmi toplevel/trace.cmi \ - toplevel/toploop.cmi bytecomp/symtable.cmi typing/printtyp.cmi \ + toplevel/toploop.cmi toplevel/topdirext.cmi bytecomp/symtable.cmi typing/printtyp.cmi \ typing/path.cmi bytecomp/opcodes.cmo utils/misc.cmi bytecomp/meta.cmi \ parsing/longident.cmi typing/ident.cmi typing/env.cmi bytecomp/dll.cmi \ typing/ctype.cmi utils/consistbl.cmi utils/config.cmi \ bytecomp/cmo_format.cmi utils/clflags.cmi toplevel/topdirs.cmi toplevel/topdirs.cmx: utils/warnings.cmx typing/types.cmx toplevel/trace.cmx \ - toplevel/toploop.cmx bytecomp/symtable.cmx typing/printtyp.cmx \ + toplevel/toploop.cmx toplevel/topdirext.cmi bytecomp/symtable.cmx typing/printtyp.cmx \ typing/path.cmx bytecomp/opcodes.cmx utils/misc.cmx bytecomp/meta.cmx \ parsing/longident.cmx typing/ident.cmx typing/env.cmx bytecomp/dll.cmx \ typing/ctype.cmx utils/consistbl.cmx utils/config.cmx \ @@ -862,24 +880,24 @@ toplevel/toploop.cmo: utils/warnings.cmi typing/unused_var.cmi \ typing/types.cmi typing/typemod.cmi typing/typedtree.cmi \ typing/typecore.cmi bytecomp/translmod.cmi bytecomp/symtable.cmi \ - bytecomp/simplif.cmi typing/printtyp.cmi bytecomp/printlambda.cmi \ - bytecomp/printinstr.cmi parsing/printast.cmi typing/predef.cmi \ + bytecomp/simplif.cmi bytecomp/printlambda.cmi \ + bytecomp/printinstr.cmi parsing/printast.cmi typing/primitive.cmi typing/predef.cmi \ typing/path.cmi parsing/parsetree.cmi parsing/parse.cmi \ typing/outcometree.cmi typing/oprint.cmi utils/misc.cmi bytecomp/meta.cmi \ parsing/longident.cmi parsing/location.cmi parsing/lexer.cmi \ - typing/ident.cmi toplevel/genprintval.cmi driver/errors.cmi \ + typing/ident.cmi toplevel/genprintval.cmi toplevel/genprinttyp.cmo driver/errors.cmi \ typing/env.cmi bytecomp/emitcode.cmi bytecomp/dll.cmi utils/consistbl.cmi \ utils/config.cmi driver/compile.cmi utils/clflags.cmi \ bytecomp/bytegen.cmi typing/btype.cmi toplevel/toploop.cmi toplevel/toploop.cmx: utils/warnings.cmx typing/unused_var.cmx \ typing/types.cmx typing/typemod.cmx typing/typedtree.cmx \ typing/typecore.cmx bytecomp/translmod.cmx bytecomp/symtable.cmx \ - bytecomp/simplif.cmx typing/printtyp.cmx bytecomp/printlambda.cmx \ - bytecomp/printinstr.cmx parsing/printast.cmx typing/predef.cmx \ + bytecomp/simplif.cmx bytecomp/printlambda.cmx \ + bytecomp/printinstr.cmx parsing/printast.cmx typing/primitive.cmx typing/predef.cmx \ typing/path.cmx parsing/parsetree.cmi parsing/parse.cmx \ typing/outcometree.cmi typing/oprint.cmx utils/misc.cmx bytecomp/meta.cmx \ parsing/longident.cmx parsing/location.cmx parsing/lexer.cmx \ - typing/ident.cmx toplevel/genprintval.cmx driver/errors.cmx \ + typing/ident.cmx toplevel/genprintval.cmx toplevel/genprinttyp.cmx driver/errors.cmx \ typing/env.cmx bytecomp/emitcode.cmx bytecomp/dll.cmx utils/consistbl.cmx \ utils/config.cmx driver/compile.cmx utils/clflags.cmx \ bytecomp/bytegen.cmx typing/btype.cmx toplevel/toploop.cmi @@ -891,9 +909,9 @@ utils/clflags.cmx toplevel/topmain.cmi toplevel/topstart.cmo: toplevel/topmain.cmi toplevel/topstart.cmx: toplevel/topmain.cmx -toplevel/trace.cmo: typing/types.cmi toplevel/toploop.cmi typing/printtyp.cmi \ +toplevel/trace.cmo: typing/types.cmi toplevel/toploop.cmi \ typing/predef.cmi typing/path.cmi utils/misc.cmi bytecomp/meta.cmi \ parsing/longident.cmi typing/ctype.cmi toplevel/trace.cmi -toplevel/trace.cmx: typing/types.cmx toplevel/toploop.cmx typing/printtyp.cmx \ +toplevel/trace.cmx: typing/types.cmx toplevel/toploop.cmx \ typing/predef.cmx typing/path.cmx utils/misc.cmx bytecomp/meta.cmx \ parsing/longident.cmx typing/ctype.cmx toplevel/trace.cmi diff -Naur ocaml-3.11.0/.depend.orig ocaml-3.11.0-enhtop+/.depend.orig --- ocaml-3.11.0/.depend.orig 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/.depend.orig 2009-03-24 10:55:08.045441594 -0400 @@ -0,0 +1,899 @@ +utils/ccomp.cmi: +utils/clflags.cmi: +utils/config.cmi: +utils/consistbl.cmi: +utils/misc.cmi: +utils/tbl.cmi: +utils/terminfo.cmi: +utils/warnings.cmi: +utils/ccomp.cmo: utils/misc.cmi utils/config.cmi utils/clflags.cmi \ + utils/ccomp.cmi +utils/ccomp.cmx: utils/misc.cmx utils/config.cmx utils/clflags.cmx \ + utils/ccomp.cmi +utils/clflags.cmo: utils/config.cmi utils/clflags.cmi +utils/clflags.cmx: utils/config.cmx utils/clflags.cmi +utils/config.cmo: utils/config.cmi +utils/config.cmx: utils/config.cmi +utils/consistbl.cmo: utils/consistbl.cmi +utils/consistbl.cmx: utils/consistbl.cmi +utils/misc.cmo: utils/misc.cmi +utils/misc.cmx: utils/misc.cmi +utils/tbl.cmo: utils/tbl.cmi +utils/tbl.cmx: utils/tbl.cmi +utils/terminfo.cmo: utils/terminfo.cmi +utils/terminfo.cmx: utils/terminfo.cmi +utils/warnings.cmo: utils/warnings.cmi +utils/warnings.cmx: utils/warnings.cmi +parsing/asttypes.cmi: +parsing/lexer.cmi: parsing/parser.cmi parsing/location.cmi +parsing/linenum.cmi: +parsing/location.cmi: utils/warnings.cmi +parsing/longident.cmi: +parsing/parse.cmi: parsing/parsetree.cmi +parsing/parser.cmi: parsing/parsetree.cmi +parsing/parsetree.cmi: parsing/longident.cmi parsing/location.cmi \ + parsing/asttypes.cmi +parsing/printast.cmi: parsing/parsetree.cmi +parsing/syntaxerr.cmi: parsing/location.cmi +parsing/lexer.cmo: utils/warnings.cmi parsing/parser.cmi utils/misc.cmi \ + parsing/location.cmi parsing/lexer.cmi +parsing/lexer.cmx: utils/warnings.cmx parsing/parser.cmx utils/misc.cmx \ + parsing/location.cmx parsing/lexer.cmi +parsing/linenum.cmo: utils/misc.cmi parsing/linenum.cmi +parsing/linenum.cmx: utils/misc.cmx parsing/linenum.cmi +parsing/location.cmo: utils/warnings.cmi utils/terminfo.cmi \ + parsing/linenum.cmi parsing/location.cmi +parsing/location.cmx: utils/warnings.cmx utils/terminfo.cmx \ + parsing/linenum.cmx parsing/location.cmi +parsing/longident.cmo: utils/misc.cmi parsing/longident.cmi +parsing/longident.cmx: utils/misc.cmx parsing/longident.cmi +parsing/parse.cmo: parsing/syntaxerr.cmi parsing/parser.cmi \ + parsing/location.cmi parsing/lexer.cmi parsing/parse.cmi +parsing/parse.cmx: parsing/syntaxerr.cmx parsing/parser.cmx \ + parsing/location.cmx parsing/lexer.cmx parsing/parse.cmi +parsing/parser.cmo: parsing/syntaxerr.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi utils/clflags.cmi \ + parsing/asttypes.cmi parsing/parser.cmi +parsing/parser.cmx: parsing/syntaxerr.cmx parsing/parsetree.cmi \ + parsing/longident.cmx parsing/location.cmx utils/clflags.cmx \ + parsing/asttypes.cmi parsing/parser.cmi +parsing/printast.cmo: parsing/parsetree.cmi parsing/longident.cmi \ + parsing/location.cmi parsing/asttypes.cmi parsing/printast.cmi +parsing/printast.cmx: parsing/parsetree.cmi parsing/longident.cmx \ + parsing/location.cmx parsing/asttypes.cmi parsing/printast.cmi +parsing/syntaxerr.cmo: parsing/location.cmi parsing/syntaxerr.cmi +parsing/syntaxerr.cmx: parsing/location.cmx parsing/syntaxerr.cmi +typing/annot.cmi: parsing/location.cmi +typing/btype.cmi: typing/types.cmi typing/path.cmi parsing/asttypes.cmi +typing/ctype.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi \ + typing/env.cmi parsing/asttypes.cmi +typing/datarepr.cmi: typing/types.cmi typing/path.cmi parsing/asttypes.cmi +typing/env.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \ + typing/ident.cmi utils/consistbl.cmi typing/annot.cmi +typing/ident.cmi: +typing/includeclass.cmi: typing/types.cmi typing/typedtree.cmi typing/env.cmi \ + typing/ctype.cmi +typing/includecore.cmi: typing/types.cmi typing/typedtree.cmi \ + typing/ident.cmi typing/env.cmi +typing/includemod.cmi: typing/types.cmi typing/typedtree.cmi typing/path.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi +typing/mtype.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi \ + typing/env.cmi +typing/oprint.cmi: typing/outcometree.cmi +typing/outcometree.cmi: parsing/asttypes.cmi +typing/parmatch.cmi: typing/types.cmi typing/typedtree.cmi \ + parsing/location.cmi typing/env.cmi +typing/path.cmi: typing/ident.cmi +typing/predef.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi +typing/primitive.cmi: +typing/printtyp.cmi: typing/types.cmi typing/path.cmi typing/outcometree.cmi \ + parsing/longident.cmi typing/ident.cmi +typing/stypes.cmi: typing/typedtree.cmi parsing/location.cmi typing/annot.cmi +typing/subst.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi +typing/typeclass.cmi: typing/types.cmi typing/typedtree.cmi \ + parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi parsing/asttypes.cmi +typing/typecore.cmi: typing/types.cmi typing/typedtree.cmi typing/path.cmi \ + parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi parsing/asttypes.cmi typing/annot.cmi +typing/typedecl.cmi: typing/types.cmi typing/path.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi typing/ident.cmi \ + typing/env.cmi +typing/typedtree.cmi: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + parsing/location.cmi typing/ident.cmi typing/env.cmi parsing/asttypes.cmi +typing/typemod.cmi: typing/types.cmi typing/typedtree.cmi \ + parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \ + typing/includemod.cmi typing/ident.cmi typing/env.cmi +typing/types.cmi: typing/primitive.cmi typing/path.cmi typing/ident.cmi \ + parsing/asttypes.cmi +typing/typetexp.cmi: typing/types.cmi typing/path.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi typing/env.cmi +typing/unused_var.cmi: parsing/parsetree.cmi +typing/btype.cmo: typing/types.cmi typing/path.cmi utils/misc.cmi \ + typing/btype.cmi +typing/btype.cmx: typing/types.cmx typing/path.cmx utils/misc.cmx \ + typing/btype.cmi +typing/ctype.cmo: typing/types.cmi typing/subst.cmi typing/path.cmi \ + utils/misc.cmi parsing/longident.cmi typing/ident.cmi typing/env.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/ctype.cmi +typing/ctype.cmx: typing/types.cmx typing/subst.cmx typing/path.cmx \ + utils/misc.cmx parsing/longident.cmx typing/ident.cmx typing/env.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/ctype.cmi +typing/datarepr.cmo: typing/types.cmi typing/predef.cmi utils/misc.cmi \ + parsing/asttypes.cmi typing/datarepr.cmi +typing/datarepr.cmx: typing/types.cmx typing/predef.cmx utils/misc.cmx \ + parsing/asttypes.cmi typing/datarepr.cmi +typing/env.cmo: typing/types.cmi utils/tbl.cmi typing/subst.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi parsing/longident.cmi \ + typing/ident.cmi typing/datarepr.cmi utils/consistbl.cmi utils/config.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/annot.cmi \ + typing/env.cmi +typing/env.cmx: typing/types.cmx utils/tbl.cmx typing/subst.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx parsing/longident.cmx \ + typing/ident.cmx typing/datarepr.cmx utils/consistbl.cmx utils/config.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/annot.cmi \ + typing/env.cmi +typing/ident.cmo: typing/ident.cmi +typing/ident.cmx: typing/ident.cmi +typing/includeclass.cmo: typing/types.cmi typing/printtyp.cmi \ + typing/ctype.cmi typing/includeclass.cmi +typing/includeclass.cmx: typing/types.cmx typing/printtyp.cmx \ + typing/ctype.cmx typing/includeclass.cmi +typing/includecore.cmo: typing/types.cmi typing/typedtree.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi typing/ctype.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/includecore.cmi +typing/includecore.cmx: typing/types.cmx typing/typedtree.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx typing/ctype.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/includecore.cmi +typing/includemod.cmo: typing/types.cmi typing/typedtree.cmi utils/tbl.cmi \ + typing/subst.cmi typing/printtyp.cmi typing/path.cmi typing/mtype.cmi \ + utils/misc.cmi typing/includecore.cmi typing/includeclass.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi typing/includemod.cmi +typing/includemod.cmx: typing/types.cmx typing/typedtree.cmx utils/tbl.cmx \ + typing/subst.cmx typing/printtyp.cmx typing/path.cmx typing/mtype.cmx \ + utils/misc.cmx typing/includecore.cmx typing/includeclass.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx typing/includemod.cmi +typing/mtype.cmo: typing/types.cmi typing/subst.cmi typing/path.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi typing/btype.cmi \ + parsing/asttypes.cmi typing/mtype.cmi +typing/mtype.cmx: typing/types.cmx typing/subst.cmx typing/path.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx typing/btype.cmx \ + parsing/asttypes.cmi typing/mtype.cmi +typing/oprint.cmo: typing/outcometree.cmi parsing/asttypes.cmi \ + typing/oprint.cmi +typing/oprint.cmx: typing/outcometree.cmi parsing/asttypes.cmi \ + typing/oprint.cmi +typing/parmatch.cmo: utils/warnings.cmi typing/types.cmi typing/typedtree.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi typing/datarepr.cmi typing/ctype.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/parmatch.cmi +typing/parmatch.cmx: utils/warnings.cmx typing/types.cmx typing/typedtree.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx parsing/location.cmx \ + typing/ident.cmx typing/env.cmx typing/datarepr.cmx typing/ctype.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/parmatch.cmi +typing/path.cmo: typing/ident.cmi typing/path.cmi +typing/path.cmx: typing/ident.cmx typing/path.cmi +typing/predef.cmo: typing/types.cmi typing/path.cmi typing/ident.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/predef.cmi +typing/predef.cmx: typing/types.cmx typing/path.cmx typing/ident.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/predef.cmi +typing/primitive.cmo: utils/misc.cmi typing/primitive.cmi +typing/primitive.cmx: utils/misc.cmx typing/primitive.cmi +typing/printtyp.cmo: typing/types.cmi typing/primitive.cmi typing/predef.cmi \ + typing/path.cmi typing/outcometree.cmi typing/oprint.cmi utils/misc.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi typing/ctype.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi \ + typing/printtyp.cmi +typing/printtyp.cmx: typing/types.cmx typing/primitive.cmx typing/predef.cmx \ + typing/path.cmx typing/outcometree.cmi typing/oprint.cmx utils/misc.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx typing/ctype.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \ + typing/printtyp.cmi +typing/stypes.cmo: typing/typedtree.cmi typing/printtyp.cmi \ + parsing/location.cmi utils/clflags.cmi typing/annot.cmi typing/stypes.cmi +typing/stypes.cmx: typing/typedtree.cmx typing/printtyp.cmx \ + parsing/location.cmx utils/clflags.cmx typing/annot.cmi typing/stypes.cmi +typing/subst.cmo: typing/types.cmi utils/tbl.cmi typing/path.cmi \ + utils/misc.cmi typing/ident.cmi typing/btype.cmi typing/subst.cmi +typing/subst.cmx: typing/types.cmx utils/tbl.cmx typing/path.cmx \ + utils/misc.cmx typing/ident.cmx typing/btype.cmx typing/subst.cmi +typing/typeclass.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \ + typing/typedtree.cmi typing/typedecl.cmi typing/typecore.cmi \ + typing/subst.cmi typing/stypes.cmi typing/printtyp.cmi typing/predef.cmi \ + typing/path.cmi parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/includeclass.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/typeclass.cmi +typing/typeclass.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \ + typing/typedtree.cmx typing/typedecl.cmx typing/typecore.cmx \ + typing/subst.cmx typing/stypes.cmx typing/printtyp.cmx typing/predef.cmx \ + typing/path.cmx parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/includeclass.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/typeclass.cmi +typing/typecore.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \ + typing/typedtree.cmi typing/stypes.cmi typing/printtyp.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/ident.cmi \ + typing/env.cmi typing/ctype.cmi utils/clflags.cmi typing/btype.cmi \ + parsing/asttypes.cmi typing/annot.cmi typing/typecore.cmi +typing/typecore.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \ + typing/typedtree.cmx typing/stypes.cmx typing/printtyp.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx \ + parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/ident.cmx \ + typing/env.cmx typing/ctype.cmx utils/clflags.cmx typing/btype.cmx \ + parsing/asttypes.cmi typing/annot.cmi typing/typecore.cmi +typing/typedecl.cmo: typing/typetexp.cmi typing/types.cmi \ + typing/typedtree.cmi typing/subst.cmi typing/printtyp.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi \ + parsing/parsetree.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi typing/includecore.cmi typing/ident.cmi \ + typing/env.cmi typing/ctype.cmi utils/config.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/typedecl.cmi +typing/typedecl.cmx: typing/typetexp.cmx typing/types.cmx \ + typing/typedtree.cmx typing/subst.cmx typing/printtyp.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx \ + parsing/parsetree.cmi utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx typing/includecore.cmx typing/ident.cmx \ + typing/env.cmx typing/ctype.cmx utils/config.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/typedecl.cmi +typing/typedtree.cmo: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + utils/misc.cmi parsing/location.cmi typing/ident.cmi typing/env.cmi \ + parsing/asttypes.cmi typing/typedtree.cmi +typing/typedtree.cmx: typing/types.cmx typing/primitive.cmx typing/path.cmx \ + utils/misc.cmx parsing/location.cmx typing/ident.cmx typing/env.cmx \ + parsing/asttypes.cmi typing/typedtree.cmi +typing/typemod.cmo: typing/types.cmi typing/typedtree.cmi typing/typedecl.cmi \ + typing/typecore.cmi typing/typeclass.cmi typing/subst.cmi \ + typing/stypes.cmi typing/printtyp.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/mtype.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/includemod.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/config.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/annot.cmi \ + typing/typemod.cmi +typing/typemod.cmx: typing/types.cmx typing/typedtree.cmx typing/typedecl.cmx \ + typing/typecore.cmx typing/typeclass.cmx typing/subst.cmx \ + typing/stypes.cmx typing/printtyp.cmx typing/path.cmx \ + parsing/parsetree.cmi typing/mtype.cmx utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/includemod.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx utils/config.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/annot.cmi \ + typing/typemod.cmi +typing/types.cmo: typing/primitive.cmi typing/path.cmi utils/misc.cmi \ + typing/ident.cmi parsing/asttypes.cmi typing/types.cmi +typing/types.cmx: typing/primitive.cmx typing/path.cmx utils/misc.cmx \ + typing/ident.cmx parsing/asttypes.cmi typing/types.cmi +typing/typetexp.cmo: utils/warnings.cmi typing/types.cmi utils/tbl.cmi \ + typing/printtyp.cmi typing/path.cmi parsing/parsetree.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/env.cmi \ + typing/ctype.cmi utils/clflags.cmi typing/btype.cmi typing/typetexp.cmi +typing/typetexp.cmx: utils/warnings.cmx typing/types.cmx utils/tbl.cmx \ + typing/printtyp.cmx typing/path.cmx parsing/parsetree.cmi utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/env.cmx \ + typing/ctype.cmx utils/clflags.cmx typing/btype.cmx typing/typetexp.cmi +typing/unused_var.cmo: utils/warnings.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi parsing/asttypes.cmi \ + typing/unused_var.cmi +typing/unused_var.cmx: utils/warnings.cmx parsing/parsetree.cmi \ + parsing/longident.cmx parsing/location.cmx parsing/asttypes.cmi \ + typing/unused_var.cmi +bytecomp/bytegen.cmi: bytecomp/lambda.cmi bytecomp/instruct.cmi +bytecomp/bytelibrarian.cmi: +bytecomp/bytelink.cmi: bytecomp/symtable.cmi bytecomp/cmo_format.cmi +bytecomp/bytepackager.cmi: typing/ident.cmi +bytecomp/bytesections.cmi: +bytecomp/cmo_format.cmi: bytecomp/lambda.cmi typing/ident.cmi +bytecomp/dll.cmi: +bytecomp/emitcode.cmi: bytecomp/instruct.cmi bytecomp/cmo_format.cmi +bytecomp/instruct.cmi: typing/types.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi +bytecomp/lambda.cmi: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + parsing/location.cmi typing/ident.cmi typing/env.cmi parsing/asttypes.cmi +bytecomp/matching.cmi: typing/typedtree.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi +bytecomp/meta.cmi: +bytecomp/printinstr.cmi: bytecomp/instruct.cmi +bytecomp/printlambda.cmi: bytecomp/lambda.cmi +bytecomp/runtimedef.cmi: +bytecomp/simplif.cmi: bytecomp/lambda.cmi +bytecomp/switch.cmi: +bytecomp/symtable.cmi: typing/ident.cmi bytecomp/cmo_format.cmi +bytecomp/translclass.cmi: typing/typedtree.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi +bytecomp/translcore.cmi: typing/types.cmi typing/typedtree.cmi \ + typing/primitive.cmi typing/path.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi +bytecomp/translmod.cmi: typing/typedtree.cmi typing/primitive.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi +bytecomp/translobj.cmi: bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi +bytecomp/typeopt.cmi: typing/typedtree.cmi typing/path.cmi \ + bytecomp/lambda.cmi +bytecomp/bytegen.cmo: typing/types.cmi bytecomp/switch.cmi typing/stypes.cmi \ + typing/primitive.cmi utils/misc.cmi bytecomp/lambda.cmi \ + bytecomp/instruct.cmi typing/ident.cmi utils/config.cmi \ + parsing/asttypes.cmi typing/annot.cmi bytecomp/bytegen.cmi +bytecomp/bytegen.cmx: typing/types.cmx bytecomp/switch.cmx typing/stypes.cmx \ + typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx \ + bytecomp/instruct.cmx typing/ident.cmx utils/config.cmx \ + parsing/asttypes.cmi typing/annot.cmi bytecomp/bytegen.cmi +bytecomp/bytelibrarian.cmo: utils/misc.cmi utils/config.cmi \ + bytecomp/cmo_format.cmi utils/clflags.cmi bytecomp/bytelink.cmi \ + bytecomp/bytelibrarian.cmi +bytecomp/bytelibrarian.cmx: utils/misc.cmx utils/config.cmx \ + bytecomp/cmo_format.cmi utils/clflags.cmx bytecomp/bytelink.cmx \ + bytecomp/bytelibrarian.cmi +bytecomp/bytelink.cmo: bytecomp/symtable.cmi bytecomp/opcodes.cmo \ + utils/misc.cmi bytecomp/instruct.cmi typing/ident.cmi bytecomp/dll.cmi \ + utils/consistbl.cmi utils/config.cmi bytecomp/cmo_format.cmi \ + utils/clflags.cmi utils/ccomp.cmi bytecomp/bytesections.cmi \ + bytecomp/bytelink.cmi +bytecomp/bytelink.cmx: bytecomp/symtable.cmx bytecomp/opcodes.cmx \ + utils/misc.cmx bytecomp/instruct.cmx typing/ident.cmx bytecomp/dll.cmx \ + utils/consistbl.cmx utils/config.cmx bytecomp/cmo_format.cmi \ + utils/clflags.cmx utils/ccomp.cmx bytecomp/bytesections.cmx \ + bytecomp/bytelink.cmi +bytecomp/bytepackager.cmo: typing/typemod.cmi bytecomp/translmod.cmi \ + utils/misc.cmi bytecomp/instruct.cmi typing/ident.cmi typing/env.cmi \ + bytecomp/emitcode.cmi utils/config.cmi bytecomp/cmo_format.cmi \ + utils/clflags.cmi bytecomp/bytelink.cmi bytecomp/bytegen.cmi \ + bytecomp/bytepackager.cmi +bytecomp/bytepackager.cmx: typing/typemod.cmx bytecomp/translmod.cmx \ + utils/misc.cmx bytecomp/instruct.cmx typing/ident.cmx typing/env.cmx \ + bytecomp/emitcode.cmx utils/config.cmx bytecomp/cmo_format.cmi \ + utils/clflags.cmx bytecomp/bytelink.cmx bytecomp/bytegen.cmx \ + bytecomp/bytepackager.cmi +bytecomp/bytesections.cmo: utils/config.cmi bytecomp/bytesections.cmi +bytecomp/bytesections.cmx: utils/config.cmx bytecomp/bytesections.cmi +bytecomp/dll.cmo: utils/misc.cmi utils/config.cmi bytecomp/dll.cmi +bytecomp/dll.cmx: utils/misc.cmx utils/config.cmx bytecomp/dll.cmi +bytecomp/emitcode.cmo: bytecomp/translmod.cmi typing/primitive.cmi \ + bytecomp/opcodes.cmo utils/misc.cmi bytecomp/meta.cmi bytecomp/lambda.cmi \ + bytecomp/instruct.cmi typing/env.cmi utils/config.cmi \ + bytecomp/cmo_format.cmi utils/clflags.cmi typing/btype.cmi \ + parsing/asttypes.cmi bytecomp/emitcode.cmi +bytecomp/emitcode.cmx: bytecomp/translmod.cmx typing/primitive.cmx \ + bytecomp/opcodes.cmx utils/misc.cmx bytecomp/meta.cmx bytecomp/lambda.cmx \ + bytecomp/instruct.cmx typing/env.cmx utils/config.cmx \ + bytecomp/cmo_format.cmi utils/clflags.cmx typing/btype.cmx \ + parsing/asttypes.cmi bytecomp/emitcode.cmi +bytecomp/instruct.cmo: typing/types.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi bytecomp/instruct.cmi +bytecomp/instruct.cmx: typing/types.cmx parsing/location.cmx \ + bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx bytecomp/instruct.cmi +bytecomp/lambda.cmo: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + utils/misc.cmi parsing/location.cmi typing/ident.cmi typing/env.cmi \ + parsing/asttypes.cmi bytecomp/lambda.cmi +bytecomp/lambda.cmx: typing/types.cmx typing/primitive.cmx typing/path.cmx \ + utils/misc.cmx parsing/location.cmx typing/ident.cmx typing/env.cmx \ + parsing/asttypes.cmi bytecomp/lambda.cmi +bytecomp/matching.cmo: typing/types.cmi bytecomp/typeopt.cmi \ + typing/typedtree.cmi bytecomp/switch.cmi bytecomp/printlambda.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi \ + typing/parmatch.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi \ + bytecomp/matching.cmi +bytecomp/matching.cmx: typing/types.cmx bytecomp/typeopt.cmx \ + typing/typedtree.cmx bytecomp/switch.cmx bytecomp/printlambda.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx \ + typing/parmatch.cmx utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \ + bytecomp/matching.cmi +bytecomp/meta.cmo: bytecomp/meta.cmi +bytecomp/meta.cmx: bytecomp/meta.cmi +bytecomp/opcodes.cmo: +bytecomp/opcodes.cmx: +bytecomp/printinstr.cmo: bytecomp/printlambda.cmi parsing/location.cmi \ + bytecomp/lambda.cmi bytecomp/instruct.cmi typing/ident.cmi \ + bytecomp/printinstr.cmi +bytecomp/printinstr.cmx: bytecomp/printlambda.cmx parsing/location.cmx \ + bytecomp/lambda.cmx bytecomp/instruct.cmx typing/ident.cmx \ + bytecomp/printinstr.cmi +bytecomp/printlambda.cmo: typing/types.cmi typing/primitive.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi \ + parsing/asttypes.cmi bytecomp/printlambda.cmi +bytecomp/printlambda.cmx: typing/types.cmx typing/primitive.cmx \ + parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx \ + parsing/asttypes.cmi bytecomp/printlambda.cmi +bytecomp/runtimedef.cmo: bytecomp/runtimedef.cmi +bytecomp/runtimedef.cmx: bytecomp/runtimedef.cmi +bytecomp/simplif.cmo: bytecomp/lambda.cmi typing/ident.cmi utils/clflags.cmi \ + parsing/asttypes.cmi bytecomp/simplif.cmi +bytecomp/simplif.cmx: bytecomp/lambda.cmx typing/ident.cmx utils/clflags.cmx \ + parsing/asttypes.cmi bytecomp/simplif.cmi +bytecomp/switch.cmo: bytecomp/switch.cmi +bytecomp/switch.cmx: bytecomp/switch.cmi +bytecomp/symtable.cmo: utils/tbl.cmi bytecomp/runtimedef.cmi \ + typing/predef.cmi utils/misc.cmi bytecomp/meta.cmi bytecomp/lambda.cmi \ + typing/ident.cmi bytecomp/dll.cmi bytecomp/cmo_format.cmi \ + utils/clflags.cmi bytecomp/bytesections.cmi parsing/asttypes.cmi \ + bytecomp/symtable.cmi +bytecomp/symtable.cmx: utils/tbl.cmx bytecomp/runtimedef.cmx \ + typing/predef.cmx utils/misc.cmx bytecomp/meta.cmx bytecomp/lambda.cmx \ + typing/ident.cmx bytecomp/dll.cmx bytecomp/cmo_format.cmi \ + utils/clflags.cmx bytecomp/bytesections.cmx parsing/asttypes.cmi \ + bytecomp/symtable.cmi +bytecomp/translclass.cmo: typing/types.cmi bytecomp/typeopt.cmi \ + typing/typedtree.cmi bytecomp/translobj.cmi bytecomp/translcore.cmi \ + typing/path.cmi utils/misc.cmi bytecomp/matching.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi bytecomp/translclass.cmi +bytecomp/translclass.cmx: typing/types.cmx bytecomp/typeopt.cmx \ + typing/typedtree.cmx bytecomp/translobj.cmx bytecomp/translcore.cmx \ + typing/path.cmx utils/misc.cmx bytecomp/matching.cmx parsing/location.cmx \ + bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi bytecomp/translclass.cmi +bytecomp/translcore.cmo: typing/types.cmi bytecomp/typeopt.cmi \ + typing/typedtree.cmi bytecomp/translobj.cmi typing/primitive.cmi \ + typing/predef.cmi typing/path.cmi typing/parmatch.cmi utils/misc.cmi \ + bytecomp/matching.cmi parsing/location.cmi bytecomp/lambda.cmi \ + typing/ident.cmi typing/env.cmi utils/config.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi bytecomp/translcore.cmi +bytecomp/translcore.cmx: typing/types.cmx bytecomp/typeopt.cmx \ + typing/typedtree.cmx bytecomp/translobj.cmx typing/primitive.cmx \ + typing/predef.cmx typing/path.cmx typing/parmatch.cmx utils/misc.cmx \ + bytecomp/matching.cmx parsing/location.cmx bytecomp/lambda.cmx \ + typing/ident.cmx typing/env.cmx utils/config.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi bytecomp/translcore.cmi +bytecomp/translmod.cmo: typing/types.cmi typing/typedtree.cmi \ + bytecomp/translobj.cmi bytecomp/translcore.cmi bytecomp/translclass.cmi \ + typing/printtyp.cmi typing/primitive.cmi typing/predef.cmi \ + typing/path.cmi typing/mtype.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi \ + typing/ctype.cmi parsing/asttypes.cmi bytecomp/translmod.cmi +bytecomp/translmod.cmx: typing/types.cmx typing/typedtree.cmx \ + bytecomp/translobj.cmx bytecomp/translcore.cmx bytecomp/translclass.cmx \ + typing/printtyp.cmx typing/primitive.cmx typing/predef.cmx \ + typing/path.cmx typing/mtype.cmx utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx \ + typing/ctype.cmx parsing/asttypes.cmi bytecomp/translmod.cmi +bytecomp/translobj.cmo: typing/primitive.cmi utils/misc.cmi \ + parsing/longident.cmi bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi \ + bytecomp/translobj.cmi +bytecomp/translobj.cmx: typing/primitive.cmx utils/misc.cmx \ + parsing/longident.cmx bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \ + bytecomp/translobj.cmi +bytecomp/typeopt.cmo: typing/types.cmi typing/typedtree.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi utils/misc.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi typing/ctype.cmi \ + parsing/asttypes.cmi bytecomp/typeopt.cmi +bytecomp/typeopt.cmx: typing/types.cmx typing/typedtree.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx utils/misc.cmx \ + bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx typing/ctype.cmx \ + parsing/asttypes.cmi bytecomp/typeopt.cmi +asmcomp/asmgen.cmi: bytecomp/lambda.cmi asmcomp/cmm.cmi +asmcomp/asmlibrarian.cmi: +asmcomp/asmlink.cmi: asmcomp/compilenv.cmi +asmcomp/asmpackager.cmi: +asmcomp/clambda.cmi: bytecomp/lambda.cmi typing/ident.cmi \ + asmcomp/debuginfo.cmi parsing/asttypes.cmi +asmcomp/closure.cmi: bytecomp/lambda.cmi asmcomp/clambda.cmi +asmcomp/cmm.cmi: typing/ident.cmi asmcomp/debuginfo.cmi +asmcomp/cmmgen.cmi: asmcomp/compilenv.cmi asmcomp/cmm.cmi asmcomp/clambda.cmi +asmcomp/codegen.cmi: asmcomp/cmm.cmi +asmcomp/coloring.cmi: +asmcomp/comballoc.cmi: asmcomp/mach.cmi +asmcomp/compilenv.cmi: typing/ident.cmi asmcomp/clambda.cmi +asmcomp/debuginfo.cmi: parsing/location.cmi bytecomp/lambda.cmi +asmcomp/emit.cmi: asmcomp/linearize.cmi asmcomp/cmm.cmi +asmcomp/emitaux.cmi: asmcomp/debuginfo.cmi +asmcomp/interf.cmi: asmcomp/mach.cmi +asmcomp/linearize.cmi: asmcomp/reg.cmi asmcomp/mach.cmi asmcomp/debuginfo.cmi +asmcomp/liveness.cmi: asmcomp/mach.cmi +asmcomp/mach.cmi: asmcomp/reg.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/arch.cmo +asmcomp/printcmm.cmi: asmcomp/cmm.cmi +asmcomp/printlinear.cmi: asmcomp/linearize.cmi +asmcomp/printmach.cmi: asmcomp/reg.cmi asmcomp/mach.cmi +asmcomp/proc.cmi: asmcomp/reg.cmi asmcomp/mach.cmi +asmcomp/reg.cmi: asmcomp/cmm.cmi +asmcomp/reload.cmi: asmcomp/mach.cmi +asmcomp/reloadgen.cmi: asmcomp/reg.cmi asmcomp/mach.cmi +asmcomp/schedgen.cmi: asmcomp/mach.cmi asmcomp/linearize.cmi +asmcomp/scheduling.cmi: asmcomp/linearize.cmi +asmcomp/selectgen.cmi: utils/tbl.cmi asmcomp/reg.cmi asmcomp/mach.cmi \ + typing/ident.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi asmcomp/arch.cmo +asmcomp/selection.cmi: asmcomp/mach.cmi asmcomp/cmm.cmi +asmcomp/spill.cmi: asmcomp/mach.cmi +asmcomp/split.cmi: asmcomp/mach.cmi +asmcomp/arch.cmo: utils/misc.cmi utils/config.cmi +asmcomp/arch.cmx: utils/misc.cmx utils/config.cmx +asmcomp/asmgen.cmo: bytecomp/translmod.cmi asmcomp/split.cmi \ + asmcomp/spill.cmi asmcomp/selection.cmi asmcomp/scheduling.cmi \ + asmcomp/reload.cmi asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printmach.cmi \ + asmcomp/printlinear.cmi asmcomp/printcmm.cmi typing/primitive.cmi \ + utils/misc.cmi asmcomp/mach.cmi asmcomp/liveness.cmi \ + asmcomp/linearize.cmi asmcomp/interf.cmi asmcomp/emitaux.cmi \ + asmcomp/emit.cmi utils/config.cmi asmcomp/compilenv.cmi \ + asmcomp/comballoc.cmi asmcomp/coloring.cmi asmcomp/cmmgen.cmi \ + asmcomp/cmm.cmi asmcomp/closure.cmi utils/clflags.cmi asmcomp/asmgen.cmi +asmcomp/asmgen.cmx: bytecomp/translmod.cmx asmcomp/split.cmx \ + asmcomp/spill.cmx asmcomp/selection.cmx asmcomp/scheduling.cmx \ + asmcomp/reload.cmx asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/printmach.cmx \ + asmcomp/printlinear.cmx asmcomp/printcmm.cmx typing/primitive.cmx \ + utils/misc.cmx asmcomp/mach.cmx asmcomp/liveness.cmx \ + asmcomp/linearize.cmx asmcomp/interf.cmx asmcomp/emitaux.cmx \ + asmcomp/emit.cmx utils/config.cmx asmcomp/compilenv.cmx \ + asmcomp/comballoc.cmx asmcomp/coloring.cmx asmcomp/cmmgen.cmx \ + asmcomp/cmm.cmx asmcomp/closure.cmx utils/clflags.cmx asmcomp/asmgen.cmi +asmcomp/asmlibrarian.cmo: utils/misc.cmi utils/config.cmi \ + asmcomp/compilenv.cmi utils/clflags.cmi asmcomp/clambda.cmi \ + utils/ccomp.cmi asmcomp/asmlink.cmi asmcomp/asmlibrarian.cmi +asmcomp/asmlibrarian.cmx: utils/misc.cmx utils/config.cmx \ + asmcomp/compilenv.cmx utils/clflags.cmx asmcomp/clambda.cmx \ + utils/ccomp.cmx asmcomp/asmlink.cmx asmcomp/asmlibrarian.cmi +asmcomp/asmlink.cmo: bytecomp/runtimedef.cmi asmcomp/proc.cmi utils/misc.cmi \ + parsing/location.cmi asmcomp/emitaux.cmi asmcomp/emit.cmi \ + utils/consistbl.cmi utils/config.cmi asmcomp/compilenv.cmi \ + asmcomp/cmmgen.cmi utils/clflags.cmi utils/ccomp.cmi asmcomp/asmgen.cmi \ + asmcomp/asmlink.cmi +asmcomp/asmlink.cmx: bytecomp/runtimedef.cmx asmcomp/proc.cmx utils/misc.cmx \ + parsing/location.cmx asmcomp/emitaux.cmx asmcomp/emit.cmx \ + utils/consistbl.cmx utils/config.cmx asmcomp/compilenv.cmx \ + asmcomp/cmmgen.cmx utils/clflags.cmx utils/ccomp.cmx asmcomp/asmgen.cmx \ + asmcomp/asmlink.cmi +asmcomp/asmpackager.cmo: typing/typemod.cmi bytecomp/translmod.cmi \ + utils/misc.cmi parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi \ + typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi utils/clflags.cmi \ + asmcomp/clambda.cmi utils/ccomp.cmi asmcomp/asmlink.cmi \ + asmcomp/asmgen.cmi asmcomp/asmpackager.cmi +asmcomp/asmpackager.cmx: typing/typemod.cmx bytecomp/translmod.cmx \ + utils/misc.cmx parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx \ + typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx utils/clflags.cmx \ + asmcomp/clambda.cmx utils/ccomp.cmx asmcomp/asmlink.cmx \ + asmcomp/asmgen.cmx asmcomp/asmpackager.cmi +asmcomp/clambda.cmo: bytecomp/lambda.cmi typing/ident.cmi \ + asmcomp/debuginfo.cmi parsing/asttypes.cmi asmcomp/clambda.cmi +asmcomp/clambda.cmx: bytecomp/lambda.cmx typing/ident.cmx \ + asmcomp/debuginfo.cmx parsing/asttypes.cmi asmcomp/clambda.cmi +asmcomp/closure.cmo: utils/tbl.cmi bytecomp/switch.cmi typing/primitive.cmi \ + utils/misc.cmi bytecomp/lambda.cmi typing/ident.cmi asmcomp/debuginfo.cmi \ + asmcomp/compilenv.cmi utils/clflags.cmi asmcomp/clambda.cmi \ + parsing/asttypes.cmi asmcomp/closure.cmi +asmcomp/closure.cmx: utils/tbl.cmx bytecomp/switch.cmx typing/primitive.cmx \ + utils/misc.cmx bytecomp/lambda.cmx typing/ident.cmx asmcomp/debuginfo.cmx \ + asmcomp/compilenv.cmx utils/clflags.cmx asmcomp/clambda.cmx \ + parsing/asttypes.cmi asmcomp/closure.cmi +asmcomp/cmm.cmo: typing/ident.cmi asmcomp/debuginfo.cmi asmcomp/arch.cmo \ + asmcomp/cmm.cmi +asmcomp/cmm.cmx: typing/ident.cmx asmcomp/debuginfo.cmx asmcomp/arch.cmx \ + asmcomp/cmm.cmi +asmcomp/cmmgen.cmo: typing/types.cmi bytecomp/switch.cmi asmcomp/proc.cmi \ + typing/primitive.cmi utils/misc.cmi bytecomp/lambda.cmi typing/ident.cmi \ + asmcomp/debuginfo.cmi utils/config.cmi asmcomp/compilenv.cmi \ + asmcomp/cmm.cmi utils/clflags.cmi asmcomp/clambda.cmi \ + parsing/asttypes.cmi asmcomp/arch.cmo asmcomp/cmmgen.cmi +asmcomp/cmmgen.cmx: typing/types.cmx bytecomp/switch.cmx asmcomp/proc.cmx \ + typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx typing/ident.cmx \ + asmcomp/debuginfo.cmx utils/config.cmx asmcomp/compilenv.cmx \ + asmcomp/cmm.cmx utils/clflags.cmx asmcomp/clambda.cmx \ + parsing/asttypes.cmi asmcomp/arch.cmx asmcomp/cmmgen.cmi +asmcomp/codegen.cmo: asmcomp/split.cmi asmcomp/spill.cmi asmcomp/reload.cmi \ + asmcomp/reg.cmi asmcomp/printmach.cmi asmcomp/printlinear.cmi \ + asmcomp/printcmm.cmi asmcomp/liveness.cmi asmcomp/linearize.cmi \ + asmcomp/interf.cmi asmcomp/emit.cmi asmcomp/coloring.cmi asmcomp/cmm.cmi \ + asmcomp/codegen.cmi +asmcomp/codegen.cmx: asmcomp/split.cmx asmcomp/spill.cmx asmcomp/reload.cmx \ + asmcomp/reg.cmx asmcomp/printmach.cmx asmcomp/printlinear.cmx \ + asmcomp/printcmm.cmx asmcomp/liveness.cmx asmcomp/linearize.cmx \ + asmcomp/interf.cmx asmcomp/emit.cmx asmcomp/coloring.cmx asmcomp/cmm.cmx \ + asmcomp/codegen.cmi +asmcomp/coloring.cmo: asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/coloring.cmi +asmcomp/coloring.cmx: asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/coloring.cmi +asmcomp/comballoc.cmo: asmcomp/reg.cmi asmcomp/mach.cmi utils/config.cmi \ + asmcomp/comballoc.cmi +asmcomp/comballoc.cmx: asmcomp/reg.cmx asmcomp/mach.cmx utils/config.cmx \ + asmcomp/comballoc.cmi +asmcomp/compilenv.cmo: utils/misc.cmi typing/ident.cmi typing/env.cmi \ + utils/config.cmi asmcomp/clambda.cmi asmcomp/compilenv.cmi +asmcomp/compilenv.cmx: utils/misc.cmx typing/ident.cmx typing/env.cmx \ + utils/config.cmx asmcomp/clambda.cmx asmcomp/compilenv.cmi +asmcomp/debuginfo.cmo: parsing/location.cmi bytecomp/lambda.cmi \ + asmcomp/debuginfo.cmi +asmcomp/debuginfo.cmx: parsing/location.cmx bytecomp/lambda.cmx \ + asmcomp/debuginfo.cmi +asmcomp/emit.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi parsing/location.cmi asmcomp/linearize.cmi \ + asmcomp/emitaux.cmi asmcomp/debuginfo.cmi utils/config.cmi \ + asmcomp/compilenv.cmi asmcomp/cmm.cmi utils/clflags.cmi asmcomp/arch.cmo \ + asmcomp/emit.cmi +asmcomp/emit.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx parsing/location.cmx asmcomp/linearize.cmx \ + asmcomp/emitaux.cmx asmcomp/debuginfo.cmx utils/config.cmx \ + asmcomp/compilenv.cmx asmcomp/cmm.cmx utils/clflags.cmx asmcomp/arch.cmx \ + asmcomp/emit.cmi +asmcomp/emitaux.cmo: asmcomp/reg.cmi asmcomp/linearize.cmi \ + asmcomp/debuginfo.cmi asmcomp/cmm.cmi asmcomp/arch.cmo \ + asmcomp/emitaux.cmi +asmcomp/emitaux.cmx: asmcomp/reg.cmx asmcomp/linearize.cmx \ + asmcomp/debuginfo.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \ + asmcomp/emitaux.cmi +asmcomp/interf.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi asmcomp/interf.cmi +asmcomp/interf.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx asmcomp/interf.cmi +asmcomp/linearize.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/linearize.cmi +asmcomp/linearize.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/linearize.cmi +asmcomp/liveness.cmo: asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printmach.cmi \ + utils/misc.cmi asmcomp/mach.cmi asmcomp/liveness.cmi +asmcomp/liveness.cmx: asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/printmach.cmx \ + utils/misc.cmx asmcomp/mach.cmx asmcomp/liveness.cmi +asmcomp/mach.cmo: asmcomp/reg.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/arch.cmo asmcomp/mach.cmi +asmcomp/mach.cmx: asmcomp/reg.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/arch.cmx asmcomp/mach.cmi +asmcomp/printcmm.cmo: typing/ident.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/printcmm.cmi +asmcomp/printcmm.cmx: typing/ident.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/printcmm.cmi +asmcomp/printlinear.cmo: asmcomp/printmach.cmi asmcomp/mach.cmi \ + asmcomp/linearize.cmi asmcomp/debuginfo.cmi asmcomp/printlinear.cmi +asmcomp/printlinear.cmx: asmcomp/printmach.cmx asmcomp/mach.cmx \ + asmcomp/linearize.cmx asmcomp/debuginfo.cmx asmcomp/printlinear.cmi +asmcomp/printmach.cmo: asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printcmm.cmi \ + asmcomp/mach.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi asmcomp/arch.cmo \ + asmcomp/printmach.cmi +asmcomp/printmach.cmx: asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/printcmm.cmx \ + asmcomp/mach.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \ + asmcomp/printmach.cmi +asmcomp/proc.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + utils/config.cmi asmcomp/cmm.cmi utils/clflags.cmi utils/ccomp.cmi \ + asmcomp/arch.cmo asmcomp/proc.cmi +asmcomp/proc.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + utils/config.cmx asmcomp/cmm.cmx utils/clflags.cmx utils/ccomp.cmx \ + asmcomp/arch.cmx asmcomp/proc.cmi +asmcomp/reg.cmo: asmcomp/cmm.cmi asmcomp/reg.cmi +asmcomp/reg.cmx: asmcomp/cmm.cmx asmcomp/reg.cmi +asmcomp/reload.cmo: asmcomp/reloadgen.cmi asmcomp/reg.cmi asmcomp/mach.cmi \ + asmcomp/cmm.cmi asmcomp/arch.cmo asmcomp/reload.cmi +asmcomp/reload.cmx: asmcomp/reloadgen.cmx asmcomp/reg.cmx asmcomp/mach.cmx \ + asmcomp/cmm.cmx asmcomp/arch.cmx asmcomp/reload.cmi +asmcomp/reloadgen.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + asmcomp/reloadgen.cmi +asmcomp/reloadgen.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + asmcomp/reloadgen.cmi +asmcomp/schedgen.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + asmcomp/linearize.cmi asmcomp/cmm.cmi asmcomp/arch.cmo \ + asmcomp/schedgen.cmi +asmcomp/schedgen.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + asmcomp/linearize.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \ + asmcomp/schedgen.cmi +asmcomp/scheduling.cmo: asmcomp/schedgen.cmi asmcomp/scheduling.cmi +asmcomp/scheduling.cmx: asmcomp/schedgen.cmx asmcomp/scheduling.cmi +asmcomp/selectgen.cmo: utils/tbl.cmi asmcomp/reg.cmi asmcomp/proc.cmi \ + utils/misc.cmi asmcomp/mach.cmi typing/ident.cmi asmcomp/debuginfo.cmi \ + asmcomp/cmm.cmi asmcomp/arch.cmo asmcomp/selectgen.cmi +asmcomp/selectgen.cmx: utils/tbl.cmx asmcomp/reg.cmx asmcomp/proc.cmx \ + utils/misc.cmx asmcomp/mach.cmx typing/ident.cmx asmcomp/debuginfo.cmx \ + asmcomp/cmm.cmx asmcomp/arch.cmx asmcomp/selectgen.cmi +asmcomp/selection.cmo: asmcomp/selectgen.cmi asmcomp/reg.cmi asmcomp/proc.cmi \ + utils/misc.cmi asmcomp/mach.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/arch.cmo asmcomp/selection.cmi +asmcomp/selection.cmx: asmcomp/selectgen.cmx asmcomp/reg.cmx asmcomp/proc.cmx \ + utils/misc.cmx asmcomp/mach.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/arch.cmx asmcomp/selection.cmi +asmcomp/spill.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi asmcomp/spill.cmi +asmcomp/spill.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx asmcomp/spill.cmi +asmcomp/split.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + asmcomp/split.cmi +asmcomp/split.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + asmcomp/split.cmi +driver/compile.cmi: typing/env.cmi +driver/errors.cmi: +driver/main.cmi: +driver/main_args.cmi: +driver/optcompile.cmi: typing/env.cmi +driver/opterrors.cmi: +driver/optmain.cmi: +driver/pparse.cmi: +driver/compile.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/typemod.cmi typing/typedtree.cmi bytecomp/translmod.cmi \ + typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \ + bytecomp/printlambda.cmi bytecomp/printinstr.cmi parsing/printast.cmi \ + driver/pparse.cmi parsing/parse.cmi utils/misc.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi bytecomp/emitcode.cmi utils/config.cmi \ + utils/clflags.cmi utils/ccomp.cmi bytecomp/bytegen.cmi driver/compile.cmi +driver/compile.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/typemod.cmx typing/typedtree.cmx bytecomp/translmod.cmx \ + typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \ + bytecomp/printlambda.cmx bytecomp/printinstr.cmx parsing/printast.cmx \ + driver/pparse.cmx parsing/parse.cmx utils/misc.cmx parsing/location.cmx \ + typing/ident.cmx typing/env.cmx bytecomp/emitcode.cmx utils/config.cmx \ + utils/clflags.cmx utils/ccomp.cmx bytecomp/bytegen.cmx driver/compile.cmi +driver/errors.cmo: utils/warnings.cmi typing/typetexp.cmi typing/typemod.cmi \ + typing/typedecl.cmi typing/typecore.cmi typing/typeclass.cmi \ + bytecomp/translmod.cmi bytecomp/translcore.cmi bytecomp/translclass.cmi \ + parsing/syntaxerr.cmi bytecomp/symtable.cmi driver/pparse.cmi \ + parsing/location.cmi parsing/lexer.cmi typing/includemod.cmi \ + typing/env.cmi typing/ctype.cmi bytecomp/bytepackager.cmi \ + bytecomp/bytelink.cmi bytecomp/bytelibrarian.cmi driver/errors.cmi +driver/errors.cmx: utils/warnings.cmx typing/typetexp.cmx typing/typemod.cmx \ + typing/typedecl.cmx typing/typecore.cmx typing/typeclass.cmx \ + bytecomp/translmod.cmx bytecomp/translcore.cmx bytecomp/translclass.cmx \ + parsing/syntaxerr.cmx bytecomp/symtable.cmx driver/pparse.cmx \ + parsing/location.cmx parsing/lexer.cmx typing/includemod.cmx \ + typing/env.cmx typing/ctype.cmx bytecomp/bytepackager.cmx \ + bytecomp/bytelink.cmx bytecomp/bytelibrarian.cmx driver/errors.cmi +driver/main.cmo: utils/warnings.cmi utils/misc.cmi driver/main_args.cmi \ + driver/errors.cmi utils/config.cmi driver/compile.cmi utils/clflags.cmi \ + bytecomp/bytepackager.cmi bytecomp/bytelink.cmi \ + bytecomp/bytelibrarian.cmi driver/main.cmi +driver/main.cmx: utils/warnings.cmx utils/misc.cmx driver/main_args.cmx \ + driver/errors.cmx utils/config.cmx driver/compile.cmx utils/clflags.cmx \ + bytecomp/bytepackager.cmx bytecomp/bytelink.cmx \ + bytecomp/bytelibrarian.cmx driver/main.cmi +driver/main_args.cmo: driver/main_args.cmi +driver/main_args.cmx: driver/main_args.cmi +driver/optcompile.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/typemod.cmi typing/typedtree.cmi bytecomp/translmod.cmi \ + typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \ + bytecomp/printlambda.cmi parsing/printast.cmi driver/pparse.cmi \ + parsing/parse.cmi utils/misc.cmi parsing/location.cmi typing/ident.cmi \ + typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi utils/clflags.cmi \ + utils/ccomp.cmi asmcomp/asmgen.cmi driver/optcompile.cmi +driver/optcompile.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/typemod.cmx typing/typedtree.cmx bytecomp/translmod.cmx \ + typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \ + bytecomp/printlambda.cmx parsing/printast.cmx driver/pparse.cmx \ + parsing/parse.cmx utils/misc.cmx parsing/location.cmx typing/ident.cmx \ + typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx utils/clflags.cmx \ + utils/ccomp.cmx asmcomp/asmgen.cmx driver/optcompile.cmi +driver/opterrors.cmo: utils/warnings.cmi typing/typetexp.cmi \ + typing/typemod.cmi typing/typedecl.cmi typing/typecore.cmi \ + typing/typeclass.cmi bytecomp/translmod.cmi bytecomp/translcore.cmi \ + bytecomp/translclass.cmi parsing/syntaxerr.cmi driver/pparse.cmi \ + parsing/location.cmi parsing/lexer.cmi typing/includemod.cmi \ + typing/env.cmi typing/ctype.cmi asmcomp/compilenv.cmi \ + asmcomp/asmpackager.cmi asmcomp/asmlink.cmi asmcomp/asmlibrarian.cmi \ + asmcomp/asmgen.cmi driver/opterrors.cmi +driver/opterrors.cmx: utils/warnings.cmx typing/typetexp.cmx \ + typing/typemod.cmx typing/typedecl.cmx typing/typecore.cmx \ + typing/typeclass.cmx bytecomp/translmod.cmx bytecomp/translcore.cmx \ + bytecomp/translclass.cmx parsing/syntaxerr.cmx driver/pparse.cmx \ + parsing/location.cmx parsing/lexer.cmx typing/includemod.cmx \ + typing/env.cmx typing/ctype.cmx asmcomp/compilenv.cmx \ + asmcomp/asmpackager.cmx asmcomp/asmlink.cmx asmcomp/asmlibrarian.cmx \ + asmcomp/asmgen.cmx driver/opterrors.cmi +driver/optmain.cmo: utils/warnings.cmi asmcomp/printmach.cmi \ + driver/opterrors.cmi driver/optcompile.cmi utils/misc.cmi \ + utils/config.cmi utils/clflags.cmi asmcomp/asmpackager.cmi \ + asmcomp/asmlink.cmi asmcomp/asmlibrarian.cmi asmcomp/arch.cmo \ + driver/optmain.cmi +driver/optmain.cmx: utils/warnings.cmx asmcomp/printmach.cmx \ + driver/opterrors.cmx driver/optcompile.cmx utils/misc.cmx \ + utils/config.cmx utils/clflags.cmx asmcomp/asmpackager.cmx \ + asmcomp/asmlink.cmx asmcomp/asmlibrarian.cmx asmcomp/arch.cmx \ + driver/optmain.cmi +driver/pparse.cmo: utils/misc.cmi parsing/location.cmi utils/clflags.cmi \ + utils/ccomp.cmi driver/pparse.cmi +driver/pparse.cmx: utils/misc.cmx parsing/location.cmx utils/clflags.cmx \ + utils/ccomp.cmx driver/pparse.cmi +toplevel/genprintval.cmi: typing/types.cmi typing/path.cmi \ + typing/outcometree.cmi typing/env.cmi +toplevel/opttopdirs.cmi: parsing/longident.cmi +toplevel/opttoploop.cmi: utils/warnings.cmi typing/types.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/outcometree.cmi parsing/longident.cmi \ + parsing/location.cmi typing/env.cmi +toplevel/opttopmain.cmi: +toplevel/topdirs.cmi: parsing/longident.cmi +toplevel/toploop.cmi: utils/warnings.cmi typing/types.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/outcometree.cmi parsing/longident.cmi \ + parsing/location.cmi typing/env.cmi +toplevel/topmain.cmi: +toplevel/trace.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \ + typing/env.cmi +toplevel/expunge.cmo: bytecomp/symtable.cmi bytecomp/runtimedef.cmi \ + utils/misc.cmi typing/ident.cmi bytecomp/bytesections.cmi +toplevel/expunge.cmx: bytecomp/symtable.cmx bytecomp/runtimedef.cmx \ + utils/misc.cmx typing/ident.cmx bytecomp/bytesections.cmx +toplevel/genprintval.cmo: typing/types.cmi typing/printtyp.cmi \ + typing/predef.cmi typing/path.cmi typing/outcometree.cmi utils/misc.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi typing/datarepr.cmi \ + typing/ctype.cmi typing/btype.cmi toplevel/genprintval.cmi +toplevel/genprintval.cmx: typing/types.cmx typing/printtyp.cmx \ + typing/predef.cmx typing/path.cmx typing/outcometree.cmi utils/misc.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx typing/datarepr.cmx \ + typing/ctype.cmx typing/btype.cmx toplevel/genprintval.cmi +toplevel/opttopdirs.cmo: utils/warnings.cmi typing/types.cmi \ + typing/printtyp.cmi typing/path.cmi toplevel/opttoploop.cmi \ + utils/misc.cmi parsing/longident.cmi typing/ident.cmi typing/env.cmi \ + typing/ctype.cmi utils/config.cmi utils/clflags.cmi asmcomp/asmlink.cmi \ + toplevel/opttopdirs.cmi +toplevel/opttopdirs.cmx: utils/warnings.cmx typing/types.cmx \ + typing/printtyp.cmx typing/path.cmx toplevel/opttoploop.cmx \ + utils/misc.cmx parsing/longident.cmx typing/ident.cmx typing/env.cmx \ + typing/ctype.cmx utils/config.cmx utils/clflags.cmx asmcomp/asmlink.cmx \ + toplevel/opttopdirs.cmi +toplevel/opttoploop.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/types.cmi typing/typemod.cmi typing/typedtree.cmi \ + typing/typecore.cmi bytecomp/translmod.cmi bytecomp/simplif.cmi \ + typing/printtyp.cmi bytecomp/printlambda.cmi parsing/printast.cmi \ + typing/predef.cmi typing/path.cmi parsing/parsetree.cmi parsing/parse.cmi \ + typing/outcometree.cmi driver/opterrors.cmi driver/optcompile.cmi \ + typing/oprint.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi parsing/lexer.cmi bytecomp/lambda.cmi \ + typing/ident.cmi toplevel/genprintval.cmi typing/env.cmi utils/config.cmi \ + asmcomp/compilenv.cmi utils/clflags.cmi typing/btype.cmi \ + asmcomp/asmlink.cmi asmcomp/asmgen.cmi toplevel/opttoploop.cmi +toplevel/opttoploop.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/types.cmx typing/typemod.cmx typing/typedtree.cmx \ + typing/typecore.cmx bytecomp/translmod.cmx bytecomp/simplif.cmx \ + typing/printtyp.cmx bytecomp/printlambda.cmx parsing/printast.cmx \ + typing/predef.cmx typing/path.cmx parsing/parsetree.cmi parsing/parse.cmx \ + typing/outcometree.cmi driver/opterrors.cmx driver/optcompile.cmx \ + typing/oprint.cmx utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx parsing/lexer.cmx bytecomp/lambda.cmx \ + typing/ident.cmx toplevel/genprintval.cmx typing/env.cmx utils/config.cmx \ + asmcomp/compilenv.cmx utils/clflags.cmx typing/btype.cmx \ + asmcomp/asmlink.cmx asmcomp/asmgen.cmx toplevel/opttoploop.cmi +toplevel/opttopmain.cmo: utils/warnings.cmi asmcomp/printmach.cmi \ + toplevel/opttoploop.cmi toplevel/opttopdirs.cmi driver/opterrors.cmi \ + utils/misc.cmi utils/config.cmi utils/clflags.cmi asmcomp/arch.cmo \ + toplevel/opttopmain.cmi +toplevel/opttopmain.cmx: utils/warnings.cmx asmcomp/printmach.cmx \ + toplevel/opttoploop.cmx toplevel/opttopdirs.cmx driver/opterrors.cmx \ + utils/misc.cmx utils/config.cmx utils/clflags.cmx asmcomp/arch.cmx \ + toplevel/opttopmain.cmi +toplevel/opttopstart.cmo: toplevel/opttopmain.cmi +toplevel/opttopstart.cmx: toplevel/opttopmain.cmx +toplevel/topdirs.cmo: utils/warnings.cmi typing/types.cmi toplevel/trace.cmi \ + toplevel/toploop.cmi bytecomp/symtable.cmi typing/printtyp.cmi \ + typing/path.cmi bytecomp/opcodes.cmo utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi bytecomp/dll.cmi \ + typing/ctype.cmi utils/consistbl.cmi utils/config.cmi \ + bytecomp/cmo_format.cmi utils/clflags.cmi toplevel/topdirs.cmi +toplevel/topdirs.cmx: utils/warnings.cmx typing/types.cmx toplevel/trace.cmx \ + toplevel/toploop.cmx bytecomp/symtable.cmx typing/printtyp.cmx \ + typing/path.cmx bytecomp/opcodes.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx bytecomp/dll.cmx \ + typing/ctype.cmx utils/consistbl.cmx utils/config.cmx \ + bytecomp/cmo_format.cmi utils/clflags.cmx toplevel/topdirs.cmi +toplevel/toploop.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/types.cmi typing/typemod.cmi typing/typedtree.cmi \ + typing/typecore.cmi bytecomp/translmod.cmi bytecomp/symtable.cmi \ + bytecomp/simplif.cmi typing/printtyp.cmi bytecomp/printlambda.cmi \ + bytecomp/printinstr.cmi parsing/printast.cmi typing/predef.cmi \ + typing/path.cmi parsing/parsetree.cmi parsing/parse.cmi \ + typing/outcometree.cmi typing/oprint.cmi utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi parsing/location.cmi parsing/lexer.cmi \ + typing/ident.cmi toplevel/genprintval.cmi driver/errors.cmi \ + typing/env.cmi bytecomp/emitcode.cmi bytecomp/dll.cmi utils/consistbl.cmi \ + utils/config.cmi driver/compile.cmi utils/clflags.cmi \ + bytecomp/bytegen.cmi typing/btype.cmi toplevel/toploop.cmi +toplevel/toploop.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/types.cmx typing/typemod.cmx typing/typedtree.cmx \ + typing/typecore.cmx bytecomp/translmod.cmx bytecomp/symtable.cmx \ + bytecomp/simplif.cmx typing/printtyp.cmx bytecomp/printlambda.cmx \ + bytecomp/printinstr.cmx parsing/printast.cmx typing/predef.cmx \ + typing/path.cmx parsing/parsetree.cmi parsing/parse.cmx \ + typing/outcometree.cmi typing/oprint.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx parsing/location.cmx parsing/lexer.cmx \ + typing/ident.cmx toplevel/genprintval.cmx driver/errors.cmx \ + typing/env.cmx bytecomp/emitcode.cmx bytecomp/dll.cmx utils/consistbl.cmx \ + utils/config.cmx driver/compile.cmx utils/clflags.cmx \ + bytecomp/bytegen.cmx typing/btype.cmx toplevel/toploop.cmi +toplevel/topmain.cmo: utils/warnings.cmi toplevel/toploop.cmi \ + toplevel/topdirs.cmi utils/misc.cmi driver/errors.cmi utils/config.cmi \ + utils/clflags.cmi toplevel/topmain.cmi +toplevel/topmain.cmx: utils/warnings.cmx toplevel/toploop.cmx \ + toplevel/topdirs.cmx utils/misc.cmx driver/errors.cmx utils/config.cmx \ + utils/clflags.cmx toplevel/topmain.cmi +toplevel/topstart.cmo: toplevel/topmain.cmi +toplevel/topstart.cmx: toplevel/topmain.cmx +toplevel/trace.cmo: typing/types.cmi toplevel/toploop.cmi typing/printtyp.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi typing/ctype.cmi toplevel/trace.cmi +toplevel/trace.cmx: typing/types.cmx toplevel/toploop.cmx typing/printtyp.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx typing/ctype.cmx toplevel/trace.cmi diff -Naur ocaml-3.11.0/.depend~ ocaml-3.11.0-enhtop+/.depend~ --- ocaml-3.11.0/.depend~ 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/.depend~ 2009-03-24 10:55:08.045441594 -0400 @@ -0,0 +1,899 @@ +utils/ccomp.cmi: +utils/clflags.cmi: +utils/config.cmi: +utils/consistbl.cmi: +utils/misc.cmi: +utils/tbl.cmi: +utils/terminfo.cmi: +utils/warnings.cmi: +utils/ccomp.cmo: utils/misc.cmi utils/config.cmi utils/clflags.cmi \ + utils/ccomp.cmi +utils/ccomp.cmx: utils/misc.cmx utils/config.cmx utils/clflags.cmx \ + utils/ccomp.cmi +utils/clflags.cmo: utils/config.cmi utils/clflags.cmi +utils/clflags.cmx: utils/config.cmx utils/clflags.cmi +utils/config.cmo: utils/config.cmi +utils/config.cmx: utils/config.cmi +utils/consistbl.cmo: utils/consistbl.cmi +utils/consistbl.cmx: utils/consistbl.cmi +utils/misc.cmo: utils/misc.cmi +utils/misc.cmx: utils/misc.cmi +utils/tbl.cmo: utils/tbl.cmi +utils/tbl.cmx: utils/tbl.cmi +utils/terminfo.cmo: utils/terminfo.cmi +utils/terminfo.cmx: utils/terminfo.cmi +utils/warnings.cmo: utils/warnings.cmi +utils/warnings.cmx: utils/warnings.cmi +parsing/asttypes.cmi: +parsing/lexer.cmi: parsing/parser.cmi parsing/location.cmi +parsing/linenum.cmi: +parsing/location.cmi: utils/warnings.cmi +parsing/longident.cmi: +parsing/parse.cmi: parsing/parsetree.cmi +parsing/parser.cmi: parsing/parsetree.cmi +parsing/parsetree.cmi: parsing/longident.cmi parsing/location.cmi \ + parsing/asttypes.cmi +parsing/printast.cmi: parsing/parsetree.cmi +parsing/syntaxerr.cmi: parsing/location.cmi +parsing/lexer.cmo: utils/warnings.cmi parsing/parser.cmi utils/misc.cmi \ + parsing/location.cmi parsing/lexer.cmi +parsing/lexer.cmx: utils/warnings.cmx parsing/parser.cmx utils/misc.cmx \ + parsing/location.cmx parsing/lexer.cmi +parsing/linenum.cmo: utils/misc.cmi parsing/linenum.cmi +parsing/linenum.cmx: utils/misc.cmx parsing/linenum.cmi +parsing/location.cmo: utils/warnings.cmi utils/terminfo.cmi \ + parsing/linenum.cmi parsing/location.cmi +parsing/location.cmx: utils/warnings.cmx utils/terminfo.cmx \ + parsing/linenum.cmx parsing/location.cmi +parsing/longident.cmo: utils/misc.cmi parsing/longident.cmi +parsing/longident.cmx: utils/misc.cmx parsing/longident.cmi +parsing/parse.cmo: parsing/syntaxerr.cmi parsing/parser.cmi \ + parsing/location.cmi parsing/lexer.cmi parsing/parse.cmi +parsing/parse.cmx: parsing/syntaxerr.cmx parsing/parser.cmx \ + parsing/location.cmx parsing/lexer.cmx parsing/parse.cmi +parsing/parser.cmo: parsing/syntaxerr.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi utils/clflags.cmi \ + parsing/asttypes.cmi parsing/parser.cmi +parsing/parser.cmx: parsing/syntaxerr.cmx parsing/parsetree.cmi \ + parsing/longident.cmx parsing/location.cmx utils/clflags.cmx \ + parsing/asttypes.cmi parsing/parser.cmi +parsing/printast.cmo: parsing/parsetree.cmi parsing/longident.cmi \ + parsing/location.cmi parsing/asttypes.cmi parsing/printast.cmi +parsing/printast.cmx: parsing/parsetree.cmi parsing/longident.cmx \ + parsing/location.cmx parsing/asttypes.cmi parsing/printast.cmi +parsing/syntaxerr.cmo: parsing/location.cmi parsing/syntaxerr.cmi +parsing/syntaxerr.cmx: parsing/location.cmx parsing/syntaxerr.cmi +typing/annot.cmi: parsing/location.cmi +typing/btype.cmi: typing/types.cmi typing/path.cmi parsing/asttypes.cmi +typing/ctype.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi \ + typing/env.cmi parsing/asttypes.cmi +typing/datarepr.cmi: typing/types.cmi typing/path.cmi parsing/asttypes.cmi +typing/env.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \ + typing/ident.cmi utils/consistbl.cmi typing/annot.cmi +typing/ident.cmi: +typing/includeclass.cmi: typing/types.cmi typing/typedtree.cmi typing/env.cmi \ + typing/ctype.cmi +typing/includecore.cmi: typing/types.cmi typing/typedtree.cmi \ + typing/ident.cmi typing/env.cmi +typing/includemod.cmi: typing/types.cmi typing/typedtree.cmi typing/path.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi +typing/mtype.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi \ + typing/env.cmi +typing/oprint.cmi: typing/outcometree.cmi +typing/outcometree.cmi: parsing/asttypes.cmi +typing/parmatch.cmi: typing/types.cmi typing/typedtree.cmi \ + parsing/location.cmi typing/env.cmi +typing/path.cmi: typing/ident.cmi +typing/predef.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi +typing/primitive.cmi: +typing/printtyp.cmi: typing/types.cmi typing/path.cmi typing/outcometree.cmi \ + parsing/longident.cmi typing/ident.cmi +typing/stypes.cmi: typing/typedtree.cmi parsing/location.cmi typing/annot.cmi +typing/subst.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi +typing/typeclass.cmi: typing/types.cmi typing/typedtree.cmi \ + parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi parsing/asttypes.cmi +typing/typecore.cmi: typing/types.cmi typing/typedtree.cmi typing/path.cmi \ + parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi parsing/asttypes.cmi typing/annot.cmi +typing/typedecl.cmi: typing/types.cmi typing/path.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi typing/ident.cmi \ + typing/env.cmi +typing/typedtree.cmi: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + parsing/location.cmi typing/ident.cmi typing/env.cmi parsing/asttypes.cmi +typing/typemod.cmi: typing/types.cmi typing/typedtree.cmi \ + parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \ + typing/includemod.cmi typing/ident.cmi typing/env.cmi +typing/types.cmi: typing/primitive.cmi typing/path.cmi typing/ident.cmi \ + parsing/asttypes.cmi +typing/typetexp.cmi: typing/types.cmi typing/path.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi typing/env.cmi +typing/unused_var.cmi: parsing/parsetree.cmi +typing/btype.cmo: typing/types.cmi typing/path.cmi utils/misc.cmi \ + typing/btype.cmi +typing/btype.cmx: typing/types.cmx typing/path.cmx utils/misc.cmx \ + typing/btype.cmi +typing/ctype.cmo: typing/types.cmi typing/subst.cmi typing/path.cmi \ + utils/misc.cmi parsing/longident.cmi typing/ident.cmi typing/env.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/ctype.cmi +typing/ctype.cmx: typing/types.cmx typing/subst.cmx typing/path.cmx \ + utils/misc.cmx parsing/longident.cmx typing/ident.cmx typing/env.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/ctype.cmi +typing/datarepr.cmo: typing/types.cmi typing/predef.cmi utils/misc.cmi \ + parsing/asttypes.cmi typing/datarepr.cmi +typing/datarepr.cmx: typing/types.cmx typing/predef.cmx utils/misc.cmx \ + parsing/asttypes.cmi typing/datarepr.cmi +typing/env.cmo: typing/types.cmi utils/tbl.cmi typing/subst.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi parsing/longident.cmi \ + typing/ident.cmi typing/datarepr.cmi utils/consistbl.cmi utils/config.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/annot.cmi \ + typing/env.cmi +typing/env.cmx: typing/types.cmx utils/tbl.cmx typing/subst.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx parsing/longident.cmx \ + typing/ident.cmx typing/datarepr.cmx utils/consistbl.cmx utils/config.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/annot.cmi \ + typing/env.cmi +typing/ident.cmo: typing/ident.cmi +typing/ident.cmx: typing/ident.cmi +typing/includeclass.cmo: typing/types.cmi typing/printtyp.cmi \ + typing/ctype.cmi typing/includeclass.cmi +typing/includeclass.cmx: typing/types.cmx typing/printtyp.cmx \ + typing/ctype.cmx typing/includeclass.cmi +typing/includecore.cmo: typing/types.cmi typing/typedtree.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi typing/ctype.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/includecore.cmi +typing/includecore.cmx: typing/types.cmx typing/typedtree.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx typing/ctype.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/includecore.cmi +typing/includemod.cmo: typing/types.cmi typing/typedtree.cmi utils/tbl.cmi \ + typing/subst.cmi typing/printtyp.cmi typing/path.cmi typing/mtype.cmi \ + utils/misc.cmi typing/includecore.cmi typing/includeclass.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi typing/includemod.cmi +typing/includemod.cmx: typing/types.cmx typing/typedtree.cmx utils/tbl.cmx \ + typing/subst.cmx typing/printtyp.cmx typing/path.cmx typing/mtype.cmx \ + utils/misc.cmx typing/includecore.cmx typing/includeclass.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx typing/includemod.cmi +typing/mtype.cmo: typing/types.cmi typing/subst.cmi typing/path.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi typing/btype.cmi \ + parsing/asttypes.cmi typing/mtype.cmi +typing/mtype.cmx: typing/types.cmx typing/subst.cmx typing/path.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx typing/btype.cmx \ + parsing/asttypes.cmi typing/mtype.cmi +typing/oprint.cmo: typing/outcometree.cmi parsing/asttypes.cmi \ + typing/oprint.cmi +typing/oprint.cmx: typing/outcometree.cmi parsing/asttypes.cmi \ + typing/oprint.cmi +typing/parmatch.cmo: utils/warnings.cmi typing/types.cmi typing/typedtree.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi typing/datarepr.cmi typing/ctype.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/parmatch.cmi +typing/parmatch.cmx: utils/warnings.cmx typing/types.cmx typing/typedtree.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx parsing/location.cmx \ + typing/ident.cmx typing/env.cmx typing/datarepr.cmx typing/ctype.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/parmatch.cmi +typing/path.cmo: typing/ident.cmi typing/path.cmi +typing/path.cmx: typing/ident.cmx typing/path.cmi +typing/predef.cmo: typing/types.cmi typing/path.cmi typing/ident.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/predef.cmi +typing/predef.cmx: typing/types.cmx typing/path.cmx typing/ident.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/predef.cmi +typing/primitive.cmo: utils/misc.cmi typing/primitive.cmi +typing/primitive.cmx: utils/misc.cmx typing/primitive.cmi +typing/printtyp.cmo: typing/types.cmi typing/primitive.cmi typing/predef.cmi \ + typing/path.cmi typing/outcometree.cmi typing/oprint.cmi utils/misc.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi typing/ctype.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi \ + typing/printtyp.cmi +typing/printtyp.cmx: typing/types.cmx typing/primitive.cmx typing/predef.cmx \ + typing/path.cmx typing/outcometree.cmi typing/oprint.cmx utils/misc.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx typing/ctype.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \ + typing/printtyp.cmi +typing/stypes.cmo: typing/typedtree.cmi typing/printtyp.cmi \ + parsing/location.cmi utils/clflags.cmi typing/annot.cmi typing/stypes.cmi +typing/stypes.cmx: typing/typedtree.cmx typing/printtyp.cmx \ + parsing/location.cmx utils/clflags.cmx typing/annot.cmi typing/stypes.cmi +typing/subst.cmo: typing/types.cmi utils/tbl.cmi typing/path.cmi \ + utils/misc.cmi typing/ident.cmi typing/btype.cmi typing/subst.cmi +typing/subst.cmx: typing/types.cmx utils/tbl.cmx typing/path.cmx \ + utils/misc.cmx typing/ident.cmx typing/btype.cmx typing/subst.cmi +typing/typeclass.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \ + typing/typedtree.cmi typing/typedecl.cmi typing/typecore.cmi \ + typing/subst.cmi typing/stypes.cmi typing/printtyp.cmi typing/predef.cmi \ + typing/path.cmi parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/includeclass.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/typeclass.cmi +typing/typeclass.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \ + typing/typedtree.cmx typing/typedecl.cmx typing/typecore.cmx \ + typing/subst.cmx typing/stypes.cmx typing/printtyp.cmx typing/predef.cmx \ + typing/path.cmx parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/includeclass.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/typeclass.cmi +typing/typecore.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \ + typing/typedtree.cmi typing/stypes.cmi typing/printtyp.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/parmatch.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/ident.cmi \ + typing/env.cmi typing/ctype.cmi utils/clflags.cmi typing/btype.cmi \ + parsing/asttypes.cmi typing/annot.cmi typing/typecore.cmi +typing/typecore.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \ + typing/typedtree.cmx typing/stypes.cmx typing/printtyp.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx \ + parsing/parsetree.cmi typing/parmatch.cmx utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/ident.cmx \ + typing/env.cmx typing/ctype.cmx utils/clflags.cmx typing/btype.cmx \ + parsing/asttypes.cmi typing/annot.cmi typing/typecore.cmi +typing/typedecl.cmo: typing/typetexp.cmi typing/types.cmi \ + typing/typedtree.cmi typing/subst.cmi typing/printtyp.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi \ + parsing/parsetree.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi typing/includecore.cmi typing/ident.cmi \ + typing/env.cmi typing/ctype.cmi utils/config.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi typing/typedecl.cmi +typing/typedecl.cmx: typing/typetexp.cmx typing/types.cmx \ + typing/typedtree.cmx typing/subst.cmx typing/printtyp.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx \ + parsing/parsetree.cmi utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx typing/includecore.cmx typing/ident.cmx \ + typing/env.cmx typing/ctype.cmx utils/config.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi typing/typedecl.cmi +typing/typedtree.cmo: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + utils/misc.cmi parsing/location.cmi typing/ident.cmi typing/env.cmi \ + parsing/asttypes.cmi typing/typedtree.cmi +typing/typedtree.cmx: typing/types.cmx typing/primitive.cmx typing/path.cmx \ + utils/misc.cmx parsing/location.cmx typing/ident.cmx typing/env.cmx \ + parsing/asttypes.cmi typing/typedtree.cmi +typing/typemod.cmo: typing/types.cmi typing/typedtree.cmi typing/typedecl.cmi \ + typing/typecore.cmi typing/typeclass.cmi typing/subst.cmi \ + typing/stypes.cmi typing/printtyp.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/mtype.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/includemod.cmi \ + typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/config.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/annot.cmi \ + typing/typemod.cmi +typing/typemod.cmx: typing/types.cmx typing/typedtree.cmx typing/typedecl.cmx \ + typing/typecore.cmx typing/typeclass.cmx typing/subst.cmx \ + typing/stypes.cmx typing/printtyp.cmx typing/path.cmx \ + parsing/parsetree.cmi typing/mtype.cmx utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/includemod.cmx \ + typing/ident.cmx typing/env.cmx typing/ctype.cmx utils/config.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/annot.cmi \ + typing/typemod.cmi +typing/types.cmo: typing/primitive.cmi typing/path.cmi utils/misc.cmi \ + typing/ident.cmi parsing/asttypes.cmi typing/types.cmi +typing/types.cmx: typing/primitive.cmx typing/path.cmx utils/misc.cmx \ + typing/ident.cmx parsing/asttypes.cmi typing/types.cmi +typing/typetexp.cmo: utils/warnings.cmi typing/types.cmi utils/tbl.cmi \ + typing/printtyp.cmi typing/path.cmi parsing/parsetree.cmi utils/misc.cmi \ + parsing/longident.cmi parsing/location.cmi typing/env.cmi \ + typing/ctype.cmi utils/clflags.cmi typing/btype.cmi typing/typetexp.cmi +typing/typetexp.cmx: utils/warnings.cmx typing/types.cmx utils/tbl.cmx \ + typing/printtyp.cmx typing/path.cmx parsing/parsetree.cmi utils/misc.cmx \ + parsing/longident.cmx parsing/location.cmx typing/env.cmx \ + typing/ctype.cmx utils/clflags.cmx typing/btype.cmx typing/typetexp.cmi +typing/unused_var.cmo: utils/warnings.cmi parsing/parsetree.cmi \ + parsing/longident.cmi parsing/location.cmi parsing/asttypes.cmi \ + typing/unused_var.cmi +typing/unused_var.cmx: utils/warnings.cmx parsing/parsetree.cmi \ + parsing/longident.cmx parsing/location.cmx parsing/asttypes.cmi \ + typing/unused_var.cmi +bytecomp/bytegen.cmi: bytecomp/lambda.cmi bytecomp/instruct.cmi +bytecomp/bytelibrarian.cmi: +bytecomp/bytelink.cmi: bytecomp/symtable.cmi bytecomp/cmo_format.cmi +bytecomp/bytepackager.cmi: typing/ident.cmi +bytecomp/bytesections.cmi: +bytecomp/cmo_format.cmi: bytecomp/lambda.cmi typing/ident.cmi +bytecomp/dll.cmi: +bytecomp/emitcode.cmi: bytecomp/instruct.cmi bytecomp/cmo_format.cmi +bytecomp/instruct.cmi: typing/types.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi +bytecomp/lambda.cmi: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + parsing/location.cmi typing/ident.cmi typing/env.cmi parsing/asttypes.cmi +bytecomp/matching.cmi: typing/typedtree.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi +bytecomp/meta.cmi: +bytecomp/printinstr.cmi: bytecomp/instruct.cmi +bytecomp/printlambda.cmi: bytecomp/lambda.cmi +bytecomp/runtimedef.cmi: +bytecomp/simplif.cmi: bytecomp/lambda.cmi +bytecomp/switch.cmi: +bytecomp/symtable.cmi: typing/ident.cmi bytecomp/cmo_format.cmi +bytecomp/translclass.cmi: typing/typedtree.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi +bytecomp/translcore.cmi: typing/types.cmi typing/typedtree.cmi \ + typing/primitive.cmi typing/path.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi parsing/asttypes.cmi +bytecomp/translmod.cmi: typing/typedtree.cmi typing/primitive.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi +bytecomp/translobj.cmi: bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi +bytecomp/typeopt.cmi: typing/typedtree.cmi typing/path.cmi \ + bytecomp/lambda.cmi +bytecomp/bytegen.cmo: typing/types.cmi bytecomp/switch.cmi typing/stypes.cmi \ + typing/primitive.cmi utils/misc.cmi bytecomp/lambda.cmi \ + bytecomp/instruct.cmi typing/ident.cmi utils/config.cmi \ + parsing/asttypes.cmi typing/annot.cmi bytecomp/bytegen.cmi +bytecomp/bytegen.cmx: typing/types.cmx bytecomp/switch.cmx typing/stypes.cmx \ + typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx \ + bytecomp/instruct.cmx typing/ident.cmx utils/config.cmx \ + parsing/asttypes.cmi typing/annot.cmi bytecomp/bytegen.cmi +bytecomp/bytelibrarian.cmo: utils/misc.cmi utils/config.cmi \ + bytecomp/cmo_format.cmi utils/clflags.cmi bytecomp/bytelink.cmi \ + bytecomp/bytelibrarian.cmi +bytecomp/bytelibrarian.cmx: utils/misc.cmx utils/config.cmx \ + bytecomp/cmo_format.cmi utils/clflags.cmx bytecomp/bytelink.cmx \ + bytecomp/bytelibrarian.cmi +bytecomp/bytelink.cmo: bytecomp/symtable.cmi bytecomp/opcodes.cmo \ + utils/misc.cmi bytecomp/instruct.cmi typing/ident.cmi bytecomp/dll.cmi \ + utils/consistbl.cmi utils/config.cmi bytecomp/cmo_format.cmi \ + utils/clflags.cmi utils/ccomp.cmi bytecomp/bytesections.cmi \ + bytecomp/bytelink.cmi +bytecomp/bytelink.cmx: bytecomp/symtable.cmx bytecomp/opcodes.cmx \ + utils/misc.cmx bytecomp/instruct.cmx typing/ident.cmx bytecomp/dll.cmx \ + utils/consistbl.cmx utils/config.cmx bytecomp/cmo_format.cmi \ + utils/clflags.cmx utils/ccomp.cmx bytecomp/bytesections.cmx \ + bytecomp/bytelink.cmi +bytecomp/bytepackager.cmo: typing/typemod.cmi bytecomp/translmod.cmi \ + utils/misc.cmi bytecomp/instruct.cmi typing/ident.cmi typing/env.cmi \ + bytecomp/emitcode.cmi utils/config.cmi bytecomp/cmo_format.cmi \ + utils/clflags.cmi bytecomp/bytelink.cmi bytecomp/bytegen.cmi \ + bytecomp/bytepackager.cmi +bytecomp/bytepackager.cmx: typing/typemod.cmx bytecomp/translmod.cmx \ + utils/misc.cmx bytecomp/instruct.cmx typing/ident.cmx typing/env.cmx \ + bytecomp/emitcode.cmx utils/config.cmx bytecomp/cmo_format.cmi \ + utils/clflags.cmx bytecomp/bytelink.cmx bytecomp/bytegen.cmx \ + bytecomp/bytepackager.cmi +bytecomp/bytesections.cmo: utils/config.cmi bytecomp/bytesections.cmi +bytecomp/bytesections.cmx: utils/config.cmx bytecomp/bytesections.cmi +bytecomp/dll.cmo: utils/misc.cmi utils/config.cmi bytecomp/dll.cmi +bytecomp/dll.cmx: utils/misc.cmx utils/config.cmx bytecomp/dll.cmi +bytecomp/emitcode.cmo: bytecomp/translmod.cmi typing/primitive.cmi \ + bytecomp/opcodes.cmo utils/misc.cmi bytecomp/meta.cmi bytecomp/lambda.cmi \ + bytecomp/instruct.cmi typing/env.cmi utils/config.cmi \ + bytecomp/cmo_format.cmi utils/clflags.cmi typing/btype.cmi \ + parsing/asttypes.cmi bytecomp/emitcode.cmi +bytecomp/emitcode.cmx: bytecomp/translmod.cmx typing/primitive.cmx \ + bytecomp/opcodes.cmx utils/misc.cmx bytecomp/meta.cmx bytecomp/lambda.cmx \ + bytecomp/instruct.cmx typing/env.cmx utils/config.cmx \ + bytecomp/cmo_format.cmi utils/clflags.cmx typing/btype.cmx \ + parsing/asttypes.cmi bytecomp/emitcode.cmi +bytecomp/instruct.cmo: typing/types.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi bytecomp/instruct.cmi +bytecomp/instruct.cmx: typing/types.cmx parsing/location.cmx \ + bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx bytecomp/instruct.cmi +bytecomp/lambda.cmo: typing/types.cmi typing/primitive.cmi typing/path.cmi \ + utils/misc.cmi parsing/location.cmi typing/ident.cmi typing/env.cmi \ + parsing/asttypes.cmi bytecomp/lambda.cmi +bytecomp/lambda.cmx: typing/types.cmx typing/primitive.cmx typing/path.cmx \ + utils/misc.cmx parsing/location.cmx typing/ident.cmx typing/env.cmx \ + parsing/asttypes.cmi bytecomp/lambda.cmi +bytecomp/matching.cmo: typing/types.cmi bytecomp/typeopt.cmi \ + typing/typedtree.cmi bytecomp/switch.cmi bytecomp/printlambda.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi \ + typing/parmatch.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi \ + bytecomp/matching.cmi +bytecomp/matching.cmx: typing/types.cmx bytecomp/typeopt.cmx \ + typing/typedtree.cmx bytecomp/switch.cmx bytecomp/printlambda.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx \ + typing/parmatch.cmx utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \ + bytecomp/matching.cmi +bytecomp/meta.cmo: bytecomp/meta.cmi +bytecomp/meta.cmx: bytecomp/meta.cmi +bytecomp/opcodes.cmo: +bytecomp/opcodes.cmx: +bytecomp/printinstr.cmo: bytecomp/printlambda.cmi parsing/location.cmi \ + bytecomp/lambda.cmi bytecomp/instruct.cmi typing/ident.cmi \ + bytecomp/printinstr.cmi +bytecomp/printinstr.cmx: bytecomp/printlambda.cmx parsing/location.cmx \ + bytecomp/lambda.cmx bytecomp/instruct.cmx typing/ident.cmx \ + bytecomp/printinstr.cmi +bytecomp/printlambda.cmo: typing/types.cmi typing/primitive.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi \ + parsing/asttypes.cmi bytecomp/printlambda.cmi +bytecomp/printlambda.cmx: typing/types.cmx typing/primitive.cmx \ + parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx \ + parsing/asttypes.cmi bytecomp/printlambda.cmi +bytecomp/runtimedef.cmo: bytecomp/runtimedef.cmi +bytecomp/runtimedef.cmx: bytecomp/runtimedef.cmi +bytecomp/simplif.cmo: bytecomp/lambda.cmi typing/ident.cmi utils/clflags.cmi \ + parsing/asttypes.cmi bytecomp/simplif.cmi +bytecomp/simplif.cmx: bytecomp/lambda.cmx typing/ident.cmx utils/clflags.cmx \ + parsing/asttypes.cmi bytecomp/simplif.cmi +bytecomp/switch.cmo: bytecomp/switch.cmi +bytecomp/switch.cmx: bytecomp/switch.cmi +bytecomp/symtable.cmo: utils/tbl.cmi bytecomp/runtimedef.cmi \ + typing/predef.cmi utils/misc.cmi bytecomp/meta.cmi bytecomp/lambda.cmi \ + typing/ident.cmi bytecomp/dll.cmi bytecomp/cmo_format.cmi \ + utils/clflags.cmi bytecomp/bytesections.cmi parsing/asttypes.cmi \ + bytecomp/symtable.cmi +bytecomp/symtable.cmx: utils/tbl.cmx bytecomp/runtimedef.cmx \ + typing/predef.cmx utils/misc.cmx bytecomp/meta.cmx bytecomp/lambda.cmx \ + typing/ident.cmx bytecomp/dll.cmx bytecomp/cmo_format.cmi \ + utils/clflags.cmx bytecomp/bytesections.cmx parsing/asttypes.cmi \ + bytecomp/symtable.cmi +bytecomp/translclass.cmo: typing/types.cmi bytecomp/typeopt.cmi \ + typing/typedtree.cmi bytecomp/translobj.cmi bytecomp/translcore.cmi \ + typing/path.cmi utils/misc.cmi bytecomp/matching.cmi parsing/location.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi bytecomp/translclass.cmi +bytecomp/translclass.cmx: typing/types.cmx bytecomp/typeopt.cmx \ + typing/typedtree.cmx bytecomp/translobj.cmx bytecomp/translcore.cmx \ + typing/path.cmx utils/misc.cmx bytecomp/matching.cmx parsing/location.cmx \ + bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi bytecomp/translclass.cmi +bytecomp/translcore.cmo: typing/types.cmi bytecomp/typeopt.cmi \ + typing/typedtree.cmi bytecomp/translobj.cmi typing/primitive.cmi \ + typing/predef.cmi typing/path.cmi typing/parmatch.cmi utils/misc.cmi \ + bytecomp/matching.cmi parsing/location.cmi bytecomp/lambda.cmi \ + typing/ident.cmi typing/env.cmi utils/config.cmi utils/clflags.cmi \ + typing/btype.cmi parsing/asttypes.cmi bytecomp/translcore.cmi +bytecomp/translcore.cmx: typing/types.cmx bytecomp/typeopt.cmx \ + typing/typedtree.cmx bytecomp/translobj.cmx typing/primitive.cmx \ + typing/predef.cmx typing/path.cmx typing/parmatch.cmx utils/misc.cmx \ + bytecomp/matching.cmx parsing/location.cmx bytecomp/lambda.cmx \ + typing/ident.cmx typing/env.cmx utils/config.cmx utils/clflags.cmx \ + typing/btype.cmx parsing/asttypes.cmi bytecomp/translcore.cmi +bytecomp/translmod.cmo: typing/types.cmi typing/typedtree.cmi \ + bytecomp/translobj.cmi bytecomp/translcore.cmi bytecomp/translclass.cmi \ + typing/printtyp.cmi typing/primitive.cmi typing/predef.cmi \ + typing/path.cmi typing/mtype.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi \ + typing/ctype.cmi parsing/asttypes.cmi bytecomp/translmod.cmi +bytecomp/translmod.cmx: typing/types.cmx typing/typedtree.cmx \ + bytecomp/translobj.cmx bytecomp/translcore.cmx bytecomp/translclass.cmx \ + typing/printtyp.cmx typing/primitive.cmx typing/predef.cmx \ + typing/path.cmx typing/mtype.cmx utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx \ + typing/ctype.cmx parsing/asttypes.cmi bytecomp/translmod.cmi +bytecomp/translobj.cmo: typing/primitive.cmi utils/misc.cmi \ + parsing/longident.cmi bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi \ + utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi \ + bytecomp/translobj.cmi +bytecomp/translobj.cmx: typing/primitive.cmx utils/misc.cmx \ + parsing/longident.cmx bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx \ + utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi \ + bytecomp/translobj.cmi +bytecomp/typeopt.cmo: typing/types.cmi typing/typedtree.cmi \ + typing/primitive.cmi typing/predef.cmi typing/path.cmi utils/misc.cmi \ + bytecomp/lambda.cmi typing/ident.cmi typing/env.cmi typing/ctype.cmi \ + parsing/asttypes.cmi bytecomp/typeopt.cmi +bytecomp/typeopt.cmx: typing/types.cmx typing/typedtree.cmx \ + typing/primitive.cmx typing/predef.cmx typing/path.cmx utils/misc.cmx \ + bytecomp/lambda.cmx typing/ident.cmx typing/env.cmx typing/ctype.cmx \ + parsing/asttypes.cmi bytecomp/typeopt.cmi +asmcomp/asmgen.cmi: bytecomp/lambda.cmi asmcomp/cmm.cmi +asmcomp/asmlibrarian.cmi: +asmcomp/asmlink.cmi: asmcomp/compilenv.cmi +asmcomp/asmpackager.cmi: +asmcomp/clambda.cmi: bytecomp/lambda.cmi typing/ident.cmi \ + asmcomp/debuginfo.cmi parsing/asttypes.cmi +asmcomp/closure.cmi: bytecomp/lambda.cmi asmcomp/clambda.cmi +asmcomp/cmm.cmi: typing/ident.cmi asmcomp/debuginfo.cmi +asmcomp/cmmgen.cmi: asmcomp/compilenv.cmi asmcomp/cmm.cmi asmcomp/clambda.cmi +asmcomp/codegen.cmi: asmcomp/cmm.cmi +asmcomp/coloring.cmi: +asmcomp/comballoc.cmi: asmcomp/mach.cmi +asmcomp/compilenv.cmi: typing/ident.cmi asmcomp/clambda.cmi +asmcomp/debuginfo.cmi: parsing/location.cmi bytecomp/lambda.cmi +asmcomp/emit.cmi: asmcomp/linearize.cmi asmcomp/cmm.cmi +asmcomp/emitaux.cmi: asmcomp/debuginfo.cmi +asmcomp/interf.cmi: asmcomp/mach.cmi +asmcomp/linearize.cmi: asmcomp/reg.cmi asmcomp/mach.cmi asmcomp/debuginfo.cmi +asmcomp/liveness.cmi: asmcomp/mach.cmi +asmcomp/mach.cmi: asmcomp/reg.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/arch.cmo +asmcomp/printcmm.cmi: asmcomp/cmm.cmi +asmcomp/printlinear.cmi: asmcomp/linearize.cmi +asmcomp/printmach.cmi: asmcomp/reg.cmi asmcomp/mach.cmi +asmcomp/proc.cmi: asmcomp/reg.cmi asmcomp/mach.cmi +asmcomp/reg.cmi: asmcomp/cmm.cmi +asmcomp/reload.cmi: asmcomp/mach.cmi +asmcomp/reloadgen.cmi: asmcomp/reg.cmi asmcomp/mach.cmi +asmcomp/schedgen.cmi: asmcomp/mach.cmi asmcomp/linearize.cmi +asmcomp/scheduling.cmi: asmcomp/linearize.cmi +asmcomp/selectgen.cmi: utils/tbl.cmi asmcomp/reg.cmi asmcomp/mach.cmi \ + typing/ident.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi asmcomp/arch.cmo +asmcomp/selection.cmi: asmcomp/mach.cmi asmcomp/cmm.cmi +asmcomp/spill.cmi: asmcomp/mach.cmi +asmcomp/split.cmi: asmcomp/mach.cmi +asmcomp/arch.cmo: utils/misc.cmi utils/config.cmi +asmcomp/arch.cmx: utils/misc.cmx utils/config.cmx +asmcomp/asmgen.cmo: bytecomp/translmod.cmi asmcomp/split.cmi \ + asmcomp/spill.cmi asmcomp/selection.cmi asmcomp/scheduling.cmi \ + asmcomp/reload.cmi asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printmach.cmi \ + asmcomp/printlinear.cmi asmcomp/printcmm.cmi typing/primitive.cmi \ + utils/misc.cmi asmcomp/mach.cmi asmcomp/liveness.cmi \ + asmcomp/linearize.cmi asmcomp/interf.cmi asmcomp/emitaux.cmi \ + asmcomp/emit.cmi utils/config.cmi asmcomp/compilenv.cmi \ + asmcomp/comballoc.cmi asmcomp/coloring.cmi asmcomp/cmmgen.cmi \ + asmcomp/cmm.cmi asmcomp/closure.cmi utils/clflags.cmi asmcomp/asmgen.cmi +asmcomp/asmgen.cmx: bytecomp/translmod.cmx asmcomp/split.cmx \ + asmcomp/spill.cmx asmcomp/selection.cmx asmcomp/scheduling.cmx \ + asmcomp/reload.cmx asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/printmach.cmx \ + asmcomp/printlinear.cmx asmcomp/printcmm.cmx typing/primitive.cmx \ + utils/misc.cmx asmcomp/mach.cmx asmcomp/liveness.cmx \ + asmcomp/linearize.cmx asmcomp/interf.cmx asmcomp/emitaux.cmx \ + asmcomp/emit.cmx utils/config.cmx asmcomp/compilenv.cmx \ + asmcomp/comballoc.cmx asmcomp/coloring.cmx asmcomp/cmmgen.cmx \ + asmcomp/cmm.cmx asmcomp/closure.cmx utils/clflags.cmx asmcomp/asmgen.cmi +asmcomp/asmlibrarian.cmo: utils/misc.cmi utils/config.cmi \ + asmcomp/compilenv.cmi utils/clflags.cmi asmcomp/clambda.cmi \ + utils/ccomp.cmi asmcomp/asmlink.cmi asmcomp/asmlibrarian.cmi +asmcomp/asmlibrarian.cmx: utils/misc.cmx utils/config.cmx \ + asmcomp/compilenv.cmx utils/clflags.cmx asmcomp/clambda.cmx \ + utils/ccomp.cmx asmcomp/asmlink.cmx asmcomp/asmlibrarian.cmi +asmcomp/asmlink.cmo: bytecomp/runtimedef.cmi asmcomp/proc.cmi utils/misc.cmi \ + parsing/location.cmi asmcomp/emitaux.cmi asmcomp/emit.cmi \ + utils/consistbl.cmi utils/config.cmi asmcomp/compilenv.cmi \ + asmcomp/cmmgen.cmi utils/clflags.cmi utils/ccomp.cmi asmcomp/asmgen.cmi \ + asmcomp/asmlink.cmi +asmcomp/asmlink.cmx: bytecomp/runtimedef.cmx asmcomp/proc.cmx utils/misc.cmx \ + parsing/location.cmx asmcomp/emitaux.cmx asmcomp/emit.cmx \ + utils/consistbl.cmx utils/config.cmx asmcomp/compilenv.cmx \ + asmcomp/cmmgen.cmx utils/clflags.cmx utils/ccomp.cmx asmcomp/asmgen.cmx \ + asmcomp/asmlink.cmi +asmcomp/asmpackager.cmo: typing/typemod.cmi bytecomp/translmod.cmi \ + utils/misc.cmi parsing/location.cmi bytecomp/lambda.cmi typing/ident.cmi \ + typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi utils/clflags.cmi \ + asmcomp/clambda.cmi utils/ccomp.cmi asmcomp/asmlink.cmi \ + asmcomp/asmgen.cmi asmcomp/asmpackager.cmi +asmcomp/asmpackager.cmx: typing/typemod.cmx bytecomp/translmod.cmx \ + utils/misc.cmx parsing/location.cmx bytecomp/lambda.cmx typing/ident.cmx \ + typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx utils/clflags.cmx \ + asmcomp/clambda.cmx utils/ccomp.cmx asmcomp/asmlink.cmx \ + asmcomp/asmgen.cmx asmcomp/asmpackager.cmi +asmcomp/clambda.cmo: bytecomp/lambda.cmi typing/ident.cmi \ + asmcomp/debuginfo.cmi parsing/asttypes.cmi asmcomp/clambda.cmi +asmcomp/clambda.cmx: bytecomp/lambda.cmx typing/ident.cmx \ + asmcomp/debuginfo.cmx parsing/asttypes.cmi asmcomp/clambda.cmi +asmcomp/closure.cmo: utils/tbl.cmi bytecomp/switch.cmi typing/primitive.cmi \ + utils/misc.cmi bytecomp/lambda.cmi typing/ident.cmi asmcomp/debuginfo.cmi \ + asmcomp/compilenv.cmi utils/clflags.cmi asmcomp/clambda.cmi \ + parsing/asttypes.cmi asmcomp/closure.cmi +asmcomp/closure.cmx: utils/tbl.cmx bytecomp/switch.cmx typing/primitive.cmx \ + utils/misc.cmx bytecomp/lambda.cmx typing/ident.cmx asmcomp/debuginfo.cmx \ + asmcomp/compilenv.cmx utils/clflags.cmx asmcomp/clambda.cmx \ + parsing/asttypes.cmi asmcomp/closure.cmi +asmcomp/cmm.cmo: typing/ident.cmi asmcomp/debuginfo.cmi asmcomp/arch.cmo \ + asmcomp/cmm.cmi +asmcomp/cmm.cmx: typing/ident.cmx asmcomp/debuginfo.cmx asmcomp/arch.cmx \ + asmcomp/cmm.cmi +asmcomp/cmmgen.cmo: typing/types.cmi bytecomp/switch.cmi asmcomp/proc.cmi \ + typing/primitive.cmi utils/misc.cmi bytecomp/lambda.cmi typing/ident.cmi \ + asmcomp/debuginfo.cmi utils/config.cmi asmcomp/compilenv.cmi \ + asmcomp/cmm.cmi utils/clflags.cmi asmcomp/clambda.cmi \ + parsing/asttypes.cmi asmcomp/arch.cmo asmcomp/cmmgen.cmi +asmcomp/cmmgen.cmx: typing/types.cmx bytecomp/switch.cmx asmcomp/proc.cmx \ + typing/primitive.cmx utils/misc.cmx bytecomp/lambda.cmx typing/ident.cmx \ + asmcomp/debuginfo.cmx utils/config.cmx asmcomp/compilenv.cmx \ + asmcomp/cmm.cmx utils/clflags.cmx asmcomp/clambda.cmx \ + parsing/asttypes.cmi asmcomp/arch.cmx asmcomp/cmmgen.cmi +asmcomp/codegen.cmo: asmcomp/split.cmi asmcomp/spill.cmi asmcomp/reload.cmi \ + asmcomp/reg.cmi asmcomp/printmach.cmi asmcomp/printlinear.cmi \ + asmcomp/printcmm.cmi asmcomp/liveness.cmi asmcomp/linearize.cmi \ + asmcomp/interf.cmi asmcomp/emit.cmi asmcomp/coloring.cmi asmcomp/cmm.cmi \ + asmcomp/codegen.cmi +asmcomp/codegen.cmx: asmcomp/split.cmx asmcomp/spill.cmx asmcomp/reload.cmx \ + asmcomp/reg.cmx asmcomp/printmach.cmx asmcomp/printlinear.cmx \ + asmcomp/printcmm.cmx asmcomp/liveness.cmx asmcomp/linearize.cmx \ + asmcomp/interf.cmx asmcomp/emit.cmx asmcomp/coloring.cmx asmcomp/cmm.cmx \ + asmcomp/codegen.cmi +asmcomp/coloring.cmo: asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/coloring.cmi +asmcomp/coloring.cmx: asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/coloring.cmi +asmcomp/comballoc.cmo: asmcomp/reg.cmi asmcomp/mach.cmi utils/config.cmi \ + asmcomp/comballoc.cmi +asmcomp/comballoc.cmx: asmcomp/reg.cmx asmcomp/mach.cmx utils/config.cmx \ + asmcomp/comballoc.cmi +asmcomp/compilenv.cmo: utils/misc.cmi typing/ident.cmi typing/env.cmi \ + utils/config.cmi asmcomp/clambda.cmi asmcomp/compilenv.cmi +asmcomp/compilenv.cmx: utils/misc.cmx typing/ident.cmx typing/env.cmx \ + utils/config.cmx asmcomp/clambda.cmx asmcomp/compilenv.cmi +asmcomp/debuginfo.cmo: parsing/location.cmi bytecomp/lambda.cmi \ + asmcomp/debuginfo.cmi +asmcomp/debuginfo.cmx: parsing/location.cmx bytecomp/lambda.cmx \ + asmcomp/debuginfo.cmi +asmcomp/emit.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi parsing/location.cmi asmcomp/linearize.cmi \ + asmcomp/emitaux.cmi asmcomp/debuginfo.cmi utils/config.cmi \ + asmcomp/compilenv.cmi asmcomp/cmm.cmi utils/clflags.cmi asmcomp/arch.cmo \ + asmcomp/emit.cmi +asmcomp/emit.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx parsing/location.cmx asmcomp/linearize.cmx \ + asmcomp/emitaux.cmx asmcomp/debuginfo.cmx utils/config.cmx \ + asmcomp/compilenv.cmx asmcomp/cmm.cmx utils/clflags.cmx asmcomp/arch.cmx \ + asmcomp/emit.cmi +asmcomp/emitaux.cmo: asmcomp/reg.cmi asmcomp/linearize.cmi \ + asmcomp/debuginfo.cmi asmcomp/cmm.cmi asmcomp/arch.cmo \ + asmcomp/emitaux.cmi +asmcomp/emitaux.cmx: asmcomp/reg.cmx asmcomp/linearize.cmx \ + asmcomp/debuginfo.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \ + asmcomp/emitaux.cmi +asmcomp/interf.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi asmcomp/interf.cmi +asmcomp/interf.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx asmcomp/interf.cmi +asmcomp/linearize.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/linearize.cmi +asmcomp/linearize.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/linearize.cmi +asmcomp/liveness.cmo: asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printmach.cmi \ + utils/misc.cmi asmcomp/mach.cmi asmcomp/liveness.cmi +asmcomp/liveness.cmx: asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/printmach.cmx \ + utils/misc.cmx asmcomp/mach.cmx asmcomp/liveness.cmi +asmcomp/mach.cmo: asmcomp/reg.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/arch.cmo asmcomp/mach.cmi +asmcomp/mach.cmx: asmcomp/reg.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/arch.cmx asmcomp/mach.cmi +asmcomp/printcmm.cmo: typing/ident.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/printcmm.cmi +asmcomp/printcmm.cmx: typing/ident.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/printcmm.cmi +asmcomp/printlinear.cmo: asmcomp/printmach.cmi asmcomp/mach.cmi \ + asmcomp/linearize.cmi asmcomp/debuginfo.cmi asmcomp/printlinear.cmi +asmcomp/printlinear.cmx: asmcomp/printmach.cmx asmcomp/mach.cmx \ + asmcomp/linearize.cmx asmcomp/debuginfo.cmx asmcomp/printlinear.cmi +asmcomp/printmach.cmo: asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printcmm.cmi \ + asmcomp/mach.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi asmcomp/arch.cmo \ + asmcomp/printmach.cmi +asmcomp/printmach.cmx: asmcomp/reg.cmx asmcomp/proc.cmx asmcomp/printcmm.cmx \ + asmcomp/mach.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \ + asmcomp/printmach.cmi +asmcomp/proc.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + utils/config.cmi asmcomp/cmm.cmi utils/clflags.cmi utils/ccomp.cmi \ + asmcomp/arch.cmo asmcomp/proc.cmi +asmcomp/proc.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + utils/config.cmx asmcomp/cmm.cmx utils/clflags.cmx utils/ccomp.cmx \ + asmcomp/arch.cmx asmcomp/proc.cmi +asmcomp/reg.cmo: asmcomp/cmm.cmi asmcomp/reg.cmi +asmcomp/reg.cmx: asmcomp/cmm.cmx asmcomp/reg.cmi +asmcomp/reload.cmo: asmcomp/reloadgen.cmi asmcomp/reg.cmi asmcomp/mach.cmi \ + asmcomp/cmm.cmi asmcomp/arch.cmo asmcomp/reload.cmi +asmcomp/reload.cmx: asmcomp/reloadgen.cmx asmcomp/reg.cmx asmcomp/mach.cmx \ + asmcomp/cmm.cmx asmcomp/arch.cmx asmcomp/reload.cmi +asmcomp/reloadgen.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + asmcomp/reloadgen.cmi +asmcomp/reloadgen.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + asmcomp/reloadgen.cmi +asmcomp/schedgen.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + asmcomp/linearize.cmi asmcomp/cmm.cmi asmcomp/arch.cmo \ + asmcomp/schedgen.cmi +asmcomp/schedgen.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + asmcomp/linearize.cmx asmcomp/cmm.cmx asmcomp/arch.cmx \ + asmcomp/schedgen.cmi +asmcomp/scheduling.cmo: asmcomp/schedgen.cmi asmcomp/scheduling.cmi +asmcomp/scheduling.cmx: asmcomp/schedgen.cmx asmcomp/scheduling.cmi +asmcomp/selectgen.cmo: utils/tbl.cmi asmcomp/reg.cmi asmcomp/proc.cmi \ + utils/misc.cmi asmcomp/mach.cmi typing/ident.cmi asmcomp/debuginfo.cmi \ + asmcomp/cmm.cmi asmcomp/arch.cmo asmcomp/selectgen.cmi +asmcomp/selectgen.cmx: utils/tbl.cmx asmcomp/reg.cmx asmcomp/proc.cmx \ + utils/misc.cmx asmcomp/mach.cmx typing/ident.cmx asmcomp/debuginfo.cmx \ + asmcomp/cmm.cmx asmcomp/arch.cmx asmcomp/selectgen.cmi +asmcomp/selection.cmo: asmcomp/selectgen.cmi asmcomp/reg.cmi asmcomp/proc.cmi \ + utils/misc.cmi asmcomp/mach.cmi asmcomp/debuginfo.cmi asmcomp/cmm.cmi \ + asmcomp/arch.cmo asmcomp/selection.cmi +asmcomp/selection.cmx: asmcomp/selectgen.cmx asmcomp/reg.cmx asmcomp/proc.cmx \ + utils/misc.cmx asmcomp/mach.cmx asmcomp/debuginfo.cmx asmcomp/cmm.cmx \ + asmcomp/arch.cmx asmcomp/selection.cmi +asmcomp/spill.cmo: asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \ + asmcomp/mach.cmi asmcomp/spill.cmi +asmcomp/spill.cmx: asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \ + asmcomp/mach.cmx asmcomp/spill.cmi +asmcomp/split.cmo: asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \ + asmcomp/split.cmi +asmcomp/split.cmx: asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \ + asmcomp/split.cmi +driver/compile.cmi: typing/env.cmi +driver/errors.cmi: +driver/main.cmi: +driver/main_args.cmi: +driver/optcompile.cmi: typing/env.cmi +driver/opterrors.cmi: +driver/optmain.cmi: +driver/pparse.cmi: +driver/compile.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/typemod.cmi typing/typedtree.cmi bytecomp/translmod.cmi \ + typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \ + bytecomp/printlambda.cmi bytecomp/printinstr.cmi parsing/printast.cmi \ + driver/pparse.cmi parsing/parse.cmi utils/misc.cmi parsing/location.cmi \ + typing/ident.cmi typing/env.cmi bytecomp/emitcode.cmi utils/config.cmi \ + utils/clflags.cmi utils/ccomp.cmi bytecomp/bytegen.cmi driver/compile.cmi +driver/compile.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/typemod.cmx typing/typedtree.cmx bytecomp/translmod.cmx \ + typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \ + bytecomp/printlambda.cmx bytecomp/printinstr.cmx parsing/printast.cmx \ + driver/pparse.cmx parsing/parse.cmx utils/misc.cmx parsing/location.cmx \ + typing/ident.cmx typing/env.cmx bytecomp/emitcode.cmx utils/config.cmx \ + utils/clflags.cmx utils/ccomp.cmx bytecomp/bytegen.cmx driver/compile.cmi +driver/errors.cmo: utils/warnings.cmi typing/typetexp.cmi typing/typemod.cmi \ + typing/typedecl.cmi typing/typecore.cmi typing/typeclass.cmi \ + bytecomp/translmod.cmi bytecomp/translcore.cmi bytecomp/translclass.cmi \ + parsing/syntaxerr.cmi bytecomp/symtable.cmi driver/pparse.cmi \ + parsing/location.cmi parsing/lexer.cmi typing/includemod.cmi \ + typing/env.cmi typing/ctype.cmi bytecomp/bytepackager.cmi \ + bytecomp/bytelink.cmi bytecomp/bytelibrarian.cmi driver/errors.cmi +driver/errors.cmx: utils/warnings.cmx typing/typetexp.cmx typing/typemod.cmx \ + typing/typedecl.cmx typing/typecore.cmx typing/typeclass.cmx \ + bytecomp/translmod.cmx bytecomp/translcore.cmx bytecomp/translclass.cmx \ + parsing/syntaxerr.cmx bytecomp/symtable.cmx driver/pparse.cmx \ + parsing/location.cmx parsing/lexer.cmx typing/includemod.cmx \ + typing/env.cmx typing/ctype.cmx bytecomp/bytepackager.cmx \ + bytecomp/bytelink.cmx bytecomp/bytelibrarian.cmx driver/errors.cmi +driver/main.cmo: utils/warnings.cmi utils/misc.cmi driver/main_args.cmi \ + driver/errors.cmi utils/config.cmi driver/compile.cmi utils/clflags.cmi \ + bytecomp/bytepackager.cmi bytecomp/bytelink.cmi \ + bytecomp/bytelibrarian.cmi driver/main.cmi +driver/main.cmx: utils/warnings.cmx utils/misc.cmx driver/main_args.cmx \ + driver/errors.cmx utils/config.cmx driver/compile.cmx utils/clflags.cmx \ + bytecomp/bytepackager.cmx bytecomp/bytelink.cmx \ + bytecomp/bytelibrarian.cmx driver/main.cmi +driver/main_args.cmo: driver/main_args.cmi +driver/main_args.cmx: driver/main_args.cmi +driver/optcompile.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/typemod.cmi typing/typedtree.cmi bytecomp/translmod.cmi \ + typing/stypes.cmi bytecomp/simplif.cmi typing/printtyp.cmi \ + bytecomp/printlambda.cmi parsing/printast.cmi driver/pparse.cmi \ + parsing/parse.cmi utils/misc.cmi parsing/location.cmi typing/ident.cmi \ + typing/env.cmi utils/config.cmi asmcomp/compilenv.cmi utils/clflags.cmi \ + utils/ccomp.cmi asmcomp/asmgen.cmi driver/optcompile.cmi +driver/optcompile.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/typemod.cmx typing/typedtree.cmx bytecomp/translmod.cmx \ + typing/stypes.cmx bytecomp/simplif.cmx typing/printtyp.cmx \ + bytecomp/printlambda.cmx parsing/printast.cmx driver/pparse.cmx \ + parsing/parse.cmx utils/misc.cmx parsing/location.cmx typing/ident.cmx \ + typing/env.cmx utils/config.cmx asmcomp/compilenv.cmx utils/clflags.cmx \ + utils/ccomp.cmx asmcomp/asmgen.cmx driver/optcompile.cmi +driver/opterrors.cmo: utils/warnings.cmi typing/typetexp.cmi \ + typing/typemod.cmi typing/typedecl.cmi typing/typecore.cmi \ + typing/typeclass.cmi bytecomp/translmod.cmi bytecomp/translcore.cmi \ + bytecomp/translclass.cmi parsing/syntaxerr.cmi driver/pparse.cmi \ + parsing/location.cmi parsing/lexer.cmi typing/includemod.cmi \ + typing/env.cmi typing/ctype.cmi asmcomp/compilenv.cmi \ + asmcomp/asmpackager.cmi asmcomp/asmlink.cmi asmcomp/asmlibrarian.cmi \ + asmcomp/asmgen.cmi driver/opterrors.cmi +driver/opterrors.cmx: utils/warnings.cmx typing/typetexp.cmx \ + typing/typemod.cmx typing/typedecl.cmx typing/typecore.cmx \ + typing/typeclass.cmx bytecomp/translmod.cmx bytecomp/translcore.cmx \ + bytecomp/translclass.cmx parsing/syntaxerr.cmx driver/pparse.cmx \ + parsing/location.cmx parsing/lexer.cmx typing/includemod.cmx \ + typing/env.cmx typing/ctype.cmx asmcomp/compilenv.cmx \ + asmcomp/asmpackager.cmx asmcomp/asmlink.cmx asmcomp/asmlibrarian.cmx \ + asmcomp/asmgen.cmx driver/opterrors.cmi +driver/optmain.cmo: utils/warnings.cmi asmcomp/printmach.cmi \ + driver/opterrors.cmi driver/optcompile.cmi utils/misc.cmi \ + utils/config.cmi utils/clflags.cmi asmcomp/asmpackager.cmi \ + asmcomp/asmlink.cmi asmcomp/asmlibrarian.cmi asmcomp/arch.cmo \ + driver/optmain.cmi +driver/optmain.cmx: utils/warnings.cmx asmcomp/printmach.cmx \ + driver/opterrors.cmx driver/optcompile.cmx utils/misc.cmx \ + utils/config.cmx utils/clflags.cmx asmcomp/asmpackager.cmx \ + asmcomp/asmlink.cmx asmcomp/asmlibrarian.cmx asmcomp/arch.cmx \ + driver/optmain.cmi +driver/pparse.cmo: utils/misc.cmi parsing/location.cmi utils/clflags.cmi \ + utils/ccomp.cmi driver/pparse.cmi +driver/pparse.cmx: utils/misc.cmx parsing/location.cmx utils/clflags.cmx \ + utils/ccomp.cmx driver/pparse.cmi +toplevel/genprintval.cmi: typing/types.cmi typing/path.cmi \ + typing/outcometree.cmi typing/env.cmi +toplevel/opttopdirs.cmi: parsing/longident.cmi +toplevel/opttoploop.cmi: utils/warnings.cmi typing/types.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/outcometree.cmi parsing/longident.cmi \ + parsing/location.cmi typing/env.cmi +toplevel/opttopmain.cmi: +toplevel/topdirs.cmi: parsing/longident.cmi +toplevel/toploop.cmi: utils/warnings.cmi typing/types.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/outcometree.cmi parsing/longident.cmi \ + parsing/location.cmi typing/env.cmi +toplevel/topmain.cmi: +toplevel/trace.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \ + typing/env.cmi +toplevel/expunge.cmo: bytecomp/symtable.cmi bytecomp/runtimedef.cmi \ + utils/misc.cmi typing/ident.cmi bytecomp/bytesections.cmi +toplevel/expunge.cmx: bytecomp/symtable.cmx bytecomp/runtimedef.cmx \ + utils/misc.cmx typing/ident.cmx bytecomp/bytesections.cmx +toplevel/genprintval.cmo: typing/types.cmi typing/printtyp.cmi \ + typing/predef.cmi typing/path.cmi typing/outcometree.cmi utils/misc.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi typing/datarepr.cmi \ + typing/ctype.cmi typing/btype.cmi toplevel/genprintval.cmi +toplevel/genprintval.cmx: typing/types.cmx typing/printtyp.cmx \ + typing/predef.cmx typing/path.cmx typing/outcometree.cmi utils/misc.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx typing/datarepr.cmx \ + typing/ctype.cmx typing/btype.cmx toplevel/genprintval.cmi +toplevel/opttopdirs.cmo: utils/warnings.cmi typing/types.cmi \ + typing/printtyp.cmi typing/path.cmi toplevel/opttoploop.cmi \ + utils/misc.cmi parsing/longident.cmi typing/ident.cmi typing/env.cmi \ + typing/ctype.cmi utils/config.cmi utils/clflags.cmi asmcomp/asmlink.cmi \ + toplevel/opttopdirs.cmi +toplevel/opttopdirs.cmx: utils/warnings.cmx typing/types.cmx \ + typing/printtyp.cmx typing/path.cmx toplevel/opttoploop.cmx \ + utils/misc.cmx parsing/longident.cmx typing/ident.cmx typing/env.cmx \ + typing/ctype.cmx utils/config.cmx utils/clflags.cmx asmcomp/asmlink.cmx \ + toplevel/opttopdirs.cmi +toplevel/opttoploop.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/types.cmi typing/typemod.cmi typing/typedtree.cmi \ + typing/typecore.cmi bytecomp/translmod.cmi bytecomp/simplif.cmi \ + typing/printtyp.cmi bytecomp/printlambda.cmi parsing/printast.cmi \ + typing/predef.cmi typing/path.cmi parsing/parsetree.cmi parsing/parse.cmi \ + typing/outcometree.cmi driver/opterrors.cmi driver/optcompile.cmi \ + typing/oprint.cmi utils/misc.cmi parsing/longident.cmi \ + parsing/location.cmi parsing/lexer.cmi bytecomp/lambda.cmi \ + typing/ident.cmi toplevel/genprintval.cmi typing/env.cmi utils/config.cmi \ + asmcomp/compilenv.cmi utils/clflags.cmi typing/btype.cmi \ + asmcomp/asmlink.cmi asmcomp/asmgen.cmi toplevel/opttoploop.cmi +toplevel/opttoploop.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/types.cmx typing/typemod.cmx typing/typedtree.cmx \ + typing/typecore.cmx bytecomp/translmod.cmx bytecomp/simplif.cmx \ + typing/printtyp.cmx bytecomp/printlambda.cmx parsing/printast.cmx \ + typing/predef.cmx typing/path.cmx parsing/parsetree.cmi parsing/parse.cmx \ + typing/outcometree.cmi driver/opterrors.cmx driver/optcompile.cmx \ + typing/oprint.cmx utils/misc.cmx parsing/longident.cmx \ + parsing/location.cmx parsing/lexer.cmx bytecomp/lambda.cmx \ + typing/ident.cmx toplevel/genprintval.cmx typing/env.cmx utils/config.cmx \ + asmcomp/compilenv.cmx utils/clflags.cmx typing/btype.cmx \ + asmcomp/asmlink.cmx asmcomp/asmgen.cmx toplevel/opttoploop.cmi +toplevel/opttopmain.cmo: utils/warnings.cmi asmcomp/printmach.cmi \ + toplevel/opttoploop.cmi toplevel/opttopdirs.cmi driver/opterrors.cmi \ + utils/misc.cmi utils/config.cmi utils/clflags.cmi asmcomp/arch.cmo \ + toplevel/opttopmain.cmi +toplevel/opttopmain.cmx: utils/warnings.cmx asmcomp/printmach.cmx \ + toplevel/opttoploop.cmx toplevel/opttopdirs.cmx driver/opterrors.cmx \ + utils/misc.cmx utils/config.cmx utils/clflags.cmx asmcomp/arch.cmx \ + toplevel/opttopmain.cmi +toplevel/opttopstart.cmo: toplevel/opttopmain.cmi +toplevel/opttopstart.cmx: toplevel/opttopmain.cmx +toplevel/topdirs.cmo: utils/warnings.cmi typing/types.cmi toplevel/trace.cmi \ + toplevel/toploop.cmi bytecomp/symtable.cmi typing/printtyp.cmi \ + typing/path.cmi bytecomp/opcodes.cmo utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi bytecomp/dll.cmi \ + typing/ctype.cmi utils/consistbl.cmi utils/config.cmi \ + bytecomp/cmo_format.cmi utils/clflags.cmi toplevel/topdirs.cmi +toplevel/topdirs.cmx: utils/warnings.cmx typing/types.cmx toplevel/trace.cmx \ + toplevel/toploop.cmx bytecomp/symtable.cmx typing/printtyp.cmx \ + typing/path.cmx bytecomp/opcodes.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx bytecomp/dll.cmx \ + typing/ctype.cmx utils/consistbl.cmx utils/config.cmx \ + bytecomp/cmo_format.cmi utils/clflags.cmx toplevel/topdirs.cmi +toplevel/toploop.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/types.cmi typing/typemod.cmi typing/typedtree.cmi \ + typing/typecore.cmi bytecomp/translmod.cmi bytecomp/symtable.cmi \ + bytecomp/simplif.cmi bytecomp/printlambda.cmi \ + bytecomp/printinstr.cmi parsing/printast.cmi typing/primitive.cmi typing/predef.cmi \ + typing/path.cmi parsing/parsetree.cmi parsing/parse.cmi \ + typing/outcometree.cmi typing/oprint.cmi utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi parsing/location.cmi parsing/lexer.cmi \ + typing/ident.cmi toplevel/genprintval.cmi toplevel/genprinttyp.cmo driver/errors.cmi \ + typing/env.cmi bytecomp/emitcode.cmi bytecomp/dll.cmi utils/consistbl.cmi \ + utils/config.cmi driver/compile.cmi utils/clflags.cmi \ + bytecomp/bytegen.cmi typing/btype.cmi toplevel/toploop.cmi +toplevel/toploop.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/types.cmx typing/typemod.cmx typing/typedtree.cmx \ + typing/typecore.cmx bytecomp/translmod.cmx bytecomp/symtable.cmx \ + bytecomp/simplif.cmx bytecomp/printlambda.cmx \ + bytecomp/printinstr.cmx parsing/printast.cmx typing/primitive.cmx typing/predef.cmx \ + typing/path.cmx parsing/parsetree.cmi parsing/parse.cmx \ + typing/outcometree.cmi typing/oprint.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx parsing/location.cmx parsing/lexer.cmx \ + typing/ident.cmx toplevel/genprintval.cmx toplevel/genprinttyp.cmx driver/errors.cmx \ + typing/env.cmx bytecomp/emitcode.cmx bytecomp/dll.cmx utils/consistbl.cmx \ + utils/config.cmx driver/compile.cmx utils/clflags.cmx \ + bytecomp/bytegen.cmx typing/btype.cmx toplevel/toploop.cmi +toplevel/topmain.cmo: utils/warnings.cmi toplevel/toploop.cmi \ + toplevel/topdirs.cmi utils/misc.cmi driver/errors.cmi utils/config.cmi \ + utils/clflags.cmi toplevel/topmain.cmi +toplevel/topmain.cmx: utils/warnings.cmx toplevel/toploop.cmx \ + toplevel/topdirs.cmx utils/misc.cmx driver/errors.cmx utils/config.cmx \ + utils/clflags.cmx toplevel/topmain.cmi +toplevel/topstart.cmo: toplevel/topmain.cmi +toplevel/topstart.cmx: toplevel/topmain.cmx +toplevel/trace.cmo: typing/types.cmi toplevel/toploop.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi typing/ctype.cmi toplevel/trace.cmi +toplevel/trace.cmx: typing/types.cmx toplevel/toploop.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx typing/ctype.cmx toplevel/trace.cmi diff -Naur ocaml-3.11.0/Makefile ocaml-3.11.0-enhtop+/Makefile --- ocaml-3.11.0/Makefile 2008-10-23 11:29:11.000000000 -0400 +++ ocaml-3.11.0-enhtop+/Makefile 2009-03-24 10:55:08.045441594 -0400 @@ -90,8 +90,8 @@ driver/optmain.cmo TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \ - toplevel/genprintval.cmo toplevel/toploop.cmo \ - toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo + toplevel/genprintval.cmo toplevel/genprinttyp.cmo toplevel/toploop.cmo\ + toplevel/trace.cmo toplevel/topdirext.cmo toplevel/topdirs.cmo toplevel/topmain.cmo TOPLEVELLIB=toplevel/toplevellib.cma TOPLEVELSTART=toplevel/topstart.cmo diff -Naur ocaml-3.11.0/Makefile.nt ocaml-3.11.0-enhtop+/Makefile.nt --- ocaml-3.11.0/Makefile.nt 2008-11-10 11:13:20.000000000 -0500 +++ ocaml-3.11.0-enhtop+/Makefile.nt 2009-03-24 10:55:08.045441594 -0400 @@ -87,8 +87,8 @@ driver/optmain.cmo TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \ - toplevel/genprintval.cmo toplevel/toploop.cmo \ - toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo + toplevel/genprintval.cmo toplevel/genprinttyp.cmo toplevel/toploop.cmo \ + toplevel/trace.cmo toplevel/topdirext.cmo toplevel/topdirs.cmo toplevel/topmain.cmo TOPLEVELLIB=toplevel/toplevellib.cma TOPLEVELSTART=toplevel/topstart.cmo diff -Naur ocaml-3.11.0/Makefile.nt.orig ocaml-3.11.0-enhtop+/Makefile.nt.orig --- ocaml-3.11.0/Makefile.nt.orig 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/Makefile.nt.orig 2009-03-24 10:55:08.045441594 -0400 @@ -0,0 +1,656 @@ +######################################################################### +# # +# Objective Caml # +# # +# Xavier Leroy, projet Cristal, INRIA Rocquencourt # +# # +# Copyright 1999 Institut National de Recherche en Informatique et # +# en Automatique. All rights reserved. This file is distributed # +# under the terms of the Q Public License version 1.0. # +# # +######################################################################### + +# $Id: Makefile.nt,v 1.113.2.1 2008/11/10 16:13:20 ertai Exp $ + +# The main Makefile + +include config/Makefile +include stdlib/StdlibModules + +CAMLC=boot/ocamlrun boot/ocamlc -I boot +CAMLOPT=boot/ocamlrun ./ocamlopt -I stdlib -I otherlibs/dynlink +COMPFLAGS=$(INCLUDES) +LINKFLAGS= +CAMLYACC=boot/ocamlyacc +YACCFLAGS= +CAMLLEX=boot/ocamlrun boot/ocamllex +CAMLDEP=boot/ocamlrun tools/ocamldep +DEPFLAGS=$(INCLUDES) +CAMLRUN=byterun/ocamlrun + +INCLUDES=-I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver \ + -I toplevel + +UTILS=utils/misc.cmo utils/tbl.cmo utils/config.cmo \ + utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo \ + utils/consistbl.cmo + +OPTUTILS=$(UTILS) + +PARSING=parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \ + parsing/syntaxerr.cmo parsing/parser.cmo \ + parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo + +TYPING=typing/unused_var.cmo typing/ident.cmo typing/path.cmo \ + typing/primitive.cmo typing/types.cmo \ + typing/btype.cmo typing/oprint.cmo \ + typing/subst.cmo typing/predef.cmo \ + typing/datarepr.cmo typing/env.cmo \ + typing/typedtree.cmo typing/ctype.cmo \ + typing/printtyp.cmo typing/includeclass.cmo \ + typing/mtype.cmo typing/includecore.cmo \ + typing/includemod.cmo typing/parmatch.cmo \ + typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo \ + typing/typedecl.cmo typing/typeclass.cmo \ + typing/typemod.cmo + +COMP=bytecomp/lambda.cmo bytecomp/printlambda.cmo \ + bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo \ + bytecomp/translobj.cmo bytecomp/translcore.cmo \ + bytecomp/translclass.cmo bytecomp/translmod.cmo \ + bytecomp/simplif.cmo bytecomp/runtimedef.cmo + +BYTECOMP=bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo \ + bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \ + bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo \ + bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo + +ASMCOMP=asmcomp/arch.cmo asmcomp/debuginfo.cmo \ + asmcomp/cmm.cmo asmcomp/printcmm.cmo \ + asmcomp/reg.cmo asmcomp/mach.cmo asmcomp/proc.cmo \ + asmcomp/clambda.cmo asmcomp/compilenv.cmo \ + asmcomp/closure.cmo asmcomp/cmmgen.cmo \ + asmcomp/printmach.cmo asmcomp/selectgen.cmo asmcomp/selection.cmo \ + asmcomp/comballoc.cmo asmcomp/liveness.cmo \ + asmcomp/spill.cmo asmcomp/split.cmo \ + asmcomp/interf.cmo asmcomp/coloring.cmo \ + asmcomp/reloadgen.cmo asmcomp/reload.cmo \ + asmcomp/printlinear.cmo asmcomp/linearize.cmo \ + asmcomp/schedgen.cmo asmcomp/scheduling.cmo \ + asmcomp/emitaux.cmo asmcomp/emit.cmo asmcomp/asmgen.cmo \ + asmcomp/asmlink.cmo asmcomp/asmlibrarian.cmo asmcomp/asmpackager.cmo + +DRIVER=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \ + driver/main_args.cmo driver/main.cmo + +OPTDRIVER=driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \ + driver/optmain.cmo + +TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \ + toplevel/genprintval.cmo toplevel/toploop.cmo \ + toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo + +TOPLEVELLIB=toplevel/toplevellib.cma +TOPLEVELSTART=toplevel/topstart.cmo + +COMPOBJS=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(DRIVER) + +TOPLIB=$(UTILS) $(PARSING) $(TYPING) $(COMP) $(BYTECOMP) $(TOPLEVEL) + +TOPOBJS=$(TOPLEVELLIB) $(TOPLEVELSTART) + +NATTOPOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) \ + driver/pparse.cmo driver/opterrors.cmo driver/optcompile.cmo \ + toplevel/genprintval.cmo toplevel/opttoploop.cmo toplevel/opttopdirs.cmo \ + toplevel/opttopmain.cmo toplevel/opttopstart.cmo + +OPTOBJS=$(OPTUTILS) $(PARSING) $(TYPING) $(COMP) $(ASMCOMP) $(OPTDRIVER) + +EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \ + utils/config.cmo utils/clflags.cmo \ + typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \ + typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \ + bytecomp/dll.cmo \ + bytecomp/symtable.cmo toplevel/expunge.cmo + +PERVASIVES=$(STDLIB_MODULES) topdirs toploop outcometree + +# For users who don't read the INSTALL file +defaultentry: + @echo "Please refer to the installation instructions in file README.win32." + +# Recompile the system using the bootstrap compiler +all: runtime ocamlc ocamllex ocamlyacc ocamltools library ocaml otherlibraries ocamldoc.byte ocamlbuild.byte camlp4out $(DEBUGGER) win32gui + +# The compilation of ocaml will fail if the runtime has changed. +# Never mind, just do make bootstrap to reach fixpoint again. + +# Compile everything the first time +world: coldstart all + +# Complete bootstrapping cycle +bootstrap: +# Save the original bootstrap compiler + $(MAKEREC) backup +# Promote the new compiler but keep the old runtime +# This compiler runs on boot/ocamlrun and produces bytecode for byterun/ocamlrun + $(MAKEREC) promote-cross +# Rebuild ocamlc and ocamllex (run on byterun/ocamlrun) + $(MAKEREC) partialclean + $(MAKEREC) ocamlc ocamllex ocamltools +# Rebuild the library (using byterun/ocamlrun ./ocamlc) + $(MAKEREC) library-cross +# Promote the new compiler and the new runtime + $(MAKEREC) promote +# Rebuild everything, including ocaml and the tools + $(MAKEREC) partialclean + $(MAKEREC) all +# Check if fixpoint reached + $(MAKEREC) compare + +LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader + +# Start up the system from the distribution compiler +coldstart: + cd byterun ; $(MAKEREC) all + cp byterun/ocamlrun.exe boot/ocamlrun.exe + cd yacc ; $(MAKEREC) all + cp yacc/ocamlyacc.exe boot/ocamlyacc.exe + cd stdlib ; $(MAKEREC) COMPILER=../boot/ocamlc all + cd stdlib ; cp $(LIBFILES) ../boot + +# Build the core system: the minimum needed to make depend and bootstrap +core : runtime ocamlc ocamllex ocamlyacc ocamltools library + +# Save the current bootstrap compiler +MAXSAVED=boot/Saved/Saved.prev/Saved.prev/Saved.prev/Saved.prev/Saved.prev +backup: + mkdir -p boot/Saved + if test -d $(MAXSAVED); then rm -r $(MAXSAVED); fi + mv boot/Saved boot/Saved.prev + mkdir boot/Saved + mv boot/Saved.prev boot/Saved/Saved.prev + cp boot/ocamlrun.exe boot/Saved/ocamlrun.exe + cd boot ; mv ocamlc ocamllex ocamldep ocamlyacc.exe Saved + cd boot ; cp $(LIBFILES) Saved + +# Promote the newly compiled system to the rank of cross compiler +# (Runs on the old runtime, produces code for the new runtime) +promote-cross: + cp ocamlc boot/ocamlc + cp lex/ocamllex boot/ocamllex + cp yacc/ocamlyacc.exe boot/ocamlyacc.exe + cp tools/ocamldep boot/ocamldep + cd stdlib ; cp $(LIBFILES) ../boot + +# Promote the newly compiled system to the rank of bootstrap compiler +# (Runs on the new runtime, produces code for the new runtime) +promote: promote-cross + cp byterun/ocamlrun.exe boot/ocamlrun.exe + +# Restore the saved bootstrap compiler if a problem arises +restore: + cd boot/Saved ; mv * .. + rmdir boot/Saved + mv boot/Saved.prev boot/Saved + +# Check if fixpoint reached +compare: + - cmp -i 4096 boot/ocamlc ocamlc + - cmp -i 4096 boot/ocamllex lex/ocamllex + - cmp -i 4096 boot/ocamldep tools/ocamldep + +# Remove old bootstrap compilers +cleanboot: + rm -rf boot/Saved/Saved.prev/* + +# Compile the native-code compiler +opt: runtimeopt ocamlopt libraryopt otherlibrariesopt ocamlbuildlib.native + +# Native-code versions of the tools +opt.opt: ocamlc.opt ocamlopt.opt ocamllex.opt ocamltoolsopt.opt \ + ocamlbuild.native camlp4opt ocamldoc.opt + +# Installation +install: installbyt installopt + +installbyt: + mkdir -p $(BINDIR) + mkdir -p $(LIBDIR) + cd byterun ; $(MAKEREC) install + cp ocamlc $(BINDIR)/ocamlc.exe + cp ocaml $(BINDIR)/ocaml.exe + cd stdlib ; $(MAKEREC) install + cp lex/ocamllex $(BINDIR)/ocamllex.exe + cp yacc/ocamlyacc.exe $(BINDIR)/ocamlyacc.exe + cp toplevel/toplevellib.cma $(LIBDIR)/toplevellib.cma + cp expunge $(LIBDIR)/expunge.exe + cp typing/outcometree.cmi typing/outcometree.mli $(LIBDIR) + cp toplevel/topstart.cmo $(LIBDIR) + cp toplevel/toploop.cmi toplevel/topdirs.cmi toplevel/topmain.cmi $(LIBDIR) + cd tools ; $(MAKEREC) install + cd ocamldoc ; $(MAKEREC) install + mkdir -p $(STUBLIBDIR) + for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i install; done + if test -f debugger/ocamldebug.exe; then (cd debugger; $(MAKEREC) install); \ + else :; fi + cd win32caml ; $(MAKE) install + ./build/partial-install.sh + cp config/Makefile $(LIBDIR)/Makefile.config + cp README $(DISTRIB)/Readme.general.txt + cp README.win32 $(DISTRIB)/Readme.windows.txt + cp LICENSE $(DISTRIB)/License.txt + cp Changes $(DISTRIB)/Changes.txt + +# Installation of the native-code compiler +installopt: + cd asmrun ; $(MAKEREC) install + cp ocamlopt $(BINDIR)/ocamlopt.exe + cd stdlib ; $(MAKEREC) installopt + cd ocamldoc ; $(MAKEREC) installopt + for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i installopt; done + if test -f ocamlc.opt; \ + then cp ocamlc.opt $(BINDIR)/ocamlc.opt.exe; else :; fi + if test -f ocamlopt.opt; \ + then cp ocamlopt.opt $(BINDIR)/ocamlopt.opt.exe; else :; fi + if test -f lex/ocamllex.opt; \ + then cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt.exe; else :; fi + +clean:: partialclean + +# The compiler + +ocamlc: $(COMPOBJS) + $(CAMLC) $(LINKFLAGS) -o ocamlc $(COMPOBJS) + @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlc|' \ + driver/ocamlcomp.sh.in > ocamlcomp.sh + @chmod +x ocamlcomp.sh + +partialclean:: + rm -f ocamlc + +# The native-code compiler + +ocamlopt: $(OPTOBJS) + $(CAMLC) $(LINKFLAGS) -o ocamlopt $(OPTOBJS) + @sed -e 's|@compiler@|$$topdir/boot/ocamlrun $$topdir/ocamlopt|' \ + driver/ocamlcomp.sh.in > ocamlcompopt.sh + @chmod +x ocamlcompopt.sh + +partialclean:: + rm -f ocamlopt + +# The toplevel + +ocaml: $(TOPOBJS) expunge + $(CAMLC) $(LINKFLAGS) -linkall -o ocaml.tmp $(TOPOBJS) + - $(CAMLRUN) ./expunge ocaml.tmp ocaml $(PERVASIVES) + rm -f ocaml.tmp + +toplevel/toplevellib.cma: $(TOPLIB) + $(CAMLC) -a -o $@ $(TOPLIB) + +partialclean:: + rm -f ocaml + +# The native toplevel + +ocamlnat: ocamlopt otherlibs/dynlink/dynlink.cmxa $(NATTOPOBJS:.cmo=.cmx) + $(CAMLOPT) $(LINKFLAGS) otherlibs/dynlink/dynlink.cmxa -o ocamlnat $(NATTOPOBJS:.cmo=.cmx) -linkall + +toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa + +otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml + cd otherlibs/dynlink && make allopt + + +# The configuration file + +utils/config.ml: utils/config.mlp config/Makefile + @rm -f utils/config.ml + sed -e "s|%%LIBDIR%%|$(LIBDIR)|" \ + -e "s|%%BYTERUN%%|ocamlrun|" \ + -e 's|%%CCOMPTYPE%%|$(CCOMPTYPE)|' \ + -e "s|%%BYTECC%%|$(BYTECC) $(BYTECCCOMPOPTS)|" \ + -e "s|%%NATIVECC%%|$(NATIVECC) $(NATIVECCCOMPOPTS)|" \ + -e "s|%%PARTIALLD%%|$(PARTIALLD)|" \ + -e "s|%%PACKLD%%|$(PACKLD)|" \ + -e "s|%%BYTECCLIBS%%|$(BYTECCLIBS)|" \ + -e "s|%%NATIVECCLIBS%%|$(NATIVECCLIBS)|" \ + -e 's|%%RANLIBCMD%%|$(RANLIBCMD)|' \ + -e 's|%%BINUTILS_NM%%|$(BINUTILS_NM)|' \ + -e 's|%%BINUTILS_OBJCOPY%%|$(BINUTILS_OBJCOPY)|' \ + -e "s|%%ARCH%%|$(ARCH)|" \ + -e "s|%%MODEL%%|$(MODEL)|" \ + -e "s|%%SYSTEM%%|$(SYSTEM)|" \ + -e "s|%%EXT_OBJ%%|.$(O)|" \ + -e "s|%%EXT_ASM%%|.$(S)|" \ + -e "s|%%EXT_LIB%%|.$(A)|" \ + -e "s|%%EXT_DLL%%|.dll|" \ + -e "s|%%SYSTHREAD_SUPPORT%%|true|" \ + -e 's|%%ASM%%|$(ASM)|' \ + -e 's|%%MKDLL%%|$(MKDLL)|' \ + -e 's|%%MKEXE%%|$(MKEXE)|' \ + -e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \ + -e 's|%%CC_PROFILE%%||' \ + utils/config.mlp > utils/config.ml + @chmod -w utils/config.ml + +partialclean:: + rm -f utils/config.ml + +beforedepend:: utils/config.ml + +# The parser + +parsing/parser.mli parsing/parser.ml: parsing/parser.mly + $(CAMLYACC) $(YACCFLAGS) parsing/parser.mly + +partialclean:: + rm -f parsing/parser.mli parsing/parser.ml parsing/parser.output + +beforedepend:: parsing/parser.mli parsing/parser.ml + +# The lexer + +parsing/lexer.ml: parsing/lexer.mll + $(CAMLLEX) parsing/lexer.mll + +partialclean:: + rm -f parsing/lexer.ml + +beforedepend:: parsing/lexer.ml + +# The auxiliary lexer for counting line numbers + +parsing/linenum.ml: parsing/linenum.mll + $(CAMLLEX) parsing/linenum.mll + +partialclean:: + rm -f parsing/linenum.ml + +beforedepend:: parsing/linenum.ml + +# The bytecode compiler compiled with the native-code compiler + +ocamlc.opt: $(COMPOBJS:.cmo=.cmx) + cd asmrun ; $(MAKEREC) meta.$(O) dynlink.$(O) + $(CAMLOPT) $(LINKFLAGS) -o ocamlc.opt $(COMPOBJS:.cmo=.cmx) asmrun/meta.$(O) asmrun/dynlink.$(O) + +partialclean:: + rm -f ocamlc.opt + +# The native-code compiler compiled with itself + +ocamlopt.opt: $(OPTOBJS:.cmo=.cmx) + $(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt $(OPTOBJS:.cmo=.cmx) + +partialclean:: + rm -f ocamlopt.opt + +$(OPTOBJS:.cmo=.cmx): ocamlopt + +# The numeric opcodes + +bytecomp/opcodes.ml: byterun/instruct.h + sed -n -e "/^enum/p" -e "s|,||g" -e "/^ /p" byterun/instruct.h | \ + gawk -f tools/make-opcodes > bytecomp/opcodes.ml + +partialclean:: + rm -f bytecomp/opcodes.ml + +beforedepend:: bytecomp/opcodes.ml + +# The predefined exceptions and primitives + +byterun/primitives: + cd byterun ; $(MAKEREC) primitives + +bytecomp/runtimedef.ml: byterun/primitives byterun/fail.h + (echo 'let builtin_exceptions = [|'; \ + sed -n -e 's|.*/\* \("[A-Za-z_]*"\) \*/$$| \1;|p' byterun/fail.h | \ + sed -e '$$s/;$$//'; \ + echo '|]'; \ + echo 'let builtin_primitives = [|'; \ + sed -e 's/.*/ "&";/' -e '$$s/;$$//' byterun/primitives; \ + echo '|]') > bytecomp/runtimedef.ml + +partialclean:: + rm -f bytecomp/runtimedef.ml + +beforedepend:: bytecomp/runtimedef.ml + +# Choose the right machine-dependent files + +asmcomp/arch.ml: asmcomp/$(ARCH)/arch.ml + cp asmcomp/$(ARCH)/arch.ml asmcomp/arch.ml + +partialclean:: + rm -f asmcomp/arch.ml + +beforedepend:: asmcomp/arch.ml + +ifeq ($(TOOLCHAIN),msvc) +ASMCOMP_PROC=asmcomp/$(ARCH)/proc_nt.ml +ASMCOMP_EMIT=asmcomp/$(ARCH)/emit_nt.mlp +else +ASMCOMP_PROC=asmcomp/$(ARCH)/proc.ml +ASMCOMP_EMIT=asmcomp/$(ARCH)/emit.mlp +endif + +asmcomp/proc.ml: $(ASMCOMP_PROC) + cp $(ASMCOMP_PROC) asmcomp/proc.ml + +partialclean:: + rm -f asmcomp/proc.ml + +beforedepend:: asmcomp/proc.ml + +asmcomp/selection.ml: asmcomp/$(ARCH)/selection.ml + cp asmcomp/$(ARCH)/selection.ml asmcomp/selection.ml + +partialclean:: + rm -f asmcomp/selection.ml + +beforedepend:: asmcomp/selection.ml + +asmcomp/reload.ml: asmcomp/$(ARCH)/reload.ml + cp asmcomp/$(ARCH)/reload.ml asmcomp/reload.ml + +partialclean:: + rm -f asmcomp/reload.ml + +beforedepend:: asmcomp/reload.ml + +asmcomp/scheduling.ml: asmcomp/$(ARCH)/scheduling.ml + cp asmcomp/$(ARCH)/scheduling.ml asmcomp/scheduling.ml + +partialclean:: + rm -f asmcomp/scheduling.ml + +beforedepend:: asmcomp/scheduling.ml + +# Preprocess the code emitters + +asmcomp/emit.ml: $(ASMCOMP_EMIT) tools/cvt_emit + boot/ocamlrun tools/cvt_emit < $(ASMCOMP_EMIT) > asmcomp/emit.ml + +partialclean:: + rm -f asmcomp/emit.ml + +beforedepend:: asmcomp/emit.ml + +tools/cvt_emit: tools/cvt_emit.mll + cd tools ; $(MAKEREC) cvt_emit + +# The "expunge" utility + +expunge: $(EXPUNGEOBJS) + $(CAMLC) $(LINKFLAGS) -o expunge $(EXPUNGEOBJS) + +partialclean:: + rm -f expunge + +# The runtime system for the bytecode compiler + +runtime: makeruntime stdlib/libcamlrun.$(A) + +makeruntime: + cd byterun ; $(MAKEREC) all +stdlib/libcamlrun.$(A): byterun/libcamlrun.$(A) + cp byterun/libcamlrun.$(A) stdlib/libcamlrun.$(A) +clean:: + cd byterun ; $(MAKEREC) clean + rm -f stdlib/libcamlrun.$(A) +alldepend:: + cd byterun ; $(MAKEREC) depend + +# The runtime system for the native-code compiler + +runtimeopt: makeruntimeopt stdlib/libasmrun.$(A) + +makeruntimeopt: + cd asmrun ; $(MAKEREC) all +stdlib/libasmrun.$(A): asmrun/libasmrun.$(A) + cp asmrun/libasmrun.$(A) stdlib/libasmrun.$(A) +clean:: + cd asmrun ; $(MAKEREC) clean + rm -f stdlib/libasmrun.$(A) +alldepend:: + cd asmrun ; $(MAKEREC) depend + +# The library + +library: + cd stdlib ; $(MAKEREC) all +library-cross: + cd stdlib ; $(MAKEREC) RUNTIME=../byterun/ocamlrun all +libraryopt: + cd stdlib ; $(MAKEREC) allopt +partialclean:: + cd stdlib ; $(MAKEREC) clean +alldepend:: + cd stdlib ; $(MAKEREC) depend + +# The lexer and parser generators + +ocamllex: + cd lex ; $(MAKEREC) all +ocamllex.opt: + cd lex ; $(MAKEREC) allopt +partialclean:: + cd lex ; $(MAKEREC) clean +alldepend:: + cd lex ; $(MAKEREC) depend + +ocamlyacc: + cd yacc ; $(MAKEREC) all +clean:: + cd yacc ; $(MAKEREC) clean + +# Tools + +ocamltools: + cd tools ; $(MAKEREC) all +ocamltoolsopt.opt: + cd tools ; $(MAKEREC) opt.opt +partialclean:: + cd tools ; $(MAKEREC) clean +alldepend:: + cd tools ; $(MAKEREC) depend + +# OCamldoc + +ocamldoc.byte: + cd ocamldoc ; $(MAKEREC) all +ocamldoc.opt: + cd ocamldoc ; $(MAKEREC) opt.opt +partialclean:: + cd ocamldoc ; $(MAKEREC) clean +alldepend:: + cd ocamldoc ; $(MAKEREC) depend + +# The extra libraries + +otherlibraries: + for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i all; done +otherlibrariesopt: + for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i allopt; done +partialclean:: + for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i partialclean; done +clean:: + for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i clean; done +alldepend:: + for i in $(OTHERLIBRARIES); do $(MAKEREC) -C otherlibs/$$i depend; done + +# The replay debugger + +ocamldebugger: ocamlc ocamlyacc ocamllex + cd debugger; $(MAKEREC) all +partialclean:: + cd debugger; $(MAKEREC) clean +alldepend:: + cd debugger; $(MAKEREC) depend + +# Camlp4 + +camlp4out: ocamlc otherlibraries ocamlbuild-mixed-boot ocamlbuild.byte + ./build/camlp4-byte-only.sh +camlp4opt: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot ocamlbuild.native + ./build/camlp4-native-only.sh + +# Ocamlbuild + +ocamlbuild.byte: ocamlc otherlibraries ocamlbuild-mixed-boot + ./build/ocamlbuild-byte-only.sh +ocamlbuild.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot + ./build/ocamlbuild-native-only.sh +ocamlbuildlib.native: ocamlopt otherlibrariesopt ocamlbuild-mixed-boot + ./build/ocamlbuildlib-native-only.sh + + +.PHONY: ocamlbuild-mixed-boot +ocamlbuild-mixed-boot: + ./build/mixed-boot.sh +partialclean:: + rm -rf _build + +# The Win32 toplevel GUI + +win32gui: + cd win32caml ; $(MAKE) all + +clean:: + cd win32caml ; $(MAKE) clean + +# Default rules + +.SUFFIXES: .ml .mli .cmo .cmi .cmx + +.ml.cmo: + $(CAMLC) $(COMPFLAGS) -c $< + +.mli.cmi: + $(CAMLC) $(COMPFLAGS) -c $< + +.ml.cmx: + $(CAMLOPT) $(COMPFLAGS) -c $< + +partialclean:: + rm -f utils/*.cm* utils/*.$(O) utils/*.$(S) + rm -f parsing/*.cm* parsing/*.$(O) parsing/*.$(S) + rm -f typing/*.cm* typing/*.$(O) typing/*.$(S) + rm -f bytecomp/*.cm* bytecomp/*.$(O) bytecomp/*.$(S) + rm -f asmcomp/*.cm* asmcomp/*.$(O) asmcomp/*.$(S) + rm -f driver/*.cm* driver/*.$(O) driver/*.$(S) + rm -f toplevel/*.cm* toplevel/*.$(O) toplevel/*.$(S) + rm -f tools/*.cm* tools/*.$(O) tools/*.$(S) + +depend: beforedepend + (for d in utils parsing typing bytecomp asmcomp driver toplevel; \ + do $(CAMLDEP) $(DEPFLAGS) $$d/*.mli $$d/*.ml; \ + done) > .depend + +alldepend:: depend + +include .depend diff -Naur ocaml-3.11.0/ocaml-3.10.2-01-enhtop.diff ocaml-3.11.0-enhtop+/ocaml-3.10.2-01-enhtop.diff --- ocaml-3.11.0/ocaml-3.10.2-01-enhtop.diff 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/ocaml-3.10.2-01-enhtop.diff 2009-03-24 10:55:08.055441270 -0400 @@ -0,0 +1,1858 @@ +diff -ruN ocaml-3.10.2/.depend ocaml-3.10.2-enhtop/.depend +--- ocaml-3.10.2/.depend 2007-03-02 17:47:05.000000000 -0500 ++++ ocaml-3.10.2-enhtop/.depend 2008-09-06 20:28:40.812715332 -0400 +@@ -745,13 +745,23 @@ + toplevel/topdirs.cmi: parsing/longident.cmi + toplevel/toploop.cmi: utils/warnings.cmi typing/types.cmi typing/path.cmi \ + parsing/parsetree.cmi typing/outcometree.cmi parsing/longident.cmi \ +- parsing/location.cmi typing/env.cmi ++ parsing/location.cmi typing/ident.cmi typing/env.cmi + toplevel/trace.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \ + typing/env.cmi + toplevel/expunge.cmo: bytecomp/symtable.cmi bytecomp/runtimedef.cmi \ + utils/misc.cmi typing/ident.cmi bytecomp/bytesections.cmi + toplevel/expunge.cmx: bytecomp/symtable.cmx bytecomp/runtimedef.cmx \ + utils/misc.cmx typing/ident.cmx bytecomp/bytesections.cmx ++toplevel/genprinttyp.cmo: typing/types.cmi typing/primitive.cmi \ ++ typing/predef.cmi typing/path.cmi typing/outcometree.cmi \ ++ typing/oprint.cmi utils/misc.cmi parsing/longident.cmi typing/ident.cmi \ ++ typing/env.cmi typing/ctype.cmi utils/clflags.cmi typing/btype.cmi \ ++ parsing/asttypes.cmi ++toplevel/genprinttyp.cmx: typing/types.cmx typing/primitive.cmx \ ++ typing/predef.cmx typing/path.cmx typing/outcometree.cmi \ ++ typing/oprint.cmx utils/misc.cmx parsing/longident.cmx typing/ident.cmx \ ++ typing/env.cmx typing/ctype.cmx utils/clflags.cmx typing/btype.cmx \ ++ parsing/asttypes.cmi + toplevel/genprintval.cmo: typing/types.cmi typing/printtyp.cmi \ + typing/predef.cmi typing/path.cmi typing/outcometree.cmi utils/misc.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi typing/datarepr.cmi \ +@@ -760,14 +770,22 @@ + typing/predef.cmx typing/path.cmx typing/outcometree.cmi utils/misc.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx typing/datarepr.cmx \ + typing/ctype.cmx typing/btype.cmx toplevel/genprintval.cmi ++toplevel/topdirext.cmo: typing/types.cmi toplevel/trace.cmi toplevel/toploop.cmi \ ++ bytecomp/symtable.cmi typing/path.cmi typing/outcometree.cmi utils/misc.cmi \ ++ parsing/longident.cmi typing/ident.cmi typing/env.cmi utils/config.cmi \ ++ toplevel/topdirext.cmi ++toplevel/topdirext.cmx: typing/types.cmx toplevel/trace.cmx toplevel/toploop.cmx \ ++ bytecomp/symtable.cmx typing/path.cmx typing/outcometree.cmi utils/misc.cmx \ ++ parsing/longident.cmx typing/ident.cmx typing/env.cmx utils/config.cmx \ ++ toplevel/topdirext.cmi + toplevel/topdirs.cmo: utils/warnings.cmi typing/types.cmi toplevel/trace.cmi \ +- toplevel/toploop.cmi bytecomp/symtable.cmi typing/printtyp.cmi \ ++ toplevel/toploop.cmi toplevel/topdirext.cmi bytecomp/symtable.cmi \ + typing/path.cmi bytecomp/opcodes.cmo utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi typing/ident.cmi typing/env.cmi bytecomp/dll.cmi \ + typing/ctype.cmi utils/consistbl.cmi utils/config.cmi \ + bytecomp/cmo_format.cmi utils/clflags.cmi toplevel/topdirs.cmi + toplevel/topdirs.cmx: utils/warnings.cmx typing/types.cmx toplevel/trace.cmx \ +- toplevel/toploop.cmx bytecomp/symtable.cmx typing/printtyp.cmx \ ++ toplevel/toploop.cmx toplevel/topdirext.cmx bytecomp/symtable.cmx \ + typing/path.cmx bytecomp/opcodes.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx typing/ident.cmx typing/env.cmx bytecomp/dll.cmx \ + typing/ctype.cmx utils/consistbl.cmx utils/config.cmx \ +@@ -775,24 +793,24 @@ + toplevel/toploop.cmo: utils/warnings.cmi typing/unused_var.cmi \ + typing/types.cmi typing/typemod.cmi typing/typedtree.cmi \ + typing/typecore.cmi bytecomp/translmod.cmi bytecomp/symtable.cmi \ +- bytecomp/simplif.cmi typing/printtyp.cmi bytecomp/printlambda.cmi \ +- bytecomp/printinstr.cmi parsing/printast.cmi typing/predef.cmi \ ++ bytecomp/simplif.cmi bytecomp/printlambda.cmi \ ++ bytecomp/printinstr.cmi parsing/printast.cmi typing/primitive.cmi typing/predef.cmi \ + typing/path.cmi parsing/parsetree.cmi parsing/parse.cmi \ + typing/outcometree.cmi typing/oprint.cmi utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi parsing/location.cmi parsing/lexer.cmi \ +- typing/ident.cmi toplevel/genprintval.cmi driver/errors.cmi \ ++ typing/ident.cmi toplevel/genprintval.cmi toplevel/genprinttyp.cmo driver/errors.cmi \ + typing/env.cmi bytecomp/emitcode.cmi bytecomp/dll.cmi utils/consistbl.cmi \ + utils/config.cmi driver/compile.cmi utils/clflags.cmi \ + bytecomp/bytegen.cmi typing/btype.cmi toplevel/toploop.cmi + toplevel/toploop.cmx: utils/warnings.cmx typing/unused_var.cmx \ + typing/types.cmx typing/typemod.cmx typing/typedtree.cmx \ + typing/typecore.cmx bytecomp/translmod.cmx bytecomp/symtable.cmx \ +- bytecomp/simplif.cmx typing/printtyp.cmx bytecomp/printlambda.cmx \ +- bytecomp/printinstr.cmx parsing/printast.cmx typing/predef.cmx \ ++ bytecomp/simplif.cmx bytecomp/printlambda.cmx \ ++ bytecomp/printinstr.cmx parsing/printast.cmx typing/primitive.cmx typing/predef.cmx \ + typing/path.cmx parsing/parsetree.cmi parsing/parse.cmx \ + typing/outcometree.cmi typing/oprint.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx parsing/location.cmx parsing/lexer.cmx \ +- typing/ident.cmx toplevel/genprintval.cmx driver/errors.cmx \ ++ typing/ident.cmx toplevel/genprintval.cmx toplevel/genprinttyp.cmx driver/errors.cmx \ + typing/env.cmx bytecomp/emitcode.cmx bytecomp/dll.cmx utils/consistbl.cmx \ + utils/config.cmx driver/compile.cmx utils/clflags.cmx \ + bytecomp/bytegen.cmx typing/btype.cmx toplevel/toploop.cmi +@@ -804,9 +822,9 @@ + utils/clflags.cmx toplevel/topmain.cmi + toplevel/topstart.cmo: toplevel/topmain.cmi + toplevel/topstart.cmx: toplevel/topmain.cmx +-toplevel/trace.cmo: typing/types.cmi toplevel/toploop.cmi typing/printtyp.cmi \ ++toplevel/trace.cmo: typing/types.cmi toplevel/toploop.cmi \ + typing/predef.cmi typing/path.cmi utils/misc.cmi bytecomp/meta.cmi \ + parsing/longident.cmi typing/ctype.cmi toplevel/trace.cmi +-toplevel/trace.cmx: typing/types.cmx toplevel/toploop.cmx typing/printtyp.cmx \ ++toplevel/trace.cmx: typing/types.cmx toplevel/toploop.cmx \ + typing/predef.cmx typing/path.cmx utils/misc.cmx bytecomp/meta.cmx \ + parsing/longident.cmx typing/ctype.cmx toplevel/trace.cmi +diff -ruN ocaml-3.10.2/Makefile ocaml-3.10.2-enhtop/Makefile +--- ocaml-3.10.2/Makefile 2007-06-20 09:26:29.000000000 -0400 ++++ ocaml-3.10.2-enhtop/Makefile 2008-09-06 20:28:40.812715332 -0400 +@@ -90,8 +90,8 @@ + driver/optmain.cmo + + TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \ +- toplevel/genprintval.cmo toplevel/toploop.cmo \ +- toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo ++ toplevel/genprintval.cmo toplevel/genprinttyp.cmo toplevel/toploop.cmo\ ++ toplevel/trace.cmo toplevel/topdirext.cmo toplevel/topdirs.cmo toplevel/topmain.cmo + + TOPLEVELLIB=toplevel/toplevellib.cma + TOPLEVELSTART=toplevel/topstart.cmo +diff -ruN ocaml-3.10.2/Makefile.nt ocaml-3.10.2-enhtop/Makefile.nt +--- ocaml-3.10.2/Makefile.nt 2007-06-20 09:26:29.000000000 -0400 ++++ ocaml-3.10.2-enhtop/Makefile.nt 2008-09-06 20:28:40.812715332 -0400 +@@ -86,8 +86,8 @@ + driver/optmain.cmo + + TOPLEVEL=driver/pparse.cmo driver/errors.cmo driver/compile.cmo \ +- toplevel/genprintval.cmo toplevel/toploop.cmo \ +- toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo ++ toplevel/genprintval.cmo toplevel/genprinttyp.cmo toplevel/toploop.cmo \ ++ toplevel/trace.cmo toplevel/topdirext.cmo toplevel/topdirs.cmo toplevel/topmain.cmo + + TOPLEVELLIB=toplevel/toplevellib.cma + TOPLEVELSTART=toplevel/topstart.cmo +diff -ruN ocaml-3.10.2/toplevel/genprinttyp.ml ocaml-3.10.2-enhtop/toplevel/genprinttyp.ml +--- ocaml-3.10.2/toplevel/genprinttyp.ml 1969-12-31 19:00:00.000000000 -0500 ++++ ocaml-3.10.2-enhtop/toplevel/genprinttyp.ml 2008-09-06 20:28:55.942765263 -0400 +@@ -0,0 +1,1053 @@ ++(***********************************************************************) ++(* *) ++(* Objective Caml *) ++(* *) ++(* Xavier Leroy and Jerome Vouillon, projet Cristal, INRIA Rocquencourt*) ++(* *) ++(* Copyright 1996 Institut National de Recherche en Informatique et *) ++(* en Automatique. All rights reserved. This file is distributed *) ++(* under the terms of the Q Public License version 1.0. *) ++(* *) ++(***********************************************************************) ++ ++(* $Id: printtyp.ml,v 1.143 2007/02/16 11:18:54 garrigue Exp $ *) ++ ++ ++module type ENV = sig val env: Env.t ref end ++ ++module Make = functor (Environ : ENV) -> ++struct ++ ++(* Printing functions *) ++ ++open Misc ++open Ctype ++open Format ++open Longident ++open Path ++open Asttypes ++open Types ++open Btype ++open Outcometree ++ ++let topenv = Environ.env ++ ++let is_rebound id = ++ let test_reb find_fun lookup_fun = fun id -> ++ try ++ ignore (find_fun (Path.Pident id) !topenv); ++ let p, _ = lookup_fun (Longident.Lident (Ident.name id)) !topenv in ++ not (Ident.same id (Path.head p)) ++ with Not_found -> false in ++ List.exists ++ (fun test_fun -> test_fun id) ++ [(test_reb Env.find_value Env.lookup_value); ++ (test_reb Env.find_type Env.lookup_type); ++ (test_reb Env.find_module Env.lookup_module); ++ (test_reb Env.find_modtype Env.lookup_modtype); ++ (test_reb Env.find_class Env.lookup_class); ++ (test_reb Env.find_cltype Env.lookup_cltype)] ++ ++let ident_name id = ++ let name = Ident.name id in ++ if is_rebound id then ++ match Ident.binding_time id with ++ | 0 -> sprintf "%s!" name ++ | -1 -> sprintf "%s#" name ++ | n -> sprintf "%s/%i%s" name n (if Ident.global id then "g" else "") ++ else name ++ ++(* Print a long identifier *) ++ ++let rec longident ppf = function ++ | Lident s -> fprintf ppf "%s" s ++ | Ldot(p, s) -> fprintf ppf "%a.%s" longident p s ++ | Lapply(p1, p2) -> fprintf ppf "%a(%a)" longident p1 longident p2 ++ ++(* Print an identifier *) ++ ++let ident ppf id = fprintf ppf "%s" (ident_name id) ++ ++(* Print a path *) ++ ++let ident_pervasive = Ident.create_persistent "Pervasives" ++ ++let rec tree_of_path = function ++ | Pident id -> ++ Oide_ident (ident_name id) ++ | Pdot(Pident id, s, pos) when Ident.same id ident_pervasive -> ++ Oide_ident s ++ | Pdot(p, s, pos) -> ++ Oide_dot (tree_of_path p, s) ++ | Papply(p1, p2) -> ++ Oide_apply (tree_of_path p1, tree_of_path p2) ++ ++let rec path ppf = function ++ | Pident id -> ++ ident ppf id ++ | Pdot(Pident id, s, pos) when Ident.same id ident_pervasive -> ++ fprintf ppf "%s" s ++ | Pdot(p, s, pos) -> ++ fprintf ppf "%a.%s" path p s ++ | Papply(p1, p2) -> ++ fprintf ppf "%a(%a)" path p1 path p2 ++ ++let rec path_name = function ++ | Pident id -> ident_name id ++ | Pdot (Pident id, s, pos) when Ident.same id ident_pervasive -> s ++ | Pdot (p, s, pos) -> (path_name p)^"."^s ++ | Papply(p1, p2) -> (path_name p1)^"("^(path_name p2)^")" ++ ++ ++(* Print a recursive annotation *) ++ ++let tree_of_rec = function ++ | Trec_not -> Orec_not ++ | Trec_first -> Orec_first ++ | Trec_next -> Orec_next ++ ++(* Print a raw type expression, with sharing *) ++ ++let raw_list pr ppf = function ++ [] -> fprintf ppf "[]" ++ | a :: l -> ++ fprintf ppf "@[<1>[%a%t]@]" pr a ++ (fun ppf -> List.iter (fun x -> fprintf ppf ";@,%a" pr x) l) ++ ++let rec safe_kind_repr v = function ++ Fvar {contents=Some k} -> ++ if List.memq k v then "Fvar loop" else ++ safe_kind_repr (k::v) k ++ | Fvar _ -> "Fvar None" ++ | Fpresent -> "Fpresent" ++ | Fabsent -> "Fabsent" ++ ++let rec safe_commu_repr v = function ++ Cok -> "Cok" ++ | Cunknown -> "Cunknown" ++ | Clink r -> ++ if List.memq r v then "Clink loop" else ++ safe_commu_repr (r::v) !r ++ ++let rec safe_repr v = function ++ {desc = Tlink t} when not (List.memq t v) -> ++ safe_repr (t::v) t ++ | t -> t ++ ++let rec list_of_memo = function ++ Mnil -> [] ++ | Mcons (p, t1, t2, rem) -> p :: list_of_memo rem ++ | Mlink rem -> list_of_memo !rem ++ ++let visited = ref [] ++let rec raw_type ppf ty = ++ let ty = safe_repr [] ty in ++ if List.memq ty !visited then fprintf ppf "{id=%d}" ty.id else begin ++ visited := ty :: !visited; ++ fprintf ppf "@[<1>{id=%d;level=%d;desc=@,%a}@]" ty.id ty.level ++ raw_type_desc ty.desc ++ end ++and raw_type_list tl = raw_list raw_type tl ++and raw_type_desc ppf = function ++ Tvar -> fprintf ppf "Tvar" ++ | Tarrow(l,t1,t2,c) -> ++ fprintf ppf "@[Tarrow(%s,@,%a,@,%a,@,%s)@]" ++ l raw_type t1 raw_type t2 ++ (safe_commu_repr [] c) ++ | Ttuple tl -> ++ fprintf ppf "@[<1>Ttuple@,%a@]" raw_type_list tl ++ | Tconstr (p, tl, abbrev) -> ++ fprintf ppf "@[Tconstr(@,%a,@,%a,@,%a)@]" path p ++ raw_type_list tl ++ (raw_list path) (list_of_memo !abbrev) ++ | Tobject (t, nm) -> ++ fprintf ppf "@[Tobject(@,%a,@,@[<1>ref%t@])@]" raw_type t ++ (fun ppf -> ++ match !nm with None -> fprintf ppf " None" ++ | Some(p,tl) -> ++ fprintf ppf "(Some(@,%a,@,%a))" path p raw_type_list tl) ++ | Tfield (f, k, t1, t2) -> ++ fprintf ppf "@[Tfield(@,%s,@,%s,@,%a,@;<0 -1>%a)@]" f ++ (safe_kind_repr [] k) ++ raw_type t1 raw_type t2 ++ | Tnil -> fprintf ppf "Tnil" ++ | Tlink t -> fprintf ppf "@[<1>Tlink@,%a@]" raw_type t ++ | Tsubst t -> fprintf ppf "@[<1>Tsubst@,%a@]" raw_type t ++ | Tunivar -> fprintf ppf "Tunivar" ++ | Tpoly (t, tl) -> ++ fprintf ppf "@[Tpoly(@,%a,@,%a)@]" ++ raw_type t ++ raw_type_list tl ++ | Tvariant row -> ++ fprintf ppf ++ "@[{@[%s@,%a;@]@ @[%s@,%a;@]@ %s%b;@ %s%b;@ @[<1>%s%t@]}@]" ++ "row_fields=" ++ (raw_list (fun ppf (l, f) -> ++ fprintf ppf "@[%s,@ %a@]" l raw_field f)) ++ row.row_fields ++ "row_more=" raw_type row.row_more ++ "row_closed=" row.row_closed ++ "row_fixed=" row.row_fixed ++ "row_name=" ++ (fun ppf -> ++ match row.row_name with None -> fprintf ppf "None" ++ | Some(p,tl) -> ++ fprintf ppf "Some(@,%a,@,%a)" path p raw_type_list tl) ++ ++and raw_field ppf = function ++ Rpresent None -> fprintf ppf "Rpresent None" ++ | Rpresent (Some t) -> fprintf ppf "@[<1>Rpresent(Some@,%a)@]" raw_type t ++ | Reither (c,tl,m,e) -> ++ fprintf ppf "@[Reither(%b,@,%a,@,%b,@,@[<1>ref%t@])@]" c ++ raw_type_list tl m ++ (fun ppf -> ++ match !e with None -> fprintf ppf " None" ++ | Some f -> fprintf ppf "@,@[<1>(%a)@]" raw_field f) ++ | Rabsent -> fprintf ppf "Rabsent" ++ ++let raw_type_expr ppf t = ++ visited := []; ++ raw_type ppf t; ++ visited := [] ++ ++(* Print a type expression *) ++ ++let names = ref ([] : (type_expr * string) list) ++let name_counter = ref 0 ++ ++let reset_names () = names := []; name_counter := 0 ++ ++let new_name () = ++ let name = ++ if !name_counter < 26 ++ then String.make 1 (Char.chr(97 + !name_counter)) ++ else String.make 1 (Char.chr(97 + !name_counter mod 26)) ^ ++ string_of_int(!name_counter / 26) in ++ incr name_counter; ++ name ++ ++let name_of_type t = ++ try List.assq t !names with Not_found -> ++ let name = new_name () in ++ names := (t, name) :: !names; ++ name ++ ++let check_name_of_type t = ignore(name_of_type t) ++ ++let non_gen_mark sch ty = ++ if sch && ty.desc = Tvar && ty.level <> generic_level then "_" else "" ++ ++let print_name_of_type sch ppf t = ++ fprintf ppf "'%s%s" (non_gen_mark sch t) (name_of_type t) ++ ++let visited_objects = ref ([] : type_expr list) ++let aliased = ref ([] : type_expr list) ++let delayed = ref ([] : type_expr list) ++ ++let add_delayed t = ++ if not (List.memq t !delayed) then delayed := t :: !delayed ++ ++let is_aliased ty = List.memq (proxy ty) !aliased ++let add_alias ty = ++ let px = proxy ty in ++ if not (is_aliased px) then aliased := px :: !aliased ++let aliasable ty = ++ match ty.desc with Tvar | Tunivar | Tpoly _ -> false | _ -> true ++ ++let namable_row row = ++ row.row_name <> None && ++ List.for_all ++ (fun (_, f) -> ++ match row_field_repr f with ++ | Reither(c, l, _, _) -> ++ row.row_closed && if c then l = [] else List.length l = 1 ++ | _ -> true) ++ row.row_fields ++ ++let rec mark_loops_rec visited ty = ++ let ty = repr ty in ++ let px = proxy ty in ++ if List.memq px visited && aliasable ty then add_alias px else ++ let visited = px :: visited in ++ match ty.desc with ++ | Tvar -> () ++ | Tarrow(_, ty1, ty2, _) -> ++ mark_loops_rec visited ty1; mark_loops_rec visited ty2 ++ | Ttuple tyl -> List.iter (mark_loops_rec visited) tyl ++ | Tconstr(_, tyl, _) -> ++ List.iter (mark_loops_rec visited) tyl ++ | Tvariant row -> ++ if List.memq px !visited_objects then add_alias px else ++ begin ++ let row = row_repr row in ++ if not (static_row row) then ++ visited_objects := px :: !visited_objects; ++ match row.row_name with ++ | Some(p, tyl) when namable_row row -> ++ List.iter (mark_loops_rec visited) tyl ++ | _ -> ++ iter_row (mark_loops_rec visited) {row with row_bound = ()} ++ end ++ | Tobject (fi, nm) -> ++ if List.memq px !visited_objects then add_alias px else ++ begin ++ if opened_object ty then ++ visited_objects := px :: !visited_objects; ++ begin match !nm with ++ | None -> ++ let fields, _ = flatten_fields fi in ++ List.iter ++ (fun (_, kind, ty) -> ++ if field_kind_repr kind = Fpresent then ++ mark_loops_rec visited ty) ++ fields ++ | Some (_, l) -> ++ List.iter (mark_loops_rec visited) (List.tl l) ++ end ++ end ++ | Tfield(_, kind, ty1, ty2) when field_kind_repr kind = Fpresent -> ++ mark_loops_rec visited ty1; mark_loops_rec visited ty2 ++ | Tfield(_, _, _, ty2) -> ++ mark_loops_rec visited ty2 ++ | Tnil -> () ++ | Tsubst ty -> mark_loops_rec visited ty ++ | Tlink _ -> fatal_error "Printtyp.mark_loops_rec (2)" ++ | Tpoly (ty, tyl) -> ++ List.iter (fun t -> add_alias t) tyl; ++ mark_loops_rec visited ty ++ | Tunivar -> () ++ ++let mark_loops ty = ++ normalize_type Env.empty ty; ++ mark_loops_rec [] ty;; ++ ++let reset_loop_marks () = ++ visited_objects := []; aliased := []; delayed := [] ++ ++let reset () = ++ reset_names (); reset_loop_marks () ++ ++let reset_and_mark_loops ty = ++ reset (); mark_loops ty ++ ++let reset_and_mark_loops_list tyl = ++ reset (); List.iter mark_loops tyl ++ ++(* Disabled in classic mode when printing an unification error *) ++let print_labels = ref true ++let print_label ppf l = ++ if !print_labels && l <> "" || is_optional l then fprintf ppf "%s:" l ++ ++let rec tree_of_typexp sch ty = ++ let ty = repr ty in ++ let px = proxy ty in ++ if List.mem_assq px !names && not (List.memq px !delayed) then ++ let mark = is_non_gen sch ty in ++ Otyp_var (mark, name_of_type px) else ++ ++ let pr_typ () = ++ match ty.desc with ++ | Tvar -> ++ Otyp_var (is_non_gen sch ty, name_of_type ty) ++ | Tarrow(l, ty1, ty2, _) -> ++ let pr_arrow l ty1 ty2 = ++ let lab = ++ if !print_labels && l <> "" || is_optional l then l else "" ++ in ++ let t1 = ++ if is_optional l then ++ match (repr ty1).desc with ++ | Tconstr(path, [ty], _) ++ when Path.same path Predef.path_option -> ++ tree_of_typexp sch ty ++ | _ -> Otyp_stuff "" ++ else tree_of_typexp sch ty1 in ++ Otyp_arrow (lab, t1, tree_of_typexp sch ty2) in ++ pr_arrow l ty1 ty2 ++ | Ttuple tyl -> ++ Otyp_tuple (tree_of_typlist sch tyl) ++ | Tconstr(p, tyl, abbrev) -> ++ Otyp_constr (tree_of_path p, tree_of_typlist sch tyl) ++ | Tvariant row -> ++ let row = row_repr row in ++ let fields = ++ if row.row_closed then ++ List.filter (fun (_, f) -> row_field_repr f <> Rabsent) ++ row.row_fields ++ else row.row_fields in ++ let present = ++ List.filter ++ (fun (_, f) -> ++ match row_field_repr f with ++ | Rpresent _ -> true ++ | _ -> false) ++ fields in ++ let all_present = List.length present = List.length fields in ++ begin match row.row_name with ++ | Some(p, tyl) when namable_row row -> ++ let id = tree_of_path p in ++ let args = tree_of_typlist sch tyl in ++ if row.row_closed && all_present then ++ Otyp_constr (id, args) ++ else ++ let non_gen = is_non_gen sch px in ++ let tags = ++ if all_present then None else Some (List.map fst present) in ++ Otyp_variant (non_gen, Ovar_name(tree_of_path p, args), ++ row.row_closed, tags) ++ | _ -> ++ let non_gen = ++ not (row.row_closed && all_present) && is_non_gen sch px in ++ let fields = List.map (tree_of_row_field sch) fields in ++ let tags = ++ if all_present then None else Some (List.map fst present) in ++ Otyp_variant (non_gen, Ovar_fields fields, row.row_closed, tags) ++ end ++ | Tobject (fi, nm) -> ++ tree_of_typobject sch fi nm ++ | Tsubst ty -> ++ tree_of_typexp sch ty ++ | Tlink _ | Tnil | Tfield _ -> ++ fatal_error "Printtyp.tree_of_typexp" ++ | Tpoly (ty, []) -> ++ tree_of_typexp sch ty ++ | Tpoly (ty, tyl) -> ++ let tyl = List.map repr tyl in ++ (* let tyl = List.filter is_aliased tyl in *) ++ if tyl = [] then tree_of_typexp sch ty else begin ++ let old_delayed = !delayed in ++ List.iter add_delayed tyl; ++ let tl = List.map name_of_type tyl in ++ let tr = Otyp_poly (tl, tree_of_typexp sch ty) in ++ delayed := old_delayed; tr ++ end ++ | Tunivar -> ++ Otyp_var (false, name_of_type ty) ++ in ++ if List.memq px !delayed then delayed := List.filter ((!=) px) !delayed; ++ if is_aliased px && aliasable ty then begin ++ check_name_of_type px; ++ Otyp_alias (pr_typ (), name_of_type px) end ++ else pr_typ () ++ ++and tree_of_row_field sch (l, f) = ++ match row_field_repr f with ++ | Rpresent None | Reither(true, [], _, _) -> (l, false, []) ++ | Rpresent(Some ty) -> (l, false, [tree_of_typexp sch ty]) ++ | Reither(c, tyl, _, _) -> ++ if c (* contradiction: un constructeur constant qui a un argument *) ++ then (l, true, tree_of_typlist sch tyl) ++ else (l, false, tree_of_typlist sch tyl) ++ | Rabsent -> (l, false, [] (* une erreur, en fait *)) ++ ++and tree_of_typlist sch tyl = ++ List.map (tree_of_typexp sch) tyl ++ ++and tree_of_typobject sch fi nm = ++ begin match !nm with ++ | None -> ++ let pr_fields fi = ++ let (fields, rest) = flatten_fields fi in ++ let present_fields = ++ List.fold_right ++ (fun (n, k, t) l -> ++ match field_kind_repr k with ++ | Fpresent -> (n, t) :: l ++ | _ -> l) ++ fields [] in ++ let sorted_fields = ++ Sort.list (fun (n, _) (n', _) -> n <= n') present_fields in ++ tree_of_typfields sch rest sorted_fields in ++ let (fields, rest) = pr_fields fi in ++ Otyp_object (fields, rest) ++ | Some (p, ty :: tyl) -> ++ let non_gen = is_non_gen sch (repr ty) in ++ let args = tree_of_typlist sch tyl in ++ Otyp_class (non_gen, tree_of_path p, args) ++ | _ -> ++ fatal_error "Printtyp.tree_of_typobject" ++ end ++ ++and is_non_gen sch ty = ++ sch && ty.desc = Tvar && ty.level <> generic_level ++ ++and tree_of_typfields sch rest = function ++ | [] -> ++ let rest = ++ match rest.desc with ++ | Tvar | Tunivar -> Some (is_non_gen sch rest) ++ | Tconstr _ -> Some false ++ | Tnil -> None ++ | _ -> fatal_error "typfields (1)" ++ in ++ ([], rest) ++ | (s, t) :: l -> ++ let field = (s, tree_of_typexp sch t) in ++ let (fields, rest) = tree_of_typfields sch rest l in ++ (field :: fields, rest) ++ ++let typexp sch prio ppf ty = ++ !Oprint.out_type ppf (tree_of_typexp sch ty) ++ ++let type_expr ppf ty = typexp false 0 ppf ty ++ ++and type_sch ppf ty = typexp true 0 ppf ty ++ ++and type_scheme ppf ty = reset_and_mark_loops ty; typexp true 0 ppf ty ++ ++(* Maxence *) ++let type_scheme_max ?(b_reset_names=true) ppf ty = ++ if b_reset_names then reset_names () ; ++ typexp true 0 ppf ty ++(* Fin Maxence *) ++ ++let tree_of_type_scheme ty = reset_and_mark_loops ty; tree_of_typexp true ty ++ ++(* Print one type declaration *) ++ ++let tree_of_constraints params = ++ List.fold_right ++ (fun ty list -> ++ let ty' = unalias ty in ++ if proxy ty != proxy ty' then ++ let tr = tree_of_typexp true ty in ++ (tr, tree_of_typexp true ty') :: list ++ else list) ++ params [] ++ ++let filter_params tyl = ++ let params = ++ List.fold_left ++ (fun tyl ty -> ++ let ty = repr ty in ++ if List.memq ty tyl then Btype.newgenty (Tsubst ty) :: tyl ++ else ty :: tyl) ++ [] tyl ++ in List.rev params ++ ++let string_of_mutable = function ++ | Immutable -> "" ++ | Mutable -> "mutable " ++ ++let rec tree_of_type_decl id decl = ++ ++ reset(); ++ ++ let params = filter_params decl.type_params in ++ ++ List.iter add_alias params; ++ List.iter mark_loops params; ++ List.iter check_name_of_type (List.map proxy params); ++ let ty_manifest = ++ match decl.type_manifest with ++ | None -> None ++ | Some ty -> ++ let ty = ++ (* Special hack to hide variant name *) ++ match repr ty with {desc=Tvariant row} -> ++ let row = row_repr row in ++ begin match row.row_name with ++ Some (Pident id', _) when Ident.same id id' -> ++ newgenty (Tvariant {row with row_name = None}) ++ | _ -> ty ++ end ++ | _ -> ty ++ in ++ mark_loops ty; ++ Some ty ++ in ++ begin match decl.type_kind with ++ | Type_abstract -> () ++ | Type_variant ([], _) -> () ++ | Type_variant (cstrs, priv) -> ++ List.iter (fun (_, args) -> List.iter mark_loops args) cstrs ++ | Type_record(l, rep, priv) -> ++ List.iter (fun (_, _, ty) -> mark_loops ty) l ++ end; ++ ++ let type_param = ++ function ++ | Otyp_var (_, id) -> id ++ | _ -> "?" ++ in ++ let type_defined decl = ++ let abstr = ++ match decl.type_kind with ++ Type_abstract -> ++ begin match decl.type_manifest with ++ None -> true ++ | Some ty -> has_constr_row ty ++ end ++ | Type_variant(_,p) | Type_record(_,_,p) -> ++ p = Private ++ in ++ let vari = ++ List.map2 ++ (fun ty (co,cn,ct) -> ++ if abstr || (repr ty).desc <> Tvar then (co,cn) else (true,true)) ++ decl.type_params decl.type_variance ++ in ++ (ident_name id, ++ List.map2 (fun ty cocn -> type_param (tree_of_typexp false ty), cocn) ++ params vari) ++ in ++ let tree_of_manifest ty1 = ++ match ty_manifest with ++ | None -> ty1 ++ | Some ty -> Otyp_manifest (tree_of_typexp false ty, ty1) ++ in ++ let (name, args) = type_defined decl in ++ let constraints = tree_of_constraints params in ++ let ty, priv = ++ match decl.type_kind with ++ | Type_abstract -> ++ begin match ty_manifest with ++ | None -> (Otyp_abstract, Public) ++ | Some ty -> ++ tree_of_typexp false ty, ++ (if has_constr_row ty then Private else Public) ++ end ++ | Type_variant(cstrs, priv) -> ++ tree_of_manifest (Otyp_sum (List.map tree_of_constructor cstrs)), priv ++ | Type_record(lbls, rep, priv) -> ++ tree_of_manifest (Otyp_record (List.map tree_of_label lbls)), priv ++ in ++ (name, args, ty, priv, constraints) ++ ++and tree_of_constructor (name, args) = ++ (name, tree_of_typlist false args) ++ ++and tree_of_label (name, mut, arg) = ++ (name, mut = Mutable, tree_of_typexp false arg) ++ ++let tree_of_type_declaration id decl rs = ++ Osig_type (tree_of_type_decl id decl, tree_of_rec rs) ++ ++let type_declaration id ppf decl = ++ !Oprint.out_sig_item ppf (tree_of_type_declaration id decl Trec_first) ++ ++(* Print an exception declaration *) ++ ++let tree_of_exception_declaration id decl = ++ reset_and_mark_loops_list decl; ++ let tyl = tree_of_typlist false decl in ++ Osig_exception (ident_name id, tyl) ++ ++let exception_declaration id ppf decl = ++ !Oprint.out_sig_item ppf (tree_of_exception_declaration id decl) ++ ++(* Print a value declaration *) ++ ++let tree_of_value_description id decl = ++ let id = ident_name id in ++ let ty = tree_of_type_scheme decl.val_type in ++ let prims = ++ match decl.val_kind with ++ | Val_prim p -> Primitive.description_list p ++ | _ -> [] ++ in ++ Osig_value (id, ty, prims) ++ ++let value_description id ppf decl = ++ !Oprint.out_sig_item ppf (tree_of_value_description id decl) ++ ++(* Print a class type *) ++ ++let class_var sch ppf l (m, t) = ++ fprintf ppf ++ "@ @[<2>val %s%s :@ %a@]" (string_of_mutable m) l (typexp sch 0) t ++ ++let method_type (_, kind, ty) = ++ match field_kind_repr kind, repr ty with ++ Fpresent, {desc=Tpoly(ty, _)} -> ty ++ | _ , ty -> ty ++ ++let tree_of_metho sch concrete csil (lab, kind, ty) = ++ if lab <> dummy_method then begin ++ let kind = field_kind_repr kind in ++ let priv = kind <> Fpresent in ++ let virt = not (Concr.mem lab concrete) in ++ let ty = method_type (lab, kind, ty) in ++ Ocsg_method (lab, priv, virt, tree_of_typexp sch ty) :: csil ++ end ++ else csil ++ ++let rec prepare_class_type params = function ++ | Tcty_constr (p, tyl, cty) -> ++ let sty = Ctype.self_type cty in ++ if List.memq (proxy sty) !visited_objects ++ || List.exists (fun ty -> (repr ty).desc <> Tvar) params ++ || List.exists (deep_occur sty) tyl ++ then prepare_class_type params cty ++ else List.iter mark_loops tyl ++ | Tcty_signature sign -> ++ let sty = repr sign.cty_self in ++ (* Self may have a name *) ++ let px = proxy sty in ++ if List.memq px !visited_objects then add_alias sty ++ else visited_objects := px :: !visited_objects; ++ let (fields, _) = ++ Ctype.flatten_fields (Ctype.object_fields sign.cty_self) ++ in ++ List.iter (fun met -> mark_loops (method_type met)) fields; ++ Vars.iter (fun _ (_, _, ty) -> mark_loops ty) sign.cty_vars ++ | Tcty_fun (_, ty, cty) -> ++ mark_loops ty; ++ prepare_class_type params cty ++ ++let rec tree_of_class_type sch params = ++ function ++ | Tcty_constr (p', tyl, cty) -> ++ let sty = Ctype.self_type cty in ++ if List.memq (proxy sty) !visited_objects ++ || List.exists (fun ty -> (repr ty).desc <> Tvar) params ++ then ++ tree_of_class_type sch params cty ++ else ++ Octy_constr (tree_of_path p', tree_of_typlist true tyl) ++ | Tcty_signature sign -> ++ let sty = repr sign.cty_self in ++ let self_ty = ++ if is_aliased sty then ++ Some (Otyp_var (false, name_of_type (proxy sty))) ++ else None ++ in ++ let (fields, _) = ++ Ctype.flatten_fields (Ctype.object_fields sign.cty_self) ++ in ++ let csil = [] in ++ let csil = ++ List.fold_left ++ (fun csil (ty1, ty2) -> Ocsg_constraint (ty1, ty2) :: csil) ++ csil (tree_of_constraints params) ++ in ++ let all_vars = ++ Vars.fold (fun l (m, v, t) all -> (l, m, v, t) :: all) sign.cty_vars [] ++ in ++ (* Consequence of PR#3607: order of Map.fold has changed! *) ++ let all_vars = List.rev all_vars in ++ let csil = ++ List.fold_left ++ (fun csil (l, m, v, t) -> ++ Ocsg_value (l, m = Mutable, v = Virtual, tree_of_typexp sch t) ++ :: csil) ++ csil all_vars ++ in ++ let csil = ++ List.fold_left (tree_of_metho sch sign.cty_concr) csil fields ++ in ++ Octy_signature (self_ty, List.rev csil) ++ | Tcty_fun (l, ty, cty) -> ++ let lab = if !print_labels && l <> "" || is_optional l then l else "" in ++ let ty = ++ if is_optional l then ++ match (repr ty).desc with ++ | Tconstr(path, [ty], _) when Path.same path Predef.path_option -> ty ++ | _ -> newconstr (Path.Pident(Ident.create "")) [] ++ else ty in ++ let tr = tree_of_typexp sch ty in ++ Octy_fun (lab, tr, tree_of_class_type sch params cty) ++ ++let class_type ppf cty = ++ reset (); ++ prepare_class_type [] cty; ++ !Oprint.out_class_type ppf (tree_of_class_type false [] cty) ++ ++let tree_of_class_param param variance = ++ (match tree_of_typexp true param with ++ Otyp_var (_, s) -> s ++ | _ -> "?"), ++ if (repr param).desc = Tvar then (true, true) else variance ++ ++let tree_of_class_params params = ++ let tyl = tree_of_typlist true params in ++ List.map (function Otyp_var (_, s) -> s | _ -> "?") tyl ++ ++let tree_of_class_declaration id cl rs = ++ let params = filter_params cl.cty_params in ++ ++ reset (); ++ List.iter add_alias params; ++ prepare_class_type params cl.cty_type; ++ let sty = self_type cl.cty_type in ++ List.iter mark_loops params; ++ ++ List.iter check_name_of_type (List.map proxy params); ++ if is_aliased sty then check_name_of_type (proxy sty); ++ ++ let vir_flag = cl.cty_new = None in ++ Osig_class ++ (vir_flag, ident_name id, ++ List.map2 tree_of_class_param params cl.cty_variance, ++ tree_of_class_type true params cl.cty_type, ++ tree_of_rec rs) ++ ++let class_declaration id ppf cl = ++ !Oprint.out_sig_item ppf (tree_of_class_declaration id cl Trec_first) ++ ++let tree_of_cltype_declaration id cl rs = ++ let params = List.map repr cl.clty_params in ++ ++ reset (); ++ List.iter add_alias params; ++ prepare_class_type params cl.clty_type; ++ let sty = self_type cl.clty_type in ++ List.iter mark_loops params; ++ ++ List.iter check_name_of_type (List.map proxy params); ++ if is_aliased sty then check_name_of_type (proxy sty); ++ ++ let sign = Ctype.signature_of_class_type cl.clty_type in ++ ++ let virt = ++ let (fields, _) = ++ Ctype.flatten_fields (Ctype.object_fields sign.cty_self) in ++ List.exists ++ (fun (lab, _, ty) -> ++ not (lab = dummy_method || Concr.mem lab sign.cty_concr)) ++ fields ++ || Vars.fold (fun _ (_,vr,_) b -> vr = Virtual || b) sign.cty_vars false ++ in ++ ++ Osig_class_type ++ (virt, ident_name id, ++ List.map2 tree_of_class_param params cl.clty_variance, ++ tree_of_class_type true params cl.clty_type, ++ tree_of_rec rs) ++ ++let cltype_declaration id ppf cl = ++ !Oprint.out_sig_item ppf (tree_of_cltype_declaration id cl Trec_first) ++ ++(* Print a module type *) ++ ++let rec tree_of_modtype = function ++ | Tmty_ident p -> ++ Omty_ident (tree_of_path p) ++ | Tmty_signature sg -> ++ Omty_signature (tree_of_signature sg) ++ | Tmty_functor(param, ty_arg, ty_res) -> ++ Omty_functor ++ (ident_name param, tree_of_modtype ty_arg, tree_of_modtype ty_res) ++ ++and tree_of_signature = function ++ | [] -> [] ++ | Tsig_value(id, decl) :: rem -> ++ tree_of_value_description id decl :: tree_of_signature rem ++ | Tsig_type(id, _, _) :: rem when is_row_name (ident_name id) -> ++ tree_of_signature rem ++ | Tsig_type(id, decl, rs) :: rem -> ++ Osig_type(tree_of_type_decl id decl, tree_of_rec rs) :: ++ tree_of_signature rem ++ | Tsig_exception(id, decl) :: rem -> ++ tree_of_exception_declaration id decl :: tree_of_signature rem ++ | Tsig_module(id, mty, rs) :: rem -> ++ Osig_module (ident_name id, tree_of_modtype mty, tree_of_rec rs) :: ++ tree_of_signature rem ++ | Tsig_modtype(id, decl) :: rem -> ++ tree_of_modtype_declaration id decl :: tree_of_signature rem ++ | Tsig_class(id, decl, rs) :: ctydecl :: tydecl1 :: tydecl2 :: rem -> ++ tree_of_class_declaration id decl rs :: tree_of_signature rem ++ | Tsig_cltype(id, decl, rs) :: tydecl1 :: tydecl2 :: rem -> ++ tree_of_cltype_declaration id decl rs :: tree_of_signature rem ++ | _ -> ++ assert false ++ ++and tree_of_modtype_declaration id decl = ++ let mty = ++ match decl with ++ | Tmodtype_abstract -> Omty_abstract ++ | Tmodtype_manifest mty -> tree_of_modtype mty ++ in ++ Osig_modtype (ident_name id, mty) ++ ++let tree_of_module id mty rs = ++ Osig_module (ident_name id, tree_of_modtype mty, tree_of_rec rs) ++ ++let modtype ppf mty = !Oprint.out_module_type ppf (tree_of_modtype mty) ++let modtype_declaration id ppf decl = ++ !Oprint.out_sig_item ppf (tree_of_modtype_declaration id decl) ++ ++(* Print a signature body (used by -i when compiling a .ml) *) ++ ++let print_signature ppf tree = ++ fprintf ppf "@[%a@]" !Oprint.out_signature tree ++ ++let signature ppf sg = ++ fprintf ppf "%a" print_signature (tree_of_signature sg) ++ ++(* Print an unification error *) ++ ++let type_expansion t ppf t' = ++ if t == t' then type_expr ppf t else ++ let t' = if proxy t == proxy t' then unalias t' else t' in ++ fprintf ppf "@[<2>%a@ =@ %a@]" type_expr t type_expr t' ++ ++let rec trace fst txt ppf = function ++ | (t1, t1') :: (t2, t2') :: rem -> ++ if not fst then fprintf ppf "@,"; ++ fprintf ppf "@[Type@;<1 2>%a@ %s@;<1 2>%a@] %a" ++ (type_expansion t1) t1' txt (type_expansion t2) t2' ++ (trace false txt) rem ++ | _ -> () ++ ++let rec filter_trace = function ++ | (t1, t1') :: (t2, t2') :: rem -> ++ let rem' = filter_trace rem in ++ if t1 == t1' && t2 == t2' ++ then rem' ++ else (t1, t1') :: (t2, t2') :: rem' ++ | _ -> [] ++ ++(* Hide variant name and var, to force printing the expanded type *) ++let hide_variant_name t = ++ match repr t with ++ | {desc = Tvariant row} as t when (row_repr row).row_name <> None -> ++ newty2 t.level ++ (Tvariant {(row_repr row) with row_name = None; ++ row_more = newty2 (row_more row).level Tvar}) ++ | _ -> t ++ ++let prepare_expansion (t, t') = ++ let t' = hide_variant_name t' in ++ mark_loops t; if t != t' then mark_loops t'; ++ (t, t') ++ ++let may_prepare_expansion compact (t, t') = ++ match (repr t').desc with ++ Tvariant _ | Tobject _ when compact -> ++ mark_loops t; (t, t) ++ | _ -> prepare_expansion (t, t') ++ ++let print_tags ppf fields = ++ match fields with [] -> () ++ | (t, _) :: fields -> ++ fprintf ppf "`%s" t; ++ List.iter (fun (t, _) -> fprintf ppf ",@ `%s" t) fields ++ ++let has_explanation unif t3 t4 = ++ match t3.desc, t4.desc with ++ Tfield _, _ | _, Tfield _ ++ | Tunivar, Tvar | Tvar, Tunivar ++ | Tvariant _, Tvariant _ -> true ++ | Tconstr (p, _, _), Tvar | Tvar, Tconstr (p, _, _) -> ++ unif && min t3.level t4.level < Path.binding_time p ++ | _ -> false ++ ++let rec mismatch unif = function ++ (_, t) :: (_, t') :: rem -> ++ begin match mismatch unif rem with ++ Some _ as m -> m ++ | None -> ++ if has_explanation unif t t' then Some(t,t') else None ++ end ++ | [] -> None ++ | _ -> assert false ++ ++let explanation unif t3 t4 ppf = ++ match t3.desc, t4.desc with ++ | Tfield _, Tvar | Tvar, Tfield _ -> ++ fprintf ppf "@,Self type cannot escape its class" ++ | Tconstr (p, _, _), Tvar ++ when unif && t4.level < Path.binding_time p -> ++ fprintf ppf ++ "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" ++ path p ++ | Tvar, Tconstr (p, _, _) ++ when unif && t3.level < Path.binding_time p -> ++ fprintf ppf ++ "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" ++ path p ++ | Tvar, Tunivar | Tunivar, Tvar -> ++ fprintf ppf "@,The universal variable %a would escape its scope" ++ type_expr (if t3.desc = Tunivar then t3 else t4) ++ | Tfield (lab, _, _, _), _ ++ | _, Tfield (lab, _, _, _) when lab = dummy_method -> ++ fprintf ppf ++ "@,Self type cannot be unified with a closed object type" ++ | Tfield (l, _, _, _), Tfield (l', _, _, _) when l = l' -> ++ fprintf ppf "@,Types for method %s are incompatible" l ++ | _, Tfield (l, _, _, _) -> ++ fprintf ppf ++ "@,@[The first object type has no method %s@]" l ++ | Tfield (l, _, _, _), _ -> ++ fprintf ppf ++ "@,@[The second object type has no method %s@]" l ++ | Tvariant row1, Tvariant row2 -> ++ let row1 = row_repr row1 and row2 = row_repr row2 in ++ begin match ++ row1.row_fields, row1.row_closed, row2.row_fields, row2.row_closed with ++ | [], true, [], true -> ++ fprintf ppf "@,These two variant types have no intersection" ++ | [], true, fields, _ -> ++ fprintf ppf ++ "@,@[The first variant type does not allow tag(s)@ @[%a@]@]" ++ print_tags fields ++ | fields, _, [], true -> ++ fprintf ppf ++ "@,@[The second variant type does not allow tag(s)@ @[%a@]@]" ++ print_tags fields ++ | [l1,_], true, [l2,_], true when l1 = l2 -> ++ fprintf ppf "@,Types for tag `%s are incompatible" l1 ++ | _ -> () ++ end ++ | _ -> () ++ ++let explanation unif mis ppf = ++ match mis with ++ None -> () ++ | Some (t3, t4) -> explanation unif t3 t4 ppf ++ ++let unification_error unif tr txt1 ppf txt2 = ++ reset (); ++ let tr = List.map (fun (t, t') -> (t, hide_variant_name t')) tr in ++ let mis = mismatch unif tr in ++ match tr with ++ | [] | _ :: [] -> assert false ++ | t1 :: t2 :: tr -> ++ try ++ let tr = filter_trace tr in ++ let t1, t1' = may_prepare_expansion (tr = []) t1 ++ and t2, t2' = may_prepare_expansion (tr = []) t2 in ++ print_labels := not !Clflags.classic; ++ let tr = List.map prepare_expansion tr in ++ fprintf ppf ++ "@[\ ++ @[%t@;<1 2>%a@ \ ++ %t@;<1 2>%a\ ++ @]%a%t\ ++ @]" ++ txt1 (type_expansion t1) t1' ++ txt2 (type_expansion t2) t2' ++ (trace false "is not compatible with type") tr ++ (explanation unif mis); ++ print_labels := true ++ with exn -> ++ print_labels := true; ++ raise exn ++ ++let report_unification_error ppf tr txt1 txt2 = ++ unification_error true tr txt1 ppf txt2;; ++ ++let trace fst txt ppf tr = ++ print_labels := not !Clflags.classic; ++ try match tr with ++ t1 :: t2 :: tr' -> ++ if fst then trace fst txt ppf (t1 :: t2 :: filter_trace tr') ++ else trace fst txt ppf (filter_trace tr); ++ print_labels := true ++ | _ -> () ++ with exn -> ++ print_labels := true; ++ raise exn ++ ++let report_subtyping_error ppf tr1 txt1 tr2 = ++ reset (); ++ let tr1 = List.map prepare_expansion tr1 ++ and tr2 = List.map prepare_expansion tr2 in ++ trace true txt1 ppf tr1; ++ if tr2 = [] then () else ++ let mis = mismatch true tr2 in ++ trace false "is not compatible with type" ppf tr2; ++ explanation true mis ppf ++ ++end +diff -ruN ocaml-3.10.2/toplevel/topdirext.ml ocaml-3.10.2-enhtop/toplevel/topdirext.ml +--- ocaml-3.10.2/toplevel/topdirext.ml 1969-12-31 19:00:00.000000000 -0500 ++++ ocaml-3.10.2-enhtop/toplevel/topdirext.ml 2008-09-06 20:28:40.822712773 -0400 +@@ -0,0 +1,314 @@ ++open Format ++open Types ++open Env ++open Outcometree ++open Toploop ++open Path ++ ++ ++(* Filter definition *) ++ ++type filter = Env.summary -> bool ++ ++let ( ||| ) (f1:filter) (f2:filter) = (fun s -> (f1 s) || (f2 s) : filter) ++let ( &&& ) (f1:filter) (f2:filter) = (fun s -> (f1 s) && (f2 s) : filter) ++ ++let open_filter = function ++ | Env_open (_,_) -> true ++ | _ -> false ++ ++let value_filter = function ++ | Env_value (_,_,_) -> true ++ | _ -> false ++ ++let type_filter = function ++ | Env_type (_,_,{type_manifest = Some {desc = Tobject _}}) -> false ++ | Env_type _ -> true | _ -> false ++ ++let exception_filter = function ++ | Env_exception (_,_,_) -> true ++ | _ -> false ++ ++let module_filter = function ++ | Env_module (_,_,_) -> true ++ | _ -> false ++ ++let modtype_filter = function ++ | Env_modtype (_,_,_) -> true ++ | _ -> false ++ ++let class_filter = function ++ | Env_class (_,_,{cty_type=Tcty_signature{cty_self={desc=Tobject _}}}) -> true ++ | _ -> false ++ ++let cltype_filter = function ++ | Env_cltype (_,_,{clty_type=Tcty_signature{cty_self={desc=Tobject _}}}) -> true ++ | _ -> false ++ ++let none_filter = function _ -> false ++ ++let all_filter = ++ open_filter ||| value_filter ||| type_filter ||| exception_filter ++ ||| module_filter ||| modtype_filter ||| class_filter ||| cltype_filter ++ ++let id_filter_gen filter_fun = function ++ | Env_open (_, p) -> filter_fun (Path.head p) ++ | Env_value (_,id,_) | Env_type (_,id,_) ++ | Env_exception (_,id,_) | Env_module (_,id,_) | Env_modtype (_,id,_) ++ | Env_class (_,id,_) | Env_cltype (_,id,_ ) -> filter_fun id ++ | _ -> false ++ ++let id_equal_filter id = id_filter_gen (Ident.equal id) ++ ++let id_same_filter id = id_filter_gen (Ident.same id) ++ ++let name_filter name = id_filter_gen (fun id -> Ident.name id = name) ++ ++ ++(* Printer definintion *) ++ ++ ++(* Poorman's solution to raise print function to deal with path *) ++ ++(* Fake id *) ++type id = { stamp : int; name : string; flags : int } ++let rec temp_id = function ++ | Path.Pident id -> id ++ | x -> Obj.magic {stamp = 0 ; name = Path.name x; flags = 0} ++ ++let print_open ppf path = fprintf ppf "open %s@." (Path.name path) ++let print_value ppf path decl = ++ let tree, valopt = Printtyp.tree_of_value path decl in ++ !print_out_phrase ppf (Ophr_signature [tree, valopt]) ++let print_type ppf path decl = ++ let tree = Printtyp.tree_of_type_declaration (temp_id path) decl Trec_not in ++ !print_out_phrase ppf (Ophr_signature [tree, None]) ++let print_exception ppf path decl = ++ let tree = Printtyp.tree_of_exception_declaration (temp_id path) decl in ++ !print_out_phrase ppf (Ophr_signature [tree, None]) ++let print_module ppf path decl = ++ let tree = Printtyp.tree_of_module (temp_id path)decl Trec_not in ++ !print_out_phrase ppf (Ophr_signature [tree, None]) ++let print_modtype ppf path decl = ++ let tree = Printtyp.tree_of_modtype_declaration (temp_id path) decl in ++ !print_out_phrase ppf (Ophr_signature [tree, None]) ++let print_class ppf path decl = ++ let tree = Printtyp.tree_of_class_declaration (temp_id path) decl Trec_not in ++ !print_out_phrase ppf (Ophr_signature [tree, None]) ++let print_cltype ppf path decl = ++ let tree = Printtyp.tree_of_cltype_declaration (temp_id path) decl Trec_not in ++ !print_out_phrase ppf (Ophr_signature [tree, None]) ++ ++let all_printer ppf = function ++ | Env_open (_, path) -> print_open ppf path ++ | Env_value (_, id, decl) -> print_value ppf (Pident id) decl ++ | Env_type (_, id, decl) -> print_type ppf (Pident id) decl ++ | Env_exception (_, id, decl) -> print_exception ppf (Pident id) decl ++ | Env_module (_, id, decl) -> print_module ppf (Pident id) decl ++ | Env_modtype (_, id, decl) -> print_modtype ppf (Pident id) decl ++ | Env_class (_, id, decl) -> print_class ppf (Pident id) decl ++ | Env_cltype (_, id, decl) -> print_cltype ppf (Pident id) decl ++ | _ -> () ++ ++ ++(* Travaller function *) ++ ++let env_iter env iter_fun = ++ let env_sum = Env.summary env in ++ let rec iter sum = match sum with ++ | Env_empty -> () ++ | Env_open (ns, _) | Env_value (ns,_,_) | Env_type (ns,_,_) ++ | Env_exception (ns,_,_) | Env_module (ns,_,_) | Env_modtype (ns,_,_) ++ | Env_class (ns,_,_) | Env_cltype (ns,_,_ ) -> ++ iter ns; iter_fun sum in ++ iter env_sum ++ ++ ++(* Main definition of show directive *) ++ ++let filter_conf = ++ [ "open", open_filter; ++ "value", value_filter; ++ "type", type_filter; ++ "exception", exception_filter; ++ "module", module_filter; ++ "modtype", modtype_filter; ++ "class", class_filter; ++ "cltype", cltype_filter ];; ++ ++let show_fun ppf env filter_fun print_fun = ++ let iter_fun s = if filter_fun s then print_fun ppf s in ++ env_iter env iter_fun ++ ++let show ppf env s = ++ let comm_list = Misc.rev_split_words s in ++ let filter = ++ let rec get_filter fil = function ++ | [] -> fil ++ | "all":: _ -> all_filter ++ | comm :: t -> ++ try let f = List.assoc comm filter_conf in get_filter (f ||| fil) t ++ with Not_found -> get_filter ((name_filter comm) ||| fil) t in ++ get_filter none_filter comm_list in ++ show_fun ppf env filter all_printer ++ ++let dir_show ppf s = show ppf !toplevel_env s ++let dir_show_show ppf () = dir_show ppf "all" ++ ++ ++(* Main definition of tell directive *) ++ ++(* tell can only handle limited representation at this moment *) ++let tell ppf env s = ++ let gen_fun lookup print = fun lid -> ++ try print (lookup lid env); true ++ with Not_found -> false in ++ let rec lookup_print lid = List.fold_left ++ (fun b f -> (f lid) || b) false ++ [ gen_fun Env.lookup_value (fun (p,d) -> print_value ppf p d); ++ gen_fun Env.lookup_type (fun (p,d) -> print_type ppf p d); ++ gen_fun Env.lookup_module (fun (p,d) -> print_module ppf p d); ++ gen_fun Env.lookup_modtype (fun (p,d) -> print_modtype ppf p d); ++ gen_fun Env.lookup_class (fun (p,d) -> print_class ppf p d); ++ gen_fun Env.lookup_cltype (fun (p,d) -> print_cltype ppf p d) ++ ] in ++ let rec try_lookup lid = ++ match lookup_print lid, lid with ++ | true, _ | _, Longident.Lident _ -> () ++ | _ , Longident.Ldot (lid', _) -> try_lookup lid' ++ | _ , Longident.Lapply (_, _) -> Misc.fatal_error "tell" in ++ try_lookup (Longident.parse s) ++ ++let dir_tell ppf s = tell ppf !toplevel_env s ++ ++ ++(* Type mode *) ++let type_mode_sw = ++ let toplevel_env_bak = ref (!toplevel_env) in ++ (fun b -> ++ match !type_mode, b with ++ | false, true -> toplevel_env_bak := !toplevel_env; type_mode := b ++ | true, false -> toplevel_env := !toplevel_env_bak; type_mode := b ++ | _, _ -> ()) ++ ++let dir_typemode_show ppf () = ++ if !type_mode then fprintf ppf "type mode is on.@." ++ else fprintf ppf "type mode is off.@." ++ ++let dir_typemode ppf b = type_mode_sw b; dir_typemode_show ppf () ++ ++ ++(* Module listing *) ++ ++let check_loaded mod_name = ++ try ++ let path, _ = ++ Env.lookup_module (Longident.parse mod_name) !Toploop.toplevel_env in ++ let id = Path.head path in ++ let _ = Symtable.get_global_position id in ++ true ++ with _ -> false ++ ++let list_paths () = ++ Filename.current_dir_name :: List.filter (fun d -> d <>"") !Config.load_path ++ ++let list_libs sufs dirs = List.map ++ (fun dir -> ++ let files = try Array.to_list (Sys.readdir dir) with _ -> [] in ++ List.filter (fun f -> List.exists (fun s -> Filename.check_suffix f s) sufs) files) ++ dirs ++ ++let list_mods () = ++ let dirs = ++ Filename.current_dir_name :: List.filter (fun d -> d <> "") !Config.load_path in ++ List.sort compare ++ (List.map ++ (fun x -> String.capitalize (Filename.chop_extension x)) ++ (List.flatten (list_libs [".cmi"] dirs))) ++ ++let dir_modu_show ppf () = ++ let mods = list_mods () in ++ let mods' = List.map (fun x -> x, check_loaded x) mods in ++ List.iter (fun (m, f) -> fprintf ppf "%s%s " m (if f then "(L)" else "")) mods'; ++ fprintf ppf "@." ++ ++ ++(* Env config *) ++ ++let dir_env_show ppf () = ++ fprintf ppf ++ "value:%b type:%b exception:%b@.module:%b modtype:%b class:%b cltype:%b@." ++ print_conf.print_value print_conf.print_type print_conf.print_exception ++ print_conf.print_module print_conf.print_modtype print_conf.print_class ++ print_conf.print_cltype ++ ++let string_to_printer = function ++ | "value" -> fun b -> print_conf.print_value <- b ++ | "type" -> fun b -> print_conf.print_type <- b ++ | "exception" -> fun b -> print_conf.print_exception <- b ++ | "module" -> fun b -> print_conf.print_module <- b ++ | "modtype" -> fun b -> print_conf.print_modtype <- b ++ | "class" -> fun b -> print_conf.print_class <- b ++ | "cltype" -> fun b -> print_conf.print_cltype <- b ++ | _ -> assert false ++ ++let dir_env ppf s = ++ let sl = Misc.rev_split_words s in ++ let set s = ++ try ++ let i = String.index s ':' in ++ string_to_printer (String.sub s 0 i) ++ (bool_of_string (String.sub s (i+1) (String.length s - i -1))) ++ with _ -> () in ++ List.iter set sl; ++ dir_env_show ppf () ++ ++ ++ ++(* Directory *) ++ ++let dir_directory_show ppf () = ++ let dirs = list_paths () in ++ List.iter (fprintf ppf "[%s] ") dirs; ++ fprintf ppf "@." ++ ++(* Cd *) ++ ++let dir_cd_show ppf () = ++ let cur_dir = Sys.getcwd () in ++ let sub_dir = String.concat " " (Array.to_list (Sys.readdir cur_dir)) in ++ fprintf ppf "[%s]:@." cur_dir; ++ (* Sys module won't help you to know which file is a directory *) ++ fprintf ppf "%s@." sub_dir ++ ++(* Use *) ++ ++let dir_use_show ppf () = ++ let dirs = list_paths () in ++ let use_files = list_libs [".ml"] dirs in ++ List.iter2 ++ (fun d l -> ++ match l with [] -> () | _ -> ++ fprintf ppf "[%s]:@." d; List.iter (fprintf ppf "%s ") l; fprintf ppf "@." ++ ) dirs use_files ++ ++(* Trace *) ++ ++let dir_trace_show ppf () = ++ List.iter ++ (fun x -> ++ fprintf ppf "%s " (Printtyp.path_name x.Trace.path)) ++ !Trace.traced_functions; ++ fprintf ppf "@." ++ ++(* Load *) ++ ++let dir_load_show ppf () = ++ let dirs = list_paths () in ++ let loadables = list_libs [".cmo"; ".cma"] dirs in ++ List.iter2 ++ (fun d l -> ++ match l with [] -> () | _ -> ++ fprintf ppf "[%s]:@." d; List.iter (fprintf ppf "%s ") l; fprintf ppf "@." ++ ) dirs loadables ++ +diff -ruN ocaml-3.10.2/toplevel/topdirext.mli ocaml-3.10.2-enhtop/toplevel/topdirext.mli +--- ocaml-3.10.2/toplevel/topdirext.mli 1969-12-31 19:00:00.000000000 -0500 ++++ ocaml-3.10.2-enhtop/toplevel/topdirext.mli 2008-09-06 20:28:40.822712773 -0400 +@@ -0,0 +1,18 @@ ++(* Naming convention: dir_name dir_name_op, op = show/query/etc. *) ++ ++(* New primitives *) ++val dir_show : Format.formatter -> string -> unit ++val dir_show_show: Format.formatter -> unit -> unit ++val dir_tell : Format.formatter -> string -> unit ++val dir_typemode: Format.formatter -> bool -> unit ++val dir_typemode_show : Format.formatter -> unit -> unit ++val dir_modu_show: Format.formatter -> unit -> unit ++val dir_env: Format.formatter -> string -> unit ++val dir_env_show: Format.formatter -> unit -> unit ++ ++(* Enhanced primitives *) ++val dir_directory_show: Format.formatter -> unit -> unit ++val dir_cd_show: Format.formatter -> unit -> unit ++val dir_use_show: Format.formatter -> unit -> unit ++val dir_trace_show: Format.formatter -> unit -> unit ++val dir_load_show: Format.formatter -> unit -> unit +diff -ruN ocaml-3.10.2/toplevel/topdirs.ml ocaml-3.10.2-enhtop/toplevel/topdirs.ml +--- ocaml-3.10.2/toplevel/topdirs.ml 2006-09-28 17:36:38.000000000 -0400 ++++ ocaml-3.10.2-enhtop/toplevel/topdirs.ml 2008-09-06 20:28:40.822712773 -0400 +@@ -21,6 +21,7 @@ + open Types + open Cmo_format + open Trace ++open Topdirext + open Toploop + + (* The standard output formatter *) +@@ -35,15 +36,23 @@ + (* To add a directory to the load path *) + + let dir_directory s = ++ if String.length s = 0 then () ++ else ++ let flag, s = ++ if s.[0] = '-' then false, (String.sub s 1 (String.length s - 1)) ++ else true, s in + let d = expand_directory Config.standard_library s in +- Config.load_path := d :: !Config.load_path; +- Dll.add_path [d] ++ if flag then ++ (Config.load_path := d :: !Config.load_path; Dll.add_path [d]) ++ else Config.load_path := List.filter (fun x -> x <> d) !Config.load_path ; ++ dir_directory_show std_out () + +-let _ = Hashtbl.add directive_table "directory" (Directive_string dir_directory) ++let _ = Hashtbl.add directive_table "directory" ++ (Directive_string dir_directory) + + (* To change the current directory *) + +-let dir_cd s = Sys.chdir s ++let dir_cd s = Sys.chdir s; fprintf std_out "[%s]@." (Sys.getcwd ()) + + let _ = Hashtbl.add directive_table "cd" (Directive_string dir_cd) + +@@ -224,9 +233,9 @@ + then begin + match is_traced clos with + | Some opath -> +- fprintf ppf "%a is already traced (under the name %a).@." +- Printtyp.path path +- Printtyp.path opath ++ fprintf ppf "%s is already traced (under the name %s).@." ++ (Printtyp.path_name path) ++ (Printtyp.path_name opath) + | None -> + (* Instrument the old closure *) + traced_functions := +@@ -265,10 +274,11 @@ + List.iter + (fun f -> + set_code_pointer f.closure f.actual_code; +- fprintf ppf "%a is no longer traced.@." Printtyp.path f.path) ++ fprintf ppf "%s is no longer traced.@." (Printtyp.path_name f.path)) + !traced_functions; + traced_functions := [] + ++ + let parse_warnings ppf iserr s = + try Warnings.parse_options iserr s + with Arg.Bad err -> fprintf ppf "%s.@." err +@@ -299,3 +309,20 @@ + + Hashtbl.add directive_table "warn_error" + (Directive_string (parse_warnings std_out true)) ++ ++ ++let _ = ++ Hashtbl.add directive_table "show" (Directive_string (dir_show std_out)); ++ Hashtbl.add directive_table "show" (Directive_none (dir_show_show std_out)); ++ Hashtbl.add directive_table "tell" (Directive_string (dir_tell std_out)); ++ Hashtbl.add directive_table "typemode" (Directive_bool (dir_typemode std_out)); ++ Hashtbl.add directive_table "typemode" (Directive_none (dir_typemode_show std_out)); ++ Hashtbl.add directive_table "modu" (Directive_none (dir_modu_show std_out)); ++ Hashtbl.add directive_table "env" (Directive_string (dir_env std_out)); ++ Hashtbl.add directive_table "env" (Directive_none (dir_env_show std_out)); ++ ++ Hashtbl.add directive_table "directory" (Directive_none (dir_directory_show std_out)); ++ Hashtbl.add directive_table "cd" (Directive_none (dir_cd_show std_out)); ++ Hashtbl.add directive_table "use" (Directive_none (dir_use_show std_out)); ++ Hashtbl.add directive_table "load" (Directive_none (dir_load_show std_out)); ++ Hashtbl.add directive_table "trace" (Directive_none (dir_trace_show std_out)) +diff -ruN ocaml-3.10.2/toplevel/toploop.ml ocaml-3.10.2-enhtop/toplevel/toploop.ml +--- ocaml-3.10.2/toplevel/toploop.ml 2006-01-04 11:55:50.000000000 -0500 ++++ ocaml-3.10.2-enhtop/toplevel/toploop.ml 2008-09-06 20:28:40.822712773 -0400 +@@ -47,6 +47,7 @@ + + (* Return the value referred to by a path *) + ++(* when eval a old path may get new result *) + let rec eval_path = function + | Pident id -> + if Ident.persistent id || Ident.global id then +@@ -146,42 +147,96 @@ + Symtable.restore_state initial_symtable; + Exception x + ++(* The current typing environment for the toplevel *) ++let toplevel_env = ref Env.empty ++ ++(* Typing mode switch *) ++let type_mode = ref false ++ ++ ++module Printtyp = struct ++ include Genprinttyp.Make (struct let env = toplevel_env end) ++ let tree_of_value path decl = ++ let get_obj path = ++ if !type_mode || is_rebound (Path.head path) then None ++ else ++ try Some (outval_of_value !topenv (eval_path path) decl.val_type) ++ with _ -> None in ++ let ty = tree_of_type_scheme decl.val_type in ++ let prims, valopt = match decl.val_kind with ++ | Val_prim p -> Primitive.description_list p, None ++ | _ -> [], (get_obj path) in ++ Osig_value ((path_name path), ty, prims), valopt ++end ++ ++ + (* Print the outcome of an evaluation *) + ++type print_config = { ++ mutable welcome: unit -> string; ++ mutable prompt: unit -> string; ++ mutable print_value: bool; ++ mutable print_type: bool; ++ mutable print_exception: bool; ++ mutable print_module: bool; ++ mutable print_modtype: bool; ++ mutable print_class: bool; ++ mutable print_cltype: bool; ++} ++ ++let print_conf = { ++ welcome = ++ (let str = sprintf " Objective Caml version %s" Config.version in ++ fun () -> str); ++ prompt = (fun () -> "# "); ++ print_value = true; ++ print_type = false; ++ print_exception = false; ++ print_module = true; ++ print_modtype =false; ++ print_class = true; ++ print_cltype = false; ++} ++ ++ + let rec pr_item env = function + | Tsig_value(id, decl) :: rem -> +- let tree = Printtyp.tree_of_value_description id decl in +- let valopt = +- match decl.val_kind with +- | Val_prim _ -> None +- | _ -> +- let v = +- outval_of_value env (getvalue (Translmod.toplevel_name id)) +- decl.val_type +- in +- Some v +- in ++ if print_conf.print_value then ++ let tree, valopt = Printtyp.tree_of_value (Pident id) decl in + Some (tree, valopt, rem) ++ else pr_item env rem + | Tsig_type(id, _, _) :: rem when Btype.is_row_name (Ident.name id) -> + pr_item env rem + | Tsig_type(id, decl, rs) :: rem -> ++ if print_conf.print_type then + let tree = Printtyp.tree_of_type_declaration id decl rs in + Some (tree, None, rem) ++ else pr_item env rem + | Tsig_exception(id, decl) :: rem -> ++ if print_conf.print_exception then + let tree = Printtyp.tree_of_exception_declaration id decl in + Some (tree, None, rem) ++ else pr_item env rem + | Tsig_module(id, mty, rs) :: rem -> ++ if print_conf.print_module then + let tree = Printtyp.tree_of_module id mty rs in + Some (tree, None, rem) ++ else pr_item env rem + | Tsig_modtype(id, decl) :: rem -> ++ if print_conf.print_modtype then + let tree = Printtyp.tree_of_modtype_declaration id decl in + Some (tree, None, rem) ++ else pr_item env rem + | Tsig_class(id, decl, rs) :: cltydecl :: tydecl1 :: tydecl2 :: rem -> ++ if print_conf.print_class then + let tree = Printtyp.tree_of_class_declaration id decl rs in + Some (tree, None, rem) ++ else pr_item env rem + | Tsig_cltype(id, decl, rs) :: tydecl1 :: tydecl2 :: rem -> ++ if print_conf.print_cltype then + let tree = Printtyp.tree_of_cltype_declaration id decl rs in + Some (tree, None, rem) ++ else pr_item env rem + | _ -> None + + let rec item_list env = function +@@ -191,10 +246,6 @@ + | None -> [] + | Some (tree, valopt, items) -> (tree, valopt) :: item_list env items + +-(* The current typing environment for the toplevel *) +- +-let toplevel_env = ref Env.empty +- + (* Print an exception produced by an evaluation *) + + let print_out_exception ppf exn outv = +@@ -224,8 +275,19 @@ + Warnings.check_fatal (); + begin try + toplevel_env := newenv; +- let res = load_lambda ppf lam in + let out_phr = ++ if !type_mode then ++ if print_outcome then ++ match str with ++ | [Tstr_eval exp] -> ++ let ty = Printtyp.tree_of_type_scheme exp.exp_type in ++ Ophr_eval (Oval_ellipsis, ty) ++ | [] -> Ophr_signature [] ++ | _ -> Ophr_signature (item_list newenv ++ (Typemod.simplify_signature sg)) ++ else Ophr_signature [] ++ else ++ let res = load_lambda ppf lam in + match res with + | Result v -> + if print_outcome then +@@ -256,15 +318,18 @@ + end + | Ptop_dir(dir_name, dir_arg) -> + try +- match (Hashtbl.find directive_table dir_name, dir_arg) with +- | (Directive_none f, Pdir_none) -> f (); true +- | (Directive_string f, Pdir_string s) -> f s; true +- | (Directive_int f, Pdir_int n) -> f n; true +- | (Directive_ident f, Pdir_ident lid) -> f lid; true +- | (Directive_bool f, Pdir_bool b) -> f b; true +- | (_, _) -> +- fprintf ppf "Wrong type of argument for directive `%s'.@." dir_name; +- false ++ let dirs = Hashtbl.find_all directive_table dir_name in ++ List.exists ++ (fun x -> match x, dir_arg with ++ | (Directive_none f, Pdir_none) -> f (); true ++ | (Directive_string f, Pdir_string s) -> f s; true ++ | (Directive_int f, Pdir_int n) -> f n; true ++ | (Directive_ident f, Pdir_ident lid) -> f lid; true ++ | (Directive_bool f, Pdir_bool b) -> f b; true ++ | (_, _) -> false ++ ) dirs ++ || (fprintf ppf "Wrong type of argument for directive `%s'.@." dir_name; ++ false) + with Not_found -> + fprintf ppf "Unknown directive `%s'.@." dir_name; + false +@@ -343,7 +408,7 @@ + if !got_eof then (got_eof := false; 0) else begin + let prompt = + if !Clflags.noprompt then "" +- else if !first_line then "# " ++ else if !first_line then print_conf.prompt () + else if Lexer.in_comment () then "* " + else " " + in +@@ -398,7 +463,7 @@ + exception PPerror + + let loop ppf = +- fprintf ppf " Objective Caml version %s@.@." Config.version; ++ fprintf ppf "%s@.@." (print_conf.welcome ()); + initialize_toplevel_env (); + let lb = Lexing.from_function refill_lexbuf in + Location.input_name := ""; +diff -ruN ocaml-3.10.2/toplevel/toploop.mli ocaml-3.10.2-enhtop/toplevel/toploop.mli +--- ocaml-3.10.2/toplevel/toploop.mli 2004-05-15 05:59:37.000000000 -0400 ++++ ocaml-3.10.2-enhtop/toplevel/toploop.mli 2008-09-06 20:28:40.822712773 -0400 +@@ -98,6 +98,26 @@ + val print_out_phrase : + (formatter -> Outcometree.out_phrase -> unit) ref + ++(* Overwrite default Printtyp module with both type & value environment enabled *) ++module Printtyp: sig ++ open Format ++ open Types ++ open Outcometree ++ val longident: formatter -> Longident.t -> unit ++ val ident_name: Ident.t -> string ++ val path_name: Path.t -> string ++ val tree_of_path: Path.t -> out_ident ++ val tree_of_type_scheme: type_expr -> out_type ++ val tree_of_value_description: Ident.t -> value_description -> out_sig_item ++ val tree_of_type_declaration: Ident.t -> type_declaration -> rec_status -> out_sig_item ++ val tree_of_exception_declaration: Ident.t -> exception_declaration -> out_sig_item ++ val tree_of_module: Ident.t -> module_type -> rec_status -> out_sig_item ++ val tree_of_modtype_declaration: Ident.t -> modtype_declaration -> out_sig_item ++ val tree_of_class_declaration: Ident.t -> class_declaration -> rec_status -> out_sig_item ++ val tree_of_cltype_declaration: Ident.t -> cltype_declaration -> rec_status -> out_sig_item ++ val tree_of_value: Path.t -> value_description -> out_sig_item * out_value option ++end ++ + (* Hooks for external line editor *) + + val read_interactive_input : (string -> string -> int -> int * bool) ref +@@ -109,3 +129,23 @@ + (* Used by Trace module *) + + val may_trace : bool ref ++ ++(* Used by test mode *) ++ ++val type_mode: bool ref ++ ++(* Printer config *) ++ ++type print_config = { ++ mutable welcome: unit -> string; ++ mutable prompt: unit -> string; ++ mutable print_value: bool; ++ mutable print_type: bool; ++ mutable print_exception: bool; ++ mutable print_module: bool; ++ mutable print_modtype: bool; ++ mutable print_class: bool; ++ mutable print_cltype: bool; ++} ++ ++val print_conf : print_config diff -Naur ocaml-3.11.0/ocaml-3.10.2-02-enhtop+.diff ocaml-3.11.0-enhtop+/ocaml-3.10.2-02-enhtop+.diff --- ocaml-3.11.0/ocaml-3.10.2-02-enhtop+.diff 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/ocaml-3.10.2-02-enhtop+.diff 2009-03-24 10:55:08.055441270 -0400 @@ -0,0 +1,419 @@ +diff -ruN ocaml-3.10.2-enhtop/toplevel/topdirext.ml ocaml-3.10.2-enhtop+/toplevel/topdirext.ml +--- ocaml-3.10.2-enhtop/toplevel/topdirext.ml 2008-09-06 20:28:40.822712773 -0400 ++++ ocaml-3.10.2-enhtop+/toplevel/topdirext.ml 2008-09-06 19:48:50.952764443 -0400 +@@ -182,6 +182,37 @@ + let dir_tell ppf s = tell ppf !toplevel_env s + + ++(* Added by Peng for completion ++ ++ tellall - a version of tell that returns all identifies that match ++ partially. Useful for completion ++*) ++let tellall ppf env s = ++ let gen_fun lookup print = fun lid -> ++ try List.iter print (lookup lid env); true ++ with Not_found -> false in ++ let rec lookup_print lid = List.fold_left ++ (fun b f -> (f lid) || b) false ++ [ gen_fun Env.lookup_values (fun (p,d) -> print_value ppf p d); ++ gen_fun Env.lookup_types (fun (p,d) -> print_type ppf p d); ++ gen_fun Env.lookup_modules (fun (p,d) -> print_module ppf p d); ++ gen_fun Env.lookup_modtypes (fun (p,d) -> print_modtype ppf p d); ++ gen_fun Env.lookup_classes (fun (p,d) -> print_class ppf p d); ++ gen_fun Env.lookup_cltypes (fun (p,d) -> print_cltype ppf p d) ++ ] in ++ let rec try_lookup lid = ++ match lookup_print lid, lid with ++ | true, _ | _, Longident.Lident _ -> () ++ | _ , Longident.Ldot (lid', _) -> try_lookup lid' ++ | _ , Longident.Lapply (_, _) -> Misc.fatal_error "tell" ++ in ++ try_lookup (Longident.parse s) ++ ++let dir_tellall ppf s = tellall ppf !toplevel_env s ++(* End *) ++ ++ ++ + (* Type mode *) + let type_mode_sw = + let toplevel_env_bak = ref (!toplevel_env) in +diff -ruN ocaml-3.10.2-enhtop/toplevel/topdirext.mli ocaml-3.10.2-enhtop+/toplevel/topdirext.mli +--- ocaml-3.10.2-enhtop/toplevel/topdirext.mli 2008-09-06 20:28:40.822712773 -0400 ++++ ocaml-3.10.2-enhtop+/toplevel/topdirext.mli 2008-09-06 20:12:18.402763748 -0400 +@@ -4,6 +4,7 @@ + val dir_show : Format.formatter -> string -> unit + val dir_show_show: Format.formatter -> unit -> unit + val dir_tell : Format.formatter -> string -> unit ++val dir_tellall : Format.formatter -> string -> unit + val dir_typemode: Format.formatter -> bool -> unit + val dir_typemode_show : Format.formatter -> unit -> unit + val dir_modu_show: Format.formatter -> unit -> unit +diff -ruN ocaml-3.10.2-enhtop/toplevel/topdirs.ml ocaml-3.10.2-enhtop+/toplevel/topdirs.ml +--- ocaml-3.10.2-enhtop/toplevel/topdirs.ml 2008-09-06 20:28:40.822712773 -0400 ++++ ocaml-3.10.2-enhtop+/toplevel/topdirs.ml 2008-09-06 20:08:48.432746846 -0400 +@@ -315,6 +315,7 @@ + Hashtbl.add directive_table "show" (Directive_string (dir_show std_out)); + Hashtbl.add directive_table "show" (Directive_none (dir_show_show std_out)); + Hashtbl.add directive_table "tell" (Directive_string (dir_tell std_out)); ++ Hashtbl.add directive_table "tellall" (Directive_string (dir_tellall std_out)); + Hashtbl.add directive_table "typemode" (Directive_bool (dir_typemode std_out)); + Hashtbl.add directive_table "typemode" (Directive_none (dir_typemode_show std_out)); + Hashtbl.add directive_table "modu" (Directive_none (dir_modu_show std_out)); +diff -ruN ocaml-3.10.2-enhtop/typing/env.ml ocaml-3.10.2-enhtop+/typing/env.ml +--- ocaml-3.10.2-enhtop/typing/env.ml 2006-10-13 08:56:28.000000000 -0400 ++++ ocaml-3.10.2-enhtop+/typing/env.ml 2008-09-06 20:00:52.092765139 -0400 +@@ -188,6 +188,47 @@ + close_in ic; + raise(Error(Corrupted_interface(filename))) + ++ ++(* Added by Peng for completion *) ++let find_pers_struct_with_partialname = ++ let forcedall = ref false in ++ (fun name -> ++ (* completion requires that we load all the interface files. *) ++ if not !forcedall then begin ++ let _ = List.map ++ (fun (modname, path) -> (modname, read_pers_struct modname path)) ++ (find_in_path_uncap_partials !load_path "") ++ in ++ forcedall := true ++ end; ++ ++ (* Now that that's out of the way, let's make our string and do completion *) ++ let lastindx = (String.length name) - 1 in ++ let left = if(lastindx >= 0) then name else (String.make 4 (Char.chr 0)) in ++ let right = ++ if(lastindx >= 0) then ++ let temp = (String.copy name) in ++ let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in ++ (String.set temp lastindx nextchar); ++ temp ++ else ++ String.make 4 (Char.chr 255) in ++ let ispartialmatch astring = ++ let cl = compare left astring in ++ let rl = compare right astring in ++ cl != rl & rl != 0 ++ in ++ Hashtbl.fold ++ (fun akey aval acc -> ++ if ispartialmatch akey then ++ ((akey,aval)::acc) ++ else ++ acc) ++ persistent_structures ++ []) ++(* End *) ++ ++ + let find_pers_struct name = + try + Hashtbl.find persistent_structures name +@@ -401,6 +442,82 @@ + and lookup_cltype = + lookup (fun env -> env.cltypes) (fun sc -> sc.comp_cltypes) + ++ ++ ++(* Peng added this for #tell completion *) ++let lookup_modules lid env = ++ match lid with ++ Lident s -> ++ (* from stuff already loaded *) ++ let results_loaded = Ident.find_partial_names s env.modules in ++ let results_notloaded = (* add stuff not loaded *) ++ (List.map (fun (modname, ps) -> ++ (Pident(Ident.create_persistent modname), ++ Tmty_signature ps.ps_sig)) ++ (find_pers_struct_with_partialname s)) ++ in (* merge them *) ++ List.fold_left ++ (fun acc ele -> ++ if (List.exists (fun x -> x = ele) acc) then ++ acc ++ else ++ ele::acc) ++ results_loaded ++ results_notloaded ++ | Ldot(l, s) -> ++ (try let (p, descr) = lookup_module_descr l env in ++ match Lazy.force descr with ++ | Structure_comps c -> ++ List.map ++ (fun (fullname, (data,pos)) -> ++ (Pdot(p, fullname, pos), Lazy.force data)) ++ (Tbl.find_partial s c.comp_modules) ++ | Functor_comps f -> [] ++ with Not_found -> []) ++ | Lapply(l1, l2) -> ++ (* This should never happen as the longident (lid) comes from ++ Longident.parse which never constructs Lapply *) ++ [] ++ ++let lookupN proj1 proj2 lid env = ++ try ++ match lid with ++ Lident s -> ++ Ident.find_partial_names s (proj1 env) ++ | Ldot(l, s) -> ++ let (p, desc) = lookup_module_descr l env in ++ begin match Lazy.force desc with ++ Structure_comps c -> ++ List.map (fun (fullname, (data,pos)) -> ++ Pdot(p, fullname, pos), data) ++ (Tbl.find_partial s (proj2 c)) ++ | Functor_comps f -> ++ [] ++ end ++ | Lapply(l1, l2) -> ++ [] ++ with Not_found -> [] ++ ++ ++ ++let lookup_values = ++ lookupN (fun env -> env.values) (fun sc -> sc.comp_values) ++and lookup_types = ++ lookupN (fun env -> env.types) (fun sc -> sc.comp_types) ++and lookup_modtypes = ++ lookupN (fun env -> env.modtypes) (fun sc -> sc.comp_modtypes) ++and lookup_classes = ++ lookupN (fun env -> env.classes) (fun sc -> sc.comp_classes) ++and lookup_cltypes = ++ lookupN (fun env -> env.cltypes) (fun sc -> sc.comp_cltypes) ++ ++(* End *) ++ ++ ++ ++ ++ ++ + (* Expand manifest module type names at the top of the given module type *) + + let rec scrape_modtype mty env = +diff -ruN ocaml-3.10.2-enhtop/typing/env.mli ocaml-3.10.2-enhtop+/typing/env.mli +--- ocaml-3.10.2-enhtop/typing/env.mli 2006-06-26 05:38:06.000000000 -0400 ++++ ocaml-3.10.2-enhtop+/typing/env.mli 2008-09-06 19:51:41.862765880 -0400 +@@ -45,6 +45,16 @@ + val lookup_class: Longident.t -> t -> Path.t * class_declaration + val lookup_cltype: Longident.t -> t -> Path.t * cltype_declaration + ++(* Peng added this for #tell completion *) ++val lookup_values: Longident.t -> t -> (Path.t * value_description) list ++val lookup_types: Longident.t -> t -> (Path.t * type_declaration) list ++val lookup_modtypes: Longident.t -> t -> (Path.t * modtype_declaration) list ++val lookup_classes: Longident.t -> t -> (Path.t * class_declaration) list ++val lookup_cltypes: Longident.t -> t -> (Path.t * cltype_declaration) list ++val lookup_modules: Longident.t -> t -> (Path.t * module_type) list ++(* End *) ++ ++ + (* Insertion by identifier *) + + val add_value: Ident.t -> value_description -> t -> t +diff -ruN ocaml-3.10.2-enhtop/typing/ident.ml ocaml-3.10.2-enhtop+/typing/ident.ml +--- ocaml-3.10.2-enhtop/typing/ident.ml 2004-01-04 09:32:34.000000000 -0500 ++++ ocaml-3.10.2-enhtop+/typing/ident.ml 2008-09-06 19:52:46.902765841 -0400 +@@ -172,6 +172,38 @@ + else + find_name name (if c < 0 then l else r) + ++ ++(* Peng added for #tell completion *) ++let find_partial_names name atbl = ++ let rec aux left right atbl acc = ++ match atbl with ++ Empty -> acc ++ | Node(l, k, r, _) -> ++ let cl = compare left k.ident.name in ++ let rl = compare right k.ident.name in ++ if cl != rl then ++ let acc = if rl = 0 then acc else (k.data::acc) in ++ aux left right r (aux left right l acc) ++ else ++ aux left right (if cl < 0 then l else r) acc ++ in ++ let lastindx = (String.length name) - 1 in ++ let left = if(lastindx >= 0) then name else (String.make 4 (Char.chr 0)) in ++ let right = ++ if(lastindx >= 0) then ++ let temp = (String.copy name) in ++ let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in ++ (String.set temp lastindx nextchar); ++ temp ++ else ++ String.make 4 (Char.chr 255) in ++ aux left right atbl [] ++(* End *) ++ ++ ++ ++ ++ + let rec keys_aux stack accu = function + Empty -> + begin match stack with +diff -ruN ocaml-3.10.2-enhtop/typing/ident.mli ocaml-3.10.2-enhtop+/typing/ident.mli +--- ocaml-3.10.2-enhtop/typing/ident.mli 2004-01-04 09:32:34.000000000 -0500 ++++ ocaml-3.10.2-enhtop+/typing/ident.mli 2008-09-06 19:53:32.002765459 -0400 +@@ -56,4 +56,9 @@ + val add: t -> 'a -> 'a tbl -> 'a tbl + val find_same: t -> 'a tbl -> 'a + val find_name: string -> 'a tbl -> 'a ++ ++(* Peng added fro #tell completion *) ++val find_partial_names: string -> 'a tbl -> 'a list ++(* End *) ++ + val keys: 'a tbl -> t list +diff -ruN ocaml-3.10.2-enhtop/utils/misc.ml ocaml-3.10.2-enhtop+/utils/misc.ml +--- ocaml-3.10.2-enhtop/utils/misc.ml 2007-02-23 08:44:51.000000000 -0500 ++++ ocaml-3.10.2-enhtop+/utils/misc.ml 2008-09-06 19:54:25.592766364 -0400 +@@ -103,6 +103,70 @@ + else try_dir rem + in try_dir path + ++ ++(* Added by Peng for completion *) ++let find_in_path_uncap_partials path name = ++ (* define a bracket for determining partial matches. If a string is ++ between [left,right) then it is a partial match *) ++ let lastindx = (String.length name) - 1 in ++ let left, uleft = ++ if(lastindx >= 0) then ++ name, String.uncapitalize name ++ else ++ let temp = (String.make 4 (Char.chr 0)) in ++ temp, temp in ++ let right, uright = ++ if(lastindx >= 0) then ++ let temp = (String.copy name) in ++ let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in ++ (String.set temp lastindx nextchar); ++ temp, String.uncapitalize temp ++ else ++ let temp = String.make 4 (Char.chr 255) in ++ temp, temp in ++ ++ (* some auxiliary functions. This one is for determining if string ++ is a match *) ++ let ispartialmatch astring = ++ let cl = compare uleft astring in ++ let rl = compare uright astring in ++ if cl != rl & rl != 0 then ++ true ++ else ++ let cl = compare left astring in ++ let rl = compare right astring in ++ cl != rl & rl != 0 ++ in ++ ++ let iscmi astring = ++ try ++ compare ".cmi" (String.sub astring ((String.length astring) - 4) 4) = 0 ++ with Invalid_argument _ -> false ++ in ++ ++ (* Now we do actual work, going through the path and looking for all ++ matches *) ++ List.fold_left ++ (fun acc dir -> ++ try ++ let files = Sys.readdir dir in ++ Array.fold_left ++ (fun acc ele -> ++ if (iscmi ele) & (ispartialmatch ele) then ++ let modname = String.sub ele 0 ((String.length ele) - 4) in ++ let _ = modname.[0] <- Char.uppercase modname.[0] in ++ (modname, Filename.concat dir ele)::acc ++ else ++ acc) ++ acc ++ files ++ with Sys_error _ -> acc) ++ [] ++ path ++(* End *) ++ ++ ++ + let remove_file filename = + try + Sys.remove filename +diff -ruN ocaml-3.10.2-enhtop/utils/misc.mli ocaml-3.10.2-enhtop+/utils/misc.mli +--- ocaml-3.10.2-enhtop/utils/misc.mli 2007-02-23 08:44:51.000000000 -0500 ++++ ocaml-3.10.2-enhtop+/utils/misc.mli 2008-09-06 19:55:08.982762961 -0400 +@@ -48,8 +48,15 @@ + (* Same, but search also for uncapitalized name, i.e. + if name is Foo.ml, allow /path/Foo.ml and /path/foo.ml + to match. *) ++ ++val find_in_path_uncap_partials: string list -> string -> (string * string) list ++ (* Same, but also does partial matching, eg. "Lis" matches ++ "List" and might return [("List", "/somepath/list.cmi")] *) ++ + val remove_file: string -> unit + (* Delete the given file if it exists. Never raise an error. *) ++ ++ + val expand_directory: string -> string -> string + (* [expand_directory alt file] eventually expands a [+] at the + beginning of file into [alt] (an alternate root directory) *) +diff -ruN ocaml-3.10.2-enhtop/utils/tbl.ml ocaml-3.10.2-enhtop+/utils/tbl.ml +--- ocaml-3.10.2-enhtop/utils/tbl.ml 2004-11-25 08:28:27.000000000 -0500 ++++ ocaml-3.10.2-enhtop+/utils/tbl.ml 2008-09-06 19:55:57.082765785 -0400 +@@ -65,6 +65,35 @@ + if c = 0 then d + else find x (if c < 0 then l else r) + ++(* Peng added for #tell completion *) ++let rec find_partial name atbl = ++ let rec aux left right atbl acc = ++ match atbl with ++ Empty -> acc ++ | Node(l, v, d, r, _) -> ++ let cl = compare left v in ++ let rl = compare right v in ++ if cl != rl then ++ let acc = if rl = 0 then acc else ((v,d)::acc) in ++ aux left right r (aux left right l acc) ++ else ++ aux left right (if cl < 0 then l else r) acc ++ in ++ let lastindx = (String.length name) - 1 in ++ let left = if(lastindx >= 0) then name else (String.make 4 (Char.chr 0)) in ++ let right = ++ if(lastindx >= 0) then ++ let temp = (String.copy name) in ++ let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in ++ (String.set temp lastindx nextchar); ++ temp ++ else ++ String.make 4 (Char.chr 255) ++ in ++ aux left right atbl [] ++(* End *) ++ ++ + let rec mem x = function + Empty -> false + | Node(l, v, d, r, _) -> +diff -ruN ocaml-3.10.2-enhtop/utils/tbl.mli ocaml-3.10.2-enhtop+/utils/tbl.mli +--- ocaml-3.10.2-enhtop/utils/tbl.mli 2000-04-21 04:13:22.000000000 -0400 ++++ ocaml-3.10.2-enhtop+/utils/tbl.mli 2008-09-06 19:56:26.172765451 -0400 +@@ -20,6 +20,11 @@ + val empty: ('a, 'b) t + val add: 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t + val find: 'a -> ('a, 'b) t -> 'b ++ ++(* Peng added fro #tell completion *) ++val find_partial: string -> (string, 'a) t -> (string * 'a) list ++(* End *) ++ + val mem: 'a -> ('a, 'b) t -> bool + val remove: 'a -> ('a, 'b) t -> ('a, 'b) t + val iter: ('a -> 'b -> 'c) -> ('a, 'b) t -> unit diff -Naur ocaml-3.11.0/toplevel/genprinttyp.ml ocaml-3.11.0-enhtop+/toplevel/genprinttyp.ml --- ocaml-3.11.0/toplevel/genprinttyp.ml 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/genprinttyp.ml 2009-03-24 10:55:18.575450947 -0400 @@ -0,0 +1,1055 @@ +(***********************************************************************) +(* *) +(* Objective Caml *) +(* *) +(* Xavier Leroy and Jerome Vouillon, projet Cristal, INRIA Rocquencourt*) +(* *) +(* Copyright 1996 Institut National de Recherche en Informatique et *) +(* en Automatique. All rights reserved. This file is distributed *) +(* under the terms of the Q Public License version 1.0. *) +(* *) +(***********************************************************************) + +(* $Id: printtyp.ml,v 1.143 2007/02/16 11:18:54 garrigue Exp $ *) + + +module type ENV = sig val env: Env.t ref end + +module Make = functor (Environ : ENV) -> +struct + +(* Printing functions *) + +open Misc +open Ctype +open Format +open Longident +open Path +open Asttypes +open Types +open Btype +open Outcometree + +let topenv = Environ.env + +let is_rebound id = + let test_reb find_fun lookup_fun = fun id -> + try + ignore (find_fun (Path.Pident id) !topenv); + let p, _ = lookup_fun (Longident.Lident (Ident.name id)) !topenv in + not (Ident.same id (Path.head p)) + with Not_found -> false in + List.exists + (fun test_fun -> test_fun id) + [(test_reb Env.find_value Env.lookup_value); + (test_reb Env.find_type Env.lookup_type); + (test_reb Env.find_module Env.lookup_module); + (test_reb Env.find_modtype Env.lookup_modtype); + (test_reb Env.find_class Env.lookup_class); + (test_reb Env.find_cltype Env.lookup_cltype)] + +let ident_name id = + let name = Ident.name id in + if is_rebound id then + match Ident.binding_time id with + | 0 -> sprintf "%s!" name + | -1 -> sprintf "%s#" name + | n -> sprintf "%s/%i%s" name n (if Ident.global id then "g" else "") + else name + +(* Print a long identifier *) + +let rec longident ppf = function + | Lident s -> fprintf ppf "%s" s + | Ldot(p, s) -> fprintf ppf "%a.%s" longident p s + | Lapply(p1, p2) -> fprintf ppf "%a(%a)" longident p1 longident p2 + +(* Print an identifier *) + +let ident ppf id = fprintf ppf "%s" (ident_name id) + +(* Print a path *) + +let ident_pervasive = Ident.create_persistent "Pervasives" + +let rec tree_of_path = function + | Pident id -> + Oide_ident (ident_name id) + | Pdot(Pident id, s, pos) when Ident.same id ident_pervasive -> + Oide_ident s + | Pdot(p, s, pos) -> + Oide_dot (tree_of_path p, s) + | Papply(p1, p2) -> + Oide_apply (tree_of_path p1, tree_of_path p2) + +let rec path ppf = function + | Pident id -> + ident ppf id + | Pdot(Pident id, s, pos) when Ident.same id ident_pervasive -> + fprintf ppf "%s" s + | Pdot(p, s, pos) -> + fprintf ppf "%a.%s" path p s + | Papply(p1, p2) -> + fprintf ppf "%a(%a)" path p1 path p2 + +let rec path_name = function + | Pident id -> ident_name id + | Pdot (Pident id, s, pos) when Ident.same id ident_pervasive -> s + | Pdot (p, s, pos) -> (path_name p)^"."^s + | Papply(p1, p2) -> (path_name p1)^"("^(path_name p2)^")" + + +(* Print a recursive annotation *) + +let tree_of_rec = function + | Trec_not -> Orec_not + | Trec_first -> Orec_first + | Trec_next -> Orec_next + +(* Print a raw type expression, with sharing *) + +let raw_list pr ppf = function + [] -> fprintf ppf "[]" + | a :: l -> + fprintf ppf "@[<1>[%a%t]@]" pr a + (fun ppf -> List.iter (fun x -> fprintf ppf ";@,%a" pr x) l) + +let rec safe_kind_repr v = function + Fvar {contents=Some k} -> + if List.memq k v then "Fvar loop" else + safe_kind_repr (k::v) k + | Fvar _ -> "Fvar None" + | Fpresent -> "Fpresent" + | Fabsent -> "Fabsent" + +let rec safe_commu_repr v = function + Cok -> "Cok" + | Cunknown -> "Cunknown" + | Clink r -> + if List.memq r v then "Clink loop" else + safe_commu_repr (r::v) !r + +let rec safe_repr v = function + {desc = Tlink t} when not (List.memq t v) -> + safe_repr (t::v) t + | t -> t + +let rec list_of_memo = function + Mnil -> [] + | Mcons (priv, p, t1, t2, rem) -> p :: list_of_memo rem + | Mlink rem -> list_of_memo !rem + +let visited = ref [] +let rec raw_type ppf ty = + let ty = safe_repr [] ty in + if List.memq ty !visited then fprintf ppf "{id=%d}" ty.id else begin + visited := ty :: !visited; + fprintf ppf "@[<1>{id=%d;level=%d;desc=@,%a}@]" ty.id ty.level + raw_type_desc ty.desc + end +and raw_type_list tl = raw_list raw_type tl +and raw_type_desc ppf = function + Tvar -> fprintf ppf "Tvar" + | Tarrow(l,t1,t2,c) -> + fprintf ppf "@[Tarrow(%s,@,%a,@,%a,@,%s)@]" + l raw_type t1 raw_type t2 + (safe_commu_repr [] c) + | Ttuple tl -> + fprintf ppf "@[<1>Ttuple@,%a@]" raw_type_list tl + | Tconstr (p, tl, abbrev) -> + fprintf ppf "@[Tconstr(@,%a,@,%a,@,%a)@]" path p + raw_type_list tl + (raw_list path) (list_of_memo !abbrev) + | Tobject (t, nm) -> + fprintf ppf "@[Tobject(@,%a,@,@[<1>ref%t@])@]" raw_type t + (fun ppf -> + match !nm with None -> fprintf ppf " None" + | Some(p,tl) -> + fprintf ppf "(Some(@,%a,@,%a))" path p raw_type_list tl) + | Tfield (f, k, t1, t2) -> + fprintf ppf "@[Tfield(@,%s,@,%s,@,%a,@;<0 -1>%a)@]" f + (safe_kind_repr [] k) + raw_type t1 raw_type t2 + | Tnil -> fprintf ppf "Tnil" + | Tlink t -> fprintf ppf "@[<1>Tlink@,%a@]" raw_type t + | Tsubst t -> fprintf ppf "@[<1>Tsubst@,%a@]" raw_type t + | Tunivar -> fprintf ppf "Tunivar" + | Tpoly (t, tl) -> + fprintf ppf "@[Tpoly(@,%a,@,%a)@]" + raw_type t + raw_type_list tl + | Tvariant row -> + fprintf ppf + "@[{@[%s@,%a;@]@ @[%s@,%a;@]@ %s%b;@ %s%b;@ @[<1>%s%t@]}@]" + "row_fields=" + (raw_list (fun ppf (l, f) -> + fprintf ppf "@[%s,@ %a@]" l raw_field f)) + row.row_fields + "row_more=" raw_type row.row_more + "row_closed=" row.row_closed + "row_fixed=" row.row_fixed + "row_name=" + (fun ppf -> + match row.row_name with None -> fprintf ppf "None" + | Some(p,tl) -> + fprintf ppf "Some(@,%a,@,%a)" path p raw_type_list tl) + +and raw_field ppf = function + Rpresent None -> fprintf ppf "Rpresent None" + | Rpresent (Some t) -> fprintf ppf "@[<1>Rpresent(Some@,%a)@]" raw_type t + | Reither (c,tl,m,e) -> + fprintf ppf "@[Reither(%b,@,%a,@,%b,@,@[<1>ref%t@])@]" c + raw_type_list tl m + (fun ppf -> + match !e with None -> fprintf ppf " None" + | Some f -> fprintf ppf "@,@[<1>(%a)@]" raw_field f) + | Rabsent -> fprintf ppf "Rabsent" + +let raw_type_expr ppf t = + visited := []; + raw_type ppf t; + visited := [] + +(* Print a type expression *) + +let names = ref ([] : (type_expr * string) list) +let name_counter = ref 0 + +let reset_names () = names := []; name_counter := 0 + +let new_name () = + let name = + if !name_counter < 26 + then String.make 1 (Char.chr(97 + !name_counter)) + else String.make 1 (Char.chr(97 + !name_counter mod 26)) ^ + string_of_int(!name_counter / 26) in + incr name_counter; + name + +let name_of_type t = + try List.assq t !names with Not_found -> + let name = new_name () in + names := (t, name) :: !names; + name + +let check_name_of_type t = ignore(name_of_type t) + +let non_gen_mark sch ty = + if sch && ty.desc = Tvar && ty.level <> generic_level then "_" else "" + +let print_name_of_type sch ppf t = + fprintf ppf "'%s%s" (non_gen_mark sch t) (name_of_type t) + +let visited_objects = ref ([] : type_expr list) +let aliased = ref ([] : type_expr list) +let delayed = ref ([] : type_expr list) + +let add_delayed t = + if not (List.memq t !delayed) then delayed := t :: !delayed + +let is_aliased ty = List.memq (proxy ty) !aliased +let add_alias ty = + let px = proxy ty in + if not (is_aliased px) then aliased := px :: !aliased +let aliasable ty = + match ty.desc with Tvar | Tunivar | Tpoly _ -> false | _ -> true + +let namable_row row = + row.row_name <> None && + List.for_all + (fun (_, f) -> + match row_field_repr f with + | Reither(c, l, _, _) -> + row.row_closed && if c then l = [] else List.length l = 1 + | _ -> true) + row.row_fields + +let rec mark_loops_rec visited ty = + let ty = repr ty in + let px = proxy ty in + if List.memq px visited && aliasable ty then add_alias px else + let visited = px :: visited in + match ty.desc with + | Tvar -> () + | Tarrow(_, ty1, ty2, _) -> + mark_loops_rec visited ty1; mark_loops_rec visited ty2 + | Ttuple tyl -> List.iter (mark_loops_rec visited) tyl + | Tconstr(_, tyl, _) -> + List.iter (mark_loops_rec visited) tyl + | Tvariant row -> + if List.memq px !visited_objects then add_alias px else + begin + let row = row_repr row in + if not (static_row row) then + visited_objects := px :: !visited_objects; + match row.row_name with + | Some(p, tyl) when namable_row row -> + List.iter (mark_loops_rec visited) tyl + | _ -> + iter_row (mark_loops_rec visited) {row with row_bound = ()} + end + | Tobject (fi, nm) -> + if List.memq px !visited_objects then add_alias px else + begin + if opened_object ty then + visited_objects := px :: !visited_objects; + begin match !nm with + | None -> + let fields, _ = flatten_fields fi in + List.iter + (fun (_, kind, ty) -> + if field_kind_repr kind = Fpresent then + mark_loops_rec visited ty) + fields + | Some (_, l) -> + List.iter (mark_loops_rec visited) (List.tl l) + end + end + | Tfield(_, kind, ty1, ty2) when field_kind_repr kind = Fpresent -> + mark_loops_rec visited ty1; mark_loops_rec visited ty2 + | Tfield(_, _, _, ty2) -> + mark_loops_rec visited ty2 + | Tnil -> () + | Tsubst ty -> mark_loops_rec visited ty + | Tlink _ -> fatal_error "Printtyp.mark_loops_rec (2)" + | Tpoly (ty, tyl) -> + List.iter (fun t -> add_alias t) tyl; + mark_loops_rec visited ty + | Tunivar -> () + +let mark_loops ty = + normalize_type Env.empty ty; + mark_loops_rec [] ty;; + +let reset_loop_marks () = + visited_objects := []; aliased := []; delayed := [] + +let reset () = + reset_names (); reset_loop_marks () + +let reset_and_mark_loops ty = + reset (); mark_loops ty + +let reset_and_mark_loops_list tyl = + reset (); List.iter mark_loops tyl + +(* Disabled in classic mode when printing an unification error *) +let print_labels = ref true +let print_label ppf l = + if !print_labels && l <> "" || is_optional l then fprintf ppf "%s:" l + +let rec tree_of_typexp sch ty = + let ty = repr ty in + let px = proxy ty in + if List.mem_assq px !names && not (List.memq px !delayed) then + let mark = is_non_gen sch ty in + Otyp_var (mark, name_of_type px) else + + let pr_typ () = + match ty.desc with + | Tvar -> + Otyp_var (is_non_gen sch ty, name_of_type ty) + | Tarrow(l, ty1, ty2, _) -> + let pr_arrow l ty1 ty2 = + let lab = + if !print_labels && l <> "" || is_optional l then l else "" + in + let t1 = + if is_optional l then + match (repr ty1).desc with + | Tconstr(path, [ty], _) + when Path.same path Predef.path_option -> + tree_of_typexp sch ty + | _ -> Otyp_stuff "" + else tree_of_typexp sch ty1 in + Otyp_arrow (lab, t1, tree_of_typexp sch ty2) in + pr_arrow l ty1 ty2 + | Ttuple tyl -> + Otyp_tuple (tree_of_typlist sch tyl) + | Tconstr(p, tyl, abbrev) -> + Otyp_constr (tree_of_path p, tree_of_typlist sch tyl) + | Tvariant row -> + let row = row_repr row in + let fields = + if row.row_closed then + List.filter (fun (_, f) -> row_field_repr f <> Rabsent) + row.row_fields + else row.row_fields in + let present = + List.filter + (fun (_, f) -> + match row_field_repr f with + | Rpresent _ -> true + | _ -> false) + fields in + let all_present = List.length present = List.length fields in + begin match row.row_name with + | Some(p, tyl) when namable_row row -> + let id = tree_of_path p in + let args = tree_of_typlist sch tyl in + if row.row_closed && all_present then + Otyp_constr (id, args) + else + let non_gen = is_non_gen sch px in + let tags = + if all_present then None else Some (List.map fst present) in + Otyp_variant (non_gen, Ovar_name(tree_of_path p, args), + row.row_closed, tags) + | _ -> + let non_gen = + not (row.row_closed && all_present) && is_non_gen sch px in + let fields = List.map (tree_of_row_field sch) fields in + let tags = + if all_present then None else Some (List.map fst present) in + Otyp_variant (non_gen, Ovar_fields fields, row.row_closed, tags) + end + | Tobject (fi, nm) -> + tree_of_typobject sch fi nm + | Tsubst ty -> + tree_of_typexp sch ty + | Tlink _ | Tnil | Tfield _ -> + fatal_error "Printtyp.tree_of_typexp" + | Tpoly (ty, []) -> + tree_of_typexp sch ty + | Tpoly (ty, tyl) -> + let tyl = List.map repr tyl in + (* let tyl = List.filter is_aliased tyl in *) + if tyl = [] then tree_of_typexp sch ty else begin + let old_delayed = !delayed in + List.iter add_delayed tyl; + let tl = List.map name_of_type tyl in + let tr = Otyp_poly (tl, tree_of_typexp sch ty) in + delayed := old_delayed; tr + end + | Tunivar -> + Otyp_var (false, name_of_type ty) + in + if List.memq px !delayed then delayed := List.filter ((!=) px) !delayed; + if is_aliased px && aliasable ty then begin + check_name_of_type px; + Otyp_alias (pr_typ (), name_of_type px) end + else pr_typ () + +and tree_of_row_field sch (l, f) = + match row_field_repr f with + | Rpresent None | Reither(true, [], _, _) -> (l, false, []) + | Rpresent(Some ty) -> (l, false, [tree_of_typexp sch ty]) + | Reither(c, tyl, _, _) -> + if c (* contradiction: un constructeur constant qui a un argument *) + then (l, true, tree_of_typlist sch tyl) + else (l, false, tree_of_typlist sch tyl) + | Rabsent -> (l, false, [] (* une erreur, en fait *)) + +and tree_of_typlist sch tyl = + List.map (tree_of_typexp sch) tyl + +and tree_of_typobject sch fi nm = + begin match !nm with + | None -> + let pr_fields fi = + let (fields, rest) = flatten_fields fi in + let present_fields = + List.fold_right + (fun (n, k, t) l -> + match field_kind_repr k with + | Fpresent -> (n, t) :: l + | _ -> l) + fields [] in + let sorted_fields = + Sort.list (fun (n, _) (n', _) -> n <= n') present_fields in + tree_of_typfields sch rest sorted_fields in + let (fields, rest) = pr_fields fi in + Otyp_object (fields, rest) + | Some (p, ty :: tyl) -> + let non_gen = is_non_gen sch (repr ty) in + let args = tree_of_typlist sch tyl in + Otyp_class (non_gen, tree_of_path p, args) + | _ -> + fatal_error "Printtyp.tree_of_typobject" + end + +and is_non_gen sch ty = + sch && ty.desc = Tvar && ty.level <> generic_level + +and tree_of_typfields sch rest = function + | [] -> + let rest = + match rest.desc with + | Tvar | Tunivar -> Some (is_non_gen sch rest) + | Tconstr _ -> Some false + | Tnil -> None + | _ -> fatal_error "typfields (1)" + in + ([], rest) + | (s, t) :: l -> + let field = (s, tree_of_typexp sch t) in + let (fields, rest) = tree_of_typfields sch rest l in + (field :: fields, rest) + +let typexp sch prio ppf ty = + !Oprint.out_type ppf (tree_of_typexp sch ty) + +let type_expr ppf ty = typexp false 0 ppf ty + +and type_sch ppf ty = typexp true 0 ppf ty + +and type_scheme ppf ty = reset_and_mark_loops ty; typexp true 0 ppf ty + +(* Maxence *) +let type_scheme_max ?(b_reset_names=true) ppf ty = + if b_reset_names then reset_names () ; + typexp true 0 ppf ty +(* Fin Maxence *) + +let tree_of_type_scheme ty = reset_and_mark_loops ty; tree_of_typexp true ty + +(* Print one type declaration *) + +let tree_of_constraints params = + List.fold_right + (fun ty list -> + let ty' = unalias ty in + if proxy ty != proxy ty' then + let tr = tree_of_typexp true ty in + (tr, tree_of_typexp true ty') :: list + else list) + params [] + +let filter_params tyl = + let params = + List.fold_left + (fun tyl ty -> + let ty = repr ty in + if List.memq ty tyl then Btype.newgenty (Tsubst ty) :: tyl + else ty :: tyl) + [] tyl + in List.rev params + +let string_of_mutable = function + | Immutable -> "" + | Mutable -> "mutable " + +let rec tree_of_type_decl id decl = + + reset(); + + let params = filter_params decl.type_params in + + List.iter add_alias params; + List.iter mark_loops params; + List.iter check_name_of_type (List.map proxy params); + let ty_manifest = + match decl.type_manifest with + | None -> None + | Some ty -> + let ty = + (* Special hack to hide variant name *) + match repr ty with {desc=Tvariant row} -> + let row = row_repr row in + begin match row.row_name with + Some (Pident id', _) when Ident.same id id' -> + newgenty (Tvariant {row with row_name = None}) + | _ -> ty + end + | _ -> ty + in + mark_loops ty; + Some ty + in + begin match decl.type_kind with + | Type_abstract -> () + | Type_variant [] -> () + | Type_variant cstrs -> + List.iter (fun (_, args) -> List.iter mark_loops args) cstrs + | Type_record(l, rep) -> + List.iter (fun (_, _, ty) -> mark_loops ty) l + end; + + let type_param = + function + | Otyp_var (_, id) -> id + | _ -> "?" + in + let type_defined decl = + let abstr = + match decl.type_kind with + Type_abstract -> + begin match decl.type_manifest with + None -> true + | Some ty -> has_constr_row ty + end + | Type_variant _ | Type_record(_,_) -> + decl.type_private = Private + in + let vari = + List.map2 + (fun ty (co,cn,ct) -> + if abstr || (repr ty).desc <> Tvar then (co,cn) else (true,true)) + decl.type_params decl.type_variance + in + (ident_name id, + List.map2 (fun ty cocn -> type_param (tree_of_typexp false ty), cocn) + params vari) + in + let tree_of_manifest ty1 = + match ty_manifest with + | None -> ty1 + | Some ty -> Otyp_manifest (tree_of_typexp false ty, ty1) + in + let (name, args) = type_defined decl in + let constraints = tree_of_constraints params in + let ty, priv = + match decl.type_kind with + | Type_abstract -> + begin match ty_manifest with + | None -> (Otyp_abstract, Public) + | Some ty -> + tree_of_typexp false ty, + (if has_constr_row ty then Private else Public) + end + | Type_variant cstrs -> + tree_of_manifest (Otyp_sum (List.map tree_of_constructor cstrs)), + decl.type_private + | Type_record(lbls, rep) -> + tree_of_manifest (Otyp_record (List.map tree_of_label lbls)), + decl.type_private + in + (name, args, ty, priv, constraints) + +and tree_of_constructor (name, args) = + (name, tree_of_typlist false args) + +and tree_of_label (name, mut, arg) = + (name, mut = Mutable, tree_of_typexp false arg) + +let tree_of_type_declaration id decl rs = + Osig_type (tree_of_type_decl id decl, tree_of_rec rs) + +let type_declaration id ppf decl = + !Oprint.out_sig_item ppf (tree_of_type_declaration id decl Trec_first) + +(* Print an exception declaration *) + +let tree_of_exception_declaration id decl = + reset_and_mark_loops_list decl; + let tyl = tree_of_typlist false decl in + Osig_exception (ident_name id, tyl) + +let exception_declaration id ppf decl = + !Oprint.out_sig_item ppf (tree_of_exception_declaration id decl) + +(* Print a value declaration *) + +let tree_of_value_description id decl = + let id = ident_name id in + let ty = tree_of_type_scheme decl.val_type in + let prims = + match decl.val_kind with + | Val_prim p -> Primitive.description_list p + | _ -> [] + in + Osig_value (id, ty, prims) + +let value_description id ppf decl = + !Oprint.out_sig_item ppf (tree_of_value_description id decl) + +(* Print a class type *) + +let class_var sch ppf l (m, t) = + fprintf ppf + "@ @[<2>val %s%s :@ %a@]" (string_of_mutable m) l (typexp sch 0) t + +let method_type (_, kind, ty) = + match field_kind_repr kind, repr ty with + Fpresent, {desc=Tpoly(ty, _)} -> ty + | _ , ty -> ty + +let tree_of_metho sch concrete csil (lab, kind, ty) = + if lab <> dummy_method then begin + let kind = field_kind_repr kind in + let priv = kind <> Fpresent in + let virt = not (Concr.mem lab concrete) in + let ty = method_type (lab, kind, ty) in + Ocsg_method (lab, priv, virt, tree_of_typexp sch ty) :: csil + end + else csil + +let rec prepare_class_type params = function + | Tcty_constr (p, tyl, cty) -> + let sty = Ctype.self_type cty in + if List.memq (proxy sty) !visited_objects + || List.exists (fun ty -> (repr ty).desc <> Tvar) params + || List.exists (deep_occur sty) tyl + then prepare_class_type params cty + else List.iter mark_loops tyl + | Tcty_signature sign -> + let sty = repr sign.cty_self in + (* Self may have a name *) + let px = proxy sty in + if List.memq px !visited_objects then add_alias sty + else visited_objects := px :: !visited_objects; + let (fields, _) = + Ctype.flatten_fields (Ctype.object_fields sign.cty_self) + in + List.iter (fun met -> mark_loops (method_type met)) fields; + Vars.iter (fun _ (_, _, ty) -> mark_loops ty) sign.cty_vars + | Tcty_fun (_, ty, cty) -> + mark_loops ty; + prepare_class_type params cty + +let rec tree_of_class_type sch params = + function + | Tcty_constr (p', tyl, cty) -> + let sty = Ctype.self_type cty in + if List.memq (proxy sty) !visited_objects + || List.exists (fun ty -> (repr ty).desc <> Tvar) params + then + tree_of_class_type sch params cty + else + Octy_constr (tree_of_path p', tree_of_typlist true tyl) + | Tcty_signature sign -> + let sty = repr sign.cty_self in + let self_ty = + if is_aliased sty then + Some (Otyp_var (false, name_of_type (proxy sty))) + else None + in + let (fields, _) = + Ctype.flatten_fields (Ctype.object_fields sign.cty_self) + in + let csil = [] in + let csil = + List.fold_left + (fun csil (ty1, ty2) -> Ocsg_constraint (ty1, ty2) :: csil) + csil (tree_of_constraints params) + in + let all_vars = + Vars.fold (fun l (m, v, t) all -> (l, m, v, t) :: all) sign.cty_vars [] + in + (* Consequence of PR#3607: order of Map.fold has changed! *) + let all_vars = List.rev all_vars in + let csil = + List.fold_left + (fun csil (l, m, v, t) -> + Ocsg_value (l, m = Mutable, v = Virtual, tree_of_typexp sch t) + :: csil) + csil all_vars + in + let csil = + List.fold_left (tree_of_metho sch sign.cty_concr) csil fields + in + Octy_signature (self_ty, List.rev csil) + | Tcty_fun (l, ty, cty) -> + let lab = if !print_labels && l <> "" || is_optional l then l else "" in + let ty = + if is_optional l then + match (repr ty).desc with + | Tconstr(path, [ty], _) when Path.same path Predef.path_option -> ty + | _ -> newconstr (Path.Pident(Ident.create "")) [] + else ty in + let tr = tree_of_typexp sch ty in + Octy_fun (lab, tr, tree_of_class_type sch params cty) + +let class_type ppf cty = + reset (); + prepare_class_type [] cty; + !Oprint.out_class_type ppf (tree_of_class_type false [] cty) + +let tree_of_class_param param variance = + (match tree_of_typexp true param with + Otyp_var (_, s) -> s + | _ -> "?"), + if (repr param).desc = Tvar then (true, true) else variance + +let tree_of_class_params params = + let tyl = tree_of_typlist true params in + List.map (function Otyp_var (_, s) -> s | _ -> "?") tyl + +let tree_of_class_declaration id cl rs = + let params = filter_params cl.cty_params in + + reset (); + List.iter add_alias params; + prepare_class_type params cl.cty_type; + let sty = self_type cl.cty_type in + List.iter mark_loops params; + + List.iter check_name_of_type (List.map proxy params); + if is_aliased sty then check_name_of_type (proxy sty); + + let vir_flag = cl.cty_new = None in + Osig_class + (vir_flag, ident_name id, + List.map2 tree_of_class_param params cl.cty_variance, + tree_of_class_type true params cl.cty_type, + tree_of_rec rs) + +let class_declaration id ppf cl = + !Oprint.out_sig_item ppf (tree_of_class_declaration id cl Trec_first) + +let tree_of_cltype_declaration id cl rs = + let params = List.map repr cl.clty_params in + + reset (); + List.iter add_alias params; + prepare_class_type params cl.clty_type; + let sty = self_type cl.clty_type in + List.iter mark_loops params; + + List.iter check_name_of_type (List.map proxy params); + if is_aliased sty then check_name_of_type (proxy sty); + + let sign = Ctype.signature_of_class_type cl.clty_type in + + let virt = + let (fields, _) = + Ctype.flatten_fields (Ctype.object_fields sign.cty_self) in + List.exists + (fun (lab, _, ty) -> + not (lab = dummy_method || Concr.mem lab sign.cty_concr)) + fields + || Vars.fold (fun _ (_,vr,_) b -> vr = Virtual || b) sign.cty_vars false + in + + Osig_class_type + (virt, ident_name id, + List.map2 tree_of_class_param params cl.clty_variance, + tree_of_class_type true params cl.clty_type, + tree_of_rec rs) + +let cltype_declaration id ppf cl = + !Oprint.out_sig_item ppf (tree_of_cltype_declaration id cl Trec_first) + +(* Print a module type *) + +let rec tree_of_modtype = function + | Tmty_ident p -> + Omty_ident (tree_of_path p) + | Tmty_signature sg -> + Omty_signature (tree_of_signature sg) + | Tmty_functor(param, ty_arg, ty_res) -> + Omty_functor + (ident_name param, tree_of_modtype ty_arg, tree_of_modtype ty_res) + +and tree_of_signature = function + | [] -> [] + | Tsig_value(id, decl) :: rem -> + tree_of_value_description id decl :: tree_of_signature rem + | Tsig_type(id, _, _) :: rem when is_row_name (ident_name id) -> + tree_of_signature rem + | Tsig_type(id, decl, rs) :: rem -> + Osig_type(tree_of_type_decl id decl, tree_of_rec rs) :: + tree_of_signature rem + | Tsig_exception(id, decl) :: rem -> + tree_of_exception_declaration id decl :: tree_of_signature rem + | Tsig_module(id, mty, rs) :: rem -> + Osig_module (ident_name id, tree_of_modtype mty, tree_of_rec rs) :: + tree_of_signature rem + | Tsig_modtype(id, decl) :: rem -> + tree_of_modtype_declaration id decl :: tree_of_signature rem + | Tsig_class(id, decl, rs) :: ctydecl :: tydecl1 :: tydecl2 :: rem -> + tree_of_class_declaration id decl rs :: tree_of_signature rem + | Tsig_cltype(id, decl, rs) :: tydecl1 :: tydecl2 :: rem -> + tree_of_cltype_declaration id decl rs :: tree_of_signature rem + | _ -> + assert false + +and tree_of_modtype_declaration id decl = + let mty = + match decl with + | Tmodtype_abstract -> Omty_abstract + | Tmodtype_manifest mty -> tree_of_modtype mty + in + Osig_modtype (ident_name id, mty) + +let tree_of_module id mty rs = + Osig_module (ident_name id, tree_of_modtype mty, tree_of_rec rs) + +let modtype ppf mty = !Oprint.out_module_type ppf (tree_of_modtype mty) +let modtype_declaration id ppf decl = + !Oprint.out_sig_item ppf (tree_of_modtype_declaration id decl) + +(* Print a signature body (used by -i when compiling a .ml) *) + +let print_signature ppf tree = + fprintf ppf "@[%a@]" !Oprint.out_signature tree + +let signature ppf sg = + fprintf ppf "%a" print_signature (tree_of_signature sg) + +(* Print an unification error *) + +let type_expansion t ppf t' = + if t == t' then type_expr ppf t else + let t' = if proxy t == proxy t' then unalias t' else t' in + fprintf ppf "@[<2>%a@ =@ %a@]" type_expr t type_expr t' + +let rec trace fst txt ppf = function + | (t1, t1') :: (t2, t2') :: rem -> + if not fst then fprintf ppf "@,"; + fprintf ppf "@[Type@;<1 2>%a@ %s@;<1 2>%a@] %a" + (type_expansion t1) t1' txt (type_expansion t2) t2' + (trace false txt) rem + | _ -> () + +let rec filter_trace = function + | (t1, t1') :: (t2, t2') :: rem -> + let rem' = filter_trace rem in + if t1 == t1' && t2 == t2' + then rem' + else (t1, t1') :: (t2, t2') :: rem' + | _ -> [] + +(* Hide variant name and var, to force printing the expanded type *) +let hide_variant_name t = + match repr t with + | {desc = Tvariant row} as t when (row_repr row).row_name <> None -> + newty2 t.level + (Tvariant {(row_repr row) with row_name = None; + row_more = newty2 (row_more row).level Tvar}) + | _ -> t + +let prepare_expansion (t, t') = + let t' = hide_variant_name t' in + mark_loops t; if t != t' then mark_loops t'; + (t, t') + +let may_prepare_expansion compact (t, t') = + match (repr t').desc with + Tvariant _ | Tobject _ when compact -> + mark_loops t; (t, t) + | _ -> prepare_expansion (t, t') + +let print_tags ppf fields = + match fields with [] -> () + | (t, _) :: fields -> + fprintf ppf "`%s" t; + List.iter (fun (t, _) -> fprintf ppf ",@ `%s" t) fields + +let has_explanation unif t3 t4 = + match t3.desc, t4.desc with + Tfield _, _ | _, Tfield _ + | Tunivar, Tvar | Tvar, Tunivar + | Tvariant _, Tvariant _ -> true + | Tconstr (p, _, _), Tvar | Tvar, Tconstr (p, _, _) -> + unif && min t3.level t4.level < Path.binding_time p + | _ -> false + +let rec mismatch unif = function + (_, t) :: (_, t') :: rem -> + begin match mismatch unif rem with + Some _ as m -> m + | None -> + if has_explanation unif t t' then Some(t,t') else None + end + | [] -> None + | _ -> assert false + +let explanation unif t3 t4 ppf = + match t3.desc, t4.desc with + | Tfield _, Tvar | Tvar, Tfield _ -> + fprintf ppf "@,Self type cannot escape its class" + | Tconstr (p, _, _), Tvar + when unif && t4.level < Path.binding_time p -> + fprintf ppf + "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" + path p + | Tvar, Tconstr (p, _, _) + when unif && t3.level < Path.binding_time p -> + fprintf ppf + "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" + path p + | Tvar, Tunivar | Tunivar, Tvar -> + fprintf ppf "@,The universal variable %a would escape its scope" + type_expr (if t3.desc = Tunivar then t3 else t4) + | Tfield (lab, _, _, _), _ + | _, Tfield (lab, _, _, _) when lab = dummy_method -> + fprintf ppf + "@,Self type cannot be unified with a closed object type" + | Tfield (l, _, _, _), Tfield (l', _, _, _) when l = l' -> + fprintf ppf "@,Types for method %s are incompatible" l + | _, Tfield (l, _, _, _) -> + fprintf ppf + "@,@[The first object type has no method %s@]" l + | Tfield (l, _, _, _), _ -> + fprintf ppf + "@,@[The second object type has no method %s@]" l + | Tvariant row1, Tvariant row2 -> + let row1 = row_repr row1 and row2 = row_repr row2 in + begin match + row1.row_fields, row1.row_closed, row2.row_fields, row2.row_closed with + | [], true, [], true -> + fprintf ppf "@,These two variant types have no intersection" + | [], true, fields, _ -> + fprintf ppf + "@,@[The first variant type does not allow tag(s)@ @[%a@]@]" + print_tags fields + | fields, _, [], true -> + fprintf ppf + "@,@[The second variant type does not allow tag(s)@ @[%a@]@]" + print_tags fields + | [l1,_], true, [l2,_], true when l1 = l2 -> + fprintf ppf "@,Types for tag `%s are incompatible" l1 + | _ -> () + end + | _ -> () + +let explanation unif mis ppf = + match mis with + None -> () + | Some (t3, t4) -> explanation unif t3 t4 ppf + +let unification_error unif tr txt1 ppf txt2 = + reset (); + let tr = List.map (fun (t, t') -> (t, hide_variant_name t')) tr in + let mis = mismatch unif tr in + match tr with + | [] | _ :: [] -> assert false + | t1 :: t2 :: tr -> + try + let tr = filter_trace tr in + let t1, t1' = may_prepare_expansion (tr = []) t1 + and t2, t2' = may_prepare_expansion (tr = []) t2 in + print_labels := not !Clflags.classic; + let tr = List.map prepare_expansion tr in + fprintf ppf + "@[\ + @[%t@;<1 2>%a@ \ + %t@;<1 2>%a\ + @]%a%t\ + @]" + txt1 (type_expansion t1) t1' + txt2 (type_expansion t2) t2' + (trace false "is not compatible with type") tr + (explanation unif mis); + print_labels := true + with exn -> + print_labels := true; + raise exn + +let report_unification_error ppf tr txt1 txt2 = + unification_error true tr txt1 ppf txt2;; + +let trace fst txt ppf tr = + print_labels := not !Clflags.classic; + try match tr with + t1 :: t2 :: tr' -> + if fst then trace fst txt ppf (t1 :: t2 :: filter_trace tr') + else trace fst txt ppf (filter_trace tr); + print_labels := true + | _ -> () + with exn -> + print_labels := true; + raise exn + +let report_subtyping_error ppf tr1 txt1 tr2 = + reset (); + let tr1 = List.map prepare_expansion tr1 + and tr2 = List.map prepare_expansion tr2 in + trace true txt1 ppf tr1; + if tr2 = [] then () else + let mis = mismatch true tr2 in + trace false "is not compatible with type" ppf tr2; + explanation true mis ppf + +end diff -Naur ocaml-3.11.0/toplevel/topdirext.ml ocaml-3.11.0-enhtop+/toplevel/topdirext.ml --- ocaml-3.11.0/toplevel/topdirext.ml 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/topdirext.ml 2009-03-24 10:55:08.055441270 -0400 @@ -0,0 +1,345 @@ +open Format +open Types +open Env +open Outcometree +open Toploop +open Path + + +(* Filter definition *) + +type filter = Env.summary -> bool + +let ( ||| ) (f1:filter) (f2:filter) = (fun s -> (f1 s) || (f2 s) : filter) +let ( &&& ) (f1:filter) (f2:filter) = (fun s -> (f1 s) && (f2 s) : filter) + +let open_filter = function + | Env_open (_,_) -> true + | _ -> false + +let value_filter = function + | Env_value (_,_,_) -> true + | _ -> false + +let type_filter = function + | Env_type (_,_,{type_manifest = Some {desc = Tobject _}}) -> false + | Env_type _ -> true | _ -> false + +let exception_filter = function + | Env_exception (_,_,_) -> true + | _ -> false + +let module_filter = function + | Env_module (_,_,_) -> true + | _ -> false + +let modtype_filter = function + | Env_modtype (_,_,_) -> true + | _ -> false + +let class_filter = function + | Env_class (_,_,{cty_type=Tcty_signature{cty_self={desc=Tobject _}}}) -> true + | _ -> false + +let cltype_filter = function + | Env_cltype (_,_,{clty_type=Tcty_signature{cty_self={desc=Tobject _}}}) -> true + | _ -> false + +let none_filter = function _ -> false + +let all_filter = + open_filter ||| value_filter ||| type_filter ||| exception_filter + ||| module_filter ||| modtype_filter ||| class_filter ||| cltype_filter + +let id_filter_gen filter_fun = function + | Env_open (_, p) -> filter_fun (Path.head p) + | Env_value (_,id,_) | Env_type (_,id,_) + | Env_exception (_,id,_) | Env_module (_,id,_) | Env_modtype (_,id,_) + | Env_class (_,id,_) | Env_cltype (_,id,_ ) -> filter_fun id + | _ -> false + +let id_equal_filter id = id_filter_gen (Ident.equal id) + +let id_same_filter id = id_filter_gen (Ident.same id) + +let name_filter name = id_filter_gen (fun id -> Ident.name id = name) + + +(* Printer definintion *) + + +(* Poorman's solution to raise print function to deal with path *) + +(* Fake id *) +type id = { stamp : int; name : string; flags : int } +let rec temp_id = function + | Path.Pident id -> id + | x -> Obj.magic {stamp = 0 ; name = Path.name x; flags = 0} + +let print_open ppf path = fprintf ppf "open %s@." (Path.name path) +let print_value ppf path decl = + let tree, valopt = Printtyp.tree_of_value path decl in + !print_out_phrase ppf (Ophr_signature [tree, valopt]) +let print_type ppf path decl = + let tree = Printtyp.tree_of_type_declaration (temp_id path) decl Trec_not in + !print_out_phrase ppf (Ophr_signature [tree, None]) +let print_exception ppf path decl = + let tree = Printtyp.tree_of_exception_declaration (temp_id path) decl in + !print_out_phrase ppf (Ophr_signature [tree, None]) +let print_module ppf path decl = + let tree = Printtyp.tree_of_module (temp_id path)decl Trec_not in + !print_out_phrase ppf (Ophr_signature [tree, None]) +let print_modtype ppf path decl = + let tree = Printtyp.tree_of_modtype_declaration (temp_id path) decl in + !print_out_phrase ppf (Ophr_signature [tree, None]) +let print_class ppf path decl = + let tree = Printtyp.tree_of_class_declaration (temp_id path) decl Trec_not in + !print_out_phrase ppf (Ophr_signature [tree, None]) +let print_cltype ppf path decl = + let tree = Printtyp.tree_of_cltype_declaration (temp_id path) decl Trec_not in + !print_out_phrase ppf (Ophr_signature [tree, None]) + +let all_printer ppf = function + | Env_open (_, path) -> print_open ppf path + | Env_value (_, id, decl) -> print_value ppf (Pident id) decl + | Env_type (_, id, decl) -> print_type ppf (Pident id) decl + | Env_exception (_, id, decl) -> print_exception ppf (Pident id) decl + | Env_module (_, id, decl) -> print_module ppf (Pident id) decl + | Env_modtype (_, id, decl) -> print_modtype ppf (Pident id) decl + | Env_class (_, id, decl) -> print_class ppf (Pident id) decl + | Env_cltype (_, id, decl) -> print_cltype ppf (Pident id) decl + | _ -> () + + +(* Travaller function *) + +let env_iter env iter_fun = + let env_sum = Env.summary env in + let rec iter sum = match sum with + | Env_empty -> () + | Env_open (ns, _) | Env_value (ns,_,_) | Env_type (ns,_,_) + | Env_exception (ns,_,_) | Env_module (ns,_,_) | Env_modtype (ns,_,_) + | Env_class (ns,_,_) | Env_cltype (ns,_,_ ) -> + iter ns; iter_fun sum in + iter env_sum + + +(* Main definition of show directive *) + +let filter_conf = + [ "open", open_filter; + "value", value_filter; + "type", type_filter; + "exception", exception_filter; + "module", module_filter; + "modtype", modtype_filter; + "class", class_filter; + "cltype", cltype_filter ];; + +let show_fun ppf env filter_fun print_fun = + let iter_fun s = if filter_fun s then print_fun ppf s in + env_iter env iter_fun + +let show ppf env s = + let comm_list = Misc.rev_split_words s in + let filter = + let rec get_filter fil = function + | [] -> fil + | "all":: _ -> all_filter + | comm :: t -> + try let f = List.assoc comm filter_conf in get_filter (f ||| fil) t + with Not_found -> get_filter ((name_filter comm) ||| fil) t in + get_filter none_filter comm_list in + show_fun ppf env filter all_printer + +let dir_show ppf s = show ppf !toplevel_env s +let dir_show_show ppf () = dir_show ppf "all" + + +(* Main definition of tell directive *) + +(* tell can only handle limited representation at this moment *) +let tell ppf env s = + let gen_fun lookup print = fun lid -> + try print (lookup lid env); true + with Not_found -> false in + let rec lookup_print lid = List.fold_left + (fun b f -> (f lid) || b) false + [ gen_fun Env.lookup_value (fun (p,d) -> print_value ppf p d); + gen_fun Env.lookup_type (fun (p,d) -> print_type ppf p d); + gen_fun Env.lookup_module (fun (p,d) -> print_module ppf p d); + gen_fun Env.lookup_modtype (fun (p,d) -> print_modtype ppf p d); + gen_fun Env.lookup_class (fun (p,d) -> print_class ppf p d); + gen_fun Env.lookup_cltype (fun (p,d) -> print_cltype ppf p d) + ] in + let rec try_lookup lid = + match lookup_print lid, lid with + | true, _ | _, Longident.Lident _ -> () + | _ , Longident.Ldot (lid', _) -> try_lookup lid' + | _ , Longident.Lapply (_, _) -> Misc.fatal_error "tell" in + try_lookup (Longident.parse s) + +let dir_tell ppf s = tell ppf !toplevel_env s + + +(* Added by Peng for completion + + tellall - a version of tell that returns all identifies that match + partially. Useful for completion +*) +let tellall ppf env s = + let gen_fun lookup print = fun lid -> + try List.iter print (lookup lid env); true + with Not_found -> false in + let rec lookup_print lid = List.fold_left + (fun b f -> (f lid) || b) false + [ gen_fun Env.lookup_values (fun (p,d) -> print_value ppf p d); + gen_fun Env.lookup_types (fun (p,d) -> print_type ppf p d); + gen_fun Env.lookup_modules (fun (p,d) -> print_module ppf p d); + gen_fun Env.lookup_modtypes (fun (p,d) -> print_modtype ppf p d); + gen_fun Env.lookup_classes (fun (p,d) -> print_class ppf p d); + gen_fun Env.lookup_cltypes (fun (p,d) -> print_cltype ppf p d) + ] in + let rec try_lookup lid = + match lookup_print lid, lid with + | true, _ | _, Longident.Lident _ -> () + | _ , Longident.Ldot (lid', _) -> try_lookup lid' + | _ , Longident.Lapply (_, _) -> Misc.fatal_error "tell" + in + try_lookup (Longident.parse s) + +let dir_tellall ppf s = tellall ppf !toplevel_env s +(* End *) + + + +(* Type mode *) +let type_mode_sw = + let toplevel_env_bak = ref (!toplevel_env) in + (fun b -> + match !type_mode, b with + | false, true -> toplevel_env_bak := !toplevel_env; type_mode := b + | true, false -> toplevel_env := !toplevel_env_bak; type_mode := b + | _, _ -> ()) + +let dir_typemode_show ppf () = + if !type_mode then fprintf ppf "type mode is on.@." + else fprintf ppf "type mode is off.@." + +let dir_typemode ppf b = type_mode_sw b; dir_typemode_show ppf () + + +(* Module listing *) + +let check_loaded mod_name = + try + let path, _ = + Env.lookup_module (Longident.parse mod_name) !Toploop.toplevel_env in + let id = Path.head path in + let _ = Symtable.get_global_position id in + true + with _ -> false + +let list_paths () = + Filename.current_dir_name :: List.filter (fun d -> d <>"") !Config.load_path + +let list_libs sufs dirs = List.map + (fun dir -> + let files = try Array.to_list (Sys.readdir dir) with _ -> [] in + List.filter (fun f -> List.exists (fun s -> Filename.check_suffix f s) sufs) files) + dirs + +let list_mods () = + let dirs = + Filename.current_dir_name :: List.filter (fun d -> d <> "") !Config.load_path in + List.sort compare + (List.map + (fun x -> String.capitalize (Filename.chop_extension x)) + (List.flatten (list_libs [".cmi"] dirs))) + +let dir_modu_show ppf () = + let mods = list_mods () in + let mods' = List.map (fun x -> x, check_loaded x) mods in + List.iter (fun (m, f) -> fprintf ppf "%s%s " m (if f then "(L)" else "")) mods'; + fprintf ppf "@." + + +(* Env config *) + +let dir_env_show ppf () = + fprintf ppf + "value:%b type:%b exception:%b@.module:%b modtype:%b class:%b cltype:%b@." + print_conf.print_value print_conf.print_type print_conf.print_exception + print_conf.print_module print_conf.print_modtype print_conf.print_class + print_conf.print_cltype + +let string_to_printer = function + | "value" -> fun b -> print_conf.print_value <- b + | "type" -> fun b -> print_conf.print_type <- b + | "exception" -> fun b -> print_conf.print_exception <- b + | "module" -> fun b -> print_conf.print_module <- b + | "modtype" -> fun b -> print_conf.print_modtype <- b + | "class" -> fun b -> print_conf.print_class <- b + | "cltype" -> fun b -> print_conf.print_cltype <- b + | _ -> assert false + +let dir_env ppf s = + let sl = Misc.rev_split_words s in + let set s = + try + let i = String.index s ':' in + string_to_printer (String.sub s 0 i) + (bool_of_string (String.sub s (i+1) (String.length s - i -1))) + with _ -> () in + List.iter set sl; + dir_env_show ppf () + + + +(* Directory *) + +let dir_directory_show ppf () = + let dirs = list_paths () in + List.iter (fprintf ppf "[%s] ") dirs; + fprintf ppf "@." + +(* Cd *) + +let dir_cd_show ppf () = + let cur_dir = Sys.getcwd () in + let sub_dir = String.concat " " (Array.to_list (Sys.readdir cur_dir)) in + fprintf ppf "[%s]:@." cur_dir; + (* Sys module won't help you to know which file is a directory *) + fprintf ppf "%s@." sub_dir + +(* Use *) + +let dir_use_show ppf () = + let dirs = list_paths () in + let use_files = list_libs [".ml"] dirs in + List.iter2 + (fun d l -> + match l with [] -> () | _ -> + fprintf ppf "[%s]:@." d; List.iter (fprintf ppf "%s ") l; fprintf ppf "@." + ) dirs use_files + +(* Trace *) + +let dir_trace_show ppf () = + List.iter + (fun x -> + fprintf ppf "%s " (Printtyp.path_name x.Trace.path)) + !Trace.traced_functions; + fprintf ppf "@." + +(* Load *) + +let dir_load_show ppf () = + let dirs = list_paths () in + let loadables = list_libs [".cmo"; ".cma"] dirs in + List.iter2 + (fun d l -> + match l with [] -> () | _ -> + fprintf ppf "[%s]:@." d; List.iter (fprintf ppf "%s ") l; fprintf ppf "@." + ) dirs loadables + diff -Naur ocaml-3.11.0/toplevel/topdirext.mli ocaml-3.11.0-enhtop+/toplevel/topdirext.mli --- ocaml-3.11.0/toplevel/topdirext.mli 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/topdirext.mli 2009-03-24 10:55:08.055441270 -0400 @@ -0,0 +1,19 @@ +(* Naming convention: dir_name dir_name_op, op = show/query/etc. *) + +(* New primitives *) +val dir_show : Format.formatter -> string -> unit +val dir_show_show: Format.formatter -> unit -> unit +val dir_tell : Format.formatter -> string -> unit +val dir_tellall : Format.formatter -> string -> unit +val dir_typemode: Format.formatter -> bool -> unit +val dir_typemode_show : Format.formatter -> unit -> unit +val dir_modu_show: Format.formatter -> unit -> unit +val dir_env: Format.formatter -> string -> unit +val dir_env_show: Format.formatter -> unit -> unit + +(* Enhanced primitives *) +val dir_directory_show: Format.formatter -> unit -> unit +val dir_cd_show: Format.formatter -> unit -> unit +val dir_use_show: Format.formatter -> unit -> unit +val dir_trace_show: Format.formatter -> unit -> unit +val dir_load_show: Format.formatter -> unit -> unit diff -Naur ocaml-3.11.0/toplevel/topdirs.ml ocaml-3.11.0-enhtop+/toplevel/topdirs.ml --- ocaml-3.11.0/toplevel/topdirs.ml 2008-11-18 21:35:40.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/topdirs.ml 2009-03-24 10:55:08.055441270 -0400 @@ -21,6 +21,7 @@ open Types open Cmo_format open Trace +open Topdirext open Toploop (* The standard output formatter *) @@ -35,15 +36,23 @@ (* To add a directory to the load path *) let dir_directory s = + if String.length s = 0 then () + else + let flag, s = + if s.[0] = '-' then false, (String.sub s 1 (String.length s - 1)) + else true, s in let d = expand_directory Config.standard_library s in - Config.load_path := d :: !Config.load_path; - Dll.add_path [d] + if flag then + (Config.load_path := d :: !Config.load_path; Dll.add_path [d]) + else Config.load_path := List.filter (fun x -> x <> d) !Config.load_path ; + dir_directory_show std_out () -let _ = Hashtbl.add directive_table "directory" (Directive_string dir_directory) +let _ = Hashtbl.add directive_table "directory" + (Directive_string dir_directory) (* To change the current directory *) -let dir_cd s = Sys.chdir s +let dir_cd s = Sys.chdir s; fprintf std_out "[%s]@." (Sys.getcwd ()) let _ = Hashtbl.add directive_table "cd" (Directive_string dir_cd) @@ -224,9 +233,9 @@ then begin match is_traced clos with | Some opath -> - fprintf ppf "%a is already traced (under the name %a).@." - Printtyp.path path - Printtyp.path opath + fprintf ppf "%s is already traced (under the name %s).@." + (Printtyp.path_name path) + (Printtyp.path_name opath) | None -> (* Instrument the old closure *) traced_functions := @@ -265,10 +274,11 @@ List.iter (fun f -> set_code_pointer f.closure f.actual_code; - fprintf ppf "%a is no longer traced.@." Printtyp.path f.path) + fprintf ppf "%s is no longer traced.@." (Printtyp.path_name f.path)) !traced_functions; traced_functions := [] + let parse_warnings ppf iserr s = try Warnings.parse_options iserr s with Arg.Bad err -> fprintf ppf "%s.@." err @@ -302,3 +312,21 @@ Hashtbl.add directive_table "warn_error" (Directive_string (parse_warnings std_out true)) + + +let _ = + Hashtbl.add directive_table "show" (Directive_string (dir_show std_out)); + Hashtbl.add directive_table "show" (Directive_none (dir_show_show std_out)); + Hashtbl.add directive_table "tell" (Directive_string (dir_tell std_out)); + Hashtbl.add directive_table "tellall" (Directive_string (dir_tellall std_out)); + Hashtbl.add directive_table "typemode" (Directive_bool (dir_typemode std_out)); + Hashtbl.add directive_table "typemode" (Directive_none (dir_typemode_show std_out)); + Hashtbl.add directive_table "modu" (Directive_none (dir_modu_show std_out)); + Hashtbl.add directive_table "env" (Directive_string (dir_env std_out)); + Hashtbl.add directive_table "env" (Directive_none (dir_env_show std_out)); + + Hashtbl.add directive_table "directory" (Directive_none (dir_directory_show std_out)); + Hashtbl.add directive_table "cd" (Directive_none (dir_cd_show std_out)); + Hashtbl.add directive_table "use" (Directive_none (dir_use_show std_out)); + Hashtbl.add directive_table "load" (Directive_none (dir_load_show std_out)); + Hashtbl.add directive_table "trace" (Directive_none (dir_trace_show std_out)) diff -Naur ocaml-3.11.0/toplevel/topdirs.ml.orig ocaml-3.11.0-enhtop+/toplevel/topdirs.ml.orig --- ocaml-3.11.0/toplevel/topdirs.ml.orig 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/topdirs.ml.orig 2009-03-24 10:55:08.055441270 -0400 @@ -0,0 +1,331 @@ +(***********************************************************************) +(* *) +(* Objective Caml *) +(* *) +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) +(* *) +(* Copyright 1996 Institut National de Recherche en Informatique et *) +(* en Automatique. All rights reserved. This file is distributed *) +(* under the terms of the Q Public License version 1.0. *) +(* *) +(***********************************************************************) + +(* $Id: topdirs.ml,v 1.66.14.1 2008/11/19 02:35:40 garrigue Exp $ *) + +(* Toplevel directives *) + +open Format +open Misc +open Longident +open Path +open Types +open Cmo_format +open Trace +open Topdirext +open Toploop + +(* The standard output formatter *) +let std_out = std_formatter + +(* To quit *) + +let dir_quit () = exit 0 + +let _ = Hashtbl.add directive_table "quit" (Directive_none dir_quit) + +(* To add a directory to the load path *) + +let dir_directory s = + if String.length s = 0 then () + else + let flag, s = + if s.[0] = '-' then false, (String.sub s 1 (String.length s - 1)) + else true, s in + let d = expand_directory Config.standard_library s in + if flag then + (Config.load_path := d :: !Config.load_path; Dll.add_path [d]) + else Config.load_path := List.filter (fun x -> x <> d) !Config.load_path ; + dir_directory_show std_out () + +let _ = Hashtbl.add directive_table "directory" + (Directive_string dir_directory) + +(* To change the current directory *) + +let dir_cd s = Sys.chdir s; fprintf std_out "[%s]@." (Sys.getcwd ()) + +let _ = Hashtbl.add directive_table "cd" (Directive_string dir_cd) + +(* Load in-core a .cmo file *) + +exception Load_failed + +let check_consistency ppf filename cu = + try + List.iter + (fun (name, crc) -> Consistbl.check Env.crc_units name crc filename) + cu.cu_imports + with Consistbl.Inconsistency(name, user, auth) -> + fprintf ppf "@[The files %s@ and %s@ \ + disagree over interface %s@]@." + user auth name; + raise Load_failed + +let load_compunit ic filename ppf compunit = + check_consistency ppf filename compunit; + seek_in ic compunit.cu_pos; + let code_size = compunit.cu_codesize + 8 in + let code = Meta.static_alloc code_size in + unsafe_really_input ic code 0 compunit.cu_codesize; + String.unsafe_set code compunit.cu_codesize (Char.chr Opcodes.opRETURN); + String.unsafe_blit "\000\000\000\001\000\000\000" 0 + code (compunit.cu_codesize + 1) 7; + let initial_symtable = Symtable.current_state() in + Symtable.patch_object code compunit.cu_reloc; + Symtable.update_global_table(); + begin try + may_trace := true; + ignore((Meta.reify_bytecode code code_size) ()); + may_trace := false; + with exn -> + may_trace := false; + Symtable.restore_state initial_symtable; + print_exception_outcome ppf exn; + raise Load_failed + end + +let load_file ppf name = + try + let filename = find_in_path !Config.load_path name in + let ic = open_in_bin filename in + let buffer = String.create (String.length Config.cmo_magic_number) in + really_input ic buffer 0 (String.length Config.cmo_magic_number); + let success = try + if buffer = Config.cmo_magic_number then begin + let compunit_pos = input_binary_int ic in (* Go to descriptor *) + seek_in ic compunit_pos; + load_compunit ic filename ppf (input_value ic : compilation_unit); + true + end else + if buffer = Config.cma_magic_number then begin + let toc_pos = input_binary_int ic in (* Go to table of contents *) + seek_in ic toc_pos; + let lib = (input_value ic : library) in + List.iter + (fun dllib -> + let name = Dll.extract_dll_name dllib in + try Dll.open_dlls Dll.For_execution [name] + with Failure reason -> + fprintf ppf + "Cannot load required shared library %s.@.Reason: %s.@." + name reason; + raise Load_failed) + lib.lib_dllibs; + List.iter (load_compunit ic filename ppf) lib.lib_units; + true + end else begin + fprintf ppf "File %s is not a bytecode object file.@." name; + false + end + with Load_failed -> false in + close_in ic; + success + with Not_found -> fprintf ppf "Cannot find file %s.@." name; false + +let dir_load ppf name = ignore (load_file ppf name) + +let _ = Hashtbl.add directive_table "load" (Directive_string (dir_load std_out)) + +(* Load commands from a file *) + +let dir_use ppf name = ignore(Toploop.use_file ppf name) + +let _ = Hashtbl.add directive_table "use" (Directive_string (dir_use std_out)) + +(* Install, remove a printer *) + +type 'a printer_type_new = Format.formatter -> 'a -> unit +type 'a printer_type_old = 'a -> unit + +let match_printer_type ppf desc typename = + let (printer_type, _) = + try + Env.lookup_type (Ldot(Lident "Topdirs", typename)) !toplevel_env + with Not_found -> + fprintf ppf "Cannot find type Topdirs.%s.@." typename; + raise Exit in + Ctype.init_def(Ident.current_time()); + Ctype.begin_def(); + let ty_arg = Ctype.newvar() in + Ctype.unify !toplevel_env + (Ctype.newconstr printer_type [ty_arg]) + (Ctype.instance desc.val_type); + Ctype.end_def(); + Ctype.generalize ty_arg; + ty_arg + +let find_printer_type ppf lid = + try + let (path, desc) = Env.lookup_value lid !toplevel_env in + let (ty_arg, is_old_style) = + try + (match_printer_type ppf desc "printer_type_new", false) + with Ctype.Unify _ -> + (match_printer_type ppf desc "printer_type_old", true) in + (ty_arg, path, is_old_style) + with + | Not_found -> + fprintf ppf "Unbound value %a.@." Printtyp.longident lid; + raise Exit + | Ctype.Unify _ -> + fprintf ppf "%a has a wrong type for a printing function.@." + Printtyp.longident lid; + raise Exit + +let dir_install_printer ppf lid = + try + let (ty_arg, path, is_old_style) = find_printer_type ppf lid in + let v = eval_path path in + let print_function = + if is_old_style then + (fun formatter repr -> Obj.obj v (Obj.obj repr)) + else + (fun formatter repr -> Obj.obj v formatter (Obj.obj repr)) in + install_printer path ty_arg print_function + with Exit -> () + +let dir_remove_printer ppf lid = + try + let (ty_arg, path, is_old_style) = find_printer_type ppf lid in + begin try + remove_printer path + with Not_found -> + fprintf ppf "No printer named %a.@." Printtyp.longident lid + end + with Exit -> () + +let _ = Hashtbl.add directive_table "install_printer" + (Directive_ident (dir_install_printer std_out)) +let _ = Hashtbl.add directive_table "remove_printer" + (Directive_ident (dir_remove_printer std_out)) + +(* The trace *) + +external current_environment: unit -> Obj.t = "caml_get_current_environment" + +let tracing_function_ptr = + get_code_pointer + (Obj.repr (fun arg -> Trace.print_trace (current_environment()) arg)) + +let dir_trace ppf lid = + try + let (path, desc) = Env.lookup_value lid !toplevel_env in + (* Check if this is a primitive *) + match desc.val_kind with + | Val_prim p -> + fprintf ppf "%a is an external function and cannot be traced.@." + Printtyp.longident lid + | _ -> + let clos = eval_path path in + (* Nothing to do if it's not a closure *) + if Obj.is_block clos + && (Obj.tag clos = Obj.closure_tag || Obj.tag clos = Obj.infix_tag) + then begin + match is_traced clos with + | Some opath -> + fprintf ppf "%s is already traced (under the name %s).@." + (Printtyp.path_name path) + (Printtyp.path_name opath) + | None -> + (* Instrument the old closure *) + traced_functions := + { path = path; + closure = clos; + actual_code = get_code_pointer clos; + instrumented_fun = + instrument_closure !toplevel_env lid ppf desc.val_type } + :: !traced_functions; + (* Redirect the code field of the closure to point + to the instrumentation function *) + set_code_pointer clos tracing_function_ptr; + fprintf ppf "%a is now traced.@." Printtyp.longident lid + end else fprintf ppf "%a is not a function.@." Printtyp.longident lid + with + | Not_found -> fprintf ppf "Unbound value %a.@." Printtyp.longident lid + +let dir_untrace ppf lid = + try + let (path, desc) = Env.lookup_value lid !toplevel_env in + let rec remove = function + | [] -> + fprintf ppf "%a was not traced.@." Printtyp.longident lid; + [] + | f :: rem -> + if Path.same f.path path then begin + set_code_pointer f.closure f.actual_code; + fprintf ppf "%a is no longer traced.@." Printtyp.longident lid; + rem + end else f :: remove rem in + traced_functions := remove !traced_functions + with + | Not_found -> fprintf ppf "Unbound value %a.@." Printtyp.longident lid + +let dir_untrace_all ppf () = + List.iter + (fun f -> + set_code_pointer f.closure f.actual_code; + fprintf ppf "%s is no longer traced.@." (Printtyp.path_name f.path)) + !traced_functions; + traced_functions := [] + + +let parse_warnings ppf iserr s = + try Warnings.parse_options iserr s + with Arg.Bad err -> fprintf ppf "%s.@." err + +let _ = + Hashtbl.add directive_table "trace" (Directive_ident (dir_trace std_out)); + Hashtbl.add directive_table "untrace" (Directive_ident (dir_untrace std_out)); + Hashtbl.add directive_table + "untrace_all" (Directive_none (dir_untrace_all std_out)); + +(* Control the printing of values *) + + Hashtbl.add directive_table "print_depth" + (Directive_int(fun n -> max_printer_depth := n)); + Hashtbl.add directive_table "print_length" + (Directive_int(fun n -> max_printer_steps := n)); + +(* Set various compiler flags *) + + Hashtbl.add directive_table "labels" + (Directive_bool(fun b -> Clflags.classic := not b)); + + Hashtbl.add directive_table "principal" + (Directive_bool(fun b -> Clflags.principal := b)); + + Hashtbl.add directive_table "rectypes" + (Directive_none(fun () -> Clflags.recursive_types := true)); + + Hashtbl.add directive_table "warnings" + (Directive_string (parse_warnings std_out false)); + + Hashtbl.add directive_table "warn_error" + (Directive_string (parse_warnings std_out true)) + + +let _ = + Hashtbl.add directive_table "show" (Directive_string (dir_show std_out)); + Hashtbl.add directive_table "show" (Directive_none (dir_show_show std_out)); + Hashtbl.add directive_table "tell" (Directive_string (dir_tell std_out)); + Hashtbl.add directive_table "typemode" (Directive_bool (dir_typemode std_out)); + Hashtbl.add directive_table "typemode" (Directive_none (dir_typemode_show std_out)); + Hashtbl.add directive_table "modu" (Directive_none (dir_modu_show std_out)); + Hashtbl.add directive_table "env" (Directive_string (dir_env std_out)); + Hashtbl.add directive_table "env" (Directive_none (dir_env_show std_out)); + + Hashtbl.add directive_table "directory" (Directive_none (dir_directory_show std_out)); + Hashtbl.add directive_table "cd" (Directive_none (dir_cd_show std_out)); + Hashtbl.add directive_table "use" (Directive_none (dir_use_show std_out)); + Hashtbl.add directive_table "load" (Directive_none (dir_load_show std_out)); + Hashtbl.add directive_table "trace" (Directive_none (dir_trace_show std_out)) diff -Naur ocaml-3.11.0/toplevel/toploop.ml ocaml-3.11.0-enhtop+/toplevel/toploop.ml --- ocaml-3.11.0/toplevel/toploop.ml 2007-12-04 08:38:58.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/toploop.ml 2009-03-24 10:55:08.055441270 -0400 @@ -47,6 +47,7 @@ (* Return the value referred to by a path *) +(* when eval a old path may get new result *) let rec eval_path = function | Pident id -> if Ident.persistent id || Ident.global id then @@ -147,42 +148,96 @@ Symtable.restore_state initial_symtable; Exception x +(* The current typing environment for the toplevel *) +let toplevel_env = ref Env.empty + +(* Typing mode switch *) +let type_mode = ref false + + +module Printtyp = struct + include Genprinttyp.Make (struct let env = toplevel_env end) + let tree_of_value path decl = + let get_obj path = + if !type_mode || is_rebound (Path.head path) then None + else + try Some (outval_of_value !topenv (eval_path path) decl.val_type) + with _ -> None in + let ty = tree_of_type_scheme decl.val_type in + let prims, valopt = match decl.val_kind with + | Val_prim p -> Primitive.description_list p, None + | _ -> [], (get_obj path) in + Osig_value ((path_name path), ty, prims), valopt +end + + (* Print the outcome of an evaluation *) +type print_config = { + mutable welcome: unit -> string; + mutable prompt: unit -> string; + mutable print_value: bool; + mutable print_type: bool; + mutable print_exception: bool; + mutable print_module: bool; + mutable print_modtype: bool; + mutable print_class: bool; + mutable print_cltype: bool; +} + +let print_conf = { + welcome = + (let str = sprintf " Objective Caml version %s" Config.version in + fun () -> str); + prompt = (fun () -> "# "); + print_value = true; + print_type = false; + print_exception = false; + print_module = true; + print_modtype =false; + print_class = true; + print_cltype = false; +} + + let rec pr_item env = function | Tsig_value(id, decl) :: rem -> - let tree = Printtyp.tree_of_value_description id decl in - let valopt = - match decl.val_kind with - | Val_prim _ -> None - | _ -> - let v = - outval_of_value env (getvalue (Translmod.toplevel_name id)) - decl.val_type - in - Some v - in + if print_conf.print_value then + let tree, valopt = Printtyp.tree_of_value (Pident id) decl in Some (tree, valopt, rem) + else pr_item env rem | Tsig_type(id, _, _) :: rem when Btype.is_row_name (Ident.name id) -> pr_item env rem | Tsig_type(id, decl, rs) :: rem -> + if print_conf.print_type then let tree = Printtyp.tree_of_type_declaration id decl rs in Some (tree, None, rem) + else pr_item env rem | Tsig_exception(id, decl) :: rem -> + if print_conf.print_exception then let tree = Printtyp.tree_of_exception_declaration id decl in Some (tree, None, rem) + else pr_item env rem | Tsig_module(id, mty, rs) :: rem -> + if print_conf.print_module then let tree = Printtyp.tree_of_module id mty rs in Some (tree, None, rem) + else pr_item env rem | Tsig_modtype(id, decl) :: rem -> + if print_conf.print_modtype then let tree = Printtyp.tree_of_modtype_declaration id decl in Some (tree, None, rem) + else pr_item env rem | Tsig_class(id, decl, rs) :: cltydecl :: tydecl1 :: tydecl2 :: rem -> + if print_conf.print_class then let tree = Printtyp.tree_of_class_declaration id decl rs in Some (tree, None, rem) + else pr_item env rem | Tsig_cltype(id, decl, rs) :: tydecl1 :: tydecl2 :: rem -> + if print_conf.print_cltype then let tree = Printtyp.tree_of_cltype_declaration id decl rs in Some (tree, None, rem) + else pr_item env rem | _ -> None let rec item_list env = function @@ -192,10 +247,6 @@ | None -> [] | Some (tree, valopt, items) -> (tree, valopt) :: item_list env items -(* The current typing environment for the toplevel *) - -let toplevel_env = ref Env.empty - (* Print an exception produced by an evaluation *) let print_out_exception ppf exn outv = @@ -226,8 +277,19 @@ Warnings.check_fatal (); begin try toplevel_env := newenv; - let res = load_lambda ppf lam in let out_phr = + if !type_mode then + if print_outcome then + match str with + | [Tstr_eval exp] -> + let ty = Printtyp.tree_of_type_scheme exp.exp_type in + Ophr_eval (Oval_ellipsis, ty) + | [] -> Ophr_signature [] + | _ -> Ophr_signature (item_list newenv + (Typemod.simplify_signature sg)) + else Ophr_signature [] + else + let res = load_lambda ppf lam in match res with | Result v -> if print_outcome then @@ -258,15 +320,18 @@ end | Ptop_dir(dir_name, dir_arg) -> try - match (Hashtbl.find directive_table dir_name, dir_arg) with - | (Directive_none f, Pdir_none) -> f (); true - | (Directive_string f, Pdir_string s) -> f s; true - | (Directive_int f, Pdir_int n) -> f n; true - | (Directive_ident f, Pdir_ident lid) -> f lid; true - | (Directive_bool f, Pdir_bool b) -> f b; true - | (_, _) -> - fprintf ppf "Wrong type of argument for directive `%s'.@." dir_name; - false + let dirs = Hashtbl.find_all directive_table dir_name in + List.exists + (fun x -> match x, dir_arg with + | (Directive_none f, Pdir_none) -> f (); true + | (Directive_string f, Pdir_string s) -> f s; true + | (Directive_int f, Pdir_int n) -> f n; true + | (Directive_ident f, Pdir_ident lid) -> f lid; true + | (Directive_bool f, Pdir_bool b) -> f b; true + | (_, _) -> false + ) dirs + || (fprintf ppf "Wrong type of argument for directive `%s'.@." dir_name; + false) with Not_found -> fprintf ppf "Unknown directive `%s'.@." dir_name; false @@ -345,7 +410,7 @@ if !got_eof then (got_eof := false; 0) else begin let prompt = if !Clflags.noprompt then "" - else if !first_line then "# " + else if !first_line then print_conf.prompt () else if Lexer.in_comment () then "* " else " " in @@ -400,7 +465,7 @@ exception PPerror let loop ppf = - fprintf ppf " Objective Caml version %s@.@." Config.version; + fprintf ppf "%s@.@." (print_conf.welcome ()); initialize_toplevel_env (); let lb = Lexing.from_function refill_lexbuf in Location.input_name := ""; diff -Naur ocaml-3.11.0/toplevel/toploop.ml.orig ocaml-3.11.0-enhtop+/toplevel/toploop.ml.orig --- ocaml-3.11.0/toplevel/toploop.ml.orig 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/toploop.ml.orig 2009-03-24 10:55:08.055441270 -0400 @@ -0,0 +1,437 @@ +(***********************************************************************) +(* *) +(* Objective Caml *) +(* *) +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) +(* *) +(* Copyright 1996 Institut National de Recherche en Informatique et *) +(* en Automatique. All rights reserved. This file is distributed *) +(* under the terms of the Q Public License version 1.0. *) +(* *) +(***********************************************************************) + +(* $Id: toploop.ml,v 1.95 2007/12/04 13:38:58 doligez Exp $ *) + +(* The interactive toplevel loop *) + +open Path +open Lexing +open Format +open Config +open Misc +open Parsetree +open Types +open Typedtree +open Outcometree + +type directive_fun = + | Directive_none of (unit -> unit) + | Directive_string of (string -> unit) + | Directive_int of (int -> unit) + | Directive_ident of (Longident.t -> unit) + | Directive_bool of (bool -> unit) + +(* The table of toplevel value bindings and its accessors *) + +let toplevel_value_bindings = + (Hashtbl.create 37 : (string, Obj.t) Hashtbl.t) + +let getvalue name = + try + Hashtbl.find toplevel_value_bindings name + with Not_found -> + fatal_error (name ^ " unbound at toplevel") + +let setvalue name v = + Hashtbl.replace toplevel_value_bindings name v + +(* Return the value referred to by a path *) + +let rec eval_path = function + | Pident id -> + if Ident.persistent id || Ident.global id then + Symtable.get_global_value id + else begin + let name = Translmod.toplevel_name id in + try + Hashtbl.find toplevel_value_bindings name + with Not_found -> + raise (Symtable.Error(Symtable.Undefined_global name)) + end + | Pdot(p, s, pos) -> + Obj.field (eval_path p) pos + | Papply(p1, p2) -> + fatal_error "Toploop.eval_path" + +(* To print values *) + +module EvalPath = struct + type value = Obj.t + exception Error + let eval_path p = try eval_path p with Symtable.Error _ -> raise Error + let same_value v1 v2 = (v1 == v2) +end + +module Printer = Genprintval.Make(Obj)(EvalPath) + +let max_printer_depth = ref 100 +let max_printer_steps = ref 300 + +let print_out_value = Oprint.out_value +let print_out_type = Oprint.out_type +let print_out_class_type = Oprint.out_class_type +let print_out_module_type = Oprint.out_module_type +let print_out_sig_item = Oprint.out_sig_item +let print_out_signature = Oprint.out_signature +let print_out_phrase = Oprint.out_phrase + +let print_untyped_exception ppf obj = + !print_out_value ppf (Printer.outval_of_untyped_exception obj) +let outval_of_value env obj ty = + Printer.outval_of_value !max_printer_steps !max_printer_depth + (fun _ _ _ -> None) env obj ty +let print_value env obj ppf ty = + !print_out_value ppf (outval_of_value env obj ty) + +let install_printer = Printer.install_printer +let remove_printer = Printer.remove_printer + +(* Hooks for parsing functions *) + +let parse_toplevel_phrase = ref Parse.toplevel_phrase +let parse_use_file = ref Parse.use_file +let print_location = Location.print_error (* FIXME change back to print *) +let print_error = Location.print_error +let print_warning = Location.print_warning +let input_name = Location.input_name + +(* Hooks for initialization *) + +let toplevel_startup_hook = ref (fun () -> ()) + +(* Load in-core and execute a lambda term *) + +let may_trace = ref false (* Global lock on tracing *) +type evaluation_outcome = Result of Obj.t | Exception of exn + +let load_lambda ppf lam = + if !Clflags.dump_rawlambda then fprintf ppf "%a@." Printlambda.lambda lam; + let slam = Simplif.simplify_lambda lam in + if !Clflags.dump_lambda then fprintf ppf "%a@." Printlambda.lambda slam; + let (init_code, fun_code) = Bytegen.compile_phrase slam in + if !Clflags.dump_instr then + fprintf ppf "%a%a@." + Printinstr.instrlist init_code + Printinstr.instrlist fun_code; + let (code, code_size, reloc) = Emitcode.to_memory init_code fun_code in + let can_free = (fun_code = []) in + let initial_symtable = Symtable.current_state() in + Symtable.patch_object code reloc; + Symtable.check_global_initialized reloc; + Symtable.update_global_table(); + try + may_trace := true; + let retval = (Meta.reify_bytecode code code_size) () in + may_trace := false; + if can_free then begin + Meta.static_release_bytecode code code_size; + Meta.static_free code; + end; + Result retval + with x -> + may_trace := false; + if can_free then begin + Meta.static_release_bytecode code code_size; + Meta.static_free code; + end; + Symtable.restore_state initial_symtable; + Exception x + +(* Print the outcome of an evaluation *) + +let rec pr_item env = function + | Tsig_value(id, decl) :: rem -> + let tree = Printtyp.tree_of_value_description id decl in + let valopt = + match decl.val_kind with + | Val_prim _ -> None + | _ -> + let v = + outval_of_value env (getvalue (Translmod.toplevel_name id)) + decl.val_type + in + Some v + in + Some (tree, valopt, rem) + | Tsig_type(id, _, _) :: rem when Btype.is_row_name (Ident.name id) -> + pr_item env rem + | Tsig_type(id, decl, rs) :: rem -> + let tree = Printtyp.tree_of_type_declaration id decl rs in + Some (tree, None, rem) + | Tsig_exception(id, decl) :: rem -> + let tree = Printtyp.tree_of_exception_declaration id decl in + Some (tree, None, rem) + | Tsig_module(id, mty, rs) :: rem -> + let tree = Printtyp.tree_of_module id mty rs in + Some (tree, None, rem) + | Tsig_modtype(id, decl) :: rem -> + let tree = Printtyp.tree_of_modtype_declaration id decl in + Some (tree, None, rem) + | Tsig_class(id, decl, rs) :: cltydecl :: tydecl1 :: tydecl2 :: rem -> + let tree = Printtyp.tree_of_class_declaration id decl rs in + Some (tree, None, rem) + | Tsig_cltype(id, decl, rs) :: tydecl1 :: tydecl2 :: rem -> + let tree = Printtyp.tree_of_cltype_declaration id decl rs in + Some (tree, None, rem) + | _ -> None + +let rec item_list env = function + | [] -> [] + | items -> + match pr_item env items with + | None -> [] + | Some (tree, valopt, items) -> (tree, valopt) :: item_list env items + +(* The current typing environment for the toplevel *) + +let toplevel_env = ref Env.empty + +(* Print an exception produced by an evaluation *) + +let print_out_exception ppf exn outv = + !print_out_phrase ppf (Ophr_exception (exn, outv)) + +let print_exception_outcome ppf exn = + if exn = Out_of_memory then Gc.full_major (); + let outv = outval_of_value !toplevel_env (Obj.repr exn) Predef.type_exn in + print_out_exception ppf exn outv + +(* The table of toplevel directives. + Filled by functions from module topdirs. *) + +let directive_table = (Hashtbl.create 13 : (string, directive_fun) Hashtbl.t) + +(* Execute a toplevel phrase *) + +let execute_phrase print_outcome ppf phr = + match phr with + | Ptop_def sstr -> + let oldenv = !toplevel_env in + let _ = Unused_var.warn ppf sstr in + Typecore.reset_delayed_checks (); + let (str, sg, newenv) = Typemod.type_structure oldenv sstr Location.none + in + Typecore.force_delayed_checks (); + let lam = Translmod.transl_toplevel_definition str in + Warnings.check_fatal (); + begin try + toplevel_env := newenv; + let res = load_lambda ppf lam in + let out_phr = + match res with + | Result v -> + if print_outcome then + match str with + | [Tstr_eval exp] -> + let outv = outval_of_value newenv v exp.exp_type in + let ty = Printtyp.tree_of_type_scheme exp.exp_type in + Ophr_eval (outv, ty) + | [] -> Ophr_signature [] + | _ -> Ophr_signature (item_list newenv + (Typemod.simplify_signature sg)) + else Ophr_signature [] + | Exception exn -> + toplevel_env := oldenv; + if exn = Out_of_memory then Gc.full_major(); + let outv = + outval_of_value !toplevel_env (Obj.repr exn) Predef.type_exn + in + Ophr_exception (exn, outv) + in + !print_out_phrase ppf out_phr; + begin match out_phr with + | Ophr_eval (_, _) | Ophr_signature _ -> true + | Ophr_exception _ -> false + end + with x -> + toplevel_env := oldenv; raise x + end + | Ptop_dir(dir_name, dir_arg) -> + try + match (Hashtbl.find directive_table dir_name, dir_arg) with + | (Directive_none f, Pdir_none) -> f (); true + | (Directive_string f, Pdir_string s) -> f s; true + | (Directive_int f, Pdir_int n) -> f n; true + | (Directive_ident f, Pdir_ident lid) -> f lid; true + | (Directive_bool f, Pdir_bool b) -> f b; true + | (_, _) -> + fprintf ppf "Wrong type of argument for directive `%s'.@." dir_name; + false + with Not_found -> + fprintf ppf "Unknown directive `%s'.@." dir_name; + false + +(* Temporary assignment to a reference *) + +let protect r newval body = + let oldval = !r in + try + r := newval; + let res = body() in + r := oldval; + res + with x -> + r := oldval; + raise x + +(* Read and execute commands from a file *) + +let use_print_results = ref true + +let use_file ppf name = + try + let filename = find_in_path !Config.load_path name in + let ic = open_in_bin filename in + let lb = Lexing.from_channel ic in + Location.init lb filename; + (* Skip initial #! line if any *) + Lexer.skip_sharp_bang lb; + let success = + protect Location.input_name filename (fun () -> + try + List.iter + (fun ph -> + if !Clflags.dump_parsetree then Printast.top_phrase ppf ph; + if not (execute_phrase !use_print_results ppf ph) then raise Exit) + (!parse_use_file lb); + true + with + | Exit -> false + | Sys.Break -> fprintf ppf "Interrupted.@."; false + | x -> Errors.report_error ppf x; false) in + close_in ic; + success + with Not_found -> fprintf ppf "Cannot find file %s.@." name; false + +let use_silently ppf name = + protect use_print_results false (fun () -> use_file ppf name) + +(* Reading function for interactive use *) + +let first_line = ref true +let got_eof = ref false;; + +let read_input_default prompt buffer len = + output_string stdout prompt; flush stdout; + let i = ref 0 in + try + while true do + if !i >= len then raise Exit; + let c = input_char stdin in + buffer.[!i] <- c; + incr i; + if c = '\n' then raise Exit; + done; + (!i, false) + with + | End_of_file -> + (!i, true) + | Exit -> + (!i, false) + +let read_interactive_input = ref read_input_default + +let refill_lexbuf buffer len = + if !got_eof then (got_eof := false; 0) else begin + let prompt = + if !Clflags.noprompt then "" + else if !first_line then "# " + else if Lexer.in_comment () then "* " + else " " + in + first_line := false; + let (len, eof) = !read_interactive_input prompt buffer len in + if eof then begin + Location.echo_eof (); + if len > 0 then got_eof := true; + len + end else + len + end + +(* Toplevel initialization. Performed here instead of at the + beginning of loop() so that user code linked in with ocamlmktop + can call directives from Topdirs. *) + +let _ = + Sys.interactive := true; + let crc_intfs = Symtable.init_toplevel() in + Compile.init_path(); + List.iter + (fun (name, crc) -> + Consistbl.set Env.crc_units name crc Sys.executable_name) + crc_intfs + +let load_ocamlinit ppf = + match !Clflags.init_file with + | Some f -> if Sys.file_exists f then ignore (use_silently ppf f) + else fprintf ppf "Init file not found: \"%s\".@." f + | None -> + if Sys.file_exists ".ocamlinit" then ignore (use_silently ppf ".ocamlinit") + else try + let home_init = Filename.concat (Sys.getenv "HOME") ".ocamlinit" in + if Sys.file_exists home_init then ignore (use_silently ppf home_init) + with Not_found -> () +;; + +let set_paths () = + (* Add whatever -I options have been specified on the command line, + but keep the directories that user code linked in with ocamlmktop + may have added to load_path. *) + load_path := !load_path @ [Filename.concat Config.standard_library "camlp4"]; + load_path := "" :: (List.rev !Clflags.include_dirs @ !load_path); + Dll.add_path !load_path + +let initialize_toplevel_env () = + toplevel_env := Compile.initial_env() + +(* The interactive loop *) + +exception PPerror + +let loop ppf = + fprintf ppf " Objective Caml version %s@.@." Config.version; + initialize_toplevel_env (); + let lb = Lexing.from_function refill_lexbuf in + Location.input_name := ""; + Location.input_lexbuf := Some lb; + Sys.catch_break true; + load_ocamlinit ppf; + while true do + let snap = Btype.snapshot () in + try + Lexing.flush_input lb; + Location.reset(); + first_line := true; + let phr = try !parse_toplevel_phrase lb with Exit -> raise PPerror in + if !Clflags.dump_parsetree then Printast.top_phrase ppf phr; + ignore(execute_phrase true ppf phr) + with + | End_of_file -> exit 0 + | Sys.Break -> fprintf ppf "Interrupted.@."; Btype.backtrack snap + | PPerror -> () + | x -> Errors.report_error ppf x; Btype.backtrack snap + done + +(* Execute a script *) + +let run_script ppf name args = + let len = Array.length args in + if Array.length Sys.argv < len then invalid_arg "Toploop.run_script"; + Array.blit args 0 Sys.argv 0 len; + Obj.truncate (Obj.repr Sys.argv) len; + Arg.current := 0; + Compile.init_path(); + toplevel_env := Compile.initial_env(); + Sys.interactive := false; + use_silently ppf name diff -Naur ocaml-3.11.0/toplevel/toploop.mli ocaml-3.11.0-enhtop+/toplevel/toploop.mli --- ocaml-3.11.0/toplevel/toploop.mli 2007-12-04 08:38:58.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/toploop.mli 2009-03-24 10:55:08.065441575 -0400 @@ -99,6 +99,26 @@ val print_out_phrase : (formatter -> Outcometree.out_phrase -> unit) ref +(* Overwrite default Printtyp module with both type & value environment enabled *) +module Printtyp: sig + open Format + open Types + open Outcometree + val longident: formatter -> Longident.t -> unit + val ident_name: Ident.t -> string + val path_name: Path.t -> string + val tree_of_path: Path.t -> out_ident + val tree_of_type_scheme: type_expr -> out_type + val tree_of_value_description: Ident.t -> value_description -> out_sig_item + val tree_of_type_declaration: Ident.t -> type_declaration -> rec_status -> out_sig_item + val tree_of_exception_declaration: Ident.t -> exception_declaration -> out_sig_item + val tree_of_module: Ident.t -> module_type -> rec_status -> out_sig_item + val tree_of_modtype_declaration: Ident.t -> modtype_declaration -> out_sig_item + val tree_of_class_declaration: Ident.t -> class_declaration -> rec_status -> out_sig_item + val tree_of_cltype_declaration: Ident.t -> cltype_declaration -> rec_status -> out_sig_item + val tree_of_value: Path.t -> value_description -> out_sig_item * out_value option +end + (* Hooks for external line editor *) val read_interactive_input : (string -> string -> int -> int * bool) ref @@ -110,3 +130,23 @@ (* Used by Trace module *) val may_trace : bool ref + +(* Used by test mode *) + +val type_mode: bool ref + +(* Printer config *) + +type print_config = { + mutable welcome: unit -> string; + mutable prompt: unit -> string; + mutable print_value: bool; + mutable print_type: bool; + mutable print_exception: bool; + mutable print_module: bool; + mutable print_modtype: bool; + mutable print_class: bool; + mutable print_cltype: bool; +} + +val print_conf : print_config diff -Naur ocaml-3.11.0/toplevel/toploop.mli.orig ocaml-3.11.0-enhtop+/toplevel/toploop.mli.orig --- ocaml-3.11.0/toplevel/toploop.mli.orig 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/toplevel/toploop.mli.orig 2009-03-24 10:55:08.065441575 -0400 @@ -0,0 +1,112 @@ +(***********************************************************************) +(* *) +(* Objective Caml *) +(* *) +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) +(* *) +(* Copyright 1996 Institut National de Recherche en Informatique et *) +(* en Automatique. All rights reserved. This file is distributed *) +(* under the terms of the Q Public License version 1.0. *) +(* *) +(***********************************************************************) + +(* $Id: toploop.mli,v 1.26 2007/12/04 13:38:58 doligez Exp $ *) + +open Format + +(* Accessors for the table of toplevel value bindings. These functions + must appear as first and second exported functions in this module. + (See module Translmod.) *) +val getvalue : string -> Obj.t +val setvalue : string -> Obj.t -> unit + +(* Set the load paths, before running anything *) + +val set_paths : unit -> unit + +(* The interactive toplevel loop *) + +val loop : formatter -> unit + +(* Read and execute a script from the given file *) + +val run_script : formatter -> string -> string array -> bool + (* true if successful, false if error *) + +(* Interface with toplevel directives *) + +type directive_fun = + | Directive_none of (unit -> unit) + | Directive_string of (string -> unit) + | Directive_int of (int -> unit) + | Directive_ident of (Longident.t -> unit) + | Directive_bool of (bool -> unit) + +val directive_table : (string, directive_fun) Hashtbl.t + (* Table of known directives, with their execution function *) +val toplevel_env : Env.t ref + (* Typing environment for the toplevel *) +val initialize_toplevel_env : unit -> unit + (* Initialize the typing environment for the toplevel *) +val print_exception_outcome : formatter -> exn -> unit + (* Print an exception resulting from the evaluation of user code. *) +val execute_phrase : bool -> formatter -> Parsetree.toplevel_phrase -> bool + (* Execute the given toplevel phrase. Return [true] if the + phrase executed with no errors and [false] otherwise. + First bool says whether the values and types of the results + should be printed. Uncaught exceptions are always printed. *) +val use_file : formatter -> string -> bool +val use_silently : formatter -> string -> bool + (* Read and execute commands from a file. + [use_file] prints the types and values of the results. + [use_silently] does not print them. *) +val eval_path: Path.t -> Obj.t + (* Return the toplevel object referred to by the given path *) + +(* Printing of values *) + +val print_value: Env.t -> Obj.t -> formatter -> Types.type_expr -> unit +val print_untyped_exception: formatter -> Obj.t -> unit + +val install_printer : + Path.t -> Types.type_expr -> (formatter -> Obj.t -> unit) -> unit +val remove_printer : Path.t -> unit + +val max_printer_depth: int ref +val max_printer_steps: int ref + +(* Hooks for external parsers and printers *) + +val parse_toplevel_phrase : (Lexing.lexbuf -> Parsetree.toplevel_phrase) ref +val parse_use_file : (Lexing.lexbuf -> Parsetree.toplevel_phrase list) ref +val print_location : formatter -> Location.t -> unit +val print_error : formatter -> Location.t -> unit +val print_warning : Location.t -> formatter -> Warnings.t -> unit +val input_name : string ref + +val print_out_value : + (formatter -> Outcometree.out_value -> unit) ref +val print_out_type : + (formatter -> Outcometree.out_type -> unit) ref +val print_out_class_type : + (formatter -> Outcometree.out_class_type -> unit) ref +val print_out_module_type : + (formatter -> Outcometree.out_module_type -> unit) ref +val print_out_sig_item : + (formatter -> Outcometree.out_sig_item -> unit) ref +val print_out_signature : + (formatter -> Outcometree.out_sig_item list -> unit) ref +val print_out_phrase : + (formatter -> Outcometree.out_phrase -> unit) ref + +(* Hooks for external line editor *) + +val read_interactive_input : (string -> string -> int -> int * bool) ref + +(* Hooks for initialization *) + +val toplevel_startup_hook : (unit -> unit) ref + +(* Used by Trace module *) + +val may_trace : bool ref diff -Naur ocaml-3.11.0/typing/env.ml ocaml-3.11.0-enhtop+/typing/env.ml --- ocaml-3.11.0/typing/env.ml 2008-10-06 09:53:54.000000000 -0400 +++ ocaml-3.11.0-enhtop+/typing/env.ml 2009-03-24 10:55:08.065441575 -0400 @@ -190,6 +190,47 @@ close_in ic; raise(Error(Corrupted_interface(filename))) + +(* Added by Peng for completion *) +let find_pers_struct_with_partialname = + let forcedall = ref false in + (fun name -> + (* completion requires that we load all the interface files. *) + if not !forcedall then begin + let _ = List.map + (fun (modname, path) -> (modname, read_pers_struct modname path)) + (find_in_path_uncap_partials !load_path "") + in + forcedall := true + end; + + (* Now that that's out of the way, let's make our string and do completion *) + let lastindx = (String.length name) - 1 in + let left = if(lastindx >= 0) then name else (String.make 4 (Char.chr 0)) in + let right = + if(lastindx >= 0) then + let temp = (String.copy name) in + let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in + (String.set temp lastindx nextchar); + temp + else + String.make 4 (Char.chr 255) in + let ispartialmatch astring = + let cl = compare left astring in + let rl = compare right astring in + cl != rl & rl != 0 + in + Hashtbl.fold + (fun akey aval acc -> + if ispartialmatch akey then + ((akey,aval)::acc) + else + acc) + persistent_structures + []) +(* End *) + + let find_pers_struct name = try Hashtbl.find persistent_structures name @@ -426,6 +467,82 @@ and lookup_cltype = lookup (fun env -> env.cltypes) (fun sc -> sc.comp_cltypes) + + +(* Peng added this for #tell completion *) +let lookup_modules lid env = + match lid with + Lident s -> + (* from stuff already loaded *) + let results_loaded = Ident.find_partial_names s env.modules in + let results_notloaded = (* add stuff not loaded *) + (List.map (fun (modname, ps) -> + (Pident(Ident.create_persistent modname), + Tmty_signature ps.ps_sig)) + (find_pers_struct_with_partialname s)) + in (* merge them *) + List.fold_left + (fun acc ele -> + if (List.exists (fun x -> x = ele) acc) then + acc + else + ele::acc) + results_loaded + results_notloaded + | Ldot(l, s) -> + (try let (p, descr) = lookup_module_descr l env in + match Lazy.force descr with + | Structure_comps c -> + List.map + (fun (fullname, (data,pos)) -> + (Pdot(p, fullname, pos), Lazy.force data)) + (Tbl.find_partial s c.comp_modules) + | Functor_comps f -> [] + with Not_found -> []) + | Lapply(l1, l2) -> + (* This should never happen as the longident (lid) comes from + Longident.parse which never constructs Lapply *) + [] + +let lookupN proj1 proj2 lid env = + try + match lid with + Lident s -> + Ident.find_partial_names s (proj1 env) + | Ldot(l, s) -> + let (p, desc) = lookup_module_descr l env in + begin match Lazy.force desc with + Structure_comps c -> + List.map (fun (fullname, (data,pos)) -> + Pdot(p, fullname, pos), data) + (Tbl.find_partial s (proj2 c)) + | Functor_comps f -> + [] + end + | Lapply(l1, l2) -> + [] + with Not_found -> [] + + + +let lookup_values = + lookupN (fun env -> env.values) (fun sc -> sc.comp_values) +and lookup_types = + lookupN (fun env -> env.types) (fun sc -> sc.comp_types) +and lookup_modtypes = + lookupN (fun env -> env.modtypes) (fun sc -> sc.comp_modtypes) +and lookup_classes = + lookupN (fun env -> env.classes) (fun sc -> sc.comp_classes) +and lookup_cltypes = + lookupN (fun env -> env.cltypes) (fun sc -> sc.comp_cltypes) + +(* End *) + + + + + + (* Expand manifest module type names at the top of the given module type *) let rec scrape_modtype mty env = diff -Naur ocaml-3.11.0/typing/env.ml.orig ocaml-3.11.0-enhtop+/typing/env.ml.orig --- ocaml-3.11.0/typing/env.ml.orig 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/typing/env.ml.orig 2009-03-24 10:55:08.065441575 -0400 @@ -0,0 +1,862 @@ +(***********************************************************************) +(* *) +(* Objective Caml *) +(* *) +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) +(* *) +(* Copyright 1996 Institut National de Recherche en Informatique et *) +(* en Automatique. All rights reserved. This file is distributed *) +(* under the terms of the Q Public License version 1.0. *) +(* *) +(***********************************************************************) + +(* $Id: env.ml,v 1.66 2008/10/06 13:53:54 doligez Exp $ *) + +(* Environment handling *) + +open Config +open Misc +open Asttypes +open Longident +open Path +open Types + + +type error = + Not_an_interface of string + | Corrupted_interface of string + | Illegal_renaming of string * string + | Inconsistent_import of string * string * string + | Need_recursive_types of string * string + +exception Error of error + +type summary = + Env_empty + | Env_value of summary * Ident.t * value_description + | Env_type of summary * Ident.t * type_declaration + | Env_exception of summary * Ident.t * exception_declaration + | Env_module of summary * Ident.t * module_type + | Env_modtype of summary * Ident.t * modtype_declaration + | Env_class of summary * Ident.t * class_declaration + | Env_cltype of summary * Ident.t * cltype_declaration + | Env_open of summary * Path.t + +type t = { + values: (Path.t * value_description) Ident.tbl; + annotations: (Path.t * Annot.ident) Ident.tbl; + constrs: constructor_description Ident.tbl; + labels: label_description Ident.tbl; + types: (Path.t * type_declaration) Ident.tbl; + modules: (Path.t * module_type) Ident.tbl; + modtypes: (Path.t * modtype_declaration) Ident.tbl; + components: (Path.t * module_components) Ident.tbl; + classes: (Path.t * class_declaration) Ident.tbl; + cltypes: (Path.t * cltype_declaration) Ident.tbl; + summary: summary +} + +and module_components = module_components_repr Lazy.t + +and module_components_repr = + Structure_comps of structure_components + | Functor_comps of functor_components + +and structure_components = { + mutable comp_values: (string, (value_description * int)) Tbl.t; + mutable comp_annotations: (string, (Annot.ident * int)) Tbl.t; + mutable comp_constrs: (string, (constructor_description * int)) Tbl.t; + mutable comp_labels: (string, (label_description * int)) Tbl.t; + mutable comp_types: (string, (type_declaration * int)) Tbl.t; + mutable comp_modules: (string, (module_type Lazy.t * int)) Tbl.t; + mutable comp_modtypes: (string, (modtype_declaration * int)) Tbl.t; + mutable comp_components: (string, (module_components * int)) Tbl.t; + mutable comp_classes: (string, (class_declaration * int)) Tbl.t; + mutable comp_cltypes: (string, (cltype_declaration * int)) Tbl.t +} + +and functor_components = { + fcomp_param: Ident.t; (* Formal parameter *) + fcomp_arg: module_type; (* Argument signature *) + fcomp_res: module_type; (* Result signature *) + fcomp_env: t; (* Environment in which the result signature makes sense *) + fcomp_subst: Subst.t; (* Prefixing substitution for the result signature *) + fcomp_cache: (Path.t, module_components) Hashtbl.t (* For memoization *) +} + +let empty = { + values = Ident.empty; annotations = Ident.empty; constrs = Ident.empty; + labels = Ident.empty; types = Ident.empty; + modules = Ident.empty; modtypes = Ident.empty; + components = Ident.empty; classes = Ident.empty; + cltypes = Ident.empty; + summary = Env_empty } + +let diff_keys tbl1 tbl2 = + let keys2 = Ident.keys tbl2 in + List.filter + (fun id -> + match Ident.find_same id tbl2 with Pident _, _ -> + (try ignore (Ident.find_same id tbl1); false with Not_found -> true) + | _ -> false) + keys2 + +let diff env1 env2 = + diff_keys env1.values env2.values @ + diff_keys env1.modules env2.modules @ + diff_keys env1.classes env2.classes + +(* Forward declarations *) + +let components_of_module' = + ref ((fun env sub path mty -> assert false) : + t -> Subst.t -> Path.t -> module_type -> module_components) +let components_of_functor_appl' = + ref ((fun f p1 p2 -> assert false) : + functor_components -> Path.t -> Path.t -> module_components) +let check_modtype_inclusion = + (* to be filled with Includemod.check_modtype_inclusion *) + ref ((fun env mty1 path1 mty2 -> assert false) : + t -> module_type -> Path.t -> module_type -> unit) + +(* The name of the compilation unit currently compiled. + "" if outside a compilation unit. *) + +let current_unit = ref "" + +(* Persistent structure descriptions *) + +type pers_flags = Rectypes + +type pers_struct = + { ps_name: string; + ps_sig: signature; + ps_comps: module_components; + ps_crcs: (string * Digest.t) list; + ps_filename: string; + ps_flags: pers_flags list } + +let persistent_structures = + (Hashtbl.create 17 : (string, pers_struct) Hashtbl.t) + +(* Consistency between persistent structures *) + +let crc_units = Consistbl.create() + +let check_consistency filename crcs = + try + List.iter + (fun (name, crc) -> Consistbl.check crc_units name crc filename) + crcs + with Consistbl.Inconsistency(name, source, auth) -> + raise(Error(Inconsistent_import(name, auth, source))) + +(* Reading persistent structures from .cmi files *) + +let read_pers_struct modname filename = + let ic = open_in_bin filename in + try + let buffer = String.create (String.length cmi_magic_number) in + really_input ic buffer 0 (String.length cmi_magic_number); + if buffer <> cmi_magic_number then begin + close_in ic; + raise(Error(Not_an_interface filename)) + end; + let (name, sign) = input_value ic in + let crcs = input_value ic in + let flags = input_value ic in + close_in ic; + let comps = + !components_of_module' empty Subst.identity + (Pident(Ident.create_persistent name)) + (Tmty_signature sign) in + let ps = { ps_name = name; + ps_sig = sign; + ps_comps = comps; + ps_crcs = crcs; + ps_filename = filename; + ps_flags = flags } in + if ps.ps_name <> modname then + raise(Error(Illegal_renaming(ps.ps_name, filename))); + check_consistency filename ps.ps_crcs; + List.iter + (function Rectypes -> + if not !Clflags.recursive_types then + raise(Error(Need_recursive_types(ps.ps_name, !current_unit)))) + ps.ps_flags; + Hashtbl.add persistent_structures modname ps; + ps + with End_of_file | Failure _ -> + close_in ic; + raise(Error(Corrupted_interface(filename))) + +let find_pers_struct name = + try + Hashtbl.find persistent_structures name + with Not_found -> + read_pers_struct name (find_in_path_uncap !load_path (name ^ ".cmi")) + +let reset_cache () = + current_unit := ""; + Hashtbl.clear persistent_structures; + Consistbl.clear crc_units + +let set_unit_name name = + current_unit := name + +(* Lookup by identifier *) + +let rec find_module_descr path env = + match path with + Pident id -> + begin try + let (p, desc) = Ident.find_same id env.components + in desc + with Not_found -> + if Ident.persistent id + then (find_pers_struct (Ident.name id)).ps_comps + else raise Not_found + end + | Pdot(p, s, pos) -> + begin match Lazy.force(find_module_descr p env) with + Structure_comps c -> + let (descr, pos) = Tbl.find s c.comp_components in + descr + | Functor_comps f -> + raise Not_found + end + | Papply(p1, p2) -> + begin match Lazy.force(find_module_descr p1 env) with + Functor_comps f -> + !components_of_functor_appl' f p1 p2 + | Structure_comps c -> + raise Not_found + end + +let find proj1 proj2 path env = + match path with + Pident id -> + let (p, data) = Ident.find_same id (proj1 env) + in data + | Pdot(p, s, pos) -> + begin match Lazy.force(find_module_descr p env) with + Structure_comps c -> + let (data, pos) = Tbl.find s (proj2 c) in data + | Functor_comps f -> + raise Not_found + end + | Papply(p1, p2) -> + raise Not_found + +let find_value = + find (fun env -> env.values) (fun sc -> sc.comp_values) +and find_type = + find (fun env -> env.types) (fun sc -> sc.comp_types) +and find_modtype = + find (fun env -> env.modtypes) (fun sc -> sc.comp_modtypes) +and find_class = + find (fun env -> env.classes) (fun sc -> sc.comp_classes) +and find_cltype = + find (fun env -> env.cltypes) (fun sc -> sc.comp_cltypes) + +(* Find the manifest type associated to a type when appropriate: + - the type should be public or should have a private row, + - the type should have an associated manifest type. *) +let find_type_expansion path env = + let decl = find_type path env in + match decl.type_manifest with + | Some body when decl.type_private = Public + || decl.type_kind <> Type_abstract + || Btype.has_constr_row body -> (decl.type_params, body) + (* The manifest type of Private abstract data types without + private row are still considered unknown to the type system. + Hence, this case is caught by the following clause that also handles + purely abstract data types without manifest type definition. *) + | _ -> raise Not_found + +(* Find the manifest type information associated to a type, i.e. + the necessary information for the compiler's type-based optimisations. + In particular, the manifest type associated to a private abstract type + is revealed for the sake of compiler's type-based optimisations. *) +let find_type_expansion_opt path env = + let decl = find_type path env in + match decl.type_manifest with + (* The manifest type of Private abstract data types can still get + an approximation using their manifest type. *) + | Some body -> (decl.type_params, body) + | _ -> raise Not_found + +let find_modtype_expansion path env = + match find_modtype path env with + Tmodtype_abstract -> raise Not_found + | Tmodtype_manifest mty -> mty + +let find_module path env = + match path with + Pident id -> + begin try + let (p, data) = Ident.find_same id env.modules + in data + with Not_found -> + if Ident.persistent id then + let ps = find_pers_struct (Ident.name id) in + Tmty_signature(ps.ps_sig) + else raise Not_found + end + | Pdot(p, s, pos) -> + begin match Lazy.force (find_module_descr p env) with + Structure_comps c -> + let (data, pos) = Tbl.find s c.comp_modules in Lazy.force data + | Functor_comps f -> + raise Not_found + end + | Papply(p1, p2) -> + raise Not_found (* not right *) + +(* Lookup by name *) + +let rec lookup_module_descr lid env = + match lid with + Lident s -> + begin try + Ident.find_name s env.components + with Not_found -> + if s = !current_unit then raise Not_found; + let ps = find_pers_struct s in + (Pident(Ident.create_persistent s), ps.ps_comps) + end + | Ldot(l, s) -> + let (p, descr) = lookup_module_descr l env in + begin match Lazy.force descr with + Structure_comps c -> + let (descr, pos) = Tbl.find s c.comp_components in + (Pdot(p, s, pos), descr) + | Functor_comps f -> + raise Not_found + end + | Lapply(l1, l2) -> + let (p1, desc1) = lookup_module_descr l1 env in + let (p2, mty2) = lookup_module l2 env in + begin match Lazy.force desc1 with + Functor_comps f -> + !check_modtype_inclusion env mty2 p2 f.fcomp_arg; + (Papply(p1, p2), !components_of_functor_appl' f p1 p2) + | Structure_comps c -> + raise Not_found + end + +and lookup_module lid env = + match lid with + Lident s -> + begin try + Ident.find_name s env.modules + with Not_found -> + if s = !current_unit then raise Not_found; + let ps = find_pers_struct s in + (Pident(Ident.create_persistent s), Tmty_signature ps.ps_sig) + end + | Ldot(l, s) -> + let (p, descr) = lookup_module_descr l env in + begin match Lazy.force descr with + Structure_comps c -> + let (data, pos) = Tbl.find s c.comp_modules in + (Pdot(p, s, pos), Lazy.force data) + | Functor_comps f -> + raise Not_found + end + | Lapply(l1, l2) -> + let (p1, desc1) = lookup_module_descr l1 env in + let (p2, mty2) = lookup_module l2 env in + let p = Papply(p1, p2) in + begin match Lazy.force desc1 with + Functor_comps f -> + !check_modtype_inclusion env mty2 p2 f.fcomp_arg; + (p, Subst.modtype (Subst.add_module f.fcomp_param p2 f.fcomp_subst) + f.fcomp_res) + | Structure_comps c -> + raise Not_found + end + +let lookup proj1 proj2 lid env = + match lid with + Lident s -> + Ident.find_name s (proj1 env) + | Ldot(l, s) -> + let (p, desc) = lookup_module_descr l env in + begin match Lazy.force desc with + Structure_comps c -> + let (data, pos) = Tbl.find s (proj2 c) in + (Pdot(p, s, pos), data) + | Functor_comps f -> + raise Not_found + end + | Lapply(l1, l2) -> + raise Not_found + +let lookup_simple proj1 proj2 lid env = + match lid with + Lident s -> + Ident.find_name s (proj1 env) + | Ldot(l, s) -> + let (p, desc) = lookup_module_descr l env in + begin match Lazy.force desc with + Structure_comps c -> + let (data, pos) = Tbl.find s (proj2 c) in + data + | Functor_comps f -> + raise Not_found + end + | Lapply(l1, l2) -> + raise Not_found + +let lookup_value = + lookup (fun env -> env.values) (fun sc -> sc.comp_values) +let lookup_annot id e = + lookup (fun env -> env.annotations) (fun sc -> sc.comp_annotations) id e +and lookup_constructor = + lookup_simple (fun env -> env.constrs) (fun sc -> sc.comp_constrs) +and lookup_label = + lookup_simple (fun env -> env.labels) (fun sc -> sc.comp_labels) +and lookup_type = + lookup (fun env -> env.types) (fun sc -> sc.comp_types) +and lookup_modtype = + lookup (fun env -> env.modtypes) (fun sc -> sc.comp_modtypes) +and lookup_class = + lookup (fun env -> env.classes) (fun sc -> sc.comp_classes) +and lookup_cltype = + lookup (fun env -> env.cltypes) (fun sc -> sc.comp_cltypes) + +(* Expand manifest module type names at the top of the given module type *) + +let rec scrape_modtype mty env = + match mty with + Tmty_ident path -> + begin try + scrape_modtype (find_modtype_expansion path env) env + with Not_found -> + mty + end + | _ -> mty + +(* Compute constructor descriptions *) + +let constructors_of_type ty_path decl = + match decl.type_kind with + Type_variant cstrs -> + Datarepr.constructor_descrs + (Btype.newgenty (Tconstr(ty_path, decl.type_params, ref Mnil))) + cstrs decl.type_private + | Type_record _ | Type_abstract -> [] + +(* Compute label descriptions *) + +let labels_of_type ty_path decl = + match decl.type_kind with + Type_record(labels, rep) -> + Datarepr.label_descrs + (Btype.newgenty (Tconstr(ty_path, decl.type_params, ref Mnil))) + labels rep decl.type_private + | Type_variant _ | Type_abstract -> [] + +(* Given a signature and a root path, prefix all idents in the signature + by the root path and build the corresponding substitution. *) + +let rec prefix_idents root pos sub = function + [] -> ([], sub) + | Tsig_value(id, decl) :: rem -> + let p = Pdot(root, Ident.name id, pos) in + let nextpos = match decl.val_kind with Val_prim _ -> pos | _ -> pos+1 in + let (pl, final_sub) = prefix_idents root nextpos sub rem in + (p::pl, final_sub) + | Tsig_type(id, decl, _) :: rem -> + let p = Pdot(root, Ident.name id, nopos) in + let (pl, final_sub) = + prefix_idents root pos (Subst.add_type id p sub) rem in + (p::pl, final_sub) + | Tsig_exception(id, decl) :: rem -> + let p = Pdot(root, Ident.name id, pos) in + let (pl, final_sub) = prefix_idents root (pos+1) sub rem in + (p::pl, final_sub) + | Tsig_module(id, mty, _) :: rem -> + let p = Pdot(root, Ident.name id, pos) in + let (pl, final_sub) = + prefix_idents root (pos+1) (Subst.add_module id p sub) rem in + (p::pl, final_sub) + | Tsig_modtype(id, decl) :: rem -> + let p = Pdot(root, Ident.name id, nopos) in + let (pl, final_sub) = + prefix_idents root pos + (Subst.add_modtype id (Tmty_ident p) sub) rem in + (p::pl, final_sub) + | Tsig_class(id, decl, _) :: rem -> + let p = Pdot(root, Ident.name id, pos) in + let (pl, final_sub) = prefix_idents root (pos + 1) sub rem in + (p::pl, final_sub) + | Tsig_cltype(id, decl, _) :: rem -> + let p = Pdot(root, Ident.name id, nopos) in + let (pl, final_sub) = prefix_idents root pos sub rem in + (p::pl, final_sub) + +(* Compute structure descriptions *) + +let rec components_of_module env sub path mty = + lazy(match scrape_modtype mty env with + Tmty_signature sg -> + let c = + { comp_values = Tbl.empty; comp_annotations = Tbl.empty; + comp_constrs = Tbl.empty; + comp_labels = Tbl.empty; comp_types = Tbl.empty; + comp_modules = Tbl.empty; comp_modtypes = Tbl.empty; + comp_components = Tbl.empty; comp_classes = Tbl.empty; + comp_cltypes = Tbl.empty } in + let (pl, sub) = prefix_idents path 0 sub sg in + let env = ref env in + let pos = ref 0 in + List.iter2 (fun item path -> + match item with + Tsig_value(id, decl) -> + let decl' = Subst.value_description sub decl in + c.comp_values <- + Tbl.add (Ident.name id) (decl', !pos) c.comp_values; + if !Clflags.annotations then begin + c.comp_annotations <- + Tbl.add (Ident.name id) (Annot.Iref_external, !pos) + c.comp_annotations; + end; + begin match decl.val_kind with + Val_prim _ -> () | _ -> incr pos + end + | Tsig_type(id, decl, _) -> + let decl' = Subst.type_declaration sub decl in + c.comp_types <- + Tbl.add (Ident.name id) (decl', nopos) c.comp_types; + List.iter + (fun (name, descr) -> + c.comp_constrs <- Tbl.add name (descr, nopos) c.comp_constrs) + (constructors_of_type path decl'); + List.iter + (fun (name, descr) -> + c.comp_labels <- Tbl.add name (descr, nopos) c.comp_labels) + (labels_of_type path decl'); + env := store_type_infos id path decl !env + | Tsig_exception(id, decl) -> + let decl' = Subst.exception_declaration sub decl in + let cstr = Datarepr.exception_descr path decl' in + c.comp_constrs <- + Tbl.add (Ident.name id) (cstr, !pos) c.comp_constrs; + incr pos + | Tsig_module(id, mty, _) -> + let mty' = lazy (Subst.modtype sub mty) in + c.comp_modules <- + Tbl.add (Ident.name id) (mty', !pos) c.comp_modules; + let comps = components_of_module !env sub path mty in + c.comp_components <- + Tbl.add (Ident.name id) (comps, !pos) c.comp_components; + env := store_module id path mty !env; + incr pos + | Tsig_modtype(id, decl) -> + let decl' = Subst.modtype_declaration sub decl in + c.comp_modtypes <- + Tbl.add (Ident.name id) (decl', nopos) c.comp_modtypes; + env := store_modtype id path decl !env + | Tsig_class(id, decl, _) -> + let decl' = Subst.class_declaration sub decl in + c.comp_classes <- + Tbl.add (Ident.name id) (decl', !pos) c.comp_classes; + incr pos + | Tsig_cltype(id, decl, _) -> + let decl' = Subst.cltype_declaration sub decl in + c.comp_cltypes <- + Tbl.add (Ident.name id) (decl', !pos) c.comp_cltypes) + sg pl; + Structure_comps c + | Tmty_functor(param, ty_arg, ty_res) -> + Functor_comps { + fcomp_param = param; + (* fcomp_arg must be prefixed eagerly, because it is interpreted + in the outer environment, not in env *) + fcomp_arg = Subst.modtype sub ty_arg; + (* fcomp_res is prefixed lazily, because it is interpreted in env *) + fcomp_res = ty_res; + fcomp_env = env; + fcomp_subst = sub; + fcomp_cache = Hashtbl.create 17 } + | Tmty_ident p -> + Structure_comps { + comp_values = Tbl.empty; comp_annotations = Tbl.empty; + comp_constrs = Tbl.empty; + comp_labels = Tbl.empty; comp_types = Tbl.empty; + comp_modules = Tbl.empty; comp_modtypes = Tbl.empty; + comp_components = Tbl.empty; comp_classes = Tbl.empty; + comp_cltypes = Tbl.empty }) + +(* Insertion of bindings by identifier + path *) + +and store_value id path decl env = + { env with + values = Ident.add id (path, decl) env.values; + summary = Env_value(env.summary, id, decl) } + +and store_annot id path annot env = + if !Clflags.annotations then + { env with + annotations = Ident.add id (path, annot) env.annotations } + else env + +and store_type id path info env = + { env with + constrs = + List.fold_right + (fun (name, descr) constrs -> + Ident.add (Ident.create name) descr constrs) + (constructors_of_type path info) + env.constrs; + labels = + List.fold_right + (fun (name, descr) labels -> + Ident.add (Ident.create name) descr labels) + (labels_of_type path info) + env.labels; + types = Ident.add id (path, info) env.types; + summary = Env_type(env.summary, id, info) } + +and store_type_infos id path info env = + (* Simplified version of store_type that doesn't compute and store + constructor and label infos, but simply record the arity and + manifest-ness of the type. Used in components_of_module to + keep track of type abbreviations (e.g. type t = float) in the + computation of label representations. *) + { env with + types = Ident.add id (path, info) env.types; + summary = Env_type(env.summary, id, info) } + +and store_exception id path decl env = + { env with + constrs = Ident.add id (Datarepr.exception_descr path decl) env.constrs; + summary = Env_exception(env.summary, id, decl) } + +and store_module id path mty env = + { env with + modules = Ident.add id (path, mty) env.modules; + components = + Ident.add id (path, components_of_module env Subst.identity path mty) + env.components; + summary = Env_module(env.summary, id, mty) } + +and store_modtype id path info env = + { env with + modtypes = Ident.add id (path, info) env.modtypes; + summary = Env_modtype(env.summary, id, info) } + +and store_class id path desc env = + { env with + classes = Ident.add id (path, desc) env.classes; + summary = Env_class(env.summary, id, desc) } + +and store_cltype id path desc env = + { env with + cltypes = Ident.add id (path, desc) env.cltypes; + summary = Env_cltype(env.summary, id, desc) } + +(* Compute the components of a functor application in a path. *) + +let components_of_functor_appl f p1 p2 = + try + Hashtbl.find f.fcomp_cache p2 + with Not_found -> + let p = Papply(p1, p2) in + let mty = + Subst.modtype (Subst.add_module f.fcomp_param p2 Subst.identity) + f.fcomp_res in + let comps = components_of_module f.fcomp_env f.fcomp_subst p mty in + Hashtbl.add f.fcomp_cache p2 comps; + comps + +(* Define forward functions *) + +let _ = + components_of_module' := components_of_module; + components_of_functor_appl' := components_of_functor_appl + +(* Insertion of bindings by identifier *) + +let add_value id desc env = + store_value id (Pident id) desc env + +let add_annot id annot env = + store_annot id (Pident id) annot env + +and add_type id info env = + store_type id (Pident id) info env + +and add_exception id decl env = + store_exception id (Pident id) decl env + +and add_module id mty env = + store_module id (Pident id) mty env + +and add_modtype id info env = + store_modtype id (Pident id) info env + +and add_class id ty env = + store_class id (Pident id) ty env + +and add_cltype id ty env = + store_cltype id (Pident id) ty env + +(* Insertion of bindings by name *) + +let enter store_fun name data env = + let id = Ident.create name in (id, store_fun id (Pident id) data env) + +let enter_value = enter store_value +and enter_type = enter store_type +and enter_exception = enter store_exception +and enter_module = enter store_module +and enter_modtype = enter store_modtype +and enter_class = enter store_class +and enter_cltype = enter store_cltype + +(* Insertion of all components of a signature *) + +let add_item comp env = + match comp with + Tsig_value(id, decl) -> add_value id decl env + | Tsig_type(id, decl, _) -> add_type id decl env + | Tsig_exception(id, decl) -> add_exception id decl env + | Tsig_module(id, mty, _) -> add_module id mty env + | Tsig_modtype(id, decl) -> add_modtype id decl env + | Tsig_class(id, decl, _) -> add_class id decl env + | Tsig_cltype(id, decl, _) -> add_cltype id decl env + +let rec add_signature sg env = + match sg with + [] -> env + | comp :: rem -> add_signature rem (add_item comp env) + +(* Open a signature path *) + +let open_signature root sg env = + (* First build the paths and substitution *) + let (pl, sub) = prefix_idents root 0 Subst.identity sg in + (* Then enter the components in the environment after substitution *) + let newenv = + List.fold_left2 + (fun env item p -> + match item with + Tsig_value(id, decl) -> + let e1 = store_value (Ident.hide id) p + (Subst.value_description sub decl) env + in store_annot (Ident.hide id) p (Annot.Iref_external) e1 + | Tsig_type(id, decl, _) -> + store_type (Ident.hide id) p + (Subst.type_declaration sub decl) env + | Tsig_exception(id, decl) -> + store_exception (Ident.hide id) p + (Subst.exception_declaration sub decl) env + | Tsig_module(id, mty, _) -> + store_module (Ident.hide id) p (Subst.modtype sub mty) env + | Tsig_modtype(id, decl) -> + store_modtype (Ident.hide id) p + (Subst.modtype_declaration sub decl) env + | Tsig_class(id, decl, _) -> + store_class (Ident.hide id) p + (Subst.class_declaration sub decl) env + | Tsig_cltype(id, decl, _) -> + store_cltype (Ident.hide id) p + (Subst.cltype_declaration sub decl) env) + env sg pl in + { newenv with summary = Env_open(env.summary, root) } + +(* Open a signature from a file *) + +let open_pers_signature name env = + let ps = find_pers_struct name in + open_signature (Pident(Ident.create_persistent name)) ps.ps_sig env + +(* Read a signature from a file *) + +let read_signature modname filename = + let ps = read_pers_struct modname filename in ps.ps_sig + +(* Return the CRC of the interface of the given compilation unit *) + +let crc_of_unit name = + let ps = find_pers_struct name in + try + List.assoc name ps.ps_crcs + with Not_found -> + assert false + +(* Return the list of imported interfaces with their CRCs *) + +let imported_units() = + Consistbl.extract crc_units + +(* Save a signature to a file *) + +let save_signature_with_imports sg modname filename imports = + Btype.cleanup_abbrev (); + Subst.reset_for_saving (); + let sg = Subst.signature (Subst.for_saving Subst.identity) sg in + let oc = open_out_bin filename in + try + output_string oc cmi_magic_number; + output_value oc (modname, sg); + flush oc; + let crc = Digest.file filename in + let crcs = (modname, crc) :: imports in + output_value oc crcs; + let flags = if !Clflags.recursive_types then [Rectypes] else [] in + output_value oc flags; + close_out oc; + (* Enter signature in persistent table so that imported_unit() + will also return its crc *) + let comps = + components_of_module empty Subst.identity + (Pident(Ident.create_persistent modname)) (Tmty_signature sg) in + let ps = + { ps_name = modname; + ps_sig = sg; + ps_comps = comps; + ps_crcs = crcs; + ps_filename = filename; + ps_flags = flags } in + Hashtbl.add persistent_structures modname ps; + Consistbl.set crc_units modname crc filename + with exn -> + close_out oc; + remove_file filename; + raise exn + +let save_signature sg modname filename = + save_signature_with_imports sg modname filename (imported_units()) + +(* Make the initial environment *) + +let initial = Predef.build_initial_env add_type add_exception empty + +(* Return the environment summary *) + +let summary env = env.summary + +(* Error report *) + +open Format + +let report_error ppf = function + | Not_an_interface filename -> fprintf ppf + "%s@ is not a compiled interface" filename + | Corrupted_interface filename -> fprintf ppf + "Corrupted compiled interface@ %s" filename + | Illegal_renaming(modname, filename) -> fprintf ppf + "Wrong file naming: %s@ contains the compiled interface for@ %s" + filename modname + | Inconsistent_import(name, source1, source2) -> fprintf ppf + "@[The files %s@ and %s@ \ + make inconsistent assumptions@ over interface %s@]" + source1 source2 name + | Need_recursive_types(import, export) -> + fprintf ppf + "@[Unit %s imports from %s, which uses recursive types.@ %s@]" + import export "The compilation flag -rectypes is required" diff -Naur ocaml-3.11.0/typing/env.mli ocaml-3.11.0-enhtop+/typing/env.mli --- ocaml-3.11.0/typing/env.mli 2008-10-06 09:53:54.000000000 -0400 +++ ocaml-3.11.0-enhtop+/typing/env.mli 2009-03-24 10:55:08.065441575 -0400 @@ -49,6 +49,16 @@ val lookup_class: Longident.t -> t -> Path.t * class_declaration val lookup_cltype: Longident.t -> t -> Path.t * cltype_declaration +(* Peng added this for #tell completion *) +val lookup_values: Longident.t -> t -> (Path.t * value_description) list +val lookup_types: Longident.t -> t -> (Path.t * type_declaration) list +val lookup_modtypes: Longident.t -> t -> (Path.t * modtype_declaration) list +val lookup_classes: Longident.t -> t -> (Path.t * class_declaration) list +val lookup_cltypes: Longident.t -> t -> (Path.t * cltype_declaration) list +val lookup_modules: Longident.t -> t -> (Path.t * module_type) list +(* End *) + + (* Insertion by identifier *) val add_value: Ident.t -> value_description -> t -> t diff -Naur ocaml-3.11.0/typing/env.mli.orig ocaml-3.11.0-enhtop+/typing/env.mli.orig --- ocaml-3.11.0/typing/env.mli.orig 1969-12-31 19:00:00.000000000 -0500 +++ ocaml-3.11.0-enhtop+/typing/env.mli.orig 2009-03-24 10:55:08.065441575 -0400 @@ -0,0 +1,146 @@ +(***********************************************************************) +(* *) +(* Objective Caml *) +(* *) +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) +(* *) +(* Copyright 1996 Institut National de Recherche en Informatique et *) +(* en Automatique. All rights reserved. This file is distributed *) +(* under the terms of the Q Public License version 1.0. *) +(* *) +(***********************************************************************) + +(* $Id: env.mli,v 1.35 2008/10/06 13:53:54 doligez Exp $ *) + +(* Environment handling *) + +open Types + +type t + +val empty: t +val initial: t +val diff: t -> t -> Ident.t list + +(* Lookup by paths *) + +val find_value: Path.t -> t -> value_description +val find_type: Path.t -> t -> type_declaration +val find_module: Path.t -> t -> module_type +val find_modtype: Path.t -> t -> modtype_declaration +val find_class: Path.t -> t -> class_declaration +val find_cltype: Path.t -> t -> cltype_declaration + +val find_type_expansion: Path.t -> t -> type_expr list * type_expr +val find_type_expansion_opt: Path.t -> t -> type_expr list * type_expr +(* Find the manifest type information associated to a type for the sake + of the compiler's type-based optimisations. *) +val find_modtype_expansion: Path.t -> t -> Types.module_type + +(* Lookup by long identifiers *) + +val lookup_value: Longident.t -> t -> Path.t * value_description +val lookup_annot: Longident.t -> t -> Path.t * Annot.ident +val lookup_constructor: Longident.t -> t -> constructor_description +val lookup_label: Longident.t -> t -> label_description +val lookup_type: Longident.t -> t -> Path.t * type_declaration +val lookup_module: Longident.t -> t -> Path.t * module_type +val lookup_modtype: Longident.t -> t -> Path.t * modtype_declaration +val lookup_class: Longident.t -> t -> Path.t * class_declaration +val lookup_cltype: Longident.t -> t -> Path.t * cltype_declaration + +(* Insertion by identifier *) + +val add_value: Ident.t -> value_description -> t -> t +val add_annot: Ident.t -> Annot.ident -> t -> t +val add_type: Ident.t -> type_declaration -> t -> t +val add_exception: Ident.t -> exception_declaration -> t -> t +val add_module: Ident.t -> module_type -> t -> t +val add_modtype: Ident.t -> modtype_declaration -> t -> t +val add_class: Ident.t -> class_declaration -> t -> t +val add_cltype: Ident.t -> cltype_declaration -> t -> t + +(* Insertion of all fields of a signature. *) + +val add_item: signature_item -> t -> t +val add_signature: signature -> t -> t + +(* Insertion of all fields of a signature, relative to the given path. + Used to implement open. *) + +val open_signature: Path.t -> signature -> t -> t +val open_pers_signature: string -> t -> t + +(* Insertion by name *) + +val enter_value: string -> value_description -> t -> Ident.t * t +val enter_type: string -> type_declaration -> t -> Ident.t * t +val enter_exception: string -> exception_declaration -> t -> Ident.t * t +val enter_module: string -> module_type -> t -> Ident.t * t +val enter_modtype: string -> modtype_declaration -> t -> Ident.t * t +val enter_class: string -> class_declaration -> t -> Ident.t * t +val enter_cltype: string -> cltype_declaration -> t -> Ident.t * t + +(* Initialize the cache of in-core module interfaces. *) +val reset_cache: unit -> unit + +(* Remember the name of the current compilation unit. *) +val set_unit_name: string -> unit + +(* Read, save a signature to/from a file *) + +val read_signature: string -> string -> signature + (* Arguments: module name, file name. Results: signature. *) +val save_signature: signature -> string -> string -> unit + (* Arguments: signature, module name, file name. *) +val save_signature_with_imports: + signature -> string -> string -> (string * Digest.t) list -> unit + (* Arguments: signature, module name, file name, + imported units with their CRCs. *) + +(* Return the CRC of the interface of the given compilation unit *) + +val crc_of_unit: string -> Digest.t + +(* Return the set of compilation units imported, with their CRC *) + +val imported_units: unit -> (string * Digest.t) list + +(* Direct access to the table of imported compilation units with their CRC *) + +val crc_units: Consistbl.t + +(* Summaries -- compact representation of an environment, to be + exported in debugging information. *) + +type summary = + Env_empty + | Env_value of summary * Ident.t * value_description + | Env_type of summary * Ident.t * type_declaration + | Env_exception of summary * Ident.t * exception_declaration + | Env_module of summary * Ident.t * module_type + | Env_modtype of summary * Ident.t * modtype_declaration + | Env_class of summary * Ident.t * class_declaration + | Env_cltype of summary * Ident.t * cltype_declaration + | Env_open of summary * Path.t + +val summary: t -> summary + +(* Error report *) + +type error = + Not_an_interface of string + | Corrupted_interface of string + | Illegal_renaming of string * string + | Inconsistent_import of string * string * string + | Need_recursive_types of string * string + +exception Error of error + +open Format + +val report_error: formatter -> error -> unit + +(* Forward declaration to break mutual recursion with Includemod. *) +val check_modtype_inclusion: + (t -> module_type -> Path.t -> module_type -> unit) ref diff -Naur ocaml-3.11.0/typing/ident.ml ocaml-3.11.0-enhtop+/typing/ident.ml --- ocaml-3.11.0/typing/ident.ml 2004-01-04 09:32:34.000000000 -0500 +++ ocaml-3.11.0-enhtop+/typing/ident.ml 2009-03-24 10:55:08.065441575 -0400 @@ -172,6 +172,38 @@ else find_name name (if c < 0 then l else r) + +(* Peng added for #tell completion *) +let find_partial_names name atbl = + let rec aux left right atbl acc = + match atbl with + Empty -> acc + | Node(l, k, r, _) -> + let cl = compare left k.ident.name in + let rl = compare right k.ident.name in + if cl != rl then + let acc = if rl = 0 then acc else (k.data::acc) in + aux left right r (aux left right l acc) + else + aux left right (if cl < 0 then l else r) acc + in + let lastindx = (String.length name) - 1 in + let left = if(lastindx >= 0) then name else (String.make 4 (Char.chr 0)) in + let right = + if(lastindx >= 0) then + let temp = (String.copy name) in + let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in + (String.set temp lastindx nextchar); + temp + else + String.make 4 (Char.chr 255) in + aux left right atbl [] +(* End *) + + + + + let rec keys_aux stack accu = function Empty -> begin match stack with diff -Naur ocaml-3.11.0/typing/ident.mli ocaml-3.11.0-enhtop+/typing/ident.mli --- ocaml-3.11.0/typing/ident.mli 2004-01-04 09:32:34.000000000 -0500 +++ ocaml-3.11.0-enhtop+/typing/ident.mli 2009-03-24 10:55:08.065441575 -0400 @@ -56,4 +56,9 @@ val add: t -> 'a -> 'a tbl -> 'a tbl val find_same: t -> 'a tbl -> 'a val find_name: string -> 'a tbl -> 'a + +(* Peng added fro #tell completion *) +val find_partial_names: string -> 'a tbl -> 'a list +(* End *) + val keys: 'a tbl -> t list diff -Naur ocaml-3.11.0/utils/misc.ml ocaml-3.11.0-enhtop+/utils/misc.ml --- ocaml-3.11.0/utils/misc.ml 2007-02-23 08:44:51.000000000 -0500 +++ ocaml-3.11.0-enhtop+/utils/misc.ml 2009-03-24 10:55:08.065441575 -0400 @@ -103,6 +103,70 @@ else try_dir rem in try_dir path + +(* Added by Peng for completion *) +let find_in_path_uncap_partials path name = + (* define a bracket for determining partial matches. If a string is + between [left,right) then it is a partial match *) + let lastindx = (String.length name) - 1 in + let left, uleft = + if(lastindx >= 0) then + name, String.uncapitalize name + else + let temp = (String.make 4 (Char.chr 0)) in + temp, temp in + let right, uright = + if(lastindx >= 0) then + let temp = (String.copy name) in + let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in + (String.set temp lastindx nextchar); + temp, String.uncapitalize temp + else + let temp = String.make 4 (Char.chr 255) in + temp, temp in + + (* some auxiliary functions. This one is for determining if string + is a match *) + let ispartialmatch astring = + let cl = compare uleft astring in + let rl = compare uright astring in + if cl != rl & rl != 0 then + true + else + let cl = compare left astring in + let rl = compare right astring in + cl != rl & rl != 0 + in + + let iscmi astring = + try + compare ".cmi" (String.sub astring ((String.length astring) - 4) 4) = 0 + with Invalid_argument _ -> false + in + + (* Now we do actual work, going through the path and looking for all + matches *) + List.fold_left + (fun acc dir -> + try + let files = Sys.readdir dir in + Array.fold_left + (fun acc ele -> + if (iscmi ele) & (ispartialmatch ele) then + let modname = String.sub ele 0 ((String.length ele) - 4) in + let _ = modname.[0] <- Char.uppercase modname.[0] in + (modname, Filename.concat dir ele)::acc + else + acc) + acc + files + with Sys_error _ -> acc) + [] + path +(* End *) + + + let remove_file filename = try Sys.remove filename diff -Naur ocaml-3.11.0/utils/misc.mli ocaml-3.11.0-enhtop+/utils/misc.mli --- ocaml-3.11.0/utils/misc.mli 2007-02-23 08:44:51.000000000 -0500 +++ ocaml-3.11.0-enhtop+/utils/misc.mli 2009-03-24 10:55:08.065441575 -0400 @@ -48,8 +48,15 @@ (* Same, but search also for uncapitalized name, i.e. if name is Foo.ml, allow /path/Foo.ml and /path/foo.ml to match. *) + +val find_in_path_uncap_partials: string list -> string -> (string * string) list + (* Same, but also does partial matching, eg. "Lis" matches + "List" and might return [("List", "/somepath/list.cmi")] *) + val remove_file: string -> unit (* Delete the given file if it exists. Never raise an error. *) + + val expand_directory: string -> string -> string (* [expand_directory alt file] eventually expands a [+] at the beginning of file into [alt] (an alternate root directory) *) diff -Naur ocaml-3.11.0/utils/tbl.ml ocaml-3.11.0-enhtop+/utils/tbl.ml --- ocaml-3.11.0/utils/tbl.ml 2004-11-25 08:28:27.000000000 -0500 +++ ocaml-3.11.0-enhtop+/utils/tbl.ml 2009-03-24 10:55:08.065441575 -0400 @@ -65,6 +65,35 @@ if c = 0 then d else find x (if c < 0 then l else r) +(* Peng added for #tell completion *) +let rec find_partial name atbl = + let rec aux left right atbl acc = + match atbl with + Empty -> acc + | Node(l, v, d, r, _) -> + let cl = compare left v in + let rl = compare right v in + if cl != rl then + let acc = if rl = 0 then acc else ((v,d)::acc) in + aux left right r (aux left right l acc) + else + aux left right (if cl < 0 then l else r) acc + in + let lastindx = (String.length name) - 1 in + let left = if(lastindx >= 0) then name else (String.make 4 (Char.chr 0)) in + let right = + if(lastindx >= 0) then + let temp = (String.copy name) in + let nextchar = (Char.chr ((Char.code name.[lastindx]) + 1)) in + (String.set temp lastindx nextchar); + temp + else + String.make 4 (Char.chr 255) + in + aux left right atbl [] +(* End *) + + let rec mem x = function Empty -> false | Node(l, v, d, r, _) -> diff -Naur ocaml-3.11.0/utils/tbl.mli ocaml-3.11.0-enhtop+/utils/tbl.mli --- ocaml-3.11.0/utils/tbl.mli 2000-04-21 04:13:22.000000000 -0400 +++ ocaml-3.11.0-enhtop+/utils/tbl.mli 2009-03-24 10:55:08.065441575 -0400 @@ -20,6 +20,11 @@ val empty: ('a, 'b) t val add: 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t val find: 'a -> ('a, 'b) t -> 'b + +(* Peng added fro #tell completion *) +val find_partial: string -> (string, 'a) t -> (string * 'a) list +(* End *) + val mem: 'a -> ('a, 'b) t -> bool val remove: 'a -> ('a, 'b) t -> ('a, 'b) t val iter: ('a -> 'b -> 'c) -> ('a, 'b) t -> unit