summaryrefslogtreecommitdiff
path: root/ocamldoc
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2006-09-20 11:14:37 +0000
committerDamien Doligez <damien.doligez-inria.fr>2006-09-20 11:14:37 +0000
commitfbea66a95e1d890799b6b573bcd0131558b9ba92 (patch)
tree8bfb6bd4b2688d06b2c9934a2b026797b5e91733 /ocamldoc
parent403f1e1a34fb6b62072c9e89b84ac2aad3e37f9e (diff)
downloadocaml-fbea66a95e1d890799b6b573bcd0131558b9ba92.tar.gz
fusion des changements 3.09.2 -> 3.09.3
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7619 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc')
-rw-r--r--ocamldoc/.depend397
-rw-r--r--ocamldoc/Changes.txt18
-rw-r--r--ocamldoc/Makefile6
-rw-r--r--ocamldoc/Makefile.nt2
-rw-r--r--ocamldoc/odoc.ml30
-rw-r--r--ocamldoc/odoc_args.ml5
-rw-r--r--ocamldoc/odoc_args.mli4
-rw-r--r--ocamldoc/odoc_ast.ml325
-rw-r--r--ocamldoc/odoc_comments.ml7
-rw-r--r--ocamldoc/odoc_comments.mli4
-rw-r--r--ocamldoc/odoc_cross.ml431
-rw-r--r--ocamldoc/odoc_cross.mli3
-rw-r--r--ocamldoc/odoc_dot.ml25
-rw-r--r--ocamldoc/odoc_html.ml63
-rw-r--r--ocamldoc/odoc_info.mli39
-rw-r--r--ocamldoc/odoc_latex.ml19
-rw-r--r--ocamldoc/odoc_merge.ml159
-rw-r--r--ocamldoc/odoc_messages.ml5
-rw-r--r--ocamldoc/odoc_module.ml80
-rw-r--r--ocamldoc/odoc_opt.ml17
-rw-r--r--ocamldoc/odoc_texi.ml13
21 files changed, 935 insertions, 717 deletions
diff --git a/ocamldoc/.depend b/ocamldoc/.depend
index 238d372c5d..af9cf8f2c2 100644
--- a/ocamldoc/.depend
+++ b/ocamldoc/.depend
@@ -1,233 +1,242 @@
-odoc.cmo: ../typing/typedtree.cmi odoc_texi.cmo odoc_messages.cmo \
- odoc_man.cmo odoc_latex.cmo odoc_info.cmi odoc_html.cmo odoc_global.cmi \
- odoc_dot.cmo odoc_config.cmi odoc_args.cmi odoc_analyse.cmi \
- ../utils/misc.cmi ../utils/config.cmi ../utils/clflags.cmo
-odoc.cmx: ../typing/typedtree.cmx odoc_texi.cmx odoc_messages.cmx \
- odoc_man.cmx odoc_latex.cmx odoc_info.cmx odoc_html.cmx odoc_global.cmx \
- odoc_dot.cmx odoc_config.cmx odoc_args.cmx odoc_analyse.cmx \
- ../utils/misc.cmx ../utils/config.cmx ../utils/clflags.cmx
+odoc.cmo: ../typing/typedtree.cmi ./odoc_texi.cmo ./odoc_messages.cmo \
+ ./odoc_man.cmo ./odoc_latex.cmo ./odoc_info.cmi ./odoc_html.cmo \
+ ./odoc_global.cmi ./odoc_dot.cmo ./odoc_config.cmi ./odoc_args.cmi \
+ ./odoc_analyse.cmi ../utils/misc.cmi ../utils/config.cmi \
+ ../utils/clflags.cmi
+odoc.cmx: ../typing/typedtree.cmx ./odoc_texi.cmx ./odoc_messages.cmx \
+ ./odoc_man.cmx ./odoc_latex.cmx ./odoc_info.cmx ./odoc_html.cmx \
+ ./odoc_global.cmx ./odoc_dot.cmx ./odoc_config.cmx ./odoc_args.cmx \
+ ./odoc_analyse.cmx ../utils/misc.cmx ../utils/config.cmx \
+ ../utils/clflags.cmx
odoc_analyse.cmo: ../utils/warnings.cmi ../typing/typetexp.cmi \
../typing/types.cmi ../typing/typemod.cmi ../typing/typedtree.cmi \
../typing/typedecl.cmi ../typing/typecore.cmi ../typing/typeclass.cmi \
../bytecomp/translcore.cmi ../bytecomp/translclass.cmi \
- ../parsing/syntaxerr.cmi ../parsing/parse.cmi odoc_types.cmi \
- odoc_text.cmi odoc_sig.cmi odoc_module.cmo odoc_misc.cmi \
- odoc_messages.cmo odoc_merge.cmi odoc_global.cmi odoc_dep.cmo \
- odoc_cross.cmi odoc_comments.cmi odoc_class.cmo odoc_ast.cmi \
- odoc_args.cmi ../utils/misc.cmi ../parsing/location.cmi \
+ ../parsing/syntaxerr.cmi ../parsing/parse.cmi ./odoc_types.cmi \
+ ./odoc_text.cmi ./odoc_sig.cmi ./odoc_module.cmo ./odoc_misc.cmi \
+ ./odoc_messages.cmo ./odoc_merge.cmi ./odoc_global.cmi ./odoc_dep.cmo \
+ ./odoc_cross.cmi ./odoc_comments.cmi ./odoc_class.cmo ./odoc_ast.cmi \
+ ./odoc_args.cmi ../utils/misc.cmi ../parsing/location.cmi \
../parsing/lexer.cmi ../typing/includemod.cmi ../typing/env.cmi \
- ../typing/ctype.cmi ../utils/config.cmi ../utils/clflags.cmo \
+ ../typing/ctype.cmi ../utils/config.cmi ../utils/clflags.cmi \
../utils/ccomp.cmi odoc_analyse.cmi
odoc_analyse.cmx: ../utils/warnings.cmx ../typing/typetexp.cmx \
../typing/types.cmx ../typing/typemod.cmx ../typing/typedtree.cmx \
../typing/typedecl.cmx ../typing/typecore.cmx ../typing/typeclass.cmx \
../bytecomp/translcore.cmx ../bytecomp/translclass.cmx \
- ../parsing/syntaxerr.cmx ../parsing/parse.cmx odoc_types.cmx \
- odoc_text.cmx odoc_sig.cmx odoc_module.cmx odoc_misc.cmx \
- odoc_messages.cmx odoc_merge.cmx odoc_global.cmx odoc_dep.cmx \
- odoc_cross.cmx odoc_comments.cmx odoc_class.cmx odoc_ast.cmx \
- odoc_args.cmx ../utils/misc.cmx ../parsing/location.cmx \
+ ../parsing/syntaxerr.cmx ../parsing/parse.cmx ./odoc_types.cmx \
+ ./odoc_text.cmx ./odoc_sig.cmx ./odoc_module.cmx ./odoc_misc.cmx \
+ ./odoc_messages.cmx ./odoc_merge.cmx ./odoc_global.cmx ./odoc_dep.cmx \
+ ./odoc_cross.cmx ./odoc_comments.cmx ./odoc_class.cmx ./odoc_ast.cmx \
+ ./odoc_args.cmx ../utils/misc.cmx ../parsing/location.cmx \
../parsing/lexer.cmx ../typing/includemod.cmx ../typing/env.cmx \
../typing/ctype.cmx ../utils/config.cmx ../utils/clflags.cmx \
../utils/ccomp.cmx odoc_analyse.cmi
-odoc_args.cmo: odoc_types.cmi odoc_module.cmo odoc_messages.cmo \
- odoc_global.cmi odoc_config.cmi ../utils/misc.cmi ../utils/config.cmi \
- ../utils/clflags.cmo odoc_args.cmi
-odoc_args.cmx: odoc_types.cmx odoc_module.cmx odoc_messages.cmx \
- odoc_global.cmx odoc_config.cmx ../utils/misc.cmx ../utils/config.cmx \
+odoc_args.cmo: ./odoc_types.cmi ./odoc_module.cmo ./odoc_messages.cmo \
+ ./odoc_global.cmi ./odoc_config.cmi ../utils/misc.cmi ../utils/config.cmi \
+ ../utils/clflags.cmi odoc_args.cmi
+odoc_args.cmx: ./odoc_types.cmx ./odoc_module.cmx ./odoc_messages.cmx \
+ ./odoc_global.cmx ./odoc_config.cmx ../utils/misc.cmx ../utils/config.cmx \
../utils/clflags.cmx odoc_args.cmi
odoc_ast.cmo: ../typing/types.cmi ../typing/typedtree.cmi \
../typing/predef.cmi ../typing/path.cmi ../parsing/parsetree.cmi \
- odoc_value.cmo odoc_types.cmi odoc_type.cmo odoc_sig.cmi \
- odoc_parameter.cmo odoc_name.cmi odoc_module.cmo odoc_messages.cmo \
- odoc_global.cmi odoc_exception.cmo odoc_env.cmi odoc_class.cmo \
- odoc_args.cmi ../utils/misc.cmi ../parsing/location.cmi \
- ../parsing/asttypes.cmi odoc_ast.cmi
+ ./odoc_value.cmo ./odoc_types.cmi ./odoc_type.cmo ./odoc_sig.cmi \
+ ./odoc_parameter.cmo ./odoc_name.cmi ./odoc_module.cmo \
+ ./odoc_messages.cmo ./odoc_global.cmi ./odoc_exception.cmo ./odoc_env.cmi \
+ ./odoc_class.cmo ./odoc_args.cmi ../utils/misc.cmi \
+ ../parsing/location.cmi ../typing/ident.cmi ../parsing/asttypes.cmi \
+ odoc_ast.cmi
odoc_ast.cmx: ../typing/types.cmx ../typing/typedtree.cmx \
../typing/predef.cmx ../typing/path.cmx ../parsing/parsetree.cmi \
- odoc_value.cmx odoc_types.cmx odoc_type.cmx odoc_sig.cmx \
- odoc_parameter.cmx odoc_name.cmx odoc_module.cmx odoc_messages.cmx \
- odoc_global.cmx odoc_exception.cmx odoc_env.cmx odoc_class.cmx \
- odoc_args.cmx ../utils/misc.cmx ../parsing/location.cmx \
- ../parsing/asttypes.cmi odoc_ast.cmi
-odoc_class.cmo: ../typing/types.cmi odoc_value.cmo odoc_types.cmi \
- odoc_parameter.cmo odoc_name.cmi
-odoc_class.cmx: ../typing/types.cmx odoc_value.cmx odoc_types.cmx \
- odoc_parameter.cmx odoc_name.cmx
-odoc_comments.cmo: odoc_types.cmi odoc_text.cmi odoc_see_lexer.cmo \
- odoc_parser.cmi odoc_misc.cmi odoc_messages.cmo odoc_lexer.cmo \
- odoc_global.cmi odoc_comments_global.cmi odoc_comments.cmi
-odoc_comments.cmx: odoc_types.cmx odoc_text.cmx odoc_see_lexer.cmx \
- odoc_parser.cmx odoc_misc.cmx odoc_messages.cmx odoc_lexer.cmx \
- odoc_global.cmx odoc_comments_global.cmx odoc_comments.cmi
+ ./odoc_value.cmx ./odoc_types.cmx ./odoc_type.cmx ./odoc_sig.cmx \
+ ./odoc_parameter.cmx ./odoc_name.cmx ./odoc_module.cmx \
+ ./odoc_messages.cmx ./odoc_global.cmx ./odoc_exception.cmx ./odoc_env.cmx \
+ ./odoc_class.cmx ./odoc_args.cmx ../utils/misc.cmx \
+ ../parsing/location.cmx ../typing/ident.cmx ../parsing/asttypes.cmi \
+ odoc_ast.cmi
+odoc_class.cmo: ../typing/types.cmi ./odoc_value.cmo ./odoc_types.cmi \
+ ./odoc_parameter.cmo ./odoc_name.cmi
+odoc_class.cmx: ../typing/types.cmx ./odoc_value.cmx ./odoc_types.cmx \
+ ./odoc_parameter.cmx ./odoc_name.cmx
+odoc_comments.cmo: ./odoc_types.cmi ./odoc_text.cmi ./odoc_see_lexer.cmo \
+ ./odoc_parser.cmi ./odoc_misc.cmi ./odoc_messages.cmo ./odoc_lexer.cmo \
+ ./odoc_global.cmi ./odoc_cross.cmi ./odoc_comments_global.cmi \
+ odoc_comments.cmi
+odoc_comments.cmx: ./odoc_types.cmx ./odoc_text.cmx ./odoc_see_lexer.cmx \
+ ./odoc_parser.cmx ./odoc_misc.cmx ./odoc_messages.cmx ./odoc_lexer.cmx \
+ ./odoc_global.cmx ./odoc_cross.cmx ./odoc_comments_global.cmx \
+ odoc_comments.cmi
odoc_comments_global.cmo: odoc_comments_global.cmi
odoc_comments_global.cmx: odoc_comments_global.cmi
odoc_config.cmo: ../utils/config.cmi odoc_config.cmi
odoc_config.cmx: ../utils/config.cmx odoc_config.cmi
-odoc_cross.cmo: odoc_value.cmo odoc_types.cmi odoc_type.cmo odoc_search.cmi \
- odoc_scan.cmo odoc_parameter.cmo odoc_name.cmi odoc_module.cmo \
- odoc_misc.cmi odoc_messages.cmo odoc_exception.cmo odoc_class.cmo \
- odoc_cross.cmi
-odoc_cross.cmx: odoc_value.cmx odoc_types.cmx odoc_type.cmx odoc_search.cmx \
- odoc_scan.cmx odoc_parameter.cmx odoc_name.cmx odoc_module.cmx \
- odoc_misc.cmx odoc_messages.cmx odoc_exception.cmx odoc_class.cmx \
- odoc_cross.cmi
-odoc_dag2html.cmo: odoc_info.cmi odoc_dag2html.cmi
-odoc_dag2html.cmx: odoc_info.cmx odoc_dag2html.cmi
-odoc_dep.cmo: ../parsing/parsetree.cmi odoc_type.cmo odoc_print.cmi \
- odoc_module.cmo ../tools/depend.cmi
-odoc_dep.cmx: ../parsing/parsetree.cmi odoc_type.cmx odoc_print.cmx \
- odoc_module.cmx ../tools/depend.cmx
-odoc_dot.cmo: odoc_info.cmi
-odoc_dot.cmx: odoc_info.cmx
+odoc_cross.cmo: ./odoc_value.cmo ./odoc_types.cmi ./odoc_type.cmo \
+ ./odoc_search.cmi ./odoc_scan.cmo ./odoc_parameter.cmo ./odoc_name.cmi \
+ ./odoc_module.cmo ./odoc_misc.cmi ./odoc_messages.cmo \
+ ./odoc_exception.cmo ./odoc_class.cmo odoc_cross.cmi
+odoc_cross.cmx: ./odoc_value.cmx ./odoc_types.cmx ./odoc_type.cmx \
+ ./odoc_search.cmx ./odoc_scan.cmx ./odoc_parameter.cmx ./odoc_name.cmx \
+ ./odoc_module.cmx ./odoc_misc.cmx ./odoc_messages.cmx \
+ ./odoc_exception.cmx ./odoc_class.cmx odoc_cross.cmi
+odoc_dag2html.cmo: ./odoc_info.cmi odoc_dag2html.cmi
+odoc_dag2html.cmx: ./odoc_info.cmx odoc_dag2html.cmi
+odoc_dep.cmo: ../parsing/parsetree.cmi ./odoc_type.cmo ./odoc_print.cmi \
+ ./odoc_module.cmo ../tools/depend.cmi
+odoc_dep.cmx: ../parsing/parsetree.cmi ./odoc_type.cmx ./odoc_print.cmx \
+ ./odoc_module.cmx ../tools/depend.cmx
+odoc_dot.cmo: ./odoc_info.cmi
+odoc_dot.cmx: ./odoc_info.cmx
odoc_env.cmo: ../typing/types.cmi ../typing/printtyp.cmi ../typing/predef.cmi \
- ../typing/path.cmi odoc_name.cmi ../typing/btype.cmi odoc_env.cmi
+ ../typing/path.cmi ./odoc_name.cmi ../typing/btype.cmi odoc_env.cmi
odoc_env.cmx: ../typing/types.cmx ../typing/printtyp.cmx ../typing/predef.cmx \
- ../typing/path.cmx odoc_name.cmx ../typing/btype.cmx odoc_env.cmi
-odoc_exception.cmo: ../typing/types.cmi odoc_types.cmi odoc_name.cmi
-odoc_exception.cmx: ../typing/types.cmx odoc_types.cmx odoc_name.cmx
-odoc_global.cmo: ../utils/clflags.cmo odoc_global.cmi
+ ../typing/path.cmx ./odoc_name.cmx ../typing/btype.cmx odoc_env.cmi
+odoc_exception.cmo: ../typing/types.cmi ./odoc_types.cmi ./odoc_name.cmi
+odoc_exception.cmx: ../typing/types.cmx ./odoc_types.cmx ./odoc_name.cmx
+odoc_global.cmo: ../utils/clflags.cmi odoc_global.cmi
odoc_global.cmx: ../utils/clflags.cmx odoc_global.cmi
-odoc_html.cmo: odoc_text.cmi odoc_ocamlhtml.cmo odoc_messages.cmo \
- odoc_info.cmi odoc_dag2html.cmi odoc_args.cmi
-odoc_html.cmx: odoc_text.cmx odoc_ocamlhtml.cmx odoc_messages.cmx \
- odoc_info.cmx odoc_dag2html.cmx odoc_args.cmx
-odoc_info.cmo: ../typing/printtyp.cmi odoc_value.cmo odoc_types.cmi \
- odoc_type.cmo odoc_text.cmi odoc_str.cmi odoc_search.cmi odoc_scan.cmo \
- odoc_print.cmi odoc_parameter.cmo odoc_name.cmi odoc_module.cmo \
- odoc_misc.cmi odoc_messages.cmo odoc_global.cmi odoc_exception.cmo \
- odoc_dep.cmo odoc_comments.cmi odoc_class.cmo odoc_args.cmi \
- odoc_analyse.cmi odoc_info.cmi
-odoc_info.cmx: ../typing/printtyp.cmx odoc_value.cmx odoc_types.cmx \
- odoc_type.cmx odoc_text.cmx odoc_str.cmx odoc_search.cmx odoc_scan.cmx \
- odoc_print.cmx odoc_parameter.cmx odoc_name.cmx odoc_module.cmx \
- odoc_misc.cmx odoc_messages.cmx odoc_global.cmx odoc_exception.cmx \
- odoc_dep.cmx odoc_comments.cmx odoc_class.cmx odoc_args.cmx \
- odoc_analyse.cmx odoc_info.cmi
-odoc_latex.cmo: odoc_to_text.cmo odoc_messages.cmo odoc_latex_style.cmo \
- odoc_info.cmi
-odoc_latex.cmx: odoc_to_text.cmx odoc_messages.cmx odoc_latex_style.cmx \
- odoc_info.cmx
-odoc_lexer.cmo: odoc_parser.cmi odoc_messages.cmo odoc_comments_global.cmi \
- odoc_args.cmi
-odoc_lexer.cmx: odoc_parser.cmx odoc_messages.cmx odoc_comments_global.cmx \
- odoc_args.cmx
-odoc_man.cmo: odoc_str.cmi odoc_print.cmi odoc_misc.cmi odoc_messages.cmo \
- odoc_info.cmi odoc_args.cmi
-odoc_man.cmx: odoc_str.cmx odoc_print.cmx odoc_misc.cmx odoc_messages.cmx \
- odoc_info.cmx odoc_args.cmx
-odoc_merge.cmo: odoc_value.cmo odoc_types.cmi odoc_type.cmo \
- odoc_parameter.cmo odoc_name.cmi odoc_module.cmo odoc_messages.cmo \
- odoc_exception.cmo odoc_class.cmo odoc_args.cmi odoc_merge.cmi
-odoc_merge.cmx: odoc_value.cmx odoc_types.cmx odoc_type.cmx \
- odoc_parameter.cmx odoc_name.cmx odoc_module.cmx odoc_messages.cmx \
- odoc_exception.cmx odoc_class.cmx odoc_args.cmx odoc_merge.cmi
-odoc_messages.cmo: odoc_global.cmi ../utils/config.cmi
-odoc_messages.cmx: odoc_global.cmx ../utils/config.cmx
+odoc_html.cmo: ./odoc_text.cmi ./odoc_ocamlhtml.cmo ./odoc_messages.cmo \
+ ./odoc_info.cmi ./odoc_dag2html.cmi ./odoc_args.cmi
+odoc_html.cmx: ./odoc_text.cmx ./odoc_ocamlhtml.cmx ./odoc_messages.cmx \
+ ./odoc_info.cmx ./odoc_dag2html.cmx ./odoc_args.cmx
+odoc_info.cmo: ../typing/printtyp.cmi ./odoc_value.cmo ./odoc_types.cmi \
+ ./odoc_type.cmo ./odoc_text.cmi ./odoc_str.cmi ./odoc_search.cmi \
+ ./odoc_scan.cmo ./odoc_print.cmi ./odoc_parameter.cmo ./odoc_name.cmi \
+ ./odoc_module.cmo ./odoc_misc.cmi ./odoc_messages.cmo ./odoc_global.cmi \
+ ./odoc_exception.cmo ./odoc_dep.cmo ./odoc_comments.cmi ./odoc_class.cmo \
+ ./odoc_args.cmi ./odoc_analyse.cmi odoc_info.cmi
+odoc_info.cmx: ../typing/printtyp.cmx ./odoc_value.cmx ./odoc_types.cmx \
+ ./odoc_type.cmx ./odoc_text.cmx ./odoc_str.cmx ./odoc_search.cmx \
+ ./odoc_scan.cmx ./odoc_print.cmx ./odoc_parameter.cmx ./odoc_name.cmx \
+ ./odoc_module.cmx ./odoc_misc.cmx ./odoc_messages.cmx ./odoc_global.cmx \
+ ./odoc_exception.cmx ./odoc_dep.cmx ./odoc_comments.cmx ./odoc_class.cmx \
+ ./odoc_args.cmx ./odoc_analyse.cmx odoc_info.cmi
+odoc_latex.cmo: ./odoc_to_text.cmo ./odoc_messages.cmo ./odoc_latex_style.cmo \
+ ./odoc_info.cmi
+odoc_latex.cmx: ./odoc_to_text.cmx ./odoc_messages.cmx ./odoc_latex_style.cmx \
+ ./odoc_info.cmx
+odoc_lexer.cmo: ./odoc_parser.cmi ./odoc_messages.cmo \
+ ./odoc_comments_global.cmi ./odoc_args.cmi
+odoc_lexer.cmx: ./odoc_parser.cmx ./odoc_messages.cmx \
+ ./odoc_comments_global.cmx ./odoc_args.cmx
+odoc_man.cmo: ./odoc_str.cmi ./odoc_print.cmi ./odoc_misc.cmi \
+ ./odoc_messages.cmo ./odoc_info.cmi ./odoc_args.cmi
+odoc_man.cmx: ./odoc_str.cmx ./odoc_print.cmx ./odoc_misc.cmx \
+ ./odoc_messages.cmx ./odoc_info.cmx ./odoc_args.cmx
+odoc_merge.cmo: ./odoc_value.cmo ./odoc_types.cmi ./odoc_type.cmo \
+ ./odoc_parameter.cmo ./odoc_name.cmi ./odoc_module.cmo \
+ ./odoc_messages.cmo ./odoc_exception.cmo ./odoc_class.cmo ./odoc_args.cmi \
+ odoc_merge.cmi
+odoc_merge.cmx: ./odoc_value.cmx ./odoc_types.cmx ./odoc_type.cmx \
+ ./odoc_parameter.cmx ./odoc_name.cmx ./odoc_module.cmx \
+ ./odoc_messages.cmx ./odoc_exception.cmx ./odoc_class.cmx ./odoc_args.cmx \
+ odoc_merge.cmi
+odoc_messages.cmo: ./odoc_global.cmi ../utils/config.cmi
+odoc_messages.cmx: ./odoc_global.cmx ../utils/config.cmx
odoc_misc.cmo: ../typing/types.cmi ../typing/predef.cmi ../typing/path.cmi \
- odoc_types.cmi odoc_messages.cmo ../parsing/longident.cmi \
+ ./odoc_types.cmi ./odoc_messages.cmo ../parsing/longident.cmi \
../typing/ctype.cmi ../typing/btype.cmi odoc_misc.cmi
odoc_misc.cmx: ../typing/types.cmx ../typing/predef.cmx ../typing/path.cmx \
- odoc_types.cmx odoc_messages.cmx ../parsing/longident.cmx \
+ ./odoc_types.cmx ./odoc_messages.cmx ../parsing/longident.cmx \
../typing/ctype.cmx ../typing/btype.cmx odoc_misc.cmi
-odoc_module.cmo: ../typing/types.cmi odoc_value.cmo odoc_types.cmi \
- odoc_type.cmo odoc_name.cmi odoc_exception.cmo odoc_class.cmo
-odoc_module.cmx: ../typing/types.cmx odoc_value.cmx odoc_types.cmx \
- odoc_type.cmx odoc_name.cmx odoc_exception.cmx odoc_class.cmx
-odoc_name.cmo: ../typing/path.cmi ../parsing/longident.cmi \
- ../typing/ident.cmi odoc_name.cmi
-odoc_name.cmx: ../typing/path.cmx ../parsing/longident.cmx \
- ../typing/ident.cmx odoc_name.cmi
-odoc_opt.cmo: ../typing/typedtree.cmi odoc_texi.cmo odoc_messages.cmo \
- odoc_man.cmo odoc_latex.cmo odoc_info.cmi odoc_html.cmo odoc_global.cmi \
- odoc_dot.cmo odoc_args.cmi odoc_analyse.cmi ../utils/misc.cmi \
- ../utils/config.cmi ../utils/clflags.cmo
-odoc_opt.cmx: ../typing/typedtree.cmx odoc_texi.cmx odoc_messages.cmx \
- odoc_man.cmx odoc_latex.cmx odoc_info.cmx odoc_html.cmx odoc_global.cmx \
- odoc_dot.cmx odoc_args.cmx odoc_analyse.cmx ../utils/misc.cmx \
- ../utils/config.cmx ../utils/clflags.cmx
-odoc_parameter.cmo: ../typing/types.cmi odoc_types.cmi
-odoc_parameter.cmx: ../typing/types.cmx odoc_types.cmx
-odoc_parser.cmo: odoc_types.cmi odoc_comments_global.cmi odoc_parser.cmi
-odoc_parser.cmx: odoc_types.cmx odoc_comments_global.cmx odoc_parser.cmi
+odoc_module.cmo: ../typing/types.cmi ./odoc_value.cmo ./odoc_types.cmi \
+ ./odoc_type.cmo ./odoc_name.cmi ./odoc_exception.cmo ./odoc_class.cmo
+odoc_module.cmx: ../typing/types.cmx ./odoc_value.cmx ./odoc_types.cmx \
+ ./odoc_type.cmx ./odoc_name.cmx ./odoc_exception.cmx ./odoc_class.cmx
+odoc_name.cmo: ../typing/path.cmi ./odoc_misc.cmi ../typing/ident.cmi \
+ odoc_name.cmi
+odoc_name.cmx: ../typing/path.cmx ./odoc_misc.cmx ../typing/ident.cmx \
+ odoc_name.cmi
+odoc_opt.cmo: ../typing/typedtree.cmi ./odoc_texi.cmo ./odoc_messages.cmo \
+ ./odoc_man.cmo ./odoc_latex.cmo ./odoc_info.cmi ./odoc_html.cmo \
+ ./odoc_global.cmi ./odoc_dot.cmo ./odoc_args.cmi ./odoc_analyse.cmi \
+ ../utils/misc.cmi ../utils/config.cmi ../utils/clflags.cmi
+odoc_opt.cmx: ../typing/typedtree.cmx ./odoc_texi.cmx ./odoc_messages.cmx \
+ ./odoc_man.cmx ./odoc_latex.cmx ./odoc_info.cmx ./odoc_html.cmx \
+ ./odoc_global.cmx ./odoc_dot.cmx ./odoc_args.cmx ./odoc_analyse.cmx \
+ ../utils/misc.cmx ../utils/config.cmx ../utils/clflags.cmx
+odoc_parameter.cmo: ../typing/types.cmi ./odoc_types.cmi
+odoc_parameter.cmx: ../typing/types.cmx ./odoc_types.cmx
+odoc_parser.cmo: ./odoc_types.cmi ./odoc_comments_global.cmi odoc_parser.cmi
+odoc_parser.cmx: ./odoc_types.cmx ./odoc_comments_global.cmx odoc_parser.cmi
odoc_print.cmo: ../typing/types.cmi ../typing/printtyp.cmi odoc_print.cmi
odoc_print.cmx: ../typing/types.cmx ../typing/printtyp.cmx odoc_print.cmi
-odoc_scan.cmo: odoc_value.cmo odoc_types.cmi odoc_type.cmo odoc_module.cmo \
- odoc_exception.cmo odoc_class.cmo
-odoc_scan.cmx: odoc_value.cmx odoc_types.cmx odoc_type.cmx odoc_module.cmx \
- odoc_exception.cmx odoc_class.cmx
-odoc_search.cmo: odoc_value.cmo odoc_types.cmi odoc_type.cmo \
- odoc_parameter.cmo odoc_name.cmi odoc_module.cmo odoc_exception.cmo \
- odoc_class.cmo odoc_search.cmi
-odoc_search.cmx: odoc_value.cmx odoc_types.cmx odoc_type.cmx \
- odoc_parameter.cmx odoc_name.cmx odoc_module.cmx odoc_exception.cmx \
- odoc_class.cmx odoc_search.cmi
-odoc_see_lexer.cmo: odoc_parser.cmi
-odoc_see_lexer.cmx: odoc_parser.cmx
+odoc_scan.cmo: ./odoc_value.cmo ./odoc_types.cmi ./odoc_type.cmo \
+ ./odoc_module.cmo ./odoc_exception.cmo ./odoc_class.cmo
+odoc_scan.cmx: ./odoc_value.cmx ./odoc_types.cmx ./odoc_type.cmx \
+ ./odoc_module.cmx ./odoc_exception.cmx ./odoc_class.cmx
+odoc_search.cmo: ./odoc_value.cmo ./odoc_types.cmi ./odoc_type.cmo \
+ ./odoc_parameter.cmo ./odoc_name.cmi ./odoc_module.cmo \
+ ./odoc_exception.cmo ./odoc_class.cmo odoc_search.cmi
+odoc_search.cmx: ./odoc_value.cmx ./odoc_types.cmx ./odoc_type.cmx \
+ ./odoc_parameter.cmx ./odoc_name.cmx ./odoc_module.cmx \
+ ./odoc_exception.cmx ./odoc_class.cmx odoc_search.cmi
+odoc_see_lexer.cmo: ./odoc_parser.cmi
+odoc_see_lexer.cmx: ./odoc_parser.cmx
odoc_sig.cmo: ../typing/types.cmi ../typing/typedtree.cmi ../typing/path.cmi \
- ../parsing/parsetree.cmi odoc_value.cmo odoc_types.cmi odoc_type.cmo \
- odoc_print.cmi odoc_parameter.cmo odoc_name.cmi odoc_module.cmo \
- odoc_misc.cmi odoc_messages.cmo odoc_merge.cmi odoc_global.cmi \
- odoc_exception.cmo odoc_env.cmi odoc_class.cmo odoc_args.cmi \
- ../utils/misc.cmi ../parsing/location.cmi ../typing/btype.cmi \
- ../parsing/asttypes.cmi odoc_sig.cmi
+ ../parsing/parsetree.cmi ./odoc_value.cmo ./odoc_types.cmi \
+ ./odoc_type.cmo ./odoc_print.cmi ./odoc_parameter.cmo ./odoc_name.cmi \
+ ./odoc_module.cmo ./odoc_misc.cmi ./odoc_messages.cmo ./odoc_merge.cmi \
+ ./odoc_global.cmi ./odoc_exception.cmo ./odoc_env.cmi ./odoc_class.cmo \
+ ./odoc_args.cmi ../utils/misc.cmi ../parsing/location.cmi \
+ ../typing/btype.cmi ../parsing/asttypes.cmi odoc_sig.cmi
odoc_sig.cmx: ../typing/types.cmx ../typing/typedtree.cmx ../typing/path.cmx \
- ../parsing/parsetree.cmi odoc_value.cmx odoc_types.cmx odoc_type.cmx \
- odoc_print.cmx odoc_parameter.cmx odoc_name.cmx odoc_module.cmx \
- odoc_misc.cmx odoc_messages.cmx odoc_merge.cmx odoc_global.cmx \
- odoc_exception.cmx odoc_env.cmx odoc_class.cmx odoc_args.cmx \
- ../utils/misc.cmx ../parsing/location.cmx ../typing/btype.cmx \
- ../parsing/asttypes.cmi odoc_sig.cmi
-odoc_str.cmo: ../typing/types.cmi ../typing/printtyp.cmi odoc_value.cmo \
- odoc_type.cmo odoc_print.cmi odoc_name.cmi odoc_misc.cmi \
- odoc_messages.cmo odoc_exception.cmo odoc_class.cmo odoc_str.cmi
-odoc_str.cmx: ../typing/types.cmx ../typing/printtyp.cmx odoc_value.cmx \
- odoc_type.cmx odoc_print.cmx odoc_name.cmx odoc_misc.cmx \
- odoc_messages.cmx odoc_exception.cmx odoc_class.cmx odoc_str.cmi
-odoc_test.cmo: odoc_info.cmi
-odoc_test.cmx: odoc_info.cmx
-odoc_texi.cmo: odoc_to_text.cmo odoc_messages.cmo odoc_info.cmi
-odoc_texi.cmx: odoc_to_text.cmx odoc_messages.cmx odoc_info.cmx
-odoc_text.cmo: odoc_types.cmi odoc_text_parser.cmi odoc_text_lexer.cmo \
+ ../parsing/parsetree.cmi ./odoc_value.cmx ./odoc_types.cmx \
+ ./odoc_type.cmx ./odoc_print.cmx ./odoc_parameter.cmx ./odoc_name.cmx \
+ ./odoc_module.cmx ./odoc_misc.cmx ./odoc_messages.cmx ./odoc_merge.cmx \
+ ./odoc_global.cmx ./odoc_exception.cmx ./odoc_env.cmx ./odoc_class.cmx \
+ ./odoc_args.cmx ../utils/misc.cmx ../parsing/location.cmx \
+ ../typing/btype.cmx ../parsing/asttypes.cmi odoc_sig.cmi
+odoc_str.cmo: ../typing/types.cmi ../typing/printtyp.cmi ./odoc_value.cmo \
+ ./odoc_type.cmo ./odoc_print.cmi ./odoc_name.cmi ./odoc_misc.cmi \
+ ./odoc_messages.cmo ./odoc_exception.cmo ./odoc_class.cmo odoc_str.cmi
+odoc_str.cmx: ../typing/types.cmx ../typing/printtyp.cmx ./odoc_value.cmx \
+ ./odoc_type.cmx ./odoc_print.cmx ./odoc_name.cmx ./odoc_misc.cmx \
+ ./odoc_messages.cmx ./odoc_exception.cmx ./odoc_class.cmx odoc_str.cmi
+odoc_test.cmo: ./odoc_info.cmi
+odoc_test.cmx: ./odoc_info.cmx
+odoc_texi.cmo: ./odoc_to_text.cmo ./odoc_messages.cmo ./odoc_info.cmi
+odoc_texi.cmx: ./odoc_to_text.cmx ./odoc_messages.cmx ./odoc_info.cmx
+odoc_text.cmo: ./odoc_types.cmi ./odoc_text_parser.cmi ./odoc_text_lexer.cmo \
odoc_text.cmi
-odoc_text.cmx: odoc_types.cmx odoc_text_parser.cmx odoc_text_lexer.cmx \
+odoc_text.cmx: ./odoc_types.cmx ./odoc_text_parser.cmx ./odoc_text_lexer.cmx \
odoc_text.cmi
-odoc_text_lexer.cmo: odoc_text_parser.cmi odoc_misc.cmi
-odoc_text_lexer.cmx: odoc_text_parser.cmx odoc_misc.cmx
-odoc_text_parser.cmo: odoc_types.cmi odoc_misc.cmi odoc_text_parser.cmi
-odoc_text_parser.cmx: odoc_types.cmx odoc_misc.cmx odoc_text_parser.cmi
-odoc_to_text.cmo: odoc_messages.cmo odoc_info.cmi
-odoc_to_text.cmx: odoc_messages.cmx odoc_info.cmx
-odoc_type.cmo: ../typing/types.cmi odoc_types.cmi odoc_name.cmi
-odoc_type.cmx: ../typing/types.cmx odoc_types.cmx odoc_name.cmx
-odoc_types.cmo: odoc_messages.cmo odoc_types.cmi
-odoc_types.cmx: odoc_messages.cmx odoc_types.cmi
-odoc_value.cmo: ../typing/types.cmi ../typing/printtyp.cmi odoc_types.cmi \
- odoc_parameter.cmo odoc_name.cmi
-odoc_value.cmx: ../typing/types.cmx ../typing/printtyp.cmx odoc_types.cmx \
- odoc_parameter.cmx odoc_name.cmx
-odoc_analyse.cmi: odoc_module.cmo odoc_args.cmi
-odoc_args.cmi: odoc_types.cmi odoc_module.cmo
+odoc_text_lexer.cmo: ./odoc_text_parser.cmi ./odoc_misc.cmi
+odoc_text_lexer.cmx: ./odoc_text_parser.cmx ./odoc_misc.cmx
+odoc_text_parser.cmo: ./odoc_types.cmi ./odoc_misc.cmi odoc_text_parser.cmi
+odoc_text_parser.cmx: ./odoc_types.cmx ./odoc_misc.cmx odoc_text_parser.cmi
+odoc_to_text.cmo: ./odoc_messages.cmo ./odoc_info.cmi
+odoc_to_text.cmx: ./odoc_messages.cmx ./odoc_info.cmx
+odoc_type.cmo: ../typing/types.cmi ./odoc_types.cmi ./odoc_name.cmi
+odoc_type.cmx: ../typing/types.cmx ./odoc_types.cmx ./odoc_name.cmx
+odoc_types.cmo: ./odoc_messages.cmo odoc_types.cmi
+odoc_types.cmx: ./odoc_messages.cmx odoc_types.cmi
+odoc_value.cmo: ../typing/types.cmi ../typing/printtyp.cmi ./odoc_types.cmi \
+ ./odoc_parameter.cmo ./odoc_name.cmi
+odoc_value.cmx: ../typing/types.cmx ../typing/printtyp.cmx ./odoc_types.cmx \
+ ./odoc_parameter.cmx ./odoc_name.cmx
+odoc_analyse.cmi: ./odoc_module.cmo ./odoc_args.cmi
+odoc_args.cmi: ./odoc_types.cmi ./odoc_module.cmo
odoc_ast.cmi: ../typing/types.cmi ../typing/typedtree.cmi ../typing/path.cmi \
- ../parsing/parsetree.cmi odoc_sig.cmi odoc_name.cmi odoc_module.cmo
-odoc_comments.cmi: odoc_types.cmi
-odoc_cross.cmi: odoc_module.cmo
-odoc_dag2html.cmi: odoc_info.cmi
-odoc_env.cmi: ../typing/types.cmi odoc_name.cmi
-odoc_info.cmi: ../typing/types.cmi odoc_value.cmo odoc_types.cmi \
- odoc_type.cmo odoc_search.cmi odoc_parameter.cmo odoc_module.cmo \
- odoc_exception.cmo odoc_class.cmo
-odoc_merge.cmi: odoc_types.cmi odoc_module.cmo
-odoc_misc.cmi: ../typing/types.cmi odoc_types.cmi ../parsing/longident.cmi
+ ../parsing/parsetree.cmi ./odoc_sig.cmi ./odoc_name.cmi ./odoc_module.cmo
+odoc_comments.cmi: ./odoc_types.cmi ./odoc_module.cmo
+odoc_cross.cmi: ./odoc_types.cmi ./odoc_module.cmo
+odoc_dag2html.cmi: ./odoc_info.cmi
+odoc_env.cmi: ../typing/types.cmi ./odoc_name.cmi
+odoc_info.cmi: ../typing/types.cmi ./odoc_value.cmo ./odoc_types.cmi \
+ ./odoc_type.cmo ./odoc_search.cmi ./odoc_parameter.cmo ./odoc_module.cmo \
+ ./odoc_exception.cmo ./odoc_class.cmo
+odoc_merge.cmi: ./odoc_types.cmi ./odoc_module.cmo
+odoc_misc.cmi: ../typing/types.cmi ./odoc_types.cmi ../parsing/longident.cmi
odoc_name.cmi: ../typing/path.cmi ../parsing/longident.cmi \
../typing/ident.cmi
-odoc_parser.cmi: odoc_types.cmi
+odoc_parser.cmi: ./odoc_types.cmi
odoc_print.cmi: ../typing/types.cmi
-odoc_search.cmi: odoc_value.cmo odoc_types.cmi odoc_type.cmo odoc_module.cmo \
- odoc_exception.cmo odoc_class.cmo
-odoc_sig.cmi: ../typing/types.cmi ../parsing/parsetree.cmi odoc_types.cmi \
- odoc_type.cmo odoc_name.cmi odoc_module.cmo odoc_env.cmi odoc_class.cmo
-odoc_str.cmi: ../typing/types.cmi odoc_value.cmo odoc_type.cmo \
- odoc_exception.cmo odoc_class.cmo
-odoc_text.cmi: odoc_types.cmi
-odoc_text_parser.cmi: odoc_types.cmi
+odoc_search.cmi: ./odoc_value.cmo ./odoc_types.cmi ./odoc_type.cmo \
+ ./odoc_module.cmo ./odoc_exception.cmo ./odoc_class.cmo
+odoc_sig.cmi: ../typing/types.cmi ../parsing/parsetree.cmi ./odoc_types.cmi \
+ ./odoc_type.cmo ./odoc_name.cmi ./odoc_module.cmo ./odoc_env.cmi \
+ ./odoc_class.cmo
+odoc_str.cmi: ../typing/types.cmi ./odoc_value.cmo ./odoc_type.cmo \
+ ./odoc_exception.cmo ./odoc_class.cmo
+odoc_text.cmi: ./odoc_types.cmi
+odoc_text_parser.cmi: ./odoc_types.cmi
diff --git a/ocamldoc/Changes.txt b/ocamldoc/Changes.txt
index 5f67b0cf44..77f100de42 100644
--- a/ocamldoc/Changes.txt
+++ b/ocamldoc/Changes.txt
@@ -1,10 +1,28 @@
TODO:
- need to fix display of type parameters for inherited classes/class types
+ - need to add an environment while generating to print correct links:
+ file foo.mli:
+ type u
+ module type M = sig type u end
+ module N : sig include M val f: u -> unit end
+ Here, in html for example, f in displayed being of type Foo.u instead of Foo.M.u
- latex: types variant polymorphes dépassent de la page quand ils sont trop longs
- utilisation nouvelles infos de Xavier: "début de rec", etc.
- xml generator
=====
+Release 3.09.3:
+- mod: PR#4017 new option -short-functors to use a short form to display
+ functors in html generator
+- fix: PR#4016 (using modtype constraint to filter module elements displayed in doc)
+- fix: PR#4066 (missing crossref in text from intro files)
+- fix: PR#4007 (error in merging of top dependencies of modules)
+- fix: PR#3981 (-dot-colors has no effect)
+- mod: name resolution in cross-referencing: {!name} if name is not
+ found, then it is searched in the parent module/class, and in the parent
+ of the parent, and so on until it is found.
+
+=====
Release 3.09.1:
- fix: remove .TP for generated man pages, use .sp instead
(.TP caused a lot of odd margins)
diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile
index ad213b443f..b6b47156fa 100644
--- a/ocamldoc/Makefile
+++ b/ocamldoc/Makefile
@@ -93,7 +93,6 @@ CMOFILES= odoc_config.cmo \
odoc_parser.cmo\
odoc_lexer.cmo\
odoc_see_lexer.cmo\
- odoc_comments.cmo\
odoc_env.cmo\
odoc_merge.cmo\
odoc_sig.cmo\
@@ -103,6 +102,7 @@ CMOFILES= odoc_config.cmo \
odoc_search.cmo\
odoc_scan.cmo\
odoc_cross.cmo\
+ odoc_comments.cmo\
odoc_dep.cmo\
odoc_analyse.cmo\
odoc_info.cmo
@@ -211,6 +211,10 @@ $(OCAMLDOC_LIBCMXA): $(LIBCMXFILES)
manpages: stdlib_man/Pervasives.3o
+dot: $(EXECMOFILES) odoc.cmo
+ $(OCAMLDOC_RUN) -dot -dot-reduce -o ocamldoc.dot $(INCLUDES) \
+ odoc*.ml
+
# Parsers and lexers dependencies :
###################################
odoc_text_parser.ml: odoc_text_parser.mly
diff --git a/ocamldoc/Makefile.nt b/ocamldoc/Makefile.nt
index 3a5a4ba24f..c11f1bd0fd 100644
--- a/ocamldoc/Makefile.nt
+++ b/ocamldoc/Makefile.nt
@@ -87,7 +87,6 @@ CMOFILES= odoc_config.cmo \
odoc_parser.cmo\
odoc_lexer.cmo\
odoc_see_lexer.cmo\
- odoc_comments.cmo\
odoc_env.cmo\
odoc_merge.cmo\
odoc_sig.cmo\
@@ -97,6 +96,7 @@ CMOFILES= odoc_config.cmo \
odoc_search.cmo\
odoc_scan.cmo\
odoc_cross.cmo\
+ odoc_comments.cmo\
odoc_dep.cmo\
odoc_analyse.cmo\
odoc_info.cmo
diff --git a/ocamldoc/odoc.ml b/ocamldoc/odoc.ml
index 1d4df9c6a2..e66ce37543 100644
--- a/ocamldoc/odoc.ml
+++ b/ocamldoc/odoc.ml
@@ -21,7 +21,7 @@ open Typedtree
module M = Odoc_messages
-let print_DEBUG s = print_string s ; print_newline ()
+let print_DEBUG s = print_string s ; print_newline ()
(* we check if we must load a module given on the command line *)
let arg_list = Array.to_list Sys.argv
@@ -42,7 +42,7 @@ let (cmo_or_cma_opt, paths) =
let _ = print_DEBUG "Fin analyse des arguments pour le dynamic load"
-(** Return the real name of the file to load,
+(** Return the real name of the file to load,
searching it in the paths if it is
a simple name and not in the current directory. *)
let get_real_filename name =
@@ -74,16 +74,16 @@ let _ =
let real_file = get_real_filename file in
ignore(Dynlink.loadfile real_file)
with
- Dynlink.Error e ->
+ Dynlink.Error e ->
prerr_endline (Odoc_messages.load_file_error file (Dynlink.error_message e)) ;
exit 1
| Not_found ->
prerr_endline (Odoc_messages.load_file_error file "Not_found");
- exit 1
+ exit 1
| Sys_error s
| Failure s ->
prerr_endline (Odoc_messages.load_file_error file s);
- exit 1
+ exit 1
let _ = print_DEBUG "Fin du chargement dynamique éventuel"
@@ -101,16 +101,16 @@ let _ = Odoc_args.parse
let loaded_modules =
- List.flatten
- (List.map
+ List.flatten
+ (List.map
(fun f ->
Odoc_info.verbose (Odoc_messages.loading f);
- try
+ try
let l = Odoc_analyse.load_modules f in
Odoc_info.verbose Odoc_messages.ok;
l
- with Failure s ->
- prerr_endline s ;
+ with Failure s ->
+ prerr_endline s ;
incr Odoc_global.errors ;
[]
)
@@ -124,20 +124,20 @@ let _ =
None -> ()
| Some f ->
try Odoc_analyse.dump_modules f modules
- with Failure s ->
+ with Failure s ->
prerr_endline s ;
incr Odoc_global.errors
-let _ =
+let _ =
match !Odoc_args.doc_generator with
None ->
()
- | Some gen ->
+ | Some gen ->
Odoc_info.verbose Odoc_messages.generating_doc;
gen#generate modules;
Odoc_info.verbose Odoc_messages.ok
-let _ =
+let _ =
if !Odoc_global.errors > 0 then
(
prerr_endline (Odoc_messages.errors_occured !Odoc_global.errors) ;
@@ -145,6 +145,6 @@ let _ =
)
else
exit 0
-
+
(* eof $Id$ *)
diff --git a/ocamldoc/odoc_args.ml b/ocamldoc/odoc_args.ml
index 91122ed688..f266e99f57 100644
--- a/ocamldoc/odoc_args.ml
+++ b/ocamldoc/odoc_args.ml
@@ -124,6 +124,8 @@ let index_only = ref false
let colorize_code = ref false
+let html_short_functors = ref false
+
let with_header = ref true
let with_trailer = ref true
@@ -256,7 +258,8 @@ let options = ref [
"-all-params", Arg.Set with_parameter_list, M.with_parameter_list ;
"-css-style", Arg.String (fun s -> css_style := Some s), M.css_style ;
"-index-only", Arg.Set index_only, M.index_only ;
- "-colorize-code", Arg.Set colorize_code, M.colorize_code ^
+ "-colorize-code", Arg.Set colorize_code, M.colorize_code ;
+ "-short-functors", Arg.Set html_short_functors, M.html_short_functors ^
"\n\n *** LaTeX options ***\n";
(* latex only options *)
diff --git a/ocamldoc/odoc_args.mli b/ocamldoc/odoc_args.mli
index 242f55659a..3aaa270f62 100644
--- a/ocamldoc/odoc_args.mli
+++ b/ocamldoc/odoc_args.mli
@@ -94,6 +94,10 @@ val index_only : bool ref
(** To colorize code in HTML generated documentation pages, not code pages. *)
val colorize_code : bool ref
+(** To display functors in short form rather than with "functor ... -> ",
+ in HTML generated documentation. *)
+val html_short_functors : bool ref
+
(** The flag which indicates if we must generate a header (for LaTeX). *)
val with_header : bool ref
diff --git a/ocamldoc/odoc_ast.ml b/ocamldoc/odoc_ast.ml
index a04af1b571..7c4e022caf 100644
--- a/ocamldoc/odoc_ast.ml
+++ b/ocamldoc/odoc_ast.ml
@@ -33,10 +33,10 @@ open Odoc_types
(** This variable contains the regular expression representing a blank.*)
let blank = "[ \010\013\009\012']"
+
(** This variable contains the regular expression representing a blank but not a '\n'.*)
let simple_blank = "[ \013\009\012]"
-
(** This module is used to search for structure items by name in a Typedtree.structure.
One function creates two hash tables, which can then be used to search for elements.
Class elements do not use tables.
@@ -68,12 +68,12 @@ module Typedtree_search =
| Typedtree.Tstr_module (ident, _) ->
Hashtbl.add table (M (Name.from_ident ident)) tt
| Typedtree.Tstr_recmodule mods ->
- List.iter
- (fun (ident,mod_expr) ->
- Hashtbl.add table (M (Name.from_ident ident))
- (Typedtree.Tstr_module (ident,mod_expr))
- )
- mods
+ List.iter
+ (fun (ident,mod_expr) ->
+ Hashtbl.add table (M (Name.from_ident ident))
+ (Typedtree.Tstr_module (ident,mod_expr))
+ )
+ mods
| Typedtree.Tstr_modtype (ident, _) ->
Hashtbl.add table (MT (Name.from_ident ident)) tt
| Typedtree.Tstr_exception (ident, _) ->
@@ -388,7 +388,7 @@ module Analyser =
(*
(
match clexp.Typedtree.cl_desc with
- Tclass_ident _ -> prerr_endline "Tclass_ident"
+ Tclass_ident _ -> prerr_endline "Tclass_ident"
| Tclass_structure _ -> prerr_endline "Tclass_structure"
| Tclass_fun _ -> prerr_endline "Tclass_fun"
| Tclass_apply _ -> prerr_endline "Tclass_apply"
@@ -507,18 +507,18 @@ module Analyser =
with Not_found -> raise (Failure (Odoc_messages.inherit_classexp_not_found_in_typedtree n))
in
let (info_opt, ele_comments) =
- get_comments_in_class last_pos
- p_clexp.Parsetree.pcl_loc.Location.loc_start.Lexing.pos_cnum
- in
+ get_comments_in_class last_pos
+ p_clexp.Parsetree.pcl_loc.Location.loc_start.Lexing.pos_cnum
+ in
let text_opt = match info_opt with None -> None | Some i -> i.Odoc_types.i_desc in
let name = tt_name_of_class_expr tt_clexp in
let inher =
- {
- ic_name = Odoc_env.full_class_or_class_type_name env name ;
- ic_class = None ;
- ic_text = text_opt ;
- }
- in
+ {
+ ic_name = Odoc_env.full_class_or_class_type_name env name ;
+ ic_class = None ;
+ ic_text = text_opt ;
+ }
+ in
iter (acc_inher @ [ inher ]) (acc_fields @ ele_comments)
p_clexp.Parsetree.pcl_loc.Location.loc_end.Lexing.pos_cnum
q
@@ -826,7 +826,7 @@ module Analyser =
{ (* A VOIR : chercher dans les modules et les module types, avec quel env ? *)
im_name = tt_name_from_module_expr mod_expr ;
im_module = None ;
- im_info = None ;
+ im_info = None ;
}
]
| _ ->
@@ -842,7 +842,7 @@ module Analyser =
[]
| ((Element_included_module im) :: q, (im_repl :: im_q)) ->
(Element_included_module { im_repl with im_info = im.im_info })
- :: (f (q, im_q))
+ :: (f (q, im_q))
| ((Element_included_module im) :: q, []) ->
(Element_included_module im) :: q
| (ele :: q, l) ->
@@ -850,6 +850,94 @@ module Analyser =
in
f (module_elements, included_modules)
+ (** This function removes the elements of the module which does not
+ belong to the given module type, if the module type is expanded
+ and the module has a "structure" kind. *)
+ let rec filter_module_with_module_type_constraint m mt =
+ match m.m_kind, mt with
+ Module_struct l, Types.Tmty_signature lsig ->
+ m.m_kind <- Module_struct (filter_module_elements_with_module_type_constraint l lsig);
+ m.m_type <- mt;
+ | _ -> ()
+
+ (** This function removes the elements of the module type which does not
+ belong to the given module type, if the module type is expanded
+ and the module type has a "structure" kind. *)
+ and filter_module_type_with_module_type_constraint mtyp mt =
+ match mtyp.mt_kind, mt with
+ Some Module_type_struct l, Types.Tmty_signature lsig ->
+ mtyp.mt_kind <- Some (Module_type_struct (filter_module_elements_with_module_type_constraint l lsig));
+ mtyp.mt_type <- Some mt;
+ | _ -> ()
+
+ and filter_module_elements_with_module_type_constraint l lsig =
+ let pred ele =
+ let f = match ele with
+ Element_module m ->
+ (function
+ Types.Tsig_module (ident,t,_) ->
+ let n1 = Name.simple m.m_name
+ and n2 = Ident.name ident in
+ (
+ match n1 = n2 with
+ true -> filter_module_with_module_type_constraint m t; true
+ | false -> false
+ )
+ | _ -> false)
+ | Element_module_type mt ->
+ (function
+ Types.Tsig_modtype (ident,Types.Tmodtype_manifest t) ->
+ let n1 = Name.simple mt.mt_name
+ and n2 = Ident.name ident in
+ (
+ match n1 = n2 with
+ true -> filter_module_type_with_module_type_constraint mt t; true
+ | false -> false
+ )
+ | _ -> false)
+ | Element_value v ->
+ (function
+ Types.Tsig_value (ident,_) ->
+ let n1 = Name.simple v.val_name
+ and n2 = Ident.name ident in
+ n1 = n2
+ | _ -> false)
+ | Element_type t ->
+ (function
+ Types.Tsig_type (ident,_,_) ->
+ (* A VOIR: il est possible que le détail du type soit caché *)
+ let n1 = Name.simple t.ty_name
+ and n2 = Ident.name ident in
+ n1 = n2
+ | _ -> false)
+ | Element_exception e ->
+ (function
+ Types.Tsig_exception (ident,_) ->
+ let n1 = Name.simple e.ex_name
+ and n2 = Ident.name ident in
+ n1 = n2
+ | _ -> false)
+ | Element_class c ->
+ (function
+ Types.Tsig_class (ident,_,_) ->
+ let n1 = Name.simple c.cl_name
+ and n2 = Ident.name ident in
+ n1 = n2
+ | _ -> false)
+ | Element_class_type ct ->
+ (function
+ Types.Tsig_cltype (ident,_,_) ->
+ let n1 = Name.simple ct.clt_name
+ and n2 = Ident.name ident in
+ n1 = n2
+ | _ -> false)
+ | Element_module_comment _ -> fun _ -> true
+ | Element_included_module _ -> fun _ -> true
+ in
+ List.exists f lsig
+ in
+ List.filter pred l
+
(** Analysis of a parse tree structure with a typed tree, to return module elements.*)
let rec analyse_structure env current_module_name last_pos pos_limit parsetree typedtree =
print_DEBUG "Odoc_ast:analyse_struture";
@@ -1033,13 +1121,13 @@ module Analyser =
ty_name = complete_name ;
ty_info = com_opt ;
ty_parameters =
- List.map2
- (fun p (co,cn,_) ->
- (Odoc_env.subst_type new_env p,
- co, cn)
- )
- tt_type_decl.Types.type_params
- tt_type_decl.Types.type_variance ;
+ List.map2
+ (fun p (co,cn,_) ->
+ (Odoc_env.subst_type new_env p,
+ co, cn)
+ )
+ tt_type_decl.Types.type_params
+ tt_type_decl.Types.type_variance ;
ty_kind = kind ;
ty_manifest =
(match tt_type_decl.Types.type_manifest with
@@ -1047,12 +1135,12 @@ module Analyser =
| Some t -> Some (Odoc_env.subst_type new_env t));
ty_loc = { loc_impl = Some (!file_name, loc_start) ; loc_inter = None } ;
ty_code =
- (
- if !Odoc_args.keep_code then
- Some (get_string_of_file loc_start new_end)
- else
- None
- ) ;
+ (
+ if !Odoc_args.keep_code then
+ Some (get_string_of_file loc_start new_end)
+ else
+ None
+ ) ;
}
in
let (maybe_more2, info_after_opt) =
@@ -1086,13 +1174,13 @@ module Analyser =
ex_args = List.map (Odoc_env.subst_type new_env) tt_excep_decl ;
ex_alias = None ;
ex_loc = { loc_impl = Some (!file_name, loc.Location.loc_start.Lexing.pos_cnum) ; loc_inter = None } ;
- ex_code =
+ ex_code =
(
- if !Odoc_args.keep_code then
+ if !Odoc_args.keep_code then
Some (get_string_of_file loc_start loc_end)
else
None
- ) ;
+ ) ;
}
in
(0, new_env, [ Element_exception new_ex ])
@@ -1133,18 +1221,18 @@ module Analyser =
module_expr
tt_module_expr
in
- let code =
- if !Odoc_args.keep_code then
- let loc = module_expr.Parsetree.pmod_loc in
- let st = loc.Location.loc_start.Lexing.pos_cnum in
- let en = loc.Location.loc_end.Lexing.pos_cnum in
- Some (get_string_of_file st en)
- else
- None
- in
- let new_module =
- { new_module_pre with m_code = code }
- in
+ let code =
+ if !Odoc_args.keep_code then
+ let loc = module_expr.Parsetree.pmod_loc in
+ let st = loc.Location.loc_start.Lexing.pos_cnum in
+ let en = loc.Location.loc_end.Lexing.pos_cnum in
+ Some (get_string_of_file st en)
+ else
+ None
+ in
+ let new_module =
+ { new_module_pre with m_code = code }
+ in
let new_env = Odoc_env.add_module env new_module.m_name in
let new_env2 =
match new_module.m_type with
@@ -1163,14 +1251,14 @@ module Analyser =
)
| Parsetree.Pstr_recmodule mods ->
- (* A VOIR ICI ca merde avec /work/tmp/graph.ml: pas de lien avec les module type
- dans les contraintes sur les modules *)
- let new_env =
+ (* A VOIR ICI pb: pas de lien avec les module type
+ dans les contraintes sur les modules *)
+ let new_env =
List.fold_left
(fun acc_env (name, _, mod_exp) ->
let complete_name = Name.concat current_module_name name in
- let e = Odoc_env.add_module acc_env complete_name in
- let tt_mod_exp =
+ let e = Odoc_env.add_module acc_env complete_name in
+ let tt_mod_exp =
try Typedtree_search.search_module table name
with Not_found -> raise (Failure (Odoc_messages.module_not_found_in_typedtree complete_name))
in
@@ -1181,12 +1269,12 @@ module Analyser =
None
mod_exp
tt_mod_exp
- in
- match new_module.m_type with
+ in
+ match new_module.m_type with
Types.Tmty_signature s ->
Odoc_env.add_signature e new_module.m_name
- ~rel: (Name.simple new_module.m_name) s
- | _ ->
+ ~rel: (Name.simple new_module.m_name) s
+ | _ ->
e
)
env
@@ -1209,14 +1297,14 @@ module Analyser =
else
get_comments_in_module last_pos loc_start
in
- let new_module = analyse_module
+ let new_module = analyse_module
new_env
current_module_name
name
com_opt
mod_exp
tt_mod_exp
- in
+ in
let eles = f loc_end q in
ele_comments @ ((Element_module new_module) :: eles)
in
@@ -1371,7 +1459,7 @@ module Analyser =
{
im_name = "dummy" ;
im_module = None ;
- im_info = comment_opt ;
+ im_info = comment_opt ;
}
in
(0, env, [ Element_included_module im ]) (* A VOIR : étendre l'environnement ? avec quoi ? *)
@@ -1383,16 +1471,16 @@ module Analyser =
let pos_end = p_module_expr.Parsetree.pmod_loc.Location.loc_end.Lexing.pos_cnum in
let modtype =
(* A VOIR : Odoc_env.subst_module_type env ? *)
- tt_module_expr.Typedtree.mod_type
+ tt_module_expr.Typedtree.mod_type
in
let m_code_intf =
- match p_module_expr.Parsetree.pmod_desc with
- Parsetree.Pmod_constraint (_, pmodule_type) ->
- let loc_start = pmodule_type.Parsetree.pmty_loc.Location.loc_start.Lexing.pos_cnum in
+ match p_module_expr.Parsetree.pmod_desc with
+ Parsetree.Pmod_constraint (_, pmodule_type) ->
+ let loc_start = pmodule_type.Parsetree.pmty_loc.Location.loc_start.Lexing.pos_cnum in
let loc_end = pmodule_type.Parsetree.pmty_loc.Location.loc_end.Lexing.pos_cnum in
- Some (get_string_of_file loc_start loc_end)
- | _ ->
- None
+ Some (get_string_of_file loc_start loc_end)
+ | _ ->
+ None
in
let m_base =
{
@@ -1404,9 +1492,9 @@ module Analyser =
m_kind = Module_struct [] ;
m_loc = { loc_impl = Some (!file_name, pos_start) ; loc_inter = None } ;
m_top_deps = [] ;
- m_code = None ; (* code is set by the caller, after the module is created *)
- m_code_intf = m_code_intf ;
- m_text_only = false ;
+ m_code = None ; (* code is set by the caller, after the module is created *)
+ m_code_intf = m_code_intf ;
+ m_text_only = false ;
}
in
match (p_module_expr.Parsetree.pmod_desc, tt_module_expr.Typedtree.mod_desc) with
@@ -1424,24 +1512,24 @@ module Analyser =
| (Parsetree.Pmod_functor (_, pmodule_type, p_module_expr2),
Typedtree.Tmod_functor (ident, mtyp, tt_module_expr2)) ->
- let loc_start = pmodule_type.Parsetree.pmty_loc.Location.loc_start.Lexing.pos_cnum in
+ let loc_start = pmodule_type.Parsetree.pmty_loc.Location.loc_start.Lexing.pos_cnum in
let loc_end = pmodule_type.Parsetree.pmty_loc.Location.loc_end.Lexing.pos_cnum in
- let mp_type_code = get_string_of_file loc_start loc_end in
- print_DEBUG (Printf.sprintf "mp_type_code=%s" mp_type_code);
- let mp_name = Name.from_ident ident in
- let mp_kind = Sig.analyse_module_type_kind env
- current_module_name pmodule_type mtyp
- in
+ let mp_type_code = get_string_of_file loc_start loc_end in
+ print_DEBUG (Printf.sprintf "mp_type_code=%s" mp_type_code);
+ let mp_name = Name.from_ident ident in
+ let mp_kind = Sig.analyse_module_type_kind env
+ current_module_name pmodule_type mtyp
+ in
let param =
{
mp_name = mp_name ;
mp_type = Odoc_env.subst_module_type env mtyp ;
- mp_type_code = mp_type_code ;
- mp_kind = mp_kind ;
+ mp_type_code = mp_type_code ;
+ mp_kind = mp_kind ;
}
in
let dummy_complete_name = (*Name.concat "__"*) param.mp_name in
- (* TODO: A VOIR CE __ *)
+ (* TODO: A VOIR CE __ *)
let new_env = Odoc_env.add_module env dummy_complete_name in
let m_base2 = analyse_module
new_env
@@ -1458,9 +1546,9 @@ module Analyser =
Typedtree.Tmod_apply (tt_module_expr1, tt_module_expr2, _))
| (Parsetree.Pmod_apply (p_module_expr1, p_module_expr2),
Typedtree.Tmod_constraint
- ({ Typedtree.mod_desc = Typedtree.Tmod_apply (tt_module_expr1, tt_module_expr2, _)},
+ ({ Typedtree.mod_desc = Typedtree.Tmod_apply (tt_module_expr1, tt_module_expr2, _)},
_, _)
- ) ->
+ ) ->
let m1 = analyse_module
env
current_module_name
@@ -1481,12 +1569,7 @@ module Analyser =
| (Parsetree.Pmod_constraint (p_module_expr2, p_modtype),
Typedtree.Tmod_constraint (tt_module_expr2, tt_modtype, _)) ->
- print_DEBUG ("Odoc_ast: case Parsetree.Pmod_constraint + Typedtree.Tmod_constraint "^module_name);
-
- (* we create the module with p_module_expr2 and tt_module_expr2
- but we change its type according to the constraint.
- A VOIR : est-ce que c'est bien ?
- *)
+ print_DEBUG ("Odoc_ast: case Parsetree.Pmod_constraint + Typedtree.Tmod_constraint "^module_name);
let m_base2 = analyse_module
env
current_module_name
@@ -1495,58 +1578,54 @@ module Analyser =
p_module_expr2
tt_module_expr2
in
- let mtkind = Sig.analyse_module_type_kind
- env
+ let mtkind = Sig.analyse_module_type_kind env
(Name.concat current_module_name "??")
p_modtype tt_modtype
in
+ let tt_modtype = Odoc_env.subst_module_type env tt_modtype in
+ filter_module_with_module_type_constraint m_base2 tt_modtype;
{
m_base with
- m_type = Odoc_env.subst_module_type env tt_modtype ;
- m_kind = Module_constraint (m_base2.m_kind,
- mtkind)
-
-(* Module_type_alias { mta_name = "Not analyzed" ;
- mta_module = None })
-*)
+ m_type = tt_modtype ;
+ m_kind = Module_constraint (m_base2.m_kind, mtkind) ;
}
| (Parsetree.Pmod_structure p_structure,
Typedtree.Tmod_constraint
- ({ Typedtree.mod_desc = Typedtree.Tmod_structure tt_structure},
- tt_modtype, _)
- ) ->
- (* needed for recursive modules *)
+ ({ Typedtree.mod_desc = Typedtree.Tmod_structure tt_structure},
+ tt_modtype, _)
+ ) ->
+ (* needed for recursive modules *)
- print_DEBUG ("Odoc_ast: case Parsetree.Pmod_structure + Typedtree.Tmod_constraint "^module_name);
- let elements = analyse_structure env complete_name pos_start pos_end p_structure tt_structure in
+ print_DEBUG ("Odoc_ast: case Parsetree.Pmod_structure + Typedtree.Tmod_constraint "^module_name);
+ let elements = analyse_structure env complete_name pos_start pos_end p_structure tt_structure in
(* we must complete the included modules *)
let included_modules_from_tt = tt_get_included_module_list tt_structure in
let elements2 = replace_dummy_included_modules elements included_modules_from_tt in
{ m_base with
- m_type = Odoc_env.subst_module_type env tt_modtype ;
- m_kind = Module_struct elements2 ;
- }
+ m_type = Odoc_env.subst_module_type env tt_modtype ;
+ m_kind = Module_struct elements2 ;
+ }
| (parsetree, typedtree) ->
(*DEBUG*)let s_parse =
(*DEBUG*) match parsetree with
(*DEBUG*) Parsetree.Pmod_ident _ -> "Pmod_ident"
- (*DEBUG*) | Parsetree.Pmod_structure _ -> "Pmod_structure"
- (*DEBUG*) | Parsetree.Pmod_functor _ -> "Pmod_functor"
- (*DEBUG*) | Parsetree.Pmod_apply _ -> "Pmod_apply"
- (*DEBUG*) | Parsetree.Pmod_constraint _ -> "Pmod_constraint"
- (*DEBUG*)in
- (*DEBUG*)let s_typed =
+ (*DEBUG*) | Parsetree.Pmod_structure _ -> "Pmod_structure"
+ (*DEBUG*) | Parsetree.Pmod_functor _ -> "Pmod_functor"
+ (*DEBUG*) | Parsetree.Pmod_apply _ -> "Pmod_apply"
+ (*DEBUG*) | Parsetree.Pmod_constraint _ -> "Pmod_constraint"
+ (*DEBUG*)in
+ (*DEBUG*)let s_typed =
(*DEBUG*) match typedtree with
(*DEBUG*) Typedtree.Tmod_ident _ -> "Tmod_ident"
- (*DEBUG*) | Typedtree.Tmod_structure _ -> "Tmod_structure"
- (*DEBUG*) | Typedtree.Tmod_functor _ -> "Tmod_functor"
- (*DEBUG*) | Typedtree.Tmod_apply _ -> "Tmod_apply"
- (*DEBUG*) | Typedtree.Tmod_constraint _ -> "Tmod_constraint"
- (*DEBUG*)in
- (*DEBUG*)let code = get_string_of_file pos_start pos_end in
- print_DEBUG (Printf.sprintf "code=%s\ns_parse=%s\ns_typed=%s\n" code s_parse s_typed);
+ (*DEBUG*) | Typedtree.Tmod_structure _ -> "Tmod_structure"
+ (*DEBUG*) | Typedtree.Tmod_functor _ -> "Tmod_functor"
+ (*DEBUG*) | Typedtree.Tmod_apply _ -> "Tmod_apply"
+ (*DEBUG*) | Typedtree.Tmod_constraint _ -> "Tmod_constraint"
+ (*DEBUG*)in
+ (*DEBUG*)let code = get_string_of_file pos_start pos_end in
+ print_DEBUG (Printf.sprintf "code=%s\ns_parse=%s\ns_typed=%s\n" code s_parse s_typed);
raise (Failure "analyse_module: parsetree and typedtree don't match.")
@@ -1586,12 +1665,8 @@ module Analyser =
m_kind = kind ;
m_loc = { loc_impl = Some (!file_name, 0) ; loc_inter = None } ;
m_top_deps = [] ;
- m_code = (if !Odoc_args.keep_code then Some !file else None) ;
- m_code_intf = None ;
- m_text_only = false ;
+ m_code = (if !Odoc_args.keep_code then Some !file else None) ;
+ m_code_intf = None ;
+ m_text_only = false ;
}
end
-
-
-
-(* eof $Id$ *)
diff --git a/ocamldoc/odoc_comments.ml b/ocamldoc/odoc_comments.ml
index 54650acb51..51873e305d 100644
--- a/ocamldoc/odoc_comments.ml
+++ b/ocamldoc/odoc_comments.ml
@@ -333,12 +333,11 @@ let info_of_string s =
None -> dummy
| Some i -> i
-let info_of_comment_file f =
+let info_of_comment_file modlist f =
try
let s = Odoc_misc.input_file_as_string f in
- info_of_string s
+ let i = info_of_string s in
+ Odoc_cross.assoc_comments_info "" modlist i
with
Sys_error s ->
failwith s
-
-(* eof $Id$ *)
diff --git a/ocamldoc/odoc_comments.mli b/ocamldoc/odoc_comments.mli
index b78369d182..28122cda94 100644
--- a/ocamldoc/odoc_comments.mli
+++ b/ocamldoc/odoc_comments.mli
@@ -66,7 +66,9 @@ val info_of_string : string -> Odoc_types.info
(** [info_of_comment_file file] parses the given file
and return an {!Odoc_types.info} structure. The content of the
file must have the same syntax as the content of a special comment.
+ The given module list is used for cross reference.
@raise Failure is the file could not be opened or there is a
syntax error.
*)
-val info_of_comment_file : string -> Odoc_types.info
+val info_of_comment_file :
+ Odoc_module.t_module list -> string -> Odoc_types.info
diff --git a/ocamldoc/odoc_cross.ml b/ocamldoc/odoc_cross.ml
index f589858fa3..02ad79f509 100644
--- a/ocamldoc/odoc_cross.ml
+++ b/ocamldoc/odoc_cross.ml
@@ -87,8 +87,8 @@ let rec build_alias_list = function
(
match m.m_kind with
Module_alias ma ->
- Hashtbl.add module_aliases m.m_name (ma.ma_name, Alias_to_resolve);
- Hashtbl.add module_and_modtype_aliases m.m_name (ma.ma_name, Alias_to_resolve)
+ Hashtbl.add module_aliases m.m_name (ma.ma_name, Alias_to_resolve);
+ Hashtbl.add module_and_modtype_aliases m.m_name (ma.ma_name, Alias_to_resolve)
| _ -> ()
);
build_alias_list q
@@ -96,8 +96,8 @@ let rec build_alias_list = function
(
match mt.mt_kind with
Some (Module_type_alias mta) ->
- Hashtbl.add module_and_modtype_aliases
- mt.mt_name (mta.mta_name, Alias_to_resolve)
+ Hashtbl.add module_and_modtype_aliases
+ mt.mt_name (mta.mta_name, Alias_to_resolve)
| _ -> ()
);
build_alias_list q
@@ -106,8 +106,8 @@ let rec build_alias_list = function
match e.ex_alias with
None -> ()
| Some ea ->
- Hashtbl.add exception_aliases
- e.ex_name (ea.ea_name,Alias_to_resolve)
+ Hashtbl.add exception_aliases
+ e.ex_name (ea.ea_name,Alias_to_resolve)
);
build_alias_list q
| _ :: q ->
@@ -126,26 +126,26 @@ let name_alias =
let rec f t name =
try
match Hashtbl.find t name with
- (s, Alias_resolved) -> s
- | (s, Alias_to_resolve) -> f t s
+ (s, Alias_resolved) -> s
+ | (s, Alias_to_resolve) -> f t s
with
Not_found ->
- try
- Hashtbl.iter
- (fun n2 (n3, _) ->
- if Name.prefix n2 name then
- let ln2 = String.length n2 in
- let s = n3^(String.sub name ln2 ((String.length name) - ln2)) in
- raise (Found s)
- )
- t ;
- Hashtbl.replace t name (name, Alias_resolved);
- name
- with
- Found s ->
- let s2 = f t s in
- Hashtbl.replace t s2 (s2, Alias_resolved);
- s2
+ try
+ Hashtbl.iter
+ (fun n2 (n3, _) ->
+ if Name.prefix n2 name then
+ let ln2 = String.length n2 in
+ let s = n3^(String.sub name ln2 ((String.length name) - ln2)) in
+ raise (Found s)
+ )
+ t ;
+ Hashtbl.replace t name (name, Alias_resolved);
+ name
+ with
+ Found s ->
+ let s2 = f t s in
+ Hashtbl.replace t s2 (s2, Alias_resolved);
+ s2
in
fun name alias_tbl ->
f alias_tbl name
@@ -169,7 +169,7 @@ let add_known_element name k =
Not_found ->
known_elements := Ele_map.add name [k] !known_elements
-let get_known_elements name =
+let rec get_known_elements name =
try Ele_map.find name !known_elements
with Not_found -> []
@@ -252,10 +252,10 @@ class scan =
add_known_element e.ex_name (Odoc_search.Res_exception e)
method scan_attribute a =
add_known_element a.att_value.val_name
- (Odoc_search.Res_attribute a)
+ (Odoc_search.Res_attribute a)
method scan_method m =
add_known_element m.met_value.val_name
- (Odoc_search.Res_method m)
+ (Odoc_search.Res_method m)
method scan_class_pre c =
add_known_element c.cl_name (Odoc_search.Res_class c);
true
@@ -576,118 +576,165 @@ and associate_in_class_type module_list (acc_b_modif, acc_incomplete_top_module_
let ao = Odoc_misc.apply_opt
-let rec assoc_comments_text_elements module_list t_ele =
+let not_found_of_kind kind name =
+ (match kind with
+ RK_module -> Odoc_messages.cross_module_not_found
+ | RK_module_type -> Odoc_messages.cross_module_type_not_found
+ | RK_class -> Odoc_messages.cross_class_not_found
+ | RK_class_type -> Odoc_messages.cross_class_type_not_found
+ | RK_value -> Odoc_messages.cross_value_not_found
+ | RK_type -> Odoc_messages.cross_type_not_found
+ | RK_exception -> Odoc_messages.cross_exception_not_found
+ | RK_attribute -> Odoc_messages.cross_attribute_not_found
+ | RK_method -> Odoc_messages.cross_method_not_found
+ | RK_section _ -> Odoc_messages.cross_section_not_found
+ ) name
+
+let rec assoc_comments_text_elements parent_name module_list t_ele =
match t_ele with
| Raw _
| Code _
| CodePre _
| Latex _
| Verbatim _ -> t_ele
- | Bold t -> Bold (assoc_comments_text module_list t)
- | Italic t -> Italic (assoc_comments_text module_list t)
- | Center t -> Center (assoc_comments_text module_list t)
- | Left t -> Left (assoc_comments_text module_list t)
- | Right t -> Right (assoc_comments_text module_list t)
- | Emphasize t -> Emphasize (assoc_comments_text module_list t)
- | List l -> List (List.map (assoc_comments_text module_list) l)
- | Enum l -> Enum (List.map (assoc_comments_text module_list) l)
+ | Bold t -> Bold (assoc_comments_text parent_name module_list t)
+ | Italic t -> Italic (assoc_comments_text parent_name module_list t)
+ | Center t -> Center (assoc_comments_text parent_name module_list t)
+ | Left t -> Left (assoc_comments_text parent_name module_list t)
+ | Right t -> Right (assoc_comments_text parent_name module_list t)
+ | Emphasize t -> Emphasize (assoc_comments_text parent_name module_list t)
+ | List l -> List (List.map (assoc_comments_text parent_name module_list) l)
+ | Enum l -> Enum (List.map (assoc_comments_text parent_name module_list) l)
| Newline -> Newline
- | Block t -> Block (assoc_comments_text module_list t)
- | Superscript t -> Superscript (assoc_comments_text module_list t)
- | Subscript t -> Subscript (assoc_comments_text module_list t)
- | Title (n, l_opt, t) -> Title (n, l_opt, (assoc_comments_text module_list t))
- | Link (s, t) -> Link (s, (assoc_comments_text module_list t))
- | Ref (name, None) ->
+ | Block t -> Block (assoc_comments_text parent_name module_list t)
+ | Superscript t -> Superscript (assoc_comments_text parent_name module_list t)
+ | Subscript t -> Subscript (assoc_comments_text parent_name module_list t)
+ | Title (n, l_opt, t) -> Title (n, l_opt, (assoc_comments_text parent_name module_list t))
+ | Link (s, t) -> Link (s, (assoc_comments_text parent_name module_list t))
+ | Ref (initial_name, None) ->
(
- match get_known_elements name with
- [] ->
- (
- try
- let re = Str.regexp ("^"^(Str.quote name)^"$") in
- let t = Odoc_search.find_section module_list re in
- let v2 = (name, Some (RK_section t)) in
- add_verified v2 ;
- Ref (name, Some (RK_section t))
- with
- Not_found ->
- Odoc_messages.pwarning (Odoc_messages.cross_element_not_found name);
- Ref (name, None)
- )
- | ele :: _ ->
- (* we look for the first element with this name *)
- let kind =
- match ele with
- Odoc_search.Res_module _ -> RK_module
- | Odoc_search.Res_module_type _ -> RK_module_type
- | Odoc_search.Res_class _ -> RK_class
- | Odoc_search.Res_class_type _ -> RK_class_type
- | Odoc_search.Res_value _ -> RK_value
- | Odoc_search.Res_type _ -> RK_type
- | Odoc_search.Res_exception _ -> RK_exception
- | Odoc_search.Res_attribute _ -> RK_attribute
- | Odoc_search.Res_method _ -> RK_method
- | Odoc_search.Res_section (_ ,t)-> assert false
- in
- add_verified (name, Some kind) ;
- Ref (name, Some kind)
+ let rec iter_parent ?parent_name name =
+ let res =
+ match get_known_elements name with
+ [] ->
+ (
+ try
+ let re = Str.regexp ("^"^(Str.quote name)^"$") in
+ let t = Odoc_search.find_section module_list re in
+ let v2 = (name, Some (RK_section t)) in
+ add_verified v2 ;
+ (name, Some (RK_section t))
+ with
+ Not_found ->
+ (name, None)
+ )
+ | ele :: _ ->
+ (* we look for the first element with this name *)
+ let (name, kind) =
+ match ele with
+ Odoc_search.Res_module m -> (m.m_name, RK_module)
+ | Odoc_search.Res_module_type mt -> (mt.mt_name, RK_module_type)
+ | Odoc_search.Res_class c -> (c.cl_name, RK_class)
+ | Odoc_search.Res_class_type ct -> (ct.clt_name, RK_class_type)
+ | Odoc_search.Res_value v -> (v.val_name, RK_value)
+ | Odoc_search.Res_type t -> (t.ty_name, RK_type)
+ | Odoc_search.Res_exception e -> (e.ex_name, RK_exception)
+ | Odoc_search.Res_attribute a -> (a.att_value.val_name, RK_attribute)
+ | Odoc_search.Res_method m -> (m.met_value.val_name, RK_method)
+ | Odoc_search.Res_section (_ ,t)-> assert false
+ in
+ add_verified (name, Some kind) ;
+ (name, Some kind)
+ in
+ match res with
+ | (name, Some k) -> Ref (name, Some k)
+ | (_, None) ->
+ match parent_name with
+ None ->
+ Odoc_messages.pwarning (Odoc_messages.cross_element_not_found initial_name);
+ Ref (initial_name, None)
+ | Some p ->
+ let parent_name =
+ match Name.father p with
+ "" -> None
+ | s -> Some s
+ in
+ iter_parent ?parent_name (Name.concat p initial_name)
+ in
+ iter_parent ~parent_name initial_name
)
- | Ref (name, Some kind) ->
+ | Ref (initial_name, Some kind) ->
(
- let v = (name, Some kind) in
- if was_verified v then
- Ref (name, Some kind)
- else
- match kind with
- | RK_section _ ->
- (
- (** we just verify that we find an element of this kind with this name *)
- try
- let re = Str.regexp ("^"^(Str.quote name)^"$") in
- let t = Odoc_search.find_section module_list re in
- let v2 = (name, Some (RK_section t)) in
- add_verified v2 ;
- Ref (name, Some (RK_section t))
- with
- Not_found ->
- Odoc_messages.pwarning (Odoc_messages.cross_section_not_found name);
- Ref (name, None)
- )
- | _ ->
- let (f,f_mes) =
- match kind with
- RK_module -> module_exists, Odoc_messages.cross_module_not_found
- | RK_module_type -> module_type_exists, Odoc_messages.cross_module_type_not_found
- | RK_class -> class_exists, Odoc_messages.cross_class_not_found
- | RK_class_type -> class_type_exists, Odoc_messages.cross_class_type_not_found
- | RK_value -> value_exists, Odoc_messages.cross_value_not_found
- | RK_type -> type_exists, Odoc_messages.cross_type_not_found
- | RK_exception -> exception_exists, Odoc_messages.cross_exception_not_found
- | RK_attribute -> attribute_exists, Odoc_messages.cross_attribute_not_found
- | RK_method -> method_exists, Odoc_messages.cross_method_not_found
- | RK_section _ -> assert false
- in
- if f name then
- (
- add_verified v ;
- Ref (name, Some kind)
- )
- else
- (
- Odoc_messages.pwarning (f_mes name);
- Ref (name, None)
- )
+ let rec iter_parent ?parent_name name =
+ let v = (name, Some kind) in
+ if was_verified v then
+ Ref (name, Some kind)
+ else
+ let res =
+ match kind with
+ | RK_section _ ->
+ (
+ (** we just verify that we find an element of this kind with this name *)
+ try
+ let re = Str.regexp ("^"^(Str.quote name)^"$") in
+ let t = Odoc_search.find_section module_list re in
+ let v2 = (name, Some (RK_section t)) in
+ add_verified v2 ;
+ (name, Some (RK_section t))
+ with
+ Not_found ->
+ (name, None)
+ )
+ | _ ->
+ let f =
+ match kind with
+ RK_module -> module_exists
+ | RK_module_type -> module_type_exists
+ | RK_class -> class_exists
+ | RK_class_type -> class_type_exists
+ | RK_value -> value_exists
+ | RK_type -> type_exists
+ | RK_exception -> exception_exists
+ | RK_attribute -> attribute_exists
+ | RK_method -> method_exists
+ | RK_section _ -> assert false
+ in
+ if f name then
+ (
+ add_verified v ;
+ (name, Some kind)
+ )
+ else
+ (name, None)
+ in
+ match res with
+ | (name, Some k) -> Ref (name, Some k)
+ | (_, None) ->
+ match parent_name with
+ None ->
+ Odoc_messages.pwarning (not_found_of_kind kind initial_name);
+ Ref (initial_name, None)
+ | Some p ->
+ let parent_name =
+ match Name.father p with
+ "" -> None
+ | s -> Some s
+ in
+ iter_parent ?parent_name (Name.concat p initial_name)
+ in
+ iter_parent ~parent_name initial_name
)
| Module_list l ->
Module_list l
| Index_list ->
Index_list
- | Custom (s,t) -> Custom (s, (assoc_comments_text module_list t))
+ | Custom (s,t) -> Custom (s, (assoc_comments_text parent_name module_list t))
-and assoc_comments_text module_list text =
- List.map (assoc_comments_text_elements module_list) text
+and assoc_comments_text parent_name module_list text =
+ List.map (assoc_comments_text_elements parent_name module_list) text
-and assoc_comments_info module_list i =
- let ft = assoc_comments_text module_list in
+and assoc_comments_info parent_name module_list i =
+ let ft = assoc_comments_text parent_name module_list in
{
i with
i_desc = ao ft i.i_desc ;
@@ -700,133 +747,155 @@ and assoc_comments_info module_list i =
}
-let rec assoc_comments_module_element module_list m_ele =
+let rec assoc_comments_module_element parent_name module_list m_ele =
match m_ele with
- Element_module m -> Element_module (assoc_comments_module module_list m)
- | Element_module_type mt -> Element_module_type (assoc_comments_module_type module_list mt)
- | Element_included_module _ -> m_ele (* don't go down into the aliases *)
- | Element_class c -> Element_class (assoc_comments_class module_list c)
- | Element_class_type ct -> Element_class_type (assoc_comments_class_type module_list ct)
- | Element_value v -> Element_value (assoc_comments_value module_list v)
- | Element_exception e -> Element_exception (assoc_comments_exception module_list e)
- | Element_type t -> Element_type (assoc_comments_type module_list t)
- | Element_module_comment t -> Element_module_comment (assoc_comments_text module_list t)
-
-and assoc_comments_class_element module_list c_ele =
+ Element_module m ->
+ Element_module (assoc_comments_module module_list m)
+ | Element_module_type mt ->
+ Element_module_type (assoc_comments_module_type module_list mt)
+ | Element_included_module _ ->
+ m_ele (* don't go down into the aliases *)
+ | Element_class c ->
+ Element_class (assoc_comments_class module_list c)
+ | Element_class_type ct ->
+ Element_class_type (assoc_comments_class_type module_list ct)
+ | Element_value v ->
+ Element_value (assoc_comments_value module_list v)
+ | Element_exception e ->
+ Element_exception (assoc_comments_exception module_list e)
+ | Element_type t ->
+ Element_type (assoc_comments_type module_list t)
+ | Element_module_comment t ->
+ Element_module_comment (assoc_comments_text parent_name module_list t)
+
+and assoc_comments_class_element parent_name module_list c_ele =
match c_ele with
- Class_attribute a -> Class_attribute (assoc_comments_attribute module_list a)
- | Class_method m -> Class_method (assoc_comments_method module_list m)
- | Class_comment t -> Class_comment (assoc_comments_text module_list t)
-
-and assoc_comments_module_kind module_list mk =
+ Class_attribute a ->
+ Class_attribute (assoc_comments_attribute module_list a)
+ | Class_method m ->
+ Class_method (assoc_comments_method module_list m)
+ | Class_comment t ->
+ Class_comment (assoc_comments_text parent_name module_list t)
+
+and assoc_comments_module_kind parent_name module_list mk =
match mk with
| Module_struct eles ->
- Module_struct (List.map (assoc_comments_module_element module_list) eles)
+ Module_struct
+ (List.map (assoc_comments_module_element parent_name module_list) eles)
| Module_alias _
| Module_functor _ ->
mk
| Module_apply (mk1, mk2) ->
- Module_apply (assoc_comments_module_kind module_list mk1,
- assoc_comments_module_kind module_list mk2)
+ Module_apply (assoc_comments_module_kind parent_name module_list mk1,
+ assoc_comments_module_kind parent_name module_list mk2)
| Module_with (mtk, s) ->
- Module_with (assoc_comments_module_type_kind module_list mtk, s)
+ Module_with (assoc_comments_module_type_kind parent_name module_list mtk, s)
| Module_constraint (mk1, mtk) ->
- Module_constraint (assoc_comments_module_kind module_list mk1,
- assoc_comments_module_type_kind module_list mtk)
+ Module_constraint
+ (assoc_comments_module_kind parent_name module_list mk1,
+ assoc_comments_module_type_kind parent_name module_list mtk)
-and assoc_comments_module_type_kind module_list mtk =
+and assoc_comments_module_type_kind parent_name module_list mtk =
match mtk with
| Module_type_struct eles ->
- Module_type_struct (List.map (assoc_comments_module_element module_list) eles)
+ Module_type_struct
+ (List.map (assoc_comments_module_element parent_name module_list) eles)
| Module_type_functor (params, mtk1) ->
- Module_type_functor (params, assoc_comments_module_type_kind module_list mtk1)
+ Module_type_functor
+ (params, assoc_comments_module_type_kind parent_name module_list mtk1)
| Module_type_alias _ ->
mtk
| Module_type_with (mtk1, s) ->
- Module_type_with (assoc_comments_module_type_kind module_list mtk1, s)
+ Module_type_with
+ (assoc_comments_module_type_kind parent_name module_list mtk1, s)
-and assoc_comments_class_kind module_list ck =
+and assoc_comments_class_kind parent_name module_list ck =
match ck with
Class_structure (inher, eles) ->
let inher2 =
List.map
- (fun ic -> { ic with
- ic_text = ao (assoc_comments_text module_list) ic.ic_text })
+ (fun ic ->
+ { ic with
+ ic_text = ao (assoc_comments_text parent_name module_list) ic.ic_text })
inher
in
- Class_structure (inher2, List.map (assoc_comments_class_element module_list) eles)
+ Class_structure
+ (inher2, List.map (assoc_comments_class_element parent_name module_list) eles)
| Class_apply _
| Class_constr _ -> ck
| Class_constraint (ck1, ctk) ->
- Class_constraint (assoc_comments_class_kind module_list ck1,
- assoc_comments_class_type_kind module_list ctk)
+ Class_constraint (assoc_comments_class_kind parent_name module_list ck1,
+ assoc_comments_class_type_kind parent_name module_list ctk)
-and assoc_comments_class_type_kind module_list ctk =
+and assoc_comments_class_type_kind parent_name module_list ctk =
match ctk with
Class_signature (inher, eles) ->
let inher2 =
List.map
(fun ic -> { ic with
- ic_text = ao (assoc_comments_text module_list) ic.ic_text })
+ ic_text = ao (assoc_comments_text parent_name module_list) ic.ic_text })
inher
in
- Class_signature (inher2, List.map (assoc_comments_class_element module_list) eles)
+ Class_signature (inher2, List.map (assoc_comments_class_element parent_name module_list) eles)
| Class_type _ -> ctk
and assoc_comments_module module_list m =
- m.m_info <- ao (assoc_comments_info module_list) m.m_info ;
- m.m_kind <- assoc_comments_module_kind module_list m.m_kind ;
+ m.m_info <- ao (assoc_comments_info m.m_name module_list) m.m_info ;
+ m.m_kind <- assoc_comments_module_kind m.m_name module_list m.m_kind ;
m
and assoc_comments_module_type module_list mt =
- mt.mt_info <- ao (assoc_comments_info module_list) mt.mt_info ;
- mt.mt_kind <- ao (assoc_comments_module_type_kind module_list) mt.mt_kind ;
+ mt.mt_info <- ao (assoc_comments_info mt.mt_name module_list) mt.mt_info ;
+ mt.mt_kind <- ao (assoc_comments_module_type_kind mt.mt_name module_list) mt.mt_kind ;
mt
and assoc_comments_class module_list c =
- c.cl_info <- ao (assoc_comments_info module_list) c.cl_info ;
- c.cl_kind <- assoc_comments_class_kind module_list c.cl_kind ;
- assoc_comments_parameter_list module_list c.cl_parameters;
+ c.cl_info <- ao (assoc_comments_info c.cl_name module_list) c.cl_info ;
+ c.cl_kind <- assoc_comments_class_kind c.cl_name module_list c.cl_kind ;
+ assoc_comments_parameter_list c.cl_name module_list c.cl_parameters;
c
and assoc_comments_class_type module_list ct =
- ct.clt_info <- ao (assoc_comments_info module_list) ct.clt_info ;
- ct.clt_kind <- assoc_comments_class_type_kind module_list ct.clt_kind ;
+ ct.clt_info <- ao (assoc_comments_info ct.clt_name module_list) ct.clt_info ;
+ ct.clt_kind <- assoc_comments_class_type_kind ct.clt_name module_list ct.clt_kind ;
ct
-and assoc_comments_parameter module_list p =
+and assoc_comments_parameter parent_name module_list p =
match p with
Simple_name sn ->
- sn.sn_text <- ao (assoc_comments_text module_list) sn.sn_text
+ sn.sn_text <- ao (assoc_comments_text parent_name module_list) sn.sn_text
| Tuple (l, t) ->
- List.iter (assoc_comments_parameter module_list) l
+ List.iter (assoc_comments_parameter parent_name module_list) l
-and assoc_comments_parameter_list module_list pl =
- List.iter (assoc_comments_parameter module_list) pl
+and assoc_comments_parameter_list parent_name module_list pl =
+ List.iter (assoc_comments_parameter parent_name module_list) pl
and assoc_comments_value module_list v =
- v.val_info <- ao (assoc_comments_info module_list) v.val_info ;
- assoc_comments_parameter_list module_list v.val_parameters;
+ let parent = Name.father v.val_name in
+ v.val_info <- ao (assoc_comments_info parent module_list) v.val_info ;
+ assoc_comments_parameter_list parent module_list v.val_parameters;
v
and assoc_comments_exception module_list e =
- e.ex_info <- ao (assoc_comments_info module_list) e.ex_info ;
+ let parent = Name.father e.ex_name in
+ e.ex_info <- ao (assoc_comments_info parent module_list) e.ex_info ;
e
and assoc_comments_type module_list t =
- t.ty_info <- ao (assoc_comments_info module_list) t.ty_info ;
+ let parent = Name.father t.ty_name in
+ t.ty_info <- ao (assoc_comments_info parent module_list) t.ty_info ;
(match t.ty_kind with
Type_abstract -> ()
| Type_variant (vl, _) ->
List.iter
- (fun vc -> vc.vc_text <- ao (assoc_comments_text module_list) vc.vc_text)
+ (fun vc -> vc.vc_text <- ao (assoc_comments_text parent module_list) vc.vc_text)
vl
| Type_record (fl, _) ->
List.iter
- (fun rf -> rf.rf_text <- ao (assoc_comments_text module_list) rf.rf_text)
+ (fun rf -> rf.rf_text <- ao (assoc_comments_text parent module_list) rf.rf_text)
fl
);
t
@@ -836,8 +905,9 @@ and assoc_comments_attribute module_list a =
a
and assoc_comments_method module_list m =
+ let parent_name = Name.father m.met_value.val_name in
let _ = assoc_comments_value module_list m.met_value in
- assoc_comments_parameter_list module_list m.met_value.val_parameters;
+ assoc_comments_parameter_list parent_name module_list m.met_value.val_parameters;
m
@@ -897,6 +967,3 @@ let associate module_list =
(* Find a type for each name of element which is referenced in comments. *)
ignore (associate_type_of_elements_in_comments module_list)
-
-
-(* eof $Id$ *)
diff --git a/ocamldoc/odoc_cross.mli b/ocamldoc/odoc_cross.mli
index 1c6a357027..2fce2c48c1 100644
--- a/ocamldoc/odoc_cross.mli
+++ b/ocamldoc/odoc_cross.mli
@@ -15,3 +15,6 @@
val associate : Odoc_module.t_module list -> unit
+val assoc_comments_info :
+ string -> Odoc_module.t_module list ->
+ Odoc_types.info -> Odoc_types.info
diff --git a/ocamldoc/odoc_dot.ml b/ocamldoc/odoc_dot.ml
index 877a84b913..452bf2bfa7 100644
--- a/ocamldoc/odoc_dot.ml
+++ b/ocamldoc/odoc_dot.ml
@@ -11,7 +11,7 @@
(* $Id$ *)
-(** Definition of a class which outputs a dot file showing
+(** Definition of a class which outputs a dot file showing
top modules dependencies.*)
open Odoc_info
@@ -32,7 +32,7 @@ class dot =
val mutable colors = !Args.dot_colors
(** Graph header. *)
- method header =
+ method header =
"digraph G {\n"^
" size=\"10,7.5\";\n"^
" ratio=\"fill\";\n"^
@@ -43,14 +43,14 @@ class dot =
method get_one_color =
match colors with
[] -> None
- | h :: q ->
+ | h :: q ->
colors <- q ;
Some h
method node_color s =
try Some (List.assoc s loc_colors)
with
- Not_found ->
+ Not_found ->
match self#get_one_color with
None -> None
| Some c ->
@@ -71,10 +71,10 @@ class dot =
F.fprintf fmt "\"%s\" -> \"%s\";\n" src dest
method generate_for_module fmt m =
- let l = List.filter
- (fun n ->
- !Args.dot_include_all or
- (List.exists (fun m -> m.Module.m_name = n) modules))
+ let l = List.filter
+ (fun n ->
+ !Args.dot_include_all or
+ (List.exists (fun m -> m.Module.m_name = n) modules))
m.Module.m_top_deps
in
self#print_module_atts fmt m;
@@ -91,9 +91,9 @@ class dot =
let oc = open_out !Args.out_file in
let fmt = F.formatter_of_out_channel oc in
F.fprintf fmt "%s" self#header;
- let graph = Odoc_info.Dep.deps_of_types
+ let graph = Odoc_info.Dep.deps_of_types
~kernel: !Args.dot_reduce
- types
+ types
in
List.iter (self#generate_for_type fmt) graph;
F.fprintf fmt "}\n" ;
@@ -103,14 +103,14 @@ class dot =
Sys_error s ->
raise (Failure s)
- method generate_modules modules_list =
+ method generate_modules modules_list =
try
modules <- modules_list ;
let oc = open_out !Args.out_file in
let fmt = F.formatter_of_out_channel oc in
F.fprintf fmt "%s" self#header;
- if !Args.dot_reduce then
+ if !Args.dot_reduce then
Odoc_info.Dep.kernel_deps_of_modules modules_list;
List.iter (self#generate_for_module fmt) modules_list;
@@ -123,6 +123,7 @@ class dot =
(** Generate the dot code in the file {!Odoc_info.Args.out_file}. *)
method generate (modules_list : Odoc_info.Module.t_module list) =
+ colors <- !Args.dot_colors;
if !Args.dot_types then
self#generate_types (Odoc_info.Search.types modules_list)
else
diff --git a/ocamldoc/odoc_html.ml b/ocamldoc/odoc_html.ml
index 1046958131..ff816b24be 100644
--- a/ocamldoc/odoc_html.ml
+++ b/ocamldoc/odoc_html.ml
@@ -899,7 +899,7 @@ class html =
in
bs b "<head>\n";
bs b style;
- bs b character_encoding ;
+ bs b character_encoding ;
bs b "<link rel=\"Start\" href=\"";
bs b self#index;
bs b "\">\n" ;
@@ -1168,10 +1168,21 @@ class html =
bs b (self#create_fully_qualified_module_idents_links father a.ma_name);
bs b "</code>"
| Module_functor (p, k) ->
- bs b "<div class=\"sig_block\">";
+ if !Odoc_info.Args.html_short_functors then
+ bs b " "
+ else
+ bs b "<div class=\"sig_block\">";
self#html_of_module_parameter b father p;
+ (
+ match k with
+ Module_functor _ -> ()
+ | _ when !Odoc_info.Args.html_short_functors ->
+ bs b ": "
+ | _ -> ()
+ );
self#html_of_module_kind b father ?modu k;
- bs b "</div>"
+ if not !Odoc_info.Args.html_short_functors then
+ bs b "</div>"
| Module_apply (k1, k2) ->
(* TODO: l'application n'est pas correcte dans un .mli.
Que faire ? -> afficher le module_type du typedtree *)
@@ -1190,14 +1201,20 @@ class html =
self#html_of_module_kind b father ?modu k
method html_of_module_parameter b father p =
+ let (s_functor,s_arrow) =
+ if !Odoc_info.Args.html_short_functors then
+ "", ""
+ else
+ "functor ", "-> "
+ in
self#html_of_text b
[
- Code "functor (";
+ Code (s_functor^"(");
Code p.mp_name ;
Code " : ";
] ;
self#html_of_module_type_kind b father p.mp_kind;
- self#html_of_text b [ Code ") -> "]
+ self#html_of_text b [ Code (") "^s_arrow)]
method html_of_module_element b father ele =
match ele with
@@ -1628,7 +1645,12 @@ class html =
else
bs b (Name.simple m.m_name)
);
- bs b ": ";
+ (
+ match m.m_kind with
+ Module_functor _ when !Odoc_info.Args.html_short_functors ->
+ ()
+ | _ -> bs b ": "
+ );
self#html_of_module_kind b father ~modu: m m.m_kind;
bs b "</pre>";
if info then
@@ -2040,7 +2062,7 @@ class html =
let b = new_buf () in
let pre_name = opt (fun c -> c.cl_name) pre in
let post_name = opt (fun c -> c.cl_name) post in
- bs b doctype ;
+ bs b doctype ;
bs b "<html>\n";
self#print_header b
~nav: (Some (pre_name, post_name, cl.cl_name))
@@ -2087,7 +2109,7 @@ class html =
let b = new_buf () in
let pre_name = opt (fun ct -> ct.clt_name) pre in
let post_name = opt (fun ct -> ct.clt_name) post in
- bs b doctype ;
+ bs b doctype ;
bs b "<html>\n";
self#print_header b
~nav: (Some (pre_name, post_name, clt.clt_name))
@@ -2133,7 +2155,7 @@ class html =
let b = new_buf () in
let pre_name = opt (fun mt -> mt.mt_name) pre in
let post_name = opt (fun mt -> mt.mt_name) post in
- bs b doctype ;
+ bs b doctype ;
bs b "<html>\n";
self#print_header b
~nav: (Some (pre_name, post_name, mt.mt_name))
@@ -2201,7 +2223,7 @@ class html =
let b = new_buf () in
let pre_name = opt (fun m -> m.m_name) pre in
let post_name = opt (fun m -> m.m_name) post in
- bs b doctype ;
+ bs b doctype ;
bs b "<html>\n";
self#print_header b
~nav: (Some (pre_name, post_name, modu.m_name))
@@ -2210,16 +2232,16 @@ class html =
bs b "<body>\n" ;
self#print_navbar b pre_name post_name modu.m_name ;
bs b "<center><h1>";
- if modu.m_text_only then
- bs b modu.m_name
- else
- (
+ if modu.m_text_only then
+ bs b modu.m_name
+ else
+ (
bs b
(
if Module.module_is_functor modu then
- Odoc_messages.functo
+ Odoc_messages.functo
else
- Odoc_messages.modul
+ Odoc_messages.modul
);
bp b " <a href=\"%s\">%s</a>" type_file modu.m_name;
(
@@ -2227,7 +2249,7 @@ class html =
None -> ()
| Some _ -> bp b " (<a href=\"%s\">.ml</a>)" code_file
)
- );
+ );
bs b "</h1></center>\n<br>\n";
if not modu.m_text_only then self#html_of_module b ~with_link: false modu;
@@ -2282,7 +2304,7 @@ class html =
let chanout = open_out (Filename.concat !Args.target_dir self#index) in
let b = new_buf () in
let title = match !Args.title with None -> "" | Some t -> self#escape t in
- bs b doctype ;
+ bs b doctype ;
bs b "<html>\n";
self#print_header b self#title;
bs b "<body>\n";
@@ -2290,7 +2312,8 @@ class html =
bs b title;
bs b "</h1></center>\n" ;
let info = Odoc_info.apply_opt
- Odoc_info.info_of_comment_file !Odoc_info.Args.intro_file
+ (Odoc_info.info_of_comment_file module_list)
+ !Odoc_info.Args.intro_file
in
(
match info with
@@ -2299,7 +2322,7 @@ class html =
bs b "<br/>";
self#html_of_Module_list b
(List.map (fun m -> m.m_name) module_list);
- bs b "</body>\n</html>"
+ bs b "</body>\n</html>"
| Some i -> self#html_of_info ~indent: false b info
);
Buffer.output_buffer chanout b;
diff --git a/ocamldoc/odoc_info.mli b/ocamldoc/odoc_info.mli
index ae849fa566..3fa8ea8226 100644
--- a/ocamldoc/odoc_info.mli
+++ b/ocamldoc/odoc_info.mli
@@ -210,7 +210,7 @@ module Type :
| Type_variant of variant_constructor list * bool
(** constructors * bool *)
| Type_record of record_field list * bool
- (** fields * bool *)
+ (** fields * bool *)
(** Representation of a type. *)
type t_type = Odoc_type.t_type =
@@ -410,7 +410,7 @@ module Module :
{
im_name : Name.t ; (** Complete name of the included module. *)
mutable im_module : mmt option ; (** The included module or module type, if we found it. *)
- mutable im_info : Odoc_types.info option ; (** comment associated to the includ directive *)
+ mutable im_info : Odoc_types.info option ; (** comment associated to the includ directive *)
}
and module_alias = Odoc_module.module_alias =
@@ -420,10 +420,10 @@ module Module :
}
and module_parameter = Odoc_module.module_parameter = {
- mp_name : string ; (** the name *)
- mp_type : Types.module_type ; (** the type *)
- mp_type_code : string ; (** the original code *)
- mp_kind : module_type_kind ; (** the way the parameter was built *)
+ mp_name : string ; (** the name *)
+ mp_type : Types.module_type ; (** the type *)
+ mp_type_code : string ; (** the original code *)
+ mp_kind : module_type_kind ; (** the way the parameter was built *)
}
(** Different kinds of a module. *)
@@ -444,16 +444,16 @@ module Module :
and t_module = Odoc_module.t_module =
{
m_name : Name.t ; (** Complete name of the module. *)
- m_type : Types.module_type ; (** The type of the module. *)
+ mutable m_type : Types.module_type ; (** The type of the module. *)
mutable m_info : info option ; (** Information found in the optional associated comment. *)
m_is_interface : bool ; (** [true] for modules read from interface files *)
m_file : string ; (** The file the module is defined in. *)
mutable m_kind : module_kind ; (** The way the module is defined. *)
mutable m_loc : location ;
mutable m_top_deps : Name.t list ; (** The toplevels module names this module depends on. *)
- mutable m_code : string option ; (** The whole code of the module *)
- mutable m_code_intf : string option ; (** The whole code of the interface of the module *)
- m_text_only : bool ; (** [true] if the module comes from a text file *)
+ mutable m_code : string option ; (** The whole code of the module *)
+ mutable m_code_intf : string option ; (** The whole code of the interface of the module *)
+ m_text_only : bool ; (** [true] if the module comes from a text file *)
}
and module_type_alias = Odoc_module.module_type_alias =
@@ -477,7 +477,7 @@ module Module :
{
mt_name : Name.t ; (** Complete name of the module type. *)
mutable mt_info : info option ; (** Information found in the optional associated comment. *)
- mt_type : Types.module_type option ; (** [None] means that the module type is abstract. *)
+ mutable mt_type : Types.module_type option ; (** [None] means that the module type is abstract. *)
mt_is_interface : bool ; (** [true] for modules read from interface files. *)
mt_file : string ; (** The file the module type is defined in. *)
mutable mt_kind : module_type_kind option ;
@@ -750,10 +750,11 @@ val info_string_of_info : info -> string
(** [info_of_comment_file file] parses the given file
and return an {!Odoc_info.info} structure. The content of the
file must have the same syntax as the content of a special comment.
+ The given module list is used for cross reference.
@raise Failure is the file could not be opened or there is a
syntax error.
*)
-val info_of_comment_file : string -> info
+val info_of_comment_file : Module.t_module list -> string -> info
(** [remove_ending_newline s] returns [s] without the optional ending newline. *)
val remove_ending_newline : string -> string
@@ -919,13 +920,13 @@ module Args :
sig
(** The kind of source file in arguments. *)
type source_file =
- Impl_file of string
- | Intf_file of string
- | Text_file of string
+ Impl_file of string
+ | Intf_file of string
+ | Text_file of string
(** The class type of documentation generators. *)
class type doc_generator =
- object method generate : Module.t_module list -> unit end
+ object method generate : Module.t_module list -> unit end
(** The file used by the generators outputting only one file. *)
val out_file : string ref
@@ -943,7 +944,7 @@ module Args :
val intro_file : string option ref
(** Flag to indicate whether we must display the complete list of parameters
- for functions and methods. *)
+ for functions and methods. *)
val with_parameter_list : bool ref
(** The list of module names to hide. *)
@@ -961,6 +962,10 @@ module Args :
(** To colorize code in HTML generated documentation pages, not code pages. *)
val colorize_code : bool ref
+ (** To display functors in short form rather than with "functor ... -> ",
+ in HTML generated documentation. *)
+ val html_short_functors : bool ref
+
(** The flag which indicates if we must generate a header (for LaTeX). *)
val with_header : bool ref
diff --git a/ocamldoc/odoc_latex.ml b/ocamldoc/odoc_latex.ml
index 26dfb667fd..95d1b91782 100644
--- a/ocamldoc/odoc_latex.ml
+++ b/ocamldoc/odoc_latex.ml
@@ -1014,15 +1014,15 @@ class latex =
method generate_for_top_module fmt m =
let (first_t, rest_t) = self#first_and_rest_of_info m.m_info in
let text =
- if m.m_text_only then
- [ Title (1, None, [Raw m.m_name] @
+ if m.m_text_only then
+ [ Title (1, None, [Raw m.m_name] @
(match first_t with
[] -> []
| t -> (Raw " : ") :: t)
- ) ;
- ]
- else
- [ Title (1, None,
+ ) ;
+ ]
+ else
+ [ Title (1, None,
[ Raw (Odoc_messages.modul^" ") ; Code m.m_name ] @
(match first_t with
[] -> []
@@ -1044,7 +1044,7 @@ class latex =
(Module.module_elements ~trans: false m)
(** Print the header of the TeX document. *)
- method latex_header fmt =
+ method latex_header fmt module_list =
ps fmt "\\documentclass[11pt]{article} \n";
ps fmt "\\usepackage[latin1]{inputenc} \n";
ps fmt "\\usepackage[T1]{fontenc} \n";
@@ -1067,7 +1067,8 @@ class latex =
if !Args.with_toc then ps fmt "\\tableofcontents\n";
(
let info = Odoc_info.apply_opt
- Odoc_info.info_of_comment_file !Odoc_info.Args.intro_file
+ (Odoc_info.info_of_comment_file module_list)
+ !Odoc_info.Args.intro_file
in
(match info with None -> () | Some _ -> ps fmt "\\vspace{0.2cm}");
self#latex_of_info fmt info;
@@ -1123,7 +1124,7 @@ class latex =
try
let chanout = open_out main_file in
let fmt = Format.formatter_of_out_channel chanout in
- if !Args.with_header then self#latex_header fmt;
+ if !Args.with_header then self#latex_header fmt module_list;
List.iter
(fun m ->
if !Args.separate_files then
diff --git a/ocamldoc/odoc_merge.ml b/ocamldoc/odoc_merge.ml
index 216102dc24..468c471139 100644
--- a/ocamldoc/odoc_merge.ml
+++ b/ocamldoc/odoc_merge.ml
@@ -28,7 +28,7 @@ open Odoc_module
The merge treatment depends on a given merge_option list.
@return the new info structure.*)
let merge_info merge_options (m1 : info) (m2 : info) =
- let new_desc_opt =
+ let new_desc_opt =
match m1.i_desc, m2.i_desc with
None, None -> None
| None, Some d
@@ -39,7 +39,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
Some d1
in
- let new_authors =
+ let new_authors =
match m1.i_authors, m2.i_authors with
[], [] -> []
| l, []
@@ -50,7 +50,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
l1
in
- let new_version =
+ let new_version =
match m1.i_version , m2.i_version with
None, None -> None
| Some v, None
@@ -61,7 +61,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
Some v1
in
- let new_sees =
+ let new_sees =
match m1.i_sees, m2.i_sees with
[], [] -> []
| l, []
@@ -72,7 +72,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
l1
in
- let new_since =
+ let new_since =
match m1.i_since, m2.i_since with
None, None -> None
| Some v, None
@@ -83,7 +83,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
Some v1
in
- let new_dep =
+ let new_dep =
match m1.i_deprecated, m2.i_deprecated with
None, None -> None
| None, Some t
@@ -94,7 +94,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
Some t1
in
- let new_params =
+ let new_params =
match m1.i_params, m2.i_params with
[], [] -> []
| l, []
@@ -118,7 +118,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
l1
in
- let new_raised_exceptions =
+ let new_raised_exceptions =
match m1.i_raised_exceptions, m2.i_raised_exceptions with
[], [] -> []
| l, []
@@ -142,7 +142,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
else
l1
in
- let new_rv =
+ let new_rv =
match m1.i_return_value, m2.i_return_value with
None, None -> None
| None, Some t
@@ -156,7 +156,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
let new_custom =
match m1.i_custom, m2.i_custom with
[], [] -> []
- | [], l
+ | [], l
| l, [] -> l
| l1, l2 ->
if List.mem Merge_custom merge_options then
@@ -175,7 +175,7 @@ let merge_info merge_options (m1 : info) (m2 : info) =
Odoc_types.i_raised_exceptions = new_raised_exceptions ;
Odoc_types.i_return_value = new_rv ;
Odoc_types.i_custom = new_custom ;
- }
+ }
(** Merge of two optional info structures. *)
let merge_info_opt merge_options mli_opt ml_opt =
@@ -203,7 +203,7 @@ let merge_types merge_options mli ml =
(fun c2 -> c2.vc_name = cons.vc_name)
l2
in
- let new_desc =
+ let new_desc =
match cons.vc_text, cons2.vc_text with
None, None -> None
| Some d, None
@@ -231,7 +231,7 @@ let merge_types merge_options mli ml =
(fun r -> r.rf_name = record.rf_name)
l2
in
- let new_desc =
+ let new_desc =
match record.rf_text, record2.rf_text with
None, None -> None
| Some d, None
@@ -258,7 +258,7 @@ let merge_types merge_options mli ml =
else
raise (Failure (Odoc_messages.different_types mli.ty_name))
-(** Merge of two param_info, one from a .mli, one from a .ml.
+(** Merge of two param_info, one from a .mli, one from a .ml.
The text fields are not handled but will be recreated from the
i_params field of the info structure.
Here, if a parameter in the .mli has no name, we take the one
@@ -277,7 +277,7 @@ let rec merge_param_info pi_mli pi_ml =
(* if we're here, then the tuple in the .mli has no parameter names ;
then we take the name of the parameter of the .ml and the type of the .mli. *)
Simple_name { sn_ml with sn_type = t_mli }
-
+
| (Tuple (l_mli, t_mli), Tuple (l_ml, _)) ->
(* if the two tuples have different lengths
(which should not occurs), we return the pi_mli,
@@ -313,15 +313,15 @@ let merge_classes merge_options mli ml =
(fun a ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Class_attribute a2 ->
+ Class_attribute a2 ->
if a2.att_value.val_name = a.att_value.val_name then
(
- a.att_value.val_info <- merge_info_opt merge_options
+ a.att_value.val_info <- merge_info_opt merge_options
a.att_value.val_info a2.att_value.val_info;
a.att_value.val_loc <- { a.att_value.val_loc with loc_impl = a2.att_value.val_loc.loc_impl } ;
- if !Odoc_args.keep_code then
+ if !Odoc_args.keep_code then
a.att_value.val_code <- a2.att_value.val_code;
true
)
@@ -344,23 +344,23 @@ let merge_classes merge_options mli ml =
(fun m ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Class_method m2 ->
+ Class_method m2 ->
if m2.met_value.val_name = m.met_value.val_name then
(
m.met_value.val_info <- merge_info_opt
merge_options m.met_value.val_info m2.met_value.val_info;
m.met_value.val_loc <- { m.met_value.val_loc with loc_impl = m2.met_value.val_loc.loc_impl } ;
(* merge the parameter names *)
- m.met_value.val_parameters <- (merge_parameters
+ m.met_value.val_parameters <- (merge_parameters
m.met_value.val_parameters
m2.met_value.val_parameters) ;
(* we must reassociate comments in @param to the corresponding
parameters because the associated comment of a parameter may have been changed by the merge.*)
Odoc_value.update_value_parameters_text m.met_value;
- if !Odoc_args.keep_code then
+ if !Odoc_args.keep_code then
m.met_value.val_code <- m2.met_value.val_code;
true
@@ -385,20 +385,20 @@ let merge_classes merge_options mli ml =
let merge_class_types merge_options mli ml =
mli.clt_info <- merge_info_opt merge_options mli.clt_info ml.clt_info;
mli.clt_loc <- { mli.clt_loc with loc_impl = ml.clt_loc.loc_impl } ;
- (* merge values *)
+ (* merge values *)
List.iter
(fun a ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Class_attribute a2 ->
+ Class_attribute a2 ->
if a2.att_value.val_name = a.att_value.val_name then
(
- a.att_value.val_info <- merge_info_opt merge_options
+ a.att_value.val_info <- merge_info_opt merge_options
a.att_value.val_info a2.att_value.val_info;
a.att_value.val_loc <- { a.att_value.val_loc with loc_impl = a2.att_value.val_loc.loc_impl } ;
- if !Odoc_args.keep_code then
+ if !Odoc_args.keep_code then
a.att_value.val_code <- a2.att_value.val_code;
true
@@ -422,22 +422,22 @@ let merge_class_types merge_options mli ml =
(fun m ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Class_method m2 ->
+ Class_method m2 ->
if m2.met_value.val_name = m.met_value.val_name then
(
m.met_value.val_info <- merge_info_opt
merge_options m.met_value.val_info m2.met_value.val_info;
m.met_value.val_loc <- { m.met_value.val_loc with loc_impl = m2.met_value.val_loc.loc_impl } ;
- m.met_value.val_parameters <- (merge_parameters
+ m.met_value.val_parameters <- (merge_parameters
m.met_value.val_parameters
m2.met_value.val_parameters) ;
(* we must reassociate comments in @param to the the corresponding
parameters because the associated comment of a parameter may have been changed y the merge.*)
Odoc_value.update_value_parameters_text m.met_value;
-
- if !Odoc_args.keep_code then
+
+ if !Odoc_args.keep_code then
m.met_value.val_code <- m2.met_value.val_code;
true
@@ -468,9 +468,9 @@ let rec merge_module_types merge_options mli ml =
(fun ex ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_exception ex2 ->
+ Element_exception ex2 ->
if ex2.ex_name = ex.ex_name then
(
ex.ex_info <- merge_info_opt merge_options ex.ex_info ex2.ex_info;
@@ -497,9 +497,9 @@ let rec merge_module_types merge_options mli ml =
(fun ty ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_type ty2 ->
+ Element_type ty2 ->
if ty2.ty_name = ty.ty_name then
(
merge_types merge_options ty ty2;
@@ -524,9 +524,9 @@ let rec merge_module_types merge_options mli ml =
(fun m ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_module m2 ->
+ Element_module m2 ->
if m2.m_name = m.m_name then
(
ignore (merge_modules merge_options m m2);
@@ -556,9 +556,9 @@ let rec merge_module_types merge_options mli ml =
(fun m ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_module_type m2 ->
+ Element_module_type m2 ->
if m2.mt_name = m.mt_name then
(
merge_module_types merge_options m m2;
@@ -586,9 +586,9 @@ let rec merge_module_types merge_options mli ml =
(fun v ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_value v2 ->
+ Element_value v2 ->
if v2.val_name = v.val_name then
(
v.val_info <- merge_info_opt merge_options v.val_info v2.val_info ;
@@ -601,7 +601,7 @@ let rec merge_module_types merge_options mli ml =
parameters because the associated comment of a parameter may have been changed y the merge.*)
Odoc_value.update_value_parameters_text v;
- if !Odoc_args.keep_code then
+ if !Odoc_args.keep_code then
v.val_code <- v2.val_code;
true
@@ -626,9 +626,9 @@ let rec merge_module_types merge_options mli ml =
(fun c ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_class c2 ->
+ Element_class c2 ->
if c2.cl_name = c.cl_name then
(
merge_classes merge_options c c2;
@@ -654,9 +654,9 @@ let rec merge_module_types merge_options mli ml =
(fun c ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_class_type c2 ->
+ Element_class_type c2 ->
if c2.clt_name = c.clt_name then
(
merge_class_types merge_options c c2;
@@ -682,24 +682,29 @@ let rec merge_module_types merge_options mli ml =
and merge_modules merge_options mli ml =
mli.m_info <- merge_info_opt merge_options mli.m_info ml.m_info;
mli.m_loc <- { mli.m_loc with loc_impl = ml.m_loc.loc_impl } ;
- (* More dependencies in the .ml file. *)
- mli.m_top_deps <- ml.m_top_deps ;
-
- let code =
+ let rec remove_doubles acc = function
+ [] -> acc
+ | h :: q ->
+ if List.mem h acc then remove_doubles acc q
+ else remove_doubles (h :: acc) q
+ in
+ mli.m_top_deps <- remove_doubles mli.m_top_deps ml.m_top_deps ;
+
+ let code =
if !Odoc_args.keep_code then
match mli.m_code, ml.m_code with
- Some s, _ -> Some s
- | _, Some s -> Some s
- | _ -> None
+ Some s, _ -> Some s
+ | _, Some s -> Some s
+ | _ -> None
else
None
in
- let code_intf =
+ let code_intf =
if !Odoc_args.keep_code then
match mli.m_code_intf, ml.m_code_intf with
- Some s, _ -> Some s
- | _, Some s -> Some s
- | _ -> None
+ Some s, _ -> Some s
+ | _, Some s -> Some s
+ | _ -> None
else
None
in
@@ -711,9 +716,9 @@ and merge_modules merge_options mli ml =
(fun ex ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_exception ex2 ->
+ Element_exception ex2 ->
if ex2.ex_name = ex.ex_name then
(
ex.ex_info <- merge_info_opt merge_options ex.ex_info ex2.ex_info;
@@ -740,9 +745,9 @@ and merge_modules merge_options mli ml =
(fun ty ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_type ty2 ->
+ Element_type ty2 ->
if ty2.ty_name = ty.ty_name then
(
merge_types merge_options ty ty2;
@@ -767,9 +772,9 @@ and merge_modules merge_options mli ml =
(fun m ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_module m2 ->
+ Element_module m2 ->
if m2.m_name = m.m_name then
(
ignore (merge_modules merge_options m m2);
@@ -799,9 +804,9 @@ and merge_modules merge_options mli ml =
(fun m ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_module_type m2 ->
+ Element_module_type m2 ->
if m2.mt_name = m.mt_name then
(
merge_module_types merge_options m m2;
@@ -841,8 +846,8 @@ and merge_modules merge_options mli ml =
(* we must reassociate comments in @param to the the corresponding
parameters because the associated comment of a parameter may have been changed y the merge.*)
Odoc_value.update_value_parameters_text v;
-
- if !Odoc_args.keep_code then
+
+ if !Odoc_args.keep_code then
v.val_code <- v2.val_code;
true
)
@@ -864,9 +869,9 @@ and merge_modules merge_options mli ml =
(fun c ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_class c2 ->
+ Element_class c2 ->
if c2.cl_name = c.cl_name then
(
merge_classes merge_options c c2;
@@ -892,9 +897,9 @@ and merge_modules merge_options mli ml =
(fun c ->
try
let _ = List.find
- (fun ele ->
+ (fun ele ->
match ele with
- Element_class_type c2 ->
+ Element_class_type c2 ->
if c2.clt_name = c.clt_name then
(
merge_class_types merge_options c c2;
@@ -914,7 +919,7 @@ and merge_modules merge_options mli ml =
()
)
(Odoc_module.module_class_types mli);
-
+
mli
let merge merge_options modules_list =
@@ -932,13 +937,13 @@ let merge merge_options modules_list =
m :: (iter l_others)
| m2 :: [] ->
(
- (* we can merge m with m2 if there is an implementation
+ (* we can merge m with m2 if there is an implementation
and an interface.*)
let f b = if !Odoc_args.inverse_merge_ml_mli then not b else b in
match f m.m_is_interface, f m2.m_is_interface with
true, false -> (merge_modules merge_options m m2) :: (iter l_others)
| false, true -> (merge_modules merge_options m2 m) :: (iter l_others)
- | false, false ->
+ | false, false ->
if !Odoc_args.inverse_merge_ml_mli then
(* two Module.ts for the .mli ! *)
raise (Failure (Odoc_messages.two_interfaces m.m_name))
@@ -959,5 +964,3 @@ let merge merge_options modules_list =
in
iter modules_list
-
-(* eof $Id$ *)
diff --git a/ocamldoc/odoc_messages.ml b/ocamldoc/odoc_messages.ml
index 66c4fa5fd7..033673b579 100644
--- a/ocamldoc/odoc_messages.ml
+++ b/ocamldoc/odoc_messages.ml
@@ -52,6 +52,7 @@ let load = "<file>\tLoad information from <file> ; may be used several times"
let css_style = "<file>\n\t\tUse content of <file> as CSS style definition "^html_only
let index_only = "\tGenerate index files only "^html_only
let colorize_code = "\n\t\tColorize code even in documentation pages "^html_only
+let html_short_functors = "\n\t\tUse short form to display functor types "^html_only
let generate_html = "\tGenerate HTML documentation"
let generate_latex = "\tGenerate LaTeX documentation"
let generate_texinfo = "\tGenerate TeXinfo documentation"
@@ -144,7 +145,7 @@ let latex_class_prefix =
"\t\t(default is \""^default_latex_class_prefix^"\")"
let default_latex_class_type_prefix = "classtype:"
-let latex_class_type_prefix =
+let latex_class_type_prefix =
"<string>\n\t\tUse <string> as prefix for the LaTeX labels of class types.\n"^
"\t\t(default is \""^default_latex_class_type_prefix^"\")"
@@ -286,7 +287,7 @@ let cross_element_not_found n = "Element "^n^" not found"
let cross_method_not_found n = "Method "^n^" not found"
let cross_attribute_not_found n = "Attribute "^n^" not found"
let cross_section_not_found n = "Section "^n^" not found"
-let cross_value_not_found n = "Attribute "^n^" not found"
+let cross_value_not_found n = "Value "^n^" not found"
let cross_type_not_found n = "Type "^n^" not found"
let object_end = "object ... end"
diff --git a/ocamldoc/odoc_module.ml b/ocamldoc/odoc_module.ml
index 756ccf86b6..3352bd8df1 100644
--- a/ocamldoc/odoc_module.ml
+++ b/ocamldoc/odoc_module.ml
@@ -64,7 +64,7 @@ and module_kind =
(** Representation of a module. *)
and t_module = {
m_name : Name.t ;
- m_type : Types.module_type ;
+ mutable m_type : Types.module_type ;
mutable m_info : Odoc_types.info option ;
m_is_interface : bool ; (** true for modules read from interface files *)
m_file : string ; (** the file the module is defined in. *)
@@ -92,7 +92,7 @@ and module_type_kind =
and t_module_type = {
mt_name : Name.t ;
mutable mt_info : Odoc_types.info option ;
- mt_type : Types.module_type option ; (** [None] = abstract module type *)
+ mutable mt_type : Types.module_type option ; (** [None] = abstract module type *)
mt_is_interface : bool ; (** true for modules read from interface files *)
mt_file : string ; (** the file the module type is defined in. *)
mutable mt_kind : module_type_kind option ; (** [None] = abstract module type if mt_type = None ;
@@ -207,41 +207,41 @@ let included_modules l =
let rec module_elements ?(trans=true) m =
let rec iter_kind = function
Module_struct l ->
- print_DEBUG "Odoc_module.module_element: Module_struct";
- l
+ print_DEBUG "Odoc_module.module_element: Module_struct";
+ l
| Module_alias ma ->
- print_DEBUG "Odoc_module.module_element: Module_alias";
- if trans then
+ print_DEBUG "Odoc_module.module_element: Module_alias";
+ if trans then
match ma.ma_module with
None -> []
| Some (Mod m) -> module_elements m
| Some (Modtype mt) -> module_type_elements mt
- else
+ else
[]
| Module_functor (_, k)
| Module_apply (k, _) ->
- print_DEBUG "Odoc_module.module_element: Module_functor ou Module_apply";
- iter_kind k
+ print_DEBUG "Odoc_module.module_element: Module_functor ou Module_apply";
+ iter_kind k
| Module_with (tk,_) ->
- print_DEBUG "Odoc_module.module_element: Module_with";
- module_type_elements ~trans: trans
+ print_DEBUG "Odoc_module.module_element: Module_with";
+ module_type_elements ~trans: trans
{ mt_name = "" ; mt_info = None ; mt_type = None ;
mt_is_interface = false ; mt_file = "" ; mt_kind = Some tk ;
mt_loc = Odoc_types.dummy_loc ;
}
| Module_constraint (k, tk) ->
- print_DEBUG "Odoc_module.module_element: Module_constraint";
+ print_DEBUG "Odoc_module.module_element: Module_constraint";
(* A VOIR : utiliser k ou tk ? *)
- module_elements ~trans: trans
+ module_elements ~trans: trans
{ m_name = "" ;
- m_info = None ;
- m_type = Types.Tmty_signature [] ;
+ m_info = None ;
+ m_type = Types.Tmty_signature [] ;
m_is_interface = false ; m_file = "" ; m_kind = k ;
m_loc = Odoc_types.dummy_loc ;
m_top_deps = [] ;
- m_code = None ;
- m_code_intf = None ;
- m_text_only = false ;
+ m_code = None ;
+ m_code_intf = None ;
+ m_text_only = false ;
}
(*
module_type_elements ~trans: trans
@@ -265,11 +265,11 @@ and module_type_elements ?(trans=true) mt =
else
[]
| Some (Module_type_alias mta) ->
- if trans then
+ if trans then
match mta.mta_module with
None -> []
| Some mt -> module_type_elements mt
- else
+ else
[]
in
iter_kind mt.mt_kind
@@ -342,7 +342,7 @@ let rec module_type_parameters ?(trans=true) mt =
with
Not_found ->
(p, None)
- in
+ in
param :: (iter (Some k2))
| Some (Module_type_alias mta) ->
if trans then
@@ -368,38 +368,38 @@ let rec module_type_parameters ?(trans=true) mt =
and module_parameters ?(trans=true) m =
let rec iter = function
Module_functor (p, k) ->
- let param =
+ let param =
(* we create the couple (parameter, description opt), using
the description of the parameter if we can find it in the comment.*)
- match m.m_info with
+ match m.m_info with
None ->(p, None)
- | Some i ->
- try
- let d = List.assoc p.mp_name i.Odoc_types.i_params in
- (p, Some d)
+ | Some i ->
+ try
+ let d = List.assoc p.mp_name i.Odoc_types.i_params in
+ (p, Some d)
with
- Not_found ->
+ Not_found ->
(p, None)
- in
- param :: (iter k)
+ in
+ param :: (iter k)
| Module_alias ma ->
- if trans then
+ if trans then
match ma.ma_module with
None -> []
| Some (Mod m) -> module_parameters ~trans m
| Some (Modtype mt) -> module_type_parameters ~trans mt
- else
+ else
[]
| Module_constraint (k, tk) ->
- module_type_parameters ~trans: trans
+ module_type_parameters ~trans: trans
{ mt_name = "" ; mt_info = None ; mt_type = None ;
mt_is_interface = false ; mt_file = "" ; mt_kind = Some tk ;
mt_loc = Odoc_types.dummy_loc }
| Module_struct _
| Module_apply _
| Module_with _ ->
- []
+ []
in
iter m.m_kind
@@ -435,14 +435,14 @@ let module_is_functor m =
let rec iter = function
Module_functor _ -> true
| Module_alias ma ->
- (
- match ma.ma_module with
+ (
+ match ma.ma_module with
None -> false
- | Some (Mod mo) -> iter mo.m_kind
- | Some (Modtype mt) -> module_type_is_functor mt
- )
+ | Some (Mod mo) -> iter mo.m_kind
+ | Some (Modtype mt) -> module_type_is_functor mt
+ )
| Module_constraint (k, _) ->
- iter k
+ iter k
| _ -> false
in
iter m.m_kind
diff --git a/ocamldoc/odoc_opt.ml b/ocamldoc/odoc_opt.ml
index 8eb7e6fa38..ff99599716 100644
--- a/ocamldoc/odoc_opt.ml
+++ b/ocamldoc/odoc_opt.ml
@@ -35,16 +35,16 @@ let _ = Odoc_args.parse
(default_dot_generator :> Odoc_args.doc_generator)
let loaded_modules =
- List.flatten
- (List.map
+ List.flatten
+ (List.map
(fun f ->
Odoc_info.verbose (Odoc_messages.loading f);
- try
+ try
let l = Odoc_analyse.load_modules f in
Odoc_info.verbose Odoc_messages.ok;
l
- with Failure s ->
- prerr_endline s ;
+ with Failure s ->
+ prerr_endline s ;
incr Odoc_global.errors ;
[]
)
@@ -58,11 +58,11 @@ let _ =
None -> ()
| Some f ->
try Odoc_analyse.dump_modules f modules
- with Failure s ->
+ with Failure s ->
prerr_endline s ;
incr Odoc_global.errors
-let _ =
+let _ =
match !Odoc_args.doc_generator with
None ->
()
@@ -71,7 +71,7 @@ let _ =
gen#generate modules;
Odoc_info.verbose Odoc_messages.ok
-let _ =
+let _ =
if !Odoc_global.errors > 0 then
(
prerr_endline (Odoc_messages.errors_occured !Odoc_global.errors) ;
@@ -79,4 +79,3 @@ let _ =
)
else
exit 0
-
diff --git a/ocamldoc/odoc_texi.ml b/ocamldoc/odoc_texi.ml
index b934f8576d..f602901410 100644
--- a/ocamldoc/odoc_texi.ml
+++ b/ocamldoc/odoc_texi.ml
@@ -993,12 +993,12 @@ class texi =
let title = [
self#node depth m.m_name ;
Title (depth, None,
- if m.m_text_only then
- [ Raw m.m_name ]
- else
- [ Raw (Odoc_messages.modul ^ " ") ;
+ if m.m_text_only then
+ [ Raw m.m_name ]
+ else
+ [ Raw (Odoc_messages.modul ^ " ") ;
Code m.m_name ]
- ) ;
+ ) ;
self#index `Module m.m_name ; Newline ] in
puts chanout (self#texi_of_text title) ;
@@ -1105,7 +1105,8 @@ class texi =
| Some f ->
nl chan ;
puts_nl chan
- (self#texi_of_info (Some (Odoc_info.info_of_comment_file f)))
+ (self#texi_of_info
+ (Some (Odoc_info.info_of_comment_file m_list f)))
end ;
(* write a top menu *)