diff --git a/jscomp/js_config.ml b/jscomp/js_config.ml index b6ca366228..7dc32ab7f4 100644 --- a/jscomp/js_config.ml +++ b/jscomp/js_config.ml @@ -145,8 +145,11 @@ let weak = "Caml_weak" let backtrace = "Caml_backtrace" let gc = "Caml_gc" let int32 = "Caml_int32" +let block = "Block" + let runtime_set = [ + block; int32; gc ; backtrace; diff --git a/jscomp/js_config.mli b/jscomp/js_config.mli index f6a1bf1768..7cb203c503 100644 --- a/jscomp/js_config.mli +++ b/jscomp/js_config.mli @@ -34,6 +34,7 @@ val default_gen_tds : bool ref val runtime_set : String_set.t val stdlib_set : String_set.t +val block : string val int32 : string val gc : string val backtrace : string diff --git a/jscomp/js_dump.ml b/jscomp/js_dump.ml index 0a1dca0c7d..3e8b901321 100644 --- a/jscomp/js_dump.ml +++ b/jscomp/js_dump.ml @@ -110,6 +110,8 @@ module L = struct let ge = ">=" let plus_plus = "++" (* FIXME: use (i = i + 1 | 0) instead *) let minus_minus = "--" + let caml_block = "Block" + let caml_block_create = "__" end let return_indent = (String.length L.return / Ext_pp.indent_length) @@ -892,11 +894,8 @@ and | Number (Int { i = 0l ; _}) , (Blk_tuple | Blk_array | Blk_variant _ | Blk_record _ | Blk_na | Blk_module _ - | Blk_constructor (_, 1) + | Blk_constructor (_, 1) (* Sync up with {!Js_dump}*) ) - (* Hack to optimize option which is really pervasive in ocaml, - we need concrete benchmark to support this - *) -> expression_desc cxt l f (Array (el, mutable_flag)) (* TODO: for numbers like 248, 255 we can reverse engineer to make it [Obj.xx_flag], but we can not do this in runtime libraries @@ -904,16 +903,10 @@ and | _, _ -> - expression_desc cxt l f - (J.Object ( - let length, rev_list = - List.fold_left (fun (i,acc) v -> - (i+1, (Js_op.Int_key i, v) :: acc) - ) (0, []) el in - List.rev_append rev_list - [(Js_op.Length, E.small_int length) ; (Js_op.Tag, tag)] - ) - ) + P.string f L.caml_block; + P.string f L.dot ; + P.string f L.caml_block_create; + P.paren_group f 1 (fun _ -> arguments cxt f [tag; E.arr mutable_flag el]) end | Caml_block_tag e -> P.group f 1 (fun _ -> diff --git a/jscomp/js_fold_basic.ml b/jscomp/js_fold_basic.ml index b82fdcc78e..061c5a570f 100644 --- a/jscomp/js_fold_basic.ml +++ b/jscomp/js_fold_basic.ml @@ -58,11 +58,24 @@ class count_hard_dependencies = match x with | {expression_desc = Call (_,_, {arity = NA}); _} (* see [Js_exp_make.runtime_var_dot] *) - -> begin + -> + Hash_set.add hard_dependencies + (Lam_module_ident.of_runtime (Ext_ident.create_js Js_config.curry)); + super#expression x + | {expression_desc = Caml_block(_,_, tag, tag_info); _} + -> + begin match tag.expression_desc, tag_info with + | Number (Int { i = 0l ; _}) , + (Blk_tuple | Blk_array | Blk_variant _ | Blk_record _ | Blk_na | Blk_module _ + | Blk_constructor (_, 1) + ) (*Sync up with {!Js_dump}*) + -> () + | _, _ + -> Hash_set.add hard_dependencies - (Lam_module_ident.of_runtime (Ext_ident.create_js Js_config.curry)); - super#expression x - end + (Lam_module_ident.of_runtime (Ext_ident.create_js Js_config.block)); + end; + super#expression x | _ -> super#expression x method get_hard_dependencies = hard_dependencies end diff --git a/jscomp/runtime/.depend b/jscomp/runtime/.depend index 41e67c5d0b..c6533700b2 100644 --- a/jscomp/runtime/.depend +++ b/jscomp/runtime/.depend @@ -1,7 +1,7 @@ +block.cmi : caml_array.cmi : caml_backtrace.cmi : caml_bigarray.cmi : -caml_block.cmi : caml_builtin_exceptions.cmi : caml_exceptions.cmi : caml_builtin_exceptions.cmi caml_float.cmi : @@ -21,14 +21,14 @@ caml_string.cmi : caml_sys.cmi : caml_utils.cmi : caml_weak.cmi : +block.cmo : block.cmi +block.cmx : block.cmi caml_array.cmo : js.cmo caml_array.cmi caml_array.cmx : js.cmx caml_array.cmi caml_backtrace.cmo : caml_backtrace.cmi caml_backtrace.cmx : caml_backtrace.cmi caml_bigarray.cmo : caml_bigarray.cmi caml_bigarray.cmx : caml_bigarray.cmi -caml_block.cmo : caml_block.cmi -caml_block.cmx : caml_block.cmi caml_builtin_exceptions.cmo : caml_builtin_exceptions.cmi caml_builtin_exceptions.cmx : caml_builtin_exceptions.cmi caml_exceptions.cmo : caml_builtin_exceptions.cmi caml_exceptions.cmi @@ -79,14 +79,14 @@ js_error.cmo : js_error.cmx : typed_array.cmo : typed_array.cmx : +block.cmo : block.cmi +block.cmj : block.cmi caml_array.cmo : js.cmo caml_array.cmi caml_array.cmj : js.cmj caml_array.cmi caml_backtrace.cmo : caml_backtrace.cmi caml_backtrace.cmj : caml_backtrace.cmi caml_bigarray.cmo : caml_bigarray.cmi caml_bigarray.cmj : caml_bigarray.cmi -caml_block.cmo : caml_block.cmi -caml_block.cmj : caml_block.cmi caml_builtin_exceptions.cmo : caml_builtin_exceptions.cmi caml_builtin_exceptions.cmj : caml_builtin_exceptions.cmi caml_exceptions.cmo : caml_builtin_exceptions.cmi caml_exceptions.cmi diff --git a/jscomp/runtime/block.js b/jscomp/runtime/block.js new file mode 100644 index 0000000000..e49c42aed1 --- /dev/null +++ b/jscomp/runtime/block.js @@ -0,0 +1,11 @@ +// Generated CODE, PLEASE EDIT WITH CARE +'use strict'; + + +function __(tag, block) { + block.tag = tag; + return block; +} + +exports.__ = __; +/* No side effect */ diff --git a/jscomp/runtime/caml_block.ml b/jscomp/runtime/block.ml similarity index 97% rename from jscomp/runtime/caml_block.ml rename to jscomp/runtime/block.ml index 8d25e6b2af..1c8e426d38 100644 --- a/jscomp/runtime/caml_block.ml +++ b/jscomp/runtime/block.ml @@ -20,5 +20,5 @@ (* Note that when we introduce it in {!Js_dump} we need introduce dependency properly *) -let create tag block = +let __ tag block = Obj.set_tag block tag; block diff --git a/jscomp/runtime/caml_block.mli b/jscomp/runtime/block.mli similarity index 96% rename from jscomp/runtime/caml_block.mli rename to jscomp/runtime/block.mli index 96f33b42d5..ebba7f859e 100644 --- a/jscomp/runtime/caml_block.mli +++ b/jscomp/runtime/block.mli @@ -18,4 +18,5 @@ (* Author: Hongbo Zhang *) -val create : int -> Obj.t -> Obj.t + +val __ : int -> Obj.t -> Obj.t diff --git a/jscomp/runtime/caml_obj.js b/jscomp/runtime/caml_obj.js index 7ea75e3bd7..57b8f66020 100644 --- a/jscomp/runtime/caml_obj.js +++ b/jscomp/runtime/caml_obj.js @@ -2,6 +2,7 @@ 'use strict'; var Caml_builtin_exceptions = require("./caml_builtin_exceptions"); +var Block = require("./block"); function caml_obj_dup(x) { var len = x.length; @@ -36,11 +37,7 @@ function caml_obj_truncate(x, new_size) { } function caml_lazy_make_forward(x) { - return { - 0: x, - length: 1, - tag: 250 - }; + return Block.__(250, [x]); } function caml_update_dummy(x, y) { diff --git a/jscomp/runtime/runtime.mllib b/jscomp/runtime/runtime.mllib index 2c0b15ee62..34df8e4865 100644 --- a/jscomp/runtime/runtime.mllib +++ b/jscomp/runtime/runtime.mllib @@ -10,7 +10,7 @@ caml_utils caml_sys caml_io caml_float -caml_block + caml_lexer caml_parser caml_primitive @@ -29,3 +29,4 @@ fn js_error caml_curry curry +block diff --git a/jscomp/stdlib/arg.js b/jscomp/stdlib/arg.js index 200930e1a4..6cee5b9d8d 100644 --- a/jscomp/stdlib/arg.js +++ b/jscomp/stdlib/arg.js @@ -7,6 +7,7 @@ var Bytes = require("./bytes"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Pervasives = require("./pervasives"); var Caml_format = require("../runtime/caml_format"); +var Block = require("../runtime/block"); var Sys = require("./sys"); var Curry = require("../runtime/curry"); var Printf = require("./printf"); @@ -55,11 +56,7 @@ function make_symlist(prefix, sep, suffix, l) { function help_action() { throw [ Stop, - /* Unknown */{ - 0: "-help", - length: 1, - tag: 0 - } + /* Unknown */Block.__(0, ["-help"]) ]; } @@ -74,11 +71,7 @@ function add_help(speclist) { add1 = /* :: */[ /* tuple */[ "-help", - /* Unit */{ - 0: help_action, - length: 1, - tag: 0 - }, + /* Unit */Block.__(0, [help_action]), " Display this list of options" ], /* [] */0 @@ -98,11 +91,7 @@ function add_help(speclist) { add2 = /* :: */[ /* tuple */[ "--help", - /* Unit */{ - 0: help_action, - length: 1, - tag: 0 - }, + /* Unit */Block.__(0, [help_action]), " Display this list of options" ], /* [] */0 @@ -117,17 +106,13 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { Curry._1(Printf.bprintf(buf, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%s\n" ]), errmsg); return List.iter(function (param) { @@ -139,68 +124,46 @@ function usage_b(buf, speclist, errmsg) { if (doc.length) { if (spec.tag === 11) { return Curry._3(Printf.bprintf(buf$1, /* Format */[ - /* String_literal */{ - 0: " ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]), " %s %s%s\n" ]), key, make_symlist("{", "|", "}", spec[0]), doc); } else { return Curry._2(Printf.bprintf(buf$1, /* Format */[ - /* String_literal */{ - 0: " ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), " %s %s\n" ]), key, doc); } @@ -219,12 +182,10 @@ function usage_string(speclist, errmsg) { function usage(speclist, errmsg) { return Curry._1(Printf.eprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), usage_string(speclist, errmsg)); } @@ -247,141 +208,93 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { break; default: Curry._2(Printf.bprintf(b, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": unknown option '", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "'.\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": unknown option '", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "'.\n", + /* End_of_format */0 + ]) + ]) + ]) + ]), "%s: unknown option '%s'.\n" ]), progname, s); } break; case 1 : Curry._4(Printf.bprintf(b, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": wrong argument '", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "'; option '", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "' expects ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ".\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": wrong argument '", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "'; option '", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "' expects ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ".\n", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), "%s: wrong argument '%s'; option '%s' expects %s.\n" ]), progname, error[1], error[0], error[2]); break; case 2 : Curry._2(Printf.bprintf(b, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": option '", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "' needs an argument.\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": option '", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "' needs an argument.\n", + /* End_of_format */0 + ]) + ]) + ]) + ]), "%s: option '%s' needs an argument.\n" ]), progname, error[0]); break; case 3 : Curry._2(Printf.bprintf(b, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ".\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ".\n", + /* End_of_format */0 + ]) + ]) + ]) + ]), "%s: %s.\n" ]), progname, error[0]); break; } usage_b(b, speclist[0], errmsg); - if (Caml_obj.caml_equal(error, /* Unknown */{ - 0: "-help", - length: 1, - tag: 0 - }) || Caml_obj.caml_equal(error, /* Unknown */{ - 0: "--help", - length: 1, - tag: 0 - })) { + if (Caml_obj.caml_equal(error, /* Unknown */Block.__(0, ["-help"])) || Caml_obj.caml_equal(error, /* Unknown */Block.__(0, ["--help"]))) { throw [ Help, Buffer.contents(b) @@ -404,11 +317,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { } catch (exn){ if (exn === Caml_builtin_exceptions.not_found) { - action = stop(/* Unknown */{ - 0: s, - length: 1, - tag: 0 - }); + action = stop(/* Unknown */Block.__(0, [s])); } else { throw exn; @@ -431,13 +340,11 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { if (exn[1] === "bool_of_string") { throw [ Stop, - /* Wrong */{ - 0: s, - 1: arg, - 2: "a boolean", - length: 3, - tag: 1 - } + /* Wrong */Block.__(1, [ + s, + arg, + "a boolean" + ]) ]; } else { @@ -453,11 +360,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -475,11 +378,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -491,11 +390,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -510,13 +405,11 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { if (exn$1[1] === "int_of_string") { throw [ Stop, - /* Wrong */{ - 0: s, - 1: arg$1, - 2: "an integer", - length: 3, - tag: 1 - } + /* Wrong */Block.__(1, [ + s, + arg$1, + "an integer" + ]) ]; } else { @@ -532,11 +425,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -551,13 +440,11 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { if (exn$2[1] === "int_of_string") { throw [ Stop, - /* Wrong */{ - 0: s, - 1: arg$2, - 2: "an integer", - length: 3, - tag: 1 - } + /* Wrong */Block.__(1, [ + s, + arg$2, + "an integer" + ]) ]; } else { @@ -573,11 +460,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -592,13 +475,11 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { if (exn$3[1] === "float_of_string") { throw [ Stop, - /* Wrong */{ - 0: s, - 1: arg$3, - 2: "a float", - length: 3, - tag: 1 - } + /* Wrong */Block.__(1, [ + s, + arg$3, + "a float" + ]) ]; } else { @@ -614,11 +495,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -633,13 +510,11 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { if (exn$4[1] === "float_of_string") { throw [ Stop, - /* Wrong */{ - 0: s, - 1: arg$4, - 2: "a float", - length: 3, - tag: 1 - } + /* Wrong */Block.__(1, [ + s, + arg$4, + "a float" + ]) ]; } else { @@ -655,11 +530,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -676,24 +547,18 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { else { throw [ Stop, - /* Wrong */{ - 0: s, - 1: arg$5, - 2: "one of: " + make_symlist("", " ", "", symb), - length: 3, - tag: 1 - } + /* Wrong */Block.__(1, [ + s, + arg$5, + "one of: " + make_symlist("", " ", "", symb) + ]) ]; } } else { throw [ Stop, - /* Missing */{ - 0: s, - length: 1, - tag: 2 - } + /* Missing */Block.__(2, [s]) ]; } break; @@ -712,11 +577,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { } catch (exn$1){ if (exn$1[0] === Bad) { - stop(/* Message */{ - 0: exn$1[1], - length: 1, - tag: 3 - }); + stop(/* Message */Block.__(3, [exn$1[1]])); } else if (exn$1[0] === Stop) { stop(exn$1[1]); @@ -733,11 +594,7 @@ function parse_argv_dynamic($staropt$star, argv, speclist, anonfun, errmsg) { } catch (exn$2){ if (exn$2[0] === Bad) { - stop(/* Message */{ - 0: exn$2[1], - length: 1, - tag: 3 - }); + stop(/* Message */Block.__(3, [exn$2[1]])); } else { throw exn$2; @@ -761,24 +618,20 @@ function parse(l, f, msg) { catch (exn){ if (exn[0] === Bad) { Curry._1(Printf.eprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), exn[1]); return Pervasives.exit(2); } else if (exn[0] === Help) { Curry._1(Printf.printf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), exn[1]); return Pervasives.exit(0); @@ -796,24 +649,20 @@ function parse_dynamic(l, f, msg) { catch (exn){ if (exn[0] === Bad) { Curry._1(Printf.eprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), exn[1]); return Pervasives.exit(2); } else if (exn[0] === Help) { Curry._1(Printf.printf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), exn[1]); return Pervasives.exit(0); diff --git a/jscomp/stdlib/camlinternalFormat.js b/jscomp/stdlib/camlinternalFormat.js index 561be3d713..0a943f2535 100644 --- a/jscomp/stdlib/camlinternalFormat.js +++ b/jscomp/stdlib/camlinternalFormat.js @@ -10,6 +10,7 @@ var Pervasives = require("./pervasives"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Caml_format = require("../runtime/caml_format"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Char = require("./char"); var Sys = require("./sys"); var Curry = require("../runtime/curry"); @@ -47,12 +48,10 @@ function is_in_char_set(char_set, c) { function pad_of_pad_opt(pad_opt) { if (pad_opt) { - return /* Lit_padding */{ - 0: /* Right */1, - 1: pad_opt[0], - length: 2, - tag: 0 - }; + return /* Lit_padding */Block.__(0, [ + /* Right */1, + pad_opt[0] + ]); } else { return /* No_padding */0; @@ -72,130 +71,88 @@ function param_format_of_ignored_format(ign, fmt) { if (typeof ign === "number") { switch (ign) { case 0 : - return /* Param_format_EBB */[/* Char */{ - 0: fmt, - length: 1, - tag: 0 - }]; + return /* Param_format_EBB */[/* Char */Block.__(0, [fmt])]; case 1 : - return /* Param_format_EBB */[/* Caml_char */{ - 0: fmt, - length: 1, - tag: 1 - }]; + return /* Param_format_EBB */[/* Caml_char */Block.__(1, [fmt])]; case 2 : - return /* Param_format_EBB */[/* Bool */{ - 0: fmt, - length: 1, - tag: 9 - }]; + return /* Param_format_EBB */[/* Bool */Block.__(9, [fmt])]; case 3 : - return /* Param_format_EBB */[/* Reader */{ - 0: fmt, - length: 1, - tag: 19 - }]; + return /* Param_format_EBB */[/* Reader */Block.__(19, [fmt])]; case 4 : - return /* Param_format_EBB */[/* Scan_next_char */{ - 0: fmt, - length: 1, - tag: 22 - }]; + return /* Param_format_EBB */[/* Scan_next_char */Block.__(22, [fmt])]; } } else { switch (ign.tag | 0) { case 0 : - return /* Param_format_EBB */[/* String */{ - 0: pad_of_pad_opt(ign[0]), - 1: fmt, - length: 2, - tag: 2 - }]; + return /* Param_format_EBB */[/* String */Block.__(2, [ + pad_of_pad_opt(ign[0]), + fmt + ])]; case 1 : - return /* Param_format_EBB */[/* Caml_string */{ - 0: pad_of_pad_opt(ign[0]), - 1: fmt, - length: 2, - tag: 3 - }]; + return /* Param_format_EBB */[/* Caml_string */Block.__(3, [ + pad_of_pad_opt(ign[0]), + fmt + ])]; case 2 : - return /* Param_format_EBB */[/* Int */{ - 0: ign[0], - 1: pad_of_pad_opt(ign[1]), - 2: /* No_precision */0, - 3: fmt, - length: 4, - tag: 4 - }]; + return /* Param_format_EBB */[/* Int */Block.__(4, [ + ign[0], + pad_of_pad_opt(ign[1]), + /* No_precision */0, + fmt + ])]; case 3 : - return /* Param_format_EBB */[/* Int32 */{ - 0: ign[0], - 1: pad_of_pad_opt(ign[1]), - 2: /* No_precision */0, - 3: fmt, - length: 4, - tag: 5 - }]; + return /* Param_format_EBB */[/* Int32 */Block.__(5, [ + ign[0], + pad_of_pad_opt(ign[1]), + /* No_precision */0, + fmt + ])]; case 4 : - return /* Param_format_EBB */[/* Nativeint */{ - 0: ign[0], - 1: pad_of_pad_opt(ign[1]), - 2: /* No_precision */0, - 3: fmt, - length: 4, - tag: 6 - }]; + return /* Param_format_EBB */[/* Nativeint */Block.__(6, [ + ign[0], + pad_of_pad_opt(ign[1]), + /* No_precision */0, + fmt + ])]; case 5 : - return /* Param_format_EBB */[/* Int64 */{ - 0: ign[0], - 1: pad_of_pad_opt(ign[1]), - 2: /* No_precision */0, - 3: fmt, - length: 4, - tag: 7 - }]; + return /* Param_format_EBB */[/* Int64 */Block.__(7, [ + ign[0], + pad_of_pad_opt(ign[1]), + /* No_precision */0, + fmt + ])]; case 6 : - return /* Param_format_EBB */[/* Float */{ - 0: /* Float_f */0, - 1: pad_of_pad_opt(ign[0]), - 2: prec_of_prec_opt(ign[1]), - 3: fmt, - length: 4, - tag: 8 - }]; + return /* Param_format_EBB */[/* Float */Block.__(8, [ + /* Float_f */0, + pad_of_pad_opt(ign[0]), + prec_of_prec_opt(ign[1]), + fmt + ])]; case 7 : - return /* Param_format_EBB */[/* Format_arg */{ - 0: ign[0], - 1: ign[1], - 2: fmt, - length: 3, - tag: 13 - }]; + return /* Param_format_EBB */[/* Format_arg */Block.__(13, [ + ign[0], + ign[1], + fmt + ])]; case 8 : - return /* Param_format_EBB */[/* Format_subst */{ - 0: ign[0], - 1: ign[1], - 2: fmt, - length: 3, - tag: 14 - }]; + return /* Param_format_EBB */[/* Format_subst */Block.__(14, [ + ign[0], + ign[1], + fmt + ])]; case 9 : - return /* Param_format_EBB */[/* Scan_char_set */{ - 0: ign[0], - 1: ign[1], - 2: fmt, - length: 3, - tag: 20 - }]; + return /* Param_format_EBB */[/* Scan_char_set */Block.__(20, [ + ign[0], + ign[1], + fmt + ])]; case 10 : - return /* Param_format_EBB */[/* Scan_get_counter */{ - 0: ign[0], - 1: fmt, - length: 2, - tag: 21 - }]; + return /* Param_format_EBB */[/* Scan_get_counter */Block.__(21, [ + ign[0], + fmt + ])]; } } @@ -913,98 +870,42 @@ function symm(param) { else { switch (param.tag | 0) { case 0 : - return /* Char_ty */{ - 0: symm(param[0]), - length: 1, - tag: 0 - }; + return /* Char_ty */Block.__(0, [symm(param[0])]); case 1 : - return /* String_ty */{ - 0: symm(param[0]), - length: 1, - tag: 1 - }; + return /* String_ty */Block.__(1, [symm(param[0])]); case 2 : - return /* Int_ty */{ - 0: symm(param[0]), - length: 1, - tag: 2 - }; + return /* Int_ty */Block.__(2, [symm(param[0])]); case 3 : - return /* Int32_ty */{ - 0: symm(param[0]), - length: 1, - tag: 3 - }; + return /* Int32_ty */Block.__(3, [symm(param[0])]); case 4 : - return /* Nativeint_ty */{ - 0: symm(param[0]), - length: 1, - tag: 4 - }; + return /* Nativeint_ty */Block.__(4, [symm(param[0])]); case 5 : - return /* Int64_ty */{ - 0: symm(param[0]), - length: 1, - tag: 5 - }; + return /* Int64_ty */Block.__(5, [symm(param[0])]); case 6 : - return /* Float_ty */{ - 0: symm(param[0]), - length: 1, - tag: 6 - }; + return /* Float_ty */Block.__(6, [symm(param[0])]); case 7 : - return /* Bool_ty */{ - 0: symm(param[0]), - length: 1, - tag: 7 - }; + return /* Bool_ty */Block.__(7, [symm(param[0])]); case 8 : - return /* Format_arg_ty */{ - 0: param[0], - 1: symm(param[1]), - length: 2, - tag: 8 - }; + return /* Format_arg_ty */Block.__(8, [ + param[0], + symm(param[1]) + ]); case 9 : - return /* Format_subst_ty */{ - 0: param[1], - 1: param[0], - 2: symm(param[2]), - length: 3, - tag: 9 - }; + return /* Format_subst_ty */Block.__(9, [ + param[1], + param[0], + symm(param[2]) + ]); case 10 : - return /* Alpha_ty */{ - 0: symm(param[0]), - length: 1, - tag: 10 - }; + return /* Alpha_ty */Block.__(10, [symm(param[0])]); case 11 : - return /* Theta_ty */{ - 0: symm(param[0]), - length: 1, - tag: 11 - }; + return /* Theta_ty */Block.__(11, [symm(param[0])]); case 12 : - return /* Any_ty */{ - 0: symm(param[0]), - length: 1, - tag: 12 - }; + return /* Any_ty */Block.__(12, [symm(param[0])]); case 13 : - return /* Reader_ty */{ - 0: symm(param[0]), - length: 1, - tag: 13 - }; + return /* Reader_ty */Block.__(13, [symm(param[0])]); case 14 : - return /* Ignored_reader_ty */{ - 0: symm(param[0]), - length: 1, - tag: 14 - }; + return /* Ignored_reader_ty */Block.__(14, [symm(param[0])]); } } @@ -1370,11 +1271,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 0 : - return /* Char_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 0 - }; + return /* Char_ty */Block.__(0, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1407,11 +1304,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 1 : - return /* String_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 1 - }; + return /* String_ty */Block.__(1, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1444,11 +1337,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 2 : - return /* Int_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 2 - }; + return /* Int_ty */Block.__(2, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1481,11 +1370,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 3 : - return /* Int32_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 3 - }; + return /* Int32_ty */Block.__(3, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1518,11 +1403,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 4 : - return /* Nativeint_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 4 - }; + return /* Nativeint_ty */Block.__(4, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1555,11 +1436,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 5 : - return /* Int64_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 5 - }; + return /* Int64_ty */Block.__(5, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1592,11 +1469,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 6 : - return /* Float_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 6 - }; + return /* Float_ty */Block.__(6, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1629,11 +1502,7 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 7 : - return /* Bool_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 7 - }; + return /* Bool_ty */Block.__(7, [trans(ty1[0], ty2[0])]); case 8 : exit = 6; break; @@ -1673,12 +1542,10 @@ function trans(ty1, ty2) { else { switch (ty2.tag | 0) { case 8 : - return /* Format_arg_ty */{ - 0: trans(ty1[0], ty2[0]), - 1: trans(ty1[1], ty2[1]), - length: 2, - tag: 8 - }; + return /* Format_arg_ty */Block.__(8, [ + trans(ty1[0], ty2[0]), + trans(ty1[1], ty2[1]) + ]); case 10 : exit = 1; break; @@ -1727,13 +1594,11 @@ function trans(ty1, ty2) { var match = fmtty_rel_det(ty); Curry._1(match[1], /* Refl */0); Curry._1(match[3], /* Refl */0); - return /* Format_subst_ty */{ - 0: ty1[0], - 1: ty2[1], - 2: trans(ty1[2], ty2[2]), - length: 3, - tag: 9 - }; + return /* Format_subst_ty */Block.__(9, [ + ty1[0], + ty2[1], + trans(ty1[2], ty2[2]) + ]); case 10 : exit = 1; break; @@ -1773,11 +1638,7 @@ function trans(ty1, ty2) { ]; } else if (ty2.tag === 10) { - return /* Alpha_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 10 - }; + return /* Alpha_ty */Block.__(10, [trans(ty1[0], ty2[0])]); } else { throw [ @@ -1807,11 +1668,7 @@ function trans(ty1, ty2) { exit = 1; break; case 11 : - return /* Theta_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 11 - }; + return /* Theta_ty */Block.__(11, [trans(ty1[0], ty2[0])]); default: throw [ Caml_builtin_exceptions.assert_failure, @@ -1844,11 +1701,7 @@ function trans(ty1, ty2) { exit = 2; break; case 12 : - return /* Any_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 12 - }; + return /* Any_ty */Block.__(12, [trans(ty1[0], ty2[0])]); default: throw [ Caml_builtin_exceptions.assert_failure, @@ -1884,11 +1737,7 @@ function trans(ty1, ty2) { exit = 3; break; case 13 : - return /* Reader_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 13 - }; + return /* Reader_ty */Block.__(13, [trans(ty1[0], ty2[0])]); default: throw [ Caml_builtin_exceptions.assert_failure, @@ -1927,11 +1776,7 @@ function trans(ty1, ty2) { exit = 4; break; case 14 : - return /* Ignored_reader_ty */{ - 0: trans(ty1[0], ty2[0]), - length: 1, - tag: 14 - }; + return /* Ignored_reader_ty */Block.__(14, [trans(ty1[0], ty2[0])]); default: throw [ Caml_builtin_exceptions.assert_failure, @@ -2038,88 +1883,48 @@ function fmtty_of_fmt(_fmtty) { switch (fmtty.tag | 0) { case 2 : case 3 : - return fmtty_of_padding_fmtty(fmtty[0], /* String_ty */{ - 0: fmtty_of_fmt(fmtty[1]), - length: 1, - tag: 1 - }); + return fmtty_of_padding_fmtty(fmtty[0], /* String_ty */Block.__(1, [fmtty_of_fmt(fmtty[1])])); case 4 : var ty_rest = fmtty_of_fmt(fmtty[3]); - var prec_ty = fmtty_of_precision_fmtty(fmtty[2], /* Int_ty */{ - 0: ty_rest, - length: 1, - tag: 2 - }); + var prec_ty = fmtty_of_precision_fmtty(fmtty[2], /* Int_ty */Block.__(2, [ty_rest])); return fmtty_of_padding_fmtty(fmtty[1], prec_ty); case 5 : var ty_rest$1 = fmtty_of_fmt(fmtty[3]); - var prec_ty$1 = fmtty_of_precision_fmtty(fmtty[2], /* Int32_ty */{ - 0: ty_rest$1, - length: 1, - tag: 3 - }); + var prec_ty$1 = fmtty_of_precision_fmtty(fmtty[2], /* Int32_ty */Block.__(3, [ty_rest$1])); return fmtty_of_padding_fmtty(fmtty[1], prec_ty$1); case 6 : var ty_rest$2 = fmtty_of_fmt(fmtty[3]); - var prec_ty$2 = fmtty_of_precision_fmtty(fmtty[2], /* Nativeint_ty */{ - 0: ty_rest$2, - length: 1, - tag: 4 - }); + var prec_ty$2 = fmtty_of_precision_fmtty(fmtty[2], /* Nativeint_ty */Block.__(4, [ty_rest$2])); return fmtty_of_padding_fmtty(fmtty[1], prec_ty$2); case 7 : var ty_rest$3 = fmtty_of_fmt(fmtty[3]); - var prec_ty$3 = fmtty_of_precision_fmtty(fmtty[2], /* Int64_ty */{ - 0: ty_rest$3, - length: 1, - tag: 5 - }); + var prec_ty$3 = fmtty_of_precision_fmtty(fmtty[2], /* Int64_ty */Block.__(5, [ty_rest$3])); return fmtty_of_padding_fmtty(fmtty[1], prec_ty$3); case 8 : var ty_rest$4 = fmtty_of_fmt(fmtty[3]); - var prec_ty$4 = fmtty_of_precision_fmtty(fmtty[2], /* Float_ty */{ - 0: ty_rest$4, - length: 1, - tag: 6 - }); + var prec_ty$4 = fmtty_of_precision_fmtty(fmtty[2], /* Float_ty */Block.__(6, [ty_rest$4])); return fmtty_of_padding_fmtty(fmtty[1], prec_ty$4); case 9 : - return /* Bool_ty */{ - 0: fmtty_of_fmt(fmtty[0]), - length: 1, - tag: 7 - }; + return /* Bool_ty */Block.__(7, [fmtty_of_fmt(fmtty[0])]); case 10 : _fmtty = fmtty[0]; continue ; case 13 : - return /* Format_arg_ty */{ - 0: fmtty[1], - 1: fmtty_of_fmt(fmtty[2]), - length: 2, - tag: 8 - }; + return /* Format_arg_ty */Block.__(8, [ + fmtty[1], + fmtty_of_fmt(fmtty[2]) + ]); case 14 : var ty = fmtty[1]; - return /* Format_subst_ty */{ - 0: ty, - 1: ty, - 2: fmtty_of_fmt(fmtty[2]), - length: 3, - tag: 9 - }; + return /* Format_subst_ty */Block.__(9, [ + ty, + ty, + fmtty_of_fmt(fmtty[2]) + ]); case 15 : - return /* Alpha_ty */{ - 0: fmtty_of_fmt(fmtty[0]), - length: 1, - tag: 10 - }; + return /* Alpha_ty */Block.__(10, [fmtty_of_fmt(fmtty[0])]); case 16 : - return /* Theta_ty */{ - 0: fmtty_of_fmt(fmtty[0]), - length: 1, - tag: 11 - }; + return /* Theta_ty */Block.__(11, [fmtty_of_fmt(fmtty[0])]); case 11 : case 12 : case 17 : @@ -2128,42 +1933,22 @@ function fmtty_of_fmt(_fmtty) { case 18 : return CamlinternalFormatBasics.concat_fmtty(fmtty_of_formatting_gen(fmtty[0]), fmtty_of_fmt(fmtty[1])); case 19 : - return /* Reader_ty */{ - 0: fmtty_of_fmt(fmtty[0]), - length: 1, - tag: 13 - }; + return /* Reader_ty */Block.__(13, [fmtty_of_fmt(fmtty[0])]); case 20 : - return /* String_ty */{ - 0: fmtty_of_fmt(fmtty[2]), - length: 1, - tag: 1 - }; + return /* String_ty */Block.__(1, [fmtty_of_fmt(fmtty[2])]); case 21 : - return /* Int_ty */{ - 0: fmtty_of_fmt(fmtty[1]), - length: 1, - tag: 2 - }; + return /* Int_ty */Block.__(2, [fmtty_of_fmt(fmtty[1])]); case 0 : case 1 : case 22 : - return /* Char_ty */{ - 0: fmtty_of_fmt(fmtty[0]), - length: 1, - tag: 0 - }; + return /* Char_ty */Block.__(0, [fmtty_of_fmt(fmtty[0])]); case 23 : var ign = fmtty[0]; var fmt = fmtty[1]; if (typeof ign === "number") { switch (ign) { case 3 : - return /* Ignored_reader_ty */{ - 0: fmtty_of_fmt(fmt), - length: 1, - tag: 14 - }; + return /* Ignored_reader_ty */Block.__(14, [fmtty_of_fmt(fmt)]); case 0 : case 1 : case 2 : @@ -2200,11 +1985,7 @@ function fmtty_of_fmt(_fmtty) { function fmtty_of_custom(arity, fmtty) { if (arity) { - return /* Any_ty */{ - 0: fmtty_of_custom(arity[0], fmtty), - length: 1, - tag: 12 - }; + return /* Any_ty */Block.__(12, [fmtty_of_custom(arity[0], fmtty)]); } else { return fmtty; @@ -2216,21 +1997,13 @@ function fmtty_of_padding_fmtty(pad, fmtty) { return fmtty; } else { - return /* Int_ty */{ - 0: fmtty, - length: 1, - tag: 2 - }; + return /* Int_ty */Block.__(2, [fmtty]); } } function fmtty_of_precision_fmtty(prec, fmtty) { if (typeof prec === "number" && prec !== 0) { - return /* Int_ty */{ - 0: fmtty, - length: 1, - tag: 2 - }; + return /* Int_ty */Block.__(2, [fmtty]); } else { return fmtty; @@ -2252,11 +2025,7 @@ function type_padding(pad, fmtty) { } else if (fmtty.tag === 2) { return /* Padding_fmtty_EBB */[ - /* Arg_padding */{ - 0: pad[0], - length: 1, - tag: 1 - }, + /* Arg_padding */Block.__(1, [pad[0]]), fmtty[0] ]; } @@ -2266,12 +2035,10 @@ function type_padding(pad, fmtty) { } else { return /* Padding_fmtty_EBB */[ - /* Lit_padding */{ - 0: pad[0], - 1: pad[1], - length: 2, - tag: 0 - }, + /* Lit_padding */Block.__(0, [ + pad[0], + pad[1] + ]), fmtty ]; } @@ -2342,11 +2109,7 @@ function type_format_gen(fmt, fmtty) { else { var match = type_format_gen(fmt[0], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Char */{ - 0: match[0], - length: 1, - tag: 0 - }, + /* Char */Block.__(0, [match[0]]), match[1] ]; } @@ -2361,11 +2124,7 @@ function type_format_gen(fmt, fmtty) { else { var match$1 = type_format_gen(fmt[0], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Caml_char */{ - 0: match$1[0], - length: 1, - tag: 1 - }, + /* Caml_char */Block.__(1, [match$1[0]]), match$1[1] ]; } @@ -2379,12 +2138,10 @@ function type_format_gen(fmt, fmtty) { else if (match$3.tag === 1) { var match$4 = type_format_gen(fmt[1], match$3[0]); return /* Fmt_fmtty_EBB */[ - /* String */{ - 0: match$2[0], - 1: match$4[0], - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + match$2[0], + match$4[0] + ]), match$4[1] ]; } @@ -2401,12 +2158,10 @@ function type_format_gen(fmt, fmtty) { else if (match$6.tag === 1) { var match$7 = type_format_gen(fmt[1], match$6[0]); return /* Fmt_fmtty_EBB */[ - /* Caml_string */{ - 0: match$5[0], - 1: match$7[0], - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + match$5[0], + match$7[0] + ]), match$7[1] ]; } @@ -2423,14 +2178,12 @@ function type_format_gen(fmt, fmtty) { else if (match$9.tag === 2) { var match$10 = type_format_gen(fmt[3], match$9[0]); return /* Fmt_fmtty_EBB */[ - /* Int */{ - 0: fmt[0], - 1: match$8[0], - 2: match$8[1], - 3: match$10[0], - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + fmt[0], + match$8[0], + match$8[1], + match$10[0] + ]), match$10[1] ]; } @@ -2447,14 +2200,12 @@ function type_format_gen(fmt, fmtty) { else if (match$12.tag === 3) { var match$13 = type_format_gen(fmt[3], match$12[0]); return /* Fmt_fmtty_EBB */[ - /* Int32 */{ - 0: fmt[0], - 1: match$11[0], - 2: match$11[1], - 3: match$13[0], - length: 4, - tag: 5 - }, + /* Int32 */Block.__(5, [ + fmt[0], + match$11[0], + match$11[1], + match$13[0] + ]), match$13[1] ]; } @@ -2471,14 +2222,12 @@ function type_format_gen(fmt, fmtty) { else if (match$15.tag === 4) { var match$16 = type_format_gen(fmt[3], match$15[0]); return /* Fmt_fmtty_EBB */[ - /* Nativeint */{ - 0: fmt[0], - 1: match$14[0], - 2: match$14[1], - 3: match$16[0], - length: 4, - tag: 6 - }, + /* Nativeint */Block.__(6, [ + fmt[0], + match$14[0], + match$14[1], + match$16[0] + ]), match$16[1] ]; } @@ -2495,14 +2244,12 @@ function type_format_gen(fmt, fmtty) { else if (match$18.tag === 5) { var match$19 = type_format_gen(fmt[3], match$18[0]); return /* Fmt_fmtty_EBB */[ - /* Int64 */{ - 0: fmt[0], - 1: match$17[0], - 2: match$17[1], - 3: match$19[0], - length: 4, - tag: 7 - }, + /* Int64 */Block.__(7, [ + fmt[0], + match$17[0], + match$17[1], + match$19[0] + ]), match$19[1] ]; } @@ -2519,14 +2266,12 @@ function type_format_gen(fmt, fmtty) { else if (match$21.tag === 6) { var match$22 = type_format_gen(fmt[3], match$21[0]); return /* Fmt_fmtty_EBB */[ - /* Float */{ - 0: fmt[0], - 1: match$20[0], - 2: match$20[1], - 3: match$22[0], - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + fmt[0], + match$20[0], + match$20[1], + match$22[0] + ]), match$22[1] ]; } @@ -2541,11 +2286,7 @@ function type_format_gen(fmt, fmtty) { else if (fmtty.tag === 7) { var match$23 = type_format_gen(fmt[0], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Bool */{ - 0: match$23[0], - length: 1, - tag: 9 - }, + /* Bool */Block.__(9, [match$23[0]]), match$23[1] ]; } @@ -2556,33 +2297,25 @@ function type_format_gen(fmt, fmtty) { case 10 : var match$24 = type_format_gen(fmt[0], fmtty); return /* Fmt_fmtty_EBB */[ - /* Flush */{ - 0: match$24[0], - length: 1, - tag: 10 - }, + /* Flush */Block.__(10, [match$24[0]]), match$24[1] ]; case 11 : var match$25 = type_format_gen(fmt[1], fmtty); return /* Fmt_fmtty_EBB */[ - /* String_literal */{ - 0: fmt[0], - 1: match$25[0], - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + fmt[0], + match$25[0] + ]), match$25[1] ]; case 12 : var match$26 = type_format_gen(fmt[1], fmtty); return /* Fmt_fmtty_EBB */[ - /* Char_literal */{ - 0: fmt[0], - 1: match$26[0], - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + fmt[0], + match$26[0] + ]), match$26[1] ]; case 13 : @@ -2596,13 +2329,11 @@ function type_format_gen(fmt, fmtty) { } var match$27 = type_format_gen(fmt[2], fmtty[1]); return /* Fmt_fmtty_EBB */[ - /* Format_arg */{ - 0: fmt[0], - 1: sub_fmtty$prime, - 2: match$27[0], - length: 3, - tag: 13 - }, + /* Format_arg */Block.__(13, [ + fmt[0], + sub_fmtty$prime, + match$27[0] + ]), match$27[1] ]; } @@ -2621,13 +2352,11 @@ function type_format_gen(fmt, fmtty) { } var match$28 = type_format_gen(fmt[2], CamlinternalFormatBasics.erase_rel(fmtty[2])); return /* Fmt_fmtty_EBB */[ - /* Format_subst */{ - 0: fmt[0], - 1: sub_fmtty1, - 2: match$28[0], - length: 3, - tag: 14 - }, + /* Format_subst */Block.__(14, [ + fmt[0], + sub_fmtty1, + match$28[0] + ]), match$28[1] ]; } @@ -2642,11 +2371,7 @@ function type_format_gen(fmt, fmtty) { else if (fmtty.tag === 10) { var match$29 = type_format_gen(fmt[0], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Alpha */{ - 0: match$29[0], - length: 1, - tag: 15 - }, + /* Alpha */Block.__(15, [match$29[0]]), match$29[1] ]; } @@ -2661,11 +2386,7 @@ function type_format_gen(fmt, fmtty) { else if (fmtty.tag === 11) { var match$30 = type_format_gen(fmt[0], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Theta */{ - 0: match$30[0], - length: 1, - tag: 16 - }, + /* Theta */Block.__(16, [match$30[0]]), match$30[1] ]; } @@ -2676,12 +2397,10 @@ function type_format_gen(fmt, fmtty) { case 17 : var match$31 = type_format_gen(fmt[1], fmtty); return /* Fmt_fmtty_EBB */[ - /* Formatting_lit */{ - 0: fmt[0], - 1: match$31[0], - length: 2, - tag: 17 - }, + /* Formatting_lit */Block.__(17, [ + fmt[0], + match$31[0] + ]), match$31[1] ]; case 18 : @@ -2693,19 +2412,13 @@ function type_format_gen(fmt, fmtty) { var match$33 = type_format_gen(match$32[0], fmtty0); var match$34 = type_format_gen(fmt0, match$33[1]); return /* Fmt_fmtty_EBB */[ - /* Formatting_gen */{ - 0: /* Open_box */{ - 0: /* Format */[ - match$33[0], - match$32[1] - ], - length: 1, - tag: 1 - }, - 1: match$34[0], - length: 2, - tag: 18 - }, + /* Formatting_gen */Block.__(18, [ + /* Open_box */Block.__(1, [/* Format */[ + match$33[0], + match$32[1] + ]]), + match$34[0] + ]), match$34[1] ]; } @@ -2714,19 +2427,13 @@ function type_format_gen(fmt, fmtty) { var match$36 = type_format_gen(match$35[0], fmtty0); var match$37 = type_format_gen(fmt0, match$36[1]); return /* Fmt_fmtty_EBB */[ - /* Formatting_gen */{ - 0: /* Open_tag */{ - 0: /* Format */[ - match$36[0], - match$35[1] - ], - length: 1, - tag: 0 - }, - 1: match$37[0], - length: 2, - tag: 18 - }, + /* Formatting_gen */Block.__(18, [ + /* Open_tag */Block.__(0, [/* Format */[ + match$36[0], + match$35[1] + ]]), + match$37[0] + ]), match$37[1] ]; } @@ -2737,11 +2444,7 @@ function type_format_gen(fmt, fmtty) { else if (fmtty.tag === 13) { var match$38 = type_format_gen(fmt[0], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Reader */{ - 0: match$38[0], - length: 1, - tag: 19 - }, + /* Reader */Block.__(19, [match$38[0]]), match$38[1] ]; } @@ -2756,13 +2459,11 @@ function type_format_gen(fmt, fmtty) { else if (fmtty.tag === 1) { var match$39 = type_format_gen(fmt[2], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Scan_char_set */{ - 0: fmt[0], - 1: fmt[1], - 2: match$39[0], - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + fmt[0], + fmt[1], + match$39[0] + ]), match$39[1] ]; } @@ -2777,12 +2478,10 @@ function type_format_gen(fmt, fmtty) { else if (fmtty.tag === 2) { var match$40 = type_format_gen(fmt[1], fmtty[0]); return /* Fmt_fmtty_EBB */[ - /* Scan_get_counter */{ - 0: fmt[0], - 1: match$40[0], - length: 2, - tag: 21 - }, + /* Scan_get_counter */Block.__(21, [ + fmt[0], + match$40[0] + ]), match$40[1] ]; } @@ -2803,12 +2502,10 @@ function type_format_gen(fmt, fmtty) { else if (fmtty$1.tag === 14) { var match$41 = type_format_gen(fmt$1, fmtty$1[0]); return /* Fmt_fmtty_EBB */[ - /* Ignored_param */{ - 0: /* Ignored_reader */3, - 1: match$41[0], - length: 2, - tag: 23 - }, + /* Ignored_param */Block.__(23, [ + /* Ignored_reader */3, + match$41[0] + ]), match$41[1] ]; } @@ -2827,27 +2524,21 @@ function type_format_gen(fmt, fmtty) { else { switch (ign.tag | 0) { case 7 : - return type_ignored_param_one(/* Ignored_format_arg */{ - 0: ign[0], - 1: ign[1], - length: 2, - tag: 7 - }, fmt$1, fmtty$1); + return type_ignored_param_one(/* Ignored_format_arg */Block.__(7, [ + ign[0], + ign[1] + ]), fmt$1, fmtty$1); case 8 : var match$42 = type_ignored_format_substitution(ign[1], fmt$1, fmtty$1); var match$43 = match$42[1]; return /* Fmt_fmtty_EBB */[ - /* Ignored_param */{ - 0: /* Ignored_format_subst */{ - 0: ign[0], - 1: match$42[0], - length: 2, - tag: 8 - }, - 1: match$43[0], - length: 2, - tag: 23 - }, + /* Ignored_param */Block.__(23, [ + /* Ignored_format_subst */Block.__(8, [ + ign[0], + match$42[0] + ]), + match$43[0] + ]), match$43[1] ]; case 0 : @@ -2874,12 +2565,10 @@ function type_format_gen(fmt, fmtty) { function type_ignored_param_one(ign, fmt, fmtty) { var match = type_format_gen(fmt, fmtty); return /* Fmt_fmtty_EBB */[ - /* Ignored_param */{ - 0: ign, - 1: match[0], - length: 2, - tag: 23 - }, + /* Ignored_param */Block.__(23, [ + ign, + match[0] + ]), match[1] ]; } @@ -2903,11 +2592,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else { var match = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Char_ty */{ - 0: match[0], - length: 1, - tag: 0 - }, + /* Char_ty */Block.__(0, [match[0]]), match[1] ]; } @@ -2919,11 +2604,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 1) { var match$1 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* String_ty */{ - 0: match$1[0], - length: 1, - tag: 1 - }, + /* String_ty */Block.__(1, [match$1[0]]), match$1[1] ]; } @@ -2938,11 +2619,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 2) { var match$2 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Int_ty */{ - 0: match$2[0], - length: 1, - tag: 2 - }, + /* Int_ty */Block.__(2, [match$2[0]]), match$2[1] ]; } @@ -2957,11 +2634,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 3) { var match$3 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Int32_ty */{ - 0: match$3[0], - length: 1, - tag: 3 - }, + /* Int32_ty */Block.__(3, [match$3[0]]), match$3[1] ]; } @@ -2976,11 +2649,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 4) { var match$4 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Nativeint_ty */{ - 0: match$4[0], - length: 1, - tag: 4 - }, + /* Nativeint_ty */Block.__(4, [match$4[0]]), match$4[1] ]; } @@ -2995,11 +2664,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 5) { var match$5 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Int64_ty */{ - 0: match$5[0], - length: 1, - tag: 5 - }, + /* Int64_ty */Block.__(5, [match$5[0]]), match$5[1] ]; } @@ -3014,11 +2679,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 6) { var match$6 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Float_ty */{ - 0: match$6[0], - length: 1, - tag: 6 - }, + /* Float_ty */Block.__(6, [match$6[0]]), match$6[1] ]; } @@ -3033,11 +2694,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 7) { var match$7 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Bool_ty */{ - 0: match$7[0], - length: 1, - tag: 7 - }, + /* Bool_ty */Block.__(7, [match$7[0]]), match$7[1] ]; } @@ -3056,12 +2713,10 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { } var match$8 = type_ignored_format_substitution(sub_fmtty[1], fmt, fmtty[1]); return /* Fmtty_fmt_EBB */[ - /* Format_arg_ty */{ - 0: sub2_fmtty$prime, - 1: match$8[0], - length: 2, - tag: 8 - }, + /* Format_arg_ty */Block.__(8, [ + sub2_fmtty$prime, + match$8[0] + ]), match$8[1] ]; } @@ -3088,13 +2743,11 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { Curry._1(match$9[3], /* Refl */0); var match$10 = type_ignored_format_substitution(CamlinternalFormatBasics.erase_rel(sub_fmtty[2]), fmt, fmtty[2]); return /* Fmtty_fmt_EBB */[ - /* Format_subst_ty */{ - 0: sub1_fmtty$prime, - 1: sub2_fmtty$prime$1, - 2: symm(match$10[0]), - length: 3, - tag: 9 - }, + /* Format_subst_ty */Block.__(9, [ + sub1_fmtty$prime, + sub2_fmtty$prime$1, + symm(match$10[0]) + ]), match$10[1] ]; } @@ -3109,11 +2762,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 10) { var match$11 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Alpha_ty */{ - 0: match$11[0], - length: 1, - tag: 10 - }, + /* Alpha_ty */Block.__(10, [match$11[0]]), match$11[1] ]; } @@ -3128,11 +2777,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 11) { var match$12 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Theta_ty */{ - 0: match$12[0], - length: 1, - tag: 11 - }, + /* Theta_ty */Block.__(11, [match$12[0]]), match$12[1] ]; } @@ -3149,11 +2794,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 13) { var match$13 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Reader_ty */{ - 0: match$13[0], - length: 1, - tag: 13 - }, + /* Reader_ty */Block.__(13, [match$13[0]]), match$13[1] ]; } @@ -3168,11 +2809,7 @@ function type_ignored_format_substitution(sub_fmtty, fmt, fmtty) { else if (fmtty.tag === 14) { var match$14 = type_ignored_format_substitution(sub_fmtty[0], fmt, fmtty[0]); return /* Fmtty_fmt_EBB */[ - /* Ignored_reader_ty */{ - 0: match$14[0], - length: 1, - tag: 14 - }, + /* Ignored_reader_ty */Block.__(14, [match$14[0]]), match$14[1] ]; } @@ -3611,12 +3248,10 @@ function make_printf(_k, o, _acc, _fmt) { var rest = fmt[0]; return (function(k,acc,rest){ return function (c) { - var new_acc = /* Acc_data_char */{ - 0: acc, - 1: c, - length: 2, - tag: 5 - }; + var new_acc = /* Acc_data_char */Block.__(5, [ + acc, + c + ]); return make_printf(k, o, new_acc, rest); } }(k,acc,rest)); @@ -3625,12 +3260,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k,acc,rest$1){ return function (c) { var new_acc_001 = format_caml_char(c); - var new_acc = /* Acc_data_string */{ - 0: acc, - 1: new_acc_001, - length: 2, - tag: 4 - }; + var new_acc = /* Acc_data_string */Block.__(4, [ + acc, + new_acc_001 + ]); return make_printf(k, o, new_acc, rest$1); } }(k,acc,rest$1)); @@ -3662,12 +3295,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k$1,o$1,acc$1,fmt$1,fconv){ return function (p, x) { var str = convert_float(fconv, p, x); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv)); } @@ -3675,12 +3306,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k$1,o$1,acc$1,fmt$1,fconv){ return function (x) { var str = convert_float(fconv, 6, x); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv)); } @@ -3690,12 +3319,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k$1,o$1,acc$1,fmt$1,fconv,p){ return function (x) { var str = convert_float(fconv, p, x); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv,p)); } @@ -3707,12 +3334,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k$1,o$1,acc$1,fmt$1,fconv,padty){ return function (w, p, x) { var str = fix_padding(padty, w, convert_float(fconv, p, x)); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv,padty)); } @@ -3721,12 +3346,10 @@ function make_printf(_k, o, _acc, _fmt) { return function (w, x) { var str = convert_float(fconv, 6, x); var str$prime = fix_padding(padty, w, str); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str$prime, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str$prime + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv,padty)); } @@ -3736,12 +3359,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k$1,o$1,acc$1,fmt$1,fconv,padty,p$1){ return function (w, x) { var str = fix_padding(padty, w, convert_float(fconv, p$1, x)); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv,padty,p$1)); } @@ -3754,12 +3375,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w){ return function (p, x) { var str = fix_padding(padty$1, w, convert_float(fconv, p, x)); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w)); } @@ -3768,12 +3387,10 @@ function make_printf(_k, o, _acc, _fmt) { return function (x) { var str = convert_float(fconv, 6, x); var str$prime = fix_padding(padty$1, w, str); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str$prime, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str$prime + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w)); } @@ -3783,12 +3400,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w,p$2){ return function (x) { var str = fix_padding(padty$1, w, convert_float(fconv, p$2, x)); - return make_printf(k$1, o$1, /* Acc_data_string */{ - 0: acc$1, - 1: str, - length: 2, - tag: 4 - }, fmt$1); + return make_printf(k$1, o$1, /* Acc_data_string */Block.__(4, [ + acc$1, + str + ]), fmt$1); } }(k$1,o$1,acc$1,fmt$1,fconv,padty$1,w,p$2)); } @@ -3797,51 +3412,39 @@ function make_printf(_k, o, _acc, _fmt) { var rest$2 = fmt[0]; return (function(k,acc,rest$2){ return function (b) { - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: b ? "true" : "false", - length: 2, - tag: 4 - }, rest$2); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + b ? "true" : "false" + ]), rest$2); } }(k,acc,rest$2)); case 10 : _fmt = fmt[0]; - _acc = /* Acc_flush */{ - 0: acc, - length: 1, - tag: 7 - }; + _acc = /* Acc_flush */Block.__(7, [acc]); continue ; case 11 : _fmt = fmt[1]; - _acc = /* Acc_string_literal */{ - 0: acc, - 1: fmt[0], - length: 2, - tag: 2 - }; + _acc = /* Acc_string_literal */Block.__(2, [ + acc, + fmt[0] + ]); continue ; case 12 : _fmt = fmt[1]; - _acc = /* Acc_char_literal */{ - 0: acc, - 1: fmt[0], - length: 2, - tag: 3 - }; + _acc = /* Acc_char_literal */Block.__(3, [ + acc, + fmt[0] + ]); continue ; case 13 : var rest$3 = fmt[2]; var ty = string_of_fmtty(fmt[1]); return (function(k,acc,rest$3,ty){ return function () { - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: ty, - length: 2, - tag: 4 - }, rest$3); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + ty + ]), rest$3); } }(k,acc,rest$3,ty)); case 14 : @@ -3856,36 +3459,30 @@ function make_printf(_k, o, _acc, _fmt) { var rest$5 = fmt[0]; return (function(k,acc,rest$5){ return function (f, x) { - return make_printf(k, o, /* Acc_delay */{ - 0: acc, - 1: function (o) { - return Curry._2(f, o, x); - }, - length: 2, - tag: 6 - }, rest$5); + return make_printf(k, o, /* Acc_delay */Block.__(6, [ + acc, + function (o) { + return Curry._2(f, o, x); + } + ]), rest$5); } }(k,acc,rest$5)); case 16 : var rest$6 = fmt[0]; return (function(k,acc,rest$6){ return function (f) { - return make_printf(k, o, /* Acc_delay */{ - 0: acc, - 1: f, - length: 2, - tag: 6 - }, rest$6); + return make_printf(k, o, /* Acc_delay */Block.__(6, [ + acc, + f + ]), rest$6); } }(k,acc,rest$6)); case 17 : _fmt = fmt[1]; - _acc = /* Acc_formatting_lit */{ - 0: acc, - 1: fmt[0], - length: 2, - tag: 0 - }; + _acc = /* Acc_formatting_lit */Block.__(0, [ + acc, + fmt[0] + ]); continue ; case 18 : var match = fmt[0]; @@ -3893,16 +3490,10 @@ function make_printf(_k, o, _acc, _fmt) { var rest$7 = fmt[1]; var k$prime = (function(k,acc,rest$7){ return function (koc, kacc) { - return make_printf(k, koc, /* Acc_formatting_gen */{ - 0: acc, - 1: /* Acc_open_box */{ - 0: kacc, - length: 1, - tag: 1 - }, - length: 2, - tag: 1 - }, rest$7); + return make_printf(k, koc, /* Acc_formatting_gen */Block.__(1, [ + acc, + /* Acc_open_box */Block.__(1, [kacc]) + ]), rest$7); } }(k,acc,rest$7)); _fmt = match[0][0]; @@ -3915,16 +3506,10 @@ function make_printf(_k, o, _acc, _fmt) { var rest$8 = fmt[1]; var k$prime$1 = (function(k,acc,rest$8){ return function (koc, kacc) { - return make_printf(k, koc, /* Acc_formatting_gen */{ - 0: acc, - 1: /* Acc_open_tag */{ - 0: kacc, - length: 1, - tag: 0 - }, - length: 2, - tag: 1 - }, rest$8); + return make_printf(k, koc, /* Acc_formatting_gen */Block.__(1, [ + acc, + /* Acc_open_tag */Block.__(0, [kacc]) + ]), rest$8); } }(k,acc,rest$8)); _fmt = match[0][0]; @@ -3945,12 +3530,10 @@ function make_printf(_k, o, _acc, _fmt) { ]; case 20 : var rest$9 = fmt[2]; - var new_acc = /* Acc_invalid_arg */{ - 0: acc, - 1: "Printf: bad conversion %[", - length: 2, - tag: 8 - }; + var new_acc = /* Acc_invalid_arg */Block.__(8, [ + acc, + "Printf: bad conversion %[" + ]); return (function(k,rest$9,new_acc){ return function () { return make_printf(k, o, new_acc, rest$9); @@ -3961,12 +3544,10 @@ function make_printf(_k, o, _acc, _fmt) { return (function(k,acc,rest$10){ return function (n) { var new_acc_001 = Caml_format.caml_format_int("%u", n); - var new_acc = /* Acc_data_string */{ - 0: acc, - 1: new_acc_001, - length: 2, - tag: 4 - }; + var new_acc = /* Acc_data_string */Block.__(4, [ + acc, + new_acc_001 + ]); return make_printf(k, o, new_acc, rest$10); } }(k,acc,rest$10)); @@ -3974,12 +3555,10 @@ function make_printf(_k, o, _acc, _fmt) { var rest$11 = fmt[0]; return (function(k,acc,rest$11){ return function (c) { - var new_acc = /* Acc_data_char */{ - 0: acc, - 1: c, - length: 2, - tag: 5 - }; + var new_acc = /* Acc_data_char */Block.__(5, [ + acc, + c + ]); return make_printf(k, o, new_acc, rest$11); } }(k,acc,rest$11)); @@ -4130,24 +3709,20 @@ function make_from_fmtty(k, o, acc, fmtty, fmt) { } function make_invalid_arg(k, o, acc, fmt) { - return make_printf(k, o, /* Acc_invalid_arg */{ - 0: acc, - 1: "Printf: bad conversion %_", - length: 2, - tag: 8 - }, fmt); + return make_printf(k, o, /* Acc_invalid_arg */Block.__(8, [ + acc, + "Printf: bad conversion %_" + ]), fmt); } function make_string_padding(k, o, acc, fmt, pad, trans) { if (typeof pad === "number") { return function (x) { var new_acc_001 = Curry._1(trans, x); - var new_acc = /* Acc_data_string */{ - 0: acc, - 1: new_acc_001, - length: 2, - tag: 4 - }; + var new_acc = /* Acc_data_string */Block.__(4, [ + acc, + new_acc_001 + ]); return make_printf(k, o, new_acc, fmt); }; } @@ -4155,12 +3730,10 @@ function make_string_padding(k, o, acc, fmt, pad, trans) { var padty = pad[0]; return function (w, x) { var new_acc_001 = fix_padding(padty, w, Curry._1(trans, x)); - var new_acc = /* Acc_data_string */{ - 0: acc, - 1: new_acc_001, - length: 2, - tag: 4 - }; + var new_acc = /* Acc_data_string */Block.__(4, [ + acc, + new_acc_001 + ]); return make_printf(k, o, new_acc, fmt); }; } @@ -4169,12 +3742,10 @@ function make_string_padding(k, o, acc, fmt, pad, trans) { var padty$1 = pad[0]; return function (x) { var new_acc_001 = fix_padding(padty$1, width, Curry._1(trans, x)); - var new_acc = /* Acc_data_string */{ - 0: acc, - 1: new_acc_001, - length: 2, - tag: 4 - }; + var new_acc = /* Acc_data_string */Block.__(4, [ + acc, + new_acc_001 + ]); return make_printf(k, o, new_acc, fmt); }; } @@ -4186,23 +3757,19 @@ function make_int_padding_precision(k, o, acc, fmt, pad, prec, trans, iconv) { if (prec !== 0) { return function (p, x) { var str = fix_int_precision(p, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } else { return function (x) { var str = Curry._2(trans, iconv, x); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } } @@ -4210,12 +3777,10 @@ function make_int_padding_precision(k, o, acc, fmt, pad, prec, trans, iconv) { var p = prec[0]; return function (x) { var str = fix_int_precision(p, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } } @@ -4225,23 +3790,19 @@ function make_int_padding_precision(k, o, acc, fmt, pad, prec, trans, iconv) { if (prec !== 0) { return function (w, p, x) { var str = fix_padding(padty, w, fix_int_precision(p, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } else { return function (w, x) { var str = fix_padding(padty, w, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } } @@ -4249,12 +3810,10 @@ function make_int_padding_precision(k, o, acc, fmt, pad, prec, trans, iconv) { var p$1 = prec[0]; return function (w, x) { var str = fix_padding(padty, w, fix_int_precision(p$1, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } } @@ -4265,23 +3824,19 @@ function make_int_padding_precision(k, o, acc, fmt, pad, prec, trans, iconv) { if (prec !== 0) { return function (p, x) { var str = fix_padding(padty$1, w, fix_int_precision(p, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } else { return function (x) { var str = fix_padding(padty$1, w, Curry._2(trans, iconv, x)); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } } @@ -4289,12 +3844,10 @@ function make_int_padding_precision(k, o, acc, fmt, pad, prec, trans, iconv) { var p$2 = prec[0]; return function (x) { var str = fix_padding(padty$1, w, fix_int_precision(p$2, Curry._2(trans, iconv, x))); - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: str, - length: 2, - tag: 4 - }, fmt); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + str + ]), fmt); }; } } @@ -4308,12 +3861,10 @@ function make_custom(k, o, acc, rest, arity, f) { }; } else { - return make_printf(k, o, /* Acc_data_string */{ - 0: acc, - 1: f, - length: 2, - tag: 4 - }, rest); + return make_printf(k, o, /* Acc_data_string */Block.__(4, [ + acc, + f + ]), rest); } } @@ -4536,17 +4087,13 @@ function open_box_of_string(str) { var len = str.length; var invalid_box = function () { return Curry._1(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid box description ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid box description ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "invalid box description %S" ]), str); }; @@ -4687,22 +4234,16 @@ function make_padding_fmt_ebb(pad, fmt) { } else if (pad.tag) { return /* Padding_fmt_EBB */[ - /* Arg_padding */{ - 0: pad[0], - length: 1, - tag: 1 - }, + /* Arg_padding */Block.__(1, [pad[0]]), fmt ]; } else { return /* Padding_fmt_EBB */[ - /* Lit_padding */{ - 0: pad[0], - 1: pad[1], - length: 2, - tag: 0 - }, + /* Lit_padding */Block.__(0, [ + pad[0], + pad[1] + ]), fmt ]; } @@ -4744,23 +4285,17 @@ function make_padprec_fmt_ebb(pad, prec, fmt) { } else if (pad.tag) { return /* Padprec_fmt_EBB */[ - /* Arg_padding */{ - 0: pad[0], - length: 1, - tag: 1 - }, + /* Arg_padding */Block.__(1, [pad[0]]), prec$1, fmt$prime ]; } else { return /* Padprec_fmt_EBB */[ - /* Lit_padding */{ - 0: pad[0], - 1: pad[1], - length: 2, - tag: 0 - }, + /* Lit_padding */Block.__(0, [ + pad[0], + pad[1] + ]), prec$1, fmt$prime ]; @@ -4771,133 +4306,85 @@ function fmt_ebb_of_string(legacy_behavior, str) { var legacy_behavior$1 = legacy_behavior ? legacy_behavior[0] : /* true */1; var invalid_format_message = function (str_ind, msg) { return Curry._3(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": at character number ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": at character number ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: at character number %d, %s" ]), str, str_ind, msg); }; var invalid_format_without = function (str_ind, c, s) { return Curry._4(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": at character number ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", '", - 1: /* Char */{ - 0: /* String_literal */{ - 0: "' without ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": at character number ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", '", + /* Char */Block.__(0, [/* String_literal */Block.__(11, [ + "' without ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ])]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: at character number %d, '%c' without %s" ]), str, str_ind, c, s); }; var expected_character = function (str_ind, expected, read) { return Curry._4(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": at character number ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " expected, read ", - 1: /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": at character number ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " expected, read ", + /* Caml_char */Block.__(1, [/* End_of_format */0]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: at character number %d, %s expected, read %C" ]), str, str_ind, expected, read); }; @@ -4951,38 +4438,24 @@ function fmt_ebb_of_string(legacy_behavior, str) { var set_flag = function (str_ind, flag) { if (flag[0] && !legacy_behavior$1) { Curry._3(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": at character number ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", duplicate flag ", - 1: /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": at character number ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", duplicate flag ", + /* Caml_char */Block.__(1, [/* End_of_format */0]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: at character number %d, duplicate flag %C" ]), str, str_ind, str.charCodeAt(str_ind)); } @@ -5068,23 +4541,17 @@ function fmt_ebb_of_string(legacy_behavior, str) { } else { var match$2 = parse_positive(str_ind$2, end_ind$1, 0); - return parse_after_padding(pct_ind$1, match$2[0], end_ind$1, minus$1, plus$1, sharp$1, space$1, ign$1, /* Lit_padding */{ - 0: padty, - 1: match$2[1], - length: 2, - tag: 0 - }); + return parse_after_padding(pct_ind$1, match$2[0], end_ind$1, minus$1, plus$1, sharp$1, space$1, ign$1, /* Lit_padding */Block.__(0, [ + padty, + match$2[1] + ])); } } else if (match$1 !== 42) { exit$1 = 1; } else { - return parse_after_padding(pct_ind$1, str_ind$2 + 1 | 0, end_ind$1, minus$1, plus$1, sharp$1, space$1, ign$1, /* Arg_padding */{ - 0: padty, - length: 1, - tag: 1 - }); + return parse_after_padding(pct_ind$1, str_ind$2 + 1 | 0, end_ind$1, minus$1, plus$1, sharp$1, space$1, ign$1, /* Arg_padding */Block.__(1, [padty])); } if (exit$1 === 1) { switch (padty) { @@ -5096,12 +4563,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 1 : return parse_after_padding(pct_ind$1, str_ind$2, end_ind$1, minus$1, plus$1, sharp$1, space$1, ign$1, /* No_padding */0); case 2 : - return parse_after_padding(pct_ind$1, str_ind$2, end_ind$1, minus$1, plus$1, sharp$1, space$1, ign$1, /* Lit_padding */{ - 0: /* Right */1, - 1: 0, - length: 2, - tag: 0 - }); + return parse_after_padding(pct_ind$1, str_ind$2, end_ind$1, minus$1, plus$1, sharp$1, space$1, ign$1, /* Lit_padding */Block.__(0, [ + /* Right */1, + 0 + ])); } } @@ -5207,35 +4672,23 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (exit === 1) { if (minus !== 0) { if (typeof prec === "number") { - return parse_conv(/* Arg_padding */{ - 0: /* Left */0, - length: 1, - tag: 1 - }); + return parse_conv(/* Arg_padding */Block.__(1, [/* Left */0])); } else { - return parse_conv(/* Lit_padding */{ - 0: /* Left */0, - 1: prec[0], - length: 2, - tag: 0 - }); + return parse_conv(/* Lit_padding */Block.__(0, [ + /* Left */0, + prec[0] + ])); } } else if (typeof prec === "number") { - return parse_conv(/* Arg_padding */{ - 0: /* Right */1, - length: 1, - tag: 1 - }); + return parse_conv(/* Arg_padding */Block.__(1, [/* Right */1])); } else { - return parse_conv(/* Lit_padding */{ - 0: /* Right */1, - 1: prec[0], - length: 2, - tag: 0 - }); + return parse_conv(/* Lit_padding */Block.__(0, [ + /* Right */1, + prec[0] + ])); } } @@ -5258,11 +4711,7 @@ function fmt_ebb_of_string(legacy_behavior, str) { else if (pad.tag) { if (pad[0] >= 2) { if (legacy_behavior$1) { - return /* Arg_padding */{ - 0: /* Right */1, - length: 1, - tag: 1 - }; + return /* Arg_padding */Block.__(1, [/* Right */1]); } else { return incompatible_flag(pct_ind, str_ind, symb, "0"); @@ -5274,12 +4723,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { } else if (pad[0] >= 2) { if (legacy_behavior$1) { - return /* Lit_padding */{ - 0: /* Right */1, - 1: pad[1], - length: 2, - tag: 0 - }; + return /* Lit_padding */Block.__(0, [ + /* Right */1, + pad[1] + ]); } else { return incompatible_flag(pct_ind, str_ind, symb, "0"); @@ -5343,11 +4790,7 @@ function fmt_ebb_of_string(legacy_behavior, str) { switch (symb) { case 33 : var match = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Flush */{ - 0: match[0], - length: 1, - tag: 10 - }]; + fmt_result = /* Fmt_EBB */[/* Flush */Block.__(10, [match[0]])]; break; case 40 : var sub_end = search_subformat_end(str_ind, end_ind, /* ")" */41); @@ -5359,28 +4802,22 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; var ignored_000 = opt_of_pad(/* "_" */95, pad); - var ignored = /* Ignored_format_subst */{ - 0: ignored_000, - 1: sub_fmtty, - length: 2, - tag: 8 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored, - 1: fmt_rest, - length: 2, - tag: 23 - }]; + var ignored = /* Ignored_format_subst */Block.__(8, [ + ignored_000, + sub_fmtty + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored, + fmt_rest + ])]; } else { pad_used = /* true */1; - fmt_result = /* Fmt_EBB */[/* Format_subst */{ - 0: opt_of_pad(/* "(" */40, pad), - 1: sub_fmtty, - 2: fmt_rest, - length: 3, - tag: 14 - }]; + fmt_result = /* Fmt_EBB */[/* Format_subst */Block.__(14, [ + opt_of_pad(/* "(" */40, pad), + sub_fmtty, + fmt_rest + ])]; } break; case 44 : @@ -5393,40 +4830,26 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 67 : var match$3 = parse_literal(str_ind, str_ind, end_ind); var fmt_rest$1 = match$3[0]; - fmt_result = (ign_used[0] = /* true */1, ign) ? /* Fmt_EBB */[/* Ignored_param */{ - 0: /* Ignored_caml_char */1, - 1: fmt_rest$1, - length: 2, - tag: 23 - }] : /* Fmt_EBB */[/* Caml_char */{ - 0: fmt_rest$1, - length: 1, - tag: 1 - }]; + fmt_result = (ign_used[0] = /* true */1, ign) ? /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + /* Ignored_caml_char */1, + fmt_rest$1 + ])] : /* Fmt_EBB */[/* Caml_char */Block.__(1, [fmt_rest$1])]; break; case 78 : var match$4 = parse_literal(str_ind, str_ind, end_ind); var fmt_rest$2 = match$4[0]; if (ign_used[0] = /* true */1, ign) { - var ignored$1 = /* Ignored_scan_get_counter */{ - 0: /* Token_counter */2, - length: 1, - tag: 10 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$1, - 1: fmt_rest$2, - length: 2, - tag: 23 - }]; + var ignored$1 = /* Ignored_scan_get_counter */Block.__(10, [/* Token_counter */2]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$1, + fmt_rest$2 + ])]; } else { - fmt_result = /* Fmt_EBB */[/* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: fmt_rest$2, - length: 2, - tag: 21 - }]; + fmt_result = /* Fmt_EBB */[/* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + fmt_rest$2 + ])]; } break; case 83 : @@ -5436,26 +4859,18 @@ function fmt_ebb_of_string(legacy_behavior, str) { var fmt_rest$3 = match$5[0]; if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; - var ignored$2 = /* Ignored_caml_string */{ - 0: opt_of_pad(/* "_" */95, padprec), - length: 1, - tag: 1 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$2, - 1: fmt_rest$3, - length: 2, - tag: 23 - }]; + var ignored$2 = /* Ignored_caml_string */Block.__(1, [opt_of_pad(/* "_" */95, padprec)]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$2, + fmt_rest$3 + ])]; } else { var match$6 = make_padding_fmt_ebb(pad$1, fmt_rest$3); - fmt_result = /* Fmt_EBB */[/* Caml_string */{ - 0: match$6[0], - 1: match$6[1], - length: 2, - tag: 3 - }]; + fmt_result = /* Fmt_EBB */[/* Caml_string */Block.__(3, [ + match$6[0], + match$6[1] + ])]; } break; case 91 : @@ -5467,28 +4882,22 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; var ignored_000$1 = opt_of_pad(/* "_" */95, pad); - var ignored$3 = /* Ignored_scan_char_set */{ - 0: ignored_000$1, - 1: char_set, - length: 2, - tag: 9 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$3, - 1: fmt_rest$4, - length: 2, - tag: 23 - }]; + var ignored$3 = /* Ignored_scan_char_set */Block.__(9, [ + ignored_000$1, + char_set + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$3, + fmt_rest$4 + ])]; } else { pad_used = /* true */1; - fmt_result = /* Fmt_EBB */[/* Scan_char_set */{ - 0: opt_of_pad(/* "[" */91, pad), - 1: char_set, - 2: fmt_rest$4, - length: 3, - tag: 20 - }]; + fmt_result = /* Fmt_EBB */[/* Scan_char_set */Block.__(20, [ + opt_of_pad(/* "[" */91, pad), + char_set, + fmt_rest$4 + ])]; } break; case 32 : @@ -5500,11 +4909,7 @@ function fmt_ebb_of_string(legacy_behavior, str) { break; case 97 : var match$9 = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Alpha */{ - 0: match$9[0], - length: 1, - tag: 15 - }]; + fmt_result = /* Fmt_EBB */[/* Alpha */Block.__(15, [match$9[0]])]; break; case 66 : case 98 : @@ -5513,36 +4918,24 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 99 : var char_format = function (fmt_rest) { if (ign_used[0] = /* true */1, ign) { - return /* Fmt_EBB */[/* Ignored_param */{ - 0: /* Ignored_char */0, - 1: fmt_rest, - length: 2, - tag: 23 - }]; + return /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + /* Ignored_char */0, + fmt_rest + ])]; } else { - return /* Fmt_EBB */[/* Char */{ - 0: fmt_rest, - length: 1, - tag: 0 - }]; + return /* Fmt_EBB */[/* Char */Block.__(0, [fmt_rest])]; } }; var scan_format = function (fmt_rest) { if (ign_used[0] = /* true */1, ign) { - return /* Fmt_EBB */[/* Ignored_param */{ - 0: /* Ignored_scan_next_char */4, - 1: fmt_rest, - length: 2, - tag: 23 - }]; + return /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + /* Ignored_scan_next_char */4, + fmt_rest + ])]; } else { - return /* Fmt_EBB */[/* Scan_next_char */{ - 0: fmt_rest, - length: 1, - tag: 22 - }]; + return /* Fmt_EBB */[/* Scan_next_char */Block.__(22, [fmt_rest])]; } }; var match$10 = parse_literal(str_ind, str_ind, end_ind); @@ -5571,16 +4964,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 114 : var match$12 = parse_literal(str_ind, str_ind, end_ind); var fmt_rest$6 = match$12[0]; - fmt_result = (ign_used[0] = /* true */1, ign) ? /* Fmt_EBB */[/* Ignored_param */{ - 0: /* Ignored_reader */3, - 1: fmt_rest$6, - length: 2, - tag: 23 - }] : /* Fmt_EBB */[/* Reader */{ - 0: fmt_rest$6, - length: 1, - tag: 19 - }]; + fmt_result = (ign_used[0] = /* true */1, ign) ? /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + /* Ignored_reader */3, + fmt_rest$6 + ])] : /* Fmt_EBB */[/* Reader */Block.__(19, [fmt_rest$6])]; break; case 115 : pad_used = /* true */1; @@ -5589,35 +4976,23 @@ function fmt_ebb_of_string(legacy_behavior, str) { var fmt_rest$7 = match$13[0]; if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; - var ignored$4 = /* Ignored_string */{ - 0: opt_of_pad(/* "_" */95, padprec), - length: 1, - tag: 0 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$4, - 1: fmt_rest$7, - length: 2, - tag: 23 - }]; + var ignored$4 = /* Ignored_string */Block.__(0, [opt_of_pad(/* "_" */95, padprec)]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$4, + fmt_rest$7 + ])]; } else { var match$14 = make_padding_fmt_ebb(pad$2, fmt_rest$7); - fmt_result = /* Fmt_EBB */[/* String */{ - 0: match$14[0], - 1: match$14[1], - length: 2, - tag: 2 - }]; + fmt_result = /* Fmt_EBB */[/* String */Block.__(2, [ + match$14[0], + match$14[1] + ])]; } break; case 116 : var match$15 = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Theta */{ - 0: match$15[0], - length: 1, - tag: 16 - }]; + fmt_result = /* Fmt_EBB */[/* Theta */Block.__(16, [match$15[0]])]; break; case 88 : case 100 : @@ -5726,28 +5101,22 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; var ignored_000$2 = opt_of_pad(/* "_" */95, pad); - var ignored$5 = /* Ignored_format_arg */{ - 0: ignored_000$2, - 1: sub_fmtty$1, - length: 2, - tag: 7 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$5, - 1: fmt_rest$8, - length: 2, - tag: 23 - }]; + var ignored$5 = /* Ignored_format_arg */Block.__(7, [ + ignored_000$2, + sub_fmtty$1 + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$5, + fmt_rest$8 + ])]; } else { pad_used = /* true */1; - fmt_result = /* Fmt_EBB */[/* Format_arg */{ - 0: opt_of_pad(/* "{" */123, pad), - 1: sub_fmtty$1, - 2: fmt_rest$8, - length: 3, - tag: 13 - }]; + fmt_result = /* Fmt_EBB */[/* Format_arg */Block.__(13, [ + opt_of_pad(/* "{" */123, pad), + sub_fmtty$1, + fmt_rest$8 + ])]; } break; @@ -5764,18 +5133,14 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; var ignored_001 = opt_of_pad(/* "_" */95, pad); - var ignored$6 = /* Ignored_int */{ - 0: iconv, - 1: ignored_001, - length: 2, - tag: 2 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$6, - 1: fmt_rest$9, - length: 2, - tag: 23 - }]; + var ignored$6 = /* Ignored_int */Block.__(2, [ + iconv, + ignored_001 + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$6, + fmt_rest$9 + ])]; } else { pad_used = /* true */1; @@ -5792,33 +5157,25 @@ function fmt_ebb_of_string(legacy_behavior, str) { pad$3 = typeof pad === "number" ? /* No_padding */0 : ( pad.tag ? ( pad[0] >= 2 ? ( - legacy_behavior$1 ? /* Arg_padding */{ - 0: /* Right */1, - length: 1, - tag: 1 - } : incompatible_flag(pct_ind, str_ind, /* "0" */48, "precision") + legacy_behavior$1 ? /* Arg_padding */Block.__(1, [/* Right */1]) : incompatible_flag(pct_ind, str_ind, /* "0" */48, "precision") ) : pad ) : ( pad[0] >= 2 ? ( - legacy_behavior$1 ? /* Lit_padding */{ - 0: /* Right */1, - 1: pad[1], - length: 2, - tag: 0 - } : incompatible_flag(pct_ind, str_ind, /* "0" */48, "precision") + legacy_behavior$1 ? /* Lit_padding */Block.__(0, [ + /* Right */1, + pad[1] + ]) : incompatible_flag(pct_ind, str_ind, /* "0" */48, "precision") ) : pad ) ); } var match$19 = make_padprec_fmt_ebb(pad$3, (prec_used[0] = /* true */1, prec), fmt_rest$9); - fmt_result = /* Fmt_EBB */[/* Int */{ - 0: iconv, - 1: match$19[0], - 2: match$19[1], - 3: match$19[2], - length: 4, - tag: 4 - }]; + fmt_result = /* Fmt_EBB */[/* Int */Block.__(4, [ + iconv, + match$19[0], + match$19[1], + match$19[2] + ])]; } break; case 8 : @@ -5827,25 +5184,17 @@ function fmt_ebb_of_string(legacy_behavior, str) { var fmt_rest$10 = match$20[0]; var counter = counter_of_char(symb); if (ign_used[0] = /* true */1, ign) { - var ignored$7 = /* Ignored_scan_get_counter */{ - 0: counter, - length: 1, - tag: 10 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$7, - 1: fmt_rest$10, - length: 2, - tag: 23 - }]; + var ignored$7 = /* Ignored_scan_get_counter */Block.__(10, [counter]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$7, + fmt_rest$10 + ])]; } else { - fmt_result = /* Fmt_EBB */[/* Scan_get_counter */{ - 0: counter, - 1: fmt_rest$10, - length: 2, - tag: 21 - }]; + fmt_result = /* Fmt_EBB */[/* Scan_get_counter */Block.__(21, [ + counter, + fmt_rest$10 + ])]; } } else { @@ -5865,104 +5214,70 @@ function fmt_ebb_of_string(legacy_behavior, str) { pad_used = /* true */1; var ignored_000$3 = opt_of_pad(/* "_" */95, pad); var ignored_001$1 = get_prec_opt(/* () */0); - var ignored$8 = /* Ignored_float */{ - 0: ignored_000$3, - 1: ignored_001$1, - length: 2, - tag: 6 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$8, - 1: fmt_rest$11, - length: 2, - tag: 23 - }]; + var ignored$8 = /* Ignored_float */Block.__(6, [ + ignored_000$3, + ignored_001$1 + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$8, + fmt_rest$11 + ])]; } else { pad_used = /* true */1; var match$22 = make_padprec_fmt_ebb(pad, (prec_used[0] = /* true */1, prec), fmt_rest$11); - fmt_result = /* Fmt_EBB */[/* Float */{ - 0: fconv, - 1: match$22[0], - 2: match$22[1], - 3: match$22[2], - length: 4, - tag: 8 - }]; + fmt_result = /* Fmt_EBB */[/* Float */Block.__(8, [ + fconv, + match$22[0], + match$22[1], + match$22[2] + ])]; } break; case 3 : var match$23 = parse_literal(str_ind, str_ind, end_ind); var fmt_rest$12 = match$23[0]; - fmt_result = (ign_used[0] = /* true */1, ign) ? /* Fmt_EBB */[/* Ignored_param */{ - 0: /* Ignored_bool */2, - 1: fmt_rest$12, - length: 2, - tag: 23 - }] : /* Fmt_EBB */[/* Bool */{ - 0: fmt_rest$12, - length: 1, - tag: 9 - }]; + fmt_result = (ign_used[0] = /* true */1, ign) ? /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + /* Ignored_bool */2, + fmt_rest$12 + ])] : /* Fmt_EBB */[/* Bool */Block.__(9, [fmt_rest$12])]; break; case 4 : var match$24 = parse_literal(str_ind, str_ind, end_ind); - fmt_result = /* Fmt_EBB */[/* Char_literal */{ - 0: symb, - 1: match$24[0], - length: 2, - tag: 12 - }]; + fmt_result = /* Fmt_EBB */[/* Char_literal */Block.__(12, [ + symb, + match$24[0] + ])]; break; case 5 : fmt_result = Curry._3(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": at character number ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", flag ", - 1: /* Caml_char */{ - 0: /* String_literal */{ - 0: " is only allowed after the '", - 1: /* Char_literal */{ - 0: /* "%" */37, - 1: /* String_literal */{ - 0: "', before padding and precision", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 11 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": at character number ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", flag ", + /* Caml_char */Block.__(1, [/* String_literal */Block.__(11, [ + " is only allowed after the '", + /* Char_literal */Block.__(12, [ + /* "%" */37, + /* String_literal */Block.__(11, [ + "', before padding and precision", + /* End_of_format */0 + ]) + ]) + ])]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: at character number %d, flag %C is only allowed after the '%%', before padding and precision" ]), str, pct_ind, symb); break; @@ -5984,30 +5299,24 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; var ignored_001$2 = opt_of_pad(/* "_" */95, pad); - var ignored$9 = /* Ignored_int32 */{ - 0: iconv$1, - 1: ignored_001$2, - length: 2, - tag: 3 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$9, - 1: fmt_rest$13, - length: 2, - tag: 23 - }]; + var ignored$9 = /* Ignored_int32 */Block.__(3, [ + iconv$1, + ignored_001$2 + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$9, + fmt_rest$13 + ])]; } else { pad_used = /* true */1; var match$26 = make_padprec_fmt_ebb(pad, (prec_used[0] = /* true */1, prec), fmt_rest$13); - fmt_result = /* Fmt_EBB */[/* Int32 */{ - 0: iconv$1, - 1: match$26[0], - 2: match$26[1], - 3: match$26[2], - length: 4, - tag: 5 - }]; + fmt_result = /* Fmt_EBB */[/* Int32 */Block.__(5, [ + iconv$1, + match$26[0], + match$26[1], + match$26[2] + ])]; } break; case 1 : @@ -6024,30 +5333,24 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; var ignored_001$3 = opt_of_pad(/* "_" */95, pad); - var ignored$10 = /* Ignored_nativeint */{ - 0: iconv$2, - 1: ignored_001$3, - length: 2, - tag: 4 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$10, - 1: fmt_rest$14, - length: 2, - tag: 23 - }]; + var ignored$10 = /* Ignored_nativeint */Block.__(4, [ + iconv$2, + ignored_001$3 + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$10, + fmt_rest$14 + ])]; } else { pad_used = /* true */1; var match$28 = make_padprec_fmt_ebb(pad, (prec_used[0] = /* true */1, prec), fmt_rest$14); - fmt_result = /* Fmt_EBB */[/* Nativeint */{ - 0: iconv$2, - 1: match$28[0], - 2: match$28[1], - 3: match$28[2], - length: 4, - tag: 6 - }]; + fmt_result = /* Fmt_EBB */[/* Nativeint */Block.__(6, [ + iconv$2, + match$28[0], + match$28[1], + match$28[2] + ])]; } break; @@ -6068,30 +5371,24 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (ign_used[0] = /* true */1, ign) { pad_used = /* true */1; var ignored_001$4 = opt_of_pad(/* "_" */95, pad); - var ignored$11 = /* Ignored_int64 */{ - 0: iconv$3, - 1: ignored_001$4, - length: 2, - tag: 5 - }; - fmt_result = /* Fmt_EBB */[/* Ignored_param */{ - 0: ignored$11, - 1: fmt_rest$15, - length: 2, - tag: 23 - }]; + var ignored$11 = /* Ignored_int64 */Block.__(5, [ + iconv$3, + ignored_001$4 + ]); + fmt_result = /* Fmt_EBB */[/* Ignored_param */Block.__(23, [ + ignored$11, + fmt_rest$15 + ])]; } else { pad_used = /* true */1; var match$30 = make_padprec_fmt_ebb(pad, (prec_used[0] = /* true */1, prec), fmt_rest$15); - fmt_result = /* Fmt_EBB */[/* Int64 */{ - 0: iconv$3, - 1: match$30[0], - 2: match$30[1], - 3: match$30[2], - length: 4, - tag: 7 - }]; + fmt_result = /* Fmt_EBB */[/* Int64 */Block.__(7, [ + iconv$3, + match$30[0], + match$30[1], + match$30[2] + ])]; } } break; @@ -6099,48 +5396,30 @@ function fmt_ebb_of_string(legacy_behavior, str) { } if (exit === 1) { fmt_result = Curry._3(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": at character number ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ', invalid conversion "', - 1: /* Char_literal */{ - 0: /* "%" */37, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* "\"" */34, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": at character number ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ', invalid conversion "', + /* Char_literal */Block.__(12, [ + /* "%" */37, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* "\"" */34, + /* End_of_format */0 + ])]) + ]) + ]) + ]) + ]) + ]) + ]), 'invalid format %S: at character number %d, invalid conversion "%%%c"' ]), str, str_ind - 1 | 0, symb); } @@ -6205,12 +5484,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { }; var parse_after_at = function (str_ind, end_ind) { if (str_ind === end_ind) { - return /* Fmt_EBB */[/* Char_literal */{ - 0: /* "@" */64, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }]; + return /* Fmt_EBB */[/* Char_literal */Block.__(12, [ + /* "@" */64, + /* End_of_format */0 + ])]; } else { var c = str.charCodeAt(str_ind); @@ -6231,12 +5508,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 2 : var beg_ind = str_ind + 1 | 0; var match = parse_literal(beg_ind, beg_ind, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Close_tag */1, - 1: match[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Close_tag */1, + match[0] + ])]; } } @@ -6251,12 +5526,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 2 : var beg_ind$1 = str_ind + 1 | 0; var match$1 = parse_literal(beg_ind$1, beg_ind$1, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Close_box */0, - 1: match$1[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Close_box */0, + match$1[0] + ])]; } } @@ -6270,63 +5543,49 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 0 : var beg_ind$2 = str_ind + 1 | 0; var match$2 = parse_literal(beg_ind$2, beg_ind$2, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Break */{ - 0: "@ ", - 1: 1, - 2: 0, - length: 3, - tag: 0 - }, - 1: match$2[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Break */Block.__(0, [ + "@ ", + 1, + 0 + ]), + match$2[0] + ])]; case 5 : if ((str_ind + 1 | 0) < end_ind && str[str_ind + 1 | 0] === "%") { var beg_ind$3 = str_ind + 2 | 0; var match$3 = parse_literal(beg_ind$3, beg_ind$3, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Escaped_percent */6, - 1: match$3[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Escaped_percent */6, + match$3[0] + ])]; } else { var match$4 = parse_literal(str_ind, str_ind, end_ind); - return /* Fmt_EBB */[/* Char_literal */{ - 0: /* "@" */64, - 1: match$4[0], - length: 2, - tag: 12 - }]; + return /* Fmt_EBB */[/* Char_literal */Block.__(12, [ + /* "@" */64, + match$4[0] + ])]; } break; case 12 : var beg_ind$4 = str_ind + 1 | 0; var match$5 = parse_literal(beg_ind$4, beg_ind$4, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Break */{ - 0: "@,", - 1: 0, - 2: 0, - length: 3, - tag: 0 - }, - 1: match$5[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Break */Block.__(0, [ + "@,", + 0, + 0 + ]), + match$5[0] + ])]; case 14 : var beg_ind$5 = str_ind + 1 | 0; var match$6 = parse_literal(beg_ind$5, beg_ind$5, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Flush_newline */4, - 1: match$6[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Flush_newline */4, + match$6[0] + ])]; case 27 : var str_ind$1 = str_ind + 1 | 0; var end_ind$1 = end_ind; @@ -6366,13 +5625,11 @@ function fmt_ebb_of_string(legacy_behavior, str) { var s = $$String.sub(str, str_ind$1 - 2 | 0, (str_ind_3 - str_ind$1 | 0) + 3 | 0); match$7 = /* tuple */[ str_ind_3 + 1 | 0, - /* Break */{ - 0: s, - 1: width, - 2: 0, - length: 3, - tag: 0 - } + /* Break */Block.__(0, [ + s, + width, + 0 + ]) ]; } } @@ -6388,13 +5645,11 @@ function fmt_ebb_of_string(legacy_behavior, str) { var s$1 = $$String.sub(str, str_ind$1 - 2 | 0, (str_ind_5 - str_ind$1 | 0) + 3 | 0); match$7 = /* tuple */[ str_ind_5 + 1 | 0, - /* Break */{ - 0: s$1, - 1: width, - 2: match$11[1], - length: 3, - tag: 0 - } + /* Break */Block.__(0, [ + s$1, + width, + match$11[1] + ]) ]; } } @@ -6404,25 +5659,21 @@ function fmt_ebb_of_string(legacy_behavior, str) { if (exn === Caml_builtin_exceptions.not_found) { match$7 = /* tuple */[ str_ind$1, - /* Break */{ - 0: "@;", - 1: 1, - 2: 0, - length: 3, - tag: 0 - } + /* Break */Block.__(0, [ + "@;", + 1, + 0 + ]) ]; } else if (exn[0] === Caml_builtin_exceptions.failure) { match$7 = /* tuple */[ str_ind$1, - /* Break */{ - 0: "@;", - 1: 1, - 2: 0, - length: 3, - tag: 0 - } + /* Break */Block.__(0, [ + "@;", + 1, + 0 + ]) ]; } else { @@ -6431,12 +5682,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { } var next_ind = match$7[0]; var match$12 = parse_literal(next_ind, next_ind, end_ind$1); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: match$7[1], - 1: match$12[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + match$7[1], + match$12[0] + ])]; case 28 : var str_ind$2 = str_ind + 1 | 0; var end_ind$2 = end_ind; @@ -6468,12 +5717,10 @@ function fmt_ebb_of_string(legacy_behavior, str) { var s$2 = $$String.sub(str, str_ind$2 - 2 | 0, (str_ind_3$1 - str_ind$2 | 0) + 3 | 0); match$13 = /* Some */[/* tuple */[ str_ind_3$1 + 1 | 0, - /* Magic_size */{ - 0: s$2, - 1: match$15[1], - length: 2, - tag: 1 - } + /* Magic_size */Block.__(1, [ + s$2, + match$15[1] + ]) ]]; } @@ -6493,25 +5740,17 @@ function fmt_ebb_of_string(legacy_behavior, str) { var match$16 = match$13[0]; var next_ind$1 = match$16[0]; var match$17 = parse_literal(next_ind$1, next_ind$1, end_ind$2); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: match$16[1], - 1: match$17[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + match$16[1], + match$17[0] + ])]; } else { var match$18 = parse_literal(str_ind$2, str_ind$2, end_ind$2); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "<" */60, - length: 1, - tag: 2 - }, - 1: match$18[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "<" */60]), + match$18[0] + ])]; } case 1 : case 2 : @@ -6543,21 +5782,17 @@ function fmt_ebb_of_string(legacy_behavior, str) { case 31 : var beg_ind$6 = str_ind + 1 | 0; var match$19 = parse_literal(beg_ind$6, beg_ind$6, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* FFlush */2, - 1: match$19[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* FFlush */2, + match$19[0] + ])]; case 32 : var beg_ind$7 = str_ind + 1 | 0; var match$20 = parse_literal(beg_ind$7, beg_ind$7, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Escaped_at */5, - 1: match$20[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Escaped_at */5, + match$20[0] + ])]; } } @@ -6568,26 +5803,18 @@ function fmt_ebb_of_string(legacy_behavior, str) { else { var beg_ind$8 = str_ind + 1 | 0; var match$21 = parse_literal(beg_ind$8, beg_ind$8, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Force_newline */3, - 1: match$21[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + match$21[0] + ])]; } if (exit === 1) { var beg_ind$9 = str_ind + 1 | 0; var match$22 = parse_literal(beg_ind$9, beg_ind$9, end_ind); - return /* Fmt_EBB */[/* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: c, - length: 1, - tag: 2 - }, - 1: match$22[0], - length: 2, - tag: 17 - }]; + return /* Fmt_EBB */[/* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [c]), + match$22[0] + ])]; } } @@ -6641,21 +5868,11 @@ function fmt_ebb_of_string(legacy_behavior, str) { sub_fmt, sub_str ]; - var formatting = is_open_tag ? /* Open_tag */{ - 0: sub_format, - length: 1, - tag: 0 - } : (check_open_box(sub_fmt), /* Open_box */{ - 0: sub_format, - length: 1, - tag: 1 - }); - return /* Fmt_EBB */[/* Formatting_gen */{ - 0: formatting, - 1: match$1[0], - length: 2, - tag: 18 - }]; + var formatting = is_open_tag ? /* Open_tag */Block.__(0, [sub_format]) : (check_open_box(sub_fmt), /* Open_box */Block.__(1, [sub_format])); + return /* Fmt_EBB */[/* Formatting_gen */Block.__(18, [ + formatting, + match$1[0] + ])]; } } catch (exn){ @@ -6665,21 +5882,11 @@ function fmt_ebb_of_string(legacy_behavior, str) { /* End_of_format */0, "" ]; - var formatting$1 = is_open_tag ? /* Open_tag */{ - 0: sub_format$1, - length: 1, - tag: 0 - } : /* Open_box */{ - 0: sub_format$1, - length: 1, - tag: 1 - }; - return /* Fmt_EBB */[/* Formatting_gen */{ - 0: formatting$1, - 1: match$3[0], - length: 2, - tag: 18 - }]; + var formatting$1 = is_open_tag ? /* Open_tag */Block.__(0, [sub_format$1]) : /* Open_box */Block.__(1, [sub_format$1]); + return /* Fmt_EBB */[/* Formatting_gen */Block.__(18, [ + formatting$1, + match$3[0] + ])]; } else { throw exn; @@ -6699,59 +5906,39 @@ function fmt_ebb_of_string(legacy_behavior, str) { }; var fail_single_percent = function (str_ind) { return Curry._2(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": '", - 1: /* Char_literal */{ - 0: /* "%" */37, - 1: /* String_literal */{ - 0: "' alone is not accepted in character sets, use ", - 1: /* Char_literal */{ - 0: /* "%" */37, - 1: /* Char_literal */{ - 0: /* "%" */37, - 1: /* String_literal */{ - 0: " instead at position ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "." */46, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": '", + /* Char_literal */Block.__(12, [ + /* "%" */37, + /* String_literal */Block.__(11, [ + "' alone is not accepted in character sets, use ", + /* Char_literal */Block.__(12, [ + /* "%" */37, + /* Char_literal */Block.__(12, [ + /* "%" */37, + /* String_literal */Block.__(11, [ + " instead at position ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "." */46, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: '%%' alone is not accepted in character sets, use %%%% instead at position %d." ]), str, str_ind); }; @@ -6934,41 +6121,29 @@ function fmt_ebb_of_string(legacy_behavior, str) { var new_acc = Caml_int32.imul(acc, 10) + (c - /* "0" */48 | 0) | 0; if (new_acc > Sys.max_string_length) { return Curry._3(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": integer ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " is greater than the limit ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": integer ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " is greater than the limit ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: integer %d is greater than the limit %d" ]), str, new_acc, Sys.max_string_length); } @@ -7032,20 +6207,16 @@ function fmt_ebb_of_string(legacy_behavior, str) { var size = str_ind - lit_start | 0; if (size !== 0) { if (size !== 1) { - return /* Fmt_EBB */[/* String_literal */{ - 0: $$String.sub(str, lit_start, size), - 1: fmt, - length: 2, - tag: 11 - }]; + return /* Fmt_EBB */[/* String_literal */Block.__(11, [ + $$String.sub(str, lit_start, size), + fmt + ])]; } else { - return /* Fmt_EBB */[/* Char_literal */{ - 0: str.charCodeAt(lit_start), - 1: fmt, - length: 2, - tag: 12 - }]; + return /* Fmt_EBB */[/* Char_literal */Block.__(12, [ + str.charCodeAt(lit_start), + fmt + ])]; } } else { @@ -7057,43 +6228,27 @@ function fmt_ebb_of_string(legacy_behavior, str) { var str_ind = _str_ind; if (str_ind === end_ind) { Curry._3(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ': unclosed sub-format, expected "', - 1: /* Char_literal */{ - 0: /* "%" */37, - 1: /* Char */{ - 0: /* String_literal */{ - 0: '" at character number ', - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ': unclosed sub-format, expected "', + /* Char_literal */Block.__(12, [ + /* "%" */37, + /* Char */Block.__(0, [/* String_literal */Block.__(11, [ + '" at character number ', + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ])]) + ]) + ]) + ]) + ]), 'invalid format %S: unclosed sub-format, expected "%%%c" at character number %d' ]), str, c, end_ind); } @@ -7665,58 +6820,36 @@ function fmt_ebb_of_string(legacy_behavior, str) { var incompatible_flag = function (pct_ind, str_ind, symb, option) { var subfmt = $$String.sub(str, pct_ind, str_ind - pct_ind | 0); return Curry._5(failwith_message(/* Format */[ - /* String_literal */{ - 0: "invalid format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ": at character number ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " is incompatible with '", - 1: /* Char */{ - 0: /* String_literal */{ - 0: "' in sub-format ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ": at character number ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " is incompatible with '", + /* Char */Block.__(0, [/* String_literal */Block.__(11, [ + "' in sub-format ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ])]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), "invalid format %S: at character number %d, %s is incompatible with '%c' in sub-format %S" ]), str, pct_ind, option, symb, subfmt); }; @@ -7734,27 +6867,19 @@ function format_of_string_fmtty(str, fmtty) { catch (exn){ if (exn === Type_mismatch) { return Curry._2(failwith_message(/* Format */[ - /* String_literal */{ - 0: "bad input: format type mismatch between ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " and ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "bad input: format type mismatch between ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " and ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), "bad input: format type mismatch between %S and %S" ]), str, string_of_fmtty(fmtty)); } @@ -7775,27 +6900,19 @@ function format_of_string_format(str, param) { catch (exn){ if (exn === Type_mismatch) { return Curry._2(failwith_message(/* Format */[ - /* String_literal */{ - 0: "bad input: format type mismatch between ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " and ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "bad input: format type mismatch between ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " and ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), "bad input: format type mismatch between %S and %S" ]), str, param[1]); } diff --git a/jscomp/stdlib/camlinternalFormatBasics.js b/jscomp/stdlib/camlinternalFormatBasics.js index f5c9068c78..3f1e4c7585 100644 --- a/jscomp/stdlib/camlinternalFormatBasics.js +++ b/jscomp/stdlib/camlinternalFormatBasics.js @@ -1,6 +1,7 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); function erase_rel(param) { if (typeof param === "number") { @@ -9,99 +10,43 @@ function erase_rel(param) { else { switch (param.tag | 0) { case 0 : - return /* Char_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 0 - }; + return /* Char_ty */Block.__(0, [erase_rel(param[0])]); case 1 : - return /* String_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 1 - }; + return /* String_ty */Block.__(1, [erase_rel(param[0])]); case 2 : - return /* Int_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 2 - }; + return /* Int_ty */Block.__(2, [erase_rel(param[0])]); case 3 : - return /* Int32_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 3 - }; + return /* Int32_ty */Block.__(3, [erase_rel(param[0])]); case 4 : - return /* Nativeint_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 4 - }; + return /* Nativeint_ty */Block.__(4, [erase_rel(param[0])]); case 5 : - return /* Int64_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 5 - }; + return /* Int64_ty */Block.__(5, [erase_rel(param[0])]); case 6 : - return /* Float_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 6 - }; + return /* Float_ty */Block.__(6, [erase_rel(param[0])]); case 7 : - return /* Bool_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 7 - }; + return /* Bool_ty */Block.__(7, [erase_rel(param[0])]); case 8 : - return /* Format_arg_ty */{ - 0: param[0], - 1: erase_rel(param[1]), - length: 2, - tag: 8 - }; + return /* Format_arg_ty */Block.__(8, [ + param[0], + erase_rel(param[1]) + ]); case 9 : var ty1 = param[0]; - return /* Format_subst_ty */{ - 0: ty1, - 1: ty1, - 2: erase_rel(param[2]), - length: 3, - tag: 9 - }; + return /* Format_subst_ty */Block.__(9, [ + ty1, + ty1, + erase_rel(param[2]) + ]); case 10 : - return /* Alpha_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 10 - }; + return /* Alpha_ty */Block.__(10, [erase_rel(param[0])]); case 11 : - return /* Theta_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 11 - }; + return /* Theta_ty */Block.__(11, [erase_rel(param[0])]); case 12 : - return /* Any_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 12 - }; + return /* Any_ty */Block.__(12, [erase_rel(param[0])]); case 13 : - return /* Reader_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 13 - }; + return /* Reader_ty */Block.__(13, [erase_rel(param[0])]); case 14 : - return /* Ignored_reader_ty */{ - 0: erase_rel(param[0]), - length: 1, - tag: 14 - }; + return /* Ignored_reader_ty */Block.__(14, [erase_rel(param[0])]); } } @@ -114,98 +59,42 @@ function concat_fmtty(fmtty1, fmtty2) { else { switch (fmtty1.tag | 0) { case 0 : - return /* Char_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 0 - }; + return /* Char_ty */Block.__(0, [concat_fmtty(fmtty1[0], fmtty2)]); case 1 : - return /* String_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 1 - }; + return /* String_ty */Block.__(1, [concat_fmtty(fmtty1[0], fmtty2)]); case 2 : - return /* Int_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 2 - }; + return /* Int_ty */Block.__(2, [concat_fmtty(fmtty1[0], fmtty2)]); case 3 : - return /* Int32_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 3 - }; + return /* Int32_ty */Block.__(3, [concat_fmtty(fmtty1[0], fmtty2)]); case 4 : - return /* Nativeint_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 4 - }; + return /* Nativeint_ty */Block.__(4, [concat_fmtty(fmtty1[0], fmtty2)]); case 5 : - return /* Int64_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 5 - }; + return /* Int64_ty */Block.__(5, [concat_fmtty(fmtty1[0], fmtty2)]); case 6 : - return /* Float_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 6 - }; + return /* Float_ty */Block.__(6, [concat_fmtty(fmtty1[0], fmtty2)]); case 7 : - return /* Bool_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 7 - }; + return /* Bool_ty */Block.__(7, [concat_fmtty(fmtty1[0], fmtty2)]); case 8 : - return /* Format_arg_ty */{ - 0: fmtty1[0], - 1: concat_fmtty(fmtty1[1], fmtty2), - length: 2, - tag: 8 - }; + return /* Format_arg_ty */Block.__(8, [ + fmtty1[0], + concat_fmtty(fmtty1[1], fmtty2) + ]); case 9 : - return /* Format_subst_ty */{ - 0: fmtty1[0], - 1: fmtty1[1], - 2: concat_fmtty(fmtty1[2], fmtty2), - length: 3, - tag: 9 - }; + return /* Format_subst_ty */Block.__(9, [ + fmtty1[0], + fmtty1[1], + concat_fmtty(fmtty1[2], fmtty2) + ]); case 10 : - return /* Alpha_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 10 - }; + return /* Alpha_ty */Block.__(10, [concat_fmtty(fmtty1[0], fmtty2)]); case 11 : - return /* Theta_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 11 - }; + return /* Theta_ty */Block.__(11, [concat_fmtty(fmtty1[0], fmtty2)]); case 12 : - return /* Any_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 12 - }; + return /* Any_ty */Block.__(12, [concat_fmtty(fmtty1[0], fmtty2)]); case 13 : - return /* Reader_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 13 - }; + return /* Reader_ty */Block.__(13, [concat_fmtty(fmtty1[0], fmtty2)]); case 14 : - return /* Ignored_reader_ty */{ - 0: concat_fmtty(fmtty1[0], fmtty2), - length: 1, - tag: 14 - }; + return /* Ignored_reader_ty */Block.__(14, [concat_fmtty(fmtty1[0], fmtty2)]); } } @@ -218,186 +107,120 @@ function concat_fmt(fmt1, fmt2) { else { switch (fmt1.tag | 0) { case 0 : - return /* Char */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 0 - }; + return /* Char */Block.__(0, [concat_fmt(fmt1[0], fmt2)]); case 1 : - return /* Caml_char */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 1 - }; + return /* Caml_char */Block.__(1, [concat_fmt(fmt1[0], fmt2)]); case 2 : - return /* String */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 2 - }; + return /* String */Block.__(2, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 3 : - return /* Caml_string */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 3 - }; + return /* Caml_string */Block.__(3, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 4 : - return /* Int */{ - 0: fmt1[0], - 1: fmt1[1], - 2: fmt1[2], - 3: concat_fmt(fmt1[3], fmt2), - length: 4, - tag: 4 - }; + return /* Int */Block.__(4, [ + fmt1[0], + fmt1[1], + fmt1[2], + concat_fmt(fmt1[3], fmt2) + ]); case 5 : - return /* Int32 */{ - 0: fmt1[0], - 1: fmt1[1], - 2: fmt1[2], - 3: concat_fmt(fmt1[3], fmt2), - length: 4, - tag: 5 - }; + return /* Int32 */Block.__(5, [ + fmt1[0], + fmt1[1], + fmt1[2], + concat_fmt(fmt1[3], fmt2) + ]); case 6 : - return /* Nativeint */{ - 0: fmt1[0], - 1: fmt1[1], - 2: fmt1[2], - 3: concat_fmt(fmt1[3], fmt2), - length: 4, - tag: 6 - }; + return /* Nativeint */Block.__(6, [ + fmt1[0], + fmt1[1], + fmt1[2], + concat_fmt(fmt1[3], fmt2) + ]); case 7 : - return /* Int64 */{ - 0: fmt1[0], - 1: fmt1[1], - 2: fmt1[2], - 3: concat_fmt(fmt1[3], fmt2), - length: 4, - tag: 7 - }; + return /* Int64 */Block.__(7, [ + fmt1[0], + fmt1[1], + fmt1[2], + concat_fmt(fmt1[3], fmt2) + ]); case 8 : - return /* Float */{ - 0: fmt1[0], - 1: fmt1[1], - 2: fmt1[2], - 3: concat_fmt(fmt1[3], fmt2), - length: 4, - tag: 8 - }; + return /* Float */Block.__(8, [ + fmt1[0], + fmt1[1], + fmt1[2], + concat_fmt(fmt1[3], fmt2) + ]); case 9 : - return /* Bool */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 9 - }; + return /* Bool */Block.__(9, [concat_fmt(fmt1[0], fmt2)]); case 10 : - return /* Flush */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 10 - }; + return /* Flush */Block.__(10, [concat_fmt(fmt1[0], fmt2)]); case 11 : - return /* String_literal */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 11 - }; + return /* String_literal */Block.__(11, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 12 : - return /* Char_literal */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 12 - }; + return /* Char_literal */Block.__(12, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 13 : - return /* Format_arg */{ - 0: fmt1[0], - 1: fmt1[1], - 2: concat_fmt(fmt1[2], fmt2), - length: 3, - tag: 13 - }; + return /* Format_arg */Block.__(13, [ + fmt1[0], + fmt1[1], + concat_fmt(fmt1[2], fmt2) + ]); case 14 : - return /* Format_subst */{ - 0: fmt1[0], - 1: fmt1[1], - 2: concat_fmt(fmt1[2], fmt2), - length: 3, - tag: 14 - }; + return /* Format_subst */Block.__(14, [ + fmt1[0], + fmt1[1], + concat_fmt(fmt1[2], fmt2) + ]); case 15 : - return /* Alpha */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 15 - }; + return /* Alpha */Block.__(15, [concat_fmt(fmt1[0], fmt2)]); case 16 : - return /* Theta */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 16 - }; + return /* Theta */Block.__(16, [concat_fmt(fmt1[0], fmt2)]); case 17 : - return /* Formatting_lit */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 17 - }; + return /* Formatting_lit */Block.__(17, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 18 : - return /* Formatting_gen */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 18 - }; + return /* Formatting_gen */Block.__(18, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 19 : - return /* Reader */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 19 - }; + return /* Reader */Block.__(19, [concat_fmt(fmt1[0], fmt2)]); case 20 : - return /* Scan_char_set */{ - 0: fmt1[0], - 1: fmt1[1], - 2: concat_fmt(fmt1[2], fmt2), - length: 3, - tag: 20 - }; + return /* Scan_char_set */Block.__(20, [ + fmt1[0], + fmt1[1], + concat_fmt(fmt1[2], fmt2) + ]); case 21 : - return /* Scan_get_counter */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 21 - }; + return /* Scan_get_counter */Block.__(21, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 22 : - return /* Scan_next_char */{ - 0: concat_fmt(fmt1[0], fmt2), - length: 1, - tag: 22 - }; + return /* Scan_next_char */Block.__(22, [concat_fmt(fmt1[0], fmt2)]); case 23 : - return /* Ignored_param */{ - 0: fmt1[0], - 1: concat_fmt(fmt1[1], fmt2), - length: 2, - tag: 23 - }; + return /* Ignored_param */Block.__(23, [ + fmt1[0], + concat_fmt(fmt1[1], fmt2) + ]); case 24 : - return /* Custom */{ - 0: fmt1[0], - 1: fmt1[1], - 2: concat_fmt(fmt1[2], fmt2), - length: 3, - tag: 24 - }; + return /* Custom */Block.__(24, [ + fmt1[0], + fmt1[1], + concat_fmt(fmt1[2], fmt2) + ]); } } diff --git a/jscomp/stdlib/filename.js b/jscomp/stdlib/filename.js index ad690bd26c..9236298926 100644 --- a/jscomp/stdlib/filename.js +++ b/jscomp/stdlib/filename.js @@ -5,6 +5,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var CamlinternalLazy = require("./camlinternalLazy"); var Caml_sys = require("../runtime/caml_sys"); var Pervasives = require("./pervasives"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("./printf"); var Caml_primitive = require("../runtime/caml_primitive"); @@ -233,13 +234,9 @@ function chop_extension(name) { }; } -var prng = { - 0: function () { - return Curry._1(Random.State[/* make_self_init */1], /* () */0); - }, - length: 1, - tag: 246 -}; +var prng = Block.__(246, [function () { + return Curry._1(Random.State[/* make_self_init */1], /* () */0); + }]); function temp_file_name(temp_dir, prefix, suffix) { var tag = prng.tag | 0; @@ -247,29 +244,21 @@ function temp_file_name(temp_dir, prefix, suffix) { tag === 246 ? CamlinternalLazy.force_lazy_block(prng) : prng )) & 16777215; return concat(temp_dir, Curry._3(Printf.sprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Int */{ - 0: /* Int_x */6, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 6, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Int */Block.__(4, [ + /* Int_x */6, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 6 + ]), + /* No_precision */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s%06x%s" ]), prefix, rnd, suffix)); } diff --git a/jscomp/stdlib/format.js b/jscomp/stdlib/format.js index ae9d884879..a96d49b8c5 100644 --- a/jscomp/stdlib/format.js +++ b/jscomp/stdlib/format.js @@ -7,6 +7,7 @@ var Bytes = require("./bytes"); var Caml_io = require("../runtime/caml_io"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Pervasives = require("./pervasives"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Buffer = require("./buffer"); var $$String = require("./string"); @@ -371,22 +372,14 @@ function enqueue_advance(state, tok) { function enqueue_string_as(state, size, s) { return enqueue_advance(state, /* record */[ size, - /* Pp_text */{ - 0: s, - length: 1, - tag: 0 - }, + /* Pp_text */Block.__(0, [s]), size ]); } var q_elem = /* record */[ -1, - /* Pp_text */{ - 0: "", - length: 1, - tag: 0 - }, + /* Pp_text */Block.__(0, [""]), 0 ]; @@ -474,12 +467,10 @@ function pp_open_box_gen(state, indent, br_ty) { if (state[/* pp_curr_depth */13] < state[/* pp_max_boxes */14]) { var elem = /* record */[ -state[/* pp_right_total */12], - /* Pp_begin */{ - 0: indent, - 1: br_ty, - length: 2, - tag: 3 - }, + /* Pp_begin */Block.__(3, [ + indent, + br_ty + ]), 0 ]; return scan_push(state, /* false */0, elem); @@ -525,11 +516,7 @@ function pp_open_tag(state, tag_name) { if (state[/* pp_mark_tags */21]) { return pp_enqueue(state, /* record */[ 0, - /* Pp_open_tag */{ - 0: tag_name, - length: 1, - tag: 5 - }, + /* Pp_open_tag */Block.__(5, [tag_name]), 0 ]); } @@ -719,12 +706,10 @@ function pp_print_break(state, width, offset) { if (state[/* pp_curr_depth */13] < state[/* pp_max_boxes */14]) { var elem = /* record */[ -state[/* pp_right_total */12], - /* Pp_break */{ - 0: width, - 1: offset, - length: 2, - tag: 1 - }, + /* Pp_break */Block.__(1, [ + width, + offset + ]), width ]; return scan_push(state, /* true */1, elem); @@ -747,11 +732,7 @@ function pp_open_tbox(state, _) { if (state[/* pp_curr_depth */13] < state[/* pp_max_boxes */14]) { var elem = /* record */[ 0, - /* Pp_tbegin */{ - 0: /* Pp_tbox */[[/* [] */0]], - length: 1, - tag: 4 - }, + /* Pp_tbegin */Block.__(4, [/* Pp_tbox */[[/* [] */0]]]), 0 ]; return enqueue_advance(state, elem); @@ -786,12 +767,10 @@ function pp_print_tbreak(state, width, offset) { if (state[/* pp_curr_depth */13] < state[/* pp_max_boxes */14]) { var elem = /* record */[ -state[/* pp_right_total */12], - /* Pp_tbreak */{ - 0: width, - 1: offset, - length: 2, - tag: 2 - }, + /* Pp_tbreak */Block.__(2, [ + width, + offset + ]), width ]; return scan_push(state, /* true */1, elem); @@ -1060,12 +1039,10 @@ function pp_make_formatter(f, g, h, i) { ]; var sys_tok = /* record */[ -1, - /* Pp_begin */{ - 0: 0, - 1: /* Pp_hovbox */3, - length: 2, - tag: 3 - }, + /* Pp_begin */Block.__(3, [ + 0, + /* Pp_hovbox */3 + ]), 0 ]; add_queue(sys_tok, pp_q); diff --git a/jscomp/stdlib/gc.js b/jscomp/stdlib/gc.js index 473601879e..841967d708 100644 --- a/jscomp/stdlib/gc.js +++ b/jscomp/stdlib/gc.js @@ -1,6 +1,7 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); var Caml_gc = require("../runtime/caml_gc"); var Sys = require("./sys"); var Curry = require("../runtime/curry"); @@ -9,318 +10,228 @@ var Printf = require("./printf"); function print_stat(c) { var st = Caml_gc.caml_gc_stat(/* () */0); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "minor_words: ", - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* Lit_precision */[0], - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "minor_words: ", + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* Lit_precision */[0], + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "minor_words: %.0f\n" ]), st[/* minor_words */0]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "promoted_words: ", - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* Lit_precision */[0], - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "promoted_words: ", + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* Lit_precision */[0], + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "promoted_words: %.0f\n" ]), st[/* promoted_words */1]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "major_words: ", - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* Lit_precision */[0], - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "major_words: ", + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* Lit_precision */[0], + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "major_words: %.0f\n" ]), st[/* major_words */2]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "minor_collections: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "minor_collections: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "minor_collections: %d\n" ]), st[/* minor_collections */3]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "major_collections: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "major_collections: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "major_collections: %d\n" ]), st[/* major_collections */4]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "heap_words: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "heap_words: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "heap_words: %d\n" ]), st[/* heap_words */5]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "heap_chunks: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "heap_chunks: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "heap_chunks: %d\n" ]), st[/* heap_chunks */6]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "top_heap_words: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "top_heap_words: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "top_heap_words: %d\n" ]), st[/* top_heap_words */14]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "live_words: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "live_words: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "live_words: %d\n" ]), st[/* live_words */7]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "live_blocks: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "live_blocks: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "live_blocks: %d\n" ]), st[/* live_blocks */8]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "free_words: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "free_words: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "free_words: %d\n" ]), st[/* free_words */9]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "free_blocks: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "free_blocks: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "free_blocks: %d\n" ]), st[/* free_blocks */10]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "largest_free: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "largest_free: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "largest_free: %d\n" ]), st[/* largest_free */11]); Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "fragments: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "fragments: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "fragments: %d\n" ]), st[/* fragments */12]); return Curry._1(Printf.fprintf(c, /* Format */[ - /* String_literal */{ - 0: "compactions: ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "compactions: ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "compactions: %d\n" ]), st[/* compactions */13]); } diff --git a/jscomp/stdlib/genlex.js b/jscomp/stdlib/genlex.js index bfa79472d8..62d9887834 100644 --- a/jscomp/stdlib/genlex.js +++ b/jscomp/stdlib/genlex.js @@ -7,6 +7,7 @@ var Hashtbl = require("./hashtbl"); var Stream = require("./stream"); var Caml_format = require("../runtime/caml_format"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Char = require("./char"); var Caml_string = require("../runtime/caml_string"); var List = require("./list"); @@ -42,11 +43,7 @@ function get_string() { function make_lexer(keywords) { var kwd_table = Hashtbl.create(/* None */0, 17); List.iter(function (s) { - return Hashtbl.add(kwd_table, s, /* Kwd */{ - 0: s, - length: 1, - tag: 0 - }); + return Hashtbl.add(kwd_table, s, /* Kwd */Block.__(0, [s])); }, keywords); var ident_or_keyword = function (id) { try { @@ -54,11 +51,7 @@ function make_lexer(keywords) { } catch (exn){ if (exn === Caml_builtin_exceptions.not_found) { - return /* Ident */{ - 0: id, - length: 1, - tag: 1 - }; + return /* Ident */Block.__(1, [id]); } else { throw exn; @@ -107,11 +100,7 @@ function make_lexer(keywords) { case 34 : Stream.junk(strm__); reset_buffer(/* () */0); - return /* Some */[/* String */{ - 0: string(strm__), - length: 1, - tag: 4 - }]; + return /* Some */[/* String */Block.__(4, [string(strm__)])]; case 39 : Stream.junk(strm__); var c$1; @@ -139,11 +128,7 @@ function make_lexer(keywords) { } else { Stream.junk(strm__); - return /* Some */[/* Char */{ - 0: c$1, - length: 1, - tag: 5 - }]; + return /* Some */[/* Char */Block.__(5, [c$1])]; } } else { @@ -520,11 +505,7 @@ function make_lexer(keywords) { exit$1 = 1; } if (exit$1 === 1) { - return /* Some */[/* Float */{ - 0: Caml_format.caml_float_of_string(get_string(/* () */0)), - length: 1, - tag: 3 - }]; + return /* Some */[/* Float */Block.__(3, [Caml_format.caml_float_of_string(get_string(/* () */0))])]; } }; @@ -534,11 +515,7 @@ function make_lexer(keywords) { exit = 1; } if (exit === 1) { - return /* Some */[/* Int */{ - 0: Caml_format.caml_int_of_string(get_string(/* () */0)), - length: 1, - tag: 2 - }]; + return /* Some */[/* Int */Block.__(2, [Caml_format.caml_int_of_string(get_string(/* () */0))])]; } }; @@ -573,11 +550,7 @@ function make_lexer(keywords) { if (match) { var c = match[0]; if (c > 57 || c < 48) { - return /* Some */[/* Float */{ - 0: Caml_format.caml_float_of_string(get_string(/* () */0)), - length: 1, - tag: 3 - }]; + return /* Some */[/* Float */Block.__(3, [Caml_format.caml_float_of_string(get_string(/* () */0))])]; } else { Stream.junk(strm__); @@ -587,11 +560,7 @@ function make_lexer(keywords) { } } else { - return /* Some */[/* Float */{ - 0: Caml_format.caml_float_of_string(get_string(/* () */0)), - length: 1, - tag: 3 - }]; + return /* Some */[/* Float */Block.__(3, [Caml_format.caml_float_of_string(get_string(/* () */0))])]; } }; }; diff --git a/jscomp/stdlib/hashtbl.js b/jscomp/stdlib/hashtbl.js index a6476452d0..a495847b15 100644 --- a/jscomp/stdlib/hashtbl.js +++ b/jscomp/stdlib/hashtbl.js @@ -7,6 +7,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var CamlinternalLazy = require("./camlinternalLazy"); var Caml_sys = require("../runtime/caml_sys"); var Pervasives = require("./pervasives"); +var Block = require("../runtime/block"); var Sys = require("./sys"); var Curry = require("../runtime/curry"); var Caml_primitive = require("../runtime/caml_primitive"); @@ -51,13 +52,9 @@ function randomize() { return /* () */0; } -var prng = { - 0: function () { - return Curry._1(Random.State[/* make_self_init */1], /* () */0); - }, - length: 1, - tag: 246 -}; +var prng = Block.__(246, [function () { + return Curry._1(Random.State[/* make_self_init */1], /* () */0); + }]); function power_2_above(_x, n) { while(true) { diff --git a/jscomp/stdlib/lazy.js b/jscomp/stdlib/lazy.js index 7307eb6023..ef78e3eb6c 100644 --- a/jscomp/stdlib/lazy.js +++ b/jscomp/stdlib/lazy.js @@ -4,13 +4,10 @@ var Caml_obj = require("../runtime/caml_obj"); var Obj = require("./obj"); var CamlinternalLazy = require("./camlinternalLazy"); +var Block = require("../runtime/block"); function from_fun(f) { - var x = { - 0: 0, - length: 1, - tag: Obj.lazy_tag - }; + var x = Block.__(Obj.lazy_tag, [0]); x[0] = f; return x; } diff --git a/jscomp/stdlib/printexc.js b/jscomp/stdlib/printexc.js index 78303dfd42..cd0f8dd9d5 100644 --- a/jscomp/stdlib/printexc.js +++ b/jscomp/stdlib/printexc.js @@ -6,6 +6,7 @@ var Caml_io = require("../runtime/caml_io"); var Obj = require("./obj"); var Pervasives = require("./pervasives"); var Caml_backtrace = require("../runtime/caml_backtrace"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("./printf"); var $$Array = require("./array"); @@ -14,63 +15,43 @@ var Buffer = require("./buffer"); var printers = [/* [] */0]; var locfmt = /* Format */[ - /* String_literal */{ - 0: 'File "', - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: '", line ', - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", characters ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "-" */45, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ": ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + 'File "', + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + '", line ', + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", characters ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "-" */45, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ": ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), 'File "%s", line %d, characters %d-%d: %s' ]; @@ -78,25 +59,21 @@ function field(x, i) { var f = x[i]; if (f.length === undefined) { return Curry._1(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%d" ]), f); } else if ((f.tag | 0) === Obj.string_tag) { return Curry._1(Printf.sprintf(/* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), f); } @@ -114,22 +91,16 @@ function other_fields(x, i) { } else { return Curry._2(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: ", ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + ", ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), ", %s%s" ]), field(x, i), other_fields(x, i + 1 | 0)); } @@ -139,27 +110,19 @@ function fields(x) { var n = x.length; if (n > 2 || n < 0) { return Curry._2(Printf.sprintf(/* Format */[ - /* Char_literal */{ - 0: /* "(" */40, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "(" */40, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]) + ]), "(%s%s)" ]), field(x, 1), other_fields(x, 2)); } @@ -170,22 +133,16 @@ function fields(x) { return ""; case 2 : return Curry._1(Printf.sprintf(/* Format */[ - /* Char_literal */{ - 0: /* "(" */40, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "(" */40, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "(%s)" ]), field(x, 1)); @@ -251,22 +208,16 @@ function print(fct, arg) { } catch (x){ Curry._1(Printf.eprintf(/* Format */[ - /* String_literal */{ - 0: "Uncaught exception: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Uncaught exception: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "Uncaught exception: %s\n" ]), to_string(x)); Caml_io.caml_ml_flush(Pervasives.stderr); @@ -281,22 +232,16 @@ function $$catch(fct, arg) { catch (x){ Caml_io.caml_ml_flush(Pervasives.stdout); Curry._1(Printf.eprintf(/* Format */[ - /* String_literal */{ - 0: "Uncaught exception: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Uncaught exception: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "Uncaught exception: %s\n" ]), to_string(x)); return Pervasives.exit(2); @@ -340,75 +285,53 @@ function format_backtrace_slot(pos, slot) { } else { return /* Some */[Curry._1(Printf.sprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " unknown location", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " unknown location", + /* End_of_format */0 + ]) + ]), "%s unknown location" ]), info(/* false */0))]; } } else { return /* Some */[Curry._5(Printf.sprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ' file "', - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: '", line ', - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ", characters ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "-" */45, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ' file "', + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + '", line ', + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ", characters ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "-" */45, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), '%s file "%s", line %d, characters %d-%d' ]), info(slot[0]), slot[1], slot[2], slot[3], slot[4])]; } @@ -423,17 +346,13 @@ function print_raw_backtrace(outchan, raw_backtrace) { var match = format_backtrace_slot(i, a[i]); if (match) { Curry._1(Printf.fprintf(outchan$1, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%s\n" ]), match[0]); } @@ -443,12 +362,10 @@ function print_raw_backtrace(outchan, raw_backtrace) { } else { return Printf.fprintf(outchan$1, /* Format */[ - /* String_literal */{ - 0: "(Program not linked with -g, cannot print stack backtrace)\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "(Program not linked with -g, cannot print stack backtrace)\n", + /* End_of_format */0 + ]), "(Program not linked with -g, cannot print stack backtrace)\n" ]); } @@ -466,17 +383,13 @@ function backtrace_to_string(backtrace) { var match = format_backtrace_slot(i, a[i]); if (match) { Curry._1(Printf.bprintf(b, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%s\n" ]), match[0]); } diff --git a/jscomp/stdlib/scanf.js b/jscomp/stdlib/scanf.js index 9cc7877bfd..dbd147e3c0 100644 --- a/jscomp/stdlib/scanf.js +++ b/jscomp/stdlib/scanf.js @@ -7,6 +7,7 @@ var Pervasives = require("./pervasives"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Caml_format = require("../runtime/caml_format"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("./printf"); var Caml_primitive = require("../runtime/caml_primitive"); @@ -188,12 +189,10 @@ function from_ic(scan_close_ic, iname, ic) { return create(iname, next); } -var stdin = from_ic(scan_raise_at_end, /* From_file */{ - 0: "-", - 1: Pervasives.stdin, - length: 2, - tag: 0 - }, Pervasives.stdin); +var stdin = from_ic(scan_raise_at_end, /* From_file */Block.__(0, [ + "-", + Pervasives.stdin + ]), Pervasives.stdin); function open_in(fname) { if (fname === "-") { @@ -201,12 +200,10 @@ function open_in(fname) { } else { var ic = Pervasives.open_in(fname); - return from_ic(scan_close_at_end, /* From_file */{ - 0: fname, - 1: ic, - length: 2, - tag: 0 - }, ic); + return from_ic(scan_close_at_end, /* From_file */Block.__(0, [ + fname, + ic + ]), ic); } } @@ -216,12 +213,10 @@ function open_in_bin(fname) { } else { var ic = Pervasives.open_in_bin(fname); - return from_ic(scan_close_at_end, /* From_file */{ - 0: fname, - 1: ic, - length: 2, - tag: 0 - }, ic); + return from_ic(scan_close_at_end, /* From_file */Block.__(0, [ + fname, + ic + ]), ic); } } @@ -233,11 +228,7 @@ function memo_from_ic(scan_close_ic, ic) { } catch (exn){ if (exn === Caml_builtin_exceptions.not_found) { - var ib = from_ic(scan_close_ic, /* From_channel */{ - 0: ic, - length: 1, - tag: 1 - }, ic); + var ib = from_ic(scan_close_ic, /* From_channel */Block.__(1, [ic]), ic); memo[0] = /* :: */[ /* tuple */[ ic, @@ -274,16 +265,10 @@ var Scan_failure = Caml_exceptions.create("Scanf.Scan_failure"); function bad_input_escape(c) { var s = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "illegal escape character ", - 1: /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "illegal escape character ", + /* Caml_char */Block.__(1, [/* End_of_format */0]) + ]), "illegal escape character %C" ]), c); throw [ @@ -294,22 +279,16 @@ function bad_input_escape(c) { function bad_token_length(message) { var s = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "scanning of ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " failed: the specified length was too short for token", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "scanning of ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " failed: the specified length was too short for token", + /* End_of_format */0 + ]) + ]) + ]), "scanning of %s failed: the specified length was too short for token" ]), message); throw [ @@ -320,25 +299,13 @@ function bad_token_length(message) { function character_mismatch_err(c, ci) { return Curry._2(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "looking for ", - 1: /* Caml_char */{ - 0: /* String_literal */{ - 0: ", found ", - 1: /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "looking for ", + /* Caml_char */Block.__(1, [/* String_literal */Block.__(11, [ + ", found ", + /* Caml_char */Block.__(1, [/* End_of_format */0]) + ])]) + ]), "looking for %C, found %C" ]), c, ci); } @@ -419,17 +386,13 @@ function token_bool(ib) { return /* true */1; default: var s$1 = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "invalid boolean ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "invalid boolean ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "invalid boolean %S" ]), s); throw [ @@ -557,21 +520,13 @@ function scan_decimal_digits_plus(width, ib) { var c = checked_peek_char(ib); if (c > 57 || c < 48) { var s = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "character ", - 1: /* Caml_char */{ - 0: /* String_literal */{ - 0: " is not a decimal digit", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "character ", + /* Caml_char */Block.__(1, [/* String_literal */Block.__(11, [ + " is not a decimal digit", + /* End_of_format */0 + ])]) + ]), "character %C is not a decimal digit" ]), c); throw [ @@ -622,31 +577,19 @@ function scan_digits_plus(basis, digitp, width, ib) { } else { var s = Curry._2(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "character ", - 1: /* Caml_char */{ - 0: /* String_literal */{ - 0: " is not a valid ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " digit", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "character ", + /* Caml_char */Block.__(1, [/* String_literal */Block.__(11, [ + " is not a valid ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " digit", + /* End_of_format */0 + ]) + ]) + ])]) + ]), "character %C is not a valid %s digit" ]), c, basis); throw [ @@ -1040,24 +983,10 @@ function char_for_decimal_code(c0, c1, c2) { var c = (Caml_int32.imul(100, c0 - /* "0" */48 | 0) + Caml_int32.imul(10, c1 - /* "0" */48 | 0) | 0) + (c2 - /* "0" */48 | 0) | 0; if (c < 0 || c > 255) { var s = Curry._3(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "bad character decimal encoding \\", - 1: /* Char */{ - 0: /* Char */{ - 0: /* Char */{ - 0: /* End_of_format */0, - length: 1, - tag: 0 - }, - length: 1, - tag: 0 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "bad character decimal encoding \\", + /* Char */Block.__(0, [/* Char */Block.__(0, [/* Char */Block.__(0, [/* End_of_format */0])])]) + ]), "bad character decimal encoding \\%c%c%c" ]), c0, c1, c2); throw [ @@ -1086,20 +1015,10 @@ function char_for_hexadecimal_code(c1, c2) { var c = (hexadecimal_value_of_char(c1) << 4) + hexadecimal_value_of_char(c2) | 0; if (c < 0 || c > 255) { var s = Curry._2(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "bad character hexadecimal encoding \\", - 1: /* Char */{ - 0: /* Char */{ - 0: /* End_of_format */0, - length: 1, - tag: 0 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "bad character hexadecimal encoding \\", + /* Char */Block.__(0, [/* Char */Block.__(0, [/* End_of_format */0])]) + ]), "bad character hexadecimal encoding \\%c%c" ]), c1, c2); throw [ @@ -1118,22 +1037,16 @@ function check_next_char(message, width, ib) { if (ib[/* eof */0]) { var message$1 = message; var s = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "scanning of ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " failed: premature end of file occurred before end of token", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "scanning of ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " failed: premature end of file occurred before end of token", + /* End_of_format */0 + ]) + ]) + ]), "scanning of %s failed: premature end of file occurred before end of token" ]), message$1); throw [ @@ -1361,21 +1274,13 @@ function scan_bool(ib) { if (c !== 102) { if (c !== 116) { var s = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "the character ", - 1: /* Caml_char */{ - 0: /* String_literal */{ - 0: " cannot start a boolean", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "the character ", + /* Caml_char */Block.__(1, [/* String_literal */Block.__(11, [ + " cannot start a boolean", + /* End_of_format */0 + ])]) + ]), "the character %C cannot start a boolean" ]), c); throw [ @@ -1452,29 +1357,21 @@ function scanf_bad_input(ib, x) { if (exit === 1) { var i = char_count(ib); var s$1 = Curry._2(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "scanf: bad input at char number ", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ": ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "scanf: bad input at char number ", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ": ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), "scanf: bad input at char number %i: %S" ]), i, s); throw [ @@ -1740,12 +1637,10 @@ function make_scanf(ib, _fmt, readers) { }(stp)); var str_rest_000 = match[1]; var str_rest_001 = rest[1]; - var str_rest = /* String_literal */{ - 0: str_rest_000, - 1: str_rest_001, - length: 2, - tag: 11 - }; + var str_rest = /* String_literal */Block.__(11, [ + str_rest_000, + str_rest_001 + ]); return pad_prec_scanf(ib, str_rest, readers, pad, /* No_precision */0, scan, token); case 18 : var match$1 = rest[0]; @@ -1972,12 +1867,10 @@ function make_scanf(ib, _fmt, readers) { var s$3 = token(ib); var str_rest_000$1 = match$6[1]; var str_rest_001$1 = rest$1[1]; - var str_rest$1 = /* String_literal */{ - 0: str_rest_000$1, - 1: str_rest_001$1, - length: 2, - tag: 11 - }; + var str_rest$1 = /* String_literal */Block.__(11, [ + str_rest_000$1, + str_rest_001$1 + ]); return /* Cons */[ s$3, make_scanf(ib, str_rest$1, readers) @@ -2111,33 +2004,17 @@ function kscanf(ib, ef, param) { Buffer.reset(ib[/* tokbuf */7]); var match; try { - match = /* Args */{ - 0: make_scanf(ib, fmt, readers), - length: 1, - tag: 0 - }; + match = /* Args */Block.__(0, [make_scanf(ib, fmt, readers)]); } catch (exc){ if (exc[0] === Scan_failure) { - match = /* Exc */{ - 0: exc, - length: 1, - tag: 1 - }; + match = /* Exc */Block.__(1, [exc]); } else if (exc[0] === Caml_builtin_exceptions.failure) { - match = /* Exc */{ - 0: exc, - length: 1, - tag: 1 - }; + match = /* Exc */Block.__(1, [exc]); } else if (exc === Caml_builtin_exceptions.end_of_file) { - match = /* Exc */{ - 0: exc, - length: 1, - tag: 1 - }; + match = /* Exc */Block.__(1, [exc]); } else if (exc[0] === Caml_builtin_exceptions.invalid_argument) { var s = exc[1] + (' in format "' + ($$String.escaped(str) + '"')); @@ -2246,16 +2123,10 @@ function format_from_string(s, fmt) { function unescaped(s) { return Curry._1(sscanf('"' + (s + '"'), /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]), "%S%!" ]), function (x) { return x; diff --git a/jscomp/stdlib/stream.js b/jscomp/stdlib/stream.js index 196b9993c0..403d9eb971 100644 --- a/jscomp/stdlib/stream.js +++ b/jscomp/stdlib/stream.js @@ -5,6 +5,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var CamlinternalLazy = require("./camlinternalLazy"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Pervasives = require("./pervasives"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var List = require("./list"); @@ -59,17 +60,13 @@ function get_data(count, _d) { ]; } else { - return /* Scons */{ - 0: match[0], - 1: /* Sapp */{ - 0: match[1], - 1: d2, - length: 2, - tag: 1 - }, - length: 2, - tag: 0 - }; + return /* Scons */Block.__(0, [ + match[0], + /* Sapp */Block.__(1, [ + match[1], + d2 + ]) + ]); } break; case 2 : @@ -86,12 +83,10 @@ function get_data(count, _d) { var match$2 = match$1[0]; if (match$2) { g[/* curr */0] = /* None */0; - return /* Scons */{ - 0: match$2[0], - 1: d, - length: 2, - tag: 0 - }; + return /* Scons */Block.__(0, [ + match$2[0], + d + ]); } else { return /* Sempty */0; @@ -100,12 +95,10 @@ function get_data(count, _d) { else { var match$3 = Curry._1(g[/* func */1], count); if (match$3) { - return /* Scons */{ - 0: match$3[0], - 1: d, - length: 2, - tag: 0 - }; + return /* Scons */Block.__(0, [ + match$3[0], + d + ]); } else { g[/* curr */0] = /* Some */[/* None */0]; @@ -121,12 +114,10 @@ function get_data(count, _d) { if (b[/* len */2]) { var r = b[/* buff */1][b[/* ind */3]]; b[/* ind */3] = b[/* ind */3] + 1 | 0; - return /* Scons */{ - 0: r, - 1: d, - length: 2, - tag: 0 - }; + return /* Scons */Block.__(0, [ + r, + d + ]); } else { return /* Sempty */0; @@ -284,12 +275,10 @@ function nget(n, s) { a, match$1[0] ], - /* Scons */{ - 0: a, - 1: match$1[1], - length: 2, - tag: 0 - }, + /* Scons */Block.__(0, [ + a, + match$1[1] + ]), match$1[2] + 1 | 0 ]; } @@ -351,14 +340,10 @@ function iter(f, strm) { function from(f) { return /* record */[ 0, - /* Sgen */{ - 0: /* record */[ - /* None */0, - f - ], - length: 1, - tag: 3 - } + /* Sgen */Block.__(3, [/* record */[ + /* None */0, + f + ]]) ]; } @@ -366,12 +351,10 @@ function of_list(l) { return /* record */[ 0, List.fold_right(function (x, l) { - return /* Scons */{ - 0: x, - 1: l, - length: 2, - tag: 0 - }; + return /* Scons */Block.__(0, [ + x, + l + ]); }, l, /* Sempty */0) ]; } @@ -407,135 +390,87 @@ function of_bytes(s) { function of_channel(ic) { return /* record */[ 0, - /* Sbuffio */{ - 0: /* record */[ - ic, - new Array(4096), - 0, - 0 - ], - length: 1, - tag: 4 - } + /* Sbuffio */Block.__(4, [/* record */[ + ic, + new Array(4096), + 0, + 0 + ]]) ]; } function iapp(i, s) { return /* record */[ 0, - /* Sapp */{ - 0: i[/* data */1], - 1: s[/* data */1], - length: 2, - tag: 1 - } + /* Sapp */Block.__(1, [ + i[/* data */1], + s[/* data */1] + ]) ]; } function icons(i, s) { return /* record */[ 0, - /* Scons */{ - 0: i, - 1: s[/* data */1], - length: 2, - tag: 0 - } + /* Scons */Block.__(0, [ + i, + s[/* data */1] + ]) ]; } function ising(i) { return /* record */[ 0, - /* Scons */{ - 0: i, - 1: /* Sempty */0, - length: 2, - tag: 0 - } + /* Scons */Block.__(0, [ + i, + /* Sempty */0 + ]) ]; } function lapp(f, s) { return /* record */[ 0, - /* Slazy */{ - 0: { - 0: function () { - return /* Sapp */{ - 0: Curry._1(f, /* () */0)[/* data */1], - 1: s[/* data */1], - length: 2, - tag: 1 - }; - }, - length: 1, - tag: 246 - }, - length: 1, - tag: 2 - } + /* Slazy */Block.__(2, [Block.__(246, [function () { + return /* Sapp */Block.__(1, [ + Curry._1(f, /* () */0)[/* data */1], + s[/* data */1] + ]); + }])]) ]; } function lcons(f, s) { return /* record */[ 0, - /* Slazy */{ - 0: { - 0: function () { - return /* Scons */{ - 0: Curry._1(f, /* () */0), - 1: s[/* data */1], - length: 2, - tag: 0 - }; - }, - length: 1, - tag: 246 - }, - length: 1, - tag: 2 - } + /* Slazy */Block.__(2, [Block.__(246, [function () { + return /* Scons */Block.__(0, [ + Curry._1(f, /* () */0), + s[/* data */1] + ]); + }])]) ]; } function lsing(f) { return /* record */[ 0, - /* Slazy */{ - 0: { - 0: function () { - return /* Scons */{ - 0: Curry._1(f, /* () */0), - 1: /* Sempty */0, - length: 2, - tag: 0 - }; - }, - length: 1, - tag: 246 - }, - length: 1, - tag: 2 - } + /* Slazy */Block.__(2, [Block.__(246, [function () { + return /* Scons */Block.__(0, [ + Curry._1(f, /* () */0), + /* Sempty */0 + ]); + }])]) ]; } function slazy(f) { return /* record */[ 0, - /* Slazy */{ - 0: { - 0: function () { - return Curry._1(f, /* () */0)[/* data */1]; - }, - length: 1, - tag: 246 - }, - length: 1, - tag: 2 - } + /* Slazy */Block.__(2, [Block.__(246, [function () { + return Curry._1(f, /* () */0)[/* data */1]; + }])]) ]; } diff --git a/jscomp/stdlib/unix.js b/jscomp/stdlib/unix.js index 526e6f18db..3c40f22912 100644 --- a/jscomp/stdlib/unix.js +++ b/jscomp/stdlib/unix.js @@ -9,6 +9,7 @@ var Pervasives = require("./pervasives"); var Hashtbl = require("./hashtbl"); var Caml_format = require("../runtime/caml_format"); var Callback = require("./callback"); +var Block = require("../runtime/block"); var Caml_unix = require("../runtime/caml_unix"); var Sys = require("./sys"); var Curry = require("../runtime/curry"); @@ -243,59 +244,41 @@ Printexc.register_printer(function (param) { } else { msg = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "EUNKNOWNERR ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "EUNKNOWNERR ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "EUNKNOWNERR %d" ]), e[0]); } return /* Some */[Curry._3(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "Unix.Unix_error(Unix.", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ", ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ", ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Unix.Unix_error(Unix.", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ", ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ", ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]), "Unix.Unix_error(Unix.%s, %S, %S)" ]), msg, param[2], param[3])]; } @@ -694,12 +677,10 @@ function getaddrinfo(node, service, opts) { /* PF_INET */1, ty, opt_protocol[0], - /* ADDR_INET */{ - 0: param[0], - 1: port, - length: 2, - tag: 1 - }, + /* ADDR_INET */Block.__(1, [ + param[0], + port + ]), param[1] ]; }, addresses); @@ -933,11 +914,7 @@ function open_process_in(cmd) { var in_read = match[0]; var inchan = Caml_io.caml_ml_open_descriptor_in(in_read); try { - open_proc(cmd, /* Process_in */{ - 0: inchan, - length: 1, - tag: 1 - }, 0, in_write, /* :: */[ + open_proc(cmd, /* Process_in */Block.__(1, [inchan]), 0, in_write, /* :: */[ in_read, /* [] */0 ]); @@ -957,11 +934,7 @@ function open_process_out(cmd) { var out_read = match[0]; var outchan = Caml_io.caml_ml_open_descriptor_out(out_write); try { - open_proc(cmd, /* Process_out */{ - 0: outchan, - length: 1, - tag: 2 - }, out_read, 1, /* :: */[ + open_proc(cmd, /* Process_out */Block.__(2, [outchan]), out_read, 1, /* :: */[ out_write, /* [] */0 ]); @@ -1006,12 +979,10 @@ function open_process(cmd) { ]; var inchan = Caml_io.caml_ml_open_descriptor_in(in_read); var outchan = Caml_io.caml_ml_open_descriptor_out(out_write); - open_proc(cmd, /* Process */{ - 0: inchan, - 1: outchan, - length: 2, - tag: 0 - }, out_read, in_write, /* :: */[ + open_proc(cmd, /* Process */Block.__(0, [ + inchan, + outchan + ]), out_read, in_write, /* :: */[ in_read, /* :: */[ out_write, @@ -1095,13 +1066,11 @@ function open_process_full(cmd, env) { var inchan = Caml_io.caml_ml_open_descriptor_in(in_read); var outchan = Caml_io.caml_ml_open_descriptor_out(out_write); var errchan = Caml_io.caml_ml_open_descriptor_in(err_read); - open_proc_full(cmd, env, /* Process_full */{ - 0: inchan, - 1: outchan, - 2: errchan, - length: 3, - tag: 3 - }, out_read, in_write, err_write, /* :: */[ + open_proc_full(cmd, env, /* Process_full */Block.__(3, [ + inchan, + outchan, + errchan + ]), out_read, in_write, err_write, /* :: */[ in_read, /* :: */[ out_write, @@ -1148,21 +1117,13 @@ function find_proc_id(fun_name, proc) { } function close_process_in(inchan) { - var pid = find_proc_id("close_process_in", /* Process_in */{ - 0: inchan, - length: 1, - tag: 1 - }); + var pid = find_proc_id("close_process_in", /* Process_in */Block.__(1, [inchan])); Caml_primitive.caml_ml_close_channel(inchan); return waitpid_non_intr(pid)[1]; } function close_process_out(outchan) { - var pid = find_proc_id("close_process_out", /* Process_out */{ - 0: outchan, - length: 1, - tag: 2 - }); + var pid = find_proc_id("close_process_out", /* Process_out */Block.__(2, [outchan])); Caml_io.caml_ml_flush(outchan); Caml_primitive.caml_ml_close_channel(outchan); return waitpid_non_intr(pid)[1]; @@ -1171,12 +1132,10 @@ function close_process_out(outchan) { function close_process(param) { var outchan = param[1]; var inchan = param[0]; - var pid = find_proc_id("close_process", /* Process */{ - 0: inchan, - 1: outchan, - length: 2, - tag: 0 - }); + var pid = find_proc_id("close_process", /* Process */Block.__(0, [ + inchan, + outchan + ])); Caml_primitive.caml_ml_close_channel(inchan); try { Caml_io.caml_ml_flush(outchan); @@ -1195,13 +1154,11 @@ function close_process_full(param) { var errchan = param[2]; var outchan = param[1]; var inchan = param[0]; - var pid = find_proc_id("close_process_full", /* Process_full */{ - 0: inchan, - 1: outchan, - 2: errchan, - length: 3, - tag: 3 - }); + var pid = find_proc_id("close_process_full", /* Process_full */Block.__(3, [ + inchan, + outchan, + errchan + ])); Caml_primitive.caml_ml_close_channel(inchan); try { Caml_io.caml_ml_flush(outchan); diff --git a/jscomp/test/a_filename_test.js b/jscomp/test/a_filename_test.js index a9211460a9..a41f111a46 100644 --- a/jscomp/test/a_filename_test.js +++ b/jscomp/test/a_filename_test.js @@ -2,17 +2,16 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Ext_filename = require("./ext_filename"); var suites_000 = /* tuple */[ "basic", function () { - return /* Eq */{ - 0: Ext_filename.node_relative_path("./a/b.c", "./a/u/g.c"), - 1: "./u/g", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Ext_filename.node_relative_path("./a/b.c", "./a/u/g.c"), + "./u/g" + ]); } ]; diff --git a/jscomp/test/a_list_test.js b/jscomp/test/a_list_test.js index 6b5c0e7946..03982ef2b2 100644 --- a/jscomp/test/a_list_test.js +++ b/jscomp/test/a_list_test.js @@ -2,26 +2,25 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Ext_list = require("./ext_list"); var suites_000 = /* tuple */[ "drop", function () { - return /* Eq */{ - 0: Ext_list.drop(3, /* :: */[ - 0, - /* :: */[ - 1, + return /* Eq */Block.__(0, [ + Ext_list.drop(3, /* :: */[ + 0, /* :: */[ - 2, - /* [] */0 + 1, + /* :: */[ + 2, + /* [] */0 + ] ] - ] - ]), - 1: /* [] */0, - length: 2, - tag: 0 - }; + ]), + /* [] */0 + ]); } ]; @@ -29,79 +28,75 @@ var suites_001 = /* :: */[ /* tuple */[ "drop1", function () { - return /* Eq */{ - 0: Ext_list.drop(2, /* :: */[ - 0, - /* :: */[ - 1, + return /* Eq */Block.__(0, [ + Ext_list.drop(2, /* :: */[ + 0, /* :: */[ - 2, - /* [] */0 + 1, + /* :: */[ + 2, + /* [] */0 + ] ] - ] - ]), - 1: /* :: */[ - 2, - /* [] */0 - ], - length: 2, - tag: 0 - }; + ]), + /* :: */[ + 2, + /* [] */0 + ] + ]); } ], /* :: */[ /* tuple */[ "flat_map", function () { - return /* Eq */{ - 0: /* :: */[ - 0, + return /* Eq */Block.__(0, [ /* :: */[ 0, /* :: */[ - 1, + 0, /* :: */[ 1, /* :: */[ - 0, - /* [] */0 + 1, + /* :: */[ + 0, + /* [] */0 + ] ] ] ] - ] - ], - 1: Ext_list.flat_map(function (x) { - if (x % 2) { - return /* :: */[ - 1, - /* :: */[ + ], + Ext_list.flat_map(function (x) { + if (x % 2) { + return /* :: */[ 1, + /* :: */[ + 1, + /* [] */0 + ] + ]; + } + else { + return /* :: */[ + 0, /* [] */0 - ] - ]; - } - else { - return /* :: */[ - 0, - /* [] */0 - ]; - } - }, /* :: */[ - 0, - /* :: */[ + ]; + } + }, /* :: */[ 0, /* :: */[ - 3, + 0, /* :: */[ - 0, - /* [] */0 + 3, + /* :: */[ + 0, + /* [] */0 + ] ] ] - ] - ]), - length: 2, - tag: 0 - }; + ]) + ]); } ], /* [] */0 diff --git a/jscomp/test/a_string_test.js b/jscomp/test/a_string_test.js index 65fd1abc23..0335493c71 100644 --- a/jscomp/test/a_string_test.js +++ b/jscomp/test/a_string_test.js @@ -2,27 +2,26 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Ext_string = require("./ext_string"); var List = require("../stdlib/list"); var suites_000 = /* tuple */[ "split", function () { - return /* Eq */{ - 0: Ext_string.split(/* Some */[/* true */1], "hihi", /* "i" */105), - 1: /* :: */[ - "h", + return /* Eq */Block.__(0, [ + Ext_string.split(/* Some */[/* true */1], "hihi", /* "i" */105), /* :: */[ "h", /* :: */[ - "", - /* [] */0 + "h", + /* :: */[ + "", + /* [] */0 + ] ] ] - ], - length: 2, - tag: 0 - }; + ]); } ]; @@ -30,84 +29,76 @@ var suites_001 = /* :: */[ /* tuple */[ "split_non_empty", function () { - return /* Eq */{ - 0: Ext_string.split(/* None */0, "hihi", /* "i" */105), - 1: /* :: */[ - "h", + return /* Eq */Block.__(0, [ + Ext_string.split(/* None */0, "hihi", /* "i" */105), /* :: */[ "h", - /* [] */0 + /* :: */[ + "h", + /* [] */0 + ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* :: */[ /* tuple */[ "split_empty", function () { - return /* Eq */{ - 0: Ext_string.split(/* Some */[/* true */1], "", /* "i" */105), - 1: /* [] */0, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Ext_string.split(/* Some */[/* true */1], "", /* "i" */105), + /* [] */0 + ]); } ], /* :: */[ /* tuple */[ "split_normal", function () { - return /* Eq */{ - 0: Ext_string.split(/* Some */[/* true */1], "h i i", /* " " */32), - 1: /* :: */[ - "h", + return /* Eq */Block.__(0, [ + Ext_string.split(/* Some */[/* true */1], "h i i", /* " " */32), /* :: */[ - "i", + "h", /* :: */[ "i", - /* [] */0 + /* :: */[ + "i", + /* [] */0 + ] ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* :: */[ /* tuple */[ "split_by", function () { - return /* Eq */{ - 0: List.filter(function (s) { - return +(s !== ""); - })(Ext_string.split_by(/* None */0, function (x) { - if (x === /* " " */32) { - return /* true */1; - } - else { - return +(x === /* "\t" */9); - } - }, "h hgso hgso \t hi")), - 1: /* :: */[ - "h", + return /* Eq */Block.__(0, [ + List.filter(function (s) { + return +(s !== ""); + })(Ext_string.split_by(/* None */0, function (x) { + if (x === /* " " */32) { + return /* true */1; + } + else { + return +(x === /* "\t" */9); + } + }, "h hgso hgso \t hi")), /* :: */[ - "hgso", + "h", /* :: */[ "hgso", /* :: */[ - "hi", - /* [] */0 + "hgso", + /* :: */[ + "hi", + /* [] */0 + ] ] ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* [] */0 diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index 861c1baa5b..c4aa55b692 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -1,7 +1,8 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); function f(b, _, _n) { while(true) { @@ -40,12 +41,10 @@ function or_f(b, _, _n) { var suites_000 = /* tuple */[ "and_tail", function () { - return /* Eq */{ - 0: /* false */0, - 1: f(/* true */1, 1, 0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* false */0, + f(/* true */1, 1, 0) + ]); } ]; @@ -53,12 +52,10 @@ var suites_001 = /* :: */[ /* tuple */[ "or_tail", function () { - return /* Eq */{ - 0: /* false */0, - 1: or_f(/* false */0, 1, 0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* false */0, + or_f(/* false */0, 1, 0) + ]); } ], /* [] */0 diff --git a/jscomp/test/ari_regress_test.js b/jscomp/test/ari_regress_test.js index d508a42242..8a4890e1c8 100644 --- a/jscomp/test/ari_regress_test.js +++ b/jscomp/test/ari_regress_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var g = 7; @@ -34,12 +35,10 @@ function v(param) { var suites_000 = /* tuple */[ "curry", function () { - return /* Eq */{ - 0: g, - 1: 7, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + g, + 7 + ]); } ]; @@ -47,36 +46,30 @@ var suites_001 = /* :: */[ /* tuple */[ "curry2", function () { - return /* Eq */{ - 0: 14, - 1: (Curry._1(v, 1), Curry._1(v, 1)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 14, + (Curry._1(v, 1), Curry._1(v, 1)) + ]); } ], /* :: */[ /* tuple */[ "curry3", function () { - return /* Eq */{ - 0: x, - 1: 14, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + 14 + ]); } ], /* :: */[ /* tuple */[ 'File "ari_regress_test.ml", line 20, characters 4-11', function () { - return /* Eq */{ - 0: h[0], - 1: 1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + h[0], + 1 + ]); } ], /* [] */0 diff --git a/jscomp/test/arith_lexer.js b/jscomp/test/arith_lexer.js index 35b026efbc..808e175bb8 100644 --- a/jscomp/test/arith_lexer.js +++ b/jscomp/test/arith_lexer.js @@ -4,6 +4,7 @@ var Pervasives = require("../stdlib/pervasives"); var Caml_format = require("../runtime/caml_format"); var Lexing = require("../stdlib/lexing"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var __ocaml_lex_tables = /* record */[ @@ -40,17 +41,9 @@ function __ocaml_lex_lexeme_rec(lexbuf, ___ocaml_lex_state) { ___ocaml_lex_state = 0; continue ; case 1 : - return /* NUMERAL */{ - 0: Caml_format.caml_int_of_string(Lexing.lexeme(lexbuf)), - length: 1, - tag: 0 - }; + return /* NUMERAL */Block.__(0, [Caml_format.caml_int_of_string(Lexing.lexeme(lexbuf))]); case 2 : - return /* IDENT */{ - 0: Lexing.lexeme(lexbuf), - length: 1, - tag: 1 - }; + return /* IDENT */Block.__(1, [Lexing.lexeme(lexbuf)]); case 3 : return /* PLUS */0; case 4 : diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index 7d6dba3380..601a2c4472 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -2,6 +2,7 @@ 'use strict'; var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); +var Block = require("../runtime/block"); var Parsing = require("../stdlib/parsing"); var yytransl_const = /* array */[ @@ -56,67 +57,47 @@ var yyact = /* array */[ }, function (__caml_parser_env) { var _1 = Parsing.peek_val(__caml_parser_env, 0); - return /* Numeral */{ - 0: _1, - length: 1, - tag: 0 - }; + return /* Numeral */Block.__(0, [_1]); }, function (__caml_parser_env) { var _1 = Parsing.peek_val(__caml_parser_env, 0); - return /* Variable */{ - 0: _1, - length: 1, - tag: 6 - }; + return /* Variable */Block.__(6, [_1]); }, function (__caml_parser_env) { var _1 = Parsing.peek_val(__caml_parser_env, 2); var _3 = Parsing.peek_val(__caml_parser_env, 0); - return /* Plus */{ - 0: _1, - 1: _3, - length: 2, - tag: 1 - }; + return /* Plus */Block.__(1, [ + _1, + _3 + ]); }, function (__caml_parser_env) { var _1 = Parsing.peek_val(__caml_parser_env, 2); var _3 = Parsing.peek_val(__caml_parser_env, 0); - return /* Minus */{ - 0: _1, - 1: _3, - length: 2, - tag: 2 - }; + return /* Minus */Block.__(2, [ + _1, + _3 + ]); }, function (__caml_parser_env) { var _1 = Parsing.peek_val(__caml_parser_env, 2); var _3 = Parsing.peek_val(__caml_parser_env, 0); - return /* Times */{ - 0: _1, - 1: _3, - length: 2, - tag: 3 - }; + return /* Times */Block.__(3, [ + _1, + _3 + ]); }, function (__caml_parser_env) { var _1 = Parsing.peek_val(__caml_parser_env, 2); var _3 = Parsing.peek_val(__caml_parser_env, 0); - return /* Divide */{ - 0: _1, - 1: _3, - length: 2, - tag: 4 - }; + return /* Divide */Block.__(4, [ + _1, + _3 + ]); }, function (__caml_parser_env) { var _2 = Parsing.peek_val(__caml_parser_env, 0); - return /* Negate */{ - 0: _2, - length: 1, - tag: 5 - }; + return /* Negate */Block.__(5, [_2]); }, function (__caml_parser_env) { return Parsing.peek_val(__caml_parser_env, 1); diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index ee0c72249d..c1e611a98e 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -3,6 +3,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Caml_array = require("../runtime/caml_array"); var $$Array = require("../stdlib/array"); var List = require("../stdlib/list"); @@ -29,20 +30,18 @@ function is_sorted(x) { var array_suites_000 = /* tuple */[ "init", function () { - return /* Eq */{ - 0: $$Array.init(5, function (x) { - return x; - }), - 1: /* array */[ - 0, - 1, - 2, - 3, - 4 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + $$Array.init(5, function (x) { + return x; + }), + /* array */[ + 0, + 1, + 2, + 3, + 4 + ] + ]); } ]; @@ -68,85 +67,77 @@ var array_suites_001 = /* :: */[ ], /* [] */0 ])); - return /* Eq */{ - 0: match[0], - 1: match[1], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + match[0], + match[1] + ]); } ], /* :: */[ /* tuple */[ "concat", function () { - return /* Eq */{ - 0: /* array */[ - 0, - 1, - 2, - 3, - 4, - 5 - ], - 1: Caml_array.caml_array_concat(/* :: */[ - /* int array */[ - 0, - 1, - 2 - ], - /* :: */[ + return /* Eq */Block.__(0, [ + /* array */[ + 0, + 1, + 2, + 3, + 4, + 5 + ], + Caml_array.caml_array_concat(/* :: */[ /* int array */[ - 3, - 4 + 0, + 1, + 2 ], /* :: */[ - /* int array */[], + /* int array */[ + 3, + 4 + ], /* :: */[ - /* int array */[5], - /* [] */0 + /* int array */[], + /* :: */[ + /* int array */[5], + /* [] */0 + ] ] ] - ] - ]), - length: 2, - tag: 0 - }; + ]) + ]); } ], /* :: */[ /* tuple */[ "make", function () { - return /* Eq */{ - 0: Caml_array.caml_make_vect(100, /* "a" */97), - 1: $$Array.init(100, function () { - return /* "a" */97; - }), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_array.caml_make_vect(100, /* "a" */97), + $$Array.init(100, function () { + return /* "a" */97; + }) + ]); } ], /* :: */[ /* tuple */[ "sub", function () { - return /* Eq */{ - 0: $$Array.sub(/* array */[ - 0, - 1, - 2, - 3, - 4 - ], 2, 2), - 1: /* int array */[ - 2, - 3 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + $$Array.sub(/* array */[ + 0, + 1, + 2, + 3, + 4 + ], 2, 2), + /* int array */[ + 2, + 3 + ] + ]); } ], /* :: */[ @@ -162,41 +153,37 @@ var array_suites_001 = /* :: */[ return (x << 1); }); $$Array.blit(v, 1, u, 1, 2); - return /* Eq */{ - 0: /* tuple */[ - /* int array */[ - 0, - 2, - 4 + return /* Eq */Block.__(0, [ + /* tuple */[ + /* int array */[ + 0, + 2, + 4 + ], + /* int array */[ + 100, + 2, + 4 + ] ], - /* int array */[ - 100, - 2, - 4 + /* tuple */[ + v, + u ] - ], - 1: /* tuple */[ - v, - u - ], - length: 2, - tag: 0 - }; + ]); } ], /* :: */[ /* tuple */[ "make", function () { - return /* Eq */{ - 0: Caml_array.caml_make_vect(2, 1), - 1: /* int array */[ - 1, - 1 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_array.caml_make_vect(2, 1), + /* int array */[ + 1, + 1 + ] + ]); } ], /* :: */[ @@ -209,16 +196,14 @@ var array_suites_001 = /* :: */[ 1 ]; $$Array.sort(Caml_obj.caml_int_compare, u); - return /* Eq */{ - 0: Caml_obj.caml_equal(/* int array */[ - 0, - 1, - 3 - ], u), - 1: /* true */1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_obj.caml_equal(/* int array */[ + 0, + 1, + 3 + ], u), + /* true */1 + ]); } ], /* :: */[ @@ -229,12 +214,10 @@ var array_suites_001 = /* :: */[ return i % 17; }); $$Array.sort(Caml_obj.caml_int_compare, v); - return /* Eq */{ - 0: /* true */1, - 1: is_sorted(v), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + is_sorted(v) + ]); } ], /* [] */0 diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index dc08624130..222f8fba44 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -3,6 +3,7 @@ var Bytes = require("../stdlib/bytes"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Buffer = require("../stdlib/buffer"); var v = "gso"; @@ -10,18 +11,16 @@ var v = "gso"; var suites_000 = /* tuple */[ "equal", function () { - return /* Eq */{ - 0: /* tuple */[ - Bytes.make(3, /* "a" */97)[0], - Bytes.make(3, /* "a" */97)[0] - ], - 1: /* tuple */[ - /* "a" */97, - /* "a" */97 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + Bytes.make(3, /* "a" */97)[0], + Bytes.make(3, /* "a" */97)[0] + ], + /* tuple */[ + /* "a" */97, + /* "a" */97 + ] + ]); } ]; @@ -31,18 +30,16 @@ var suites_001 = /* :: */[ function () { var u = Bytes.make(3, /* "a" */97); u[0] = /* "b" */98; - return /* Eq */{ - 0: /* tuple */[ - u[0], - v.charCodeAt(0) - ], - 1: /* tuple */[ - /* "b" */98, - /* "g" */103 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + u[0], + v.charCodeAt(0) + ], + /* tuple */[ + /* "b" */98, + /* "g" */103 + ] + ]); } ], /* :: */[ @@ -53,12 +50,10 @@ var suites_001 = /* :: */[ for(var i = 0; i <= 10; ++i){ Buffer.add_string(v, "" + i); } - return /* Eq */{ - 0: Buffer.contents(v), - 1: "012345678910", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Buffer.contents(v), + "012345678910" + ]); } ], /* [] */0 diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 9b74a9dcaf..ebfbbe736f 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -3,16 +3,15 @@ var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var suites_000 = /* tuple */[ "option", function () { - return /* Eq */{ - 0: /* true */1, - 1: Caml_obj.caml_lessthan(/* None */0, /* Some */[1]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + Caml_obj.caml_lessthan(/* None */0, /* Some */[1]) + ]); } ]; @@ -20,66 +19,32 @@ var suites_001 = /* :: */[ /* tuple */[ "option2", function () { - return /* Eq */{ - 0: /* true */1, - 1: Caml_obj.caml_lessthan(/* Some */[1], /* Some */[2]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + Caml_obj.caml_lessthan(/* Some */[1], /* Some */[2]) + ]); } ], /* :: */[ /* tuple */[ "list0", function () { - return /* Eq */{ - 0: /* true */1, - 1: Caml_obj.caml_greaterthan(/* :: */[ - 1, - /* [] */0 - ], /* [] */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + Caml_obj.caml_greaterthan(/* :: */[ + 1, + /* [] */0 + ], /* [] */0) + ]); } ], /* :: */[ /* tuple */[ "listeq", function () { - return /* Eq */{ - 0: /* true */1, - 1: Caml_obj.caml_equal(/* :: */[ - 1, - /* :: */[ - 2, - /* :: */[ - 3, - /* [] */0 - ] - ] - ], /* :: */[ - 1, - /* :: */[ - 2, - /* :: */[ - 3, - /* [] */0 - ] - ] - ]), - length: 2, - tag: 0 - }; - } - ], - /* :: */[ - /* tuple */[ - "listneq", - function () { - return /* Eq */{ - 0: /* true */1, - 1: Caml_obj.caml_greaterthan(/* :: */[ + return /* Eq */Block.__(0, [ + /* true */1, + Caml_obj.caml_equal(/* :: */[ 1, /* :: */[ 2, @@ -93,106 +58,88 @@ var suites_001 = /* :: */[ /* :: */[ 2, /* :: */[ - 2, + 3, /* [] */0 ] ] - ]), - length: 2, - tag: 0 - }; + ]) + ]); + } + ], + /* :: */[ + /* tuple */[ + "listneq", + function () { + return /* Eq */Block.__(0, [ + /* true */1, + Caml_obj.caml_greaterthan(/* :: */[ + 1, + /* :: */[ + 2, + /* :: */[ + 3, + /* [] */0 + ] + ] + ], /* :: */[ + 1, + /* :: */[ + 2, + /* :: */[ + 2, + /* [] */0 + ] + ] + ]) + ]); } ], /* :: */[ /* tuple */[ "custom_u", function () { - return /* Eq */{ - 0: /* true */1, - 1: Caml_obj.caml_greaterthan(/* tuple */[ - /* A */{ - 0: 3, - length: 1, - tag: 0 - }, - /* B */{ - 0: 2, - 1: /* false */0, - length: 2, - tag: 1 - }, - /* C */{ - 0: 1, - length: 1, - tag: 2 - } - ], /* tuple */[ - /* A */{ - 0: 3, - length: 1, - tag: 0 - }, - /* B */{ - 0: 2, - 1: /* false */0, - length: 2, - tag: 1 - }, - /* C */{ - 0: 0, - length: 1, - tag: 2 - } - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + Caml_obj.caml_greaterthan(/* tuple */[ + /* A */Block.__(0, [3]), + /* B */Block.__(1, [ + 2, + /* false */0 + ]), + /* C */Block.__(2, [1]) + ], /* tuple */[ + /* A */Block.__(0, [3]), + /* B */Block.__(1, [ + 2, + /* false */0 + ]), + /* C */Block.__(2, [0]) + ]) + ]); } ], /* :: */[ /* tuple */[ "custom_u2", function () { - return /* Eq */{ - 0: /* true */1, - 1: Caml_obj.caml_equal(/* tuple */[ - /* A */{ - 0: 3, - length: 1, - tag: 0 - }, - /* B */{ - 0: 2, - 1: /* false */0, - length: 2, - tag: 1 - }, - /* C */{ - 0: 1, - length: 1, - tag: 2 - } - ], /* tuple */[ - /* A */{ - 0: 3, - length: 1, - tag: 0 - }, - /* B */{ - 0: 2, - 1: /* false */0, - length: 2, - tag: 1 - }, - /* C */{ - 0: 1, - length: 1, - tag: 2 - } - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + Caml_obj.caml_equal(/* tuple */[ + /* A */Block.__(0, [3]), + /* B */Block.__(1, [ + 2, + /* false */0 + ]), + /* C */Block.__(2, [1]) + ], /* tuple */[ + /* A */Block.__(0, [3]), + /* B */Block.__(1, [ + 2, + /* false */0 + ]), + /* C */Block.__(2, [1]) + ]) + ]); } ], /* [] */0 diff --git a/jscomp/test/caml_format_test.js b/jscomp/test/caml_format_test.js index 95d5c90447..349d417f14 100644 --- a/jscomp/test/caml_format_test.js +++ b/jscomp/test/caml_format_test.js @@ -7,6 +7,7 @@ var Caml_float = require("../runtime/caml_float"); var Pervasives = require("../stdlib/pervasives"); var Caml_format = require("../runtime/caml_format"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var Int64 = require("../stdlib/int64"); @@ -97,26 +98,20 @@ function from_of_string() { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "of_string ", - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "of_string ", + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]), "of_string %L" ]), i), function () { - return /* Eq */{ - 0: Caml_format.caml_int_of_string(b), - 1: a, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_int_of_string(b), + a + ]); } ]; }, of_string)); @@ -124,19 +119,15 @@ function from_of_string() { function u(v) { return Curry._1(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 33, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 33 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%33d" ]), v); } @@ -144,19 +135,15 @@ function u(v) { var to_str = Caml_format.caml_int_of_string var v = Curry._1(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 3 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%3d" ]), 3333); @@ -202,12 +189,10 @@ var suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at(/* :: */[ /* tuple */[ "isnan_of_string", function () { - return /* Eq */{ - 0: /* true */1, - 1: +(Caml_float.caml_classify_float(Caml_format.caml_float_of_string("nan")) === /* FP_nan */4), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + +(Caml_float.caml_classify_float(Caml_format.caml_float_of_string("nan")) === /* FP_nan */4) + ]); } ], /* [] */0 @@ -216,53 +201,41 @@ var suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at(/* :: */[ var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "infinity_of_string ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "infinity_of_string ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "infinity_of_string %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: Caml_float.caml_classify_float(Caml_format.caml_float_of_string(b)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + Caml_float.caml_classify_float(Caml_format.caml_float_of_string(b)) + ]); } ]; }, pairs)), Pervasives.$at(/* :: */[ /* tuple */[ "throw", function () { - return /* ThrowAny */{ - 0: function () { - return Caml_format.caml_float_of_string(""); - }, - length: 1, - tag: 3 - }; + return /* ThrowAny */Block.__(3, [function () { + return Caml_format.caml_float_of_string(""); + }]); } ], /* :: */[ /* tuple */[ "format_int", function () { - return /* Eq */{ - 0: " 33", - 1: Caml_format.caml_format_int("%32d", 33), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + " 33", + Caml_format.caml_format_int("%32d", 33) + ]); } ], /* [] */0 @@ -272,28 +245,22 @@ var suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at(/* :: */[ var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "normal_float_of_string ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "normal_float_of_string ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "normal_float_of_string %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: Caml_format.caml_float_of_string(b), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + Caml_format.caml_float_of_string(b) + ]); } ]; }, pairs$1)))))); @@ -305,82 +272,56 @@ function ff(param) { var formatter_suites_000 = /* tuple */[ "fmt_concat", function () { - return /* Eq */{ - 0: Curry._6(Format.asprintf(Pervasives.$caret$caret(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - "%s %03d %L" - ], /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - "%S %03d %L" - ])), "32", 33, 33, "a", 33, 3), - 1: '32 033 33"a" 033 3', - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._6(Format.asprintf(Pervasives.$caret$caret(/* Format */[ + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 3 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), + "%s %03d %L" + ], /* Format */[ + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 3 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), + "%S %03d %L" + ])), "32", 33, 33, "a", 33, 3), + '32 033 33"a" 033 3' + ]); } ]; @@ -388,996 +329,320 @@ var formatter_suites_001 = /* :: */[ /* tuple */[ "fmt_gen", function () { - return /* Eq */{ - 0: Curry._8(Format.asprintf(Pervasives.$caret$caret(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - "%s %03d %L" - ], /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Alpha */{ - 0: /* End_of_format */0, - length: 1, - tag: 15 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - "%S %03d %L %a" - ])), "32", 33, 33, "a", 33, 3, function (param, param$1) { - return Format.pp_print_list(/* None */0, Format.pp_print_int, param, param$1); - }, /* :: */[ - 1, - /* :: */[ - 2, + return /* Eq */Block.__(0, [ + Curry._8(Format.asprintf(Pervasives.$caret$caret(/* Format */[ + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 3 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), + "%s %03d %L" + ], /* Format */[ + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 3 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Alpha */Block.__(15, [/* End_of_format */0]) + ]) + ]) + ]) + ]) + ]) + ]), + "%S %03d %L %a" + ])), "32", 33, 33, "a", 33, 3, function (param, param$1) { + return Format.pp_print_list(/* None */0, Format.pp_print_int, param, param$1); + }, /* :: */[ + 1, /* :: */[ - 3, - /* [] */0 + 2, + /* :: */[ + 3, + /* [] */0 + ] ] - ] - ]), - 1: '32 033 33"a" 033 3 12\n3', - length: 2, - tag: 0 - }; + ]), + '32 033 33"a" 033 3 12\n3' + ]); } ], /* :: */[ /* tuple */[ "long_fmt", function () { - return /* Eq */{ - 0: Curry.app(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Line_counter */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_F */15, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_E */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_g */9, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_G */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Bool */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Bool */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 9 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 9 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - "%d %i %u %n %l %L %N %x %X %o %s %S %c %C %f %F %e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no " - ]), [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - "a", - "b", - /* "c" */99, - /* "d" */100, - 1, - 2, - 3, - 4, - 5, - 6, - /* true */1, - /* false */0, - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11 - ]), - 1: "1 2 3 4 5 6 7 8 9 12 a \"b\" c 'd' 1.000000 2. 3.000000e+00 4.000000E+00 5 6 true false 0 1 2 3 4 5 6 7 8 9 a 13 ", - length: 2, - tag: 0 - }; - } - ], - /* :: */[ - /* tuple */[ - "long_fmt_2", - function () { - return /* Eq */{ - 0: Curry.app(Format.asprintf(/* Format */[ - /* Formatting_gen */{ - 0: /* Open_box */{ - 0: /* Format */[ - /* End_of_format */0, - "" - ], - length: 1, - tag: 1 - }, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 23, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 2, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_u */12, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_x */6, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 0, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: "l ", - 1: /* Int */{ - 0: /* Int_x */6, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 0, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: "L ", - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_x */6, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_F */15, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 2, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_e */3, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 2, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_E */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_g */9, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_G */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Bool */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Bool */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Nativeint */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " ", - 1: /* Formatting_lit */{ - 0: /* Close_box */0, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 6 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 9 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 9 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 21 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 21 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 18 - }, - "@[%23d %2i %3u %4n %0xl %0xL %N %03x %X %o %s %S %c %C %3f %2F %2e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no @]" + return /* Eq */Block.__(0, [ + Curry.app(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Line_counter */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_char */Block.__(1, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_F */15, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_E */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_g */9, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_G */12, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Bool */Block.__(9, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Bool */Block.__(9, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " ", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ])]) + ])]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ])]) + ])]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), + "%d %i %u %n %l %L %N %x %X %o %s %S %c %C %f %F %e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no " ]), [ 1, 2, @@ -1414,336 +679,598 @@ var formatter_suites_001 = /* :: */[ 10, 11 ]), - 1: " 1 2 3 4 5l 6L 7 008 9 12 a \"b\" c 'd' 1.000000 2. 3.000000e+00 4.000000E+00 5 6 true false 0 1 2 3 4 5 6 7 8 9 a 13 ", - length: 2, - tag: 0 - }; + "1 2 3 4 5 6 7 8 9 12 a \"b\" c 'd' 1.000000 2. 3.000000e+00 4.000000E+00 5 6 true false 0 1 2 3 4 5 6 7 8 9 a 13 " + ]); + } + ], + /* :: */[ + /* tuple */[ + "long_fmt_2", + function () { + return /* Eq */Block.__(0, [ + Curry.app(Format.asprintf(/* Format */[ + /* Formatting_gen */Block.__(18, [ + /* Open_box */Block.__(1, [/* Format */[ + /* End_of_format */0, + "" + ]]), + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 23 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 2 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_u */12, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 3 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_x */6, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 0 + ]), + /* No_precision */0, + /* String_literal */Block.__(11, [ + "l ", + /* Int */Block.__(4, [ + /* Int_x */6, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 0 + ]), + /* No_precision */0, + /* String_literal */Block.__(11, [ + "L ", + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_x */6, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 3 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_char */Block.__(1, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_f */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 3 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_F */15, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 2 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_e */3, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 2 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_E */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_g */9, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_G */12, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Bool */Block.__(9, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Bool */Block.__(9, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Nativeint */Block.__(6, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " ", + /* Formatting_lit */Block.__(17, [ + /* Close_box */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ])]) + ])]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ])]) + ])]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), + "@[%23d %2i %3u %4n %0xl %0xL %N %03x %X %o %s %S %c %C %3f %2F %2e %E %g %G %B %b %ld %li %lu %lx %lX %lo %nd %ni %nu %nx %nx %no @]" + ]), [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + "a", + "b", + /* "c" */99, + /* "d" */100, + 1, + 2, + 3, + 4, + 5, + 6, + /* true */1, + /* false */0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ]), + " 1 2 3 4 5l 6L 7 008 9 12 a \"b\" c 'd' 1.000000 2. 3.000000e+00 4.000000E+00 5 6 true false 0 1 2 3 4 5 6 7 8 9 a 13 " + ]); } ], /* :: */[ /* tuple */[ "width_1", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 14, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "%014d" - ]), 32), - 1: "00000000000032", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 14 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), + "%014d" + ]), 32), + "00000000000032" + ]); } ], /* :: */[ /* tuple */[ "width_2", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 10, - length: 2, - tag: 0 - }, - 2: /* Lit_precision */[3], - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, - "%10.3f" - ]), 32333.02), - 1: " 32333.020", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Float */Block.__(8, [ + /* Float_f */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 10 + ]), + /* Lit_precision */[3], + /* End_of_format */0 + ]), + "%10.3f" + ]), 32333.02), + " 32333.020" + ]); } ], /* :: */[ /* tuple */[ "alternate_1", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_x */6, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 0, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "%0x" - ]), 32333), - 1: "7e4d", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_x */6, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 0 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), + "%0x" + ]), 32333), + "7e4d" + ]); } ], /* :: */[ /* tuple */[ "alternate_2", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_Cx */7, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 0, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "%#0x" - ]), 32333), - 1: "0x7e4d", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_Cx */7, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 0 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), + "%#0x" + ]), 32333), + "0x7e4d" + ]); } ], /* :: */[ /* tuple */[ "alternate_3", function () { - return /* Eq */{ - 0: /* tuple */[ - Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_Co */11, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "%#o" - ]), 32), - Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "%o" - ]), 32) - ], - 1: /* tuple */[ - "040", - "40" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_Co */11, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%#o" + ]), 32), + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%o" + ]), 32) + ], + /* tuple */[ + "040", + "40" + ] + ]); } ], /* :: */[ /* tuple */[ "justify_0", function () { - return /* Eq */{ - 0: Caml_format.caml_format_int("%-8d", 32), - 1: "32 ", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_format_int("%-8d", 32), + "32 " + ]); } ], /* :: */[ /* tuple */[ "sign_p", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_pd */1, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 4, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "%+4d" - ]), 32), - 1: " +32", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_pd */1, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 4 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), + "%+4d" + ]), 32), + " +32" + ]); } ], /* :: */[ /* tuple */[ "sign_2p", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_sd */2, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 4, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "% 4d" - ]), 32), - 1: " 32", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_sd */2, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 4 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), + "% 4d" + ]), 32), + " 32" + ]); } ], /* :: */[ /* tuple */[ "sign_3p", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int32 */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 5 - }, - "%lu" - ]), -1), - 1: "4294967295", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int32 */Block.__(5, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%lu" + ]), -1), + "4294967295" + ]); } ], /* :: */[ /* tuple */[ "sign_4p", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int32 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 5 - }, - "%ld" - ]), -1), - 1: "-1", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int32 */Block.__(5, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%ld" + ]), -1), + "-1" + ]); } ], /* :: */[ /* tuple */[ "width_3", function () { - return /* Eq */{ - 0: Caml_format.caml_format_int("%032d", 32), - 1: "00000000000000000000000000000032", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_format_int("%032d", 32), + "00000000000000000000000000000032" + ]); } ], /* :: */[ /* tuple */[ "prec_1", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* Lit_precision */[10], - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - "%.10d" - ]), 32), - 1: "0000000032", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* Lit_precision */[10], + /* End_of_format */0 + ]), + "%.10d" + ]), 32), + "0000000032" + ]); } ], /* :: */[ /* tuple */[ "prec_2", function () { - return /* Eq */{ - 0: Caml_format.caml_format_int("%.10d", 32), - 1: "0000000032", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_format_int("%.10d", 32), + "0000000032" + ]); } ], /* :: */[ /* tuple */[ "prec_3", function () { - return /* Eq */{ - 0: Caml_format.caml_format_int("%.d", 32), - 1: "32", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_format_int("%.d", 32), + "32" + ]); } ], /* :: */[ /* tuple */[ "prec_4", function () { - return /* Eq */{ - 0: Caml_format.caml_format_int("%.d", 32), - 1: "32", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_format_int("%.d", 32), + "32" + ]); } ], /* [] */0 @@ -1881,24 +1408,20 @@ var float_data = /* array */[ function ident(ppf, s) { return Curry._1(Format.fprintf(ppf, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), s); } function kwd(ppf, s) { return Curry._1(Format.fprintf(ppf, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), s); } @@ -1908,11 +1431,7 @@ function pr_exp0(ppf, lam) { switch (lam.tag | 0) { case 1 : return Curry._2(Format.fprintf(ppf, /* Format */[ - /* Alpha */{ - 0: /* End_of_format */0, - length: 1, - tag: 15 - }, + /* Alpha */Block.__(15, [/* End_of_format */0]), "%a" ]), ident, lam[0]); case 0 : @@ -1923,43 +1442,25 @@ function pr_exp0(ppf, lam) { } if (exit === 1) { return Curry._2(Format.fprintf(ppf, /* Format */[ - /* Formatting_gen */{ - 0: /* Open_box */{ - 0: /* Format */[ - /* String_literal */{ - 0: "<1>", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - "<1>" - ], - length: 1, - tag: 1 - }, - 1: /* Char_literal */{ - 0: /* "(" */40, - 1: /* Alpha */{ - 0: /* Char_literal */{ - 0: /* ")" */41, - 1: /* Formatting_lit */{ - 0: /* Close_box */0, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 15 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 18 - }, + /* Formatting_gen */Block.__(18, [ + /* Open_box */Block.__(1, [/* Format */[ + /* String_literal */Block.__(11, [ + "<1>", + /* End_of_format */0 + ]), + "<1>" + ]]), + /* Char_literal */Block.__(12, [ + /* "(" */40, + /* Alpha */Block.__(15, [/* Char_literal */Block.__(12, [ + /* ")" */41, + /* Formatting_lit */Block.__(17, [ + /* Close_box */0, + /* End_of_format */0 + ]) + ])]) + ]) + ]), "@[<1>(%a)@]" ]), pr_lambda, lam); } @@ -1968,33 +1469,19 @@ function pr_exp0(ppf, lam) { function pr_app(ppf, e) { return Curry._2(Format.fprintf(ppf, /* Format */[ - /* Formatting_gen */{ - 0: /* Open_box */{ - 0: /* Format */[ - /* String_literal */{ - 0: "<2>", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - "<2>" - ], - length: 1, - tag: 1 - }, - 1: /* Alpha */{ - 0: /* Formatting_lit */{ - 0: /* Close_box */0, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 1, - tag: 15 - }, - length: 2, - tag: 18 - }, + /* Formatting_gen */Block.__(18, [ + /* Open_box */Block.__(1, [/* Format */[ + /* String_literal */Block.__(11, [ + "<2>", + /* End_of_format */0 + ]), + "<2>" + ]]), + /* Alpha */Block.__(15, [/* Formatting_lit */Block.__(17, [ + /* Close_box */0, + /* End_of_format */0 + ])]) + ]), "@[<2>%a@]" ]), pr_other_applications, e); } @@ -2006,26 +1493,14 @@ function pr_other_applications(ppf, f) { return pr_exp0(ppf, f); case 2 : return Curry._4(Format.fprintf(ppf, /* Format */[ - /* Alpha */{ - 0: /* Formatting_lit */{ - 0: /* Break */{ - 0: "@ ", - 1: 1, - 2: 0, - length: 3, - tag: 0 - }, - 1: /* Alpha */{ - 0: /* End_of_format */0, - length: 1, - tag: 15 - }, - length: 2, - tag: 17 - }, - length: 1, - tag: 15 - }, + /* Alpha */Block.__(15, [/* Formatting_lit */Block.__(17, [ + /* Break */Block.__(0, [ + "@ ", + 1, + 0 + ]), + /* Alpha */Block.__(15, [/* End_of_format */0]) + ])]), "%a@ %a" ]), pr_app, f[0], pr_exp0, f[1]); @@ -2036,56 +1511,26 @@ function pr_lambda(ppf, e) { switch (e.tag | 0) { case 0 : return Curry._8(Format.fprintf(ppf, /* Format */[ - /* Formatting_gen */{ - 0: /* Open_box */{ - 0: /* Format */[ - /* String_literal */{ - 0: "<1>", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - "<1>" - ], - length: 1, - tag: 1 - }, - 1: /* Alpha */{ - 0: /* Alpha */{ - 0: /* Alpha */{ - 0: /* Formatting_lit */{ - 0: /* Break */{ - 0: "@ ", - 1: 1, - 2: 0, - length: 3, - tag: 0 - }, - 1: /* Alpha */{ - 0: /* Formatting_lit */{ - 0: /* Close_box */0, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 1, - tag: 15 - }, - length: 2, - tag: 17 - }, - length: 1, - tag: 15 - }, - length: 1, - tag: 15 - }, - length: 1, - tag: 15 - }, - length: 2, - tag: 18 - }, + /* Formatting_gen */Block.__(18, [ + /* Open_box */Block.__(1, [/* Format */[ + /* String_literal */Block.__(11, [ + "<1>", + /* End_of_format */0 + ]), + "<1>" + ]]), + /* Alpha */Block.__(15, [/* Alpha */Block.__(15, [/* Alpha */Block.__(15, [/* Formatting_lit */Block.__(17, [ + /* Break */Block.__(0, [ + "@ ", + 1, + 0 + ]), + /* Alpha */Block.__(15, [/* Formatting_lit */Block.__(17, [ + /* Close_box */0, + /* End_of_format */0 + ])]) + ])])])]) + ]), "@[<1>%a%a%a@ %a@]" ]), kwd, "\\", ident, e[0], kwd, ".", pr_lambda, e[1]); case 1 : @@ -2096,11 +1541,7 @@ function pr_lambda(ppf, e) { } var string_of_lambda = Curry._1(Format.asprintf(/* Format */[ - /* Alpha */{ - 0: /* End_of_format */0, - length: 1, - tag: 15 - }, + /* Alpha */Block.__(15, [/* End_of_format */0]), "%a" ]), pr_lambda); @@ -2116,77 +1557,37 @@ var Lambda_suites = /* module */[ var lambda_suites = /* array */[ /* tuple */[ - /* Var */{ - 0: "x", - length: 1, - tag: 1 - }, + /* Var */Block.__(1, ["x"]), "x" ], /* tuple */[ - /* Apply */{ - 0: /* Var */{ - 0: "x", - length: 1, - tag: 1 - }, - 1: /* Var */{ - 0: "y", - length: 1, - tag: 1 - }, - length: 2, - tag: 2 - }, + /* Apply */Block.__(2, [ + /* Var */Block.__(1, ["x"]), + /* Var */Block.__(1, ["y"]) + ]), "x y" ], /* tuple */[ - /* Lambda */{ - 0: "z", - 1: /* Apply */{ - 0: /* Var */{ - 0: "x", - length: 1, - tag: 1 - }, - 1: /* Var */{ - 0: "y", - length: 1, - tag: 1 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 0 - }, + /* Lambda */Block.__(0, [ + "z", + /* Apply */Block.__(2, [ + /* Var */Block.__(1, ["x"]), + /* Var */Block.__(1, ["y"]) + ]) + ]), "\\z. x y" ], /* tuple */[ - /* Lambda */{ - 0: "z", - 1: /* Lambda */{ - 0: "z", - 1: /* Apply */{ - 0: /* Var */{ - 0: "x", - length: 1, - tag: 1 - }, - 1: /* Var */{ - 0: "y", - length: 1, - tag: 1 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 0 - }, - length: 2, - tag: 0 - }, + /* Lambda */Block.__(0, [ + "z", + /* Lambda */Block.__(0, [ + "z", + /* Apply */Block.__(2, [ + /* Var */Block.__(1, ["x"]), + /* Var */Block.__(1, ["y"]) + ]) + ]) + ]), "\\z. \\z. x y" ] ]; @@ -2197,28 +1598,22 @@ function from_lambda_pairs() { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "lambda_print ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "lambda_print ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "lambda_print %d" ]), i), function () { - return /* Eq */{ - 0: Curry._1(string_of_lambda, a), - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(string_of_lambda, a), + b + ]); } ]; }, lambda_suites)); @@ -2232,35 +1627,25 @@ var ksprintf_suites_000 = /* tuple */[ return x + x; }, fmt); }; - return /* Eq */{ - 0: Curry._2(f(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " a ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - "%s %s a " - ]), "x", "xx"), - 1: "x xx a x xx a ", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._2(f(/* Format */[ + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " a ", + /* End_of_format */0 + ]) + ]) + ]) + ]), + "%s %s a " + ]), "x", "xx"), + "x xx a x xx a " + ]); } ]; @@ -2268,30 +1653,22 @@ var ksprintf_suites_001 = /* :: */[ /* tuple */[ "sprintf", function () { - return /* Eq */{ - 0: Curry._2(Format.sprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - "%s %S" - ]), "x", "X"), - 1: 'x "X"', - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._2(Format.sprintf(/* Format */[ + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), + "%s %S" + ]), "x", "X"), + 'x "X"' + ]); } ], /* [] */0 @@ -2305,22 +1682,18 @@ var ksprintf_suites = /* :: */[ var int64_suites_000 = /* tuple */[ "i32_simple", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Nativeint */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 6 - }, - "%nx" - ]), 4294967295), - 1: "ffffffff", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Nativeint */Block.__(6, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%nx" + ]), 4294967295), + "ffffffff" + ]); } ]; @@ -2328,619 +1701,509 @@ var int64_suites_001 = /* :: */[ /* tuple */[ "i32_simple1", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Nativeint */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 6 - }, - "%no" - ]), 4294967295), - 1: "37777777777", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Nativeint */Block.__(6, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%no" + ]), 4294967295), + "37777777777" + ]); } ], /* :: */[ /* tuple */[ "i64_simple", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Ld" - ]), /* int64 */[ - 0, - 3 - ]), - 1: "3", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Ld" + ]), /* int64 */[ + 0, + 3 + ]), + "3" + ]); } ], /* :: */[ /* tuple */[ "i64_simple2", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Lx" - ]), /* int64 */[ - 0, - 33 - ]), - 1: "21", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Lx" + ]), /* int64 */[ + 0, + 33 + ]), + "21" + ]); } ], /* :: */[ /* tuple */[ "i64_simple3", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Li" - ]), /* int64 */[ - 0, - 33 - ]), - 1: "33", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Li" + ]), /* int64 */[ + 0, + 33 + ]), + "33" + ]); } ], /* :: */[ /* tuple */[ "i64_simple4", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%LX" - ]), /* int64 */[ - 0, - 44 - ]), - 1: "2C", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%LX" + ]), /* int64 */[ + 0, + 44 + ]), + "2C" + ]); } ], /* :: */[ /* tuple */[ "i64_simple5", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Lx" - ]), /* int64 */[ - 0, - 44 - ]), - 1: "2c", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Lx" + ]), /* int64 */[ + 0, + 44 + ]), + "2c" + ]); } ], /* :: */[ /* tuple */[ "i64_simple6", function () { - return /* Eq */{ - 0: Curry._2(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_x */6, - 1: /* Arg_padding */{ - 0: /* Right */1, - length: 1, - tag: 1 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%*Lx" - ]), 5, /* int64 */[ - 0, - 44 - ]), - 1: " 2c", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._2(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_x */6, + /* Arg_padding */Block.__(1, [/* Right */1]), + /* No_precision */0, + /* End_of_format */0 + ]), + "%*Lx" + ]), 5, /* int64 */[ + 0, + 44 + ]), + " 2c" + ]); } ], /* :: */[ /* tuple */[ "i64_simple7", function () { - return /* Eq */{ - 0: Caml_format.caml_int64_format("%d", /* int64 */[ - 0, - 3333 - ]), - 1: "3333", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_int64_format("%d", /* int64 */[ + 0, + 3333 + ]), + "3333" + ]); } ], /* :: */[ /* tuple */[ "i64_simple8", function () { - return /* Eq */{ - 0: Curry._2(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Int64 */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 18, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - length: 4, - tag: 7 - }, - "%Ld%018Ld" - ]), /* int64 */[ - 0, - 3 - ], /* int64 */[ - 0, - 3 - ]), - 1: "3000000000000000003", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._2(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 18 + ]), + /* No_precision */0, + /* End_of_format */0 + ]) + ]), + "%Ld%018Ld" + ]), /* int64 */[ + 0, + 3 + ], /* int64 */[ + 0, + 3 + ]), + "3000000000000000003" + ]); } ], /* :: */[ /* tuple */[ "i64_simple9", function () { - return /* Eq */{ - 0: Curry._2(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Int64 */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 18, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - length: 4, - tag: 7 - }, - "%Ld%018Ld" - ]), /* int64 */[ - 107288, - 1548746752 - ], /* int64 */[ - 0, - 0 - ]), - 1: "460800000000000000000000000000000", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._2(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 18 + ]), + /* No_precision */0, + /* End_of_format */0 + ]) + ]), + "%Ld%018Ld" + ]), /* int64 */[ + 107288, + 1548746752 + ], /* int64 */[ + 0, + 0 + ]), + "460800000000000000000000000000000" + ]); } ], /* :: */[ /* tuple */[ "i64_simple10", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Lx" - ]), Int64.max_int), - 1: "7fffffffffffffff", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Lx" + ]), Int64.max_int), + "7fffffffffffffff" + ]); } ], /* :: */[ /* tuple */[ "i64_simple15", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Ld" - ]), /* int64 */[ - -1, - 4294967295 - ]), - 1: "-1", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Ld" + ]), /* int64 */[ + -1, + 4294967295 + ]), + "-1" + ]); } ], /* :: */[ /* tuple */[ "i64_simple16", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Ld" - ]), /* int64 */[ - -1, - 4294956185 - ]), - 1: "-11111", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Ld" + ]), /* int64 */[ + -1, + 4294956185 + ]), + "-11111" + ]); } ], /* :: */[ /* tuple */[ "i64_simple14", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%LX" - ]), /* int64 */[ - -1, - 4294967295 - ]), - 1: "FFFFFFFFFFFFFFFF", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%LX" + ]), /* int64 */[ + -1, + 4294967295 + ]), + "FFFFFFFFFFFFFFFF" + ]); } ], /* :: */[ /* tuple */[ "i64_simple17", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Lx" - ]), /* int64 */[ - -1, - 4294967295 - ]), - 1: "ffffffffffffffff", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Lx" + ]), /* int64 */[ + -1, + 4294967295 + ]), + "ffffffffffffffff" + ]); } ], /* :: */[ /* tuple */[ "i64_simple11", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%LX" - ]), Int64.max_int), - 1: "7FFFFFFFFFFFFFFF", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%LX" + ]), Int64.max_int), + "7FFFFFFFFFFFFFFF" + ]); } ], /* :: */[ /* tuple */[ "i64_simple12", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%LX" - ]), Int64.min_int), - 1: "8000000000000000", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%LX" + ]), Int64.min_int), + "8000000000000000" + ]); } ], /* :: */[ /* tuple */[ "i64_simple17", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Lu" - ]), /* int64 */[ - -1, - 4294967295 - ]), - 1: "18446744073709551615", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Lu" + ]), /* int64 */[ + -1, + 4294967295 + ]), + "18446744073709551615" + ]); } ], /* :: */[ /* tuple */[ "i64_simple21", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_u */12, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Lu" - ]), /* int64 */[ - -1, - 4294957296 - ]), - 1: "18446744073709541616", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_u */12, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Lu" + ]), /* int64 */[ + -1, + 4294957296 + ]), + "18446744073709541616" + ]); } ], /* :: */[ /* tuple */[ "i64_simple19", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_o */10, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%Lo" - ]), Int64.min_int), - 1: "1000000000000000000000", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_o */10, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%Lo" + ]), Int64.min_int), + "1000000000000000000000" + ]); } ], /* :: */[ /* tuple */[ "i64_simple13", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%LX" - ]), Caml_int64.add(Int64.min_int, /* int64 */[ - 0, - 1 - ])), - 1: "8000000000000001", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%LX" + ]), Caml_int64.add(Int64.min_int, /* int64 */[ + 0, + 1 + ])), + "8000000000000001" + ]); } ], /* :: */[ /* tuple */[ "i64_simple20", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_x */6, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 12, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%12Lx" - ]), /* int64 */[ - 0, - 3 - ]), - 1: " 3", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_x */6, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 12 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), + "%12Lx" + ]), /* int64 */[ + 0, + 3 + ]), + " 3" + ]); } ], /* :: */[ /* tuple */[ "i64_simple21", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_X */8, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, - "%LX" - ]), /* int64 */[ - 1859194407, - 1163551168 - ]), - 1: "6ED10E27455A61C0", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_X */8, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), + "%LX" + ]), /* int64 */[ + 1859194407, + 1163551168 + ]), + "6ED10E27455A61C0" + ]); } ], /* :: */[ /* tuple */[ "missing_neline", function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 7 - }, - "%Ld\n" - ]), /* int64 */[ - 0, - 32 - ]), - 1: "32\n", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(/* Format */[ + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), + "%Ld\n" + ]), /* int64 */[ + 0, + 32 + ]), + "32\n" + ]); } ], /* :: */[ @@ -2948,30 +2211,24 @@ var int64_suites_001 = /* :: */[ "missing_newline2", function () { var buf = Buffer.create(30); - return /* Eq */{ - 0: (Curry._1(Printf.bprintf(buf, /* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 7 - }, - "%Ld\n" - ]), /* int64 */[ - 0, - 32 - ]), Buffer.contents(buf)), - 1: "32\n", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + (Curry._1(Printf.bprintf(buf, /* Format */[ + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), + "%Ld\n" + ]), /* int64 */[ + 0, + 32 + ]), Buffer.contents(buf)), + "32\n" + ]); } ], /* [] */0 @@ -3078,28 +2335,22 @@ Mt.from_pair_suites("caml_format_test.ml", Pervasives.$at(suites, Pervasives.$at var fmt = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "float_format ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "float_format ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "float_format %d" ]), i), function () { - return /* Eq */{ - 0: Caml_format.caml_format_float(fmt, f), - 1: str_result, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_format_float(fmt, f), + str_result + ]); } ]; }, float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi(function (i, param) { @@ -3107,33 +2358,25 @@ Mt.from_pair_suites("caml_format_test.ml", Pervasives.$at(suites, Pervasives.$at var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "int64_of_string ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "int64_of_string ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "int64_of_string %d " ]), i), function () { - return /* Eq */{ - 0: Caml_format.caml_int64_of_string(b), - 1: a, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_format.caml_int64_of_string(b), + a + ]); } ]; }, of_string_data))))))))); diff --git a/jscomp/test/class3_test.js b/jscomp/test/class3_test.js index c879486aae..a2f1506639 100644 --- a/jscomp/test/class3_test.js +++ b/jscomp/test/class3_test.js @@ -5,6 +5,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); var List = require("../stdlib/list"); @@ -70,12 +71,10 @@ function eq(loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Eq */{ - 0: x, - 1: y, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + y + ]); } ], suites[0] diff --git a/jscomp/test/class4_test.js b/jscomp/test/class4_test.js index 767f3b4948..3bc691db7f 100644 --- a/jscomp/test/class4_test.js +++ b/jscomp/test/class4_test.js @@ -3,6 +3,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); @@ -28,12 +29,10 @@ function eq(loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Eq */{ - 0: x, - 1: y, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + y + ]); } ], suites[0] diff --git a/jscomp/test/class5_test.js b/jscomp/test/class5_test.js index b5666b1126..26dc977f6b 100644 --- a/jscomp/test/class5_test.js +++ b/jscomp/test/class5_test.js @@ -3,6 +3,7 @@ var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); var List = require("../stdlib/list"); @@ -29,12 +30,10 @@ function eq(loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Eq */{ - 0: x, - 1: y, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + y + ]); } ], suites[0] diff --git a/jscomp/test/class6_test.js b/jscomp/test/class6_test.js index 358227f35f..5c9c011a9b 100644 --- a/jscomp/test/class6_test.js +++ b/jscomp/test/class6_test.js @@ -5,6 +5,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); @@ -27,12 +28,10 @@ function eq(loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Eq */{ - 0: x, - 1: y, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + y + ]); } ], suites[0] diff --git a/jscomp/test/class7_test.js b/jscomp/test/class7_test.js index 439bdc2b54..bb76d58f72 100644 --- a/jscomp/test/class7_test.js +++ b/jscomp/test/class7_test.js @@ -4,6 +4,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); var Oo = require("../stdlib/oo"); @@ -41,12 +42,10 @@ function eq(loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Eq */{ - 0: x, - 1: y, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + y + ]); } ], suites[0] diff --git a/jscomp/test/class8_test.js b/jscomp/test/class8_test.js index b70a00bcf0..2e866de4a6 100644 --- a/jscomp/test/class8_test.js +++ b/jscomp/test/class8_test.js @@ -4,6 +4,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); @@ -24,12 +25,10 @@ function eq(loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Eq */{ - 0: x, - 1: y, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + y + ]); } ], suites[0] diff --git a/jscomp/test/class_test.js b/jscomp/test/class_test.js index aaac0b853d..2e9d61a72f 100644 --- a/jscomp/test/class_test.js +++ b/jscomp/test/class_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); @@ -90,48 +91,40 @@ Mt.from_pair_suites("class_test.ml", /* :: */[ /* tuple */[ 'File "class_test.ml", line 33, characters 4-11', function () { - return /* Eq */{ - 0: zero, - 1: 0, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + zero, + 0 + ]); } ], /* :: */[ /* tuple */[ 'File "class_test.ml", line 34, characters 4-11', function () { - return /* Eq */{ - 0: three, - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + three, + 3 + ]); } ], /* :: */[ /* tuple */[ 'File "class_test.ml", line 35, characters 4-11', function () { - return /* Eq */{ - 0: one, - 1: 1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + one, + 1 + ]); } ], /* :: */[ /* tuple */[ 'File "class_test.ml", line 36, characters 4-11', function () { - return /* Eq */{ - 0: two, - 1: 2, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + two, + 2 + ]); } ], /* [] */0 diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index d771c6caea..05f85aeb12 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -3,6 +3,7 @@ var Bytes = require("../stdlib/bytes"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Caml_string = require("../runtime/caml_string"); function fib(n) { @@ -136,12 +137,10 @@ function string_escaped(s) { var suites_000 = /* tuple */[ "complete_escape", function () { - return /* Eq */{ - 0: Bytes.to_string(escaped(Bytes.of_string("\0\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), - 1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Bytes.to_string(escaped(Bytes.of_string("\0\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), + "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" + ]); } ]; diff --git a/jscomp/test/complex_test.js b/jscomp/test/complex_test.js index 6c168a7dfe..57dd108639 100644 --- a/jscomp/test/complex_test.js +++ b/jscomp/test/complex_test.js @@ -3,19 +3,18 @@ var Complex = require("../stdlib/complex"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var suites_000 = /* tuple */[ "basic_add", function () { - return /* Eq */{ - 0: /* float array */[ - 2, - 2 - ], - 1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* float array */[ + 2, + 2 + ], + Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) + ]); } ]; diff --git a/jscomp/test/const_block_test.js b/jscomp/test/const_block_test.js index 4537f395f1..e3a2f2349c 100644 --- a/jscomp/test/const_block_test.js +++ b/jscomp/test/const_block_test.js @@ -1,7 +1,8 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); var a = /* float array */[ 0, @@ -36,18 +37,16 @@ function h() { function g() { f(/* () */0); - return /* Eq */{ - 0: /* tuple */[ - a[0], - b[0] - ], - 1: /* tuple */[ - 3.0, - 3 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + a[0], + b[0] + ], + /* tuple */[ + 3.0, + 3 + ] + ]); } var suites_000 = /* tuple */[ @@ -61,19 +60,17 @@ var suites_001 = /* :: */[ function () { c[0] = 3; c[1] = 4; - return /* Eq */{ - 0: /* array */[ - 3, - 4, - 2, - 3, - 4, - 5 - ], - 1: c, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* array */[ + 3, + 4, + 2, + 3, + 4, + 5 + ], + c + ]); } ], /* [] */0 diff --git a/jscomp/test/const_test.js b/jscomp/test/const_test.js index 88464cb45e..0894c46df5 100644 --- a/jscomp/test/const_test.js +++ b/jscomp/test/const_test.js @@ -1,6 +1,7 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); function f(x) { return x; @@ -11,11 +12,7 @@ function ff(x) { } function fff(x) { - var match = /* A */{ - 0: x, - length: 1, - tag: 0 - }; + var match = /* A */Block.__(0, [x]); switch (match.tag | 0) { case 0 : return x; diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index 719118a214..792fce552f 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Caml_array = require("../runtime/caml_array"); var $$Array = require("../stdlib/array"); @@ -77,36 +78,30 @@ Mt.from_pair_suites("cps_test.ml", /* :: */[ /* tuple */[ "cps_test_sum", function () { - return /* Eq */{ - 0: 55, - 1: test(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 55, + test(/* () */0) + ]); } ], /* :: */[ /* tuple */[ "cps_test_closure", function () { - return /* Eq */{ - 0: 15, - 1: test_closure(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 15, + test_closure(/* () */0) + ]); } ], /* :: */[ /* tuple */[ "cps_test_closure2", function () { - return /* Eq */{ - 0: 30, - 1: test_closure2(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 30, + test_closure2(/* () */0) + ]); } ], /* [] */0 diff --git a/jscomp/test/digest_test.js b/jscomp/test/digest_test.js index 3ec59c7014..9e715ef16e 100644 --- a/jscomp/test/digest_test.js +++ b/jscomp/test/digest_test.js @@ -4,6 +4,7 @@ var Bytes = require("../stdlib/bytes"); var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Digest = require("../stdlib/digest"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); @@ -152,48 +153,40 @@ Mt.from_pair_suites("digest_test.ml", Pervasives.$at(/* :: */[ /* tuple */[ 'File "digest_test.ml", line 6, characters 4-11', function () { - return /* Eq */{ - 0: Digest.to_hex(Digest.string("value")), - 1: "2063c1608d6e0baf80249c42e2be5804", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Digest.to_hex(Digest.string("value")), + "2063c1608d6e0baf80249c42e2be5804" + ]); } ], /* :: */[ /* tuple */[ 'File "digest_test.ml", line 7, characters 4-11', function () { - return /* Eq */{ - 0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), - 1: "9e107d9d372bb6826bd81d3542a419d6", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), + "9e107d9d372bb6826bd81d3542a419d6" + ]); } ], /* :: */[ /* tuple */[ 'File "digest_test.ml", line 9, characters 4-11', function () { - return /* Eq */{ - 0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), - 1: "e4d909c290d0fb1ca068ffaddf22cbd0", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), + "e4d909c290d0fb1ca068ffaddf22cbd0" + ]); } ], /* :: */[ /* tuple */[ 'File "digest_test.ml", line 11, characters 4-11', function () { - return /* Eq */{ - 0: Digest.to_hex(Digest.string("")), - 1: "d41d8cd98f00b204e9800998ecf8427e", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Digest.to_hex(Digest.string("")), + "d41d8cd98f00b204e9800998ecf8427e" + ]); } ], /* :: */[ @@ -201,12 +194,10 @@ Mt.from_pair_suites("digest_test.ml", Pervasives.$at(/* :: */[ 'File "digest_test.ml", line 12, characters 4-11', function () { var x = "The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog."; - return /* Eq */{ - 0: Digest.to_hex(Digest.string(x)), - 1: "7065cc36bba1d155fb09f9d02f22e8bf", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Digest.to_hex(Digest.string(x)), + "7065cc36bba1d155fb09f9d02f22e8bf" + ]); } ], /* :: */[ @@ -214,12 +205,10 @@ Mt.from_pair_suites("digest_test.ml", Pervasives.$at(/* :: */[ 'File "digest_test.ml", line 13, characters 4-11', function () { var x = "The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog."; - return /* Eq */{ - 0: Digest.to_hex(Digest.string(x)), - 1: "b9193d1df4b7a8f0a25ffdd1005c5b2b", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Digest.to_hex(Digest.string(x)), + "b9193d1df4b7a8f0a25ffdd1005c5b2b" + ]); } ], /* [] */0 @@ -231,23 +220,19 @@ Mt.from_pair_suites("digest_test.ml", Pervasives.$at(/* :: */[ ], $$Array.to_list($$Array.map(function (i) { return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%d" ]), i), function () { - return /* Eq */{ - 0: Digest.to_hex(Digest.string(Caml_string.bytes_to_string(Bytes.make(i, /* "a" */97)))), - 1: ref[i], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Digest.to_hex(Digest.string(Caml_string.bytes_to_string(Bytes.make(i, /* "a" */97)))), + ref[i] + ]); } ]; }, Ext_array.range(0, 129))))); diff --git a/jscomp/test/epsilon_test.js b/jscomp/test/epsilon_test.js index 5702335d52..12cd27d6ac 100644 --- a/jscomp/test/epsilon_test.js +++ b/jscomp/test/epsilon_test.js @@ -3,18 +3,17 @@ var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var v = (Number.EPSILON?Number.EPSILON:2.220446049250313e-16); var suites_000 = /* tuple */[ "epsilon", function () { - return /* Eq */{ - 0: Pervasives.epsilon_float, - 1: v, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Pervasives.epsilon_float, + v + ]); } ]; @@ -22,12 +21,10 @@ var suites_001 = /* :: */[ /* tuple */[ "raw_epsilon", function () { - return /* Eq */{ - 0: 2.220446049250313e-16, - 1: v, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 2.220446049250313e-16, + v + ]); } ], /* [] */0 diff --git a/jscomp/test/es6_module_test.js b/jscomp/test/es6_module_test.js index 872701e47c..38df71db6a 100644 --- a/jscomp/test/es6_module_test.js +++ b/jscomp/test/es6_module_test.js @@ -1,8 +1,9 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); -var List = require("../stdlib/list"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); +var List = require("../stdlib/list"); function length() { return 3; @@ -12,30 +13,26 @@ Mt.from_pair_suites("es6_module_test.ml", /* :: */[ /* tuple */[ "list_length", function () { - return /* Eq */{ - 0: List.length(/* :: */[ - 1, - /* :: */[ - 2, - /* [] */0 - ] - ]), - 1: 2, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + List.length(/* :: */[ + 1, + /* :: */[ + 2, + /* [] */0 + ] + ]), + 2 + ]); } ], /* :: */[ /* tuple */[ "length", function () { - return /* Eq */{ - 0: 3, - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3, + 3 + ]); } ], /* [] */0 diff --git a/jscomp/test/exception_raise_test.js b/jscomp/test/exception_raise_test.js index aa8738cdd8..8330f261f2 100644 --- a/jscomp/test/exception_raise_test.js +++ b/jscomp/test/exception_raise_test.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Local = Caml_exceptions.create("Exception_raise_test.Local"); @@ -102,20 +103,18 @@ Mt.from_pair_suites("exception_raise_test.ml", /* :: */[ /* tuple */[ 'File "exception_raise_test.ml", line 97, characters 4-11', function () { - return /* Eq */{ - 0: /* tuple */[ - f, - ff, - fff - ], - 1: /* tuple */[ - 2, - 2, - 2 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + f, + ff, + fff + ], + /* tuple */[ + 2, + 2, + 2 + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/ext_log.js b/jscomp/test/ext_log.js index 0ef901c679..c615ad742d 100644 --- a/jscomp/test/ext_log.js +++ b/jscomp/test/ext_log.js @@ -2,31 +2,26 @@ 'use strict'; var Pervasives = require("../stdlib/pervasives"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Lam_current_unit = require("./lam_current_unit"); var Format = require("../stdlib/format"); function err(str, f) { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]), "%s " ], Pervasives.$caret$caret(f, /* Format */[ - /* Formatting_lit */{ - 0: /* Flush_newline */4, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, + /* Formatting_lit */Block.__(17, [ + /* Flush_newline */4, + /* End_of_format */0 + ]), "@." ]))), str); } @@ -34,33 +29,25 @@ function err(str, f) { function ierr(b, str, f) { if (b) { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]), "%s " ], f)), str); } else { return Curry._1(Format.ifprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]), "%s " ], f)), str); } @@ -68,30 +55,22 @@ function ierr(b, str, f) { function warn(str, f) { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "WARN: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "WARN: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "WARN: %s " ], Pervasives.$caret$caret(f, /* Format */[ - /* Formatting_lit */{ - 0: /* Flush_newline */4, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, + /* Formatting_lit */Block.__(17, [ + /* Flush_newline */4, + /* End_of_format */0 + ]), "@." ]))), str); } @@ -99,43 +78,31 @@ function warn(str, f) { function iwarn(b, str, f) { if (b) { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "WARN: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "WARN: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "WARN: %s " ], f)), str); } else { return Curry._1(Format.ifprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "WARN: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "WARN: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "WARN: %s " ], f)), str); } @@ -144,59 +111,43 @@ function iwarn(b, str, f) { function dwarn(str, f) { if (Lam_current_unit.is_same_file(/* () */0)) { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "WARN: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "WARN: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "WARN: %s " ], Pervasives.$caret$caret(f, /* Format */[ - /* Formatting_lit */{ - 0: /* Flush_newline */4, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, + /* Formatting_lit */Block.__(17, [ + /* Flush_newline */4, + /* End_of_format */0 + ]), "@." ]))), str); } else { return Curry._1(Format.ifprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "WARN: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "WARN: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "WARN: %s " ], Pervasives.$caret$caret(f, /* Format */[ - /* Formatting_lit */{ - 0: /* Flush_newline */4, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, + /* Formatting_lit */Block.__(17, [ + /* Flush_newline */4, + /* End_of_format */0 + ]), "@." ]))), str); } @@ -204,22 +155,16 @@ function dwarn(str, f) { function info(str, f) { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "INFO: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "INFO: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "INFO: %s " ], f)), str); } @@ -227,43 +172,31 @@ function info(str, f) { function iinfo(b, str, f) { if (b) { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "INFO: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "INFO: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "INFO: %s " ], f)), str); } else { return Curry._1(Format.fprintf(Format.err_formatter, Pervasives.$caret$caret(/* Format */[ - /* String_literal */{ - 0: "INFO: ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "INFO: ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), "INFO: %s " ], f)), str); } diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index ac073ce5eb..2e430e1f64 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Str = Caml_exceptions.create("Extensible_variant_test.Str"); @@ -38,16 +39,14 @@ function to_int(x) { var suites_000 = /* tuple */[ "test_int", function () { - return /* Eq */{ - 0: 3, - 1: to_int([ - Int, - 3, - 0 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3, + to_int([ + Int, + 3, + 0 + ]) + ]); } ]; @@ -55,31 +54,27 @@ var suites_001 = /* :: */[ /* tuple */[ "test_int2", function () { - return /* Eq */{ - 0: 0, - 1: to_int([ - Int$1, - 3, - 0 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 0, + to_int([ + Int$1, + 3, + 0 + ]) + ]); } ], /* :: */[ /* tuple */[ "test_string", function () { - return /* Eq */{ - 0: -1, - 1: to_int([ - Str, - "x" - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -1, + to_int([ + Str, + "x" + ]) + ]); } ], /* [] */0 diff --git a/jscomp/test/ffi_arity_test.js b/jscomp/test/ffi_arity_test.js index 6357da2e74..8009bfccd5 100644 --- a/jscomp/test/ffi_arity_test.js +++ b/jscomp/test/ffi_arity_test.js @@ -3,6 +3,7 @@ var Mt = require("./mt"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); function f(v) { @@ -52,101 +53,91 @@ Mt.from_pair_suites("ffi_arity_test.ml", /* :: */[ /* tuple */[ 'File "ffi_arity_test.ml", line 23, characters 4-11', function () { - return /* Eq */{ - 0: v, - 1: /* int array */[ - 0, - 1, - 4 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + v, + /* int array */[ + 0, + 1, + 4 + ] + ]); } ], /* :: */[ /* tuple */[ 'File "ffi_arity_test.ml", line 24, characters 4-11', function () { - return /* Eq */{ - 0: vv, - 1: /* int array */[ - 1, - 3, - 5 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + vv, + /* int array */[ + 1, + 3, + 5 + ] + ]); } ], /* :: */[ /* tuple */[ 'File "ffi_arity_test.ml", line 25, characters 4-11', function () { - return /* Eq */{ - 0: hh, - 1: /* int array */[ - 1, - 2, - 3 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + hh, + /* int array */[ + 1, + 2, + 3 + ] + ]); } ], /* :: */[ /* tuple */[ 'File "ffi_arity_test.ml", line 26, characters 4-11', function () { - return /* Eq */{ - 0: /* int array */[ - 1, - 2, - 3 - ].map(function (x) { - return function (y) { - return x + y | 0; - }; - }).map(function (y) { - return Caml_int32.imul(Curry._1(y, 0), Curry._1(y, 1)); - }), - 1: /* int array */[ - 2, - 6, - 12 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int array */[ + 1, + 2, + 3 + ].map(function (x) { + return function (y) { + return x + y | 0; + }; + }).map(function (y) { + return Caml_int32.imul(Curry._1(y, 0), Curry._1(y, 1)); + }), + /* int array */[ + 2, + 6, + 12 + ] + ]); } ], /* :: */[ /* tuple */[ 'File "ffi_arity_test.ml", line 31, characters 4-11', function () { - return /* Eq */{ - 0: /* int array */[ + return /* Eq */Block.__(0, [ + /* int array */[ + 1, + 2, + 3 + ].map(function (param, param$1) { + return Curry._2(function (x) { + var y = Caml_int32.imul(x, x); + return function (i) { + return y + i | 0; + }; + }, param, param$1); + }), + /* int array */[ 1, - 2, - 3 - ].map(function (param, param$1) { - return Curry._2(function (x) { - var y = Caml_int32.imul(x, x); - return function (i) { - return y + i | 0; - }; - }, param, param$1); - }), - 1: /* int array */[ - 1, - 5, - 11 - ], - length: 2, - tag: 0 - }; + 5, + 11 + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/float_of_bits_test.js b/jscomp/test/float_of_bits_test.js index 1f473c8db0..3daed0a4c2 100644 --- a/jscomp/test/float_of_bits_test.js +++ b/jscomp/test/float_of_bits_test.js @@ -5,6 +5,7 @@ var Caml_int64 = require("../runtime/caml_int64"); var Caml_float = require("../runtime/caml_float"); var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var $$Array = require("../stdlib/array"); @@ -33,55 +34,43 @@ function from_pairs() { return /* :: */[ /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "int32_float_of_bits ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "int32_float_of_bits ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "int32_float_of_bits %d" ]), i), function () { - return /* Eq */{ - 0: Caml_float.caml_int32_float_of_bits(i32), - 1: f, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_float.caml_int32_float_of_bits(i32), + f + ]); } ], /* :: */[ /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "int32_bits_of_float ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "int32_bits_of_float ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "int32_bits_of_float %d" ]), i), function () { - return /* Eq */{ - 0: Caml_float.caml_int32_bits_of_float(f), - 1: i32, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_float.caml_int32_bits_of_float(f), + i32 + ]); } ], /* [] */0 @@ -94,24 +83,20 @@ var suites = Pervasives.$at(/* :: */[ /* tuple */[ "one", function () { - return /* Eq */{ - 0: Caml_int64.bits_of_float(1.0), - 1: one_float, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.bits_of_float(1.0), + one_float + ]); } ], /* :: */[ /* tuple */[ "two", function () { - return /* Eq */{ - 0: Caml_int64.float_of_bits(one_float), - 1: 1.0, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.float_of_bits(one_float), + 1.0 + ]); } ], /* [] */0 diff --git a/jscomp/test/float_test.js b/jscomp/test/float_test.js index d306bc13cb..fea34469ea 100644 --- a/jscomp/test/float_test.js +++ b/jscomp/test/float_test.js @@ -4,6 +4,7 @@ var Caml_float = require("../runtime/caml_float"); var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Mt_global = require("./mt_global"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); @@ -121,28 +122,22 @@ function from_pairs(ps) { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "pair ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "pair ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "pair %d" ]), i), function () { - return /* Approx */{ - 0: a, - 1: b, - length: 2, - tag: 2 - }; + return /* Approx */Block.__(2, [ + a, + b + ]); } ]; }, ps)); @@ -242,48 +237,40 @@ Mt.from_pair_suites("float_test.ml", Pervasives.$at(/* :: */[ /* tuple */[ "mod_float", function () { - return /* Approx */{ - 0: 3.2 % 0.5, - 1: 0.200000000000000178, - length: 2, - tag: 2 - }; + return /* Approx */Block.__(2, [ + 3.2 % 0.5, + 0.200000000000000178 + ]); } ], /* :: */[ /* tuple */[ "modf_float1", function () { - return /* Approx */{ - 0: a, - 1: 0.299999999999997158, - length: 2, - tag: 2 - }; + return /* Approx */Block.__(2, [ + a, + 0.299999999999997158 + ]); } ], /* :: */[ /* tuple */[ "modf_float2", function () { - return /* Approx */{ - 0: b, - 1: 32, - length: 2, - tag: 2 - }; + return /* Approx */Block.__(2, [ + b, + 32 + ]); } ], /* :: */[ /* tuple */[ "int_of_float", function () { - return /* Eq */{ - 0: 3.2 | 0, - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3.2 | 0, + 3 + ]); } ], /* [] */0 diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index f9dd6b424a..279239a98e 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -2,6 +2,7 @@ 'use strict'; var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Caml_array = require("../runtime/caml_array"); var $$Array = require("../stdlib/array"); @@ -211,12 +212,10 @@ function for_9() { var suites_000 = /* tuple */[ "for_loop_test_3", function () { - return /* Eq */{ - 0: 90, - 1: for_3(Caml_array.caml_make_vect(10, 2)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 90, + for_3(Caml_array.caml_make_vect(10, 2)) + ]); } ]; @@ -224,86 +223,74 @@ var suites_001 = /* :: */[ /* tuple */[ "for_loop_test_4", function () { - return /* Eq */{ - 0: 180, - 1: for_4(Caml_array.caml_make_vect(10, 2)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 180, + for_4(Caml_array.caml_make_vect(10, 2)) + ]); } ], /* :: */[ /* tuple */[ "for_loop_test_5", function () { - return /* Eq */{ - 0: 2420, - 1: for_5(Caml_array.caml_make_vect(10, 2), 11), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 2420, + for_5(Caml_array.caml_make_vect(10, 2), 11) + ]); } ], /* :: */[ /* tuple */[ "for_loop_test_6", function () { - return /* Eq */{ - 0: /* int array */[ - 30, - 1, - 2, - 3 - ], - 1: for_6(Caml_array.caml_make_vect(3, 0), 0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int array */[ + 30, + 1, + 2, + 3 + ], + for_6(Caml_array.caml_make_vect(3, 0), 0) + ]); } ], /* :: */[ /* tuple */[ "for_loop_test_7", function () { - return /* Eq */{ - 0: 84, - 1: for_7(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 84, + for_7(/* () */0) + ]); } ], /* :: */[ /* tuple */[ "for_loop_test_8", function () { - return /* Eq */{ - 0: 294, - 1: for_8(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 294, + for_8(/* () */0) + ]); } ], /* :: */[ /* tuple */[ "for_loop_test_9", function () { - return /* Eq */{ - 0: /* array */[/* tuple */[ - 10, - /* int array */[ - 1, - 2, - 2, - 3 - ], - 5 - ]], - 1: for_9(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* array */[/* tuple */[ + 10, + /* int array */[ + 1, + 2, + 2, + 3 + ], + 5 + ]], + for_9(/* () */0) + ]); } ], /* [] */0 diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index 256d591abc..7a0ed7fda0 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -1,7 +1,8 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); function tst() { for(var i = (console.log("hi"), 0) ,i_finish = (console.log("hello"), 3); i <= i_finish; ++i){ @@ -23,12 +24,10 @@ function test2() { var suites_000 = /* tuple */[ "for_order", function () { - return /* Eq */{ - 0: 10, - 1: test2(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 10, + test2(/* () */0) + ]); } ]; diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index 5b99f33d46..4ac610ac1e 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -3,6 +3,7 @@ var Stream = require("../stdlib/stream"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Genlex = require("../stdlib/genlex"); var List = require("../stdlib/list"); @@ -65,61 +66,31 @@ function to_list(s) { var suites_000 = /* tuple */[ "lexer_stream_genlex", function () { - return /* Eq */{ - 0: /* :: */[ - /* Int */{ - 0: 3, - length: 1, - tag: 2 - }, + return /* Eq */Block.__(0, [ /* :: */[ - /* Kwd */{ - 0: "(", - length: 1, - tag: 0 - }, + /* Int */Block.__(2, [3]), /* :: */[ - /* Int */{ - 0: 3, - length: 1, - tag: 2 - }, + /* Kwd */Block.__(0, ["("]), /* :: */[ - /* Kwd */{ - 0: "+", - length: 1, - tag: 0 - }, + /* Int */Block.__(2, [3]), /* :: */[ - /* Int */{ - 0: 2, - length: 1, - tag: 2 - }, + /* Kwd */Block.__(0, ["+"]), /* :: */[ - /* Int */{ - 0: -1, - length: 1, - tag: 2 - }, + /* Int */Block.__(2, [2]), /* :: */[ - /* Kwd */{ - 0: ")", - length: 1, - tag: 0 - }, - /* [] */0 + /* Int */Block.__(2, [-1]), + /* :: */[ + /* Kwd */Block.__(0, [")"]), + /* [] */0 + ] ] ] ] ] ] - ] - ], - 1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))), - length: 2, - tag: 0 - }; + ], + to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) + ]); } ]; diff --git a/jscomp/test/global_exception_regression_test.js b/jscomp/test/global_exception_regression_test.js index 5cd520729e..4de39945e3 100644 --- a/jscomp/test/global_exception_regression_test.js +++ b/jscomp/test/global_exception_regression_test.js @@ -3,6 +3,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var v = Caml_builtin_exceptions.not_found; @@ -13,12 +14,10 @@ var s = Caml_builtin_exceptions.end_of_file; var suites_000 = /* tuple */[ "not_found_equal", function () { - return /* Eq */{ - 0: u, - 1: v, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + u, + v + ]); } ]; @@ -26,12 +25,10 @@ var suites_001 = /* :: */[ /* tuple */[ "not_found_not_equal_end_of_file", function () { - return /* Neq */{ - 0: u, - 1: s, - length: 2, - tag: 1 - }; + return /* Neq */Block.__(1, [ + u, + s + ]); } ], /* [] */0 diff --git a/jscomp/test/google_closure_test.js b/jscomp/test/google_closure_test.js index cfd2da753b..168853c845 100644 --- a/jscomp/test/google_closure_test.js +++ b/jscomp/test/google_closure_test.js @@ -2,30 +2,29 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Test_google_closure = require("./test_google_closure"); Mt.from_pair_suites("Closure", /* :: */[ /* tuple */[ "partial", function () { - return /* Eq */{ - 0: /* tuple */[ - Test_google_closure.a, - Test_google_closure.b, - Test_google_closure.c - ], - 1: /* tuple */[ - "3", - 101, - /* int array */[ - 1, - 2, - 3 + return /* Eq */Block.__(0, [ + /* tuple */[ + Test_google_closure.a, + Test_google_closure.b, + Test_google_closure.c + ], + /* tuple */[ + "3", + 101, + /* int array */[ + 1, + 2, + 3 + ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* [] */0 diff --git a/jscomp/test/hamming_test.js b/jscomp/test/hamming_test.js index 1e268625a7..587a257de8 100644 --- a/jscomp/test/hamming_test.js +++ b/jscomp/test/hamming_test.js @@ -6,6 +6,7 @@ var Caml_obj = require("../runtime/caml_obj"); var CamlinternalLazy = require("../stdlib/camlinternalLazy"); var Caml_format = require("../runtime/caml_format"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var Buffer = require("../stdlib/buffer"); @@ -99,111 +100,91 @@ function pr(param) { var nl = param[0]; if (Caml_int64.compare(nh, n0)) { return Curry._2(Printf.bprintf(buf, /* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Int64 */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Zeros */2, - 1: 18, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 7 - }, - length: 4, - tag: 7 - }, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Zeros */2, + 18 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "%Ld%018Ld\n" ]), nh, nl); } else { return Curry._1(Printf.bprintf(buf, /* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 7 - }, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%Ld\n" ]), nl); } } function map(f, l) { - return { - 0: function () { - var tag = l.tag | 0; - var match = tag === 250 ? l[0] : ( - tag === 246 ? CamlinternalLazy.force_lazy_block(l) : l - ); - return /* Cons */[ - Curry._1(f, match[0]), - map(f, match[1]) - ]; - }, - length: 1, - tag: 246 - }; + return Block.__(246, [function () { + var tag = l.tag | 0; + var match = tag === 250 ? l[0] : ( + tag === 246 ? CamlinternalLazy.force_lazy_block(l) : l + ); + return /* Cons */[ + Curry._1(f, match[0]), + map(f, match[1]) + ]; + }]); } function merge(cmp, l1, l2) { - return { - 0: function () { - var tag = l1.tag | 0; - var match = tag === 250 ? l1[0] : ( - tag === 246 ? CamlinternalLazy.force_lazy_block(l1) : l1 - ); - var tag$1 = l2.tag | 0; - var match$1 = tag$1 === 250 ? l2[0] : ( - tag$1 === 246 ? CamlinternalLazy.force_lazy_block(l2) : l2 - ); - var ll2 = match$1[1]; - var x2 = match$1[0]; - var ll1 = match[1]; - var x1 = match[0]; - var c = Curry._2(cmp, x1, x2); - if (c) { - if (c < 0) { - return /* Cons */[ - x1, - merge(cmp, ll1, l2) - ]; + return Block.__(246, [function () { + var tag = l1.tag | 0; + var match = tag === 250 ? l1[0] : ( + tag === 246 ? CamlinternalLazy.force_lazy_block(l1) : l1 + ); + var tag$1 = l2.tag | 0; + var match$1 = tag$1 === 250 ? l2[0] : ( + tag$1 === 246 ? CamlinternalLazy.force_lazy_block(l2) : l2 + ); + var ll2 = match$1[1]; + var x2 = match$1[0]; + var ll1 = match[1]; + var x1 = match[0]; + var c = Curry._2(cmp, x1, x2); + if (c) { + if (c < 0) { + return /* Cons */[ + x1, + merge(cmp, ll1, l2) + ]; + } + else { + return /* Cons */[ + x2, + merge(cmp, l1, ll2) + ]; + } } else { return /* Cons */[ - x2, - merge(cmp, l1, ll2) + x1, + merge(cmp, ll1, ll2) ]; } - } - else { - return /* Cons */[ - x1, - merge(cmp, ll1, ll2) - ]; - } - }, - length: 1, - tag: 246 - }; + }]); } function iter_interval(f, _l, _param) { @@ -250,70 +231,54 @@ var ham5 = { }; -Caml_obj.caml_update_dummy(hamming, { - 0: function () { - return /* Cons */[ - nn1, - merge(cmp, ham2, merge(cmp, ham3, ham5)) - ]; - }, - length: 1, - tag: 246 - }); - -Caml_obj.caml_update_dummy(ham2, { - 0: function () { - var lzarg = map(x2, hamming); - var tag = lzarg.tag | 0; - if (tag === 250) { - return lzarg[0]; - } - else if (tag === 246) { - return CamlinternalLazy.force_lazy_block(lzarg); - } - else { - return lzarg; - } - }, - length: 1, - tag: 246 - }); - -Caml_obj.caml_update_dummy(ham3, { - 0: function () { - var lzarg = map(x3, hamming); - var tag = lzarg.tag | 0; - if (tag === 250) { - return lzarg[0]; - } - else if (tag === 246) { - return CamlinternalLazy.force_lazy_block(lzarg); - } - else { - return lzarg; - } - }, - length: 1, - tag: 246 - }); - -Caml_obj.caml_update_dummy(ham5, { - 0: function () { - var lzarg = map(x5, hamming); - var tag = lzarg.tag | 0; - if (tag === 250) { - return lzarg[0]; - } - else if (tag === 246) { - return CamlinternalLazy.force_lazy_block(lzarg); - } - else { - return lzarg; - } - }, - length: 1, - tag: 246 - }); +Caml_obj.caml_update_dummy(hamming, Block.__(246, [function () { + return /* Cons */[ + nn1, + merge(cmp, ham2, merge(cmp, ham3, ham5)) + ]; + }])); + +Caml_obj.caml_update_dummy(ham2, Block.__(246, [function () { + var lzarg = map(x2, hamming); + var tag = lzarg.tag | 0; + if (tag === 250) { + return lzarg[0]; + } + else if (tag === 246) { + return CamlinternalLazy.force_lazy_block(lzarg); + } + else { + return lzarg; + } + }])); + +Caml_obj.caml_update_dummy(ham3, Block.__(246, [function () { + var lzarg = map(x3, hamming); + var tag = lzarg.tag | 0; + if (tag === 250) { + return lzarg[0]; + } + else if (tag === 246) { + return CamlinternalLazy.force_lazy_block(lzarg); + } + else { + return lzarg; + } + }])); + +Caml_obj.caml_update_dummy(ham5, Block.__(246, [function () { + var lzarg = map(x5, hamming); + var tag = lzarg.tag | 0; + if (tag === 250) { + return lzarg[0]; + } + else if (tag === 246) { + return CamlinternalLazy.force_lazy_block(lzarg); + } + else { + return lzarg; + } + }])); iter_interval(pr, hamming, /* tuple */[ 88000, @@ -324,12 +289,10 @@ Mt.from_pair_suites("hamming_test.ml", /* :: */[ /* tuple */[ "output", function () { - return /* Eq */{ - 0: Buffer.contents(buf), - 1: "6726050156250000000000000000000000000\n6729216728661136606575523242669244416\n6730293634611118019721084375000000000\n6731430439413948088320000000000000000\n6733644878411293029785156250000000000\n6736815026358904613608094481682268160\n6739031236724077363200000000000000000\n6743282904874568941599068856042651648\n6744421903677486140423997176256921600\n6746640616477458432000000000000000000\n6750000000000000000000000000000000000\n6750897085400702945836103937453588480\n6752037370304563380023474956271616000\n6754258588364960445000000000000000000\n6755399441055744000000000000000000000\n6757621765136718750000000000000000000\n6758519863481752323552044362431792300\n6759661435938757375539248533340160000\n6761885162088395001166534423828125000\n6763027302973440000000000000000000000\n6765252136392518877983093261718750000\n6767294110289640371843415775641600000\n6768437164792816653010961694720000000\n6770663777894400000000000000000000000\n6774935403077748181101173538816000000\n6776079748261363229431903027200000000\n6778308875544000000000000000000000000\n6782585324034592562287109312160000000\n6783730961356018699387011072000000000\n6785962605658597412109375000000000000\n6789341568946838378906250000000000000\n6791390813820928754681118720000000000\n6794772480000000000000000000000000000\n6799059315411241693033267200000000000\n6800207735332289107722240000000000000\n6802444800000000000000000000000000000\n6806736475893120841673472000000000000\n6807886192552970708582400000000000000\n6810125783203125000000000000000000000\n6814422305043756994967597929687500000\n6815573319906622439424000000000000000\n6817815439391434192657470703125000000\n6821025214188390921278195662703296512\n6821210263296961784362792968750000000\n6823269127183128330240000000000000000\n6828727177473454717179297140960133120\n6830973624183426662400000000000000000\n6834375000000000000000000000000000000\n6835283298968211732659055236671758336\n6836437837433370422273768393225011200\n6838686820719522450562500000000000000\n6839841934068940800000000000000000000\n6842092037200927734375000000000000000\n6844157203887991842733489140006912000\n6845313241232438768082197309030400000\n6847565144260608000000000000000000000\n6849817788097425363957881927490234375\n6851885286668260876491458472837120000\n6853042629352726861173598715904000000\n6855297075118080000000000000000000000\n6859622095616220033364938208051200000\n6860780745114630269799801815040000000\n6863037736488300000000000000000000000\n6866455078125000000000000000000000000\n6867367640585024969315698178562000000\n6868527598372968933129348710400000000\n6870787138229329879760742187500000000\n6871947673600000000000000000000000000\n6874208338558673858642578125000000000\n6876283198993690364114632704000000000\n6879707136000000000000000000000000000\n6884047556853882214196183040000000000\n6885210332023942721568768000000000000\n6887475360000000000000000000000000000\n6891820681841784852194390400000000000\n6892984769959882842439680000000000000\n6895252355493164062500000000000000000\n6899602583856803957404692903808593750\n6900767986405455219916800000000000000\n6903038132383827120065689086914062500\n6906475391588173806667327880859375000\n6908559991272917434368000000000000000\n6912000000000000000000000000000000000\n6914086267191872901144038355222134784\n6916360794485719495680000000000000000\n6917529027641081856000000000000000000\n6919804687500000000000000000000000000\n6921893310401287552552190498140323840\n6924170405978516481194531250000000000\n6925339958244802560000000000000000000\n6927618187665939331054687500000000000\n6929709168936591740767657754256998400\n6930879656747844252683224775393280000\n6933159708563865600000000000000000000\n6937533852751614137447601703747584000\n6938705662219635946938268699852800000\n6940988288557056000000000000000000000\n6945367371811422783781999935651840000\n6946540504428563148172299337728000000\n6948825708194403750000000000000000000\n", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Buffer.contents(buf), + "6726050156250000000000000000000000000\n6729216728661136606575523242669244416\n6730293634611118019721084375000000000\n6731430439413948088320000000000000000\n6733644878411293029785156250000000000\n6736815026358904613608094481682268160\n6739031236724077363200000000000000000\n6743282904874568941599068856042651648\n6744421903677486140423997176256921600\n6746640616477458432000000000000000000\n6750000000000000000000000000000000000\n6750897085400702945836103937453588480\n6752037370304563380023474956271616000\n6754258588364960445000000000000000000\n6755399441055744000000000000000000000\n6757621765136718750000000000000000000\n6758519863481752323552044362431792300\n6759661435938757375539248533340160000\n6761885162088395001166534423828125000\n6763027302973440000000000000000000000\n6765252136392518877983093261718750000\n6767294110289640371843415775641600000\n6768437164792816653010961694720000000\n6770663777894400000000000000000000000\n6774935403077748181101173538816000000\n6776079748261363229431903027200000000\n6778308875544000000000000000000000000\n6782585324034592562287109312160000000\n6783730961356018699387011072000000000\n6785962605658597412109375000000000000\n6789341568946838378906250000000000000\n6791390813820928754681118720000000000\n6794772480000000000000000000000000000\n6799059315411241693033267200000000000\n6800207735332289107722240000000000000\n6802444800000000000000000000000000000\n6806736475893120841673472000000000000\n6807886192552970708582400000000000000\n6810125783203125000000000000000000000\n6814422305043756994967597929687500000\n6815573319906622439424000000000000000\n6817815439391434192657470703125000000\n6821025214188390921278195662703296512\n6821210263296961784362792968750000000\n6823269127183128330240000000000000000\n6828727177473454717179297140960133120\n6830973624183426662400000000000000000\n6834375000000000000000000000000000000\n6835283298968211732659055236671758336\n6836437837433370422273768393225011200\n6838686820719522450562500000000000000\n6839841934068940800000000000000000000\n6842092037200927734375000000000000000\n6844157203887991842733489140006912000\n6845313241232438768082197309030400000\n6847565144260608000000000000000000000\n6849817788097425363957881927490234375\n6851885286668260876491458472837120000\n6853042629352726861173598715904000000\n6855297075118080000000000000000000000\n6859622095616220033364938208051200000\n6860780745114630269799801815040000000\n6863037736488300000000000000000000000\n6866455078125000000000000000000000000\n6867367640585024969315698178562000000\n6868527598372968933129348710400000000\n6870787138229329879760742187500000000\n6871947673600000000000000000000000000\n6874208338558673858642578125000000000\n6876283198993690364114632704000000000\n6879707136000000000000000000000000000\n6884047556853882214196183040000000000\n6885210332023942721568768000000000000\n6887475360000000000000000000000000000\n6891820681841784852194390400000000000\n6892984769959882842439680000000000000\n6895252355493164062500000000000000000\n6899602583856803957404692903808593750\n6900767986405455219916800000000000000\n6903038132383827120065689086914062500\n6906475391588173806667327880859375000\n6908559991272917434368000000000000000\n6912000000000000000000000000000000000\n6914086267191872901144038355222134784\n6916360794485719495680000000000000000\n6917529027641081856000000000000000000\n6919804687500000000000000000000000000\n6921893310401287552552190498140323840\n6924170405978516481194531250000000000\n6925339958244802560000000000000000000\n6927618187665939331054687500000000000\n6929709168936591740767657754256998400\n6930879656747844252683224775393280000\n6933159708563865600000000000000000000\n6937533852751614137447601703747584000\n6938705662219635946938268699852800000\n6940988288557056000000000000000000000\n6945367371811422783781999935651840000\n6946540504428563148172299337728000000\n6948825708194403750000000000000000000\n" + ]); } ], /* [] */0 diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index abd5f4a3e1..51a57c0d0c 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -4,6 +4,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Hashtbl = require("../stdlib/hashtbl"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var $$Array = require("../stdlib/array"); var List = require("../stdlib/list"); @@ -45,24 +46,22 @@ function g(count) { var suites_000 = /* tuple */[ "simple", function () { - return /* Eq */{ - 0: /* :: */[ - /* tuple */[ - 1, - /* "1" */49 - ], + return /* Eq */Block.__(0, [ /* :: */[ /* tuple */[ - 2, - /* "2" */50 + 1, + /* "1" */49 ], - /* [] */0 - ] - ], - 1: f(/* () */0), - length: 2, - tag: 0 - }; + /* :: */[ + /* tuple */[ + 2, + /* "2" */50 + ], + /* [] */0 + ] + ], + f(/* () */0) + ]); } ]; @@ -70,17 +69,15 @@ var suites_001 = /* :: */[ /* tuple */[ "more_iterations", function () { - return /* Eq */{ - 0: $$Array.init(1001, function (i) { - return /* tuple */[ - (i << 1), - "" + i - ]; - }), - 1: g(1000), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + $$Array.init(1001, function (i) { + return /* tuple */[ + (i << 1), + "" + i + ]; + }), + g(1000) + ]); } ], /* [] */0 diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index 1773e1527c..7a28f58b11 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var List = require("../stdlib/list"); var Caml_string = require("../runtime/caml_string"); @@ -2352,24 +2353,20 @@ Mt.from_pair_suites("inline_map2_test.ml", /* :: */[ /* tuple */[ "assertion1", function () { - return /* Eq */{ - 0: find(10, m), - 1: /* "a" */97, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + find(10, m), + /* "a" */97 + ]); } ], /* :: */[ /* tuple */[ "assertion2", function () { - return /* Eq */{ - 0: find$1("10", s), - 1: /* "a" */97, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + find$1("10", s), + /* "a" */97 + ]); } ], /* [] */0 diff --git a/jscomp/test/inline_map_test.js b/jscomp/test/inline_map_test.js index a67ec2b0fe..b00126eebe 100644 --- a/jscomp/test/inline_map_test.js +++ b/jscomp/test/inline_map_test.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var List = require("../stdlib/list"); function height(param) { @@ -181,12 +182,10 @@ Mt.from_pair_suites("inline_map_test.ml", /* :: */[ /* tuple */[ "find", function () { - return /* Eq */{ - 0: find(10, m), - 1: /* "a" */97, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + find(10, m), + /* "a" */97 + ]); } ], /* [] */0 diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 815caf59d1..d116a6dab5 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -3,6 +3,7 @@ var Filename = require("../stdlib/filename"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var $$String = require("../stdlib/string"); @@ -53,12 +54,10 @@ function basename(param) { var suites_000 = /* tuple */[ "basename", function () { - return /* Eq */{ - 0: basename("b/c/a.b"), - 1: "a.b", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + basename("b/c/a.b"), + "a.b" + ]); } ]; diff --git a/jscomp/test/int32_test.js b/jscomp/test/int32_test.js index 535aaed6b4..9b611618cd 100644 --- a/jscomp/test/int32_test.js +++ b/jscomp/test/int32_test.js @@ -4,6 +4,7 @@ var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Int32 = require("../stdlib/int32"); var Curry = require("../runtime/curry"); var $$Array = require("../stdlib/array"); @@ -158,24 +159,20 @@ Mt.from_pair_suites("int32_test.ml", Pervasives.$at(/* :: */[ /* tuple */[ 'File "int32_test.ml", line 32, characters 2-9', function () { - return /* Eq */{ - 0: 1, - 1: 1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 1, + 1 + ]); } ], /* :: */[ /* tuple */[ 'File "int32_test.ml", line 33, characters 2-9', function () { - return /* Eq */{ - 0: -2147483647, - 1: -2147483647, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -2147483647, + -2147483647 + ]); } ], /* [] */0 @@ -183,82 +180,64 @@ Mt.from_pair_suites("int32_test.ml", Pervasives.$at(/* :: */[ ], Pervasives.$at($$Array.to_list(Ext_array.map2i(function (i, a, b) { return /* tuple */[ Curry._1(Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "shift_right_logical_cases ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "shift_right_logical_cases ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "shift_right_logical_cases %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + b + ]); } ]; }, shift_right_logical_tests_000, shift_right_logical_tests_001)), Pervasives.$at($$Array.to_list(Ext_array.map2i(function (i, a, b) { return /* tuple */[ Curry._1(Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "shift_right_cases ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "shift_right_cases ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "shift_right_cases %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + b + ]); } ]; }, shift_right_tests_000, shift_right_tests_001)), $$Array.to_list(Ext_array.map2i(function (i, a, b) { return /* tuple */[ Curry._1(Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "shift_left_cases ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "shift_left_cases ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "shift_left_cases %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + b + ]); } ]; }, shift_left_tests_000, shift_left_tests_001)))))); diff --git a/jscomp/test/int64_mul_div_test.js b/jscomp/test/int64_mul_div_test.js index f41a340362..dcba7ae4af 100644 --- a/jscomp/test/int64_mul_div_test.js +++ b/jscomp/test/int64_mul_div_test.js @@ -6,24 +6,23 @@ var Caml_obj = require("../runtime/caml_obj"); var Pervasives = require("../stdlib/pervasives"); var Caml_format = require("../runtime/caml_format"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var $$Array = require("../stdlib/array"); var List = require("../stdlib/list"); function commutative_mul(result, a, b) { - return /* Eq */{ - 0: /* tuple */[ - result, - result - ], - 1: /* tuple */[ - Caml_int64.mul(a, b), - Caml_int64.mul(b, a) - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + result, + result + ], + /* tuple */[ + Caml_int64.mul(a, b), + Caml_int64.mul(b, a) + ] + ]); } var pairs = Caml_obj.caml_obj_dup(/* array */[ @@ -316,24 +315,18 @@ function from_pairs(prefix, pairs) { var result = param[0]; return /* tuple */[ Curry._2(Printf.sprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "_" */95, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "_" */95, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]), "%s_%d" ]), prefix, i), function () { @@ -1648,32 +1641,26 @@ function from(xs) { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "small_divs ", - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "small_divs ", + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]), "small_divs %L" ]), i), function () { - return /* Eq */{ - 0: /* tuple */[ - c, - d - ], - 1: /* tuple */[ - Caml_int64.div(a, b), - Caml_int64.mod_(a, b) - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + c, + d + ], + /* tuple */[ + Caml_int64.div(a, b), + Caml_int64.mod_(a, b) + ] + ]); } ]; }, $$Array.to_list(xs)); @@ -1730,26 +1717,20 @@ function from_compare(xs) { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "int64_compare ", - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "int64_compare ", + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]), "int64_compare %L" ]), i), function () { - return /* Eq */{ - 0: c, - 1: Caml_int64.compare(a, b), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + c, + Caml_int64.compare(a, b) + ]); } ]; }, $$Array.to_list(xs)); @@ -1761,26 +1742,20 @@ function from_to_string(xs) { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "to_string ", - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "to_string ", + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]), "to_string %L" ]), i), function () { - return /* Eq */{ - 0: str_a, - 1: Caml_format.caml_int64_format("%d", a), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + str_a, + Caml_format.caml_int64_format("%d", a) + ]); } ]; }, $$Array.to_list(xs)); @@ -1791,28 +1766,22 @@ Mt.from_pair_suites("int64_mul_div_test.ml", Pervasives.$at(from_pairs("random", var i64 = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "to_float_", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "to_float_", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "to_float_%d" ]), i), function () { - return /* Eq */{ - 0: Caml_int64.to_float(i64), - 1: f, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.to_float(i64), + f + ]); } ]; }, $$Array.to_list(to_floats)), Pervasives.$at(List.mapi(function (i, param) { @@ -1820,42 +1789,34 @@ Mt.from_pair_suites("int64_mul_div_test.ml", Pervasives.$at(from_pairs("random", var f = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "of_float_", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "of_float_", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "of_float_%d" ]), i), function () { - return /* Eq */{ - 0: Caml_int64.of_float(f), - 1: i64, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.of_float(f), + i64 + ]); } ]; }, $$Array.to_list(of_float_pairs)), Pervasives.$at(/* :: */[ /* tuple */[ "compare_check_complete", function () { - return /* Eq */{ - 0: $$Array.map(function () { - return /* true */1; - }, check_complete_compare), - 1: check_complete_compare, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + $$Array.map(function () { + return /* true */1; + }, check_complete_compare), + check_complete_compare + ]); } ], /* [] */0 @@ -1863,42 +1824,38 @@ Mt.from_pair_suites("int64_mul_div_test.ml", Pervasives.$at(from_pairs("random", /* tuple */[ "div_rem_0", function () { - return /* Eq */{ - 0: Caml_int64.div(/* int64 */[ - -1, - 4294967295 - ], /* int64 */[ - 0, - 16 - ]), - 1: /* int64 */[ - 0, - 0 - ], - length: 2, - tag: 0 - }; - } - ], - /* :: */[ - /* tuple */[ - "div_rem_1", - function () { - return /* Eq */{ - 0: Caml_int64.mod_(/* int64 */[ + return /* Eq */Block.__(0, [ + Caml_int64.div(/* int64 */[ -1, 4294967295 ], /* int64 */[ 0, 16 ]), - 1: /* int64 */[ - -1, - 4294967295 - ], - length: 2, - tag: 0 - }; + /* int64 */[ + 0, + 0 + ] + ]); + } + ], + /* :: */[ + /* tuple */[ + "div_rem_1", + function () { + return /* Eq */Block.__(0, [ + Caml_int64.mod_(/* int64 */[ + -1, + 4294967295 + ], /* int64 */[ + 0, + 16 + ]), + /* int64 */[ + -1, + 4294967295 + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 0a415a0756..0c19bcd095 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -5,6 +5,7 @@ var Caml_int64 = require("../runtime/caml_int64"); var Caml_obj = require("../runtime/caml_obj"); var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Int32 = require("../stdlib/int32"); var Curry = require("../runtime/curry"); var Int64 = require("../stdlib/int64"); @@ -26,18 +27,16 @@ var a = /* int64 */[ ]; function commutative_add(result, a, b) { - return /* Eq */{ - 0: /* tuple */[ - result, - result - ], - 1: /* tuple */[ - Caml_int64.add(a, b), - Caml_int64.add(b, a) - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + result, + result + ], + /* tuple */[ + Caml_int64.add(a, b), + Caml_int64.add(b, a) + ] + ]); } var generic_compare = Caml_obj.caml_compare @@ -893,51 +892,45 @@ var suites = Pervasives.$at(/* :: */[ /* tuple */[ "add_one", function () { - return /* Eq */{ - 0: v, - 1: /* int64 */[ - 0, - 2147483648 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + v, + /* int64 */[ + 0, + 2147483648 + ] + ]); } ], /* :: */[ /* tuple */[ "add_2", function () { - return /* Eq */{ - 0: /* int64 */[ - 0, - 4294967294 - ], - 1: Caml_int64.add(a, a), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0, + 4294967294 + ], + Caml_int64.add(a, a) + ]); } ], /* :: */[ /* tuple */[ "add_3", function () { - return /* Eq */{ - 0: /* int64 */[ - 0, - 0 - ], - 1: Caml_int64.add(/* int64 */[ - 0, - 0 - ], /* int64 */[ - 0, - 0 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0, + 0 + ], + Caml_int64.add(/* int64 */[ + 0, + 0 + ], /* int64 */[ + 0, + 0 + ]) + ]); } ], /* :: */[ @@ -1072,1253 +1065,1203 @@ var suites = Pervasives.$at(/* :: */[ /* tuple */[ "to_int32", function () { - return /* Eq */{ - 0: 3, - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3, + 3 + ]); } ], /* :: */[ /* tuple */[ "to_int", function () { - return /* Eq */{ - 0: 3, - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3, + 3 + ]); } ], /* :: */[ /* tuple */[ "of_int", function () { - return /* Eq */{ - 0: /* int64 */[ - 0, - 3 - ], - 1: /* int64 */[ - 0, - 3 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0, + 3 + ], + /* int64 */[ + 0, + 3 + ] + ]); } ], /* :: */[ /* tuple */[ "lognot", function () { - return /* Eq */{ - 0: /* int64 */[ - -1, - 4294967293 - ], - 1: /* int64 */[ - -1, - ((2 ^ 4294967295) >>> 0) - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + -1, + 4294967293 + ], + /* int64 */[ + -1, + ((2 ^ 4294967295) >>> 0) + ] + ]); } ], /* :: */[ /* tuple */[ "neg", function () { - return /* Eq */{ - 0: /* int64 */[ - -1, - 4294967294 - ], - 1: Caml_int64.neg(/* int64 */[ - 0, - 2 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + -1, + 4294967294 + ], + Caml_int64.neg(/* int64 */[ + 0, + 2 + ]) + ]); } ], /* :: */[ /* tuple */[ "sub1", function () { - return /* Eq */{ - 0: /* int64 */[ - 0, - 2 - ], - 1: Caml_int64.sub(/* int64 */[ - 0, - 3 - ], /* int64 */[ - 0, - 1 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0, + 2 + ], + Caml_int64.sub(/* int64 */[ + 0, + 3 + ], /* int64 */[ + 0, + 1 + ]) + ]); } ], /* :: */[ /* tuple */[ "xor1", function () { - return /* Eq */{ - 0: /* tuple */[ - /* int64 */[ - 0, - ((4009750271 ^ 4293853166) >>> 0) - ], - /* int64 */[ - 0 ^ 0, - ((2147483647 ^ 4009750271) >>> 0) - ] - ], - 1: /* tuple */[ - /* int64 */[ - 0, - 286331153 + return /* Eq */Block.__(0, [ + /* tuple */[ + /* int64 */[ + 0, + ((4009750271 ^ 4293853166) >>> 0) + ], + /* int64 */[ + 0 ^ 0, + ((2147483647 ^ 4009750271) >>> 0) + ] ], - /* int64 */[ - 0, - 2432700672 + /* tuple */[ + /* int64 */[ + 0, + 286331153 + ], + /* int64 */[ + 0, + 2432700672 + ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* :: */[ /* tuple */[ "or", function () { - return /* Eq */{ - 0: /* int64 */[ - 0, - ((4009750271 | 4293853166) >>> 0) - ], - 1: /* int64 */[ - 0, - 4294967295 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0, + ((4009750271 | 4293853166) >>> 0) + ], + /* int64 */[ + 0, + 4294967295 + ] + ]); } ], /* :: */[ /* tuple */[ "and", function () { - return /* Eq */{ - 0: /* int64 */[ - 0 & 0, - ((4009750271 & 4293853166) >>> 0) - ], - 1: /* int64 */[ - 0, - 4008636142 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0 & 0, + ((4009750271 & 4293853166) >>> 0) + ], + /* int64 */[ + 0, + 4008636142 + ] + ]); } ], /* :: */[ /* tuple */[ "lsl", function () { - return /* Eq */{ - 0: $$Array.map(function (x) { - return Caml_int64.lsl_(/* int64 */[ - 0, - 1 - ], x); - }, $$Array.init(64, function (i) { - return i; - })), - 1: /* array */[ - /* int64 */[ - 0, - 1 - ], - /* int64 */[ - 0, - 2 - ], - /* int64 */[ - 0, - 4 - ], - /* int64 */[ - 0, - 8 - ], - /* int64 */[ - 0, - 16 - ], - /* int64 */[ - 0, - 32 - ], - /* int64 */[ - 0, - 64 - ], - /* int64 */[ - 0, - 128 - ], - /* int64 */[ - 0, - 256 - ], - /* int64 */[ - 0, - 512 - ], - /* int64 */[ - 0, - 1024 - ], - /* int64 */[ - 0, - 2048 - ], - /* int64 */[ - 0, - 4096 - ], - /* int64 */[ - 0, - 8192 - ], - /* int64 */[ - 0, - 16384 - ], - /* int64 */[ - 0, - 32768 - ], - /* int64 */[ - 0, - 65536 - ], - /* int64 */[ - 0, - 131072 - ], - /* int64 */[ - 0, - 262144 - ], - /* int64 */[ - 0, - 524288 - ], - /* int64 */[ - 0, - 1048576 - ], - /* int64 */[ - 0, - 2097152 - ], - /* int64 */[ - 0, - 4194304 - ], - /* int64 */[ - 0, - 8388608 - ], - /* int64 */[ - 0, - 16777216 - ], - /* int64 */[ - 0, - 33554432 - ], - /* int64 */[ - 0, - 67108864 - ], - /* int64 */[ - 0, - 134217728 - ], - /* int64 */[ - 0, - 268435456 - ], - /* int64 */[ - 0, - 536870912 - ], - /* int64 */[ - 0, - 1073741824 - ], - /* int64 */[ - 0, - 2147483648 - ], - /* int64 */[ - 1, - 0 - ], - /* int64 */[ - 2, - 0 - ], - /* int64 */[ - 4, - 0 - ], - /* int64 */[ - 8, - 0 - ], - /* int64 */[ - 16, - 0 - ], - /* int64 */[ - 32, - 0 - ], - /* int64 */[ - 64, - 0 - ], - /* int64 */[ - 128, - 0 - ], - /* int64 */[ - 256, - 0 - ], - /* int64 */[ - 512, - 0 - ], - /* int64 */[ - 1024, - 0 - ], - /* int64 */[ - 2048, - 0 - ], - /* int64 */[ - 4096, - 0 - ], - /* int64 */[ - 8192, - 0 - ], - /* int64 */[ - 16384, - 0 - ], - /* int64 */[ - 32768, - 0 - ], - /* int64 */[ - 65536, - 0 - ], - /* int64 */[ - 131072, - 0 - ], - /* int64 */[ - 262144, - 0 - ], - /* int64 */[ - 524288, - 0 - ], - /* int64 */[ - 1048576, - 0 - ], - /* int64 */[ - 2097152, - 0 - ], - /* int64 */[ - 4194304, - 0 - ], - /* int64 */[ - 8388608, - 0 - ], - /* int64 */[ - 16777216, - 0 - ], - /* int64 */[ - 33554432, - 0 - ], - /* int64 */[ - 67108864, - 0 - ], - /* int64 */[ - 134217728, - 0 - ], - /* int64 */[ - 268435456, - 0 - ], - /* int64 */[ - 536870912, - 0 - ], - /* int64 */[ - 1073741824, - 0 - ], - /* int64 */[ - -2147483648, - 0 - ] - ], - length: 2, - tag: 0 - }; - } - ], - /* :: */[ - /* tuple */[ - "lsr", - function () { - return /* Eq */{ - 0: $$Array.map(function (x) { - return Caml_int64.lsr_(/* int64 */[ - -1, - 4294967295 + return /* Eq */Block.__(0, [ + $$Array.map(function (x) { + return Caml_int64.lsl_(/* int64 */[ + 0, + 1 ], x); }, $$Array.init(64, function (i) { return i; })), - 1: /* array */[ + /* array */[ /* int64 */[ - -1, - 4294967295 + 0, + 1 ], /* int64 */[ - 2147483647, - 4294967295 + 0, + 2 ], /* int64 */[ - 1073741823, - 4294967295 + 0, + 4 ], /* int64 */[ - 536870911, - 4294967295 + 0, + 8 ], /* int64 */[ - 268435455, - 4294967295 + 0, + 16 ], /* int64 */[ - 134217727, - 4294967295 + 0, + 32 ], /* int64 */[ - 67108863, - 4294967295 + 0, + 64 ], /* int64 */[ - 33554431, - 4294967295 + 0, + 128 ], /* int64 */[ - 16777215, - 4294967295 + 0, + 256 ], /* int64 */[ - 8388607, - 4294967295 + 0, + 512 ], /* int64 */[ - 4194303, - 4294967295 + 0, + 1024 ], /* int64 */[ - 2097151, - 4294967295 + 0, + 2048 ], /* int64 */[ - 1048575, - 4294967295 + 0, + 4096 ], /* int64 */[ - 524287, - 4294967295 + 0, + 8192 ], /* int64 */[ - 262143, - 4294967295 + 0, + 16384 ], /* int64 */[ - 131071, - 4294967295 + 0, + 32768 ], /* int64 */[ - 65535, - 4294967295 + 0, + 65536 ], /* int64 */[ - 32767, - 4294967295 + 0, + 131072 ], /* int64 */[ - 16383, - 4294967295 + 0, + 262144 ], /* int64 */[ - 8191, - 4294967295 + 0, + 524288 ], /* int64 */[ - 4095, - 4294967295 + 0, + 1048576 ], /* int64 */[ - 2047, - 4294967295 + 0, + 2097152 ], /* int64 */[ - 1023, - 4294967295 + 0, + 4194304 ], /* int64 */[ - 511, - 4294967295 + 0, + 8388608 ], /* int64 */[ - 255, - 4294967295 + 0, + 16777216 ], /* int64 */[ - 127, - 4294967295 + 0, + 33554432 ], /* int64 */[ - 63, - 4294967295 + 0, + 67108864 ], /* int64 */[ - 31, - 4294967295 + 0, + 134217728 ], /* int64 */[ - 15, - 4294967295 + 0, + 268435456 ], /* int64 */[ - 7, - 4294967295 + 0, + 536870912 ], /* int64 */[ - 3, - 4294967295 + 0, + 1073741824 ], /* int64 */[ - 1, - 4294967295 + 0, + 2147483648 ], /* int64 */[ - 0, - 4294967295 + 1, + 0 ], /* int64 */[ - 0, - 2147483647 + 2, + 0 ], /* int64 */[ - 0, - 1073741823 + 4, + 0 ], /* int64 */[ - 0, - 536870911 + 8, + 0 ], /* int64 */[ - 0, - 268435455 + 16, + 0 ], /* int64 */[ - 0, - 134217727 + 32, + 0 ], /* int64 */[ - 0, - 67108863 + 64, + 0 ], /* int64 */[ - 0, - 33554431 + 128, + 0 ], /* int64 */[ - 0, - 16777215 + 256, + 0 ], /* int64 */[ - 0, - 8388607 + 512, + 0 ], /* int64 */[ - 0, - 4194303 + 1024, + 0 ], /* int64 */[ - 0, - 2097151 + 2048, + 0 ], /* int64 */[ - 0, - 1048575 + 4096, + 0 ], /* int64 */[ - 0, - 524287 + 8192, + 0 ], /* int64 */[ - 0, - 262143 + 16384, + 0 ], /* int64 */[ - 0, - 131071 + 32768, + 0 ], /* int64 */[ - 0, - 65535 + 65536, + 0 ], /* int64 */[ - 0, - 32767 + 131072, + 0 ], /* int64 */[ - 0, - 16383 + 262144, + 0 ], /* int64 */[ - 0, - 8191 + 524288, + 0 ], /* int64 */[ - 0, - 4095 + 1048576, + 0 ], /* int64 */[ - 0, - 2047 + 2097152, + 0 ], /* int64 */[ - 0, - 1023 + 4194304, + 0 ], /* int64 */[ - 0, - 511 + 8388608, + 0 ], /* int64 */[ - 0, - 255 + 16777216, + 0 ], /* int64 */[ - 0, - 127 + 33554432, + 0 ], /* int64 */[ - 0, - 63 + 67108864, + 0 ], /* int64 */[ - 0, - 31 + 134217728, + 0 ], /* int64 */[ - 0, - 15 + 268435456, + 0 ], /* int64 */[ - 0, - 7 + 536870912, + 0 ], /* int64 */[ - 0, - 3 + 1073741824, + 0 ], /* int64 */[ - 0, - 1 + -2147483648, + 0 ] - ], - length: 2, - tag: 0 - }; - } - ], - /* :: */[ - /* tuple */[ - "asr", - function () { - return /* Eq */{ - 0: $$Array.map(function (x) { - return Caml_int64.asr_(/* int64 */[ + ] + ]); + } + ], + /* :: */[ + /* tuple */[ + "lsr", + function () { + return /* Eq */Block.__(0, [ + $$Array.map(function (x) { + return Caml_int64.lsr_(/* int64 */[ -1, 4294967295 ], x); }, $$Array.init(64, function (i) { return i; })), - 1: /* array */[ + /* array */[ /* int64 */[ -1, 4294967295 ], /* int64 */[ - -1, + 2147483647, 4294967295 ], /* int64 */[ - -1, + 1073741823, 4294967295 ], /* int64 */[ - -1, + 536870911, 4294967295 ], /* int64 */[ - -1, + 268435455, 4294967295 ], /* int64 */[ - -1, + 134217727, 4294967295 ], /* int64 */[ - -1, + 67108863, 4294967295 ], /* int64 */[ - -1, + 33554431, 4294967295 ], /* int64 */[ - -1, + 16777215, 4294967295 ], /* int64 */[ - -1, + 8388607, 4294967295 ], /* int64 */[ - -1, + 4194303, 4294967295 ], /* int64 */[ - -1, + 2097151, 4294967295 ], /* int64 */[ - -1, + 1048575, 4294967295 ], /* int64 */[ - -1, + 524287, 4294967295 ], /* int64 */[ - -1, + 262143, 4294967295 ], /* int64 */[ - -1, + 131071, 4294967295 ], /* int64 */[ - -1, + 65535, 4294967295 ], /* int64 */[ - -1, + 32767, 4294967295 ], /* int64 */[ - -1, + 16383, 4294967295 ], /* int64 */[ - -1, + 8191, 4294967295 ], /* int64 */[ - -1, + 4095, 4294967295 ], /* int64 */[ - -1, + 2047, 4294967295 ], /* int64 */[ - -1, + 1023, 4294967295 ], /* int64 */[ - -1, + 511, 4294967295 ], /* int64 */[ - -1, + 255, 4294967295 ], /* int64 */[ - -1, + 127, 4294967295 ], /* int64 */[ - -1, + 63, 4294967295 ], /* int64 */[ - -1, + 31, 4294967295 ], /* int64 */[ - -1, + 15, 4294967295 ], /* int64 */[ - -1, + 7, 4294967295 ], /* int64 */[ - -1, + 3, 4294967295 ], /* int64 */[ - -1, + 1, 4294967295 ], /* int64 */[ - -1, + 0, 4294967295 ], /* int64 */[ - -1, - 4294967295 + 0, + 2147483647 ], /* int64 */[ - -1, - 4294967295 + 0, + 1073741823 ], /* int64 */[ - -1, - 4294967295 + 0, + 536870911 ], /* int64 */[ - -1, - 4294967295 + 0, + 268435455 ], /* int64 */[ - -1, - 4294967295 + 0, + 134217727 ], /* int64 */[ - -1, - 4294967295 + 0, + 67108863 ], /* int64 */[ - -1, - 4294967295 + 0, + 33554431 ], /* int64 */[ - -1, - 4294967295 + 0, + 16777215 ], /* int64 */[ - -1, - 4294967295 + 0, + 8388607 ], /* int64 */[ - -1, - 4294967295 + 0, + 4194303 ], /* int64 */[ - -1, - 4294967295 + 0, + 2097151 ], /* int64 */[ - -1, - 4294967295 + 0, + 1048575 ], /* int64 */[ - -1, - 4294967295 + 0, + 524287 ], /* int64 */[ - -1, - 4294967295 + 0, + 262143 ], /* int64 */[ - -1, - 4294967295 + 0, + 131071 ], /* int64 */[ - -1, - 4294967295 + 0, + 65535 ], /* int64 */[ - -1, - 4294967295 + 0, + 32767 ], /* int64 */[ - -1, - 4294967295 + 0, + 16383 ], /* int64 */[ - -1, - 4294967295 + 0, + 8191 ], /* int64 */[ - -1, - 4294967295 + 0, + 4095 ], /* int64 */[ - -1, - 4294967295 + 0, + 2047 ], /* int64 */[ - -1, - 4294967295 + 0, + 1023 ], /* int64 */[ - -1, - 4294967295 + 0, + 511 ], /* int64 */[ - -1, - 4294967295 + 0, + 255 ], /* int64 */[ - -1, - 4294967295 + 0, + 127 ], /* int64 */[ - -1, - 4294967295 + 0, + 63 ], /* int64 */[ - -1, - 4294967295 + 0, + 31 ], /* int64 */[ - -1, - 4294967295 + 0, + 15 ], /* int64 */[ - -1, - 4294967295 + 0, + 7 ], /* int64 */[ - -1, - 4294967295 + 0, + 3 ], /* int64 */[ - -1, - 4294967295 + 0, + 1 ] - ], - length: 2, - tag: 0 - }; + ] + ]); + } + ], + /* :: */[ + /* tuple */[ + "asr", + function () { + return /* Eq */Block.__(0, [ + $$Array.map(function (x) { + return Caml_int64.asr_(/* int64 */[ + -1, + 4294967295 + ], x); + }, $$Array.init(64, function (i) { + return i; + })), + /* array */[ + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ], + /* int64 */[ + -1, + 4294967295 + ] + ] + ]); } ], /* :: */[ /* tuple */[ "mul simple", function () { - return /* Eq */{ - 0: /* int64 */[ - 0, - 6 - ], - 1: Caml_int64.mul(/* int64 */[ - 0, - 3 - ], /* int64 */[ - 0, - 2 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0, + 6 + ], + Caml_int64.mul(/* int64 */[ + 0, + 3 + ], /* int64 */[ + 0, + 2 + ]) + ]); } ], /* :: */[ /* tuple */[ "of_int32", function () { - return /* Eq */{ - 0: $$Array.map(Caml_int64.of_int32, /* array */[ + return /* Eq */Block.__(0, [ + $$Array.map(Caml_int64.of_int32, /* array */[ + 0, + -2147483648 + ]), + /* array */[ + /* int64 */[ 0, - -2147483648 - ]), - 1: /* array */[ - /* int64 */[ - 0, - 0 - ], - /* int64 */[ - -1, - 2147483648 + 0 + ], + /* int64 */[ + -1, + 2147483648 + ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* :: */[ /* tuple */[ "to_int32", function () { - return /* Eq */{ - 0: $$Array.map(function (prim) { - return prim[1] | 0; - }, /* array */[ - /* int64 */[ - 0, - 0 - ], - /* int64 */[ - 0, - 2147483648 - ] - ]), - 1: /* array */[ - 0, - -2147483648 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + $$Array.map(function (prim) { + return prim[1] | 0; + }, /* array */[ + /* int64 */[ + 0, + 0 + ], + /* int64 */[ + 0, + 2147483648 + ] + ]), + /* array */[ + 0, + -2147483648 + ] + ]); } ], /* :: */[ /* tuple */[ "discard_sign", function () { - return /* Eq */{ - 0: Caml_int64.discard_sign(/* int64 */[ - -1, - 4294967295 - ]), - 1: /* int64 */[ - 2147483647, - 4294967295 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.discard_sign(/* int64 */[ + -1, + 4294967295 + ]), + /* int64 */[ + 2147483647, + 4294967295 + ] + ]); } ], /* :: */[ /* tuple */[ "div_mod", function () { - return /* Eq */{ - 0: Caml_int64.div_mod(/* int64 */[ + return /* Eq */Block.__(0, [ + Caml_int64.div_mod(/* int64 */[ + 0, + 7 + ], /* int64 */[ + 0, + 3 + ]), + /* tuple */[ + /* int64 */[ 0, - 7 - ], /* int64 */[ + 2 + ], + /* int64 */[ 0, - 3 - ]), - 1: /* tuple */[ - /* int64 */[ - 0, - 2 - ], - /* int64 */[ - 0, - 1 + 1 + ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* :: */[ /* tuple */[ "to_hex", function () { - return /* Eq */{ - 0: Caml_int64.to_hex(/* int64 */[ - -1, - 4294967295 - ]), - 1: "ffffffffffffffff", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.to_hex(/* int64 */[ + -1, + 4294967295 + ]), + "ffffffffffffffff" + ]); } ], /* :: */[ /* tuple */[ "generic_compare", function () { - return /* Eq */{ - 0: +(Caml_obj.caml_compare(/* int64 */[ - 1, - 0 - ], /* int64 */[ - 0, - 1 - ]) > 0), - 1: /* true */1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + +(Caml_obj.caml_compare(/* int64 */[ + 1, + 0 + ], /* int64 */[ + 0, + 1 + ]) > 0), + /* true */1 + ]); } ], /* :: */[ /* tuple */[ "test_compier_literal", function () { - return /* Eq */{ - 0: /* int64 */[ - 0, - 4294967295 - ], - 1: Caml_int64.add(Caml_int64.add(/* int64 */[ - 0, - 2147483647 - ], /* int64 */[ - 0, - 2147483647 - ]), /* int64 */[ - 0, - 1 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int64 */[ + 0, + 4294967295 + ], + Caml_int64.add(Caml_int64.add(/* int64 */[ + 0, + 2147483647 + ], /* int64 */[ + 0, + 2147483647 + ]), /* int64 */[ + 0, + 1 + ]) + ]); } ], /* :: */[ /* tuple */[ "generic_compare2", function () { - return /* Eq */{ - 0: +(Caml_obj.caml_compare(/* int64 */[ - 0, - 2147483648 - ], /* int64 */[ - 0, - 1 - ]) > 0), - 1: /* true */1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + +(Caml_obj.caml_compare(/* int64 */[ + 0, + 2147483648 + ], /* int64 */[ + 0, + 1 + ]) > 0), + /* true */1 + ]); } ], /* :: */[ /* tuple */[ "shift_left", function () { - return /* Eq */{ - 0: Caml_int64.lsl_(/* int64 */[ - 0, - 16777215 - ], 8), - 1: /* int64 */[ - 0, - 4294967040 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.lsl_(/* int64 */[ + 0, + 16777215 + ], 8), + /* int64 */[ + 0, + 4294967040 + ] + ]); } ], /* :: */[ /* tuple */[ "shift_right", function () { - return /* Eq */{ - 0: 4294967295, - 1: 4294967295, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 4294967295, + 4294967295 + ]); } ], /* :: */[ /* tuple */[ "fib_int64", function () { - return /* Eq */{ - 0: fib(1000, /* int64 */[ - 0, - 1 - ], /* int64 */[ - 0, - 2 - ]), - 1: /* int64 */[ - -1990564327, - 2874523960 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + fib(1000, /* int64 */[ + 0, + 1 + ], /* int64 */[ + 0, + 2 + ]), + /* int64 */[ + -1990564327, + 2874523960 + ] + ]); } ], /* :: */[ /* tuple */[ "fac_int64", function () { - return /* Eq */{ - 0: fac(30, /* int64 */[ - 0, - 1 - ]), - 1: /* int64 */[ - -2040662563, - 1409286144 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + fac(30, /* int64 */[ + 0, + 1 + ]), + /* int64 */[ + -2040662563, + 1409286144 + ] + ]); } ], /* [] */0 @@ -2360,82 +2303,64 @@ var suites = Pervasives.$at(/* :: */[ ], Pervasives.$at($$Array.to_list(Ext_array.map2i(function (i, a, b) { return /* tuple */[ Curry._1(Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "shift_left_cases ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "shift_left_cases ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "shift_left_cases %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + b + ]); } ]; }, shift_left_tests_000, shift_left_tests_001)), Pervasives.$at($$Array.to_list(Ext_array.map2i(function (i, a, b) { return /* tuple */[ Curry._1(Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "shift_right_cases ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "shift_right_cases ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "shift_right_cases %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + b + ]); } ]; }, shift_right_tests_000, shift_right_tests_001)), $$Array.to_list(Ext_array.map2i(function (i, a, b) { return /* tuple */[ Curry._1(Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "shift_right_logical_cases ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "shift_right_logical_cases ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "shift_right_logical_cases %d" ]), i), function () { - return /* Eq */{ - 0: a, - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + a, + b + ]); } ]; }, shift_right_logical_suites_000, shift_right_logical_suites_001))))); diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index 4aa23b76ac..ba08b57701 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -4,6 +4,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Hashtbl = require("../stdlib/hashtbl"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var $$Array = require("../stdlib/array"); var List = require("../stdlib/list"); @@ -63,24 +64,22 @@ var Int_hash = Hashtbl.Make(/* module */[ var suites_000 = /* tuple */[ "simple", function () { - return /* Eq */{ - 0: /* :: */[ - /* tuple */[ - 1, - /* "1" */49 - ], + return /* Eq */Block.__(0, [ /* :: */[ /* tuple */[ - 2, - /* "2" */50 + 1, + /* "1" */49 ], - /* [] */0 - ] - ], - 1: f(Int_hash), - length: 2, - tag: 0 - }; + /* :: */[ + /* tuple */[ + 2, + /* "2" */50 + ], + /* [] */0 + ] + ], + f(Int_hash) + ]); } ]; @@ -88,17 +87,15 @@ var suites_001 = /* :: */[ /* tuple */[ "more_iterations", function () { - return /* Eq */{ - 0: $$Array.init(1001, function (i) { - return /* tuple */[ - (i << 1), - "" + i - ]; - }), - 1: g(Int_hash)(1000), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + $$Array.init(1001, function (i) { + return /* tuple */[ + (i << 1), + "" + i + ]; + }), + g(Int_hash)(1000) + ]); } ], /* [] */0 diff --git a/jscomp/test/int_overflow_test.js b/jscomp/test/int_overflow_test.js index 551717c44e..0626577caa 100644 --- a/jscomp/test/int_overflow_test.js +++ b/jscomp/test/int_overflow_test.js @@ -3,6 +3,7 @@ var Mt = require("./mt"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Int32 = require("../stdlib/int32"); function hash_variant(s) { @@ -45,132 +46,110 @@ Mt.from_pair_suites("int_overflow_test.ml", /* :: */[ /* tuple */[ "plus_overflow", function () { - return /* Eq */{ - 0: /* true */1, - 1: +((Int32.max_int + 1 | 0) === Int32.min_int), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + +((Int32.max_int + 1 | 0) === Int32.min_int) + ]); } ], /* :: */[ /* tuple */[ "minus_overflow", function () { - return /* Eq */{ - 0: /* true */1, - 1: +((Int32.min_int - Int32.one | 0) === Int32.max_int), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + +((Int32.min_int - Int32.one | 0) === Int32.max_int) + ]); } ], /* :: */[ /* tuple */[ "flow_again", function () { - return /* Eq */{ - 0: 2147483646, - 1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 2147483646, + (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 + ]); } ], /* :: */[ /* tuple */[ "flow_again", function () { - return /* Eq */{ - 0: -2, - 1: Int32.max_int + Int32.max_int | 0, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -2, + Int32.max_int + Int32.max_int | 0 + ]); } ], /* :: */[ /* tuple */[ "hash_test", function () { - return /* Eq */{ - 0: hash_variant("xxyyzzuuxxzzyy00112233"), - 1: 544087776, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + hash_variant("xxyyzzuuxxzzyy00112233"), + 544087776 + ]); } ], /* :: */[ /* tuple */[ "hash_test2", function () { - return /* Eq */{ - 0: hash_variant("xxyyzxzzyy"), - 1: -449896130, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + hash_variant("xxyyzxzzyy"), + -449896130 + ]); } ], /* :: */[ /* tuple */[ 'File "int_overflow_test.ml", line 37, characters 2-9', function () { - return /* Eq */{ - 0: hash_variant2("xxyyzzuuxxzzyy00112233"), - 1: 544087776, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + hash_variant2("xxyyzzuuxxzzyy00112233"), + 544087776 + ]); } ], /* :: */[ /* tuple */[ 'File "int_overflow_test.ml", line 38, characters 2-9', function () { - return /* Eq */{ - 0: hash_variant2("xxyyzxzzyy"), - 1: -449896130, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + hash_variant2("xxyyzxzzyy"), + -449896130 + ]); } ], /* :: */[ /* tuple */[ "int_literal_flow", function () { - return /* Eq */{ - 0: -1, - 1: -1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -1, + -1 + ]); } ], /* :: */[ /* tuple */[ "int_literal_flow2", function () { - return /* Eq */{ - 0: -1, - 1: -1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -1, + -1 + ]); } ], /* :: */[ /* tuple */[ "int_literal_flow3", function () { - return /* Eq */{ - 0: -1, - 1: -1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -1, + -1 + ]); } ], /* [] */0 diff --git a/jscomp/test/js_bool_test.js b/jscomp/test/js_bool_test.js index 96463690c7..9604d6309c 100644 --- a/jscomp/test/js_bool_test.js +++ b/jscomp/test/js_bool_test.js @@ -3,6 +3,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); function f(x) { if (x) { @@ -40,12 +41,10 @@ var v = ( true); var suites_000 = /* tuple */[ "caml_bool_eq_caml_bool", function () { - return /* Eq */{ - 0: u, - 1: f(true), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + u, + f(true) + ]); } ]; @@ -53,24 +52,20 @@ var suites_001 = /* :: */[ /* tuple */[ "js_bool_eq_js_bool", function () { - return /* Eq */{ - 0: v, - 1: true, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + v, + true + ]); } ], /* :: */[ /* tuple */[ "js_bool_neq_acml_bool", function () { - return /* Eq */{ - 0: /* false */0, - 1: Caml_obj.caml_equal(f(true), (true)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* false */0, + Caml_obj.caml_equal(f(true), (true)) + ]); } ], /* [] */0 diff --git a/jscomp/test/js_date_test.js b/jscomp/test/js_date_test.js index 4cb11dbe5f..70b46d08e1 100644 --- a/jscomp/test/js_date_test.js +++ b/jscomp/test/js_date_test.js @@ -1,7 +1,8 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); var d = new Date(2016, 2); @@ -19,12 +20,10 @@ var d3 = d2(2016)(1, /* () */0); var suites_000 = /* tuple */[ "getMonth", function () { - return /* Eq */{ - 0: 2, - 1: d.getMonth(), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 2, + d.getMonth() + ]); } ]; @@ -32,20 +31,18 @@ var suites_001 = /* :: */[ /* tuple */[ "getYear", function () { - return /* Eq */{ - 0: /* tuple */[ - 2016, - 2, - 1 - ], - 1: /* tuple */[ - d3.getFullYear(), - d3.getMonth(), - d3.getDate() - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + 2016, + 2, + 1 + ], + /* tuple */[ + d3.getFullYear(), + d3.getMonth(), + d3.getDate() + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/js_obj_test.js b/jscomp/test/js_obj_test.js index bf45548550..f80e8a2b10 100644 --- a/jscomp/test/js_obj_test.js +++ b/jscomp/test/js_obj_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); @@ -35,12 +36,10 @@ var suites_000 = /* tuple */[ CamlinternalOO.init_class($$class); class_tables[0] = env_init; } - return /* Eq */{ - 0: 33, - 1: f(Curry._1(class_tables[0], 0)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 33, + f(Curry._1(class_tables[0], 0)) + ]); } ]; @@ -48,16 +47,14 @@ var suites_001 = /* :: */[ /* tuple */[ "js_obj", function () { - return /* Eq */{ - 0: 34, - 1: f({ - "say": function (x) { - return x + 2 | 0; - } - }), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 34, + f({ + "say": function (x) { + return x + 2 | 0; + } + }) + ]); } ], /* [] */0 diff --git a/jscomp/test/lam_methname.js b/jscomp/test/lam_methname.js index 7564597605..5f215d01cf 100644 --- a/jscomp/test/lam_methname.js +++ b/jscomp/test/lam_methname.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_obj = require("../runtime/caml_obj"); var Caml_format = require("../runtime/caml_format"); +var Block = require("../runtime/block"); var Ext_string = require("./ext_string"); var Curry = require("../runtime/curry"); var Ext_log = require("./ext_log"); @@ -34,11 +35,7 @@ function process(x) { var v = Ext_string.rfind(sub, x); if (v < 0) { return /* tuple */[ - /* Unknown */{ - 0: /* None */0, - length: 1, - tag: 2 - }, + /* Unknown */Block.__(2, [/* None */0]), x ]; } @@ -64,12 +61,10 @@ function process(x) { var fail = function (l) { var error = "invalid indicator" + (indicator + ("in method name " + (x + (":" + Lam_current_unit.get_file(/* () */0))))); Curry._1(Ext_log.err(l, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), error); throw [ @@ -124,27 +119,11 @@ function process(x) { if (match) { var match$1 = match[0]; $js = match$1 !== 17279 ? ( - match$1 >= 785140586 ? /* Unknown */{ - 0: arity$1, - length: 1, - tag: 2 - } : /* Js */{ - 0: arity$1, - length: 1, - tag: 0 - } - ) : /* Ml */{ - 0: arity$1, - length: 1, - tag: 1 - }; + match$1 >= 785140586 ? /* Unknown */Block.__(2, [arity$1]) : /* Js */Block.__(0, [arity$1]) + ) : /* Ml */Block.__(1, [arity$1]); } else { - $js = /* Js */{ - 0: arity$1, - length: 1, - tag: 0 - }; + $js = /* Js */Block.__(0, [arity$1]); } return /* tuple */[ $js, diff --git a/jscomp/test/lam_methname_test.js b/jscomp/test/lam_methname_test.js index ef6b23819f..9178fc7ca9 100644 --- a/jscomp/test/lam_methname_test.js +++ b/jscomp/test/lam_methname_test.js @@ -3,23 +3,18 @@ var Lam_methname = require("./lam_methname"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var suites_000 = /* tuple */[ "normal", function () { - return /* Eq */{ - 0: Lam_methname.process("xx"), - 1: /* tuple */[ - /* Unknown */{ - 0: /* None */0, - length: 1, - tag: 2 - }, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx"), + /* tuple */[ + /* Unknown */Block.__(2, [/* None */0]), + "xx" + ] + ]); } ]; @@ -27,155 +22,117 @@ var suites_001 = /* :: */[ /* tuple */[ "js", function () { - return /* Eq */{ - 0: Lam_methname.process("xx__js"), - 1: /* tuple */[ - /* Js */{ - 0: /* None */0, - length: 1, - tag: 0 - }, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx__js"), + /* tuple */[ + /* Js */Block.__(0, [/* None */0]), + "xx" + ] + ]); } ], /* :: */[ /* tuple */[ "js_set", function () { - return /* Eq */{ - 0: Lam_methname.process("xx__w"), - 1: /* tuple */[ - /* Js_write */2, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx__w"), + /* tuple */[ + /* Js_write */2, + "xx" + ] + ]); } ], /* :: */[ /* tuple */[ "js_none", function () { - return /* Eq */{ - 0: Lam_methname.process("xx__"), - 1: /* tuple */[ - /* Js */{ - 0: /* None */0, - length: 1, - tag: 0 - }, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx__"), + /* tuple */[ + /* Js */Block.__(0, [/* None */0]), + "xx" + ] + ]); } ], /* :: */[ /* tuple */[ "js1", function () { - return /* Eq */{ - 0: Lam_methname.process("xx__js_1"), - 1: /* tuple */[ - /* Js */{ - 0: /* Some */[1], - length: 1, - tag: 0 - }, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx__js_1"), + /* tuple */[ + /* Js */Block.__(0, [/* Some */[1]]), + "xx" + ] + ]); } ], /* :: */[ /* tuple */[ "js2", function () { - return /* Eq */{ - 0: Lam_methname.process("xx__w"), - 1: /* tuple */[ - /* Js_write */2, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx__w"), + /* tuple */[ + /* Js_write */2, + "xx" + ] + ]); } ], /* :: */[ /* tuple */[ "js3", function () { - return /* Eq */{ - 0: Lam_methname.process("xx__2"), - 1: /* tuple */[ - /* Js */{ - 0: /* Some */[2], - length: 1, - tag: 0 - }, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx__2"), + /* tuple */[ + /* Js */Block.__(0, [/* Some */[2]]), + "xx" + ] + ]); } ], /* :: */[ /* tuple */[ "ml1", function () { - return /* Eq */{ - 0: Lam_methname.process("xx__2_ml"), - 1: /* tuple */[ - /* Ml */{ - 0: /* Some */[2], - length: 1, - tag: 1 - }, - "xx" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("xx__2_ml"), + /* tuple */[ + /* Ml */Block.__(1, [/* Some */[2]]), + "xx" + ] + ]); } ], /* :: */[ /* tuple */[ "index", function () { - return /* Eq */{ - 0: Lam_methname.process("index__"), - 1: /* tuple */[ - /* Js_read_index */0, - "index" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("index__"), + /* tuple */[ + /* Js_read_index */0, + "index" + ] + ]); } ], /* :: */[ /* tuple */[ "set_index", function () { - return /* Eq */{ - 0: Lam_methname.process("index__w"), - 1: /* tuple */[ - /* Js_write_index */1, - "index" - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Lam_methname.process("index__w"), + /* tuple */[ + /* Js_write_index */1, + "index" + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/lazy_test.js b/jscomp/test/lazy_test.js index acd8fb7382..5b3c517f94 100644 --- a/jscomp/test/lazy_test.js +++ b/jscomp/test/lazy_test.js @@ -5,17 +5,14 @@ var Lazy = require("../stdlib/lazy"); var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var CamlinternalLazy = require("../stdlib/camlinternalLazy"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var u = [3]; -var v = { - 0: function () { - u[0] = 32; - return /* () */0; - }, - length: 1, - tag: 246 -}; +var v = Block.__(246, [function () { + u[0] = 32; + return /* () */0; + }]); function lazy_test() { var h = u[0]; @@ -80,23 +77,15 @@ function f(param) { var s = [/* None */0]; -var set_true = { - 0: function () { - s[0] = /* Some */[1]; - return /* () */0; - }, - length: 1, - tag: 246 -}; +var set_true = Block.__(246, [function () { + s[0] = /* Some */[1]; + return /* () */0; + }]); -var set_false = { - 0: function () { - s[0] = /* None */0; - return /* () */0; - }, - length: 1, - tag: 246 -}; +var set_false = Block.__(246, [function () { + s[0] = /* None */0; + return /* () */0; + }]); var h; @@ -118,14 +107,10 @@ catch (exn){ var u_v = [0]; -var u$1 = { - 0: function () { - u_v[0] = 2; - return /* () */0; - }, - length: 1, - tag: 246 -}; +var u$1 = Block.__(246, [function () { + u_v[0] = 2; + return /* () */0; + }]); var tag = u$1.tag | 0; @@ -155,53 +140,43 @@ var l_from_fun = Lazy.from_fun(function () { return 3; }); -var forward_test = { - 0: function () { - var u = 3; - u = u + 1 | 0; - return u; - }, - length: 1, - tag: 246 -}; +var forward_test = Block.__(246, [function () { + var u = 3; + u = u + 1 | 0; + return u; + }]); Mt.from_pair_suites("lazy_test.ml", /* :: */[ /* tuple */[ "simple", function () { - return /* Eq */{ - 0: lazy_test(/* () */0), - 1: /* tuple */[ - 3, - 32 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + lazy_test(/* () */0), + /* tuple */[ + 3, + 32 + ] + ]); } ], /* :: */[ /* tuple */[ "lazy_match", function () { - return /* Eq */{ - 0: h, - 1: 2, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + h, + 2 + ]); } ], /* :: */[ /* tuple */[ "lazy_force", function () { - return /* Eq */{ - 0: u_v[0], - 1: 2, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + u_v[0], + 2 + ]); } ], /* :: */[ @@ -209,14 +184,12 @@ Mt.from_pair_suites("lazy_test.ml", /* :: */[ "lazy_from_fun", function () { var tag = l_from_fun.tag | 0; - return /* Eq */{ - 0: tag === 250 ? l_from_fun[0] : ( - tag === 246 ? CamlinternalLazy.force_lazy_block(l_from_fun) : l_from_fun - ), - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + tag === 250 ? l_from_fun[0] : ( + tag === 246 ? CamlinternalLazy.force_lazy_block(l_from_fun) : l_from_fun + ), + 3 + ]); } ], /* :: */[ @@ -225,14 +198,12 @@ Mt.from_pair_suites("lazy_test.ml", /* :: */[ function () { var lzarg = Lazy.from_val(3); var tag = lzarg.tag | 0; - return /* Eq */{ - 0: tag === 250 ? lzarg[0] : ( - tag === 246 ? CamlinternalLazy.force_lazy_block(lzarg) : lzarg - ), - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + tag === 250 ? lzarg[0] : ( + tag === 246 ? CamlinternalLazy.force_lazy_block(lzarg) : lzarg + ), + 3 + ]); } ], /* :: */[ @@ -245,14 +216,12 @@ Mt.from_pair_suites("lazy_test.ml", /* :: */[ tag === 246 ? CamlinternalLazy.force_lazy_block(lzarg) : lzarg ); var tag$1 = prim.tag | 0; - return /* Eq */{ - 0: tag$1 === 250 ? prim[0] : ( - tag$1 === 246 ? CamlinternalLazy.force_lazy_block(prim) : prim - ), - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + tag$1 === 250 ? prim[0] : ( + tag$1 === 246 ? CamlinternalLazy.force_lazy_block(prim) : prim + ), + 3 + ]); } ], /* :: */[ @@ -266,14 +235,12 @@ Mt.from_pair_suites("lazy_test.ml", /* :: */[ tag === 246 ? CamlinternalLazy.force_lazy_block(lzarg) : lzarg ); var tag$1 = prim.tag | 0; - return /* Eq */{ - 0: tag$1 === 250 ? prim[0] : ( - tag$1 === 246 ? CamlinternalLazy.force_lazy_block(prim) : prim - ), - 1: 4, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + tag$1 === 250 ? prim[0] : ( + tag$1 === 246 ? CamlinternalLazy.force_lazy_block(prim) : prim + ), + 4 + ]); } ], /* [] */0 diff --git a/jscomp/test/lexer_test.js b/jscomp/test/lexer_test.js index efffb165d4..1d13bff071 100644 --- a/jscomp/test/lexer_test.js +++ b/jscomp/test/lexer_test.js @@ -5,6 +5,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Arith_syntax = require("./arith_syntax"); var Mt = require("./mt"); var Lexing = require("../stdlib/lexing"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Number_lexer = require("./number_lexer"); var Arith_lexer = require("./arith_lexer"); @@ -53,49 +54,31 @@ function from_tokens(lst) { var lexer_suites_000 = /* tuple */[ "arith_token", function () { - return /* Eq */{ - 0: f("x + 3 + 4 + y"), - 1: /* :: */[ - /* IDENT */{ - 0: "x", - length: 1, - tag: 1 - }, + return /* Eq */Block.__(0, [ + f("x + 3 + 4 + y"), /* :: */[ - /* PLUS */0, + /* IDENT */Block.__(1, ["x"]), /* :: */[ - /* NUMERAL */{ - 0: 3, - length: 1, - tag: 0 - }, + /* PLUS */0, /* :: */[ - /* PLUS */0, + /* NUMERAL */Block.__(0, [3]), /* :: */[ - /* NUMERAL */{ - 0: 4, - length: 1, - tag: 0 - }, + /* PLUS */0, /* :: */[ - /* PLUS */0, + /* NUMERAL */Block.__(0, [4]), /* :: */[ - /* IDENT */{ - 0: "y", - length: 1, - tag: 1 - }, - /* [] */0 + /* PLUS */0, + /* :: */[ + /* IDENT */Block.__(1, ["y"]), + /* [] */0 + ] ] ] ] ] ] ] - ], - length: 2, - tag: 0 - }; + ]); } ]; @@ -103,16 +86,10 @@ var lexer_suites_001 = /* :: */[ /* tuple */[ "simple token", function () { - return /* Eq */{ - 0: Arith_lexer.lexeme(Lexing.from_string("10")), - 1: /* NUMERAL */{ - 0: 10, - length: 1, - tag: 0 - }, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Arith_lexer.lexeme(Lexing.from_string("10")), + /* NUMERAL */Block.__(0, [10]) + ]); } ], /* :: */[ @@ -128,43 +105,44 @@ var lexer_suites_001 = /* :: */[ return /* () */0; }; Number_lexer.token(add, Lexing.from_string("32 + 32 ( ) * / ")); - return /* Eq */{ - 0: List.rev(v[0]), - 1: /* :: */[ - "number", + return /* Eq */Block.__(0, [ + List.rev(v[0]), /* :: */[ - "32", + "number", /* :: */[ - "new line", + "32", /* :: */[ - "+", + "new line", /* :: */[ - "new line", + "+", /* :: */[ - "number", + "new line", /* :: */[ - "32", + "number", /* :: */[ - "new line", + "32", /* :: */[ - "(", + "new line", /* :: */[ - "new line", + "(", /* :: */[ - ")", + "new line", /* :: */[ - "new line", + ")", /* :: */[ - "*", + "new line", /* :: */[ - "new line", + "*", /* :: */[ - "/", + "new line", /* :: */[ - "new line", + "/", /* :: */[ - "eof", - /* [] */0 + "new line", + /* :: */[ + "eof", + /* [] */0 + ] ] ] ] @@ -181,34 +159,27 @@ var lexer_suites_001 = /* :: */[ ] ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* :: */[ /* tuple */[ "simple number", function () { - return /* Eq */{ - 0: Arith_syntax.str(Arith_parser.toplevel(Arith_lexer.lexeme, Lexing.from_string("10"))), - 1: "10.", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Arith_syntax.str(Arith_parser.toplevel(Arith_lexer.lexeme, Lexing.from_string("10"))), + "10." + ]); } ], /* :: */[ /* tuple */[ "arith", function () { - return /* Eq */{ - 0: Arith_syntax.str(Arith_parser.toplevel(Arith_lexer.lexeme, Lexing.from_string("x + 3 + 4 + y"))), - 1: "x+3.+4.+y", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Arith_syntax.str(Arith_parser.toplevel(Arith_lexer.lexeme, Lexing.from_string("x + 3 + 4 + y"))), + "x+3.+4.+y" + ]); } ], /* [] */0 diff --git a/jscomp/test/lib_js_test.js b/jscomp/test/lib_js_test.js index a7c689ee19..cc961e08d1 100644 --- a/jscomp/test/lib_js_test.js +++ b/jscomp/test/lib_js_test.js @@ -1,7 +1,8 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); console.log(JSON.stringify(/* :: */[ 1, @@ -19,12 +20,10 @@ console.log("hey"); var suites_000 = /* tuple */[ "anything_to_string", function () { - return /* Eq */{ - 0: "3", - 1: "" + 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "3", + "" + 3 + ]); } ]; diff --git a/jscomp/test/libarg_test.js b/jscomp/test/libarg_test.js index d3550c2294..0c24fff36c 100644 --- a/jscomp/test/libarg_test.js +++ b/jscomp/test/libarg_test.js @@ -4,6 +4,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); var Arg = require("../stdlib/arg"); +var Block = require("../runtime/block"); var Printf = require("../stdlib/printf"); var Curry = require("../runtime/curry"); var List = require("../stdlib/list"); @@ -24,33 +25,23 @@ function record(fmt) { function f_unit() { return record(/* Format */[ - /* String_literal */{ - 0: "unit()", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "unit()", + /* End_of_format */0 + ]), "unit()" ]); } function f_bool(b) { return Curry._1(record(/* Format */[ - /* String_literal */{ - 0: "bool(", - 1: /* Bool */{ - 0: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 1, - tag: 9 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "bool(", + /* Bool */Block.__(9, [/* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ])]) + ]), "bool(%b)" ]), b); } @@ -61,22 +52,16 @@ var r_clear = [/* true */1]; function f_string(s) { return Curry._1(record(/* Format */[ - /* String_literal */{ - 0: "string(", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "string(", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "string(%s)" ]), s); } @@ -85,24 +70,18 @@ var r_string = [""]; function f_int(i) { return Curry._1(record(/* Format */[ - /* String_literal */{ - 0: "int(", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "int(", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "int(%d)" ]), i); } @@ -111,24 +90,18 @@ var r_int = [0]; function f_float(f) { return Curry._1(record(/* Format */[ - /* String_literal */{ - 0: "float(", - 1: /* Float */{ - 0: /* Float_g */9, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "float(", + /* Float */Block.__(8, [ + /* Float_g */9, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "float(%g)" ]), f); } @@ -137,229 +110,149 @@ var r_float = [0.0]; function f_symbol(s) { return Curry._1(record(/* Format */[ - /* String_literal */{ - 0: "symbol(", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "symbol(", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "symbol(%s)" ]), s); } function f_rest(s) { return Curry._1(record(/* Format */[ - /* String_literal */{ - 0: "rest(", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "rest(", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "rest(%s)" ]), s); } function f_anon(s) { return Curry._1(record(/* Format */[ - /* String_literal */{ - 0: "anon(", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "anon(", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "anon(%s)" ]), s); } var spec_000 = /* tuple */[ "-u", - /* Unit */{ - 0: f_unit, - length: 1, - tag: 0 - }, + /* Unit */Block.__(0, [f_unit]), "Unit (0)" ]; var spec_001 = /* :: */[ /* tuple */[ "-b", - /* Bool */{ - 0: f_bool, - length: 1, - tag: 1 - }, + /* Bool */Block.__(1, [f_bool]), "Bool (1)" ], /* :: */[ /* tuple */[ "-s", - /* Set */{ - 0: r_set, - length: 1, - tag: 2 - }, + /* Set */Block.__(2, [r_set]), "Set (0)" ], /* :: */[ /* tuple */[ "-c", - /* Clear */{ - 0: r_clear, - length: 1, - tag: 3 - }, + /* Clear */Block.__(3, [r_clear]), "Clear (0)" ], /* :: */[ /* tuple */[ "-str", - /* String */{ - 0: f_string, - length: 1, - tag: 4 - }, + /* String */Block.__(4, [f_string]), "String (1)" ], /* :: */[ /* tuple */[ "-sstr", - /* Set_string */{ - 0: r_string, - length: 1, - tag: 5 - }, + /* Set_string */Block.__(5, [r_string]), "Set_string (1)" ], /* :: */[ /* tuple */[ "-i", - /* Int */{ - 0: f_int, - length: 1, - tag: 6 - }, + /* Int */Block.__(6, [f_int]), "Int (1)" ], /* :: */[ /* tuple */[ "-si", - /* Set_int */{ - 0: r_int, - length: 1, - tag: 7 - }, + /* Set_int */Block.__(7, [r_int]), "Set_int (1)" ], /* :: */[ /* tuple */[ "-f", - /* Float */{ - 0: f_float, - length: 1, - tag: 8 - }, + /* Float */Block.__(8, [f_float]), "Float (1)" ], /* :: */[ /* tuple */[ "-sf", - /* Set_float */{ - 0: r_float, - length: 1, - tag: 9 - }, + /* Set_float */Block.__(9, [r_float]), "Set_float (1)" ], /* :: */[ /* tuple */[ "-t", - /* Tuple */{ - 0: /* :: */[ - /* Bool */{ - 0: f_bool, - length: 1, - tag: 1 - }, - /* :: */[ - /* String */{ - 0: f_string, - length: 1, - tag: 4 - }, + /* Tuple */Block.__(10, [/* :: */[ + /* Bool */Block.__(1, [f_bool]), /* :: */[ - /* Int */{ - 0: f_int, - length: 1, - tag: 6 - }, - /* [] */0 + /* String */Block.__(4, [f_string]), + /* :: */[ + /* Int */Block.__(6, [f_int]), + /* [] */0 + ] ] - ] - ], - length: 1, - tag: 10 - }, + ]]), "Tuple (3)" ], /* :: */[ /* tuple */[ "-sym", - /* Symbol */{ - 0: /* :: */[ - "a", + /* Symbol */Block.__(11, [ /* :: */[ - "b", + "a", /* :: */[ - "c", - /* [] */0 + "b", + /* :: */[ + "c", + /* [] */0 + ] ] - ] - ], - 1: f_symbol, - length: 2, - tag: 11 - }, + ], + f_symbol + ]), "Symbol (1)" ], /* :: */[ /* tuple */[ "-rest", - /* Rest */{ - 0: f_rest, - length: 1, - tag: 12 - }, + /* Rest */Block.__(12, [f_rest]), "Rest (*)" ], /* [] */0 @@ -443,22 +336,16 @@ var args2 = /* array */[ function error(s) { return Curry._1(Printf.printf(/* Format */[ - /* String_literal */{ - 0: "error (", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ")\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "error (", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ")\n", + /* End_of_format */0 + ]) + ]) + ]), "error (%s)\n" ]), s); } @@ -531,50 +418,28 @@ function test(argv) { if (Caml_obj.caml_notequal(result, reference)) { var f = function (x, y) { return Curry._3(Printf.printf(/* Format */[ - /* String */{ - 0: /* Lit_padding */{ - 0: /* Right */1, - 1: 20, - length: 2, - tag: 0 - }, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* Lit_padding */{ - 0: /* Left */0, - 1: 20, - length: 2, - tag: 0 - }, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* Lit_padding */Block.__(0, [ + /* Right */1, + 20 + ]), + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* Lit_padding */Block.__(0, [ + /* Left */0, + 20 + ]), + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ])]) + ]) + ]), "%20s %c %-20s\n%!" ]), x, x === y ? /* "=" */61 : /* "#" */35, y); }; @@ -592,13 +457,9 @@ test(args1); var suites_000 = /* tuple */[ "should raise", function () { - return /* ThrowAny */{ - 0: function () { - return test(args2); - }, - length: 1, - tag: 3 - }; + return /* ThrowAny */Block.__(3, [function () { + return test(args2); + }]); } ]; diff --git a/jscomp/test/list_test.js b/jscomp/test/list_test.js index f4728227da..05c08a6a6d 100644 --- a/jscomp/test/list_test.js +++ b/jscomp/test/list_test.js @@ -3,27 +3,26 @@ var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var $$Array = require("../stdlib/array"); var List = require("../stdlib/list"); var list_suites_000 = /* tuple */[ "length", function () { - return /* Eq */{ - 0: 1, - 1: List.length(/* :: */[ - /* tuple */[ - 0, - 1, - 2, - 3, - 4 - ], - /* [] */0 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 1, + List.length(/* :: */[ + /* tuple */[ + 0, + 1, + 2, + 3, + 4 + ], + /* [] */0 + ]) + ]); } ]; @@ -31,77 +30,71 @@ var list_suites_001 = /* :: */[ /* tuple */[ "length2", function () { - return /* Eq */{ - 0: 5, - 1: List.length(/* :: */[ - 0, - /* :: */[ - 1, + return /* Eq */Block.__(0, [ + 5, + List.length(/* :: */[ + 0, /* :: */[ - 2, + 1, /* :: */[ - 3, + 2, /* :: */[ - 4, - /* [] */0 + 3, + /* :: */[ + 4, + /* [] */0 + ] ] ] ] - ] - ]), - length: 2, - tag: 0 - }; + ]) + ]); } ], /* :: */[ /* tuple */[ "long_length", function () { - return /* Eq */{ - 0: 30000, - 1: List.length($$Array.to_list($$Array.init(30000, function () { - return 0; - }))), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 30000, + List.length($$Array.to_list($$Array.init(30000, function () { + return 0; + }))) + ]); } ], /* :: */[ /* tuple */[ "sort", function () { - return /* Eq */{ - 0: List.sort(Caml_obj.caml_int_compare, /* :: */[ - 4, - /* :: */[ - 1, + return /* Eq */Block.__(0, [ + List.sort(Caml_obj.caml_int_compare, /* :: */[ + 4, /* :: */[ - 2, + 1, /* :: */[ - 3, - /* [] */0 + 2, + /* :: */[ + 3, + /* [] */0 + ] ] ] - ] - ]), - 1: /* :: */[ - 1, + ]), /* :: */[ - 2, + 1, /* :: */[ - 3, + 2, /* :: */[ - 4, - /* [] */0 + 3, + /* :: */[ + 4, + /* [] */0 + ] ] ] ] - ], - length: 2, - tag: 0 - }; + ]); } ], /* [] */0 diff --git a/jscomp/test/loop_regression_test.js b/jscomp/test/loop_regression_test.js index b86ebe2f96..0e8b387198 100644 --- a/jscomp/test/loop_regression_test.js +++ b/jscomp/test/loop_regression_test.js @@ -1,7 +1,8 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); function f() { var v = [0]; @@ -23,12 +24,10 @@ function f() { var suites_000 = /* tuple */[ "sum", function () { - return /* Eq */{ - 0: 55, - 1: f(/* () */0), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 55, + f(/* () */0) + ]); } ]; diff --git a/jscomp/test/map_find_test.js b/jscomp/test/map_find_test.js index ca971b6782..938af664fe 100644 --- a/jscomp/test/map_find_test.js +++ b/jscomp/test/map_find_test.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var List = require("../stdlib/list"); var Caml_string = require("../runtime/caml_string"); @@ -353,24 +354,20 @@ Mt.from_pair_suites("map_find_test.ml", /* :: */[ /* tuple */[ "int", function () { - return /* Eq */{ - 0: find(10, m), - 1: /* "a" */97, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + find(10, m), + /* "a" */97 + ]); } ], /* :: */[ /* tuple */[ "string", function () { - return /* Eq */{ - 0: find$1("10", s), - 1: /* "a" */97, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + find$1("10", s), + /* "a" */97 + ]); } ], /* [] */0 diff --git a/jscomp/test/map_test.js b/jscomp/test/map_test.js index 9cfa95debe..27608da88a 100644 --- a/jscomp/test/map_test.js +++ b/jscomp/test/map_test.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_obj = require("../runtime/caml_obj"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Caml_string = require("../runtime/caml_string"); var List = require("../stdlib/list"); @@ -406,12 +407,10 @@ var int_map_suites_000 = /* tuple */[ ] ] ]); - return /* Eq */{ - 0: cardinal(v), - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + cardinal(v), + 3 + ]); } ]; @@ -457,12 +456,10 @@ var int_map_suites_001 = /* :: */[ ] ] ]); - return /* Eq */{ - 0: compare(Caml_obj.caml_compare, u, v), - 1: 0, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + compare(Caml_obj.caml_compare, u, v), + 0 + ]); } ], /* :: */[ @@ -507,14 +504,12 @@ var int_map_suites_001 = /* :: */[ ] ] ]); - return /* Eq */{ - 0: /* true */1, - 1: equal(function (x, y) { - return +(x === y); - }, u, v), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + equal(function (x, y) { + return +(x === y); + }, u, v) + ]); } ], /* :: */[ @@ -532,12 +527,10 @@ var int_map_suites_001 = /* :: */[ } } - return /* Eq */{ - 0: v, - 1: -1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + v, + -1 + ]); } ], /* [] */0 diff --git a/jscomp/test/module_parameter_test.js b/jscomp/test/module_parameter_test.js index ad529fef1f..959241712d 100644 --- a/jscomp/test/module_parameter_test.js +++ b/jscomp/test/module_parameter_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var $$String = require("../stdlib/string"); function u(v) { @@ -47,12 +48,10 @@ function v(x) { var suites_000 = /* tuple */[ "const", function () { - return /* Eq */{ - 0: 1, - 1: v0, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 1, + v0 + ]); } ]; @@ -60,12 +59,10 @@ var suites_001 = /* :: */[ /* tuple */[ "other", function () { - return /* Eq */{ - 0: 3, - 1: v("abc"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3, + v("abc") + ]); } ], /* [] */0 diff --git a/jscomp/test/mt_global.js b/jscomp/test/mt_global.js index 5153f98097..5e2b968f86 100644 --- a/jscomp/test/mt_global.js +++ b/jscomp/test/mt_global.js @@ -1,6 +1,7 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); function collect_eq(test_id, suites, loc, x, y) { test_id[0] = test_id[0] + 1 | 0; @@ -8,12 +9,10 @@ function collect_eq(test_id, suites, loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Eq */{ - 0: x, - 1: y, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + y + ]); } ], suites[0] @@ -27,12 +26,10 @@ function collect_neq(test_id, suites, loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Neq */{ - 0: x, - 1: y, - length: 2, - tag: 1 - }; + return /* Neq */Block.__(1, [ + x, + y + ]); } ], suites[0] @@ -46,12 +43,10 @@ function collect_approx(test_id, suites, loc, x, y) { /* tuple */[ loc + (" id " + test_id[0]), function () { - return /* Approx */{ - 0: x, - 1: y, - length: 2, - tag: 2 - }; + return /* Approx */Block.__(2, [ + x, + y + ]); } ], suites[0] diff --git a/jscomp/test/obj_magic_test.js b/jscomp/test/obj_magic_test.js index 14184d6227..b34aa8f980 100644 --- a/jscomp/test/obj_magic_test.js +++ b/jscomp/test/obj_magic_test.js @@ -1,13 +1,11 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Obj = require("../stdlib/obj"); -var Mt = require("./mt"); +var Obj = require("../stdlib/obj"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); -var empty_backtrace = { - length: 0, - tag: Obj.abstract_tag -}; +var empty_backtrace = Block.__(Obj.abstract_tag, []); function is_block(x) { return x.length !== undefined; @@ -16,12 +14,10 @@ function is_block(x) { var suites_000 = /* tuple */[ "is_block_test1", function () { - return /* Eq */{ - 0: /* false */0, - 1: (3).length !== undefined, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* false */0, + (3).length !== undefined + ]); } ]; @@ -29,39 +25,33 @@ var suites_001 = /* :: */[ /* tuple */[ "is_block_test2", function () { - return /* Eq */{ - 0: /* true */1, - 1: /* :: */[ - 3, - /* [] */0 - ].length !== undefined, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + /* :: */[ + 3, + /* [] */0 + ].length !== undefined + ]); } ], /* :: */[ /* tuple */[ "is_block_test3", function () { - return /* Eq */{ - 0: /* true */1, - 1: "x".length !== undefined, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + "x".length !== undefined + ]); } ], /* :: */[ /* tuple */[ "is_block_test4", function () { - return /* Eq */{ - 0: /* false */0, - 1: (3.0).length !== undefined, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* false */0, + (3.0).length !== undefined + ]); } ], /* [] */0 diff --git a/jscomp/test/obj_test.js b/jscomp/test/obj_test.js index beeceb9884..e34eba08f0 100644 --- a/jscomp/test/obj_test.js +++ b/jscomp/test/obj_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalOO = require("../stdlib/camlinternalOO"); @@ -162,18 +163,16 @@ var vvvv = CamlinternalOO.create_object_opt(0, $$class$5); var suites_000 = /* tuple */[ "single_obj", function () { - return /* Eq */{ - 0: /* int array */[ - 3, - 32 - ], - 1: /* int array */[ - v.tag === 248 ? Curry.js1(120, 1, v) : v.x, - v.tag === 248 ? Curry.js1(121, 2, v) : v.y - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int array */[ + 3, + 32 + ], + /* int array */[ + v.tag === 248 ? Curry.js1(120, 1, v) : v.x, + v.tag === 248 ? Curry.js1(121, 2, v) : v.y + ] + ]); } ]; @@ -181,150 +180,126 @@ var suites_001 = /* :: */[ /* tuple */[ "single_obj_cache", function () { - return /* Eq */{ - 0: /* int array */[ - 3, - 32 - ], - 1: /* int array */[ - v.tag === 248 ? Curry.js1(120, 3, v) : v.x, - v.tag === 248 ? Curry.js1(121, 4, v) : v.y - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* int array */[ + 3, + 32 + ], + /* int array */[ + v.tag === 248 ? Curry.js1(120, 3, v) : v.x, + v.tag === 248 ? Curry.js1(121, 4, v) : v.y + ] + ]); } ], /* :: */[ /* tuple */[ "self_obj", function () { - return /* Eq */{ - 0: 13, - 1: vv.tag === 248 ? Curry.js2(616641298, 5, vv, 3) : Curry._1(vv.hello.bind(vv), 3), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 13, + vv.tag === 248 ? Curry.js2(616641298, 5, vv, 3) : Curry._1(vv.hello.bind(vv), 3) + ]); } ], /* :: */[ /* tuple */[ "uu_id", function () { - return /* Eq */{ - 0: "uu", - 1: uu.tag === 248 ? Curry.js1(23515, 6, uu) : uu.id, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "uu", + uu.tag === 248 ? Curry.js1(23515, 6, uu) : uu.id + ]); } ], /* :: */[ /* tuple */[ "uu_add", function () { - return /* Eq */{ - 0: uuu.tag === 248 ? Curry.js3(4846113, 7, uuu, 1, 20) : Curry._2(uuu.add.bind(uuu), 1, 20), - 1: 21, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + uuu.tag === 248 ? Curry.js3(4846113, 7, uuu, 1, 20) : Curry._2(uuu.add.bind(uuu), 1, 20), + 21 + ]); } ], /* :: */[ /* tuple */[ "v_add", function () { - return /* Eq */{ - 0: vvvv.tag === 248 ? Curry.js3(4846113, 8, vvvv, 3, 7) : Curry._2(vvvv.add.bind(vvvv), 3, 7), - 1: 10, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + vvvv.tag === 248 ? Curry.js3(4846113, 8, vvvv, 3, 7) : Curry._2(vvvv.add.bind(vvvv), 3, 7), + 10 + ]); } ], /* :: */[ /* tuple */[ "u_id1", function () { - return /* Eq */{ - 0: u.tag === 248 ? Curry.js1(5243894, 9, u) : u.id1, - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + u.tag === 248 ? Curry.js1(5243894, 9, u) : u.id1, + 3 + ]); } ], /* :: */[ /* tuple */[ "u_id2", function () { - return /* Eq */{ - 0: u.tag === 248 ? Curry.js1(5243895, 10, u) : u.id2, - 1: 4, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + u.tag === 248 ? Curry.js1(5243895, 10, u) : u.id2, + 4 + ]); } ], /* :: */[ /* tuple */[ "u hi", function () { - return /* Eq */{ - 0: u.tag === 248 ? Curry.js3(23297, 11, u, 1, 2) : Curry._2(u.hi.bind(u), 1, 2), - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + u.tag === 248 ? Curry.js3(23297, 11, u, 1, 2) : Curry._2(u.hi.bind(u), 1, 2), + 3 + ]); } ], /* :: */[ /* tuple */[ "u hello", function () { - return /* Eq */{ - 0: u.tag === 248 ? Curry.js2(616641298, 12, u, 32) : Curry._1(u.hello.bind(u), 32), - 1: 32, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + u.tag === 248 ? Curry.js2(616641298, 12, u, 32) : Curry._1(u.hello.bind(u), 32), + 32 + ]); } ], /* :: */[ /* tuple */[ "v hi", function () { - return /* Eq */{ - 0: vvvv.tag === 248 ? Curry.js2(23297, 13, vvvv, 31) : Curry._1(vvvv.hi.bind(vvvv), 31), - 1: 63, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + vvvv.tag === 248 ? Curry.js2(23297, 13, vvvv, 31) : Curry._1(vvvv.hi.bind(vvvv), 31), + 63 + ]); } ], /* :: */[ /* tuple */[ "uuu add", function () { - return /* Eq */{ - 0: uuu.tag === 248 ? Curry.js3(4846113, 14, uuu, 3, 4) : Curry._2(uuu.add.bind(uuu), 3, 4), - 1: 7, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + uuu.tag === 248 ? Curry.js3(4846113, 14, uuu, 3, 4) : Curry._2(uuu.add.bind(uuu), 3, 4), + 7 + ]); } ], /* :: */[ /* tuple */[ "v x", function () { - return /* Eq */{ - 0: v.tag === 248 ? Curry.js1(120, 15, v) : v.x, - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + v.tag === 248 ? Curry.js1(120, 15, v) : v.x, + 3 + ]); } ], /* [] */0 diff --git a/jscomp/test/of_string_test.js b/jscomp/test/of_string_test.js index cecd36d677..fd8759158e 100644 --- a/jscomp/test/of_string_test.js +++ b/jscomp/test/of_string_test.js @@ -3,16 +3,15 @@ var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var suites_000 = /* tuple */[ "string_of_float_1", function () { - return /* Eq */{ - 0: "10.", - 1: Pervasives.string_of_float(10), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "10.", + Pervasives.string_of_float(10) + ]); } ]; @@ -20,24 +19,20 @@ var suites_001 = /* :: */[ /* tuple */[ "string_of_int", function () { - return /* Eq */{ - 0: "10", - 1: "" + 10, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "10", + "" + 10 + ]); } ], /* :: */[ /* tuple */[ "valid_float_lexem", function () { - return /* Eq */{ - 0: "10.", - 1: Pervasives.valid_float_lexem("10"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "10.", + Pervasives.valid_float_lexem("10") + ]); } ], /* [] */0 diff --git a/jscomp/test/pr_regression_test.js b/jscomp/test/pr_regression_test.js index ccb731f833..35bad2050a 100644 --- a/jscomp/test/pr_regression_test.js +++ b/jscomp/test/pr_regression_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var v = [3]; @@ -84,22 +85,20 @@ Mt.from_pair_suites("pr_regression_test.ml", /* :: */[ /* tuple */[ "partial", function () { - return /* Eq */{ - 0: /* tuple */[ - 5, - 5, - 5, - 5 - ], - 1: /* tuple */[ - a, - b, - c, - d - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + 5, + 5, + 5, + 5 + ], + /* tuple */[ + a, + b, + c, + d + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/print_alpha_test.js b/jscomp/test/print_alpha_test.js index fdec820294..6051f84c5f 100644 --- a/jscomp/test/print_alpha_test.js +++ b/jscomp/test/print_alpha_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); function f(h, _) { @@ -16,14 +17,12 @@ Mt.from_pair_suites("print_alpha_test.ml", /* :: */[ /* tuple */[ 'File "print_alpha_test.ml", line 15, characters 4-11', function () { - return /* Eq */{ - 0: f(function (prim, prim$1) { - return prim + prim$1 | 0; - }, /* () */0)(1, 2), - 1: 3, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + f(function (prim, prim$1) { + return prim + prim$1 | 0; + }, /* () */0)(1, 2), + 3 + ]); } ], /* [] */0 diff --git a/jscomp/test/printf_sim.js b/jscomp/test/printf_sim.js index c49a9ad7f8..9c1efa68cf 100644 --- a/jscomp/test/printf_sim.js +++ b/jscomp/test/printf_sim.js @@ -1,23 +1,20 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); Curry._1(Printf.printf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 7 - }, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%Ld\n" ]), /* int64 */[ 0, @@ -25,72 +22,50 @@ Curry._1(Printf.printf(/* Format */[ ]); Printf.printf(/* Format */[ - /* String_literal */{ - 0: "heloo!\nhelloxx\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "heloo!\nhelloxx\n", + /* End_of_format */0 + ]), "heloo!\nhelloxx\n" ]); Printf.printf(/* Format */[ - /* String_literal */{ - 0: "hello\nhi\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "hello\nhi\n", + /* End_of_format */0 + ]), "hello\nhi\n" ]); Curry._2(Printf.printf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* Arg_padding */{ - 0: /* Right */1, - length: 1, - tag: 1 - }, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: "\n\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Arg_padding */Block.__(1, [/* Right */1]), + /* No_precision */0, + /* String_literal */Block.__(11, [ + "\n\n", + /* End_of_format */0 + ]) + ]), "%*d\n\n" ]), 32, 3); Curry._1(Printf.printf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), Curry._2(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* Arg_padding */{ - 0: /* Right */1, - length: 1, - tag: 1 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Arg_padding */Block.__(1, [/* Right */1]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%*d\n" ]), 32, 3)); diff --git a/jscomp/test/printf_test.js b/jscomp/test/printf_test.js index 5989fb8745..625a23de5c 100644 --- a/jscomp/test/printf_test.js +++ b/jscomp/test/printf_test.js @@ -2,42 +2,33 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var Format = require("../stdlib/format"); function print_pair(fmt, param) { return Curry._2(Format.fprintf(fmt, /* Format */[ - /* Char_literal */{ - 0: /* "(" */40, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "," */44, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "(" */40, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "," */44, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "(%d,%d)" ]), param[0], param[1]); } @@ -45,27 +36,21 @@ function print_pair(fmt, param) { var suites_000 = /* tuple */[ "sprintf_simple", function () { - return /* Eq */{ - 0: "3232", - 1: Curry._2(Printf.sprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 2 - }, - "%s%d" - ]), "32", 32), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "3232", + Curry._2(Printf.sprintf(/* Format */[ + /* String */Block.__(2, [ + /* No_padding */0, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), + "%s%d" + ]), "32", 32) + ]); } ]; @@ -73,42 +58,32 @@ var suites_001 = /* :: */[ /* tuple */[ "print_asprintf", function () { - return /* Eq */{ - 0: "xx", - 1: Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "xx", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - "xx" - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "xx", + Format.asprintf(/* Format */[ + /* String_literal */Block.__(11, [ + "xx", + /* End_of_format */0 + ]), + "xx" + ]) + ]); } ], /* :: */[ /* tuple */[ "print_pair", function () { - return /* Eq */{ - 0: "(1,2)", - 1: Curry._2(Format.asprintf(/* Format */[ - /* Alpha */{ - 0: /* End_of_format */0, - length: 1, - tag: 15 - }, - "%a" - ]), print_pair, /* tuple */[ - 1, - 2 - ]), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "(1,2)", + Curry._2(Format.asprintf(/* Format */[ + /* Alpha */Block.__(15, [/* End_of_format */0]), + "%a" + ]), print_pair, /* tuple */[ + 1, + 2 + ]) + ]); } ], /* [] */0 @@ -121,12 +96,10 @@ var suites = /* :: */[ ]; var v = Format.asprintf(/* Format */[ - /* String_literal */{ - 0: "xx", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "xx", + /* End_of_format */0 + ]), "xx" ]); diff --git a/jscomp/test/qcc.js b/jscomp/test/qcc.js index 179083026f..0184924d8e 100644 --- a/jscomp/test/qcc.js +++ b/jscomp/test/qcc.js @@ -7,6 +7,7 @@ var Bytes = require("../stdlib/bytes"); var Caml_obj = require("../runtime/caml_obj"); var Pervasives = require("../stdlib/pervasives"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Char = require("../stdlib/char"); var Sys = require("../stdlib/sys"); var Curry = require("../runtime/curry"); @@ -237,11 +238,7 @@ function next() { var n = _n; var match$1 = peekch(/* () */0); if (match$1 > 57 || match$1 < 48) { - return /* ILit */{ - 0: n, - length: 1, - tag: 1 - }; + return /* ILit */Block.__(1, [n]); } else { _n = (Caml_int32.imul(10, n) + Curry._1(getch, /* () */0) | 0) - 48 | 0; @@ -264,11 +261,7 @@ function next() { ]; } else { - return /* ILit */{ - 0: ch, - length: 1, - tag: 1 - }; + return /* ILit */Block.__(1, [ch]); } } } @@ -287,12 +280,10 @@ function next() { else { Curry._1(getch, /* () */0); gpos[0] = e + 8 & -8; - return /* SLit */{ - 0: (b + 232 | 0) + 4194304 | 0, - 1: Bytes.to_string(Bytes.sub(glo, b, e - b | 0)), - length: 2, - tag: 2 - }; + return /* SLit */Block.__(2, [ + (b + 232 | 0) + 4194304 | 0, + Bytes.to_string(Bytes.sub(glo, b, e - b | 0)) + ]); } }; } @@ -311,11 +302,7 @@ function next() { } else { - return /* Sym */{ - 0: Curry._1(addsym, Bytes.to_string(Bytes.sub(s, 0, n$1 + 1 | 0))), - length: 1, - tag: 3 - }; + return /* Sym */Block.__(3, [Curry._1(addsym, Bytes.to_string(Bytes.sub(s, 0, n$1 + 1 | 0)))]); } }; } @@ -358,11 +345,7 @@ function next() { var lop = param[0]; if (lop.charCodeAt(0) === ch$2 && lop.charCodeAt(1) === peekch(/* () */0)) { Curry._1(getch, /* () */0); - return /* Op */{ - 0: lop, - length: 1, - tag: 0 - }; + return /* Op */Block.__(0, [lop]); } else { _param = param[1]; @@ -371,11 +354,7 @@ function next() { } } else { - return /* Op */{ - 0: Caml_string.bytes_to_string(Bytes.make(1, ch$2)), - length: 1, - tag: 0 - }; + return /* Op */Block.__(0, [Caml_string.bytes_to_string(Bytes.make(1, ch$2))]); } }; } @@ -383,11 +362,7 @@ function next() { } else { - return /* Op */{ - 0: "EOF!", - length: 1, - tag: 0 - }; + return /* Op */Block.__(0, ["EOF!"]); } } @@ -448,48 +423,34 @@ function patch(rel, loc, n) { var x = rel ? n - (loc + 4 | 0) | 0 : n; if (dbg[0]) { Curry._3(Printf.eprintf(/* Format */[ - /* String_literal */{ - 0: "patching at ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " to ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " (n=", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ")\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "patching at ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " to ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " (n=", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ")\n", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]), "patching at %d to %d (n=%d)\n" ]), loc, x, n); } @@ -545,11 +506,7 @@ function pop(r) { } var lval = [/* tuple */[ - /* Mov */{ - 0: 0, - length: 1, - tag: 0 - }, + /* Mov */Block.__(0, [0]), /* Int */0 ]]; @@ -570,11 +527,7 @@ function read(param) { out(4722614); le(8, 0); lval[0] = /* tuple */[ - /* Del */{ - 0: 4, - length: 1, - tag: 1 - }, + /* Del */Block.__(1, [4]), /* Chr */1 ]; return /* () */0; @@ -583,11 +536,7 @@ function read(param) { out(18571); le(8, 0); lval[0] = /* tuple */[ - /* Del */{ - 0: 3, - length: 1, - tag: 1 - }, + /* Del */Block.__(1, [3]), /* Int */0 ]; return /* () */0; @@ -712,200 +661,136 @@ var lvls = /* :: */[ var inss = /* :: */[ /* tuple */[ "*", - /* Bin */{ - 0: /* :: */[ - 1208987585, - /* [] */0 - ], - length: 1, - tag: 0 - } + /* Bin */Block.__(0, [/* :: */[ + 1208987585, + /* [] */0 + ]]) ], /* :: */[ /* tuple */[ "/", - /* Bin */{ - 0: /* :: */[ - 18577, - /* :: */[ - 18585, + /* Bin */Block.__(0, [/* :: */[ + 18577, /* :: */[ - 4782073, - /* [] */0 + 18585, + /* :: */[ + 4782073, + /* [] */0 + ] ] - ] - ], - length: 1, - tag: 0 - } + ]]) ], /* :: */[ /* tuple */[ "%", - /* Bin */{ - 0: /* :: */[ - 18577, - /* :: */[ - 18585, + /* Bin */Block.__(0, [/* :: */[ + 18577, /* :: */[ - 4782073, + 18585, /* :: */[ - 18578, - /* [] */0 + 4782073, + /* :: */[ + 18578, + /* [] */0 + ] ] ] - ] - ], - length: 1, - tag: 0 - } + ]]) ], /* :: */[ /* tuple */[ "+", - /* Bin */{ - 0: /* :: */[ - 4719048, - /* [] */0 - ], - length: 1, - tag: 0 - } + /* Bin */Block.__(0, [/* :: */[ + 4719048, + /* [] */0 + ]]) ], /* :: */[ /* tuple */[ "-", - /* Bin */{ - 0: /* :: */[ - 18577, - /* :: */[ - 4729288, - /* [] */0 - ] - ], - length: 1, - tag: 0 - } - ], - /* :: */[ - /* tuple */[ - "<<", - /* Bin */{ - 0: /* :: */[ + /* Bin */Block.__(0, [/* :: */[ 18577, /* :: */[ - 4772832, + 4729288, /* [] */0 ] - ], - length: 1, - tag: 0 - } - ], - /* :: */[ - /* tuple */[ - ">>", - /* Bin */{ - 0: /* :: */[ + ]]) + ], + /* :: */[ + /* tuple */[ + "<<", + /* Bin */Block.__(0, [/* :: */[ 18577, /* :: */[ - 4772856, + 4772832, /* [] */0 ] - ], - length: 1, - tag: 0 - } + ]]) + ], + /* :: */[ + /* tuple */[ + ">>", + /* Bin */Block.__(0, [/* :: */[ + 18577, + /* :: */[ + 4772856, + /* [] */0 + ] + ]]) ], /* :: */[ /* tuple */[ "<", - /* Cmp */{ - 0: 10, - length: 1, - tag: 1 - } + /* Cmp */Block.__(1, [10]) ], /* :: */[ /* tuple */[ "<=", - /* Cmp */{ - 0: 12, - length: 1, - tag: 1 - } + /* Cmp */Block.__(1, [12]) ], /* :: */[ /* tuple */[ ">", - /* Cmp */{ - 0: 13, - length: 1, - tag: 1 - } + /* Cmp */Block.__(1, [13]) ], /* :: */[ /* tuple */[ ">=", - /* Cmp */{ - 0: 11, - length: 1, - tag: 1 - } + /* Cmp */Block.__(1, [11]) ], /* :: */[ /* tuple */[ "==", - /* Cmp */{ - 0: 2, - length: 1, - tag: 1 - } + /* Cmp */Block.__(1, [2]) ], /* :: */[ /* tuple */[ "!=", - /* Cmp */{ - 0: 3, - length: 1, - tag: 1 - } + /* Cmp */Block.__(1, [3]) ], /* :: */[ /* tuple */[ "&", - /* Bin */{ - 0: /* :: */[ - 4727240, - /* [] */0 - ], - length: 1, - tag: 0 - } + /* Bin */Block.__(0, [/* :: */[ + 4727240, + /* [] */0 + ]]) ], /* :: */[ /* tuple */[ "^", - /* Bin */{ - 0: /* :: */[ - 4731336, - /* [] */0 - ], - length: 1, - tag: 0 - } + /* Bin */Block.__(0, [/* :: */[ + 4731336, + /* [] */0 + ]]) ], /* :: */[ /* tuple */[ "|", - /* Bin */{ - 0: /* :: */[ - 4721096, - /* [] */0 - ], - length: 1, - tag: 0 - } + /* Bin */Block.__(0, [/* :: */[ + 4721096, + /* [] */0 + ]]) ], /* [] */0 ] @@ -925,53 +810,21 @@ var inss = /* :: */[ ] ]; -var tokint = /* Sym */{ - 0: Curry._1(addsym, "int"), - length: 1, - tag: 3 -}; - -var tokchar = /* Sym */{ - 0: Curry._1(addsym, "char"), - length: 1, - tag: 3 -}; - -var tokret = /* Sym */{ - 0: Curry._1(addsym, "return"), - length: 1, - tag: 3 -}; - -var tokif = /* Sym */{ - 0: Curry._1(addsym, "if"), - length: 1, - tag: 3 -}; - -var tokelse = /* Sym */{ - 0: Curry._1(addsym, "else"), - length: 1, - tag: 3 -}; - -var tokwhile = /* Sym */{ - 0: Curry._1(addsym, "while"), - length: 1, - tag: 3 -}; - -var tokfor = /* Sym */{ - 0: Curry._1(addsym, "for"), - length: 1, - tag: 3 -}; - -var tokbreak = /* Sym */{ - 0: Curry._1(addsym, "break"), - length: 1, - tag: 3 -}; +var tokint = /* Sym */Block.__(3, [Curry._1(addsym, "int")]); + +var tokchar = /* Sym */Block.__(3, [Curry._1(addsym, "char")]); + +var tokret = /* Sym */Block.__(3, [Curry._1(addsym, "return")]); + +var tokif = /* Sym */Block.__(3, [Curry._1(addsym, "if")]); + +var tokelse = /* Sym */Block.__(3, [Curry._1(addsym, "else")]); + +var tokwhile = /* Sym */Block.__(3, [Curry._1(addsym, "while")]); + +var tokfor = /* Sym */Block.__(3, [Curry._1(addsym, "for")]); + +var tokbreak = /* Sym */Block.__(3, [Curry._1(addsym, "break")]); function binary(stk, lvl) { if (lvl === -1) { @@ -1064,11 +917,7 @@ function unary(stk) { var t = Curry._1(next$1, /* () */0); var match$1; if (Caml_obj.caml_equal(t, tokint)) { - match$1 = Caml_obj.caml_equal(Curry._1(next$1, /* () */0), /* Op */{ - 0: "*", - length: 1, - tag: 0 - }) ? /* tuple */[ + match$1 = Caml_obj.caml_equal(Curry._1(next$1, /* () */0), /* Op */Block.__(0, ["*"])) ? /* tuple */[ /* Int */0, 1 ] : /* tuple */[ @@ -1122,17 +971,13 @@ function unary(stk) { unary(stk); if (!List.mem_assoc(o, unops)) { var s = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "unknown operator ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "unknown operator ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "unknown operator %s" ]), o); throw [ @@ -1171,11 +1016,7 @@ function unary(stk) { out(4754245); out(l & 255); lval[0] = /* tuple */[ - /* Mov */{ - 0: 3, - length: 1, - tag: 0 - }, + /* Mov */Block.__(0, [3]), /* Int */0 ]; } @@ -1209,22 +1050,14 @@ function postfix(stk) { while(true) { var rl = _rl; var l = _l; - if (nextis(/* Op */{ - 0: ")", - length: 1, - tag: 0 - })) { + if (nextis(/* Op */Block.__(0, [")"]))) { Curry._1(next$1, /* () */0); return List.iter(pop, l); } else { expr(stk); push(0); - if (nextis(/* Op */{ - 0: ",", - length: 1, - tag: 0 - })) { + if (nextis(/* Op */Block.__(0, [","]))) { Curry._1(next$1, /* () */0); } _rl = List.tl(rl); @@ -1367,18 +1200,10 @@ function decl(g, _n, _stk) { while(true) { var stk = _stk; var n = _n; - while(nextis(/* Op */{ - 0: "*", - length: 1, - tag: 0 - })) { + while(nextis(/* Op */Block.__(0, ["*"]))) { Curry._1(next$1, /* () */0); }; - if (nextis(/* Op */{ - 0: ";", - length: 1, - tag: 0 - })) { + if (nextis(/* Op */Block.__(0, [";"]))) { return /* tuple */[ n, stk @@ -1415,11 +1240,7 @@ function decl(g, _n, _stk) { stk ]; } - if (nextis(/* Op */{ - 0: ",", - length: 1, - tag: 0 - })) { + if (nextis(/* Op */Block.__(0, [","]))) { Curry._1(next$1, /* () */0); _stk = stk$prime; _n = n$prime; @@ -1447,24 +1268,18 @@ function decl(g, _n, _stk) { Curry._1(next$1, /* () */0); if (dbg[0]) { Curry._1(Printf.eprintf(/* Format */[ - /* String_literal */{ - 0: "end of decl (", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " vars)\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "end of decl (", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " vars)\n", + /* End_of_format */0 + ]) + ]) + ]), "end of decl (%d vars)\n" ]), n); } @@ -1546,20 +1361,12 @@ function stmt(brk, stk) { } else { Curry._1(next$1, /* () */0); - if (!nextis(/* Op */{ - 0: ";", - length: 1, - tag: 0 - })) { + if (!nextis(/* Op */Block.__(0, [";"]))) { expr(stk); } Curry._1(next$1, /* () */0); var top = opos[0]; - if (nextis(/* Op */{ - 0: ";", - length: 1, - tag: 0 - })) { + if (nextis(/* Op */Block.__(0, [";"]))) { bl[0] = 0; } else { @@ -1590,11 +1397,7 @@ function stmt(brk, stk) { return patch(/* true */1, bl[0], opos[0]); } else if (Caml_obj.caml_equal(t, tokret)) { - if (!nextis(/* Op */{ - 0: ";", - length: 1, - tag: 0 - })) { + if (!nextis(/* Op */Block.__(0, [";"]))) { expr(stk); } Curry._1(next$1, /* () */0); @@ -1653,11 +1456,7 @@ function block(brk, stk) { var match = decl(/* false */0, 0, stk); var stk$prime = match[1]; var n = match[0]; - while(!nextis(/* Op */{ - 0: "}", - length: 1, - tag: 0 - })) { + while(!nextis(/* Op */Block.__(0, ["}"]))) { stmt(brk, stk$prime); }; Curry._1(next$1, /* () */0); @@ -1674,11 +1473,7 @@ function block(brk, stk) { function top(_param) { while(true) { - if (nextis(/* Op */{ - 0: "EOF!", - length: 1, - tag: 0 - })) { + if (nextis(/* Op */Block.__(0, ["EOF!"]))) { return 0; } else if (nextis(tokint)) { @@ -1729,11 +1524,7 @@ function top(_param) { case 3 : var r = List.hd(regs); push(r); - if (nextis(/* Op */{ - 0: ",", - length: 1, - tag: 0 - })) { + if (nextis(/* Op */Block.__(0, [","]))) { Curry._1(next$1, /* () */0); } var stk$prime_000 = /* tuple */[ @@ -1775,11 +1566,7 @@ function top(_param) { ] ] ], 1, /* [] */0); - while(Caml_obj.caml_notequal(Curry._1(next$1, /* () */0), /* Op */{ - 0: "{", - length: 1, - tag: 0 - })) { + while(Caml_obj.caml_notequal(Curry._1(next$1, /* () */0), /* Op */Block.__(0, ["{"]))) { }; retl[0] = 0; @@ -1791,22 +1578,16 @@ function top(_param) { out(51651); if (dbg[0]) { Curry._1(Printf.eprintf(/* Format */[ - /* String_literal */{ - 0: "done with function ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "done with function ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "done with function %s\n" ]), Curry._1(symstr, f)); } @@ -2067,97 +1848,69 @@ function main() { switch (param.tag | 0) { case 0 : return Curry._1(Printf.printf(/* Format */[ - /* String_literal */{ - 0: "Operator '", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "'\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Operator '", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "'\n", + /* End_of_format */0 + ]) + ]) + ]), "Operator '%s'\n" ]), param[0]); case 1 : return Curry._1(Printf.printf(/* Format */[ - /* String_literal */{ - 0: "Int literal ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Int literal ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "Int literal %d\n" ]), param[0]); case 2 : return Curry._1(Printf.printf(/* Format */[ - /* String_literal */{ - 0: "Str literal ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Str literal ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "Str literal %S\n" ]), param[1]); case 3 : var i = param[0]; return Curry._2(Printf.printf(/* Format */[ - /* String_literal */{ - 0: "Symbol '", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "' (", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ")\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Symbol '", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "' (", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ")\n", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "Symbol '%s' (%d)\n" ]), Curry._1(symstr, i), i); @@ -2190,12 +1943,10 @@ function main() { } else if (tok[0] === "EOF!") { return Printf.printf(/* Format */[ - /* String_literal */{ - 0: "End of input stream\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "End of input stream\n", + /* End_of_format */0 + ]), "End of input stream\n" ]); } diff --git a/jscomp/test/queue_test.js b/jscomp/test/queue_test.js index 5c12bdefa8..9e5dd86450 100644 --- a/jscomp/test/queue_test.js +++ b/jscomp/test/queue_test.js @@ -3,6 +3,7 @@ var Mt = require("./mt"); var Queue = require("../stdlib/queue"); +var Block = require("../runtime/block"); var Caml_array = require("../runtime/caml_array"); var $$Array = require("../stdlib/array"); @@ -35,12 +36,10 @@ var suites_000 = /* tuple */[ 5, 2 ]; - return /* Eq */{ - 0: x, - 1: queue_1(x), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + x, + queue_1(x) + ]); } ]; diff --git a/jscomp/test/random_test.js b/jscomp/test/random_test.js index 8b8b116c9c..52a63055fd 100644 --- a/jscomp/test/random_test.js +++ b/jscomp/test/random_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Mt_global = require("./mt_global"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); @@ -78,67 +79,47 @@ var xx = Random.$$float(3.0); var xxx = Random.int32(103); Curry._5(Printf.printf(/* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int32 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " \n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 5 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 7 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 7 - }, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int32 */Block.__(5, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " \n", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), "%Ld %Ld %d %f %ld \n" ]), f, h, vv, xx, xxx); diff --git a/jscomp/test/rec_module_test.js b/jscomp/test/rec_module_test.js index ddfa4114f9..860e18401c 100644 --- a/jscomp/test/rec_module_test.js +++ b/jscomp/test/rec_module_test.js @@ -3,6 +3,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var CamlinternalMod = require("../stdlib/camlinternalMod"); var List = require("../stdlib/list"); @@ -1064,22 +1065,20 @@ CamlinternalMod.update_mod([[0]], AAA, /* module */[compare$1]); var suites_000 = /* tuple */[ "test1", function () { - return /* Eq */{ - 0: /* tuple */[ - /* true */1, - /* true */1, - /* false */0, - /* false */0 - ], - 1: /* tuple */[ - Curry._1(A[/* even */0], 2), - Curry._1(AA[/* even */0], 4), - Curry._1(B[/* odd */0], 2), - Curry._1(BB[/* odd */0], 4) - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* tuple */[ + /* true */1, + /* true */1, + /* false */0, + /* false */0 + ], + /* tuple */[ + Curry._1(A[/* even */0], 2), + Curry._1(AA[/* even */0], 4), + Curry._1(B[/* odd */0], 2), + Curry._1(BB[/* odd */0], 4) + ] + ]); } ]; @@ -1087,93 +1086,69 @@ var suites_001 = /* :: */[ /* tuple */[ "test2", function () { - return /* Eq */{ - 0: Curry._1(BB[/* y */1], /* () */0), - 1: 32, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(BB[/* y */1], /* () */0), + 32 + ]); } ], /* :: */[ /* tuple */[ "test3", function () { - return /* Eq */{ - 0: Curry._1(AA[/* x */1], /* () */0), - 1: 35, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(AA[/* x */1], /* () */0), + 35 + ]); } ], /* :: */[ /* tuple */[ "test4", function () { - return /* Eq */{ - 0: /* true */1, - 1: Curry._1(A[/* even */0], 2), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + Curry._1(A[/* even */0], 2) + ]); } ], /* :: */[ /* tuple */[ "test4", function () { - return /* Eq */{ - 0: /* true */1, - 1: Curry._1(AA[/* even */0], 4), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* true */1, + Curry._1(AA[/* even */0], 4) + ]); } ], /* :: */[ /* tuple */[ "test5", function () { - return /* Eq */{ - 0: /* false */0, - 1: Curry._1(B[/* odd */0], 2), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* false */0, + Curry._1(B[/* odd */0], 2) + ]); } ], /* :: */[ /* tuple */[ "test6", function () { - return /* Eq */{ - 0: 2, - 1: cardinal(of_list(/* :: */[ - /* Leaf */{ - 0: "a", - length: 1, - tag: 0 - }, - /* :: */[ - /* Leaf */{ - 0: "b", - length: 1, - tag: 0 - }, + return /* Eq */Block.__(0, [ + 2, + cardinal(of_list(/* :: */[ + /* Leaf */Block.__(0, ["a"]), /* :: */[ - /* Leaf */{ - 0: "a", - length: 1, - tag: 0 - }, - /* [] */0 + /* Leaf */Block.__(0, ["b"]), + /* :: */[ + /* Leaf */Block.__(0, ["a"]), + /* [] */0 + ] ] - ] - ])), - length: 2, - tag: 0 - }; + ])) + ]); } ], /* [] */0 diff --git a/jscomp/test/rec_value_test.js b/jscomp/test/rec_value_test.js index a05fef3a4a..276fbb2c3b 100644 --- a/jscomp/test/rec_value_test.js +++ b/jscomp/test/rec_value_test.js @@ -4,6 +4,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var CamlinternalLazy = require("../stdlib/camlinternalLazy"); +var Block = require("../runtime/block"); var List = require("../stdlib/list"); var x = { @@ -79,11 +80,7 @@ var h = { }; -Caml_obj.caml_update_dummy(h, { - 0: fib, - length: 1, - tag: 250 - }); +Caml_obj.caml_update_dummy(h, Block.__(250, [fib])); function fib(n) { if (n > 3 || n < 0) { @@ -286,12 +283,10 @@ var v$1 = 3; var suites_000 = /* tuple */[ "hd", function () { - return /* Eq */{ - 0: 1, - 1: List.hd(List.tl(x)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 1, + List.hd(List.tl(x)) + ]); } ]; @@ -326,60 +321,44 @@ var suites_001 = /* :: */[ ] ]; } - return /* Eq */{ - 0: 3, - 1: $js, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3, + $js + ]); } ], /* :: */[ /* tuple */[ "rec_sum", function () { - return /* Eq */{ - 0: 55, - 1: sum(0, 10), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 55, + sum(0, 10) + ]); } ], /* :: */[ /* tuple */[ "fake_rec", function () { - return /* Eq */{ - 0: /* tuple */[ - /* :: */[ - 1, - /* :: */[ - 2, - /* [] */0 - ] - ], - /* :: */[ - 2, + return /* Eq */Block.__(0, [ + /* tuple */[ /* :: */[ - 3, - /* [] */0 - ] - ], - /* :: */[ - 1, + 1, + /* :: */[ + 2, + /* [] */0 + ] + ], /* :: */[ 2, /* :: */[ 3, /* [] */0 ] - ] - ], - /* :: */[ - 1, + ], /* :: */[ - 55, + 1, /* :: */[ 2, /* :: */[ @@ -387,28 +366,38 @@ var suites_001 = /* :: */[ /* [] */0 ] ] - ] - ], - /* :: */[ - 2, + ], /* :: */[ - 3, - /* [] */0 - ] + 1, + /* :: */[ + 55, + /* :: */[ + 2, + /* :: */[ + 3, + /* [] */0 + ] + ] + ] + ], + /* :: */[ + 2, + /* :: */[ + 3, + /* [] */0 + ] + ], + 3 ], - 3 - ], - 1: /* tuple */[ - fake_v, - fake_y, - fake_z, - fake_z2, - fake_y2, - v$1 - ], - length: 2, - tag: 0 - }; + /* tuple */[ + fake_v, + fake_y, + fake_z, + fake_z2, + fake_y2, + v$1 + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/record_with_test.js b/jscomp/test/record_with_test.js index 47e7dfed55..f5723c429a 100644 --- a/jscomp/test/record_with_test.js +++ b/jscomp/test/record_with_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var v = /* record */[ @@ -27,12 +28,10 @@ function f(g, h) { var suites_000 = /* tuple */[ "eq_with", function () { - return /* Eq */{ - 0: v, - 1: newrecord, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + v, + newrecord + ]); } ]; diff --git a/jscomp/test/scanf_io.js b/jscomp/test/scanf_io.js index 9006f41a2d..4428373e48 100644 --- a/jscomp/test/scanf_io.js +++ b/jscomp/test/scanf_io.js @@ -6,6 +6,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Bytes = require("../stdlib/bytes"); var Caml_obj = require("../runtime/caml_obj"); var Pervasives = require("../stdlib/pervasives"); +var Block = require("../runtime/block"); var Digest = require("../stdlib/digest"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); @@ -28,22 +29,18 @@ var tscanf_data_file_lines = /* :: */[ function create_tscanf_data(ob, lines) { var add_line = function (param) { Buffer.add_string(ob, Curry._1(Printf.sprintf(/* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), param[0])); Buffer.add_string(ob, " -> "); Buffer.add_string(ob, Curry._1(Printf.sprintf(/* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), param[1])); return Buffer.add_string(ob, ";\n"); @@ -66,32 +63,22 @@ function get_lines(fname) { try { while(!Curry._1(Scanf.Scanning[/* end_of_input */9], ib)) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: " -> ", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "; ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + " -> ", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "; ", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), " %S -> %S; " ]), function (x, y) { l[0] = /* :: */[ @@ -109,27 +96,19 @@ function get_lines(fname) { catch (exn){ if (exn[0] === Scanf.Scan_failure) { var s = Curry._2(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "in file ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ", ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "in file ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ", ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), "in file %s, %s" ]), fname, exn[1]); throw [ @@ -139,22 +118,16 @@ function get_lines(fname) { } else if (exn === Caml_builtin_exceptions.end_of_file) { var s$1 = Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "in file ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: ", unexpected end of file", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "in file ", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + ", unexpected end of file", + /* End_of_format */0 + ]) + ]) + ]), "in file %s, unexpected end of file" ]), fname); throw [ @@ -171,18 +144,14 @@ function get_lines(fname) { function add_digest_ib(ob, ib) { var scan_line = function (ib, f) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xdb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xdb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%[^\n\r]\n" ]), f); }; diff --git a/jscomp/test/scanf_reference_error_regression_test.js b/jscomp/test/scanf_reference_error_regression_test.js index 872c2f57bf..089080161d 100644 --- a/jscomp/test/scanf_reference_error_regression_test.js +++ b/jscomp/test/scanf_reference_error_regression_test.js @@ -3,6 +3,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Mt_global = require("./mt_global"); var Curry = require("../runtime/curry"); var Scanf = require("../stdlib/scanf"); @@ -19,13 +20,11 @@ function eq(f, param) { function scan_rest(ib, accu) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[]]" ]), function (param) { if (param === "]") { @@ -35,24 +34,18 @@ function scan_rest(ib, accu) { var ib$1 = ib; var accu$1 = accu; return Curry._1(Scanf.bscanf(ib$1, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %i " ]), function (i) { var ib$2 = ib$1; @@ -61,13 +54,11 @@ function scan_rest(ib, accu) { accu$1 ]; return Curry._1(Scanf.bscanf(ib$2, /* Format */[ - /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%1[];]" ]), function (param) { switch (param) { @@ -77,12 +68,10 @@ function scan_rest(ib, accu) { return accu$2; default: var s = Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "scan_int_list", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "scan_int_list", + /* End_of_format */0 + ]), "scan_int_list" ]); throw [ @@ -98,12 +87,10 @@ function scan_rest(ib, accu) { function scan_int_list(ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " [ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " [ ", + /* End_of_format */0 + ]), " [ " ]), /* () */0); return List.rev(scan_rest(ib, /* [] */0)); diff --git a/jscomp/test/scanf_test.js b/jscomp/test/scanf_test.js index 1d5e96dd47..b3181e28bc 100644 --- a/jscomp/test/scanf_test.js +++ b/jscomp/test/scanf_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Mt_global = require("./mt_global"); var Curry = require("../runtime/curry"); var Scanf = require("../stdlib/scanf"); @@ -16,26 +17,20 @@ function eq(f, param) { eq('File "scanf_test.ml", line 6, characters 5-12', /* tuple */[ Curry._1(Scanf.sscanf("32 31", /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]), "%d %d" ]), function (x, y) { return x + y | 0; diff --git a/jscomp/test/simple_lexer_test.js b/jscomp/test/simple_lexer_test.js index b5f9721051..4c18237175 100644 --- a/jscomp/test/simple_lexer_test.js +++ b/jscomp/test/simple_lexer_test.js @@ -4,6 +4,7 @@ var Bytes = require("../stdlib/bytes"); var Mt = require("./mt"); var Lexing = require("../stdlib/lexing"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Caml_string = require("../runtime/caml_string"); @@ -53,12 +54,10 @@ function __ocaml_lex_translate_rec(lexbuf, ___ocaml_lex_state) { var suites_000 = /* tuple */[ "translate", function () { - return /* Eq */{ - 0: __ocaml_lex_translate_rec(Lexing.from_string("-- current_directory --"), 0), - 1: "-- . --", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + __ocaml_lex_translate_rec(Lexing.from_string("-- current_directory --"), 0), + "-- . --" + ]); } ]; diff --git a/jscomp/test/sprintf_reg_test.js b/jscomp/test/sprintf_reg_test.js index 90799886b0..35746347df 100644 --- a/jscomp/test/sprintf_reg_test.js +++ b/jscomp/test/sprintf_reg_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Mt_global = require("./mt_global"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); @@ -15,35 +16,23 @@ function eq(f, param) { } var s = Curry._1(Printf.sprintf(/* Format */[ - /* Format_arg */{ - 0: /* None */0, - 1: /* String_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 1 - }, - 2: /* Char_literal */{ - 0: /* "." */46, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 13 - }, + /* Format_arg */Block.__(13, [ + /* None */0, + /* String_ty */Block.__(1, [/* End_of_fmtty */0]), + /* Char_literal */Block.__(12, [ + /* "." */46, + /* End_of_format */0 + ]) + ]), "%{%s%}." ]), /* Format */[ - /* String_literal */{ - 0: "32", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "32", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "32%s" ]); @@ -53,42 +42,28 @@ eq('File "sprintf_reg_test.ml", line 8, characters 5-12', /* tuple */[ ]); var s$1 = Curry._2(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Format_arg */{ - 0: /* None */0, - 1: /* String_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 1 - }, - 2: /* End_of_format */0, - length: 3, - tag: 13 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Format_arg */Block.__(13, [ + /* None */0, + /* String_ty */Block.__(1, [/* End_of_fmtty */0]), + /* End_of_format */0 + ]) + ]) + ]), "%i %{%s%}" ]), 1, /* Format */[ - /* String_literal */{ - 0: "spells one ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "spells one ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "spells one %s" ]); diff --git a/jscomp/test/stack_test.js b/jscomp/test/stack_test.js index ade69829ad..6921fabb5b 100644 --- a/jscomp/test/stack_test.js +++ b/jscomp/test/stack_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Stack = require("../stdlib/stack"); var List = require("../stdlib/list"); @@ -27,21 +28,19 @@ function v() { var suites_000 = /* tuple */[ "push_test", function () { - return /* Eq */{ - 0: /* :: */[ - 1, + return /* Eq */Block.__(0, [ /* :: */[ - 4, + 1, /* :: */[ - 3, - /* [] */0 + 4, + /* :: */[ + 3, + /* [] */0 + ] ] - ] - ], - 1: v(/* () */0), - length: 2, - tag: 0 - }; + ], + v(/* () */0) + ]); } ]; diff --git a/jscomp/test/string_get_set_test.js b/jscomp/test/string_get_set_test.js index 2d7953abe2..7c3fa3fc7f 100644 --- a/jscomp/test/string_get_set_test.js +++ b/jscomp/test/string_get_set_test.js @@ -3,96 +3,83 @@ var Caml_int64 = require("../runtime/caml_int64"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Caml_string = require("../runtime/caml_string"); Mt.from_pair_suites("string_get_set_test.ml", /* :: */[ /* tuple */[ 'File "string_get_set_test.ml", line 8, characters 4-11', function () { - return /* Eq */{ - 0: Caml_string.caml_string_get16("2\0", 0), - 1: 50, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_string.caml_string_get16("2\0", 0), + 50 + ]); } ], /* :: */[ /* tuple */[ 'File "string_get_set_test.ml", line 9, characters 4-11', function () { - return /* Eq */{ - 0: Caml_string.caml_string_get16("20", 0), - 1: 12338, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_string.caml_string_get16("20", 0), + 12338 + ]); } ], /* :: */[ /* tuple */[ 'File "string_get_set_test.ml", line 10, characters 4-11', function () { - return /* Eq */{ - 0: Caml_string.caml_string_get32("0123", 0), - 1: 858927408, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_string.caml_string_get32("0123", 0), + 858927408 + ]); } ], /* :: */[ /* tuple */[ 'File "string_get_set_test.ml", line 11, characters 4-11', function () { - return /* Eq */{ - 0: Caml_string.caml_string_get32("0123", 0), - 1: 858927408, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_string.caml_string_get32("0123", 0), + 858927408 + ]); } ], /* :: */[ /* tuple */[ 'File "string_get_set_test.ml", line 12, characters 4-11', function () { - return /* Eq */{ - 0: Caml_string.caml_string_get32("3210", 0), - 1: 808530483, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_string.caml_string_get32("3210", 0), + 808530483 + ]); } ], /* :: */[ /* tuple */[ 'File "string_get_set_test.ml", line 13, characters 4-11', function () { - return /* Eq */{ - 0: Caml_int64.get64("12345678", 0), - 1: /* int64 */[ - 943142453, - 875770417 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.get64("12345678", 0), + /* int64 */[ + 943142453, + 875770417 + ] + ]); } ], /* :: */[ /* tuple */[ 'File "string_get_set_test.ml", line 14, characters 4-11', function () { - return /* Eq */{ - 0: Caml_int64.get64("87654321", 0), - 1: /* int64 */[ - 825373492, - 892745528 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.get64("87654321", 0), + /* int64 */[ + 825373492, + 892745528 + ] + ]); } ], /* [] */0 diff --git a/jscomp/test/string_literal_print_test.js b/jscomp/test/string_literal_print_test.js index d3c7f0018f..fa13abdc48 100644 --- a/jscomp/test/string_literal_print_test.js +++ b/jscomp/test/string_literal_print_test.js @@ -1,7 +1,8 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); var zero_to_255 = "\0\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; @@ -11,12 +12,10 @@ Mt.from_pair_suites("string_literal_print_test.ml", /* :: */[ /* tuple */[ "test_string_print", function () { - return /* Eq */{ - 0: js_zero_to_255, - 1: zero_to_255, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + js_zero_to_255, + zero_to_255 + ]); } ], /* [] */0 diff --git a/jscomp/test/string_runtime_test.js b/jscomp/test/string_runtime_test.js index 4f2d8c754f..11fa1deaaf 100644 --- a/jscomp/test/string_runtime_test.js +++ b/jscomp/test/string_runtime_test.js @@ -4,22 +4,21 @@ var Caml_string = require("../runtime/caml_string"); var Bytes = require("../stdlib/bytes"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var List = require("../stdlib/list"); var Caml_string = require("../runtime/caml_string"); var suites_000 = /* tuple */[ "string_of_char_array", function () { - return /* Eq */{ - 0: Caml_string.caml_string_of_char_array(/* int array */[ - /* "a" */97, - /* "b" */98, - /* "c" */99 - ]), - 1: "abc", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_string.caml_string_of_char_array(/* int array */[ + /* "a" */97, + /* "b" */98, + /* "c" */99 + ]), + "abc" + ]); } ]; @@ -27,12 +26,10 @@ var suites_001 = /* :: */[ /* tuple */[ "caml_is_printable", function () { - return /* Eq */{ - 0: Caml_string.caml_is_printable(/* "a" */97), - 1: /* true */1, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_string.caml_is_printable(/* "a" */97), + /* true */1 + ]); } ], /* :: */[ @@ -71,12 +68,10 @@ var suites_001 = /* :: */[ ] ] ])); - return /* Eq */{ - 0: match[0], - 1: match[1], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + match[0], + match[1] + ]); } ], /* [] */0 diff --git a/jscomp/test/string_test.js b/jscomp/test/string_test.js index db145fa9bc..570e66e441 100644 --- a/jscomp/test/string_test.js +++ b/jscomp/test/string_test.js @@ -4,6 +4,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Bytes = require("../stdlib/bytes"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Ext_string = require("./ext_string"); var $$String = require("../stdlib/string"); var List = require("../stdlib/list"); @@ -156,219 +157,187 @@ Mt.from_pair_suites("string_test.ml", /* :: */[ /* tuple */[ "mutliple switch", function () { - return /* Eq */{ - 0: 9, - 1: ff("4"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 9, + ff("4") + ]); } ], /* :: */[ /* tuple */[ "int switch", function () { - return /* Eq */{ - 0: 9, - 1: gg(4), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 9, + gg(4) + ]); } ], /* :: */[ /* tuple */[ "escape_normal", function () { - return /* Eq */{ - 0: "haha", - 1: $$String.escaped("haha"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "haha", + $$String.escaped("haha") + ]); } ], /* :: */[ /* tuple */[ "escape_bytes", function () { - return /* Eq */{ - 0: Bytes.of_string("haha"), - 1: Bytes.escaped(Bytes.of_string("haha")), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Bytes.of_string("haha"), + Bytes.escaped(Bytes.of_string("haha")) + ]); } ], /* :: */[ /* tuple */[ "escape_quote", function () { - return /* Eq */{ - 0: '\\"\\"', - 1: $$String.escaped('""'), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + '\\"\\"', + $$String.escaped('""') + ]); } ], /* :: */[ /* tuple */[ "rev_split_by_char", function () { - return /* Eq */{ - 0: /* :: */[ - "", + return /* Eq */Block.__(0, [ /* :: */[ - "bbbb", + "", /* :: */[ "bbbb", - /* [] */0 + /* :: */[ + "bbbb", + /* [] */0 + ] ] - ] - ], - 1: rev_split_by_char(/* "a" */97, "bbbbabbbba"), - length: 2, - tag: 0 - }; + ], + rev_split_by_char(/* "a" */97, "bbbbabbbba") + ]); } ], /* :: */[ /* tuple */[ "xsplit", function () { - return /* Eq */{ - 0: /* :: */[ - "a", + return /* Eq */Block.__(0, [ /* :: */[ - "b", + "a", /* :: */[ - "c", - /* [] */0 + "b", + /* :: */[ + "c", + /* [] */0 + ] ] - ] - ], - 1: xsplit(/* "." */46, "a.b.c"), - length: 2, - tag: 0 - }; + ], + xsplit(/* "." */46, "a.b.c") + ]); } ], /* :: */[ /* tuple */[ "split_empty", function () { - return /* Eq */{ - 0: /* [] */0, - 1: Ext_string.split(/* None */0, "", /* "_" */95), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* [] */0, + Ext_string.split(/* None */0, "", /* "_" */95) + ]); } ], /* :: */[ /* tuple */[ "rfind", function () { - return /* Eq */{ - 0: 7, - 1: Ext_string.rfind("__", "__index__js"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 7, + Ext_string.rfind("__", "__index__js") + ]); } ], /* :: */[ /* tuple */[ "rfind_2", function () { - return /* Eq */{ - 0: 0, - 1: Ext_string.rfind("__", "__index_js"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 0, + Ext_string.rfind("__", "__index_js") + ]); } ], /* :: */[ /* tuple */[ "rfind_3", function () { - return /* Eq */{ - 0: -1, - 1: Ext_string.rfind("__", "_index_js"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -1, + Ext_string.rfind("__", "_index_js") + ]); } ], /* :: */[ /* tuple */[ "find", function () { - return /* Eq */{ - 0: 0, - 1: Ext_string.find(/* None */0, "__", "__index__js"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 0, + Ext_string.find(/* None */0, "__", "__index__js") + ]); } ], /* :: */[ /* tuple */[ "find_2", function () { - return /* Eq */{ - 0: 6, - 1: Ext_string.find(/* None */0, "__", "_index__js"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 6, + Ext_string.find(/* None */0, "__", "_index__js") + ]); } ], /* :: */[ /* tuple */[ "find_3", function () { - return /* Eq */{ - 0: -1, - 1: Ext_string.find(/* None */0, "__", "_index_js"), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + -1, + Ext_string.find(/* None */0, "__", "_index_js") + ]); } ], /* :: */[ /* tuple */[ "of_char", function () { - return /* Eq */{ - 0: "0", - 1: Caml_string.bytes_to_string(Bytes.make(1, /* "0" */48)), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "0", + Caml_string.bytes_to_string(Bytes.make(1, /* "0" */48)) + ]); } ], /* :: */[ /* tuple */[ "of_chars", function () { - return /* Eq */{ - 0: string_of_chars(/* :: */[ - /* "0" */48, - /* :: */[ - /* "1" */49, + return /* Eq */Block.__(0, [ + string_of_chars(/* :: */[ + /* "0" */48, /* :: */[ - /* "2" */50, - /* [] */0 + /* "1" */49, + /* :: */[ + /* "2" */50, + /* [] */0 + ] ] - ] - ]), - 1: "012", - length: 2, - tag: 0 - }; + ]), + "012" + ]); } ], /* [] */0 diff --git a/jscomp/test/swap_test.js b/jscomp/test/swap_test.js index db7f47f280..1db2deaece 100644 --- a/jscomp/test/swap_test.js +++ b/jscomp/test/swap_test.js @@ -6,6 +6,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); var Caml_int32 = require("../runtime/caml_int32"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var $$Array = require("../stdlib/array"); @@ -858,28 +859,22 @@ var suites_16 = List.map(function (param) { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "swap16 ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "swap16 ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "swap16 %d" ]), a), function () { - return /* Eq */{ - 0: Caml_int32.caml_bswap16(a), - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int32.caml_bswap16(a), + b + ]); } ]; }, $$Array.to_list(tests_16)); @@ -889,28 +884,22 @@ var suites_32 = List.map(function (param) { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "swap32 ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "swap32 ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "swap32 %d" ]), a), function () { - return /* Eq */{ - 0: Caml_int32.caml_int32_bswap(a), - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int32.caml_int32_bswap(a), + b + ]); } ]; }, $$Array.to_list(tests_32)); @@ -920,41 +909,33 @@ var suites_64 = List.map(function (param) { var a = param[0]; return /* tuple */[ Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "swap64 ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "swap64 ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), "swap64 %d" ]), a[1] | 0), function () { - return /* Eq */{ - 0: Caml_int64.swap(a), - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Caml_int64.swap(a), + b + ]); } ]; }, $$Array.to_list(tests_64)); var d16_000 = /* Format */[ - /* Int */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%x" ]; @@ -978,14 +959,12 @@ var d16 = /* tuple */[ ]; var d32_000 = /* Format */[ - /* Int32 */{ - 0: /* Int_x */6, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 5 - }, + /* Int32 */Block.__(5, [ + /* Int_x */6, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%lx" ]; @@ -1016,33 +995,25 @@ function f(s, param) { var a = param[0]; return /* tuple */[ Curry._2(Format.asprintf(/* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]), "%s %i" ]), s, i), function () { - return /* Eq */{ - 0: Curry._1(Format.asprintf(x), Curry._1(swap, a)), - 1: b, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Curry._1(Format.asprintf(x), Curry._1(swap, a)), + b + ]); } ]; }, param[2])); diff --git a/jscomp/test/tailcall_inline_test.js b/jscomp/test/tailcall_inline_test.js index aa573e03ae..1f6d022209 100644 --- a/jscomp/test/tailcall_inline_test.js +++ b/jscomp/test/tailcall_inline_test.js @@ -2,6 +2,7 @@ 'use strict'; var Mt = require("./mt"); +var Block = require("../runtime/block"); var Caml_array = require("../runtime/caml_array"); var $$Array = require("../stdlib/array"); @@ -31,23 +32,21 @@ function f() { var suites_000 = /* tuple */[ "acc", function () { - return /* Eq */{ - 0: f(/* () */0), - 1: /* array */[ - 0, - 1, - 3, - 6, - 10, - 15, - 21, - 28, - 36, - 45 - ], - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + f(/* () */0), + /* array */[ + 0, + 1, + 3, + 6, + 10, + 15, + 21, + 28, + 36, + 45 + ] + ]); } ]; @@ -55,25 +54,23 @@ var suites_001 = /* :: */[ /* tuple */[ "array_to_list", function () { - return /* Eq */{ - 0: /* :: */[ - 1, + return /* Eq */Block.__(0, [ /* :: */[ - 2, + 1, /* :: */[ - 3, - /* [] */0 - ] - ] - ], - 1: $$Array.to_list(/* int array */[ - 1, 2, - 3 - ]), - length: 2, - tag: 0 - }; + /* :: */[ + 3, + /* [] */0 + ] + ] + ], + $$Array.to_list(/* int array */[ + 1, + 2, + 3 + ]) + ]); } ], /* [] */0 diff --git a/jscomp/test/test_format.js b/jscomp/test/test_format.js index 25803e782c..e8582c9710 100644 --- a/jscomp/test/test_format.js +++ b/jscomp/test/test_format.js @@ -1,18 +1,17 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Format = require("../stdlib/format"); Curry._1(Format.fprintf(Format.std_formatter, /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%d" ]), 3); diff --git a/jscomp/test/test_formatter.js b/jscomp/test/test_formatter.js index 208b5e5e66..9f4dfa93e8 100644 --- a/jscomp/test/test_formatter.js +++ b/jscomp/test/test_formatter.js @@ -1,22 +1,19 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); function f() { return /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%d%s" ]; } diff --git a/jscomp/test/test_seq.js b/jscomp/test/test_seq.js index b22f03e70d..b12ef7f844 100644 --- a/jscomp/test/test_seq.js +++ b/jscomp/test/test_seq.js @@ -5,6 +5,7 @@ var Caml_obj = require("../runtime/caml_obj"); var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_exceptions = require("../runtime/caml_exceptions"); var Pervasives = require("../stdlib/pervasives"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Bad = Caml_exceptions.create("Test_seq.Bad"); @@ -36,11 +37,7 @@ function assoc3(x, _l) { function help_action() { throw [ Stop, - /* Unknown */{ - 0: "-help", - length: 1, - tag: 0 - } + /* Unknown */Block.__(0, ["-help"]) ]; } @@ -64,11 +61,7 @@ function add_help(speclist) { add1 = /* :: */[ /* tuple */[ "-help", - /* Unit */{ - 0: help_action, - length: 1, - tag: 0 - }, + /* Unit */Block.__(0, [help_action]), " Display this list of options" ], /* [] */0 @@ -88,11 +81,7 @@ function add_help(speclist) { add2 = /* :: */[ /* tuple */[ "--help", - /* Unit */{ - 0: help_action, - length: 1, - tag: 0 - }, + /* Unit */Block.__(0, [help_action]), " Display this list of options" ], /* [] */0 diff --git a/jscomp/test/test_sprintf.js b/jscomp/test/test_sprintf.js index 043c43e070..a69410a2a3 100644 --- a/jscomp/test/test_sprintf.js +++ b/jscomp/test/test_sprintf.js @@ -1,23 +1,20 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); console.error(Curry._2(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%d%s" ]), 32, "ss")); diff --git a/jscomp/test/test_switch.js b/jscomp/test/test_switch.js index b7bc33b4a3..20760325bb 100644 --- a/jscomp/test/test_switch.js +++ b/jscomp/test/test_switch.js @@ -1,6 +1,7 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); function f(param) { @@ -32,11 +33,7 @@ function bind(x, f) { return x; } else { - return /* Left */{ - 0: Curry._1(f, x[0]), - length: 1, - tag: 0 - }; + return /* Left */Block.__(0, [Curry._1(f, x[0])]); } } diff --git a/jscomp/test/testing.js b/jscomp/test/testing.js index 91aca16fb4..382accce28 100644 --- a/jscomp/test/testing.js +++ b/jscomp/test/testing.js @@ -5,6 +5,7 @@ var Caml_io = require("../runtime/caml_io"); var Caml_obj = require("../runtime/caml_obj"); var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Pervasives = require("../stdlib/pervasives"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var Scanf = require("../stdlib/scanf"); @@ -36,24 +37,18 @@ function print_test_number() { function print_failure_test_fail() { all_tests_ok[0] = /* false */0; return Pervasives.print_string(Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "\n********* Failure Test number ", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " incorrectly failed ***********\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "\n********* Failure Test number ", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " incorrectly failed ***********\n", + /* End_of_format */0 + ]) + ]) + ]), "\n********* Failure Test number %i incorrectly failed ***********\n" ]), test_num[0])); } @@ -61,24 +56,18 @@ function print_failure_test_fail() { function print_failure_test_succeed() { all_tests_ok[0] = /* false */0; return Pervasives.print_string(Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "\n********* Failure Test number ", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " failed to fail ***********\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "\n********* Failure Test number ", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " failed to fail ***********\n", + /* End_of_format */0 + ]) + ]) + ]), "\n********* Failure Test number %i failed to fail ***********\n" ]), test_num[0])); } @@ -92,24 +81,18 @@ function test(b) { else { all_tests_ok[0] = /* false */0; return Pervasives.print_string(Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "\n********* Test number ", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " failed ***********\n", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "\n********* Test number ", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " failed ***********\n", + /* End_of_format */0 + ]) + ]) + ]), "\n********* Test number %i failed ***********\n" ]), test_num[0])); } diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index d50e01fb25..0d68d6ca8d 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -5,6 +5,7 @@ var Caml_builtin_exceptions = require("../runtime/caml_builtin_exceptions"); var Caml_obj = require("../runtime/caml_obj"); var Pervasives = require("../stdlib/pervasives"); var Caml_format = require("../runtime/caml_format"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Printf = require("../stdlib/printf"); var $$String = require("../stdlib/string"); @@ -88,24 +89,18 @@ function string_of_rank(param) { } else { return Curry._1(Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "Ranked(", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ")" */41, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Ranked(", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ")" */41, + /* End_of_format */0 + ]) + ]) + ]), "Ranked(%i)" ]), param[0]); } diff --git a/jscomp/test/to_string_test.js b/jscomp/test/to_string_test.js index c06a460561..d6bd76059b 100644 --- a/jscomp/test/to_string_test.js +++ b/jscomp/test/to_string_test.js @@ -3,6 +3,7 @@ var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var ff = Pervasives.string_of_float @@ -14,24 +15,20 @@ Mt.from_pair_suites("to_string_test.ml", /* :: */[ /* tuple */[ 'File "to_string_test.ml", line 7, characters 2-9', function () { - return /* Eq */{ - 0: Pervasives.string_of_float(Pervasives.infinity), - 1: "inf", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Pervasives.string_of_float(Pervasives.infinity), + "inf" + ]); } ], /* :: */[ /* tuple */[ 'File "to_string_test.ml", line 8, characters 1-8', function () { - return /* Eq */{ - 0: Pervasives.string_of_float(Pervasives.neg_infinity), - 1: "-inf", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + Pervasives.string_of_float(Pervasives.neg_infinity), + "-inf" + ]); } ], /* [] */0 diff --git a/jscomp/test/tscanf_test.js b/jscomp/test/tscanf_test.js index d167d0cc1b..31d7d2ab4e 100644 --- a/jscomp/test/tscanf_test.js +++ b/jscomp/test/tscanf_test.js @@ -8,6 +8,7 @@ var Bytes = require("../stdlib/bytes"); var Pervasives = require("../stdlib/pervasives"); var Caml_format = require("../runtime/caml_format"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Testing = require("./testing"); var Mt_global = require("./mt_global"); var Curry = require("../runtime/curry"); @@ -42,51 +43,39 @@ function test0() { /* End_of_format */0, "" ]), id, 1) + Curry._2(Scanf.sscanf("", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]), " " ]), id, 2) | 0) + Curry._2(Scanf.sscanf(" ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]), " " ]), id, 3) | 0) + Curry._2(Scanf.sscanf("\t", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]), " " ]), id, 4) | 0) + Curry._2(Scanf.sscanf("\n", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]), " " ]), id, 5) | 0) + Curry._1(Scanf.sscanf("\n\t 6", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), " %d" ]), id) | 0; } @@ -95,79 +84,59 @@ test('File "tscanf_test.ml", line 42, characters 5-12', +(test0(/* () */0) === 2 function test1() { return (((Curry._1(Scanf.sscanf("1", /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%d" ]), id) + Curry._1(Scanf.sscanf(" 2", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), " %d" ]), id) | 0) + Curry._1(Scanf.sscanf(" -2", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), " %d" ]), id) | 0) + Curry._1(Scanf.sscanf(" +2", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), " %d" ]), id) | 0) + Curry._1(Scanf.sscanf(" 2a ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "a" */97, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "a" */97, + /* End_of_format */0 + ]) + ]) + ]), " %da" ]), id) | 0; } @@ -176,54 +145,40 @@ test('File "tscanf_test.ml", line 54, characters 5-12', +(test1(/* () */0) === 5 function test2() { return (Curry._1(Scanf.sscanf("123", /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 2, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 2 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%2i" ]), id) + Curry._1(Scanf.sscanf("245", /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%d" ]), id) | 0) + Curry._1(Scanf.sscanf(" 2a ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 1, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "a" */97, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 1 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "a" */97, + /* End_of_format */0 + ]) + ]) + ]), " %1da" ]), id) | 0; } @@ -232,74 +187,54 @@ test('File "tscanf_test.ml", line 63, characters 5-12', +(test2(/* () */0) === 2 function test3() { return ((Curry._1(Scanf.sscanf("0xff", /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 3 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%3i" ]), id) + Curry._1(Scanf.sscanf("0XEF", /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 3, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 3 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%3i" ]), id) | 0) + Curry._1(Scanf.sscanf("x=-245", /* Format */[ - /* String_literal */{ - 0: " x = ", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " x = ", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), " x = %d" ]), id) | 0) + Curry._1(Scanf.sscanf(" 2a ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 1, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* "a" */97, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 1 + ]), + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* "a" */97, + /* End_of_format */0 + ]) + ]) + ]), " %1da" ]), id) | 0; } @@ -308,232 +243,184 @@ test('File "tscanf_test.ml", line 73, characters 5-12', +(test3(/* () */0) === - function test4() { if (Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "1"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === 1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "-1"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === -1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "+1"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === 1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "1."), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === 1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], ".1"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === 0.1); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "-.1"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === -0.1); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "+.1"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === 0.1); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "+1."), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === 1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "-1."), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]), function (b0) { return +(b0 === -1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "0 1. 1.3"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "%f %f %f" ]), function (b0, b1, b2) { return b0 === 0.0 && b1 === 1.0 ? +(b2 === 1.3) : /* false */0; }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "0.113"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 4, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 4 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%4f" ]), function (b0) { return +(b0 === 0.11); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "0.113"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 5, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 5 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%5f" ]), function (b0) { return +(b0 === 0.113); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "000.113"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 15, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 15 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%15f" ]), function (b0) { return +(b0 === 0.113); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "+000.113"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 15, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 15 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%15f" ]), function (b0) { return +(b0 === 0.113); })) { return Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "-000.113"), /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* Lit_padding */{ - 0: /* Right */1, - 1: 15, - length: 2, - tag: 0 - }, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* Lit_padding */Block.__(0, [ + /* Right */1, + 15 + ]), + /* No_precision */0, + /* End_of_format */0 + ]), "%15f" ]), function (b0) { return +(b0 === -0.113); @@ -548,135 +435,103 @@ test('File "tscanf_test.ml", line 110, characters 5-12', test4(/* () */0)); function test5() { if (Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "1e1"), /* Format */[ - /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%e" ]), function (b) { return +(b === 10.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "1e+1"), /* Format */[ - /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%e" ]), function (b) { return +(b === 10.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "10e-1"), /* Format */[ - /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%e" ]), function (b) { return +(b === 1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "10.e-1"), /* Format */[ - /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%e" ]), function (b) { return +(b === 1.0); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "1e1 1.e+1 1.3e-1"), /* Format */[ - /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_e */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_e */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "%e %e %e" ]), function (b1, b2, b3) { return b1 === 10.0 && b2 === b1 ? +(b3 === 0.13) : /* false */0; })) { return Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "1 1.1 0e+1 1.3e-1"), /* Format */[ - /* Float */{ - 0: /* Float_g */9, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_g */9, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_g */9, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Float */{ - 0: /* Float_g */9, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_g */9, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_g */9, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_g */9, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Float */Block.__(8, [ + /* Float_g */9, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]), "%g %g %g %g" ]), function (b1, b2, b3, b4) { if (b1 === 1.0 && b2 === 1.1 && b3 === 0.0) { @@ -696,15 +551,7 @@ test('File "tscanf_test.ml", line 133, characters 5-12', test5(/* () */0)); function test6() { if (Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "truetrue"), /* Format */[ - /* Bool */{ - 0: /* Bool */{ - 0: /* End_of_format */0, - length: 1, - tag: 9 - }, - length: 1, - tag: 9 - }, + /* Bool */Block.__(9, [/* Bool */Block.__(9, [/* End_of_format */0])]), "%B%B" ]), function (b1, b2) { return Caml_obj.caml_equal(/* tuple */[ @@ -715,15 +562,7 @@ function test6() { /* true */1 ]); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "truefalse"), /* Format */[ - /* Bool */{ - 0: /* Bool */{ - 0: /* End_of_format */0, - length: 1, - tag: 9 - }, - length: 1, - tag: 9 - }, + /* Bool */Block.__(9, [/* Bool */Block.__(9, [/* End_of_format */0])]), "%B%B" ]), function (b1, b2) { return Caml_obj.caml_equal(/* tuple */[ @@ -734,15 +573,7 @@ function test6() { /* false */0 ]); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "falsetrue"), /* Format */[ - /* Bool */{ - 0: /* Bool */{ - 0: /* End_of_format */0, - length: 1, - tag: 9 - }, - length: 1, - tag: 9 - }, + /* Bool */Block.__(9, [/* Bool */Block.__(9, [/* End_of_format */0])]), "%B%B" ]), function (b1, b2) { return Caml_obj.caml_equal(/* tuple */[ @@ -753,15 +584,7 @@ function test6() { /* true */1 ]); }) && Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "falsefalse"), /* Format */[ - /* Bool */{ - 0: /* Bool */{ - 0: /* End_of_format */0, - length: 1, - tag: 9 - }, - length: 1, - tag: 9 - }, + /* Bool */Block.__(9, [/* Bool */Block.__(9, [/* End_of_format */0])]), "%B%B" ]), function (b1, b2) { return Caml_obj.caml_equal(/* tuple */[ @@ -773,20 +596,10 @@ function test6() { ]); })) { return Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "true false"), /* Format */[ - /* Bool */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Bool */{ - 0: /* End_of_format */0, - length: 1, - tag: 9 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 9 - }, + /* Bool */Block.__(9, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Bool */Block.__(9, [/* End_of_format */0]) + ])]), "%B %B" ]), function (b1, b2) { return Caml_obj.caml_equal(/* tuple */[ @@ -807,80 +620,34 @@ test('File "tscanf_test.ml", line 150, characters 5-12', test6(/* () */0)); function test7() { if (Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "'a' '\n' '\t' '\0' ' '"), /* Format */[ - /* Caml_char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 1 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 1 - }, + /* Caml_char */Block.__(1, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_char */Block.__(1, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_char */Block.__(1, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_char */Block.__(1, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_char */Block.__(1, [/* End_of_format */0]) + ])]) + ])]) + ])]) + ])]), "%C %C %C %C %C" ]), function (c1, c2, c3, c4, c5) { return c1 === /* "a" */97 && c2 === /* "\n" */10 && c3 === /* "\t" */9 && !c4 ? +(c5 === /* " " */32) : /* false */0; })) { return Curry._1(Scanf.bscanf(Curry._1(Scanf.Scanning[/* from_string */6], "a \n \t \0 b"), /* Format */[ - /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ])]) + ])]) + ])]), "%c %c %c " ]), function (c1, c2, c3) { if (c1 === /* "a" */97 && !c2) { @@ -900,20 +667,12 @@ test('File "tscanf_test.ml", line 168, characters 5-12', test7(/* () */0)); function verify_read(c) { var s = Curry._1(Printf.sprintf(/* Format */[ - /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, + /* Caml_char */Block.__(1, [/* End_of_format */0]), "%C" ]), c); var ib = Curry._1(Scanf.Scanning[/* from_string */6], s); if (Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, + /* Caml_char */Block.__(1, [/* End_of_format */0]), "%C" ]), id) === c) { return 0; @@ -945,12 +704,10 @@ test('File "tscanf_test.ml", line 183, characters 5-12', +(verify_scan_Chars(/* function unit(fmt, s) { var ib = Curry._1(Scanf.Scanning[/* from_string */6], Curry._1(Printf.sprintf(/* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), s)); return Curry._1(Scanf.bscanf(ib, fmt), id); @@ -963,12 +720,10 @@ function test_fmt(fmt, s) { var test9_string = "\xef\xbb\xbf"; var partial_arg = /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]; @@ -978,63 +733,51 @@ function test_S(param) { function test9() { if (test_S("poi") && test_S('a"b') && test_S("a\nb") && test_S("a\nb") && test_S("a\\\nb \\\nc\n\\\nb") && test_S("a\\\n\\\n\\\nb \\\nc\n\\\nb") && test_S("\xef") && test_S("\\xef") && Curry._1(Scanf.sscanf('"\\xef"', /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), function (s) { return s; }) === "\xef" && Curry._1(Scanf.sscanf('"\\xef\\xbb\\xbf"', /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), function (s) { return s; }) === test9_string && Curry._1(Scanf.sscanf('"\\xef\\xbb\\xbf"', /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), function (s) { return s; }) === "\xef\xbb\xbf" && Curry._1(Scanf.sscanf('"\xef\xbb\xbf"', /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), function (s) { return s; }) === test9_string && Curry._1(Scanf.sscanf('"\\\\xef\\\\xbb\\\\xbf"', /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), function (s) { return s; }) === "\\xef\\xbb\\xbf") { return +(Curry._1(Scanf.sscanf('" "', /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), function (s) { return s; @@ -1051,72 +794,48 @@ function test10() { var unit = function (s) { var ib = Curry._1(Scanf.Scanning[/* from_string */6], s); return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]), id); }; var res = Curry._1(Scanf.sscanf('Une chaine: "celle-ci" et "celle-la"!', /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]) + ]), "%s %s %S %s %S %s" ]), function (s1, s2, s3, s4, s5, s6) { return s1 + (s2 + (s3 + (s4 + (s5 + s6)))); @@ -1133,117 +852,75 @@ test('File "tscanf_test.ml", line 254, characters 5-12', test10(/* () */0)); function test11() { if (Curry._1(Scanf.sscanf("Pierre\tWeis\t70", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "%s %s %s" ]), function (prenom, nom, poids) { return prenom === "Pierre" && nom === "Weis" ? +(Caml_format.caml_int_of_string(poids) === 70) : /* false */0; }) && Curry._1(Scanf.sscanf("Jean-Luc\tde Leage\t68", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "%[^\t] %[^\t] %d" ]), function (prenom, nom, poids) { return prenom === "Jean-Luc" && nom === "de Leage" ? +(poids === 68) : /* false */0; })) { return Curry._1(Scanf.sscanf("Daniel\tde Rauglaudre\t66", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "\t" */9, - length: 1, - tag: 2 - }, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "\t" */9, - length: 1, - tag: 2 - }, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "\t" */9]), + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "\t" */9]), + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]) + ]), "%s@\t %s@\t %d" ]), function (prenom, nom, poids) { if (prenom === "Daniel" && nom === "de Rauglaudre") { @@ -1261,283 +938,203 @@ function test11() { function test110() { if (Curry._2(Scanf.sscanf("", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]), " " ]), function (x) { return x; }, "") === "" && Curry._1(Scanf.sscanf("", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf("", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%s%s" ]), function (x, y) { return x === "" ? +(y === "") : /* false */0; }) && Curry._1(Scanf.sscanf("", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]), "%s " ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf("", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), " %s" ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf("", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %s " ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf("", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* End_of_format */0 + ]), "%[^\n]" ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf("", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]), "%[^\n] " ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf(" ", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf(" ", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%s%s" ]), function (x, y) { return x === "" ? +(y === "") : /* false */0; }) && Curry._1(Scanf.sscanf(" ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %s " ]), function (x) { return +(x === ""); }) && Curry._1(Scanf.sscanf(" ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), " %s %s" ]), function (x, y) { return x === "" ? +(x === y) : /* false */0; }) && Curry._1(Scanf.sscanf(" ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Break */{ - 0: "@ ", - 1: 1, - 2: 0, - length: 3, - tag: 0 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Break */Block.__(0, [ + "@ ", + 1, + 0 + ]), + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), " %s@ %s" ]), function (x, y) { return x === "" ? +(x === y) : /* false */0; }) && Curry._1(Scanf.sscanf(" poi !", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Break */{ - 0: "@ ", - 1: 1, - 2: 0, - length: 3, - tag: 0 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Flush_newline */4, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Break */Block.__(0, [ + "@ ", + 1, + 0 + ]), + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Flush_newline */4, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), " %s@ %s@." ]), function (x, y) { return x === "poi" ? +(y === "!") : /* false */0; })) { return Curry._1(Scanf.sscanf(" poi !", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Break */{ - 0: "@ ", - 1: 1, - 2: 0, - length: 3, - tag: 0 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Flush_newline */4, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Break */Block.__(0, [ + "@ ", + 1, + 0 + ]), + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Flush_newline */4, + /* End_of_format */0 + ]) + ]) + ]) + ]), "%s@ %s@." ]), function (x, y) { if (x === "") { @@ -1555,18 +1152,14 @@ function test110() { function test111() { return Curry._1(Scanf.sscanf("", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* End_of_format */0 + ]) + ]), "%[^\n]@\n" ]), function (x) { return +(x === ""); @@ -1581,105 +1174,77 @@ function ib() { function f(ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " [", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " [", + /* End_of_format */0 + ]), " [" ]), /* () */0); return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ";" */59, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ";" */59, + /* End_of_format */0 + ]) + ]) + ]), " %i;" ]), function (i) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ";" */59, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ";" */59, + /* End_of_format */0 + ]) + ]) + ]), " %i;" ]), function (j) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ";" */59, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ";" */59, + /* End_of_format */0 + ]) + ]) + ]), " %i;" ]), function (k) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ";" */59, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ";" */59, + /* End_of_format */0 + ]) + ]) + ]), " %i;" ]), function (l) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ]), " ]" ]), /* () */0); return /* :: */[ @@ -1722,24 +1287,18 @@ test('File "tscanf_test.ml", line 311, characters 5-12', test12(/* () */0)); function scan_elems(ib, accu) { try { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* ";" */59, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* ";" */59, + /* End_of_format */0 + ]) + ]) + ]), " %i;" ]), function (i) { return scan_elems(ib, /* :: */[ @@ -1755,12 +1314,10 @@ function scan_elems(ib, accu) { function g(ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); return List.rev(scan_elems(ib, /* [] */0)); @@ -1786,22 +1343,18 @@ test('File "tscanf_test.ml", line 324, characters 5-12', test13(/* () */0)); function scan_int_list(ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); var accu = scan_elems(ib, /* [] */0); Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ]), " ]" ]), /* () */0); return List.rev(accu); @@ -1827,28 +1380,18 @@ test('File "tscanf_test.ml", line 337, characters 5-12', test14(/* () */0)); function scan_elems$1(ib, accu) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* End_of_format */0, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* End_of_format */0]) + ]) + ]) + ]), " %i %c" ]), function (i, c) { if (c !== 59) { @@ -1876,12 +1419,10 @@ function scan_elems$1(ib, accu) { function scan_int_list$1(ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); return scan_elems$1(ib, /* [] */0); @@ -1908,23 +1449,15 @@ test('File "tscanf_test.ml", line 357, characters 5-12', test15(/* () */0)); function scan_elems$2(ib, accu) { try { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ])]), "%c %i" ]), function (c, i) { var exit = 0; @@ -1979,12 +1512,10 @@ function scan_elems$2(ib, accu) { catch (exn){ if (exn[0] === Scanf.Scan_failure) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* "]" */93, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "]" */93, + /* End_of_format */0 + ]), "]" ]), /* () */0); return accu; @@ -2047,25 +1578,19 @@ test('File "tscanf_test.ml", line 383, characters 5-12', test16(/* () */0)); function scan_elems$3(ib, accu) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Scan_char_set */{ - 0: /* None */0, - 1: "\0&\0\0\x01\0\0\b\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0&\0\0\x01\0\0\b\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]) + ]) + ]), " %i%[]; \t\n\r]" ]), function (i, s) { switch (s) { @@ -2090,12 +1615,10 @@ function scan_elems$3(ib, accu) { function scan_int_list$2(ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " [", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " [", + /* End_of_format */0 + ]), " [" ]), /* () */0); return scan_elems$3(ib, /* [] */0); @@ -2150,21 +1673,13 @@ test('File "tscanf_test.ml", line 406, characters 5-12', test17(/* () */0)); function scan_elems$4(ib, accu) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ])]) + ]), " %c " ]), function (c) { if (c !== 91) { @@ -2181,13 +1696,11 @@ function scan_elems$4(ib, accu) { } else { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[]]" ]), function (param) { if (param === "]") { @@ -2195,24 +1708,18 @@ function scan_elems$4(ib, accu) { } else { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %i " ]), function (i) { return scan_rest(ib, /* :: */[ @@ -2228,21 +1735,13 @@ function scan_elems$4(ib, accu) { function scan_rest(ib, accu) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Char */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 1, - tag: 0 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Char */Block.__(0, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ])]) + ]), " %c " ]), function (c) { if (c !== 59) { @@ -2258,13 +1757,11 @@ function scan_rest(ib, accu) { } else { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[]]" ]), function (param) { if (param === "]") { @@ -2272,24 +1769,18 @@ function scan_rest(ib, accu) { } else { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %i " ]), function (i) { return scan_rest(ib, /* :: */[ @@ -2376,13 +1867,11 @@ test21(/* () */0); function scan_rest$1(ib, accu) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[]]" ]), function (param) { if (param === "]") { @@ -2392,24 +1881,18 @@ function scan_rest$1(ib, accu) { var ib$1 = ib; var accu$1 = accu; return Curry._1(Scanf.bscanf(ib$1, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %i " ]), function (i) { var ib$2 = ib$1; @@ -2418,13 +1901,11 @@ function scan_rest$1(ib, accu) { accu$1 ]; return Curry._1(Scanf.bscanf(ib$2, /* Format */[ - /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%1[];]" ]), function (param) { switch (param) { @@ -2434,12 +1915,10 @@ function scan_rest$1(ib, accu) { return accu$2; default: var s = Printf.sprintf(/* Format */[ - /* String_literal */{ - 0: "scan_int_list", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "scan_int_list", + /* End_of_format */0 + ]), "scan_int_list" ]); throw [ @@ -2455,12 +1934,10 @@ function scan_rest$1(ib, accu) { function scan_int_list$4(ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " [ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " [ ", + /* End_of_format */0 + ]), " [ " ]), /* () */0); return List.rev(scan_rest$1(ib, /* [] */0)); @@ -2531,22 +2008,18 @@ function scan_elems$5(ib, scan_elem, accu) { function scan_list(scan_elem, ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); var accu = scan_elems$5(ib, scan_elem, /* [] */0); Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ]), " ]" ]), /* () */0); return List.rev(accu); @@ -2554,30 +2027,22 @@ function scan_list(scan_elem, ib) { function scan_int_elem(ib) { return Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]) + ]) + ]) + ]), " %i %1[;]" ]); } @@ -2644,65 +2109,43 @@ function test27() { function scan_string_elem(ib) { return Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: ' "', - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "\"" */34, - length: 1, - tag: 2 - }, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + ' "', + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "\"" */34]), + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), ' "%s@" %1[;]' ]); } function scan_String_elem(ib) { return Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]) + ]) + ]) + ]), " %S %1[;]" ]); } @@ -2795,22 +2238,18 @@ function scan_elems$6(ib, scan_elem, accu) { function scan_list$1(scan_elem, ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); var accu = scan_elems$6(ib, scan_elem, /* [] */0); Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ]), " ]" ]), /* () */0); return List.rev(accu); @@ -2818,30 +2257,22 @@ function scan_list$1(scan_elem, ib) { function scan_int_elem$1(ib, f, ek) { return Curry._1(Scanf.kscanf(ib, ek, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]) + ]) + ]) + ]), " %i %1[;]" ]), f); } @@ -2886,28 +2317,20 @@ test('File "tscanf_test.ml", line 639, characters 5-12', test29(/* () */0)); function scan_string_elem$1(ib, f, ek) { return Curry._1(Scanf.kscanf(ib, ek, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]) + ]) + ]) + ]), " %S %1[;]" ]), f); } @@ -2963,18 +2386,14 @@ function scan_elems$7(ib, scan_elem, accu) { return Curry._1(Scanf.kscanf(ib, function (_, _$1) { return accu$1; }, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]) + ]), " %1[;]" ]), function (s) { if (s === "") { @@ -2991,41 +2410,33 @@ function scan_elems$7(ib, scan_elem, accu) { function scan_list$2(scan_elem, ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); var accu = scan_elems$7(ib, scan_elem, /* [] */0); Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ]), " ]" ]), /* () */0); return List.rev(accu); } var partial_arg$1 = /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]) + ]), " %i" ]; @@ -3038,17 +2449,13 @@ function scan_int_list$6(param) { } var partial_arg$3 = /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), " %S" ]; @@ -3145,23 +2552,17 @@ function scan_elems$8(ib, scan_elem_fmt, accu) { accu ]; return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %1[;] " ]), function (param) { if (param === "") { @@ -3176,36 +2577,30 @@ function scan_elems$8(ib, scan_elem_fmt, accu) { function scan_list$3(scan_elem_fmt, ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); var accu = scan_elems$8(ib, scan_elem_fmt, /* [] */0); Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ]), " ]" ]), /* () */0); return List.rev(accu); } var partial_arg$5 = /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ]; @@ -3214,12 +2609,10 @@ function scan_int_list$7(param) { } var partial_arg$6 = /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]; @@ -3307,11 +2700,7 @@ function scan_elems$9(scan_elem, accu, ib) { return Curry._2(Scanf.kscanf(ib, function (_, _$1) { return accu; }, /* Format */[ - /* Reader */{ - 0: /* End_of_format */0, - length: 1, - tag: 19 - }, + /* Reader */Block.__(19, [/* End_of_format */0]), "%r" ]), function (ib) { return Curry._2(scan_elem, ib, function (elem) { @@ -3320,23 +2709,17 @@ function scan_elems$9(scan_elem, accu, ib) { accu ]; return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %1[;] " ]), function (param) { if (param === "") { @@ -3354,22 +2737,18 @@ function scan_elems$9(scan_elem, accu, ib) { function scan_list$4(scan_elem, ib) { Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* End_of_format */0 + ]), "[ " ]), /* () */0); var accu = scan_elems$9(scan_elem, /* [] */0, ib); Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ]), " ]" ]), /* () */0); return List.rev(accu); @@ -3377,14 +2756,12 @@ function scan_list$4(scan_elem, ib) { function scan_float(ib) { return Scanf.bscanf(ib, /* Format */[ - /* Float */{ - 0: /* Float_f */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 8 - }, + /* Float */Block.__(8, [ + /* Float_f */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%f" ]); } @@ -3392,14 +2769,12 @@ function scan_float(ib) { function scan_int_list$8(param) { return scan_list$4(function (ib) { return Scanf.bscanf(ib, /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ]); }, param); @@ -3408,12 +2783,10 @@ function scan_int_list$8(param) { function scan_string_list$2(param) { return scan_list$4(function (ib) { return Scanf.bscanf(ib, /* Format */[ - /* Caml_string */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 3 - }, + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%S" ]); }, param); @@ -3422,11 +2795,7 @@ function scan_string_list$2(param) { function scan_bool_list(param) { return scan_list$4(function (ib) { return Scanf.bscanf(ib, /* Format */[ - /* Bool */{ - 0: /* End_of_format */0, - length: 1, - tag: 9 - }, + /* Bool */Block.__(9, [/* End_of_format */0]), "%B" ]); }, param); @@ -3435,11 +2804,7 @@ function scan_bool_list(param) { function scan_char_list(param) { return scan_list$4(function (ib) { return Scanf.bscanf(ib, /* Format */[ - /* Caml_char */{ - 0: /* End_of_format */0, - length: 1, - tag: 1 - }, + /* Caml_char */Block.__(1, [/* End_of_format */0]), "%C" ]); }, param); @@ -3501,39 +2866,31 @@ function scan_float_list_list$1(ib, k) { function test35() { if (Curry._1(Scanf.sscanf("", /* Format */[ - /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]), "%N" ]), function (x) { return x; }) === 0 && Curry._1(Scanf.sscanf("456", /* Format */[ - /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]), "%N" ]), function (x) { return x; }) === 0 && Caml_obj.caml_equal(Curry._1(Scanf.sscanf("456", /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]), "%d%N" ]), function (x, y) { return /* tuple */[ @@ -3545,22 +2902,16 @@ function test35() { 1 ])) { return Caml_obj.caml_equal(Curry._1(Scanf.sscanf(" ", /* Format */[ - /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Scan_get_counter */{ - 0: /* Token_counter */2, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 21 - }, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* String */Block.__(2, [ + /* No_padding */0, + /* Scan_get_counter */Block.__(21, [ + /* Token_counter */2, + /* End_of_format */0 + ]) + ]) + ]), "%N%s%N" ]), function (x, s, y) { return /* tuple */[ @@ -3585,27 +2936,17 @@ function read_elems(read_elem, accu, ib) { return Curry._2(Scanf.kscanf(ib, function (_, _$1) { return accu; }, /* Format */[ - /* Reader */{ - 0: /* Char_literal */{ - 0: /* " " */32, - 1: /* Scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 1, - tag: 19 - }, + /* Reader */Block.__(19, [/* Char_literal */Block.__(12, [ + /* " " */32, + /* Scan_char_set */Block.__(20, [ + /* Some */[1], + "\0\0\0\0\0\0\0\b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ])]), "%r %1[;] " ]), Curry._1(read_elem, function (elem) { return /* :: */[ @@ -3624,21 +2965,13 @@ function read_elems(read_elem, accu, ib) { function read_list(read_elem, ib) { return Curry._2(Scanf.bscanf(ib, /* Format */[ - /* String_literal */{ - 0: "[ ", - 1: /* Reader */{ - 0: /* String_literal */{ - 0: " ]", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 1, - tag: 19 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "[ ", + /* Reader */Block.__(19, [/* String_literal */Block.__(11, [ + " ]", + /* End_of_format */0 + ])]) + ]), "[ %r ]" ]), function (param) { return read_elems(read_elem, /* [] */0, param); @@ -3659,39 +2992,31 @@ function scan_List(fmt) { function test36() { if (Curry._1(Scanf.sscanf("", /* Format */[ - /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* End_of_format */0 + ]), "%n" ]), function (x) { return x; }) === 0 && Curry._1(Scanf.sscanf("456", /* Format */[ - /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* End_of_format */0 + ]), "%n" ]), function (x) { return x; }) === 0 && Caml_obj.caml_equal(Curry._1(Scanf.sscanf("456", /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* End_of_format */0 + ]) + ]), "%d%n" ]), function (x, y) { return /* tuple */[ @@ -3703,22 +3028,16 @@ function test36() { 3 ])) { return Caml_obj.caml_equal(Curry._1(Scanf.sscanf(" ", /* Format */[ - /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 21 - }, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* String */Block.__(2, [ + /* No_padding */0, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* End_of_format */0 + ]) + ]) + ]), "%n%s%n" ]), function (x, s, y) { return /* tuple */[ @@ -3765,104 +3084,50 @@ test('File "tscanf_test.ml", line 1005, characters 5-12', test37(/* () */0)); function test38() { if (Curry._1(Scanf.sscanf("a", /* Format */[ - /* Char_literal */{ - 0: /* "a" */97, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "a" */97, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]), "a%!" ]), /* true */1) && Curry._1(Scanf.sscanf("a", /* Format */[ - /* Char_literal */{ - 0: /* "a" */97, - 1: /* Flush */{ - 0: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "a" */97, + /* Flush */Block.__(10, [/* Flush */Block.__(10, [/* End_of_format */0])]) + ]), "a%!%!" ]), /* true */1) && Curry._1(Scanf.sscanf(" a", /* Format */[ - /* String_literal */{ - 0: " a", - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + " a", + /* Flush */Block.__(10, [/* End_of_format */0]) + ]), " a%!" ]), /* true */1) && Curry._1(Scanf.sscanf("a ", /* Format */[ - /* String_literal */{ - 0: "a ", - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "a ", + /* Flush */Block.__(10, [/* End_of_format */0]) + ]), "a %!" ]), /* true */1) && Curry._1(Scanf.sscanf("", /* Format */[ - /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, + /* Flush */Block.__(10, [/* End_of_format */0]), "%!" ]), /* true */1) && Curry._1(Scanf.sscanf(" ", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]), " %!" ]), /* true */1) && Curry._1(Scanf.sscanf("", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]), " %!" ]), /* true */1)) { return Curry._1(Scanf.sscanf("", /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Flush */{ - 0: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Flush */Block.__(10, [/* Flush */Block.__(10, [/* End_of_format */0])]) + ]), " %!%!" ]), /* true */1); } @@ -3896,22 +3161,14 @@ test('File "tscanf_test.ml", line 1036, characters 5-12', test39(/* () */0)); function test40() { var ib = Curry._1(Scanf.Scanning[/* from_string */6], "cba"); return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf9\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf9\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]), "%[^ab]%s%!" ]), function (s1, s2) { if (s1 === "c") { @@ -3928,23 +3185,15 @@ test('File "tscanf_test.ml", line 1046, characters 5-12', test40(/* () */0)); function test41() { var ib = Curry._1(Scanf.Scanning[/* from_string */6], "cba"); return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\0\x0e\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 3, - tag: 20 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\0\x0e\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]), "%[^abc]%[cba]%!" ]), function (s1, s2) { if (s1 === "") { @@ -3962,28 +3211,18 @@ function test42() { var s = "defcbaaghi"; var ib = Curry._1(Scanf.Scanning[/* from_string */6], s); if (Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\0\x0e\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 3, - tag: 20 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\0\x0e\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]), "%[^abc]%[abc]%s%!" ]), function (s1, s2, s3) { if (s1 === "def" && s2 === "cbaa") { @@ -3995,21 +3234,13 @@ function test42() { })) { var ib$1 = Curry._1(Scanf.Scanning[/* from_string */6], s); return Curry._1(Scanf.bscanf(ib$1, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "\t" */9, - length: 1, - tag: 2 - }, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "\t" */9]), + /* End_of_format */0 + ]) + ]), "%s@\t" ]), function (s) { return +(s === "defcbaaghi"); @@ -4026,18 +3257,12 @@ var ib$1 = Curry._1(Scanf.Scanning[/* from_string */6], ""); function match_000() { return Curry._1(Scanf.bscanf(ib$1, /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]), "%i%!" ]), function (i) { return i; @@ -4046,18 +3271,12 @@ function match_000() { function match_001() { return Curry._1(Scanf.bscanf(ib$1, /* Format */[ - /* Flush */{ - 0: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, - length: 1, - tag: 10 - }, + /* Flush */Block.__(10, [/* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ])]), "%!%i" ]), function (i) { return i; @@ -4073,33 +3292,21 @@ var test43 = match_000; function test45() { var ib = Curry._1(Scanf.Scanning[/* from_string */6], "12.2"); return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\xff\x03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Char_literal */{ - 0: /* "." */46, - 1: /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\xff\x03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\xff\x03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Char_literal */Block.__(12, [ + /* "." */46, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\xff\x03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]) + ]), "%[0-9].%[0-9]%s%!" ]), function (s1, s2, s3) { if (s1 === "12" && s2 === "2") { @@ -4115,104 +3322,68 @@ test('File "tscanf_test.ml", line 1090, characters 5-12', test45(/* () */0)); function match_000$1() { return Curry._3(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Format_subst */{ - 0: /* None */0, - 1: /* String_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 1 - }, - 2: /* Char_literal */{ - 0: /* "." */46, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 14 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Format_subst */Block.__(14, [ + /* None */0, + /* String_ty */Block.__(1, [/* End_of_fmtty */0]), + /* Char_literal */Block.__(12, [ + /* "." */46, + /* End_of_format */0 + ]) + ]) + ]) + ]), "%i %(%s%)." ]), 1, /* Format */[ - /* String_literal */{ - 0: "spells one, ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "spells one, ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "spells one, %s" ], "in english"); } function match_001$1() { return Curry._3(Printf.sprintf(/* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Format_arg */{ - 0: /* None */0, - 1: /* String_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 1 - }, - 2: /* String_literal */{ - 0: ", ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "." */46, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 3, - tag: 13 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Format_arg */Block.__(13, [ + /* None */0, + /* String_ty */Block.__(1, [/* End_of_fmtty */0]), + /* String_literal */Block.__(11, [ + ", ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "." */46, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]) + ]), "%i %{%s%}, %s." ]), 1, /* Format */[ - /* String_literal */{ - 0: "spells one ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "spells one ", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "spells one %s" ], "in english"); } @@ -4230,87 +3401,61 @@ function test48() { return Caml_obj.caml_equal(Scanf.format_from_string(s, fmt), efmt); }; var fmt = /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ]; if (test_meta_read("%i", fmt, fmt)) { if (test_meta_read("%i", /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%d" ], /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ])) { if (Curry._1(Scanf.sscanf('12 "%i"89 ', /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Format_arg */{ - 0: /* None */0, - 1: /* Int_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 2 - }, - 2: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 3, - tag: 13 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Format_arg */Block.__(13, [ + /* None */0, + /* Int_ty */Block.__(2, [/* End_of_fmtty */0]), + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]) + ]) + ]), "%i %{%d%}%s %!" ]), function (i, f, s) { if (i === 12 && Caml_obj.caml_equal(f, /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ])) { return +(s === "89"); @@ -4321,17 +3466,11 @@ function test48() { })) { var k = function (s) { return Curry._1(Scanf.sscanf(s, /* Format */[ - /* Format_subst */{ - 0: /* None */0, - 1: /* Float_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 6 - }, - 2: /* End_of_format */0, - length: 3, - tag: 14 - }, + /* Format_subst */Block.__(14, [ + /* None */0, + /* Float_ty */Block.__(6, [/* End_of_fmtty */0]), + /* End_of_format */0 + ]), "%(%f%)" ]), function (_, i) { return i; @@ -4343,22 +3482,14 @@ function test48() { if (k('" : %4f": 9.87654321') === 9.87) { var h = function (s) { return Curry._1(Scanf.sscanf(s, /* Format */[ - /* String_literal */{ - 0: "Read integers with ", - 1: /* Format_subst */{ - 0: /* None */0, - 1: /* Int_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 2 - }, - 2: /* End_of_format */0, - length: 3, - tag: 14 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Read integers with ", + /* Format_subst */Block.__(14, [ + /* None */0, + /* Int_ty */Block.__(2, [/* End_of_fmtty */0]), + /* End_of_format */0 + ]) + ]), "Read integers with %(%i%)" ]), function (_, i) { return i; @@ -4370,26 +3501,14 @@ function test48() { if (h('Read integers with "%4x"987654321') === 39030) { var i = function (s) { return Curry._1(Scanf.sscanf(s, /* Format */[ - /* String_literal */{ - 0: "with ", - 1: /* Format_subst */{ - 0: /* None */0, - 1: /* Int_ty */{ - 0: /* String_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 1 - }, - length: 1, - tag: 2 - }, - 2: /* End_of_format */0, - length: 3, - tag: 14 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "with ", + /* Format_subst */Block.__(14, [ + /* None */0, + /* Int_ty */Block.__(2, [/* String_ty */Block.__(1, [/* End_of_fmtty */0])]), + /* End_of_format */0 + ]) + ]), "with %(%i %s%)" ]), function (_, amount, currency) { return /* tuple */[ @@ -4416,26 +3535,14 @@ function test48() { ])) { var j = function (s) { return Curry._1(Scanf.sscanf(s, /* Format */[ - /* String_literal */{ - 0: "with ", - 1: /* Format_subst */{ - 0: /* None */0, - 1: /* Int_ty */{ - 0: /* String_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 1 - }, - length: 1, - tag: 2 - }, - 2: /* End_of_format */0, - length: 3, - tag: 14 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "with ", + /* Format_subst */Block.__(14, [ + /* None */0, + /* Int_ty */Block.__(2, [/* String_ty */Block.__(1, [/* End_of_fmtty */0])]), + /* End_of_format */0 + ]) + ]), "with %(%i %_s %s%)" ]), function (_, amount, currency) { return /* tuple */[ @@ -4528,224 +3635,150 @@ test('File "tscanf_test.ml", line 1157, characters 5-12', test48(/* () */0)); function test49() { if (Curry._1(Scanf.sscanf("as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[\\]" ]), function (s) { return +(s === ""); }) && Curry._1(Scanf.sscanf("as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%[\\]%s" ]), function (s, t) { return s === "" ? +(t === "as") : /* false */0; }) && Curry._1(Scanf.sscanf("as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]), "%[\\]%s%!" ]), function (s, t) { return s === "" ? +(t === "as") : /* false */0; }) && Curry._1(Scanf.sscanf("as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0@\0\0\0\0\0\0\x02\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0@\0\0\0\0\0\0\x02\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[a..z]" ]), function (s) { return +(s === "a"); }) && Curry._1(Scanf.sscanf("as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[a-z]" ]), function (s) { return +(s === "as"); }) && Curry._1(Scanf.sscanf("as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0@\0\0\0\0\0\0\x02\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0@\0\0\0\0\0\0\x02\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%[a..z]%s" ]), function (s, t) { return s === "a" ? +(t === "s") : /* false */0; }) && Curry._1(Scanf.sscanf("as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%[a-z]%s" ]), function (s, t) { return s === "as" ? +(t === "") : /* false */0; }) && Curry._1(Scanf.sscanf("-as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0 \0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* End_of_format */0, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0 \0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* End_of_format */0 + ]), "%[-a-z]" ]), function (s) { return +(s === "-as"); }) && Curry._1(Scanf.sscanf("-as", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0 \0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "s" */115, - length: 1, - tag: 2 - }, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0 \0\0\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "s" */115]), + /* End_of_format */0 + ]) + ]), "%[-a-z]@s" ]), function (s) { return +(s === "-a"); }) && Curry._1(Scanf.sscanf("-as", /* Format */[ - /* Char_literal */{ - 0: /* "-" */45, - 1: /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "s" */115, - length: 1, - tag: 2 - }, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "-" */45, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "s" */115]), + /* End_of_format */0 + ]) + ]) + ]), "-%[a]@s" ]), function (s) { return +(s === "a"); }) && Curry._1(Scanf.sscanf("-asb", /* Format */[ - /* Char_literal */{ - 0: /* "-" */45, - 1: /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "s" */115, - length: 1, - tag: 2 - }, - 1: /* Char_literal */{ - 0: /* "b" */98, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 17 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "-" */45, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "s" */115]), + /* Char_literal */Block.__(12, [ + /* "b" */98, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]) + ]), "-%[a]@sb%!" ]), function (s) { return +(s === "a"); })) { return Curry._1(Scanf.sscanf("-asb", /* Format */[ - /* Char_literal */{ - 0: /* "-" */45, - 1: /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "s" */115, - length: 1, - tag: 2 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 3, - tag: 20 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* "-" */45, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "s" */115]), + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), "-%[a]@s%s" ]), function (s, t) { if (s === "a") { @@ -4796,18 +3829,14 @@ function reader(ib, ob) { } else { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", - 2: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\xff\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%[^\n]\n" ]), function (s) { if (s === "stop") { @@ -4832,17 +3861,13 @@ function reader(ib, ob) { function writer(ib, ob) { return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%s\n" ]), function (s) { switch (s) { @@ -4851,14 +3876,12 @@ function writer(ib, ob) { return reader(ib, ob); case "stop" : return Curry._1(Scanf.bscanf(ib, /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ]), function (i) { return i; @@ -4887,128 +3910,88 @@ test('File "tscanf_test.ml", line 1228, characters 5-12', +(go(/* () */0) === 10 function test51() { if (Curry._1(Scanf.sscanf("Hello", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]), "%s" ]), id) === "Hello" && Curry._1(Scanf.sscanf("Hello\n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]), "%s\n" ]), id) === "Hello" && Curry._1(Scanf.sscanf("Hello\n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]), "%s%s\n" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\nWorld", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]), "%s\n%s%!" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "World") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\nWorld!", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s\n%s" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "World!") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s@\n%s" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "") : /* false */0; })) { return Curry._1(Scanf.sscanf("Hello \n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s@\n%s" ]), function (s1, s2) { if (s1 === "Hello ") { @@ -5028,333 +4011,213 @@ test('File "tscanf_test.ml", line 1248, characters 5-12', test51(/* () */0)); function test52() { if (Curry._1(Scanf.sscanf("Hello\n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* End_of_format */0 + ]) + ]), "%s@\n" ]), id) === "Hello" && Curry._1(Scanf.sscanf("Hello", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* End_of_format */0 + ]) + ]), "%s@\n" ]), id) === "Hello" && Curry._1(Scanf.sscanf("Hello", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* End_of_format */0 + ]) + ]) + ]), "%s%s@\n" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\nWorld", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]), "%s@\n%s%!" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "World") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\nWorld!", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* End_of_format */0 + ]) + ]) + ]) + ]), "%s@\n%s@\n" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "World!") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s@\n%s" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello \n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Force_newline */3, - 1: /* End_of_format */0, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Force_newline */3, + /* End_of_format */0 + ]) + ]) + ]), "%s%s@\n" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === " ") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello \n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Ignored_param */{ - 0: /* Ignored_scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - length: 2, - tag: 9 - }, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 23 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* String */Block.__(2, [ + /* No_padding */0, + /* Ignored_param */Block.__(23, [ + /* Ignored_scan_char_set */Block.__(9, [ + /* Some */[1], + "\0\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + ]), + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]) + ]), "%s%s%_1[ ]\n" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello \n", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Ignored_param */{ - 0: /* Ignored_scan_char_set */{ - 0: /* Some */[1], - 1: "\0\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - length: 2, - tag: 9 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 23 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Ignored_param */Block.__(23, [ + /* Ignored_scan_char_set */Block.__(9, [ + /* Some */[1], + "\0\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + ]), + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* End_of_format */0 + ]) + ]) + ]) + ]), "%s%_1[ ]%s\n" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\nWorld", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]), "%s\n%s%!" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "World") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\nWorld!", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* String */Block.__(2, [ + /* No_padding */0, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]), "%s\n%s%!" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "World!") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello\nWorld!", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "\n" */10, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Scan_indic */{ - 0: /* "!" */33, - length: 1, - tag: 2 - }, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "\n" */10, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Scan_indic */Block.__(2, [/* "!" */33]), + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]) + ]), "%s\n%s@!%!" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "World") : /* false */0; }) && Curry._1(Scanf.sscanf("Hello{foo}", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_gen */{ - 0: /* Open_tag */{ - 0: /* Format */[ - /* End_of_format */0, - "" - ], - length: 1, - tag: 0 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 18 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_gen */Block.__(18, [ + /* Open_tag */Block.__(0, [/* Format */[ + /* End_of_format */0, + "" + ]]), + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s@{%s" ]), function (s1, s2) { return s1 === "Hello" ? +(s2 === "foo}") : /* false */0; })) { return Curry._1(Scanf.sscanf("Hello[foo]", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_gen */{ - 0: /* Open_box */{ - 0: /* Format */[ - /* End_of_format */0, - "" - ], - length: 1, - tag: 1 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 18 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_gen */Block.__(18, [ + /* Open_box */Block.__(1, [/* Format */[ + /* End_of_format */0, + "" + ]]), + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s@[%s" ]), function (s1, s2) { if (s1 === "Hello") { @@ -5374,72 +4237,60 @@ test('File "tscanf_test.ml", line 1286, characters 5-12', test52(/* () */0)); function test53() { if (Curry._1(Scanf.sscanf("123", /* Format */[ - /* Nativeint */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 6 - }, + /* Nativeint */Block.__(6, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%nd" ]), id) === 123 && Curry._1(Scanf.sscanf("124", /* Format */[ - /* Nativeint */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 6 - }, + /* Nativeint */Block.__(6, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%nd" ]), function (i) { return +(i - 1 === 123); }) && Curry._1(Scanf.sscanf("123", /* Format */[ - /* Int32 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 5 - }, + /* Int32 */Block.__(5, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%ld" ]), id) === 123 && Curry._1(Scanf.sscanf("124", /* Format */[ - /* Int32 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 5 - }, + /* Int32 */Block.__(5, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%ld" ]), function (i) { return +((i + 1 | 0) === 125); }) && Caml_int64.eq(Curry._1(Scanf.sscanf("123", /* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%Ld" ]), id), /* int64 */[ 0, 123 ])) { return Curry._1(Scanf.sscanf("124", /* Format */[ - /* Int64 */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 7 - }, + /* Int64 */Block.__(7, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%Ld" ]), function (i) { return Caml_int64.eq(Caml_int64.sub(i, /* int64 */[ @@ -5461,19 +4312,15 @@ test('File "tscanf_test.ml", line 1301, characters 5-12', test53(/* () */0)); function test56() { var g = function (s) { return Curry._1(Scanf.sscanf(s, /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* End_of_format */0 + ]) + ]), "%d%n" ]), function (i, n) { return /* tuple */[ @@ -5506,285 +4353,193 @@ function test57() { return Caml_obj.caml_equal(Scanf.format_from_string(s, fmt), efmt); }; if (test_format_scan(" %i ", /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ], /* Format */[ - /* Char_literal */{ - 0: /* " " */32, - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 12 - }, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* End_of_format */0 + ]) + ]) + ]), " %i " ]) && test_format_scan("%i", /* Format */[ - /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%d" ], /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ]) && test_format_scan("Read an int %i then a string %s.", /* Format */[ - /* String_literal */{ - 0: "Spec", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: "ifi", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "cation", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Spec", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + "ifi", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "cation", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "Spec%difi%scation" ], /* Format */[ - /* String_literal */{ - 0: "Read an int ", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: " then a string ", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* "." */46, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Read an int ", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + " then a string ", + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* "." */46, + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "Read an int %i then a string %s." ]) && test_format_scan('Read an int %i then a string "%s".', /* Format */[ - /* String_literal */{ - 0: "Spec", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: "ifi", - 1: /* Caml_string */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "cation", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 3 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Spec", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + "ifi", + /* Caml_string */Block.__(3, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "cation", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "Spec%difi%Scation" ], /* Format */[ - /* String_literal */{ - 0: "Read an int ", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ' then a string "', - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: '".', - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Read an int ", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ' then a string "', + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + '".', + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), 'Read an int %i then a string "%s".' ]) && test_format_scan('Read an int %i then a string "%s".', /* Format */[ - /* String_literal */{ - 0: "Spec", - 1: /* Int */{ - 0: /* Int_d */0, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: "ifi", - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: "cation", - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Spec", + /* Int */Block.__(4, [ + /* Int_d */0, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + "ifi", + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + "cation", + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), "Spec%difi%scation" ], /* Format */[ - /* String_literal */{ - 0: "Read an int ", - 1: /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* String_literal */{ - 0: ' then a string "', - 1: /* String */{ - 0: /* No_padding */0, - 1: /* String_literal */{ - 0: '".', - 1: /* End_of_format */0, - length: 2, - tag: 11 - }, - length: 2, - tag: 2 - }, - length: 2, - tag: 11 - }, - length: 4, - tag: 4 - }, - length: 2, - tag: 11 - }, + /* String_literal */Block.__(11, [ + "Read an int ", + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* String_literal */Block.__(11, [ + ' then a string "', + /* String */Block.__(2, [ + /* No_padding */0, + /* String_literal */Block.__(11, [ + '".', + /* End_of_format */0 + ]) + ]) + ]) + ]) + ]), 'Read an int %i then a string "%s".' ])) { return Curry._1(Scanf.sscanf('12 "%i"89 ', /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* Char_literal */{ - 0: /* " " */32, - 1: /* Format_arg */{ - 0: /* None */0, - 1: /* Int_ty */{ - 0: /* End_of_fmtty */0, - length: 1, - tag: 2 - }, - 2: /* String */{ - 0: /* No_padding */0, - 1: /* Char_literal */{ - 0: /* " " */32, - 1: /* Flush */{ - 0: /* End_of_format */0, - length: 1, - tag: 10 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 2 - }, - length: 3, - tag: 13 - }, - length: 2, - tag: 12 - }, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Format_arg */Block.__(13, [ + /* None */0, + /* Int_ty */Block.__(2, [/* End_of_fmtty */0]), + /* String */Block.__(2, [ + /* No_padding */0, + /* Char_literal */Block.__(12, [ + /* " " */32, + /* Flush */Block.__(10, [/* End_of_format */0]) + ]) + ]) + ]) + ]) + ]), "%i %{%d%}%s %!" ]), function (i, f, s) { if (i === 12 && Caml_obj.caml_equal(f, /* Format */[ - /* Int */{ - 0: /* Int_i */3, - 1: /* No_padding */0, - 2: /* No_precision */0, - 3: /* End_of_format */0, - length: 4, - tag: 4 - }, + /* Int */Block.__(4, [ + /* Int_i */3, + /* No_padding */0, + /* No_precision */0, + /* End_of_format */0 + ]), "%i" ])) { return +(s === "89"); @@ -5803,84 +4558,58 @@ test('File "tscanf_test.ml", line 1357, characters 5-12', test57(/* () */0)); function test58() { if (Curry._1(Scanf.sscanf("string1%string2", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Escaped_percent */6, - 1: /* Char_literal */{ - 0: /* "s" */115, - 1: /* End_of_format */0, - length: 2, - tag: 12 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Escaped_percent */6, + /* Char_literal */Block.__(12, [ + /* "s" */115, + /* End_of_format */0 + ]) + ]) + ]), "%s@%%s" ]), id) === "string1" && Curry._1(Scanf.sscanf("string1%string2", /* Format */[ - /* String */{ - 0: /* No_padding */0, - 1: /* Formatting_lit */{ - 0: /* Escaped_percent */6, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 17 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* No_padding */0, + /* Formatting_lit */Block.__(17, [ + /* Escaped_percent */6, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%s@%%%s" ]), Pervasives.$caret) === "string1string2" && Curry._1(Scanf.sscanf("string1@string2", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\xff\x03\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Char_literal */{ - 0: /* "@" */64, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\xff\x03\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Char_literal */Block.__(12, [ + /* "@" */64, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]), "%[a-z0-9]@%s" ]), Pervasives.$caret) === "string1string2") { return +(Curry._1(Scanf.sscanf("string1@%string2", /* Format */[ - /* Scan_char_set */{ - 0: /* None */0, - 1: "\0\0\0\0\0\0\xff\x03\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", - 2: /* Char_literal */{ - 0: /* "@" */64, - 1: /* Char_literal */{ - 0: /* "%" */37, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 12 - }, - length: 2, - tag: 12 - }, - length: 3, - tag: 20 - }, + /* Scan_char_set */Block.__(20, [ + /* None */0, + "\0\0\0\0\0\0\xff\x03\0\0\0\0\xfe\xff\xff\x07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + /* Char_literal */Block.__(12, [ + /* "@" */64, + /* Char_literal */Block.__(12, [ + /* "%" */37, + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]) + ]) + ]), "%[a-z0-9]%@%%%s" ]), Pervasives.$caret) === "string1string2"); } @@ -5895,65 +4624,39 @@ test('File "tscanf_test.ml", line 1371, characters 14-21', /* true */1); function test60() { if (Curry._1(Scanf.sscanf("abc", /* Format */[ - /* Scan_next_char */{ - 0: /* Scan_next_char */{ - 0: /* Char */{ - 0: /* Scan_get_counter */{ - 0: /* Char_counter */1, - 1: /* End_of_format */0, - length: 2, - tag: 21 - }, - length: 1, - tag: 0 - }, - length: 1, - tag: 22 - }, - length: 1, - tag: 22 - }, + /* Scan_next_char */Block.__(22, [/* Scan_next_char */Block.__(22, [/* Char */Block.__(0, [/* Scan_get_counter */Block.__(21, [ + /* Char_counter */1, + /* End_of_format */0 + ])])])]), "%0c%0c%c%n" ]), function (c1, c2, c3, n) { return c1 === /* "a" */97 && c2 === /* "a" */97 && c3 === /* "a" */97 ? +(n === 1) : /* false */0; }) && Curry._1(Scanf.sscanf("abc", /* Format */[ - /* String */{ - 0: /* Lit_padding */{ - 0: /* Right */1, - 1: 0, - length: 2, - tag: 0 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* Lit_padding */Block.__(0, [ + /* Right */1, + 0 + ]), + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%0s%s" ]), function (s1, s2) { return s1 === "" ? +(s2 === "abc") : /* false */0; })) { return Curry._1(Scanf.sscanf("abc", /* Format */[ - /* String */{ - 0: /* Lit_padding */{ - 0: /* Right */1, - 1: 1, - length: 2, - tag: 0 - }, - 1: /* String */{ - 0: /* No_padding */0, - 1: /* End_of_format */0, - length: 2, - tag: 2 - }, - length: 2, - tag: 2 - }, + /* String */Block.__(2, [ + /* Lit_padding */Block.__(0, [ + /* Right */1, + 1 + ]), + /* String */Block.__(2, [ + /* No_padding */0, + /* End_of_format */0 + ]) + ]), "%1s%s" ]), function (s1, s2) { if (s1 === "a") { diff --git a/jscomp/test/typeof_test.js b/jscomp/test/typeof_test.js index d6619ea164..9018432535 100644 --- a/jscomp/test/typeof_test.js +++ b/jscomp/test/typeof_test.js @@ -1,17 +1,16 @@ // Generated CODE, PLEASE EDIT WITH CARE 'use strict'; -var Mt = require("./mt"); +var Mt = require("./mt"); +var Block = require("../runtime/block"); var suites_000 = /* tuple */[ "int_type", function () { - return /* Eq */{ - 0: "number", - 1: "number", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "number", + "number" + ]); } ]; @@ -19,12 +18,10 @@ var suites_001 = /* :: */[ /* tuple */[ "string_type", function () { - return /* Eq */{ - 0: "string", - 1: "string", - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + "string", + "string" + ]); } ], /* [] */0 diff --git a/jscomp/test/unsafe_ppx_test.js b/jscomp/test/unsafe_ppx_test.js index 39631b24b7..cfa9c8073f 100644 --- a/jscomp/test/unsafe_ppx_test.js +++ b/jscomp/test/unsafe_ppx_test.js @@ -3,6 +3,7 @@ var Pervasives = require("../stdlib/pervasives"); var Mt = require("./mt"); +var Block = require("../runtime/block"); var Curry = require("../runtime/curry"); var Ffi_js = require("./ffi_js"); @@ -57,48 +58,40 @@ Mt.from_pair_suites("unsafe_ppx_test.ml", /* :: */[ /* tuple */[ "unsafe_max", function () { - return /* Eq */{ - 0: 2, - 1: max(1, 2), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 2, + max(1, 2) + ]); } ], /* :: */[ /* tuple */[ "unsafe_test", function () { - return /* Eq */{ - 0: 3, - 1: v, - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 3, + v + ]); } ], /* :: */[ /* tuple */[ "unsafe_max2", function () { - return /* Eq */{ - 0: 2, - 1: (Math.max)(1, 2), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + 2, + (Math.max)(1, 2) + ]); } ], /* :: */[ /* tuple */[ "ffi_keys", function () { - return /* Eq */{ - 0: /* array */["a"], - 1: Ffi_js.keys(( {a : 3})), - length: 2, - tag: 0 - }; + return /* Eq */Block.__(0, [ + /* array */["a"], + Ffi_js.keys(( {a : 3})) + ]); } ], /* [] */0