]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_kernel/check.ml
added # to comment
[helm.git] / helm / software / components / ng_kernel / check.ml
index 87f9580da3879083c878a8e5a131e3ad2452167e..68c9ff1ae489e0cdf37f65e4a4166017fe426d7b 100644 (file)
@@ -8,22 +8,27 @@ let _ =
   NCicPp.set_ppterm NCicPp.trivial_pp_term;
   Helm_registry.load_from "conf.xml";
   let alluris = 
-    try [Sys.argv.(1)]
+    try
+      let s = Sys.argv.(1) in
+      if s = "-alluris" then
+       begin
+        let uri_re = Str.regexp ".*\\(ind\\|var\\|con\\)$" in
+        let uris = Http_getter.getalluris () in
+        let alluris = List.filter (fun u -> Str.string_match uri_re u 0) uris in
+        let oc = open_out "alluris.txt" in
+        List.iter (fun s -> output_string oc (s^"\n")) alluris;
+        close_out oc; 
+        []
+       end
+      else [s]
     with Invalid_argument _ -> 
       let r = ref [] in
       let ic = open_in "alluris.txt" in
       try while true do r := input_line ic :: !r; done; []
       with _ -> List.rev !r
   in
-(* uncomment to obtain the list of uris
-  let uri_re = Str.regexp ".*\\(ind\\|var\\|con\\)$" in
-  let uris = Http_getter.getalluris () in
-  let alluris = List.filter (fun u -> Str.string_match uri_re u 0) uris in
-  let oc = open_out "alluris.txt" in
-  List.iter (fun s -> output_string oc (s^"\n")) alluris;
-  close_out oc; exit 0;
-*)
   List.iter (fun uu ->
+    if uu.[0] = '#' then prerr_endline "SKIP" else begin
     prerr_endline ("************* INIZIO **************** " ^ uu);
     let u = UriManager.uri_of_string uu in
     let _,o = NCicEnvironment.get_obj (NUri.nuri_of_ouri u) in
@@ -33,8 +38,10 @@ let _ =
     with 
     | NCicTypeChecker.AssertFailure s 
     | NCicTypeChecker.TypeCheckerFailure s as e -> 
+(*        prerr_endline ("Obj: " ^ NCicPp.ppobj o); *)
        prerr_endline (Lazy.force s); raise e
     | CicEnvironment.Object_not_found s -> 
-        prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s))
+                    prerr_endline ("Obj not found: " ^ UriManager.string_of_uri s);
+    end)
     alluris
 ;;