X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fgrafite_parser%2FdependenciesParser.ml;h=b7b4151fa3b5c47f874cd476f60012e9bcfe7f85;hb=df61a96a76dcad98ebaee2faf875afd31dff7ead;hp=69a28c962ff49fc95b82c1055bdd04b49482e488;hpb=8f9d476c32c48d14348a61889dc191c7696bd404;p=helm.git diff --git a/helm/software/components/grafite_parser/dependenciesParser.ml b/helm/software/components/grafite_parser/dependenciesParser.ml index 69a28c962..b7b4151fa 100644 --- a/helm/software/components/grafite_parser/dependenciesParser.ml +++ b/helm/software/components/grafite_parser/dependenciesParser.ml @@ -25,6 +25,17 @@ (* $Id$ *) +(* FG + * From Cambridge dictionary + * Dependency: + * a country which is supported and governed by another country + * Dependence: + * when you need something or someone all the time, especially in order to + * continue existing or operating + * + * Fate vobis ... + *) + exception UnableToInclude of string (* statements meaningful for matitadep *) @@ -43,7 +54,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 +71,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,4 +104,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); - uri + uri,file