diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ocaml_backend.ml | 5 | ||||
| -rw-r--r-- | src/rewriter.ml | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ocaml_backend.ml b/src/ocaml_backend.ml index 9b8ac56a..bf5ce83c 100644 --- a/src/ocaml_backend.ml +++ b/src/ocaml_backend.ml @@ -163,6 +163,11 @@ let rec ocaml_exp ctx (E_aux (exp_aux, _) as exp) = | E_app (f, [x]) -> zencode ctx f ^^ space ^^ ocaml_atomic_exp ctx x | E_app (f, xs) when Env.is_union_constructor f (env_of exp) -> zencode_upper ctx f ^^ space ^^ parens (separate_map (comma ^^ space) (ocaml_atomic_exp ctx) xs) + (* Make sure we get the correct short circuiting semantics for and and or *) + | E_app (f, [x; y]) when string_of_id f = "and_bool" -> + separate space [ocaml_atomic_exp ctx x; string "&&"; ocaml_atomic_exp ctx y] + | E_app (f, [x; y]) when string_of_id f = "or_bool" -> + separate space [ocaml_atomic_exp ctx x; string "||"; ocaml_atomic_exp ctx y] | E_app (f, xs) -> zencode ctx f ^^ space ^^ parens (separate_map (comma ^^ space) (ocaml_atomic_exp ctx) xs) | E_vector_subrange (exp1, exp2, exp3) -> string "subrange" ^^ space ^^ parens (separate_map (comma ^^ space) (ocaml_atomic_exp ctx) [exp1; exp2; exp3]) diff --git a/src/rewriter.ml b/src/rewriter.ml index 62e4f7ef..f387e157 100644 --- a/src/rewriter.ml +++ b/src/rewriter.ml @@ -2686,7 +2686,7 @@ let rewrite_simple_types (Defs defs) = e_lit = simple_lit; e_vector = (fun exps -> E_list exps); e_cast = (fun (typ, exp) -> E_cast (simple_typ typ, exp)); - e_assert = (fun (E_aux (_, annot), str) -> E_assert (E_aux (E_lit (mk_lit L_true), annot), str)); + (* e_assert = (fun (E_aux (_, annot), str) -> E_assert (E_aux (E_lit (mk_lit L_true), annot), str)); *) lEXP_cast = (fun (typ, lexp) -> LEXP_cast (simple_typ typ, lexp)); pat_alg = simple_pat } in |
