]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/binaries/matitadep/matitadep.ml
- degree-based equivalene for terms
[helm.git] / matita / components / binaries / matitadep / matitadep.ml
index 4e0651be4e19541e473b1c11db3b3bb3ac0de09a..054f90f4a64bac89921c71c81ba7c4bb7c3bc43b 100644 (file)
@@ -14,10 +14,12 @@ let rec purge dname vdeps = match vdeps with
    | hd :: tl -> if hd = dname then tl else hd :: purge dname tl 
 
 let add fname =
+   if fname = "" then () else
    if Hashtbl.mem graph fname then () else
    Hashtbl.add graph fname {ddeps = []; rdeps = None}
 
 let add_ddep fname dname =
+   if dname = "" then () else
    let file = Hashtbl.find graph fname in
    Hashtbl.replace graph fname {file with ddeps = dname :: file.ddeps} 
 
@@ -81,7 +83,17 @@ let leaf () =
    StringSet.iter iter fnames
 
 let rec read ich = 
-   let _ = Scanf.sscanf (input_line ich) "%s@:include \"%s@\"." init in
+   let line = input_line ich in
+   begin try Scanf.sscanf line "%s@:include \"%s@\"." init 
+   with Scanf.Scan_failure _ ->
+      begin try Scanf.sscanf line "./%s@:include \"%s@\"." init
+      with Scanf.Scan_failure _ ->   
+         begin try Scanf.sscanf line "%s@:(*%s@*)" (fun _ _ -> ())
+         with Scanf.Scan_failure _ ->
+           Printf.eprintf "unknown line: %s.\n" line
+         end
+      end  
+   end;
    read ich
    
 let _ =
@@ -94,7 +106,7 @@ let _ =
       if !show_top then top ();
       if !show_leaf then leaf ()   
    in
-   let help   = "" in
+   let help   = "matitadep [-clt | -d <int> ] < <file>" in
    let help_c = " Print the redundant and looping arcs of the dependences graph" in
    let help_d = "<flags>  Set these debug options" in
    let help_l = " Print the leaf nodes of the dependences graph" in