From 070be7632b3a4fec0e1fffa787d2f38cf9c72b00 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Wed, 22 Jun 2005 11:34:13 +0000 Subject: [PATCH] string -> uri --- helm/searchEngine/searchEngine.ml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml index dcaee2466..b7783acfb 100644 --- a/helm/searchEngine/searchEngine.ml +++ b/helm/searchEngine/searchEngine.ml @@ -103,7 +103,8 @@ let javascript_quote s = let string_tail s = let len = String.length s in String.sub s 1 (len-1) -let nonvar s = +let nonvar uri = + let s = UriManager.string_of_uri uri in let len = String.length s in let suffix = String.sub s (len-4) 4 in not (suffix = ".var") @@ -283,7 +284,10 @@ let exec_action dbd (req: Http_types.request) outchan = | id::tail when id<>"" -> (fun id' -> if id = id' then - Some (List.map (fun u -> Netencoding.Url.decode u) tail) + Some (List.map + (fun u -> UriManager.uri_of_string + (Netencoding.Url.decode u)) + tail) else f id') | _ -> failwith "Can't parse choices") @@ -307,7 +311,7 @@ let exec_action dbd (req: Http_types.request) outchan = struct let interactive_user_uri_choice ~selection_mode ?ok ?enable_button_for_non_vars ~(title: string) ~(msg: string) - ~(id: string) (choices: string list) + ~(id: string) (choices: UriManager.uri list) = match id_to_choices id with | Some choices -> choices @@ -379,12 +383,14 @@ let exec_action dbd (req: Http_types.request) outchan = let uri = match term with | Cic.MutInd (uri, typeno, _) -> - UriManager.string_of_uriref (uri, [typeno]) + UriManager.uri_of_string + (UriManager.string_of_uriref (uri, [typeno])) | _ -> raise Not_a_MutInd in MetadataQuery.elim ~dbd uri | _ -> assert false in + let uris = List.map UriManager.string_of_uri uris in send_results ~id_to_uris (`Results uris) req outchan with | Not_a_MutInd -> @@ -440,6 +446,7 @@ let callback dbd (req: Http_types.request) outchan = send_results (`Results []) req outchan else begin let results = MetadataQuery.locate ~dbd expression in + let results = List.map UriManager.string_of_uri results in send_results (`Results results) req outchan end | "/hint" -- 2.39.2