From f148b4ddc2333650e49436ff6693d1ad1847f8fb Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Thu, 19 Feb 2004 15:18:52 +0000 Subject: [PATCH] source logging is now native in the interpreter --- helm/ocaml/mathql_generator/mQueryGenerator.ml | 6 +++--- helm/ocaml/mathql_interpreter/mQIConn.ml | 4 +++- helm/ocaml/mathql_interpreter/mQIConn.mli | 2 +- helm/ocaml/mathql_interpreter/mQueryInterpreter.ml | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/helm/ocaml/mathql_generator/mQueryGenerator.ml b/helm/ocaml/mathql_generator/mQueryGenerator.ml index 4ae3f1388..7e0dd9c96 100644 --- a/helm/ocaml/mathql_generator/mQueryGenerator.ml +++ b/helm/ocaml/mathql_generator/mQueryGenerator.ml @@ -35,7 +35,7 @@ module U = MQGUtil let locate s = let query = M.Property (true,M.RefineExact,["objectName"],[],[],[],[],false,(M.Const s) ) - in M.Log (false, true, M.StatQuery query) + in M.StatQuery query let unreferred target_pattern source_pattern = let query = @@ -46,7 +46,7 @@ let unreferred target_pattern source_pattern = M.Property(false,M.RefineExact,["refObj"],["h:occurrence"],[],[],[],true,(M.Const source_pattern)) )) - in M.Log (false, true, M.StatQuery query) + in M.StatQuery query let compose cl = let letin = ref [] in @@ -137,7 +137,7 @@ let compose cl = let f (vvar, msval) x = M.LetVVar(vvar,msval,x) in iter f (fun x y z -> x (y z)) ! letin in - M.Log (false, true, M.StatQuery (letin_query (select_query must_query))) + M.StatQuery (letin_query (select_query must_query)) (* high-level functions ****************************************************) diff --git a/helm/ocaml/mathql_interpreter/mQIConn.ml b/helm/ocaml/mathql_interpreter/mQIConn.ml index 2b1847008..9c9cfa995 100644 --- a/helm/ocaml/mathql_interpreter/mQIConn.ml +++ b/helm/ocaml/mathql_interpreter/mQIConn.ml @@ -26,7 +26,7 @@ (* AUTOR: Ferruccio Guidi *) -type flag = Postgres | Galax | Stat | Quiet | Warn | Log +type flag = Postgres | Galax | Stat | Quiet | Warn | Log | Source type handle = { log : string -> unit; (* logging function *) @@ -57,6 +57,7 @@ let string_of_flag = function | Quiet -> "Q" | Warn -> "W" | Log -> "L" + | Source -> "V" let flag_of_char = function | 'P' -> [Postgres] @@ -65,6 +66,7 @@ let flag_of_char = function | 'Q' -> [Quiet] | 'W' -> [Warn] | 'L' -> [Log] + | 'V' -> [Source] | _ -> [] let string_fold_left f a s = diff --git a/helm/ocaml/mathql_interpreter/mQIConn.mli b/helm/ocaml/mathql_interpreter/mQIConn.mli index 889b373d8..cb1ae4ddc 100644 --- a/helm/ocaml/mathql_interpreter/mQIConn.mli +++ b/helm/ocaml/mathql_interpreter/mQIConn.mli @@ -26,7 +26,7 @@ (* AUTOR: Ferruccio Guidi *) -type flag = Postgres | Galax | Stat | Quiet | Warn | Log +type flag = Postgres | Galax | Stat | Quiet | Warn | Log | Source val string_of_flags : flag list -> string val flags_of_string : string -> flag list diff --git a/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml b/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml index a5adbcd39..d7ff053bd 100644 --- a/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml +++ b/helm/ocaml/mathql_interpreter/mQueryInterpreter.ml @@ -233,6 +233,7 @@ let execute h x = try snd (List.assoc i c.avars) with Not_found -> warn (M.AVar i); [] in + let x = if C.set h C.Source then M.Log (false, true, x) else x in let c = {svars = []; avars = []; groups = []; vvars = []} in let t = P.start_time () in let r = eval_query c x in -- 2.39.2