给定以下源文件:
(* /tmp/src/A.mli *)
val f : B.t -> B.t(* /tmp/src/A.ml *)
let f (x : B.t) = x(* /tmp/src/B.mli *)
type t(* /tmp/src/B.ml *)
type t = int我试着运行吉祥物代码检查器,但是它无法绑定从.mli文件中引用的模块,尽管使用了-I标志。它可以很好地解决.ml文件中的绑定问题。
$ mascot.native -config mascot.cfg -I /tmp/src /tmp/src/{A,B}.{ml,mli} -html /tmp/out
File "/tmp/src/A.mli", line 2, characters 8-11:
Error: Unbound module B
loading configuration files...
configuring checks...
analyzing dependencies...
running checks...
reporting to "/tmp/out" with output "html"...
它可以很好地解决.ml文件中的绑定问题。
$ mascot.native -config mascot.cfg -I /tmp/src /tmp/src/{A,B}.ml -html /tmp/out
loading configuration files...
configuring checks...
analyzing dependencies...
running checks...
reporting to "/tmp/out" with output "html"...我在手册中找不到解释要分析的文件的任何东西,但是我相信Mascot应该在接口文件上运行,因为示例页面包含文档问题的例子:
(**模块描述)*)类型t (*这一个实际上没有文档化(裸注释而不是ocamldoc )。*)
当我只提供源文件时,界面检查似乎不会运行。
发布于 2012-10-26 11:27:29
我遇到了同样的问题,只有编译其接口文件并使B.cmi位于当前目录中,才能使Mascot找到模块B.cmi,例如:
cd /tmp/src
ocamlc B.mli
mascot.native -config mascot.cfg {A,B}.{ml,mli} -html /tmp/out.html似乎没有命令行选项可以告诉Mascot在哪里查找.mli/.cmi文件;正如问题中提到的,-I标志对此不起作用。
https://stackoverflow.com/questions/11400594
复制相似问题