From b3a18009fd8b90eccc1033c24c4617948a6c2b2d Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Tue, 17 Dec 2013 17:58:11 +0000 Subject: pretty-printer: fix union constructor application Foo (1,2,3) is stored internally as the function Foo applied to [1; 2; 3]. We need to add commas when pretty-printing. This should not affect pretty-printing of regular functions application, since those always take a single parameter anyway (which may be a tuple). --- src/pretty_print.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/pretty_print.ml b/src/pretty_print.ml index 2ea4a2a8..8a8b07cf 100644 --- a/src/pretty_print.ml +++ b/src/pretty_print.ml @@ -216,7 +216,7 @@ and pp_exp ppf (E_aux(e,_)) = | E_id(id) -> pp_id ppf id | E_lit(lit) -> pp_lit ppf lit | E_cast(typ,exp) -> fprintf ppf "@[<0>%a%a%a %a@]" kwd "(" pp_typ typ kwd ")" pp_exp exp - | E_app(f,args) -> fprintf ppf "@[<0>%a(%a)@]" pp_id f (list_pp pp_exp pp_exp) args + | E_app(f,args) -> fprintf ppf "@[<0>%a(%a)@]" pp_id f (list_pp pp_comma_exp pp_exp) args | E_app_infix(l,op,r) -> fprintf ppf "@[<0>%a %a %a@]" pp_exp l pp_id op pp_exp r | E_tuple(exps) -> fprintf ppf "@[<0>%a %a %a@]" kwd "(" (list_pp pp_comma_exp pp_exp) exps kwd ")" | E_if(c,t,e) -> fprintf ppf "@[<0> %a %a @[<1> %a %a@] @[<1> %a@ %a@]@]" kwd "if " pp_exp c kwd "then" pp_exp t kwd "else" pp_exp e -- cgit v1.2.3