OCaml Mascot无法从.mli文件中找到模块

时间:2012-07-09 18:06:33

标签: ocaml

给出以下源文件:

(* /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

我尝试运行mascot代码检查程序,但它无法绑定.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"...

我在manual找不到任何解释文件分析的内容,但我相信Mascot应该在接口文件上运行,因为examples页面包括文档问题的例子:

(** Module descriptoion. *)

type t
(* This one is not actually documented
   (bare comment instead of ocamldoc one). *)
当我只提供源文件时,似乎没有运行

和接口检查。

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,并且只能通过编译当前目录中具有B的接口文件来使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标志不起作用。

相关问题