aboutsummaryrefslogtreecommitdiff
path: root/plugins/extraction/ocaml.ml
diff options
context:
space:
mode:
authorletouzey2011-02-25 16:43:56 +0000
committerletouzey2011-02-25 16:43:56 +0000
commita13eac935515be8be32b8080aab858c46a6b202a (patch)
treec4456f495e104aaef9edec6fac939ad0b55b3d12 /plugins/extraction/ocaml.ml
parent5a085cb64261a533d3131cdeae2b10cc2d8f1d14 (diff)
Extraction: Add missing parenthesis around emulated pattern-match (fix #2478)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13861 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/extraction/ocaml.ml')
-rw-r--r--plugins/extraction/ocaml.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml
index b60eee381b..e4a145586c 100644
--- a/plugins/extraction/ocaml.ml
+++ b/plugins/extraction/ocaml.ml
@@ -245,9 +245,12 @@ let rec pp_expr par env args =
if ids <> [] then named_lams (List.rev ids) e
else dummy_lams (ast_lift 1 e) 1
in
- hov 2 (str (find_custom_match pv) ++ fnl () ++
+ apply
+ (pp_par par'
+ (hov 2
+ (str (find_custom_match pv) ++ fnl () ++
prvect (fun tr -> pp_expr true env [] (mkfun tr) ++ fnl ()) pv
- ++ pp_expr true env [] t)
+ ++ pp_expr true env [] t)))
| MLcase (info, t, pv) ->
let expr = if info.m_kind = Coinductive then
(str "Lazy.force" ++ spc () ++ pp_expr true env [] t)