summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Kerneis2013-12-17 17:58:11 +0000
committerGabriel Kerneis2013-12-17 18:00:28 +0000
commitb3a18009fd8b90eccc1033c24c4617948a6c2b2d (patch)
treef12851ff68a7f99645d607eb1ef30ce1b59e85b1 /src
parenteb5fa9cae19d52d5f3219c20f6ddb1a94b655ea5 (diff)
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).
Diffstat (limited to 'src')
-rw-r--r--src/pretty_print.ml2
1 files changed, 1 insertions, 1 deletions
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