let (slash_RE, til_slash_RE, no_slashes_RE) =
(Pcre.regexp "/", Pcre.regexp "^.*/", Pcre.regexp "^[^/]*$")
+let fix_regexp_RE = Pcre.regexp ("^" ^ (Pcre.quote "(cic|theory)"))
let ls regexp =
if remote () then
Pcre.regexp (pat ^ "/"), Pcre.regexp "[^/]+/[^/]*",
Pcre.regexp (pat ^ "(\\.|$)"), Pcre.regexp "/.*"
in
+ let exists_theory regexp =
+ let theory =
+ Pcre.replace ~rex:fix_regexp_RE ~templ:"theory" regexp ^ "index.theory"
+ in
+ try
+ ignore (resolve theory);
+ true
+ with Key_not_found _ -> false
+ in
let toplevel_theory =
match List.rev (Pcre.split ~rex:slash_RE pat) with
| dir :: _ -> Some (dir ^ ".theory")
(index_not_generated_yet := false ;
store_obj "index.theory"));
*)
- store_obj "index.theory";
+ if exists_theory regexp then store_obj "index.theory";
List.iter
(fun localpart ->
if not (List.mem localpart !valid_candidates) then