Skip to content

Commit c2874b2

Browse files
committed
more
1 parent f4833c5 commit c2874b2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

compiler/lib/generate.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,12 @@ let rec translate_expr ctx queue loc x e level : _ * J.statement_list =
12821282
let (pa, ca), queue = access_queue' ~ctx queue a in
12831283
let (pb, cb), queue = access_queue' ~ctx queue b in
12841284
let prop = or_p pa pb in
1285-
J.EBin (J.Plus, ca, cb), prop, queue
1285+
let rec add ca cb =
1286+
match cb with
1287+
| J.EBin (J.Plus, cb1, cb2) -> J.EBin (J.Plus, add ca cb1, cb2)
1288+
| _ -> J.EBin (J.Plus, ca, cb)
1289+
in
1290+
add ca cb, prop, queue
12861291
| Extern name, l -> (
12871292
let name = Primitive.resolve name in
12881293
match internal_prim name with

compiler/tests-compiler/test_string.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ let (_ : string) = here ()
5656
cst_a = "a",
5757
cst_b = "b",
5858
caml_string_concat = runtime.caml_string_concat;
59-
function _a_(_b_){return cst_a + (cst_a + (cst_b + cst_b));}
59+
function _a_(_b_){return cst_a + cst_a + cst_b + cst_b;}
6060
_a_(0);
6161
var Test = [0, caml_string_concat, _a_];
6262
runtime.caml_register_global(2, Test, "Test");

compiler/tests-full/stdlib.cma.expected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@
813813
/*<<stdlib.ml:545:2>>*/ return [0,
814814
/*<<stdlib.ml:545:10>>*/ caml_call2
815815
(CamlinternalFormatBasics[3], fmt1, fmt2),
816-
str1 + ("%," + str2)];
816+
str1 + "%," + str2];
817817
}
818818
/*<<stdlib.ml:559:20>>*/ /*<<stdlib.ml:559:20>>*/ var
819819
exit_function = [0, flush_all];

0 commit comments

Comments
 (0)