summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorJonathan Protzenko2023-02-08 20:21:42 -0800
committerSon HO2023-06-04 21:44:33 +0200
commit1ba26f5c815509911965b6f90f75e8f8cc3c0417 (patch)
tree8d038cd7d1b071cd7484b743cd96e7b0be519755 /compiler
parentc5fe6cc2cada878ea3e70262e0c9b9f607db7974 (diff)
WIP
Diffstat (limited to 'compiler')
-rw-r--r--compiler/Extract.ml9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/Extract.ml b/compiler/Extract.ml
index a2ad37f5..c90d2170 100644
--- a/compiler/Extract.ml
+++ b/compiler/Extract.ml
@@ -1809,7 +1809,8 @@ and extract_lets (ctx : extraction_ctx) (fmt : F.formatter) (inside : bool)
match !backend with
| FStar -> "="
| Coq -> ":="
- | Lean -> if monadic then "<-" else ":="
+ (* TODO: switch to ⟵ once issues are fixed *)
+ | Lean -> if monadic then "←" else ":="
in
F.pp_print_string fmt eq;
F.pp_print_space fmt ();
@@ -1867,6 +1868,8 @@ and extract_Switch (ctx : extraction_ctx) (fmt : F.formatter) (inside : bool)
(* Open a box for the [if e] *)
F.pp_open_hovbox fmt ctx.indent_incr;
F.pp_print_string fmt "if";
+ if !backend = Lean then
+ F.pp_print_string fmt " h:";
F.pp_print_space fmt ();
let scrut_inside = PureUtils.texpression_requires_parentheses scrut in
extract_texpression ctx fmt scrut_inside scrut;
@@ -1924,7 +1927,7 @@ and extract_Switch (ctx : extraction_ctx) (fmt : F.formatter) (inside : bool)
F.pp_open_hovbox fmt ctx.indent_incr;
(* Print the [match ... with] *)
let match_begin =
- match !backend with FStar -> "begin match" | Coq | Lean -> "match"
+ match !backend with FStar -> "begin match" | Coq -> "match" | Lean -> "match h:"
in
F.pp_print_string fmt match_begin;
F.pp_print_space fmt ();
@@ -2647,7 +2650,7 @@ let extract_unit_test_if_unit_fun (ctx : extraction_ctx) (fmt : F.formatter)
F.pp_print_space fmt ();
F.pp_print_string fmt "()");
F.pp_print_space fmt ();
- F.pp_print_string fmt "=";
+ F.pp_print_string fmt "==";
F.pp_print_space fmt ();
let success = ctx_get_variant (Assumed Result) result_return_id ctx in
F.pp_print_string fmt ("." ^ success ^ " ())"));