]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/grafite_parser/dependenciesParser.ml
Quick&dirty patch to make Http_getter_storage.is_empty ignore {.moo,.metadata.lexicon...
[helm.git] / helm / software / components / grafite_parser / dependenciesParser.ml
index dee9511182333c36d1ff7412f3c6498103e1b475..5e80d8b4c8279d118cd8c92dd03172bd78b304eb 100644 (file)
@@ -43,7 +43,14 @@ let parse_dependencies lexbuf =
     CicNotationLexer.level2_ast_lexer.Token.tok_func (Obj.magic lexbuf)
   in
   let rec parse acc = 
+   try
     (parser
+    | [< '("QSTRING", s) >] ->
+        (* because of alias id qstring = qstring :-( *)
+        (try
+          parse (UriDep (UriManager.uri_of_string s) :: acc)
+         with
+          UriManager.IllFormedUri _ -> parse acc)
     | [< '("URI", u) >] ->
         parse (UriDep (UriManager.uri_of_string u) :: acc)
     | [< '("IDENT", "include"); '("QSTRING", fname) >] ->
@@ -53,6 +60,9 @@ let parse_dependencies lexbuf =
     | [< '("EOI", _) >] -> acc
     | [< 'tok >] -> parse acc
     | [<  >] -> acc) tok_stream
+   with
+      Stream.Error _ -> parse acc
+    | CicNotationLexer.Error _ -> parse acc
   in
   List.rev (parse [])
 
@@ -83,10 +93,4 @@ let baseuri_of_script ~include_paths file =
  let uri = Http_getter_misc.strip_trailing_slash buri in
  if String.length uri < 5 || String.sub uri 0 5 <> "cic:/" then
    HLog.error (file ^ " sets an incorrect baseuri: " ^ buri);
- (try 
-   ignore(Http_getter.resolve ~writable:false uri)
- with
- | Http_getter_types.Unresolvable_URI _ -> 
-     HLog.error (file ^ " sets an unresolvable baseuri: " ^ buri)
- | Http_getter_types.Key_not_found _ -> ());
- uri
+ uri,file