1

次のソース ファイルがあるとします。

(* /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 はインターフェイス ファイルで実行されるはずだと思います。

(** Module descriptoion. *)

type t
(* This one is not actually documented
   (bare comment instead of ocamldoc one). *)

ソースファイルのみを提供すると、インターフェースチェックが実行されないようです。

4

1 に答える 1

1

B私は同じ問題にぶつかり、Mascotにそのインターフェイスファイルコンパイルして現在のディレクトリに置くだけでモジュールを見つけさせることができB.cmiました。たとえば、次のようになります。

cd /tmp/src
ocamlc B.mli
mascot.native -config mascot.cfg {A,B}.{ml,mli} -html /tmp/out.html

.mli/.cmiファイルを探す場所をMascotに指示するためのコマンドラインオプションがないようです。質問で述べたように、-Iフラグはこれには機能しません。

于 2012-10-26T11:27:29.290 に答える