;;
let nuri_of_ouri u indinfo =
- uri_of_string (string_of_uri (Uri(0,UriManager.string_of_uri u,indinfo)))
+ let s = UriManager.string_of_uri u in
+ let dot = String.rindex s '.' in
+ let s2 = String.sub s 0 dot in
+ let ns = match indinfo with
+ | Decl -> s2 ^ ".dec"
+ | Def -> s2 ^ ".def"
+ | Fix (i,j) -> s2 ^ ".fix(" ^ string_of_int i ^ "," ^ string_of_int j ^ ")"
+ | CoFix i -> s2 ^ ".cfx(" ^ string_of_int i ^ ")"
+ | Ind i -> s2 ^ ".ind(" ^ string_of_int i ^ ")"
+ | Con (i,j) -> s2 ^ ".con(" ^ string_of_int i ^ "," ^ string_of_int j ^ ")"
+ in uri_of_string ns
;;
let ouri_of_nuri u =
- UriManager.uri_of_string (string_of_uri u)
+ let s = string_of_uri u in
+ let dot = String.rindex s '.' in
+ let prefix = String.sub s 0 dot in
+ let suffix = String.sub s (dot+1) 3 in
+ let os =
+ match suffix with
+ | "dec"
+ | "def" -> prefix ^ ".con"
+ | "ind"
+ | "con" -> prefix ^ ".ind"
+ | _ -> assert false
+ in
+ UriManager.uri_of_string os
;;