X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fbinaries%2Fmatitadep%2Fmatitadep.ml;h=054f90f4a64bac89921c71c81ba7c4bb7c3bc43b;hb=bf816f05ddbe0ded4948dd33490619724dc4f7cf;hp=4e0651be4e19541e473b1c11db3b3bb3ac0de09a;hpb=dec157aae89a4c1830f18eeb0b4152c8c5162ca7;p=helm.git diff --git a/matita/components/binaries/matitadep/matitadep.ml b/matita/components/binaries/matitadep/matitadep.ml index 4e0651be4..054f90f4a 100644 --- a/matita/components/binaries/matitadep/matitadep.ml +++ b/matita/components/binaries/matitadep/matitadep.ml @@ -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 ] < " in let help_c = " Print the redundant and looping arcs of the dependences graph" in let help_d = " Set these debug options" in let help_l = " Print the leaf nodes of the dependences graph" in