X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fbinaries%2Ftranscript%2Fengine.ml;h=da07dd235489890fa39b5ec31d2aa3e47bcdb415;hb=2bcf927f58bac034b8758173cdbd16cb7475de36;hp=a51d3f0c2bd9df07bd5d769a3b083dc18ea793a4;hpb=8ae1653eb75d2b57c50e077c49cb9d078313ea9d;p=helm.git diff --git a/helm/software/components/binaries/transcript/engine.ml b/helm/software/components/binaries/transcript/engine.ml index a51d3f0c2..da07dd235 100644 --- a/helm/software/components/binaries/transcript/engine.ml +++ b/helm/software/components/binaries/transcript/engine.ml @@ -28,8 +28,8 @@ module X = HExtlib module HG = Http_getter module GA = GrafiteAst -module T = Types -module G = Grafite +module T = Types +module G = Grafite module O = Options type script = { @@ -66,8 +66,9 @@ let default_script = { let default_scripts = 2 +let suffix = ".conf.xml" + let load_registry registry = - let suffix = ".conf.xml" in let registry = if Filename.check_suffix registry suffix then registry else registry ^ suffix @@ -84,8 +85,10 @@ let set_files st = | None -> List.rev files | Some l -> let l = trim l in - if List.mem l st.excludes then aux files else aux (l :: files) - in + if List.mem l st.excludes then aux files else + if !O.sources = [] || List.mem l !O.sources then aux (l :: files) else + aux files + in let files = aux [] in let _ = Unix.close_process_in ich in {st with files = files} @@ -172,7 +175,7 @@ let is_ma st name = let set_items st name items = let i = get_index st name in let script = st.scripts.(i) in - let contents = List.rev_append items script.contents in + let contents = List.rev_append (X.list_uniq items) script.contents in st.scripts.(i) <- {script with name = name; contents = contents} let set_heading st name = @@ -196,11 +199,18 @@ let make_script_name st script name = Filename.concat st.output_path (name ^ ext) let get_iparams st name = + let debug debug = GA.IPDebug debug in let map = function + | "comments" -> GA.IPComments | "nodefaults" -> GA.IPNoDefaults | "coercions" -> GA.IPCoercions - | "comments" -> GA.IPComments - | s -> failwith ("unknown inline parameter: " ^ s) + | "cr" -> GA.IPCR + | s -> + try Scanf.sscanf s "debug-%u" debug with + | Scanf.Scan_failure _ + | Failure _ + | End_of_file -> + failwith ("unknown inline parameter: " ^ s) in List.map map (X.list_assoc_all name st.iparams)