Skip to content
Browse files

[enhance] OpaPrint: better if else block printing

  • Loading branch information...
1 parent 2d19cdd commit 48a91aa810056cb7a8001ec1b472e939a8ace4c3 @cedricss cedricss committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 opalang/opaPrint.ml
View
4 opalang/opaPrint.ml
@@ -1278,11 +1278,11 @@ module Js = struct
(if self#expr_need_block e2 then
pp f "@[<2>if (%a) {@\n%a@]@\n@[<2>} " (* TODO ?? *)
else
- pp f "if (%a) %a @[<2>") self#expr e1 self#expr e2;
+ pp f "@[<2>if (%a)@ %a@]@ @[<2>") self#expr e1 self#expr e2;
(if self#expr_need_block e3 then
pp f "else {@\n%a@]@\n}" (* TODO ?? *)
else
- pp f "else %a@]") self#expr e3;
+ pp f "else@ %a@]") self#expr e3;
| `xhtml e -> Sugar.Xhtml.pp_xml self#expr_sugar f e
| `action e -> Sugar.Action.pp self#to_unprotected_ident self#expr_sugar f e

0 comments on commit 48a91aa

Please sign in to comment.
Something went wrong with that request. Please try again.