Commit 6974f756 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-03-16 14:20:55 by jdemouth] Nouveaux messages.

Original author: jdemouth
Date: 2004-03-16 14:20:55+00:00
parent 5d41e60d
......@@ -280,26 +280,29 @@ let topinput = run Parser.top_phrases
ifdef ML_INTERFACE then
let check_ml cu id out_dir out =
let fnam = String.copy cu in
String.set fnam 0 ( Char.lowercase ( String.get fnam 0 ) );
try
let name = cu ^ ".cmi" in
let name = fnam ^ ".cmi" in
let file = List.find (
fun dir -> Sys.file_exists ( Filename.concat dir name )
) !Librarian.obj_path in
if file = "" then raise Not_found;
let file = Filename.concat file name in
(* Load Caml .cmi file. *)
let ml_cu = ML.CompUnit.from_bytecode file cu
and cd_cu = Ml_cduce.CompUnit.from_types_cu cu id in
(* Check file interfaces. *)
Ml_checker.run ml_cu cd_cu;
(* Generate interface file. *)
String.set cu 0 ( Char.lowercase ( String.get cu 0 ) );
let out = open_out ( Filename.concat out_dir (cu ^ ".ml") ) in
let fmt = Format.formatter_of_out_channel out in
Ml_generator.ML.generate fmt ml_cu cd_cu;
close_out out;
with Not_found ->
Format.eprintf "Warning: no valid Caml interface found.@."
with Not_found -> (
let name = fnam ^ ".mli" in
let file = List.find (
fun dir -> Sys.file_exists ( Filename.concat dir name )
) !Librarian.obj_path in
if file <> "" then Format.eprintf "Warning: found %s.mli but no %s.cmi: forgotten compilation?@." fnam fnam;
)
else
let check_ml cu id out_dir out = ();;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment