下面是一个示例接口test.mli,使用ocamldoc风格的注释进行了注释:
(** ocamldoc module comment *)
open MissingModule;;
(** ocamldoc function comment *)
val test : unit;;如果我运行命令ocamldoc test.mli,我会得到以下错误:
File "test.mli", line 2, characters 0-9:
Error: Unbound module MissingModule
1 error(s) encountered为什么文档生成器应该关心未绑定的模块?
发布于 2012-04-19 06:20:52
这是因为ocamldoc完全限定了类型名。文件:
open MissingModule
val f: foo -> unit被翻译成
val f: MissingModule.foo -> unitMissingModule.foo成为MissingModule中foo定义的一个很好的交叉引用(如果missingModule.mli作为ocamldoc的参数)。
要完成答案,为了完全限定类型标识,您需要键入正在处理的文件。因此,ocamldoc需要能够访问相应的.cmi文件。
https://stackoverflow.com/questions/10217840
复制相似问题