From 6e2770c280aa9e74604e25324afb680b18d01964 Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Wed, 29 Oct 2003 15:40:25 +0000 Subject: [PATCH] some interfaces changed to prepare the mathql code for version 1.4 --- helm/Makefile | 3 ++- helm/gTopLevel/.depend | 17 +++++++---------- helm/gTopLevel/disambiguate.ml | 4 ++-- helm/gTopLevel/gTopLevel.ml | 4 ++-- helm/mathql_test/mqgtop.ml | 8 ++++---- helm/mathql_test/mqtop.ml | 2 +- helm/ocaml/mathql_interpreter/.depend | 6 ++---- .../mathql_interpreter/mQueryInterpreter.ml | 6 +++--- helm/ocaml/mathql_interpreter/mQueryUtil.ml | 4 ++-- helm/ocaml/mathql_interpreter/mQueryUtil.mli | 4 ++-- helm/searchEngine/searchEngine.ml | 2 +- 11 files changed, 28 insertions(+), 32 deletions(-) diff --git a/helm/Makefile b/helm/Makefile index 721a89621..0b925d515 100644 --- a/helm/Makefile +++ b/helm/Makefile @@ -1,4 +1,5 @@ -DIRS = ocaml hbugs gTopLevel searchEngine mathql_test +DIRS = ocaml gTopLevel searchEngine mathql_test +# hbugs DIRS_BYTE = $(patsubst %,%.byte,$(DIRS)) DIRS_OPT = $(patsubst %,%.opt,$(DIRS)) diff --git a/helm/gTopLevel/.depend b/helm/gTopLevel/.depend index af62a9fcb..6da67a4a5 100644 --- a/helm/gTopLevel/.depend +++ b/helm/gTopLevel/.depend @@ -1,3 +1,6 @@ +termEditor.cmi: disambiguate.cmi +texTermEditor.cmi: disambiguate.cmi +invokeTactics.cmi: termEditor.cmi termViewer.cmi proofEngine.cmo: proofEngine.cmi proofEngine.cmx: proofEngine.cmi logicalOperations.cmo: proofEngine.cmi logicalOperations.cmi @@ -6,10 +9,8 @@ disambiguate.cmo: disambiguate.cmi disambiguate.cmx: disambiguate.cmi termEditor.cmo: disambiguate.cmi termEditor.cmi termEditor.cmx: disambiguate.cmx termEditor.cmi -termEditor.cmi: disambiguate.cmi texTermEditor.cmo: disambiguate.cmi texTermEditor.cmi texTermEditor.cmx: disambiguate.cmx texTermEditor.cmi -texTermEditor.cmi: disambiguate.cmi xmlDiff.cmo: xmlDiff.cmi xmlDiff.cmx: xmlDiff.cmi termViewer.cmo: logicalOperations.cmi xmlDiff.cmi termViewer.cmi @@ -18,11 +19,7 @@ invokeTactics.cmo: logicalOperations.cmi proofEngine.cmi termEditor.cmi \ termViewer.cmi invokeTactics.cmi invokeTactics.cmx: logicalOperations.cmx proofEngine.cmx termEditor.cmx \ termViewer.cmx invokeTactics.cmi -invokeTactics.cmi: termEditor.cmi termViewer.cmi -hbugs.cmo: invokeTactics.cmi proofEngine.cmi hbugs.cmi -hbugs.cmx: invokeTactics.cmx proofEngine.cmx hbugs.cmi -hbugs.cmi: invokeTactics.cmi -gTopLevel.cmo: hbugs.cmi invokeTactics.cmi logicalOperations.cmi \ - proofEngine.cmi termEditor.cmi termViewer.cmi texTermEditor.cmi -gTopLevel.cmx: hbugs.cmx invokeTactics.cmx logicalOperations.cmx \ - proofEngine.cmx termEditor.cmx termViewer.cmx texTermEditor.cmx +gTopLevel.cmo: invokeTactics.cmi logicalOperations.cmi proofEngine.cmi \ + termEditor.cmi termViewer.cmi texTermEditor.cmi +gTopLevel.cmx: invokeTactics.cmx logicalOperations.cmx proofEngine.cmx \ + termEditor.cmx termViewer.cmx texTermEditor.cmx diff --git a/helm/gTopLevel/disambiguate.ml b/helm/gTopLevel/disambiguate.ml index 974e0b49e..efb1c0508 100644 --- a/helm/gTopLevel/disambiguate.ml +++ b/helm/gTopLevel/disambiguate.ml @@ -73,9 +73,9 @@ module Make(C:Callbacks) = MQueryMisc.wrong_xpointer_format_from_wrong_xpointer_format' uri ) result in C.output_html "

Locate Query:

";
-     MQueryUtil.text_of_query C.output_html query ""; 
+     MQueryUtil.text_of_query C.output_html "" query; 
      C.output_html "

Result:

"; - MQueryUtil.text_of_result C.output_html result "
"; + MQueryUtil.text_of_result C.output_html "
" result; let uris' = match uris with [] -> diff --git a/helm/gTopLevel/gTopLevel.ml b/helm/gTopLevel/gTopLevel.ml index 7861304ef..9fd0b352b 100644 --- a/helm/gTopLevel/gTopLevel.ml +++ b/helm/gTopLevel/gTopLevel.ml @@ -982,9 +982,9 @@ let locate_callback id = MQueryMisc.wrong_xpointer_format_from_wrong_xpointer_format' uri) result in out "

Locate Query:

";
-  MQueryUtil.text_of_query out query ""; 
+  MQueryUtil.text_of_query out "" query; 
   out "

Result:

"; - MQueryUtil.text_of_result out result "
"; + MQueryUtil.text_of_result out "
" result; user_uri_choice ~title:"Ambiguous input." ~msg: ("Ambiguous input \"" ^ id ^ diff --git a/helm/mathql_test/mqgtop.ml b/helm/mathql_test/mqgtop.ml index edf714b1e..d13ab2538 100644 --- a/helm/mathql_test/mqgtop.ml +++ b/helm/mathql_test/mqgtop.ml @@ -73,14 +73,14 @@ let issue handle q = let out = output_string och in if ! query_num = 1 then out (time () ^ nl); out ("Query: " ^ string_of_int ! query_num ^ nl); - U.text_of_query out q nl; + U.text_of_query out nl q; out ("Result: " ^ nl); - U.text_of_result out r nl; + U.text_of_result out nl r; close_out och in - if ! show_queries then U.text_of_query (output_string stdout) q nl; + if ! show_queries then U.text_of_query (output_string stdout) nl q; let r = I.execute handle q in - U.text_of_result (output_string stdout) r nl; + U.text_of_result (output_string stdout) nl r; if ! log_file <> "" then log q r; incr query_num; flush stdout diff --git a/helm/mathql_test/mqtop.ml b/helm/mathql_test/mqtop.ml index 48ffb1e74..851a63391 100644 --- a/helm/mathql_test/mqtop.ml +++ b/helm/mathql_test/mqtop.ml @@ -32,7 +32,7 @@ let _ = let ich = Lexing.from_channel stdin in let rec aux () = let t = U.start_time () in - U.text_of_query print_string (U.query_of_text ich) "\n"; + U.text_of_query print_string "\n" (U.query_of_text ich); Printf.printf "mqtop: query: %s\n" (U.stop_time t); flush stdout; aux() in diff --git a/helm/ocaml/mathql_interpreter/.depend b/helm/ocaml/mathql_interpreter/.depend index 7d9b3c625..bbe2948d5 100644 --- a/helm/ocaml/mathql_interpreter/.depend +++ b/helm/ocaml/mathql_interpreter/.depend @@ -1,11 +1,9 @@ mQIConn.cmi: mQIMap.cmi mQIProperty.cmi: mQIConn.cmi mQueryInterpreter.cmi: mQIConn.cmi -mQueryTParser.cmo: mQueryTParser.cmi -mQueryTParser.cmx: mQueryTParser.cmi -mQueryTLexer.cmo: mQueryTParser.cmi +mQueryTLexer.cmo: mQueryTParser.cmo mQueryTLexer.cmx: mQueryTParser.cmx -mQueryUtil.cmo: mQueryTLexer.cmo mQueryTParser.cmi mQueryUtil.cmi +mQueryUtil.cmo: mQueryTLexer.cmo mQueryTParser.cmo mQueryUtil.cmi mQueryUtil.cmx: mQueryTLexer.cmx mQueryTParser.cmx mQueryUtil.cmi mQIUtil.cmo: mQIUtil.cmi mQIUtil.cmx: mQIUtil.cmi diff --git a/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml b/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml index b2bfd445d..a5adbcd39 100644 --- a/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml +++ b/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml @@ -56,7 +56,7 @@ let execute h x = if C.set h C.Warn then begin C.log h "MQIExecute: waring: reference to undefined variables: "; - P.text_of_query (C.log h) q "\n" + P.text_of_query (C.log h) "\n" q end in let rec eval_val c = function @@ -131,7 +131,7 @@ let execute h x = | M.Log (_,b,x) -> if b then begin let t = P.start_time () in - P.text_of_query (C.log h) x "\n"; + P.text_of_query (C.log h) "\n" x; let s = P.stop_time t in if C.set h C.Stat then C.log h (Printf.sprintf "Log source: %s\n" s); @@ -139,7 +139,7 @@ let execute h x = end else begin let s = (eval_query c x) in let t = P.start_time () in - P.text_of_result (C.log h) s "\n"; + P.text_of_result (C.log h) "\n" s; let r = P.stop_time t in if C.set h C.Stat then C.log h (Printf.sprintf "Log: %s\n" r); diff --git a/helm/ocaml/mathql_interpreter/mQueryUtil.ml b/helm/ocaml/mathql_interpreter/mQueryUtil.ml index 4484c486b..e8344b0d6 100644 --- a/helm/ocaml/mathql_interpreter/mQueryUtil.ml +++ b/helm/ocaml/mathql_interpreter/mQueryUtil.ml @@ -37,7 +37,7 @@ let txt_str out s = out ("\"" ^ s ^ "\"") let txt_path out p = out "/"; txt_list out (txt_str out) "/" p -let text_of_query out x sep = +let text_of_query out sep x = let module M = MathQL in let txt_path_list l = txt_list out (txt_path out) ", " l in let txt_svar sv = out ("%" ^ sv) in @@ -155,7 +155,7 @@ let text_of_query out x sep = in txt_set x; out sep -let text_of_result out x sep = +let text_of_result out sep x = let txt_attr = function | (p, []) -> txt_path out p | (p, l) -> txt_path out p; out " = "; txt_list out (txt_str out) ", " l diff --git a/helm/ocaml/mathql_interpreter/mQueryUtil.mli b/helm/ocaml/mathql_interpreter/mQueryUtil.mli index 2a3c80b83..575400298 100644 --- a/helm/ocaml/mathql_interpreter/mQueryUtil.mli +++ b/helm/ocaml/mathql_interpreter/mQueryUtil.mli @@ -26,9 +26,9 @@ (* AUTOR: Ferruccio Guidi *) -val text_of_query : (string -> unit) -> MathQL.query -> string -> unit +val text_of_query : (string -> unit) -> string -> MathQL.query -> unit -val text_of_result : (string -> unit) -> MathQL.result -> string -> unit +val text_of_result : (string -> unit) -> string -> MathQL.result -> unit val query_of_text : Lexing.lexbuf -> MathQL.query diff --git a/helm/searchEngine/searchEngine.ml b/helm/searchEngine/searchEngine.ml index f7fae9481..535b5f83f 100644 --- a/helm/searchEngine/searchEngine.ml +++ b/helm/searchEngine/searchEngine.ml @@ -426,7 +426,7 @@ List.iter (fun u -> prerr_endline ("<" ^ Netencoding.Url.decode u ^ ">")) tail; let msg = Pcre.replace ~pat:"\'" ~templ:"\\\'" msg in (match selection_mode with | `SINGLE -> assert false - | `EXTENDED -> + | `MULTIPLE -> Http_daemon.send_basic_headers ~code:200 outchan ; Http_daemon.send_CRLF outchan ; iter_file -- 2.39.2