X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fmathql_interpreter%2FmQueryIO.ml;h=e99dc0d72b5c9b5270e3c376b6bdfcc34905e5eb;hb=f83c30c8f80325e1bbf219c50cd2859aa53ee204;hp=14199e513136d396f88380fe130346200d430395;hpb=381006cf8b418cfdeaf145ab7df9e8f2b19ae2e6;p=helm.git diff --git a/helm/ocaml/mathql_interpreter/mQueryIO.ml b/helm/ocaml/mathql_interpreter/mQueryIO.ml index 14199e513..e99dc0d72 100644 --- a/helm/ocaml/mathql_interpreter/mQueryIO.ml +++ b/helm/ocaml/mathql_interpreter/mQueryIO.ml @@ -55,18 +55,20 @@ let txt_path out p = out "/"; P.flat_list out (txt_str out) "/" p let text_of_result out sep x = let txt_attr _ p l b = txt_path out p; - if l <> [] then begin - out " = "; P.flat_list out (txt_str out) ", " l + begin match l with + | [] -> () + | [s] -> out " = "; txt_str out s + | l -> out " = {"; P.flat_list out (txt_str out) ", " l; out "}" end; - if b then out ("; " ^ sep) + if b then out ("; ") in let txt_group l = out "{"; I.x_grp_iter txt_attr () l; out "}" in let txt_res _ s l b = txt_str out s; if l <> [] then begin - out " = "; P.flat_list out txt_group ", " l + out " attr "; P.flat_list out txt_group ", " l end; - if b then out "; " + if b then out ("; " ^ sep) in I.x_iter txt_res () x; out sep @@ -124,7 +126,7 @@ and text_of_query out sep x = | M.From av -> txt_avar av and txt_set = function | M.Fun (p, pl, xl) -> - let o = {L.out = out; L.path = txt_path; + let o = {L.out = out; L.sep = ""; L.path = txt_path; L.query = text_of_query; L.result = text_of_result } in @@ -158,7 +160,7 @@ and text_of_query out sep x = txt_set x; out sep let text_out_spec out sep = - {L.out = out; L.path = txt_path; + {L.out = out; L.sep = sep; L.path = txt_path; L.query = text_of_query; L.result = text_of_result }