summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Norton2017-04-11 14:32:45 +0100
committerShaked Flur2017-04-18 13:58:33 +0100
commit5914b680eb98f4d920556f66f805adb839fe644f (patch)
treea9adc4123429c5cac448e96fbe86373391cb6cb4
parent1e536a4240a3ad1831786eafca245583d7609058 (diff)
make ocaml embedding of foreach use (now universal) big_ints.
-rw-r--r--src/pretty_print_ocaml.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pretty_print_ocaml.ml b/src/pretty_print_ocaml.ml
index 2d9b6f37..3f83c8b0 100644
--- a/src/pretty_print_ocaml.ml
+++ b/src/pretty_print_ocaml.ml
@@ -213,7 +213,7 @@ let doc_exp_ocaml, doc_let_ocaml =
string "else" ^^ space ^^ group (exp e))
| E_for(id,exp1,exp2,exp3,(Ord_aux(order,_)),exp4) ->
let var= doc_id_ocaml id in
- let (compare,next) = if order = Ord_inc then string "<=",string "+" else string ">=",string "-" in
+ let (compare,next) = if order = Ord_inc then string "le_big_int",string "add_big_int" else string "ge_big_int",string "sub_big_int" in
let by = exp exp3 in
let stop = exp exp2 in
(*takes over two names but doesn't require building a closure*)
@@ -224,10 +224,10 @@ let doc_exp_ocaml, doc_let_ocaml =
var;
equals;
string "if";
- parens (doc_op compare var (string "__stop") );
+ parens (compare ^^ space ^^ var ^^ space ^^ (string "__stop") );
string "then";
parens (exp exp4 ^^ space ^^ semi ^^ (string "foreach") ^^
- parens (doc_op next var (string "__by")));
+ parens (next ^^ space ^^ var ^^ space ^^ (string "__by")));
string "in";
string "foreach";
exp exp1])