X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbin%2Frecomm%2Frecomm.ml;h=87caeb10b960a18857265629d23863866106b30b;hb=8fdf1af656038d0245eba64ff2531bbe94ce0e9e;hp=bac315438dea9bc465fbeff79c7946e982c43128;hpb=dbc57c92512c04b3fd88f8289bb8dbe99b2f90e0;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml b/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml index bac315438..87caeb10b 100644 --- a/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml +++ b/matita/matita/contribs/lambdadelta/bin/recomm/recomm.ml @@ -5,6 +5,7 @@ module EO = RecommOutput module P1 = RecommPccFor module P2 = RecommPcsAnd +module P3 = RecommPcsPar module G = RecommGc @@ -12,9 +13,22 @@ let write = ref false let force = ref false +let subst = ref None + let chdir path = Sys.chdir path +let start_substs () = + subst := Some (open_out "subst.txt") + +let write_substs lint = function + | None -> () + | Some och -> EO.write_substs och lint + +let stop_substs = function + | None -> () + | Some och -> close_out och + let rec process path name = let file = Filename.concat path name in if Sys.is_directory file then begin @@ -25,6 +39,7 @@ let rec process path name = Printf.eprintf "processing: %S\n" file; let orig = EI.read_srcs file in let lint = EC.recomm_srcs orig in + write_substs lint !subst; if !force || (!write && lint <> orig) then EO.write_srcs file lint end else begin Printf.eprintf "skipping: %S\n" file @@ -42,6 +57,7 @@ let msg_o = " Log other comments (default: no)" let msg_r = " Replace the input files (default: no)" let msg_s = " Log section comments (default: no)" let msg_t = " Log title comments (default: no)" +let msg_u = " Write substitution file (default: no)" let msg_w = " Write the changed output files (default: no)" let main = @@ -58,5 +74,7 @@ let main = "-r", Arg.Set EO.replace, msg_r; "-s", Arg.Set EC.log_s, msg_s; "-t", Arg.Set EC.log_t, msg_t; + "-u", Arg.Unit start_substs, msg_u; "-w", Arg.Set write, msg_w; - ] (process "") "" + ] (process "") ""; + stop_substs !subst