From: Enrico Tassi Date: Mon, 14 Jan 2008 09:03:01 +0000 (+0000) Subject: better parsing of the root file X-Git-Tag: make_still_working~5673 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=effdaf06f6f002d930bdabcab0fd47d3cfc36c04;p=helm.git better parsing of the root file --- diff --git a/helm/software/components/library/librarian.ml b/helm/software/components/library/librarian.ml index da5136934..b765f64b6 100644 --- a/helm/software/components/library/librarian.ml +++ b/helm/software/components/library/librarian.ml @@ -40,7 +40,10 @@ let remove_trailing_slash s = let load_root_file rootpath = let data = HExtlib.input_file rootpath in let lines = Str.split (Str.regexp "\n") data in - let clean s = Pcre.replace ~pat:"^ *" (Pcre.replace ~pat:" *$" s) in + let clean s = + Pcre.replace ~pat:"[ \t]+" ~templ:" " + (Pcre.replace ~pat:"^ *" (Pcre.replace ~pat:" *$" s)) + in List.map (fun l -> match Str.split (Str.regexp "=") l with