Commit 32a80d70 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-03-11 13:33:19 by jdemouth] Ajout de l'option -I a l'interface.

Original author: jdemouth
Date: 2004-03-11 13:33:19+00:00
parent 2c941081
......@@ -281,17 +281,24 @@ let topinput = run Parser.top_phrases
ifdef ML_INTERFACE then
let check_ml cu id out_dir out =
try
let name = cu ^ ".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 (cu ^ ".cmi")
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 _ ->
with Not_found ->
Format.eprintf "Warning: no valid Caml interface found.@."
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