]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/binaries/probe/engine.ml
updated probe and matitadep
[helm.git] / matita / components / binaries / probe / engine.ml
index c959e648c5e86af39229145ac6c76105bf0d9111..0fe7ace5323168e188df2e54f62f68f961fb8eb1 100644 (file)
@@ -18,6 +18,8 @@ module US = U.UriSet
 module B  = Librarian
 module H  = HExtlib
 
+module M = MacLexer
+
 let unsupported protocol =
    failwith (P.sprintf "probe: unsupported protocol: %s" protocol)
 
@@ -41,17 +43,23 @@ let is_registry str =
 let get_uri str =
   let str = H.normalize_path str in
   let dir, file =
-      if H.is_regular str && F.check_suffix str ".ma" 
+      if H.is_regular str && F.check_suffix str ".ma"
       then F.dirname str, F.chop_extension (F.basename str)
       else if H.is_dir str then str, ""
       else missing str
    in
    let rec aux bdir file = match B.find_roots_in_dir bdir with
-      | [root] -> 
-         let buri = L.assoc "baseuri" (B.load_root_file root) in         
+      | [root] ->
+         let buri = L.assoc "baseuri" (B.load_root_file root) in
         F.concat bdir file, F.concat buri file
       | roots  ->
          if bdir = F.current_dir_name || bdir = F.dir_sep then unrooted dir roots else
         aux (F.dirname bdir) (F.concat (F.basename bdir) file)
    in
    aux dir file
+
+let mac fname =
+   let ich = open_in fname in
+   let lexbuf = Lexing.from_channel ich in
+   M.token lexbuf; close_in ich
+