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
| 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
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
}