aboutsummaryrefslogtreecommitdiff
path: root/tools/coqdep.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2020-02-09 22:39:46 +0100
committerEmilio Jesus Gallego Arias2020-02-11 11:00:06 +0100
commitc9d76e9cd6953625778bf4b173430d674e15f05d (patch)
tree25646027db77bd8ff74d4faa315c070a60e61002 /tools/coqdep.ml
parent4c6c173447d5b7d04aa0fd4f51d27a078c675708 (diff)
[coqdep] mli cleanup, remove unused functions
Diffstat (limited to 'tools/coqdep.ml')
-rw-r--r--tools/coqdep.ml46
1 files changed, 1 insertions, 45 deletions
diff --git a/tools/coqdep.ml b/tools/coqdep.ml
index 745cf950b5..950c784325 100644
--- a/tools/coqdep.ml
+++ b/tools/coqdep.ml
@@ -9,9 +9,8 @@
(************************************************************************)
open Format
-open Coqdep_lexer
-open Coqdep_common
open Minisys
+open Coqdep_common
(** The basic parts of coqdep (i.e. the parts used by [coqdep -boot])
are now in [Coqdep_common]. The code that remains here concerns
@@ -29,47 +28,6 @@ open Minisys
let option_sort = ref false
-let warning_mult suf iter =
- let tab = Hashtbl.create 151 in
- let check f d =
- begin try
- let d' = Hashtbl.find tab f in
- if (Filename.dirname (file_name f d))
- <> (Filename.dirname (file_name f d')) then begin
- coqdep_warning "the file %s is defined twice!" (f ^ suf)
- end
- with Not_found -> () end;
- Hashtbl.add tab f d
- in
- iter check
-
-let sort () =
- let seen = Hashtbl.create 97 in
- let rec loop file =
- let file = canonize file in
- if not (Hashtbl.mem seen file) then begin
- Hashtbl.add seen file ();
- let cin = open_in (file ^ ".v") in
- let lb = Lexing.from_channel cin in
- try
- while true do
- match coq_action lb with
- | Require (from, sl) ->
- List.iter
- (fun s ->
- match search_v_known ?from s with
- | None -> ()
- | Some f -> loop f)
- sl
- | _ -> ()
- done
- with Fin_fichier ->
- close_in cin;
- printf "%s%s " file !suffixe
- end
- in
- List.iter (fun (name,_) -> loop name) !vAccu
-
let usage () =
eprintf " usage: coqdep [options] <filename>+\n";
eprintf " options:\n";
@@ -159,8 +117,6 @@ let coqdep () =
List.iter (fun (f,d) -> add_mli_known f d ".mli") !mliAccu;
List.iter (fun (f,d) -> add_mllib_known f d ".mllib") !mllibAccu;
List.iter (fun (f,suff,d) -> add_ml_known f d suff) !mlAccu;
- warning_mult ".mli" iter_mli_known;
- warning_mult ".ml" iter_ml_known;
if !option_sort then begin sort (); exit 0 end;
if !option_c then mL_dependencies ();
coq_dependencies ();