From 9ab880c6bae5a0c0c234e8561eac6480938fbf26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Waneck?= Date: Sat, 8 Oct 2016 16:45:05 -0300 Subject: [PATCH] [java/cs] Make sure the main expression is always a block --- src/generators/gencs.ml | 4 ++-- src/generators/genjava.ml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generators/gencs.ml b/src/generators/gencs.ml index c9d64799872..638e8e0685a 100644 --- a/src/generators/gencs.ml +++ b/src/generators/gencs.ml @@ -2416,7 +2416,7 @@ let configure gen = expr_s w { eexpr = TTypeExpr(TClassDecl cl); etype = t_dynamic; epos = null_pos }; write w ".main();" | Some expr -> - expr_s w expr); + expr_s w (mk_block expr)); end_block w; end_block w; newline w; @@ -2460,7 +2460,7 @@ let configure gen = | None -> write w "main();"; | Some expr -> - expr_s w expr); + expr_s w (mk_block expr)); end_block w end; diff --git a/src/generators/genjava.ml b/src/generators/genjava.ml index 13990bcdd03..4fcccbe2db3 100644 --- a/src/generators/genjava.ml +++ b/src/generators/genjava.ml @@ -1955,7 +1955,7 @@ let configure gen = ); (match gen.gcon.main with | Some(expr) -> - expr_s w expr + expr_s w (mk_block expr) | None -> write w "main();"); end_block w;