(* *)
(******************************************************************************)
-(* CSC: IMPERATIVE AND NOT VERY CLEAN, TO GET THE LAST ISSUED QUERY *)
-(* FG : THIS FUNCTION IS BECOMING A REAL NONSENSE *)
-let get_last_query =
- let query = ref "" in
- let out s = query := ! query ^ s in
- MQueryGenerator.set_confirm_query
- (function q ->
- query := ""; MQueryUtil.text_of_query out q ""; true);
- function result ->
- out (!query ^ " <h1>Result:</h1> "); MQueryUtil.text_of_result out result "<br>";
- !query
-;;
-
(** This module provides a functor to disambiguate the input **)
(** given a set of user-interface call-backs **)
module Make(C:Callbacks) =
struct
- let locate_one_id id =
- let result = MQueryGenerator.locate id in
+ let locate_one_id mqi_handle id =
+ let query = MQueryGenerator.locate id in
+ let result = MQueryInterpreter.execute mqi_handle query in
let uris =
List.map
(function uri,_ ->
MQueryMisc.wrong_xpointer_format_from_wrong_xpointer_format' uri
) result in
- let html=
- " <h1>Locate Query: </h1><pre>" ^ get_last_query result ^ "</pre>"
- in
- C.output_html html ;
+ C.output_html "<h1>Locate Query: </h1><pre>";
+ MQueryUtil.text_of_query C.output_html query "";
+ C.output_html "<h1>Result:</h1>";
+ MQueryUtil.text_of_result C.output_html result "<br>";
let uris' =
match uris with
[] ->
Uris of CicTextualParser0.uri list
| Symbols of (CicTextualParser0.interpretation -> Cic.term) list
- let disambiguate_input context metasenv dom mk_metasenv_and_expr ~id_to_uris=
+ let disambiguate_input mqi_handle context metasenv dom mk_metasenv_and_expr ~id_to_uris=
let known_ids,resolve_id = id_to_uris in
let dom' =
let rec filter =
let list_of_uris =
List.map
(function
- CicTextualParser0.Id id -> Uris (locate_one_id id)
+ CicTextualParser0.Id id -> Uris (locate_one_id mqi_handle id)
| CicTextualParser0.Symbol (descr,choices) ->
(* CSC: Implementare la funzione di filtraggio manuale *)
(* CSC: corrispondente alla locate_one_id *)