diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index cddc423b7..14d5f969d 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,4 @@ # ocamlformat bump -3c98cd3e0c4e1191983b602a8e38a1c92d259891 \ No newline at end of file +3c98cd3e0c4e1191983b602a8e38a1c92d259891 +# Upgrade to OCamlformat 0.26.0 +7de742a776fcdad4b098695617b9e7afab822c82 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..7e2a1227c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + labels: + - dependencies + - no changelog diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..7aba39cfd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,153 @@ +name: build + +on: + pull_request: + push: + branches: + - master + schedule: + # Prime the caches every Monday + - cron: 0 1 * * MON + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + ocaml-compiler: + - "4.08" + - "4.09" + - "4.10" + - "4.11" + - "4.12" + - "4.13" + - "5.0" + - "5.1" + skip-test: + - true + skip-doc: + - true + skip-effects: + - true + include: + - os: ubuntu-latest + ocaml-compiler: "4.14" + skip-effects: true + skip-test: false + skip-doc: true + - os: macos-latest + ocaml-compiler: "4.14" + skip-effects: true + skip-test: false + skip-doc: true + - os: windows-latest + ocaml-compiler: "4.14" + skip-effects: true + skip-test: false + skip-doc: true + - os: ubuntu-latest + ocaml-compiler: "5.2" + skip-effects: false + skip-test: false + skip-doc: false + - os: macos-latest + ocaml-compiler: "5.2" + skip-effects: true + skip-test: false + skip-doc: true + - os: windows-latest + ocaml-compiler: "5.2" + skip-effects: false + skip-test: false + skip-doc: true + + runs-on: ${{ matrix.os }} + + steps: + - name: Set git to use LF + if: matrix.ocaml-compiler < 5.2 + run: | + git config --global core.autocrlf false + git config --global core.eol lf + git config --global core.ignorecase false + + - name: Checkout tree + uses: actions/checkout@v4 + + - name: Set-up Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: Set-up OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + dune-cache: true + opam-pin: false + + - run: opam install conf-pkg-config + if: runner.os == 'Windows' + + - run: opam install . --best-effort + if: ${{ matrix.skip-test }} + + - run: opam install . --with-test + if: ${{ !matrix.skip-test }} + + - run: opam exec -- make all + if: ${{ !matrix.skip-test }} + + - run: opam exec -- make tests + if: ${{ !matrix.skip-test }} + + - run: opam exec -- dune build @all @runtest --profile using-effects + if: ${{ !matrix.skip-effects }} + + - run: opam exec -- git diff --exit-code + if: ${{ !matrix.skip-test }} + + - name: build doc + if: ${{ !matrix.skip-doc && github.event_name == 'push' && github.ref_name == 'master'}} + run: | + opam install odoc lwt_log cohttp-lwt-unix yojson ocp-indent graphics higlo + opam exec -- make doc + + - name: synchronize doc + if: ${{ !matrix.skip-doc && github.event_name == 'push' && github.ref_name == 'master' }} + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: wikidoc + folder: doc-dev + clean: true + target-folder: doc/dev/ + + lint-opam: + runs-on: ubuntu-latest + steps: + - name: Checkout tree + uses: actions/checkout@v4 + + - name: Set-up OCaml + uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: "5.2" + dune-cache: true + + - uses: ocaml/setup-ocaml/lint-opam@v3 + + lint-fmt: + runs-on: ubuntu-latest + steps: + - name: Checkout tree + uses: actions/checkout@v4 + + - name: Set-up OCaml + uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: "5.2" + dune-cache: true + + - uses: ocaml/setup-ocaml/lint-fmt@v3 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 000000000..5e756355e --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,20 @@ +name: Check changelog + +on: + pull_request: + branches: + - master + types: + - labeled + - opened + - reopened + - synchronize + - unlabeled + +jobs: + check-changelog: + name: Check changelog + runs-on: ubuntu-latest + steps: + - name: Check changelog + uses: tarides/changelog-check-action@v3 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..e69de29bb diff --git a/CHANGES.md b/CHANGES.md index c48f55e85..1d9de3f2a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,150 @@ -# Dev (2023-??-??) - ?? +# dev + +## Features/Changes +* Misc: update testsuite to OCaml 5.2 +* Misc: CI uses opam.2.2 and no longer use sunset repo +* Misc: yojson is no longer optional +* Compiler: speedup global_flow/global_deadcode pass on large bytecode +* Compiler: speedup json parsing, relying on Yojson.Raw (#1640) +* Compiler: make indirect call using sequence instead of using the call method + [f.call(null, args)] becomes [(0,f)(args)] +* Runtime: change Sys.os_type on windows (Cygwin -> Win32) +* Runtime: backtraces are really expensive, they need to be be explicitly + requested at compile time (--enable with-js-error) or at startup (OCAMLRUNPARAM=b=1) + + +## Bug fixes +* Runtime: fix parsing of unsigned integers (0u2147483648) +* Toplevel: fix missing primitives with separate compilation +* Compiler: fix link of packed modules with separate compilation +* Fixed the static evaluation of some equalities (#1659) + +# 5.8.2 (2024-05-26) - Luc + +## Bug fixes +* Compiler: fix variable renaming for property binding and assignment target (part 2) + +# 5.8.1 (2024-05-05) - Lille + +## Features/Changes + +* Library: new Typed_array.Bytes module. + +## Bug fixes + +* Compiler: fix #1509 + +# 5.8.0 (2024-04-20) - Lille + +## Features/Changes +* Compiler: es6 now generate consise body +* Compiler: codegen: optimize Offset_ref for negative offsets +* Compiler: codegen: change argument passing of back edges. +* Compiler: codegen: use Array destruction to assign args of back + edges with es6. +* Compiler: codegen: specialize string equality +* Compiler: codegen: more specialization for %int_add, %int_sub +* Compiler: recognize and optimize String.concat +* Compiler: more inlining - duplicate small function. +* Compiler: Make it possible to link runtime JavaScript file + together with OCaml libraries #1509 +* Runtime: abort instead of exit when calling unimplemented + js primitives in bytecode/native. It should help if one tries + to understand the source of the call with gdb (see #677) +* Runtime: re-enable marshalling of floats, disabled in jsoo 2.0 +* Runtime: new runtime api for channels + +## Bug fixes + +* Compiler: fix variable renaming for property binding and assignment target +* Compiler: fix separate compilation of toplevels (broken since 5.7.0) +* Compiler: fix assertion while checking stack compatibility (#1600) + +# 5.7.2 (2024-04-03) - Lille + +## Bug fixes +* Runtime: add missing primitives for ocaml 5.2.0~beta1 + +# 5.7.1 (2024-03-05) - Lille + +## Features/Changes +* Compiler: only flush the necessary env for closures (#1568) +* Library: dialog element support + +## Bug fixes +* Compiler: fix --enable=vardecl +* Compiler: fix parallel renaming (bug introduced in #1567) +* Lib: fix paragraph construction and coercion +* Runtime: reduce memory leak with channels (#1581) + +# 5.7.0 (2024-02-16) - Lille + +## Features/Changes +* Mics: fix support for OCaml 5.2 +* Compiler: no longer rely on IIFE for scoping variable inside loops +* Compiler: avoid parsing bytecode sections twice, jsoo counter part of ocaml#12599 +* Lib: add ellipse to canvasRenderingContext2D (@FayCarsons, #1555) + +## Bug fixes +* Compiler: fix global dead code elimination in a toplevel context +* Compiler: fix exit-loop-early optim in presence of closure (#1561) +* Compiler: remove quadratic behavior in generate.ml (#1531, #1567) + +# 5.6.0 (2024-01-02) - Lille + +## Features/Changes +* Compiler: try to preserve clorures ordering between ml and js +* Compiler: js-parser accept for await + +## Bug fixes +* Compiler: js-parser now accept all the line terminators defined in the spec +* Compiler: js-parser: fix support for LHS assignment target +* Compiler: js-parser: fix parser of default export +* Compiler: js-parser: allow 'as' as ident +* Compiler: js-parser: fix for-in rewriting +* Compiler: js-parser: fix yield pretty print +* Compiler: js-parser: fix async arrow function +* Compiler: js-parser: fix class printing +* Compiler: js-parser: fix #privateName + +# 5.5.2 (2023-12-01) - Lille + +## Features/Changes +* Compiler: global dead code elimination (Micah Cantor, #1503) +* Compiler: change control-flow compilation strategy (#1496) +* Compiler: loop no longer absorb the whole continuation +* Compiler: Dead code elimination of unused references (#2076) +* Compiler: reduce memory consumption (#1516) +* Compiler: support for import and export construct in the js parser/printer +* Lib: add download attribute to anchor element +* Misc: switch CI to OCaml 5.1 +* Misc: preliminary support for OCaml 5.2 +* Misc: support for OCaml 5.1.1 + +## Bug fixes +* Runtime: fix Dom_html.onIE (#1493) +* Runtime: add conversion functions + strict equality for compatibility with Wasm_of_ocaml (#1492) +* Runtime: Dynlink should be able to find symbols in jsoo_runtime #1517 +* Runtime: fix Unix.lstat, Unix.LargeFile.lstat (#1519) +* Compiler: fix global flow analysis (#1494) +* Compiler: fix js parser/printer wrt async functions (#1515) +* Compiler: fix free variables pass wrt parameters' default value (#1521) +* Compiler: fix free variables for classes +* Compiler: fix internal invariant (continuation) +* Compiler: fix variable renaming for let, const and classes +* Lib: Url.Current.set_fragment need not any urlencode (#1497) + +# 5.4.0 (2023-07-06) - Lille ## Bug fixes +* Runtime: Fix recursive modules on ocaml < 4.13 (#1485) * Runtime: fix hashing of NaN (#1475) * Runtime: float rounding should resolve tie away from zero (#1475) * Runtime: fix Gc.stat, Gc.quick_stat, Gc.get (#1475) +* Compiler: fix some miscompilation, probably introduced in jsoo 5.0.0, + revealed by OCaml 5.0 -# 5.3.0 (2023-??-??) - ?? +# 5.3.0 (2023-06-21) - Lille ## Features/Changes * Misc: Bump magic number for ocaml 5.1 * Misc: changes to stay compatible with the next version of ppx_expect @@ -65,7 +204,7 @@ ## Bug fixes * Effects: fix Js.export and Js.export_all to work with functions (#1417,#1377) * Sourcemap: fix incorrect sourcemap with separate compilation -* Compiler: fix control flow analysis; some annotions were wrong in the runtime +* Compiler: fix control flow analysis; some annotations were wrong in the runtime * Compiler: js backtrace recording respected in the js runtime and when using effects * Compiler: no longer fail on invalid source file (when the file is a directory) * Runtime: fix the compilation of some mutually recursive functions diff --git a/TODO.txt b/TODO.txt index c09924394..b8ab11dfc 100644 --- a/TODO.txt +++ b/TODO.txt @@ -7,15 +7,8 @@ Compiler optimizations - constant hoisting (including functions, out of loops and functions) - inline also partially applied functions -- we should check stack compatibility when parsing: - when jumping somewhere, the stack should keep the same shape - - cross-function optimizations -- deadcode elimination inside blocks - (for instance, elimination of function which are defined in a - functor but are not used) - - should we rebind variables from a deeper level ? (only if used more than once...) diff --git a/VERSION b/VERSION index f15f9c581..5e21ca5a8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.3.0-wasm +5.8.2 diff --git a/benchmarks/sources/ml/nucleic.ml b/benchmarks/sources/ml/nucleic.ml index 27bd8d8c4..100e7d9c4 100644 --- a/benchmarks/sources/ml/nucleic.ml +++ b/benchmarks/sources/ml/nucleic.ml @@ -6957,7 +6957,7 @@ let pseudoknot_domains = (* L2 LOOP | *) ; p_o3' rUs 16 15 (* | *) ; p_o3' rCs 17 16 (* | *) - ; p_o3' rAs 18 17 (* <-' *) + ; p_o3' rAs 18 17 (* <-' *) (* *) (* L1 LOOP *) ; helix3' rU 7 8 (* <-. *) diff --git a/compiler/bin-js_of_ocaml/check_runtime.ml b/compiler/bin-js_of_ocaml/check_runtime.ml index 14bca57e0..56c2c0a3f 100644 --- a/compiler/bin-js_of_ocaml/check_runtime.ml +++ b/compiler/bin-js_of_ocaml/check_runtime.ml @@ -43,7 +43,7 @@ let print_groups output l = output_string output (Printf.sprintf "%s\n" name))) let f (runtime_files, bytecode, target_env) = - Generate.init (); + Linker.reset (); let runtime_files, builtin = List.partition_map runtime_files ~f:(fun name -> match Builtins.find name with diff --git a/compiler/bin-js_of_ocaml/cmd_arg.ml b/compiler/bin-js_of_ocaml/cmd_arg.ml index 629755117..5ffe0fd7f 100644 --- a/compiler/bin-js_of_ocaml/cmd_arg.ml +++ b/compiler/bin-js_of_ocaml/cmd_arg.ml @@ -46,10 +46,9 @@ type t = ; source_map : (string option * Source_map.t) option ; runtime_files : string list ; no_runtime : bool - ; include_partial_runtime : bool - ; runtime_only : bool + ; include_runtime : bool ; output_file : [ `Name of string | `Stdout ] * bool - ; input_file : string option + ; bytecode : [ `File of string | `Stdin | `None ] ; params : (string * string) list ; static_env : (string * string) list ; wrap_with_fun : [ `Iife | `Named of string | `Anonymous ] @@ -123,11 +122,11 @@ let options = let doc = "Do not include the standard runtime." in Arg.(value & flag & info [ "noruntime"; "no-runtime" ] ~doc) in - let include_partial_runtime = + let include_runtime = let doc = "Include (partial) runtime when compiling cmo and cma files to JavaScript." in - Arg.(value & flag & info [ "include-partial-runtime" ] ~doc) + Arg.(value & flag & info [ "include-runtime" ] ~doc) in let no_sourcemap = let doc = @@ -270,7 +269,7 @@ let options = no_cmis profile no_runtime - include_partial_runtime + include_runtime no_sourcemap sourcemap sourcemap_inline_in_js @@ -284,19 +283,19 @@ let options = let chop_extension s = try Filename.chop_extension s with Invalid_argument _ -> s in let runtime_files = js_files in let fs_external = fs_external || (toplevel && no_cmis) in - let input_file = + let bytecode = match input_file with - | "-" -> None - | x -> Some x + | "-" -> `Stdin + | x -> `File x in let output_file = match output_file with | Some "-" -> `Stdout, true | Some s -> `Name s, true | None -> ( - match input_file with - | Some s -> `Name (chop_extension s ^ ".js"), false - | None -> `Stdout, false) + match bytecode with + | `File s -> `Name (chop_extension s ^ ".js"), false + | `Stdin -> `Stdout, false) in let source_map = if (not no_sourcemap) && (sourcemap || sourcemap_inline_in_js) @@ -336,14 +335,13 @@ let options = ; include_dirs ; runtime_files ; no_runtime - ; include_partial_runtime - ; runtime_only = false + ; include_runtime ; fs_files ; fs_output ; fs_external ; no_cmis ; output_file - ; input_file + ; bytecode ; source_map ; keep_unit_names } @@ -366,7 +364,7 @@ let options = $ no_cmis $ profile $ noruntime - $ include_partial_runtime + $ include_runtime $ no_sourcemap $ sourcemap $ sourcemap_inline_in_js @@ -566,14 +564,13 @@ let options_runtime_only = ; include_dirs ; runtime_files ; no_runtime - ; include_partial_runtime = false - ; runtime_only = true + ; include_runtime = false ; fs_files ; fs_output ; fs_external ; no_cmis ; output_file - ; input_file = None + ; bytecode = `None ; source_map ; keep_unit_names = false } diff --git a/compiler/bin-js_of_ocaml/cmd_arg.mli b/compiler/bin-js_of_ocaml/cmd_arg.mli index 9bd5996a2..c63aae293 100644 --- a/compiler/bin-js_of_ocaml/cmd_arg.mli +++ b/compiler/bin-js_of_ocaml/cmd_arg.mli @@ -26,10 +26,9 @@ type t = ; source_map : (string option * Source_map.t) option ; runtime_files : string list ; no_runtime : bool - ; include_partial_runtime : bool - ; runtime_only : bool + ; include_runtime : bool ; output_file : [ `Name of string | `Stdout ] * bool - ; input_file : string option + ; bytecode : [ `File of string | `Stdin | `None ] ; params : (string * string) list ; static_env : (string * string) list ; wrap_with_fun : diff --git a/compiler/bin-js_of_ocaml/compile.ml b/compiler/bin-js_of_ocaml/compile.ml index b456d69c3..12945f602 100644 --- a/compiler/bin-js_of_ocaml/compile.ml +++ b/compiler/bin-js_of_ocaml/compile.ml @@ -70,7 +70,7 @@ let run ; source_map ; runtime_files = runtime_files_from_cmdline ; no_runtime - ; input_file + ; bytecode ; output_file ; params ; static_env @@ -80,19 +80,18 @@ let run ; target_env ; toplevel ; no_cmis - ; runtime_only ; include_dirs ; fs_files ; fs_output ; fs_external ; export_file ; keep_unit_names - ; include_partial_runtime + ; include_runtime } = let include_cmis = toplevel && not no_cmis in let custom_header = common.Jsoo_cmdline.Arg.custom_header in Jsoo_cmdline.Arg.eval common; - Generate.init (); + Linker.reset (); (match output_file with | `Stdout, _ -> () | `Name name, _ when debug_mem () -> Debug.start_profiling name @@ -149,10 +148,7 @@ let run if times () then Format.eprintf "Start parsing...@."; let need_debug = Option.is_some source_map || Config.Flag.debuginfo () in let check_debug (one : Parse_bytecode.one) = - if (not runtime_only) - && Option.is_some source_map - && Parse_bytecode.Debug.is_empty one.debug - && not (Code.is_empty one.code) + if Option.is_some source_map && Parse_bytecode.Debug.is_empty one.debug then warn "Warning: '--source-map' is enabled but the bytecode program was compiled with \ @@ -179,8 +175,14 @@ let run , noloc ) ]) in - let output (one : Parse_bytecode.one) ~standalone ~source_map ~link output_file = - check_debug one; + let output + (one : Parse_bytecode.one) + ~check_sourcemap + ~standalone + ~source_map + ~link + output_file = + if check_sourcemap then check_debug one; let init_pseudo_fs = fs_external && standalone in let sm = match output_file with @@ -255,7 +257,7 @@ let run let uinfo = Unit_info.of_cmo cmo in Pretty_print.string fmt "\n"; Pretty_print.string fmt (Unit_info.to_string uinfo); - output code ~source_map ~standalone ~link:`No output_file + output code ~check_sourcemap:true ~source_map ~standalone ~link:`No output_file in let output_partial_runtime ~standalone ~source_map ((_, fmt) as output_file) = assert (not standalone); @@ -273,201 +275,208 @@ let run in output code + ~check_sourcemap:false ~source_map ~standalone ~link:(`All_from runtime_files_from_cmdline) output_file in - (if runtime_only - then ( - let prims = Linker.list_all () |> StringSet.elements in - assert (List.length prims > 0); - let code, uinfo = Parse_bytecode.predefined_exceptions ~target:`JavaScript in - let uinfo = { uinfo with primitives = uinfo.primitives @ prims } in - let code : Parse_bytecode.one = - { code - ; cmis = StringSet.empty - ; debug = Parse_bytecode.Debug.create ~include_cmis:false false - } - in - output_gen - ~standalone:true - ~custom_header - ~build_info:(Build_info.create `Runtime) - ~source_map - (fst output_file) - (fun ~standalone ~source_map ((_, fmt) as output_file) -> - Pretty_print.string fmt "\n"; - Pretty_print.string fmt (Unit_info.to_string uinfo); - output code ~source_map ~standalone ~link:`All output_file)) - else - let kind, ic, close_ic, include_dirs = - match input_file with - | None -> Parse_bytecode.from_channel stdin, stdin, (fun () -> ()), include_dirs - | Some fn -> - let ch = open_in_bin fn in - let res = Parse_bytecode.from_channel ch in - let include_dirs = Filename.dirname fn :: include_dirs in - res, ch, (fun () -> close_in ch), include_dirs - in - (match kind with - | `Exe -> - let t1 = Timer.make () in - (* The OCaml compiler can generate code using the - "caml_string_greaterthan" primitive but does not use it - itself. This is (was at some point at least) the only primitive - in this case. Ideally, Js_of_ocaml should parse the .mli files - for primitives as well as marking this primitive as potentially - used. But the -linkall option is probably good enough. *) - let linkall = linkall || toplevel || dynlink in - let code = - Parse_bytecode.from_exe - ~target:`JavaScript - ~includes:include_dirs - ~include_cmis - ~link_info:(toplevel || dynlink) - ~linkall - ?exported_unit - ~debug:need_debug - ic - in - if times () then Format.eprintf " parsing: %a@." Timer.print t1; - output_gen - ~standalone:true - ~custom_header - ~build_info:(Build_info.create `Exe) - ~source_map - (fst output_file) - (output code ~link:(if linkall then `All else `Needed)) - | `Cmo cmo -> - let output_file = - match output_file, keep_unit_names with - | (`Stdout, false), true -> `Name (gen_unit_filename "./" cmo) - | (`Name x, false), true -> `Name (gen_unit_filename (Filename.dirname x) cmo) - | (`Stdout, _), false -> `Stdout - | (`Name x, _), false -> `Name x - | (`Name x, true), true - when String.length x > 0 && Char.equal x.[String.length x - 1] '/' -> - `Name (gen_unit_filename x cmo) - | (`Name _, true), true | (`Stdout, true), true -> - failwith "use [-o dirname/] or remove [--keep-unit-names]" - in - let t1 = Timer.make () in - let code = - Parse_bytecode.from_cmo - ~target:`JavaScript - ~includes:include_dirs - ~include_cmis - ~debug:need_debug - cmo - ic - in - if times () then Format.eprintf " parsing: %a@." Timer.print t1; - output_gen - ~standalone:false - ~custom_header - ~build_info:(Build_info.create `Cmo) - ~source_map - output_file - (fun ~standalone ~source_map output -> - let source_map = - if not include_partial_runtime - then source_map - else output_partial_runtime ~standalone ~source_map output - in - output_partial cmo code ~standalone ~source_map output) - | `Cma cma when keep_unit_names -> - (if include_partial_runtime - then - let output_file = - let gen dir = Filename.concat dir "runtime.js" in - match output_file with - | `Stdout, false -> gen "./" - | `Name x, false -> gen (Filename.dirname x) - | `Name x, true - when String.length x > 0 && Char.equal x.[String.length x - 1] '/' -> - gen x - | `Stdout, true | `Name _, true -> - failwith "use [-o dirname/] or remove [--keep-unit-names]" - in - output_gen - ~standalone:false - ~custom_header - ~build_info:(Build_info.create `Runtime) - ~source_map - (`Name output_file) - (fun ~standalone ~source_map output -> - output_partial_runtime ~standalone ~source_map output)); - List.iter cma.lib_units ~f:(fun cmo -> + (match bytecode with + | `None -> + let prims = Linker.list_all () |> StringSet.elements in + assert (List.length prims > 0); + let code, uinfo = Parse_bytecode.predefined_exceptions ~target:`JavaScript in + let uinfo = { uinfo with primitives = uinfo.primitives @ prims } in + let code : Parse_bytecode.one = + { code + ; cmis = StringSet.empty + ; debug = Parse_bytecode.Debug.create ~include_cmis:false false + } + in + output_gen + ~standalone:true + ~custom_header + ~build_info:(Build_info.create `Runtime) + ~source_map + (fst output_file) + (fun ~standalone ~source_map ((_, fmt) as output_file) -> + Pretty_print.string fmt "\n"; + Pretty_print.string fmt (Unit_info.to_string uinfo); + output + code + ~check_sourcemap:false + ~source_map + ~standalone + ~link:`All + output_file) + | (`Stdin | `File _) as bytecode -> + let kind, ic, close_ic, include_dirs = + match bytecode with + | `Stdin -> Parse_bytecode.from_channel stdin, stdin, (fun () -> ()), include_dirs + | `File fn -> + let ch = open_in_bin fn in + let res = Parse_bytecode.from_channel ch in + let include_dirs = Filename.dirname fn :: include_dirs in + res, ch, (fun () -> close_in ch), include_dirs + in + (match kind with + | `Exe -> + let t1 = Timer.make () in + (* The OCaml compiler can generate code using the + "caml_string_greaterthan" primitive but does not use it + itself. This is (was at some point at least) the only primitive + in this case. Ideally, Js_of_ocaml should parse the .mli files + for primitives as well as marking this primitive as potentially + used. But the -linkall option is probably good enough. *) + let linkall = linkall || toplevel || dynlink in + let code = + Parse_bytecode.from_exe + ~target:`JavaScript + ~includes:include_dirs + ~include_cmis + ~link_info:(toplevel || dynlink) + ~linkall + ?exported_unit + ~debug:need_debug + ic + in + if times () then Format.eprintf " parsing: %a@." Timer.print t1; + output_gen + ~standalone:true + ~custom_header + ~build_info:(Build_info.create `Exe) + ~source_map + (fst output_file) + (output code ~check_sourcemap:true ~link:(if linkall then `All else `Needed)) + | `Cmo cmo -> + let output_file = + match output_file, keep_unit_names with + | (`Stdout, false), true -> `Name (gen_unit_filename "./" cmo) + | (`Name x, false), true -> `Name (gen_unit_filename (Filename.dirname x) cmo) + | (`Stdout, _), false -> `Stdout + | (`Name x, _), false -> `Name x + | (`Name x, true), true + when String.length x > 0 && Char.equal x.[String.length x - 1] '/' -> + `Name (gen_unit_filename x cmo) + | (`Name _, true), true | (`Stdout, true), true -> + failwith "use [-o dirname/] or remove [--keep-unit-names]" + in + let t1 = Timer.make () in + let code = + Parse_bytecode.from_cmo + ~target:`JavaScript + ~includes:include_dirs + ~include_cmis + ~debug:need_debug + cmo + ic + in + if times () then Format.eprintf " parsing: %a@." Timer.print t1; + output_gen + ~standalone:false + ~custom_header + ~build_info:(Build_info.create `Cmo) + ~source_map + output_file + (fun ~standalone ~source_map output -> + let source_map = + if not include_runtime + then source_map + else output_partial_runtime ~standalone ~source_map output + in + output_partial cmo code ~standalone ~source_map output) + | `Cma cma when keep_unit_names -> + (if include_runtime + then let output_file = + let gen dir = Filename.concat dir "runtime.js" in match output_file with - | `Stdout, false -> gen_unit_filename "./" cmo - | `Name x, false -> gen_unit_filename (Filename.dirname x) cmo + | `Stdout, false -> gen "./" + | `Name x, false -> gen (Filename.dirname x) | `Name x, true when String.length x > 0 && Char.equal x.[String.length x - 1] '/' -> - gen_unit_filename x cmo + gen x | `Stdout, true | `Name _, true -> failwith "use [-o dirname/] or remove [--keep-unit-names]" in - let t1 = Timer.make () in - let code = - Parse_bytecode.from_cmo - ~target:`JavaScript - ~includes:include_dirs - ~include_cmis - ~debug:need_debug - cmo - ic - in - if times () - then - Format.eprintf - " parsing: %a (%s)@." - Timer.print - t1 - (Ocaml_compiler.Cmo_format.name cmo); output_gen ~standalone:false ~custom_header - ~build_info:(Build_info.create `Cma) + ~build_info:(Build_info.create `Runtime) ~source_map (`Name output_file) - (output_partial cmo code)) - | `Cma cma -> - let f ~standalone ~source_map output = - let source_map = - if not include_partial_runtime - then source_map - else output_partial_runtime ~standalone ~source_map output - in - List.fold_left cma.lib_units ~init:source_map ~f:(fun source_map cmo -> - let t1 = Timer.make () in - let code = - Parse_bytecode.from_cmo - ~target:`JavaScript - ~includes:include_dirs - ~include_cmis - ~debug:need_debug - cmo - ic - in - if times () - then - Format.eprintf - " parsing: %a (%s)@." - Timer.print - t1 - (Ocaml_compiler.Cmo_format.name cmo); - output_partial cmo ~standalone ~source_map code output) - in - output_gen - ~standalone:false - ~custom_header - ~build_info:(Build_info.create `Cma) - ~source_map - (fst output_file) - f); - close_ic ()); + (fun ~standalone ~source_map output -> + output_partial_runtime ~standalone ~source_map output)); + List.iter cma.lib_units ~f:(fun cmo -> + let output_file = + match output_file with + | `Stdout, false -> gen_unit_filename "./" cmo + | `Name x, false -> gen_unit_filename (Filename.dirname x) cmo + | `Name x, true + when String.length x > 0 && Char.equal x.[String.length x - 1] '/' -> + gen_unit_filename x cmo + | `Stdout, true | `Name _, true -> + failwith "use [-o dirname/] or remove [--keep-unit-names]" + in + let t1 = Timer.make () in + let code = + Parse_bytecode.from_cmo + ~target:`JavaScript + ~includes:include_dirs + ~include_cmis + ~debug:need_debug + cmo + ic + in + if times () + then + Format.eprintf + " parsing: %a (%s)@." + Timer.print + t1 + (Ocaml_compiler.Cmo_format.name cmo); + output_gen + ~standalone:false + ~custom_header + ~build_info:(Build_info.create `Cma) + ~source_map + (`Name output_file) + (output_partial cmo code)) + | `Cma cma -> + let f ~standalone ~source_map output = + let source_map = + if not include_runtime + then source_map + else output_partial_runtime ~standalone ~source_map output + in + List.fold_left cma.lib_units ~init:source_map ~f:(fun source_map cmo -> + let t1 = Timer.make () in + let code = + Parse_bytecode.from_cmo + ~target:`JavaScript + ~includes:include_dirs + ~include_cmis + ~debug:need_debug + cmo + ic + in + if times () + then + Format.eprintf + " parsing: %a (%s)@." + Timer.print + t1 + (Ocaml_compiler.Cmo_format.name cmo); + output_partial cmo ~standalone ~source_map code output) + in + output_gen + ~standalone:false + ~custom_header + ~build_info:(Build_info.create `Cma) + ~source_map + (fst output_file) + f); + close_ic ()); Debug.stop_profiling () let info name = diff --git a/compiler/bin-js_of_ocaml/info.ml b/compiler/bin-js_of_ocaml/info.ml index 0fc46359f..099739bea 100644 --- a/compiler/bin-js_of_ocaml/info.ml +++ b/compiler/bin-js_of_ocaml/info.ml @@ -44,6 +44,6 @@ let make ~name ~doc ~description = let version = match Compiler_version.git_version with | "" -> Compiler_version.s - | v -> Printf.sprintf "%s+git-%s" Compiler_version.s v + | v -> Printf.sprintf "%s+%s" Compiler_version.s v in Cmd.info name ~version ~doc ~man diff --git a/compiler/bin-js_of_ocaml/link.ml b/compiler/bin-js_of_ocaml/link.ml index 090913d20..cebb9e53d 100644 --- a/compiler/bin-js_of_ocaml/link.ml +++ b/compiler/bin-js_of_ocaml/link.ml @@ -151,6 +151,7 @@ let f ; toplevel } = Jsoo_cmdline.Arg.eval common; + Linker.reset (); let with_output f = match output_file with | None -> f stdout diff --git a/compiler/bin-jsoo_minify/cmd_arg.ml b/compiler/bin-jsoo_minify/cmd_arg.ml index 743cbe0e2..eaad97e11 100644 --- a/compiler/bin-jsoo_minify/cmd_arg.ml +++ b/compiler/bin-jsoo_minify/cmd_arg.ml @@ -72,6 +72,6 @@ let info = let version = match Compiler_version.git_version with | "" -> Compiler_version.s - | v -> Printf.sprintf "%s+git-%s" Compiler_version.s v + | v -> Printf.sprintf "%s+%s" Compiler_version.s v in Cmd.info "jsoo_minify" ~version ~doc ~man diff --git a/compiler/lib-dynlink/dune b/compiler/lib-dynlink/dune index 4965e7c38..84788e768 100644 --- a/compiler/lib-dynlink/dune +++ b/compiler/lib-dynlink/dune @@ -3,6 +3,9 @@ (public_name js_of_ocaml-compiler.dynlink) (synopsis "Js_of_ocaml compiler dynlink support") (library_flags (-linkall)) + (foreign_stubs + (language c) + (names stubs)) (libraries js_of_ocaml-compiler js_of_ocaml-compiler.runtime diff --git a/compiler/lib-dynlink/js_of_ocaml_compiler_dynlink.ml b/compiler/lib-dynlink/js_of_ocaml_compiler_dynlink.ml index 9bf10680d..8ff9e3d8e 100644 --- a/compiler/lib-dynlink/js_of_ocaml_compiler_dynlink.ml +++ b/compiler/lib-dynlink/js_of_ocaml_compiler_dynlink.ml @@ -2,28 +2,39 @@ open Js_of_ocaml_compiler.Stdlib open Js_of_ocaml_compiler module J = Jsoo_runtime.Js -let split_primitives p = - let len = String.length p in - let rec split beg cur = - if cur >= len - then [] - else if Char.equal p.[cur] '\000' - then String.sub p ~pos:beg ~len:(cur - beg) :: split (cur + 1) (cur + 1) - else split beg (cur + 1) - in - Array.of_list (split 0 0) +type bytecode_sections = + { symb : Ocaml_compiler.Symtable.GlobalMap.t + ; crcs : (string * Digest.t option) list + ; prim : string list + ; dlpt : string list + } +[@@ocaml.warning "-unused-field"] + +external get_bytecode_sections : unit -> bytecode_sections = "jsoo_get_bytecode_sections" -external get_section_table : unit -> (string * Obj.t) list = "caml_get_section_table" +let normalize_bytecode code = + match Ocaml_version.compare Ocaml_version.current [ 5; 2 ] < 0 with + | true -> code + | false -> + (* starting with ocaml 5.2, The toplevel no longer append [RETURN 1] *) + let { Instr.opcode; _ } = Instr.find RETURN in + let len = String.length code in + let b = Bytes.create (len + 8) in + Bytes.blit_string ~src:code ~src_pos:0 ~dst:b ~dst_pos:0 ~len; + Bytes.set_int32_le b len (Int32.of_int opcode); + Bytes.set_int32_le b (len + 4) 1l; + Bytes.to_string b let () = let global = J.pure_js_expr "globalThis" in Config.Flag.set "use-js-string" (Jsoo_runtime.Sys.Config.use_js_string ()); Config.Flag.set "effects" (Jsoo_runtime.Sys.Config.effects ()); + Linker.reset (); (* this needs to stay synchronized with toplevel.js *) - let toplevel_compile (s : bytes array) (debug : Instruct.debug_event list array) : + let toplevel_compile (s : string) (debug : Instruct.debug_event list array) : unit -> J.t = - let s = String.concat ~sep:"" (List.map ~f:Bytes.to_string (Array.to_list s)) in - let prims = split_primitives (Symtable.data_primitive_names ()) in + let s = normalize_bytecode s in + let prims = Array.of_list (Ocaml_compiler.Symtable.all_primitives ()) in let b = Buffer.create 100 in let fmt = Pretty_print.to_buffer b in Driver.configure fmt; @@ -48,9 +59,9 @@ let () = flush stderr; res in - let toc = get_section_table () in + let toc = get_bytecode_sections () in let sym = - let t : Ocaml_compiler.Symtable.GlobalMap.t = Obj.obj (List.assoc "SYMB" toc) in + let t : Ocaml_compiler.Symtable.GlobalMap.t = toc.symb in Ocaml_compiler.Symtable.GlobalMap.fold (fun i n acc -> StringMap.add (Ocaml_compiler.Symtable.Global.name i) n acc) t diff --git a/compiler/lib-dynlink/stubs.c b/compiler/lib-dynlink/stubs.c new file mode 100644 index 000000000..aba1fc6f7 --- /dev/null +++ b/compiler/lib-dynlink/stubs.c @@ -0,0 +1,6 @@ +#include +#include +void jsoo_get_bytecode_sections () { + fprintf(stderr, "Unimplemented Javascript primitive jsoo_get_bytecode_sections!\n"); + exit(1); +} diff --git a/compiler/lib-runtime-files/gen/gen.ml b/compiler/lib-runtime-files/gen/gen.ml index 3f0147357..bdf330f4e 100644 --- a/compiler/lib-runtime-files/gen/gen.ml +++ b/compiler/lib-runtime-files/gen/gen.ml @@ -31,11 +31,15 @@ let read_file f = failwith (Printf.sprintf "Cannot read content of %s.\n%s" f (Printexc.to_string e)) let to_ident s = - String.map (String.uncapitalize_ascii s) ~f:(function - | 'a' .. 'z' as c -> c - | 'A' .. 'Z' as c -> c - | '0' .. '9' as c -> c - | _ -> '_') + match + String.map (String.uncapitalize_ascii s) ~f:(function + | 'a' .. 'z' as c -> c + | 'A' .. 'Z' as c -> c + | '0' .. '9' as c -> c + | _ -> '_') + with + | "effect" -> "effect_" + | x -> x let rec list_product l = match l with @@ -88,7 +92,7 @@ let () = let %s = Js_of_ocaml_compiler.Builtins.register ~name:%S ~content:{frag|%s|frag} - ~fragments:(Some {frag|%s|frag}) + ~fragments:(Some %S) |} (to_ident (Filename.chop_extension name)) name diff --git a/compiler/lib-runtime-files/js_of_ocaml_compiler_runtime_files.ml b/compiler/lib-runtime-files/js_of_ocaml_compiler_runtime_files.ml index 4bb63e3b1..22ebd08bb 100644 --- a/compiler/lib-runtime-files/js_of_ocaml_compiler_runtime_files.ml +++ b/compiler/lib-runtime-files/js_of_ocaml_compiler_runtime_files.ml @@ -54,9 +54,10 @@ let runtime = ; domain ; prng ; sync - ; effect + ; effect_ ; zstd ; runtime_events + ; blake2 ] include Files diff --git a/compiler/lib-runtime-files/tests/all.ml b/compiler/lib-runtime-files/tests/all.ml index ad89353fa..282ecce3f 100644 --- a/compiler/lib-runtime-files/tests/all.ml +++ b/compiler/lib-runtime-files/tests/all.ml @@ -15,6 +15,7 @@ let%expect_test _ = +backtrace.js +bigarray.js +bigstring.js + +blake2.js +compare.js +domain.js +dynlink.js @@ -59,6 +60,7 @@ let%expect_test _ = +backtrace.js +bigarray.js +bigstring.js + +blake2.js +compare.js +domain.js +effect.js diff --git a/compiler/lib/base64.mli b/compiler/lib/base64.mli index 9b0496b8e..c423ca95b 100644 --- a/compiler/lib/base64.mli +++ b/compiler/lib/base64.mli @@ -23,8 +23,7 @@ Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. It is specified in RFC 4648. - - {e Release %%VERSION%% - %%PKG_HOMEPAGE%%} *) + *) type ('a, 'b) result = | Ok of 'a diff --git a/compiler/lib/build_info.ml b/compiler/lib/build_info.ml index 3d723a5c3..9802c9eb8 100644 --- a/compiler/lib/build_info.ml +++ b/compiler/lib/build_info.ml @@ -52,7 +52,7 @@ let create kind = let version = match Compiler_version.git_version with | "" -> Compiler_version.s - | v -> Printf.sprintf "%s+git-%s" Compiler_version.s v + | v -> Printf.sprintf "%s+%s" Compiler_version.s v in [ "use-js-string", string_of_bool (Config.Flag.use_js_string ()) ; "effects", string_of_bool (Config.Flag.effects ()) diff --git a/compiler/lib/code.ml b/compiler/lib/code.ml index d9fffb4ee..fb2acc606 100644 --- a/compiler/lib/code.ml +++ b/compiler/lib/code.ml @@ -100,6 +100,22 @@ module Var : sig type 'a t + module DataSet : sig + type 'a t + + val iter : ('a -> unit) -> 'a t -> unit + + val fold : ('a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc + end + + module DataMap : sig + type ('a, 'b) t + + val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit + + val fold : ('a -> 'b -> 'acc -> 'acc) -> ('a, 'b) t -> 'acc -> 'acc + end + type size = unit val get : 'a t -> key -> 'a @@ -108,6 +124,14 @@ module Var : sig val make : size -> 'a -> 'a t + val make_map : size -> ('a, 'b) DataMap.t t + + val make_set : size -> 'a DataSet.t t + + val add_map : ('a, 'b) DataMap.t t -> key -> 'a -> 'b -> unit + + val add_set : 'a DataSet.t t -> key -> 'a -> unit + val iter : (key -> 'a -> unit) -> 'a t -> unit end @@ -204,6 +228,42 @@ end = struct module Tbl = struct type 'a t = 'a array + module DataSet = struct + type 'a t = + | Empty + | One of 'a + | Many of ('a, unit) Hashtbl.t + + let iter f = function + | Empty -> () + | One a -> f a + | Many t -> Hashtbl.iter (fun k () -> f k) t + + let fold f t acc = + match t with + | Empty -> acc + | One a -> f a acc + | Many t -> Hashtbl.fold (fun k () acc -> f k acc) t acc + end + + module DataMap = struct + type ('a, 'b) t = + | Empty + | One of 'a * 'b + | Many of ('a, 'b) Hashtbl.t + + let iter f = function + | Empty -> () + | One (a, b) -> f a b + | Many t -> Hashtbl.iter f t + + let fold f t acc = + match t with + | Empty -> acc + | One (a, b) -> f a b acc + | Many t -> Hashtbl.fold f t acc + end + type key = T.t type size = unit @@ -214,6 +274,30 @@ end = struct let make () v = Array.make (count ()) v + let make_set () = Array.make (count ()) DataSet.Empty + + let make_map () = Array.make (count ()) DataMap.Empty + + let add_map t x k v = + match t.(x) with + | DataMap.Empty -> t.(x) <- One (k, v) + | One (k', v') -> + let tbl = Hashtbl.create 0 in + Hashtbl.replace tbl k' v'; + Hashtbl.replace tbl k v; + t.(x) <- Many tbl + | Many tbl -> Hashtbl.replace tbl k v + + let add_set t x k = + match t.(x) with + | DataSet.Empty -> t.(x) <- One k + | One k' -> + let tbl = Hashtbl.create 0 in + Hashtbl.replace tbl k' (); + Hashtbl.replace tbl k (); + t.(x) <- Many tbl + | Many tbl -> Hashtbl.replace tbl k () + let iter f t = for i = 0 to Array.length t - 1 do f i (Array.unsafe_get t i) @@ -672,12 +756,12 @@ let poptraps blocks pc = let acc, visited = loop blocks pc1 visited depth acc in let acc, visited = loop blocks pc2 visited depth acc in acc, visited - | Switch (_, a1) -> + | Switch (_, a) -> let acc, visited = Array.fold_right ~init:(acc, visited) ~f:(fun (pc, _) (acc, visited) -> loop blocks pc visited depth acc) - a1 + a in acc, visited in @@ -822,7 +906,7 @@ let invariant { blocks; start; _ } = let defs = Var.ISet.empty () in let check_cont (cont, args) = let b = Addr.Map.find cont blocks in - assert (List.length args >= List.length b.params) + assert (List.length args = List.length b.params) in let define x = if check_defs diff --git a/compiler/lib/code.mli b/compiler/lib/code.mli index 1c107d75e..e6d0196f5 100644 --- a/compiler/lib/code.mli +++ b/compiler/lib/code.mli @@ -91,6 +91,22 @@ module Var : sig module Tbl : sig type key = t + module DataSet : sig + type 'a t + + val iter : ('a -> unit) -> 'a t -> unit + + val fold : ('a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc + end + + module DataMap : sig + type ('a, 'b) t + + val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit + + val fold : ('a -> 'b -> 'acc -> 'acc) -> ('a, 'b) t -> 'acc -> 'acc + end + type 'a t type size = unit @@ -101,6 +117,14 @@ module Var : sig val make : size -> 'a -> 'a t + val make_map : size -> ('a, 'b) DataMap.t t + + val make_set : size -> 'a DataSet.t t + + val add_map : ('a, 'b) DataMap.t t -> key -> 'a -> 'b -> unit + + val add_set : 'a DataSet.t t -> key -> 'a -> unit + val iter : (key -> 'a -> unit) -> 'a t -> unit end @@ -250,6 +274,10 @@ module Print : sig | Instr of (instr * loc) | Last of (last * loc) + val expr : Format.formatter -> expr -> unit + + val constant : Format.formatter -> constant -> unit + val var_list : Format.formatter -> Var.t list -> unit val instr : Format.formatter -> instr * loc -> unit diff --git a/compiler/lib/config.ml b/compiler/lib/config.ml index 95193f49c..9385a063b 100644 --- a/compiler/lib/config.ml +++ b/compiler/lib/config.ml @@ -58,6 +58,8 @@ module Flag = struct let deadcode = o ~name:"deadcode" ~default:true + let globaldeadcode = o ~name:"globaldeadcode" ~default:true + let shortvar = o ~name:"shortvar" ~default:true let compact = o ~name:"compact" ~default:true diff --git a/compiler/lib/config.mli b/compiler/lib/config.mli index ac1672bde..e4c86d37b 100644 --- a/compiler/lib/config.mli +++ b/compiler/lib/config.mli @@ -25,6 +25,8 @@ module Flag : sig val deadcode : unit -> bool + val globaldeadcode : unit -> bool + val optcall : unit -> bool val shortvar : unit -> bool diff --git a/compiler/lib/deadcode.ml b/compiler/lib/deadcode.ml index 5e7b61756..23a7efc0e 100644 --- a/compiler/lib/deadcode.ml +++ b/compiler/lib/deadcode.ml @@ -28,6 +28,11 @@ open Code type def = | Expr of expr | Var of Var.t + | Field_update of Var.t + +let add_def defs x i = + let idx = Var.idx x in + defs.(idx) <- i :: defs.(idx) type variable_uses = int array @@ -48,11 +53,15 @@ let pure_expr pure_funs e = Pure_fun.pure_expr pure_funs e && Config.Flag.deadco let rec mark_var st x = let x = Var.idx x in st.live.(x) <- st.live.(x) + 1; - if st.live.(x) = 1 then List.iter st.defs.(x) ~f:(fun e -> mark_def st e) + if st.live.(x) = 1 then List.iter st.defs.(x) ~f:(fun e -> mark_def st x e) -and mark_def st d = +and mark_def st x d = match d with - | Var x -> mark_var st x + | Var y -> mark_var st y + | Field_update y -> + (* A [Set_field (x, _, y)] becomes live *) + st.live.(x) <- st.live.(x) + 1; + mark_var st y | Expr e -> if pure_expr st.pure_funs e then mark_expr st e and mark_expr st e = @@ -82,9 +91,14 @@ and mark_reachable st pc = match i with | Let (_, e) -> if not (pure_expr st.pure_funs e) then mark_expr st e | Assign _ -> () - | Set_field (x, _, _, y) -> - mark_var st x; - mark_var st y + | Set_field (x, _, _, y) -> ( + match st.defs.(Var.idx x) with + | [ Expr (Block _) ] when st.live.(Var.idx x) = 0 -> + (* We will keep this instruction only if x is live *) + add_def st.defs x (Field_update y) + | _ -> + mark_var st x; + mark_var st y) | Array_set (x, y, z) -> mark_var st x; mark_var st y; @@ -110,14 +124,14 @@ and mark_reachable st pc = let live_instr st i = match i with | Let (x, e) -> st.live.(Var.idx x) > 0 || not (pure_expr st.pure_funs e) - | Assign (x, _) -> st.live.(Var.idx x) > 0 - | Set_field _ | Offset_ref _ | Array_set _ -> true + | Assign (x, _) | Set_field (x, _, _, _) -> st.live.(Var.idx x) > 0 + | Offset_ref _ | Array_set _ -> true let rec filter_args st pl al = match pl, al with | x :: pl, y :: al -> if st.live.(Var.idx x) > 0 then y :: filter_args st pl al else filter_args st pl al - | [], _ -> [] + | [], [] -> [] | _ -> assert false let filter_cont blocks st (pc, args) = @@ -162,16 +176,13 @@ let annot st pc xi = (****) -let add_def defs x i = - let idx = Var.idx x in - defs.(idx) <- i :: defs.(idx) - let rec add_arg_dep defs params args = match params, args with | x :: params, y :: args -> add_def defs x (Var y); add_arg_dep defs params args - | _ -> () + | [], [] -> () + | _ -> assert false let add_cont_dep blocks defs (pc, args) = match try Some (Addr.Map.find pc blocks) with Not_found -> None with diff --git a/compiler/lib/driver.ml b/compiler/lib/driver.ml index bb4ce4aaf..3454a2328 100644 --- a/compiler/lib/driver.ml +++ b/compiler/lib/driver.ml @@ -90,17 +90,28 @@ let ( +> ) f g x = g (f x) let map_fst f (x, y, z) = f x, y, z -let effects p = +let effects ~deadcode_sentinal p = if Config.Flag.effects () then ( if debug () then Format.eprintf "Effects...@."; - p |> Deadcode.f +> Effects.f +> map_fst Lambda_lifting.f) + let p, live_vars = Deadcode.f p in + let p = Effects.remove_empty_blocks ~live_vars p in + let p, live_vars = Deadcode.f p in + let info = Global_flow.f ~fast:false p in + let p, live_vars = + if Config.Flag.globaldeadcode () + then + let p = Global_deadcode.f p ~deadcode_sentinal info in + Deadcode.f p + else p, live_vars + in + p |> Effects.f ~flow_info:info ~live_vars +> map_fst Lambda_lifting.f) else ( p , (Code.Var.Set.empty : Effects.trampolined_calls) , (Code.Var.Set.empty : Effects.in_cps) ) -let exact_calls profile p = +let exact_calls profile ~deadcode_sentinal p = if not (Config.Flag.effects ()) then let fast = @@ -109,6 +120,11 @@ let exact_calls profile p = | O1 | O2 -> true in let info = Global_flow.f ~fast p in + let p = + if Config.Flag.globaldeadcode () && Config.Flag.deadcode () + then Global_deadcode.f p ~deadcode_sentinal info + else p + in Specialize.f ~function_arity:(fun f -> Global_flow.function_arity info f) p else p @@ -182,6 +198,7 @@ let generate ~exported_runtime ~wrap_with_fun ~warn_on_unhandled_effect + ~deadcode_sentinal ((p, live_vars), trampolined_calls, _) = if times () then Format.eprintf "Start Generation...@."; let should_export = should_export wrap_with_fun in @@ -192,6 +209,7 @@ let generate ~trampolined_calls ~should_export ~warn_on_unhandled_effect + ~deadcode_sentinal d let debug_linker = Debug.find "linker" @@ -352,36 +370,38 @@ let link' ~export_runtime ~standalone ~link (js : Javascript.statement_list) : if export_runtime then let open Javascript in - let all = Linker.all linkinfos in - let all = - List.map all ~f:(fun name -> - let name = Utf8_string.of_string_exn name in - Property (PNI name, EVar (ident name))) - in - (if standalone - then - ( Expression_statement - (EBin - ( Eq - , dot - (EVar (ident Global_constant.global_object_)) - (Utf8_string.of_string_exn "jsoo_runtime") - , EObj all )) - , N ) - else - ( Expression_statement - (call - (dot - (EVar (ident (Utf8_string.of_string_exn "Object"))) - (Utf8_string.of_string_exn "assign")) - [ dot - (EVar (ident Global_constant.global_object_)) - (Utf8_string.of_string_exn "jsoo_runtime") - ; EObj all - ] - N) - , N )) - :: js + match Linker.all linkinfos with + | [] -> js + | all -> + let all = + List.map all ~f:(fun name -> + let name = Utf8_string.of_string_exn name in + Property (PNI name, EVar (ident name))) + in + (if standalone + then + ( Expression_statement + (EBin + ( Eq + , dot + (EVar (ident Global_constant.global_object_)) + (Utf8_string.of_string_exn "jsoo_runtime") + , EObj all )) + , N ) + else + ( Expression_statement + (call + (dot + (EVar (ident (Utf8_string.of_string_exn "Object"))) + (Utf8_string.of_string_exn "assign")) + [ dot + (EVar (ident Global_constant.global_object_)) + (Utf8_string.of_string_exn "jsoo_runtime") + ; EObj all + ] + N) + , N )) + :: js else js in let missing = Linker.missing linkinfos in @@ -399,7 +419,7 @@ let link' ~export_runtime ~standalone ~link (js : Javascript.statement_list) : List.map ~f:(fun name -> let name = Utf8_string.of_string_exn name in - Prop_ident (ident name, None)) + Prop_ident (Prop_and_ident (ident name), None)) missing ; rest = None } @@ -653,7 +673,7 @@ let target_flag (type a) (t : a target) = | JavaScript _ -> `JavaScript | Wasm -> `Wasm -let link_and_pack ?(standalone = true) ?(wrap_with_fun = `Iife) ~link p = +let link_and_pack ?(standalone = true) ?(wrap_with_fun = `Iife) ?(link = `No) p = let export_runtime = match link with | `All | `All_from _ -> true @@ -675,6 +695,10 @@ let full ~source_map d p : result = + let deadcode_sentinal = + (* If deadcode is disabled, this field is just fresh variable *) + Code.Var.fresh_n "undef" + in let opt = specialize_js_once +> (match profile with @@ -682,13 +706,13 @@ let full | O2 -> o2 | O3 -> o3) ~target:(target_flag target) - +> exact_calls profile - +> effects + +> exact_calls ~deadcode_sentinal profile + +> effects ~deadcode_sentinal +> map_fst - ((match target with - | JavaScript _ -> Generate_closure.f - | Wasm -> Fun.id) - +> deadcode') + (match target with + | JavaScript _ -> if Config.Flag.effects () then Fun.id else Generate_closure.f + | Wasm -> Fun.id) + +> map_fst deadcode' in if times () then Format.eprintf "Start Optimizing...@."; let t = Timer.make () in @@ -698,7 +722,12 @@ let full | JavaScript formatter -> let exported_runtime = not standalone in let emit formatter = - generate d ~exported_runtime ~wrap_with_fun ~warn_on_unhandled_effect:standalone + generate + d + ~exported_runtime + ~wrap_with_fun + ~warn_on_unhandled_effect:standalone + ~deadcode_sentinal +> link_and_pack ~standalone ~wrap_with_fun ~link +> output formatter ~source_map () in diff --git a/compiler/lib/driver.mli b/compiler/lib/driver.mli index 8e8d0c97e..1b9eaa616 100644 --- a/compiler/lib/driver.mli +++ b/compiler/lib/driver.mli @@ -57,7 +57,7 @@ val from_string : val link_and_pack : ?standalone:bool -> ?wrap_with_fun:[ `Iife | `Anonymous | `Named of string ] - -> link:[ `All | `All_from of string list | `Needed | `No ] + -> ?link:[ `All | `All_from of string list | `Needed | `No ] -> Javascript.statement_list -> Javascript.statement_list diff --git a/compiler/lib/duplicate.ml b/compiler/lib/duplicate.ml new file mode 100644 index 000000000..9ea4aefb5 --- /dev/null +++ b/compiler/lib/duplicate.ml @@ -0,0 +1,96 @@ +(* Js_of_ocaml compiler + * http://www.ocsigen.org/js_of_ocaml/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +open! Stdlib +open Code + +let subst_cont m s (pc, arg) = Addr.Map.find pc m, List.map arg ~f:(fun x -> s x) + +let expr s e = + match e with + | Constant _ -> e + | Apply { f; args; exact } -> + Apply { f = s f; args = List.map args ~f:(fun x -> s x); exact } + | Block (n, a, k, mut) -> Block (n, Array.map a ~f:(fun x -> s x), k, mut) + | Field (x, n, field_type) -> Field (s x, n, field_type) + | Closure _ -> failwith "Inlining/Duplicating closure is currenly not supported" + | Special x -> Special x + | Prim (p, l) -> + Prim + ( p + , List.map l ~f:(function + | Pv x -> Pv (s x) + | Pc _ as x -> x) ) + +let instr s i = + match i with + | Let (x, e) -> Let (s x, expr s e) + | Assign (x, y) -> Assign (s x, s y) + | Set_field (x, n, typ, y) -> Set_field (s x, n, typ, s y) + | Offset_ref (x, n) -> Offset_ref (s x, n) + | Array_set (x, y, z) -> Array_set (s x, s y, s z) + +let instrs s l = List.map l ~f:(fun (i, loc) -> instr s i, loc) + +let last m s (l, loc) = + let l = + match l with + | Stop -> l + | Branch cont -> Branch (subst_cont m s cont) + | Pushtrap (cont1, x, cont2) -> + Pushtrap (subst_cont m s cont1, s x, subst_cont m s cont2) + | Return x -> Return (s x) + | Raise (x, k) -> Raise (s x, k) + | Cond (x, cont1, cont2) -> Cond (s x, subst_cont m s cont1, subst_cont m s cont2) + | Switch (x, a1) -> Switch (s x, Array.map a1 ~f:(fun cont -> subst_cont m s cont)) + | Poptrap cont -> Poptrap (subst_cont m s cont) + in + l, loc + +let block m s block = + { params = List.map ~f:s block.params + ; body = instrs s block.body + ; branch = last m s block.branch + } + +let closure p ~bound_vars ~f ~params ~cont:(pc, args) = + let s = + Subst.from_map + (Var.Set.fold (fun x s -> Var.Map.add x (Var.fork x) s) bound_vars Var.Map.empty) + in + let free_pc, m = + Code.traverse + { fold = Code.fold_children } + (fun pc (pc', m) -> pc' + 1, Addr.Map.add pc pc' m) + pc + p.blocks + (p.free_pc, Addr.Map.empty) + in + let blocks = + Code.traverse + { fold = Code.fold_children } + (fun pc blocks -> + let b = Addr.Map.find pc blocks in + let b = block m s b in + Addr.Map.add (Addr.Map.find pc m) b blocks) + pc + p.blocks + p.blocks + in + let p = { p with blocks; free_pc } in + p, s f, List.map ~f:s params, (Addr.Map.find pc m, List.map ~f:s args) diff --git a/compiler/lib/duplicate.mli b/compiler/lib/duplicate.mli new file mode 100644 index 000000000..94ce7b758 --- /dev/null +++ b/compiler/lib/duplicate.mli @@ -0,0 +1,25 @@ +(* Js_of_ocaml compiler + * http://www.ocsigen.org/js_of_ocaml/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +val closure : + Code.program + -> bound_vars:Code.Var.Set.t + -> f:Code.Var.t + -> params:Code.Var.t list + -> cont:int * Code.Var.t list + -> Code.program * Code.Var.t * Code.Var.t list * (int * Code.Var.t list) diff --git a/compiler/lib/effects.ml b/compiler/lib/effects.ml index 66c79a3ed..4c6873b2f 100644 --- a/compiler/lib/effects.ml +++ b/compiler/lib/effects.ml @@ -531,11 +531,11 @@ let cps_block ~st ~k pc block = in let rewrite_instr x e loc = - let perform_effect ~effect ~continuation loc = + let perform_effect ~effect_ ~continuation loc = Some (fun ~k -> let e = - Prim (Extern "caml_perform_effect", [ Pv effect; continuation; Pv k ]) + Prim (Extern "caml_perform_effect", [ Pv effect_; continuation; Pv k ]) in let x = Var.fresh () in [ Let (x, e), loc ], (Return x, loc)) @@ -562,10 +562,10 @@ let cps_block ~st ~k pc block = ~f [ arg; k' ] loc) - | Prim (Extern "%perform", [ Pv effect ]) -> - perform_effect ~effect ~continuation:(Pc (Int 0l)) loc - | Prim (Extern "%reperform", [ Pv effect; continuation ]) -> - perform_effect ~effect ~continuation loc + | Prim (Extern "%perform", [ Pv effect_ ]) -> + perform_effect ~effect_ ~continuation:(Pc (Int 0l)) loc + | Prim (Extern "%reperform", [ Pv effect_; continuation ]) -> + perform_effect ~effect_ ~continuation loc | _ -> None in @@ -940,13 +940,12 @@ let remove_empty_blocks ~live_vars (p : Code.program) : Code.program = (****) -let f (p, live_vars) = +let f ~flow_info ~live_vars p = let t = Timer.make () in - let p = remove_empty_blocks ~live_vars p in - let flow_info = Global_flow.f ~fast:false p in let cps_needed = Partial_cps_analysis.f p flow_info in let p, cps_needed = rewrite_toplevel ~cps_needed p in let p = split_blocks ~cps_needed p in let p, trampolined_calls, in_cps = cps_transform ~live_vars ~flow_info ~cps_needed p in if Debug.find "times" () then Format.eprintf " effects: %a@." Timer.print t; + Code.invariant p; p, trampolined_calls, in_cps diff --git a/compiler/lib/effects.mli b/compiler/lib/effects.mli index 44bc06104..c32df662e 100644 --- a/compiler/lib/effects.mli +++ b/compiler/lib/effects.mli @@ -18,6 +18,12 @@ type trampolined_calls = Code.Var.Set.t +val remove_empty_blocks : live_vars:Deadcode.variable_uses -> Code.program -> Code.program + type in_cps = Code.Var.Set.t -val f : Code.program * Deadcode.variable_uses -> Code.program * trampolined_calls * in_cps +val f : + flow_info:Global_flow.info + -> live_vars:Deadcode.variable_uses + -> Code.program + -> Code.program * trampolined_calls * in_cps diff --git a/compiler/lib/eval.ml b/compiler/lib/eval.ml index 5892f8dc1..3ef8b5a79 100644 --- a/compiler/lib/eval.ml +++ b/compiler/lib/eval.ml @@ -171,11 +171,11 @@ let the_length_of info x = get_approx info (fun x -> - match info.info_defs.(Var.idx x) with - | Expr (Constant (String s)) -> Some (Int32.of_int (String.length s)) - | Expr (Prim (Extern "caml_create_string", [ arg ])) - | Expr (Prim (Extern "caml_create_bytes", [ arg ])) -> the_int info arg - | _ -> None) + match Flow.Info.def info x with + | Some (Constant (String s)) -> Some (Int32.of_int (String.length s)) + | Some (Prim (Extern "caml_create_string", [ arg ])) + | Some (Prim (Extern "caml_create_bytes", [ arg ])) -> the_int info arg + | None | Some _ -> None) None (fun u v -> match u, v with @@ -194,14 +194,14 @@ let is_int ~target info x = get_approx info (fun x -> - match info.info_defs.(Var.idx x) with - | Expr (Constant (Int _)) -> Y - | Expr (Constant (Int32 _ | NativeInt _)) -> ( + match Flow.Info.def info x with + | Some (Constant (Int _)) -> Y + | Some (Constant (NativeInt _ | Int32 _)) -> ( match target with | `JavaScript -> Y | `Wasm -> N) - | Expr (Block (_, _, _, _)) | Expr (Constant _) -> N - | _ -> Unknown) + | Some (Block (_, _, _, _) | Constant _) -> N + | None | Some _ -> Unknown) Unknown (fun u v -> match u, v with @@ -210,7 +210,7 @@ let is_int ~target info x = | _ -> Unknown) x | Pc (Int _) -> Y - | Pc (Int32 _ | NativeInt _) -> ( + | Pc (NativeInt _ | Int32 _) -> ( match target with | `JavaScript -> Y | `Wasm -> N) @@ -222,11 +222,15 @@ let the_tag_of info x get = get_approx info (fun x -> - match info.info_defs.(Var.idx x) with - | Expr (Block (j, _, _, _)) -> - if Var.ISet.mem info.info_possibly_mutable x then None else get j - | Expr (Constant (Tuple (j, _, _))) -> get j - | _ -> None) + match Flow.Info.def info x with + | Some (Block (j, _, _, mut)) -> + if Flow.Info.possibly_mutable info x + then ( + assert (Poly.(mut = Maybe_mutable)); + None) + else get j + | Some (Constant (Tuple (j, _, _))) -> get j + | None | Some _ -> None) None (fun u v -> match u, v with @@ -245,10 +249,10 @@ let the_cont_of info x (a : cont array) = get_approx info (fun x -> - match info.info_defs.(Var.idx x) with - | Expr (Prim (Extern "%direct_obj_tag", [ b ])) -> the_tag_of info b get - | Expr (Constant (Int j)) -> get (Int32.to_int j) - | _ -> None) + match Flow.Info.def info x with + | Some (Prim (Extern "%direct_obj_tag", [ b ])) -> the_tag_of info b get + | Some (Constant (Int j)) -> get (Int32.to_int j) + | None | Some _ -> None) None (fun u v -> match u, v with @@ -273,10 +277,14 @@ let constant_js_equal a b = | _, Float_array _ | Int64 _, _ | _, Int64 _ + | Int32 _, _ + | _, Int32 _ + | NativeInt _, _ + | _, NativeInt _ | Tuple _, _ | _, Tuple _ -> None -let eval_instr ~target info ((x, loc) as i) = +let eval_instr info ~target ((x, loc) as i) = match x with | Let (x, Prim (Extern (("caml_equal" | "caml_notequal") as prim), [ y; z ])) -> ( match the_const_of info y, the_const_of info z with @@ -291,7 +299,7 @@ let eval_instr ~target info ((x, loc) as i) = | _ -> assert false in let c = Constant (bool' c) in - Flow.update_def info x c; + Flow.Info.update_def info x c; [ Let (x, c), loc ]) | _ -> [ i ]) | Let (x, Prim (Extern ("caml_js_equals" | "caml_js_strict_equals"), [ y; z ])) -> ( @@ -301,7 +309,7 @@ let eval_instr ~target info ((x, loc) as i) = | None -> [ i ] | Some c -> let c = Constant (bool' c) in - Flow.update_def info x c; + Flow.Info.update_def info x c; [ Let (x, c), loc ]) | _ -> [ i ]) | Let (x, Prim (Extern "caml_ml_string_length", [ s ])) -> ( @@ -315,7 +323,7 @@ let eval_instr ~target info ((x, loc) as i) = | None -> [ i ] | Some c -> let c = Constant (Int c) in - Flow.update_def info x c; + Flow.Info.update_def info x c; [ Let (x, c), loc ]) | Let ( _ @@ -337,13 +345,13 @@ let eval_instr ~target info ((x, loc) as i) = | Unknown -> [ i ] | (Y | N) as b -> let c = Constant (bool' Poly.(b = Y)) in - Flow.update_def info x c; + Flow.Info.update_def info x c; [ Let (x, c), loc ]) | Let (x, Prim (Extern "%direct_obj_tag", [ y ])) -> ( match the_tag_of info y (fun x -> Some x) with | Some tag -> let c = Constant (Int (Int32.of_int tag)) in - Flow.update_def info x c; + Flow.Info.update_def info x c; [ Let (x, c), loc ] | None -> [ i ]) | Let (x, Prim (Extern "caml_sys_const_backend_type", [ _ ])) -> @@ -378,14 +386,14 @@ let eval_instr ~target info ((x, loc) as i) = match res with | Some c -> let c = Constant c in - Flow.update_def info x c; + Flow.Info.update_def info x c; [ Let (x, c), loc ] | _ -> [ ( Let ( x , Prim ( prim - , List.map2 prim_args prim_args' ~f:(fun arg c -> + , List.map2 prim_args prim_args' ~f:(fun arg (c : constant option) -> match c, target with | Some ((Int _ | NativeString _) as c), _ -> Pc c | Some (Float _ as c), `JavaScript -> Pc c @@ -421,9 +429,9 @@ let the_cond_of info x = | NativeString _ | Float_array _ | Int64 _ )) -> Non_zero - | Expr (Block (_, _, _, _)) -> Non_zero - | Expr (Field _ | Closure _ | Prim _ | Apply _ | Special _) -> Unknown - | Param | Phi _ -> Unknown) + | Some (Block (_, _, _, _)) -> Non_zero + | Some (Field _ | Closure _ | Prim _ | Apply _ | Special _) -> Unknown + | None -> Unknown) Unknown (fun u v -> match u, v with diff --git a/compiler/lib/eval.mli b/compiler/lib/eval.mli index 30a36b08f..bb3edd123 100644 --- a/compiler/lib/eval.mli +++ b/compiler/lib/eval.mli @@ -21,4 +21,4 @@ val clear_static_env : unit -> unit val set_static_env : string -> string -> unit -val f : target:[ `JavaScript | `Wasm ] -> Flow.info -> Code.program -> Code.program +val f : target:[ `JavaScript | `Wasm ] -> Flow.Info.t -> Code.program -> Code.program diff --git a/compiler/lib/flow.ml b/compiler/lib/flow.ml index 1212e56f0..a60c68225 100644 --- a/compiler/lib/flow.ml +++ b/compiler/lib/flow.ml @@ -34,16 +34,25 @@ type def = | Expr of Code.expr | Param -type info = - { info_defs : def array - ; info_known_origins : Code.Var.Set.t Code.Var.Tbl.t - ; info_maybe_unknown : bool Code.Var.Tbl.t - ; info_possibly_mutable : Var.ISet.t - } +module Info = struct + type t = + { info_defs : def array + ; info_known_origins : Code.Var.Set.t Code.Var.Tbl.t + ; info_maybe_unknown : bool Code.Var.Tbl.t + ; info_possibly_mutable : Var.ISet.t + } + + let def t x = + match t.info_defs.(Code.Var.idx x) with + | Phi _ | Param -> None + | Expr x -> Some x -let update_def { info_defs; _ } x exp = - let idx = Code.Var.idx x in - info_defs.(idx) <- Expr exp + let possibly_mutable t x = Code.Var.ISet.mem t.info_possibly_mutable x + + let update_def { info_defs; _ } x exp = + let idx = Code.Var.idx x in + info_defs.(idx) <- Expr exp +end let undefined = Phi Var.Set.empty @@ -81,7 +90,8 @@ let rec arg_deps vars deps defs params args = add_dep deps x y; add_assign_def vars defs x y; arg_deps vars deps defs params args - | _ -> () + | [], [] -> () + | _ -> assert false let cont_deps blocks vars deps defs (pc, args) = let block = Addr.Map.find pc blocks in @@ -296,7 +306,12 @@ let solver2 ?skip_param vars deps defs known_origins possibly_mutable = in Solver2.f () g (propagate2 ?skip_param defs known_origins possibly_mutable) -let get_approx { info_defs = _; info_known_origins; info_maybe_unknown; _ } f top join x = +let get_approx + { Info.info_defs = _; info_known_origins; info_maybe_unknown; _ } + f + top + join + x = let s = Var.Tbl.get info_known_origins x in if Var.Tbl.get info_maybe_unknown x then top @@ -341,6 +356,10 @@ let constant_identical a b = | _, Float_array _ | Int64 _, _ | _, Int64 _ + | Int32 _, _ + | _, Int32 _ + | NativeInt _, _ + | _, NativeInt _ | Tuple _, _ | _, Tuple _ -> false @@ -380,7 +399,7 @@ let the_native_string_of info x = | _ -> None (*XXX Maybe we could iterate? *) -let direct_approx info x = +let direct_approx (info : Info.t) x = match info.info_defs.(Var.idx x) with | Expr (Field (y, n, _)) -> get_approx @@ -400,7 +419,7 @@ let direct_approx info x = y | _ -> None -let build_subst info vars = +let build_subst (info : Info.t) vars = let nv = Var.count () in let subst = Array.init nv ~f:(fun i -> Var.of_idx i) in Var.ISet.iter @@ -454,7 +473,7 @@ let f ?skip_param p = vars; let t5 = Timer.make () in let info = - { info_defs = defs + { Info.info_defs = defs ; info_known_origins = known_origins ; info_maybe_unknown = maybe_unknown ; info_possibly_mutable = possibly_mutable diff --git a/compiler/lib/flow.mli b/compiler/lib/flow.mli index 3dfb87551..c2033e0c6 100644 --- a/compiler/lib/flow.mli +++ b/compiler/lib/flow.mli @@ -37,31 +37,27 @@ val get_label : t -> Code.Var.t option *) -type def = - | Phi of Code.Var.Set.t - | Expr of Code.expr - | Param - -type info = - { info_defs : def array - ; info_known_origins : Code.Var.Set.t Code.Var.Tbl.t - ; info_maybe_unknown : bool Code.Var.Tbl.t - ; info_possibly_mutable : Code.Var.ISet.t - } +module Info : sig + type t -val get_approx : - info -> (Code.Var.Set.elt -> 'b) -> 'b -> ('b -> 'b -> 'b) -> Code.Var.Tbl.key -> 'b + val def : t -> Code.Var.t -> Code.expr option + + val update_def : t -> Code.Var.t -> Code.expr -> unit -val the_def_of : info -> Code.prim_arg -> Code.expr option + val possibly_mutable : t -> Code.Var.t -> bool +end + +val get_approx : + Info.t -> (Code.Var.Set.elt -> 'b) -> 'b -> ('b -> 'b -> 'b) -> Code.Var.Tbl.key -> 'b -val the_const_of : info -> Code.prim_arg -> Code.constant option +val the_def_of : Info.t -> Code.prim_arg -> Code.expr option -val the_string_of : info -> Code.prim_arg -> string option +val the_const_of : Info.t -> Code.prim_arg -> Code.constant option -val the_native_string_of : info -> Code.prim_arg -> Code.Native_string.t option +val the_string_of : Info.t -> Code.prim_arg -> string option -val the_int : info -> Code.prim_arg -> int32 option +val the_native_string_of : Info.t -> Code.prim_arg -> Code.Native_string.t option -val update_def : info -> Code.Var.t -> Code.expr -> unit +val the_int : Info.t -> Code.prim_arg -> int32 option -val f : ?skip_param:bool -> Code.program -> Code.program * info +val f : ?skip_param:bool -> Code.program -> Code.program * Info.t diff --git a/compiler/lib/flow_lexer.ml b/compiler/lib/flow_lexer.ml index cd3257bab..526b71096 100644 --- a/compiler/lib/flow_lexer.ml +++ b/compiler/lib/flow_lexer.ml @@ -14,17 +14,6 @@ module Lex_mode = struct | REGEXP end -module Loc = struct - (* line numbers are 1-indexed; column numbers are 0-indexed *) - - type t = - { source : string option - ; start : Lexing.position - ; _end : Lexing.position - } - [@@ocaml.warning "-69"] -end - module Parse_error = struct type t = | Unexpected of string @@ -45,28 +34,20 @@ module Lex_env = struct type lex_state = { lex_errors_acc : (Loc.t * Parse_error.t) list } [@@ocaml.unboxed] type t = - { lex_source : string option - ; lex_lb : Sedlexing.lexbuf + { lex_lb : Sedlexing.lexbuf ; lex_state : lex_state ; lex_mode_stack : Lex_mode.t list + ; lex_last_loc : Loc.t ref } [@@ocaml.warning "-69"] - let source env = env.lex_source - let empty_lex_state = { lex_errors_acc = [] } let create lex_lb = - let s, _ = Sedlexing.lexing_positions lex_lb in - let lex_source = - match s.pos_fname with - | "" -> None - | s -> Some s - in - { lex_source - ; lex_lb + { lex_lb ; lex_state = empty_lex_state ; lex_mode_stack = [ Lex_mode.NORMAL ] + ; lex_last_loc = ref (Loc.create Lexing.dummy_pos Lexing.dummy_pos) } end @@ -84,7 +65,7 @@ let pop_mode env = module Lex_result = struct type t = { lex_token : Js_token.t - ; lex_loc : Lexing.position * Lexing.position + ; lex_loc : Loc.t ; lex_errors : (Loc.t * Parse_error.t) list } [@@ocaml.warning "-69"] @@ -161,7 +142,7 @@ let scinumber = , Opt ('-' | '+') , underscored_digit )] -let wholenumber = [%sedlex.regexp? underscored_digit, Opt '.'] +let integer = [%sedlex.regexp? underscored_digit] let floatnumber = [%sedlex.regexp? Opt underscored_digit, '.', underscored_decimal] @@ -171,12 +152,8 @@ let octbigint = [%sedlex.regexp? octnumber, 'n'] let hexbigint = [%sedlex.regexp? hexnumber, 'n'] -let scibigint = [%sedlex.regexp? scinumber, 'n'] - let wholebigint = [%sedlex.regexp? underscored_digit, 'n'] -let floatbigint = [%sedlex.regexp? (floatnumber | underscored_digit, '.'), 'n'] - (* https://tc39.github.io/ecma262/#sec-white-space *) let whitespace = [%sedlex.regexp? @@ -239,16 +216,21 @@ let is_valid_identifier_name s = | js_id_start, Star js_id_continue, eof -> true | _ -> false -let loc_of_lexbuf env (lexbuf : Sedlexing.lexbuf) = +let loc_of_lexbuf _env (lexbuf : Sedlexing.lexbuf) = let start_offset, stop_offset = Sedlexing.lexing_positions lexbuf in - { Loc.source = Lex_env.source env; start = start_offset; _end = stop_offset } + Loc.create start_offset stop_offset let lex_error (env : Lex_env.t) loc err : Lex_env.t = let lex_errors_acc = (loc, err) :: env.lex_state.lex_errors_acc in { env with lex_state = { lex_errors_acc } } -let illegal (env : Lex_env.t) (loc : Loc.t) = - lex_error env loc (Parse_error.Unexpected "token ILLEGAL") +let illegal (env : Lex_env.t) (loc : Loc.t) reason = + let reason = + match reason with + | "" -> "token ILLEGAL" + | s -> s + in + lex_error env loc (Parse_error.Unexpected reason) let decode_identifier = let sub_lexeme lexbuf trim_start trim_end = @@ -338,7 +320,7 @@ let decode_identifier = id_char env loc buf lexbuf let recover env lexbuf ~f = - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = illegal env (loc_of_lexbuf env lexbuf) "recovery" in Sedlexing.rollback lexbuf; f env lexbuf @@ -347,9 +329,33 @@ type result = | Comment of Lex_env.t * string | Continue of Lex_env.t +let newline lexbuf = + let start = Sedlexing.lexeme_start lexbuf in + let stop = Sedlexing.lexeme_end lexbuf in + let len = stop - start in + let pending = ref false in + for i = 0 to len - 1 do + match Uchar.to_int (Sedlexing.lexeme_char lexbuf i) with + | 0x000d -> pending := true + | 0x000a -> pending := false + | 0x2028 | 0x2029 -> + if !pending + then ( + pending := false; + Sedlexing.new_line lexbuf); + Sedlexing.new_line lexbuf + | _ -> + if !pending + then ( + pending := false; + Sedlexing.new_line lexbuf) + done; + if !pending then Sedlexing.new_line lexbuf + let rec comment env buf lexbuf = match%sedlex lexbuf with | line_terminator_sequence -> + newline lexbuf; lexeme_to_buffer lexbuf buf; comment env buf lexbuf | "*/" -> @@ -363,7 +369,7 @@ let rec comment env buf lexbuf = lexeme_to_buffer lexbuf buf; comment env buf lexbuf | _ -> - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = illegal env (loc_of_lexbuf env lexbuf) "" in env let drop_line env = @@ -384,7 +390,7 @@ let rec line_comment env buf lexbuf = line_comment env buf lexbuf | _ -> failwith "unreachable line_comment" -let string_escape env lexbuf = +let string_escape ~accept_invalid env lexbuf = match%sedlex lexbuf with | eof | '\\' -> let str = lexeme lexbuf in @@ -419,13 +425,20 @@ let string_escape env lexbuf = let hex = String.sub str 2 (String.length str - 3) in let code = int_of_string ("0x" ^ hex) in (* 11.8.4.1 *) - let env = if code > 0x10FFFF then illegal env (loc_of_lexbuf env lexbuf) else env in + let env = + if code > 0x10FFFF && not accept_invalid + then illegal env (loc_of_lexbuf env lexbuf) "unicode escape out of range" + else env + in env, str | 'u' | 'x' | '0' .. '7' -> let str = lexeme lexbuf in - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = + if accept_invalid then env else illegal env (loc_of_lexbuf env lexbuf) "" + in env, str | line_terminator_sequence -> + newline lexbuf; let str = lexeme lexbuf in env, str | any -> @@ -444,23 +457,26 @@ let rec string_quote env q buf lexbuf = else ( Buffer.add_string buf q'; string_quote env q buf lexbuf) - | '\\', line_terminator_sequence -> string_quote env q buf lexbuf + | '\\', line_terminator_sequence -> + newline lexbuf; + string_quote env q buf lexbuf | '\\' -> - let env, str = string_escape env lexbuf in - if String.equal str "" || String.get q 0 <> String.get str 0 - then Buffer.add_string buf "\\"; + let env, str = string_escape ~accept_invalid:false env lexbuf in + (match str with + | "'" | "\"" -> () + | _ -> Buffer.add_string buf "\\"); Buffer.add_string buf str; string_quote env q buf lexbuf | '\n' -> let x = lexeme lexbuf in Buffer.add_string buf x; - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = illegal env (loc_of_lexbuf env lexbuf) "" in string_quote env q buf lexbuf (* env, end_pos_of_lexbuf env lexbuf *) | eof -> let x = lexeme lexbuf in Buffer.add_string buf x; - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = illegal env (loc_of_lexbuf env lexbuf) "" in env (* match multi-char substrings that don't contain the start chars of the above patterns *) | Plus (Compl ("'" | '"' | '\\' | '\n' | eof)) | any -> @@ -470,7 +486,9 @@ let rec string_quote env q buf lexbuf = let token (env : Lex_env.t) lexbuf : result = match%sedlex lexbuf with - | line_terminator_sequence -> Continue env + | line_terminator_sequence -> + newline lexbuf; + Continue env | Plus whitespace -> Continue env | "/*" -> let buf = Buffer.create 127 in @@ -560,19 +578,6 @@ let token (env : Lex_env.t) lexbuf : result = | hexnumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) | _ -> failwith "unreachable token hexnumber") | hexnumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) - | scibigint, word -> - (* Numbers cannot be immediately followed by words *) - recover env lexbuf ~f:(fun env lexbuf -> - match%sedlex lexbuf with - | scibigint -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.InvalidSciBigInt in - Token (env, T_BIGINT (BIG_NORMAL, lexeme lexbuf)) - | _ -> failwith "unreachable token scibigint") - | scibigint -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.InvalidSciBigInt in - Token (env, T_BIGINT (BIG_NORMAL, lexeme lexbuf)) | scinumber, word -> (* Numbers cannot be immediately followed by words *) recover env lexbuf ~f:(fun env lexbuf -> @@ -580,33 +585,31 @@ let token (env : Lex_env.t) lexbuf : result = | scinumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) | _ -> failwith "unreachable token scinumber") | scinumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) - | floatbigint, word -> - (* Numbers cannot be immediately followed by words *) - recover env lexbuf ~f:(fun env lexbuf -> - match%sedlex lexbuf with - | floatbigint -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.InvalidFloatBigInt in - Token (env, T_BIGINT (BIG_NORMAL, lexeme lexbuf)) - | _ -> failwith "unreachable token floatbigint") | wholebigint, word -> (* Numbers cannot be immediately followed by words *) recover env lexbuf ~f:(fun env lexbuf -> match%sedlex lexbuf with | wholebigint -> Token (env, T_BIGINT (BIG_NORMAL, lexeme lexbuf)) | _ -> failwith "unreachable token wholebigint") - | floatbigint -> - let loc = loc_of_lexbuf env lexbuf in - let env = lex_error env loc Parse_error.InvalidFloatBigInt in - Token (env, T_BIGINT (BIG_NORMAL, lexeme lexbuf)) | wholebigint -> Token (env, T_BIGINT (BIG_NORMAL, lexeme lexbuf)) - | (wholenumber | floatnumber), word -> + | integer, word -> + (* Numbers cannot be immediately followed by words *) + recover env lexbuf ~f:(fun env lexbuf -> + match%sedlex lexbuf with + | integer -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) + | _ -> failwith "unreachable token wholenumber") + | integer, '.', word -> ( + Sedlexing.rollback lexbuf; + match%sedlex lexbuf with + | integer -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) + | _ -> failwith "unreachable token wholenumber") + | floatnumber, word -> (* Numbers cannot be immediately followed by words *) recover env lexbuf ~f:(fun env lexbuf -> match%sedlex lexbuf with - | wholenumber | floatnumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) + | floatnumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) | _ -> failwith "unreachable token wholenumber") - | wholenumber | floatnumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) + | integer, Opt '.' | floatnumber -> Token (env, T_NUMBER (NORMAL, lexeme lexbuf)) (* Syntax *) | "{" -> let env = push_mode env NORMAL in @@ -697,13 +700,19 @@ let token (env : Lex_env.t) lexbuf : result = | None -> ( match is_valid_identifier_name decoded with | true -> env - | false -> illegal env (loc_of_lexbuf env lexbuf)) - | Some _ -> illegal env (loc_of_lexbuf env lexbuf) + | false -> + illegal + env + (loc_of_lexbuf env lexbuf) + (Printf.sprintf "%S is not a valid identifier" decoded)) + | Some _ -> + (* accept keyword as ident if escaped *) + env in Token (env, T_IDENTIFIER (Stdlib.Utf8_string.of_string_exn decoded, raw))) | eof -> Token (env, T_EOF) | any -> - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = illegal env (loc_of_lexbuf env lexbuf) "" in Token (env, T_ERROR (lexeme lexbuf)) | _ -> failwith "unreachable token" @@ -721,6 +730,7 @@ let rec regexp_class env buf lexbuf = Buffer.add_char buf ']'; env | line_terminator_sequence -> + newline lexbuf; let loc = loc_of_lexbuf env lexbuf in let env = lex_error env loc Parse_error.UnterminatedRegExp in env @@ -738,6 +748,7 @@ let rec regexp_body env buf lexbuf = let env = lex_error env loc Parse_error.UnterminatedRegExp in env, "" | '\\', line_terminator_sequence -> + newline lexbuf; let loc = loc_of_lexbuf env lexbuf in let env = lex_error env loc Parse_error.UnterminatedRegExp in env, "" @@ -757,6 +768,7 @@ let rec regexp_body env buf lexbuf = let env = regexp_class env buf lexbuf in regexp_body env buf lexbuf | line_terminator_sequence -> + newline lexbuf; let loc = loc_of_lexbuf env lexbuf in let env = lex_error env loc Parse_error.UnterminatedRegExp in env, "" @@ -770,7 +782,9 @@ let rec regexp_body env buf lexbuf = let regexp env lexbuf = match%sedlex lexbuf with | eof -> Token (env, T_EOF) - | line_terminator_sequence -> Continue env + | line_terminator_sequence -> + newline lexbuf; + Continue env | Plus whitespace -> Continue env | "//" -> let buf = Buffer.create 127 in @@ -787,7 +801,7 @@ let regexp env lexbuf = let env, flags = regexp_body env buf lexbuf in Token (env, T_REGEXP (Stdlib.Utf8_string.of_string_exn (Buffer.contents buf), flags)) | any -> - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = illegal env (loc_of_lexbuf env lexbuf) "" in Token (env, T_ERROR (lexeme lexbuf)) | _ -> failwith "unreachable regexp" @@ -808,12 +822,12 @@ let backquote env lexbuf = | '\\' -> let buf = Buffer.create 127 in Buffer.add_char buf '\\'; - let env, str = string_escape env lexbuf in + let env, str = string_escape ~accept_invalid:true env lexbuf in Buffer.add_string buf str; Token (env, T_ENCAPSED_STRING (Buffer.contents buf)) | eof -> Token (env, T_EOF) | _ -> - let env = illegal env (loc_of_lexbuf env lexbuf) in + let env = illegal env (loc_of_lexbuf env lexbuf) "" in Token (env, T_ERROR (lexeme lexbuf)) let wrap f = @@ -821,12 +835,14 @@ let wrap f = let start, _ = Sedlexing.lexing_positions env.Lex_env.lex_lb in let t = f env env.Lex_env.lex_lb in let _, stop = Sedlexing.lexing_positions env.Lex_env.lex_lb in - t, (start, stop) + t, Loc.create ~last_line:(Loc.line_end' !(env.lex_last_loc)) start stop in let rec helper comments env = Sedlexing.start env.Lex_env.lex_lb; - match f env with - | Token (env, t), lex_loc -> + let res, lex_loc = f env in + match res with + | Token (env, t) -> + env.lex_last_loc := lex_loc; let lex_token = t in let lex_errors_acc = env.lex_state.lex_errors_acc in if lex_errors_acc = [] @@ -834,14 +850,15 @@ let wrap f = else ( { env with lex_state = Lex_env.empty_lex_state } , { Lex_result.lex_token; lex_loc; lex_errors = List.rev lex_errors_acc } ) - | Comment (env, comment), lex_loc -> + | Comment (env, comment) -> + env.lex_last_loc := lex_loc; let lex_errors_acc = env.lex_state.lex_errors_acc in ( env , { Lex_result.lex_token = TComment comment ; lex_loc ; lex_errors = List.rev lex_errors_acc } ) - | Continue env, _ -> helper comments env + | Continue env -> helper comments env in fun env -> helper [] env diff --git a/compiler/lib/flow_lexer.mli b/compiler/lib/flow_lexer.mli index 0c1d278ae..e91d29ab8 100644 --- a/compiler/lib/flow_lexer.mli +++ b/compiler/lib/flow_lexer.mli @@ -18,14 +18,6 @@ module Parse_error : sig val to_string : t -> string end -module Loc : sig - type t = - { source : string option - ; start : Lexing.position - ; _end : Lexing.position - } -end - module Lex_env : sig type t @@ -37,7 +29,7 @@ module Lex_result : sig val token : t -> Js_token.t - val loc : t -> Lexing.position * Lexing.position + val loc : t -> Loc.t val errors : t -> (Loc.t * Parse_error.t) list end diff --git a/compiler/lib/freevars.ml b/compiler/lib/freevars.ml index b0601ccba..89fbf4da9 100644 --- a/compiler/lib/freevars.ml +++ b/compiler/lib/freevars.ml @@ -216,10 +216,45 @@ let free_variables vars in_loop p = !freevars let f p = + Code.invariant p; + let t = Timer.make () in + let bound = Code.Var.ISet.empty () in + let visited = BitSet.create' p.free_pc in + let free_vars = + Code.fold_closures_innermost_first + p + (fun _name_opt params (pc, args) acc -> + let free = ref Var.Set.empty in + let using x = + if Code.Var.ISet.mem bound x then () else free := Var.Set.add x !free + in + let rec traverse pc = + if not (BitSet.mem visited pc) + then ( + BitSet.set visited pc; + let block = Addr.Map.find pc p.blocks in + iter_block_bound_vars (fun x -> Code.Var.ISet.add bound x) block; + iter_block_free_vars using block; + List.iter block.body ~f:(function + | Let (_, Closure (_, (pc_clo, _))), _ -> + Code.Var.Set.iter using (Code.Addr.Map.find pc_clo acc) + | _ -> ()); + Code.fold_children p.blocks pc (fun pc' () -> traverse pc') ()) + in + List.iter params ~f:(fun x -> Code.Var.ISet.add bound x); + List.iter args ~f:using; + traverse pc; + Code.Addr.Map.add pc !free acc) + Code.Addr.Map.empty + in + if times () then Format.eprintf " free vars 2: %a@." Timer.print t; + free_vars + +let f_mutable p = Code.invariant p; let t = Timer.make () in let in_loop = find_all_loops p in let vars = mark_variables in_loop p in let free_vars = free_variables vars in_loop p in - if times () then Format.eprintf " free vars: %a@." Timer.print t; + if times () then Format.eprintf " free vars 1: %a@." Timer.print t; free_vars diff --git a/compiler/lib/freevars.mli b/compiler/lib/freevars.mli index 95a2a4fdb..ef07c7540 100644 --- a/compiler/lib/freevars.mli +++ b/compiler/lib/freevars.mli @@ -29,4 +29,6 @@ val iter_last_free_var : (Code.Var.t -> unit) -> Code.last -> unit val find_loops_in_closure : Code.program -> Code.Addr.t -> Code.Addr.t Code.Addr.Map.t +val f_mutable : Code.program -> Code.Var.Set.t Code.Addr.Map.t + val f : Code.program -> Code.Var.Set.t Code.Addr.Map.t diff --git a/compiler/lib/generate.ml b/compiler/lib/generate.ml index 16ff54a5e..15b239d75 100644 --- a/compiler/lib/generate.ml +++ b/compiler/lib/generate.ml @@ -18,21 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -(*XXX - Patterns: - => loops should avoid absorbing the whole continuation... - (detect when the continuation does not loop anymore and close - the loop at this point) - => should have special code for switches that include the preceding - if statement when possible - => if e1 then {if e2 then P else Q} else {if e3 then P else Q} - => if e then return e1; return e2 - => if e then var x = e1; else var x = e2; - => while (true) {.... if (e) continue; break; } - - - CLEAN UP!!! -*) - open! Stdlib let debug = Debug.find "gen" @@ -47,22 +32,26 @@ module J = Javascript let string_of_set s = String.concat ~sep:", " (List.map ~f:Addr.to_string (Addr.Set.elements s)) -let rec list_group_rec f g l b m n = +let rec list_group_rec ~equal f g l b m n = match l with | [] -> List.rev ((b, List.rev m) :: n) | a :: r -> let fa = f a in - if Poly.(fa = b) - then list_group_rec f g r b (g a :: m) n - else list_group_rec f g r fa [ g a ] ((b, List.rev m) :: n) + if equal fa b + then list_group_rec ~equal f g r b (g a :: m) n + else list_group_rec ~equal f g r fa [ g a ] ((b, List.rev m) :: n) -let list_group f g l = +let list_group ~equal f g l = match l with | [] -> [] - | a :: r -> list_group_rec f g r (f a) [ g a ] [] + | a :: r -> list_group_rec ~equal f g r (f a) [ g a ] [] (****) +type fall_through = + | Block of Addr.t + | Return + type application_description = { arity : int ; exact : bool @@ -281,12 +270,18 @@ module Ctx = struct ; should_export : bool ; effect_warning : bool ref ; trampolined_calls : Effects.trampolined_calls + ; deadcode_sentinal : Var.t + ; mutated_vars : Code.Var.Set.t Code.Addr.Map.t + ; freevars : Code.Var.Set.t Code.Addr.Map.t } let initial ~warn_on_unhandled_effect ~exported_runtime ~should_export + ~deadcode_sentinal + ~mutated_vars + ~freevars blocks live trampolined_calls @@ -300,9 +295,18 @@ module Ctx = struct ; should_export ; effect_warning = ref (not warn_on_unhandled_effect) ; trampolined_calls + ; deadcode_sentinal + ; mutated_vars + ; freevars } end +type edge_kind = + | Loop + | Exit_loop of bool ref + | Exit_switch of bool ref + | Forward + let var x = J.EVar (J.V x) let int n = J.ENum (J.Num.of_int32 (Int32.of_int n)) @@ -437,7 +441,7 @@ let rec constant_rec ~ctx x level instrs = | Float_array a -> ( Mlvalue.Array.make ~tag:Obj.double_array_tag - ~args:(Array.to_list (Array.map a ~f:float_const)) + ~args:(Array.to_list (Array.map a ~f:(fun x -> J.Element (float_const x)))) , instrs ) | Int64 i -> let p = @@ -483,9 +487,9 @@ let rec constant_rec ~ctx x level instrs = let instrs = (J.variable_declaration [ J.V v, (js, J.N) ], J.N) :: instrs in - J.EVar (J.V v) :: acc, instrs - | _ -> js :: acc, instrs) - else List.rev l, instrs + J.Element (J.EVar (J.V v)) :: acc, instrs + | _ -> J.Element js :: acc, instrs) + else List.map ~f:(fun x -> J.Element x) (List.rev l), instrs in Mlvalue.Block.make ~tag ~args:l, instrs) | Int i -> int32 i, instrs @@ -498,7 +502,6 @@ let constant ~ctx x level = type queue_elt = { prop : int - ; cardinal : int ; ce : J.expression ; loc : J.location ; deps : Code.Var.Set.t @@ -507,15 +510,15 @@ type queue_elt = let access_queue queue x = try let elt = List.assoc x queue in - if elt.cardinal = 1 - then ((elt.prop, elt.deps), elt.ce), List.remove_assoc x queue - else - ( ((elt.prop, elt.deps), elt.ce) - , List.map queue ~f:(function - | x', elt when Var.equal x x' -> x', { elt with cardinal = pred elt.cardinal } - | x -> x) ) + ((elt.prop, elt.deps), elt.ce), List.remove_assoc x queue with Not_found -> ((fst const_p, Code.Var.Set.singleton x), var x), queue +let access_queue_loc queue x = + try + let elt = List.assoc x queue in + ((elt.prop, elt.deps), elt.ce, elt.loc), List.remove_assoc x queue + with Not_found -> ((fst const_p, Code.Var.Set.singleton x), var x, J.N), queue + let access_queue' ~ctx queue x = match x with | Pc c -> @@ -525,22 +528,6 @@ let access_queue' ~ctx queue x = (const_p, js), queue | Pv x -> access_queue queue x -let access_queue_may_flush queue v x = - let tx, queue = access_queue queue x in - let _, instrs, queue = - List.fold_left - queue - ~init:(Code.Var.Set.singleton v, [], []) - ~f:(fun (deps, instrs, queue) ((y, elt) as eq) -> - if not (Code.Var.Set.disjoint deps elt.deps) - then - ( Code.Var.Set.add y deps - , (J.variable_declaration [ J.V y, (elt.ce, elt.loc) ], elt.loc) :: instrs - , queue ) - else deps, instrs, eq :: queue) - in - instrs, (tx, List.rev queue) - let should_flush (cond, _) prop = cond <> fst const_p && cond + prop >= fst flush_p let flush_queue expr_queue prop (l : J.statement_list) = @@ -557,97 +544,26 @@ let flush_queue expr_queue prop (l : J.statement_list) = let flush_all expr_queue l = fst (flush_queue expr_queue flush_p l) -let enqueue expr_queue prop x ce loc cardinal acc = +let enqueue expr_queue prop x ce loc acc = let instrs, expr_queue = if Config.Flag.compact () - then if is_mutable prop then flush_queue expr_queue prop [] else [], expr_queue - else flush_queue expr_queue flush_p [] + then if is_mutable prop then flush_queue expr_queue prop acc else acc, expr_queue + else flush_queue expr_queue flush_p acc in let prop, deps = prop in - let deps = - List.fold_left expr_queue ~init:deps ~f:(fun deps (x', elt) -> - if Code.Var.Set.mem x' deps then Code.Var.Set.union elt.deps deps else deps) - in - instrs @ acc, (x, { prop; deps; ce; loc; cardinal }) :: expr_queue + instrs, (x, { prop; deps; ce; loc }) :: expr_queue (****) -module Interm : sig - type elt = - { pc : Addr.t - ; var : Var.t - ; value : int - ; default : bool - } - - type t - - val empty : t - - val mem : Addr.t -> t -> bool - - val find : Addr.t -> t -> elt - - val add : t -> idx:Addr.t -> var:Var.t -> (Addr.t * int * bool) list -> t - - val resolve_nodes : t -> Addr.Set.t -> Addr.Set.t -end = struct - type elt = - { pc : Addr.t - ; var : Var.t - ; value : int - ; default : bool - } - - type t = elt Addr.Map.t - - let empty = Addr.Map.empty - - let mem pc t = Addr.Map.mem pc t - - let find pc t = Addr.Map.find pc t - - let add t ~idx ~var members = - List.fold_left members ~init:t ~f:(fun acc (pc, value, default) -> - Addr.Map.add pc { pc = idx; var; value; default } acc) - - let rec resolve_node interm pc = - try - let int = find pc interm in - resolve_node interm int.pc - with Not_found -> pc - - let resolve_nodes interm s = - Addr.Set.fold (fun pc s' -> Addr.Set.add (resolve_node interm pc) s') s Addr.Set.empty -end - type state = - { succs : - (Addr.t, int list) Hashtbl.t (* List of forward successors for a given block *) - ; backs : (Addr.t, Addr.Set.t) Hashtbl.t (* Set of back edges for a given block *) - ; preds : (Addr.t, int) Hashtbl.t (* Number of predecessors for a given block *) - ; seen : (Addr.t, int) Hashtbl.t - (* For blocks that are member of a frontier, it's the number of predecessor already compiled *) - ; loops : Addr.Set.t - (* Set of blocks that are start a loop / have incoming back edges *) + { structure : Structure.t + ; dom : Structure.graph ; visited_blocks : Addr.Set.t ref - ; dominance_frontier_cache : (Addr.t, int Addr.Map.t) Hashtbl.t - (* dominance_frontier of a block. The frontier is a map containing number of edges to each member of the frontier. *) - ; last_interm_idx : int ref ; ctx : Ctx.t - ; blocks : Code.block Addr.Map.t } -let get_preds st pc = Hashtbl.find st.preds pc - -let get_succs st pc = Hashtbl.find st.succs pc - -let get_seen st pc = try Hashtbl.find st.seen pc with Not_found -> 0 - -let incr_seen st pc = Hashtbl.replace st.seen pc (get_seen st pc + 1) - module DTree = struct - (* This as to be kept in sync with the way we build conditionals + (* This has to be kept in sync with the way we build conditionals and switches! *) type cond = @@ -656,29 +572,30 @@ module DTree = struct | CLt of int32 | CLe of int32 + type 'a branch = int list * 'a + type 'a t = | If of cond * 'a t * 'a t - | Switch of (int list * 'a t) array - | Branch of 'a - | Empty + | Switch of 'a branch array + | Branch of 'a branch let normalize a = a |> Array.to_list |> List.sort ~cmp:(fun (cont1, _) (cont2, _) -> Poly.compare cont1 cont2) - |> list_group fst snd + |> list_group ~equal:Poly.equal fst snd |> List.map ~f:(fun (cont1, l1) -> cont1, List.flatten l1) |> List.sort ~cmp:(fun (_, l1) (_, l2) -> compare (List.length l1) (List.length l2)) |> Array.of_list - let build_if b1 b2 = If (IsTrue, Branch b1, Branch b2) + let build_if b1 b2 = If (IsTrue, Branch ([ 1 ], b1), Branch ([ 0 ], b2)) - let build_switch (a : cont array) : 'a t = + let build_switch (a : cont array) : cont t = let m = Config.Param.switch_max_case () in let ai = Array.mapi a ~f:(fun i x -> x, i) in (* group the contiguous cases with the same continuation *) let ai : (Code.cont * int list) array = - Array.of_list (list_group fst snd (Array.to_list ai)) + Array.of_list (list_group ~equal:Poly.equal fst snd (Array.to_list ai)) in let rec loop low up = let array_norm : (Code.cont * int list) array = @@ -686,15 +603,15 @@ module DTree = struct in let array_len = Array.length array_norm in if array_len = 1 (* remaining cases all jump to the same branch *) - then Branch (fst array_norm.(0)) + then Branch (snd array_norm.(0), fst array_norm.(0)) else try (* try to optimize when there are only 2 branch *) match array_norm with - | [| (b1, [ i1 ]); (b2, _l2) |] -> - If (CEq (Int32.of_int i1), Branch b1, Branch b2) - | [| (b1, _l1); (b2, [ i2 ]) |] -> - If (CEq (Int32.of_int i2), Branch b2, Branch b1) + | [| (b1, ([ i1 ] as l1)); (b2, l2) |] -> + If (CEq (Int32.of_int i1), Branch (l1, b1), Branch (l2, b2)) + | [| (b1, l1); (b2, ([ i2 ] as l2)) |] -> + If (CEq (Int32.of_int i2), Branch (l2, b2), Branch (l1, b1)) | [| (b1, l1); (b2, l2) |] -> let bound l1 = match l1, List.rev l1 with @@ -704,9 +621,9 @@ module DTree = struct let min1, max1 = bound l1 in let min2, max2 = bound l2 in if max1 < min2 - then If (CLt (Int32.of_int max1), Branch b2, Branch b1) + then If (CLt (Int32.of_int max1), Branch (l2, b2), Branch (l1, b1)) else if max2 < min1 - then If (CLt (Int32.of_int max2), Branch b1, Branch b2) + then If (CLt (Int32.of_int max2), Branch (l1, b1), Branch (l2, b2)) else raise Not_found | _ -> raise Not_found with Not_found -> ( @@ -717,7 +634,7 @@ module DTree = struct nbcases := !nbcases + List.length (snd array_norm.(i)) done; if !nbcases <= m - then Switch (Array.map array_norm ~f:(fun (x, l) -> l, Branch x)) + then Switch (Array.map array_norm ~f:(fun (x, l) -> l, x)) else let h = (up + low) / 2 in let b1 = loop low h and b2 = loop (succ h) up in @@ -727,176 +644,43 @@ module DTree = struct | _, lower_bound2 :: _ -> If (CLe (Int32.of_int lower_bound2), b2, b1)) in let len = Array.length ai in - if len = 0 then Empty else loop 0 (len - 1) - - let rec fold_cont f b acc = - match b with - | If (_, b1, b2) -> - let acc = fold_cont f b1 acc in - let acc = fold_cont f b2 acc in - acc - | Switch a -> Array.fold_left a ~init:acc ~f:(fun acc (_, b) -> fold_cont f b acc) - | Branch (pc, _) -> f pc acc - | Empty -> acc + assert (len > 0); + loop 0 (len - 1) + + let nbbranch (a : cont t) pc = + let rec loop c : cont t -> int = function + | Branch (_, (pc', _)) -> if pc' = pc then succ c else c + | If (_, a, b) -> + let c = loop c a in + let c = loop c b in + c + | Switch a -> + Array.fold_left a ~init:c ~f:(fun acc (_, (pc', _)) -> + if pc' = pc then succ acc else acc) + in + loop 0 a let nbcomp a = let rec loop c = function - | Empty -> c | Branch _ -> c | If (_, a, b) -> let c = succ c in let c = loop c a in let c = loop c b in c - | Switch a -> + | Switch _ -> let c = succ c in - Array.fold_left a ~init:c ~f:(fun acc (_, b) -> loop acc b) + c in + loop 0 a end -let fold_children blocks pc f accu = - let block = Addr.Map.find pc blocks in - match fst block.branch with - | Return _ | Raise _ | Stop -> accu - | Branch (pc', _) | Poptrap (pc', _) -> f pc' accu - | Pushtrap ((pc1, _), _, (pc2, _)) -> - let accu = f pc1 accu in - let accu = f pc2 accu in - accu - | Cond (_, cont1, cont2) -> DTree.fold_cont f (DTree.build_if cont1 cont2) accu - | Switch (_, a1) -> - let a1 = DTree.build_switch a1 in - let accu = DTree.fold_cont f a1 accu in - accu - let build_graph ctx pc = let visited_blocks = ref Addr.Set.empty in - let loops = ref Addr.Set.empty in - let succs = Hashtbl.create 17 in - let poptrap = Hashtbl.create 17 in - let backs = Hashtbl.create 17 in - let preds = Hashtbl.create 17 in - let seen = Hashtbl.create 17 in - let blocks = ctx.Ctx.blocks in - let dominance_frontier_cache = Hashtbl.create 17 in - let incr_prec pc = - match Hashtbl.find preds pc with - | exception Not_found -> Hashtbl.add preds pc 1 - | n -> Hashtbl.replace preds pc (succ n) - in - let add_cf_frontier pc front = - let prev = Hashtbl.find succs pc in - Addr.Set.iter incr_prec front; - Hashtbl.replace succs pc (Addr.Set.elements front @ prev) - in - let rec loop pc anc pushtrap = - if not (Addr.Set.mem pc !visited_blocks) - then ( - visited_blocks := Addr.Set.add pc !visited_blocks; - let anc = Addr.Set.add pc anc in - let s = Code.fold_children blocks pc Addr.Set.add Addr.Set.empty in - let pc_backs = Addr.Set.inter s anc in - Hashtbl.add backs pc pc_backs; - let s = fold_children blocks pc (fun x l -> x :: l) [] in - let pc_succs = List.filter s ~f:(fun pc -> not (Addr.Set.mem pc anc)) in - let b = Addr.Map.find pc blocks in - Hashtbl.add succs pc pc_succs; - Addr.Set.iter (fun pc' -> loops := Addr.Set.add pc' !loops) pc_backs; - List.iter pc_succs ~f:(fun pc' -> - let pushtrap = - match fst b.branch with - | Pushtrap ((pc1, _), _, (pc2, _)) -> - if pc' = pc1 - then ( - Hashtbl.add poptrap pc Addr.Set.empty; - pc :: pushtrap) - else ( - assert (pc' = pc2); - pushtrap) - | Poptrap (pc1, _) -> ( - match pushtrap with - | [] -> assert false - | p :: rest -> - let old = Hashtbl.find poptrap p in - Hashtbl.replace poptrap p (Addr.Set.add pc1 old); - rest) - | _ -> pushtrap - in - loop pc' anc pushtrap); - List.iter pc_succs ~f:incr_prec) - in - loop pc Addr.Set.empty []; - Hashtbl.add preds pc 1; - let () = - (* Create an artificial frontier when we pop an exception handler *) - let rec keep_front pc = - if Hashtbl.find preds pc > 1 - then (* already part of a merge node *) false - else - match Addr.Map.find pc blocks with - | { body = []; branch = Return _, _; _ } -> false - | { body = []; branch = Stop, _; _ } -> false - | { body = []; branch = Branch (pc', _), _; _ } -> keep_front pc' - | _ -> true - in - Hashtbl.iter - (fun pc_pushtrap pc3 -> - let pc3 = Addr.Set.filter keep_front pc3 in - add_cf_frontier pc_pushtrap pc3) - poptrap - in - { visited_blocks - ; dominance_frontier_cache - ; seen - ; loops = !loops - ; succs - ; backs - ; preds - ; last_interm_idx = ref (-1) - ; ctx - ; blocks - } - -let rec frontier_of_pc st pc = - match Hashtbl.find st.dominance_frontier_cache pc with - | d -> d - | exception Not_found -> - let visited = frontier_of_succs st (get_succs st pc) in - Hashtbl.add st.dominance_frontier_cache pc visited; - visited - -and frontier_of_succs st succs = - let visited = ref Addr.Map.empty in - let q = Queue.create () in - let incr pc n = Queue.add (Addr.Map.singleton pc n) q in - List.iter succs ~f:(fun pc -> incr pc 1); - while not (Queue.is_empty q) do - visited := - Addr.Map.merge - (fun k a b -> - let sum = Option.value ~default:0 a + Option.value ~default:0 b in - if get_preds st k = sum - then ( - Queue.add (frontier_of_pc st k) q; - None) - else Some sum) - !visited - (Queue.take q) - done; - !visited - -(* [seen] can be used to specify how many predecessor have been - handled already. It is used when compiling merge_nodes. *) -let dominance_frontier ?(seen = 1) st pc = - let pred = get_preds st pc in - assert (pred >= seen); - if pred > seen - then Addr.Set.singleton pc - else - (* pred = seen *) - let grey = frontier_of_pc st pc in - Addr.Map.fold (fun k _ acc -> Addr.Set.add k acc) grey Addr.Set.empty + let structure = Structure.build_graph ctx.Ctx.blocks pc in + let dom = Structure.dominator_tree structure in + { visited_blocks; structure; dom; ctx } (****) @@ -933,22 +717,64 @@ let visit_all params args = in l -let parallel_renaming params args continuation queue = - let l = List.rev (visit_all params args) in - List.fold_left - l - ~f:(fun continuation (y, x) queue -> - let instrs, ((px, cx), queue) = access_queue_may_flush queue y x in - let st, queue = - flush_queue - queue - px - (instrs @ [ J.variable_declaration [ J.V y, (cx, J.N) ], J.N ]) - in - let never, code = continuation queue in - never, st @ code) - ~init:continuation - queue +let parallel_renaming back_edge params args continuation queue = + if back_edge && Config.Flag.es6 () + (* This is likely slower than using explicit temp variable + but let's experiment with es6 a bit *) + then + let args, params = + List.map2 args params ~f:(fun a p -> if Var.equal a p then None else Some (a, p)) + |> List.filter_map ~f:(fun x -> x) + |> List.split + in + let args, _, queue = + List.fold_left args ~init:([], const_p, queue) ~f:(fun (acc, p, queue) a -> + let (px, cx), queue = access_queue queue a in + cx :: acc, or_p px p, queue) + in + let never, code = continuation queue in + match params, args with + | [ p ], [ a ] -> + never, (J.Expression_statement (J.EBin (J.Eq, J.EVar (J.V p), a)), J.N) :: code + | params, args -> + let lhs = + J.EAssignTarget + (J.ArrayTarget (List.map params ~f:(fun p -> J.TargetElementId (J.V p, None)))) + in + let rhs = J.EArr (List.rev_map args ~f:(fun x -> J.Element x)) in + never, (J.Expression_statement (J.EBin (J.Eq, lhs, rhs)), J.N) :: code + else + let l = visit_all params args in + (* if not back_edge + * then assert (Poly.( = ) l (List.rev_map2 params args ~f:(fun a b -> a, b))); *) + let queue, before, renaming, _ = + List.fold_left + l + ~init:(queue, [], [], Code.Var.Set.empty) + ~f:(fun (queue, before, renaming, seen) (y, x) -> + let ((_, deps_x), cx, locx), queue = access_queue_loc queue x in + let seen' = Code.Var.Set.add y seen in + if not Code.Var.Set.(is_empty (inter seen deps_x)) + then + let () = assert back_edge in + let before = (J.variable_declaration [ J.V x, (cx, locx) ], locx) :: before in + let renaming = (y, J.EVar (J.V x)) :: renaming in + queue, before, renaming, seen' + else + let renaming = (y, cx) :: renaming in + queue, before, renaming, seen') + in + let renaming = + if back_edge + then + List.map renaming ~f:(fun (t, e) -> + J.Expression_statement (J.EBin (J.Eq, J.EVar (J.V t), e)), J.N) + else + List.map renaming ~f:(fun (t, e) -> + J.variable_declaration [ J.V t, (e, J.N) ], J.N) + in + let never, code = continuation queue in + never, List.rev_append before (List.rev_append renaming code) (****) @@ -958,8 +784,7 @@ let apply_fun_raw ctx f params exact trampolined = (* Make sure we are performing a regular call, not a (slower) method call *) match f with - | J.EAccess _ | J.EDot _ -> - J.call (J.dot f (Utf8_string.of_string_exn "call")) (s_var "null" :: params) J.N + | J.EAccess _ | J.EDot _ -> J.call (J.ESeq (int 0, f)) params J.N | _ -> J.call f params J.N in let apply = @@ -1107,8 +932,16 @@ let _ = register_un_prim "%direct_obj_tag" `Mutator (fun cx _loc -> Mlvalue.Block.tag cx); register_bin_prim "caml_array_unsafe_get" `Mutable (fun cx cy _ -> Mlvalue.Array.field cx cy); - register_bin_prim "%int_add" `Pure (fun cx cy _ -> to_int (plus_int cx cy)); - register_bin_prim "%int_sub" `Pure (fun cx cy _ -> to_int (J.EBin (J.Minus, cx, cy))); + register_bin_prim "%int_add" `Pure (fun cx cy _ -> + match cx, cy with + | J.EBin (J.Minus, cz, J.ENum n), J.ENum m -> + to_int (J.EBin (J.Plus, cz, J.ENum (J.Num.add m (J.Num.neg n)))) + | _ -> to_int (plus_int cx cy)); + register_bin_prim "%int_sub" `Pure (fun cx cy _ -> + match cx, cy with + | J.EBin (J.Minus, cz, J.ENum n), J.ENum m -> + to_int (J.EBin (J.Minus, cz, J.ENum (J.Num.add n m))) + | _ -> to_int (J.EBin (J.Minus, cx, cy))); register_bin_prim "%direct_int_mul" `Pure (fun cx cy _ -> to_int (J.EBin (J.Mul, cx, cy))); register_bin_prim "%direct_int_div" `Pure (fun cx cy _ -> @@ -1174,17 +1007,6 @@ let _ = bool (J.EBin (J.InstanceOf, cx, cy))); register_un_prim "caml_js_typeof" `Mutator (fun cx _ -> J.EUn (J.Typeof, cx)) -(* This is not correct when switching the js-string flag *) -(* {[ - register_un_prim "caml_jsstring_of_string" `Mutable (fun cx loc -> - J.ECall (J.EDot (cx, "toString"), [], loc)); - register_bin_prim "caml_string_notequal" `Pure (fun cx cy _ -> - J.EBin (J.NotEqEq, cx, cy)); - register_bin_prim "caml_string_equal" `Pure (fun cx cy _ -> - bool (J.EBin (J.EqEq, cx, cy))) - ]} -*) - (****) (* when raising ocaml exception and [improved_stacktrace] is enabled, tag the ocaml exception with a Javascript error (that contain js stacktrace). @@ -1230,6 +1052,14 @@ let rec translate_expr ctx queue loc x e level : _ * J.statement_list = List.fold_right ~f:(fun x (args, prop, queue) -> let (prop', cx), queue = access_queue queue x in + let cx = + match cx with + | J.EVar (J.V v) -> + if Var.equal v ctx.deadcode_sentinal + then J.ElementHole + else J.Element cx + | _ -> J.Element cx + in cx :: args, or_p prop prop', queue) (Array.to_list a) ~init:([], const_p, queue) @@ -1245,6 +1075,7 @@ let rec translate_expr ctx queue loc x e level : _ * J.statement_list = (Mlvalue.Block.field cx n, or_p px mutable_p, queue), [] | Closure (args, ((pc, _) as cont)) -> let loc = source_location_ctx ctx ~force:After (After pc) in + let fv = Addr.Map.find pc ctx.freevars in let clo = compile_closure ctx cont in let clo = match clo with @@ -1260,7 +1091,7 @@ let rec translate_expr ctx queue loc x e level : _ * J.statement_list = | _ -> clo in let clo = J.EFun (None, J.fun_ (List.map args ~f:(fun v -> J.V v)) clo loc) in - (clo, flush_p, queue), [] + (clo, (fst const_p, fv), queue), [] | Constant c -> let js, instrs = constant ~ctx c level in (js, const_p, queue), instrs @@ -1389,9 +1220,9 @@ let rec translate_expr ctx queue loc x e level : _ * J.statement_list = -> let (po, co), queue = access_queue queue o in J.EUn (J.Delete, J.dot co f), or_p po mutator_p, queue - (* + (* This is only useful for debugging: - {[ + {[ | Extern "caml_js_get", [ _; Pc (String _) ] -> assert false | Extern "caml_js_set", [ _; Pc (String s); _ ] -> assert false | Extern "caml_js_delete", [ _; Pc (String _) ] -> assert false @@ -1442,6 +1273,26 @@ let rec translate_expr ctx queue loc x e level : _ * J.statement_list = let prim = Share.get_prim (runtime_fun ctx) name ctx.Ctx.share in let prim_kind = kind (Primitive.kind name) in J.call prim [] loc, prim_kind, queue + | Extern "caml_string_notequal", [ a; b ] when Config.Flag.use_js_string () -> + let (px, cx), queue = access_queue' ~ctx queue a in + let (py, cy), queue = access_queue' ~ctx queue b in + let prop = or_p px py in + bool (J.EBin (J.NotEqEq, cx, cy)), prop, queue + | Extern "caml_string_equal", [ a; b ] when Config.Flag.use_js_string () -> + let (px, cx), queue = access_queue' ~ctx queue a in + let (py, cy), queue = access_queue' ~ctx queue b in + let prop = or_p px py in + bool (J.EBin (J.EqEq, cx, cy)), prop, queue + | Extern "caml_string_concat", [ a; b ] when Config.Flag.use_js_string () -> + let (pa, ca), queue = access_queue' ~ctx queue a in + let (pb, cb), queue = access_queue' ~ctx queue b in + let prop = or_p pa pb in + let rec add ca cb = + match cb with + | J.EBin (J.Plus, cb1, cb2) -> J.EBin (J.Plus, add ca cb1, cb2) + | _ -> J.EBin (J.Plus, ca, cb) + in + add ca cb, prop, queue | Extern name, l -> ( let name = Primitive.resolve name in match internal_prim name with @@ -1507,11 +1358,12 @@ and translate_instr ctx expr_queue instr = let keep_name x = match Code.Var.get_name x with | None -> false - (* "switcher" is emitted by the OCaml compiler when compiling - pattern matching, it does not help much to keep it in the - generated js, let's drop it *) | Some "" -> false - | Some s -> (not (generated_name s)) && not (String.is_prefix s ~prefix:"jsoo_") + | Some s -> + (* "switcher" is emitted by the OCaml compiler when compiling + pattern matching, it does not help much to keep it in the + generated js, let's drop it *) + (not (generated_name s)) && not (String.is_prefix s ~prefix:"jsoo_") in match ctx.Ctx.live.(Var.idx x), e with | 0, _ -> @@ -1519,14 +1371,8 @@ and translate_instr ctx expr_queue instr = flush_queue expr_queue prop (instrs @ [ J.Expression_statement ce, loc ]) | 1, _ when Config.Flag.compact () && ((not (Config.Flag.pretty ())) || not (keep_name x)) - -> enqueue expr_queue prop x ce loc 1 instrs - (* We could inline more. - size_v : length of the variable after serialization - size_c : length of the constant after serialization - num : number of occurrence - size_c * n < size_v * n + size_v + 1 + size_c - *) - | n, Constant (Int _ | Float _) -> enqueue expr_queue prop x ce loc n instrs + -> enqueue expr_queue prop x ce loc instrs + | 1, Constant (Int _ | Float _) -> enqueue expr_queue prop x ce loc instrs | _ -> flush_queue expr_queue @@ -1540,23 +1386,19 @@ and translate_instr ctx expr_queue instr = expr_queue mutator_p [ J.Expression_statement (J.EBin (J.Eq, Mlvalue.Block.field cx n, cy)), loc ] - | Offset_ref (x, 1) -> - let loc = source_location_ctx ctx pc in - (* FIX: may overflow.. *) - let (_px, cx), expr_queue = access_queue expr_queue x in - flush_queue - expr_queue - mutator_p - [ J.Expression_statement (J.EUn (J.IncrA, Mlvalue.Block.field cx 0)), loc ] | Offset_ref (x, n) -> let loc = source_location_ctx ctx pc in (* FIX: may overflow.. *) let (_px, cx), expr_queue = access_queue expr_queue x in - flush_queue - expr_queue - mutator_p - [ J.Expression_statement (J.EBin (J.PlusEq, Mlvalue.Block.field cx 0, int n)), loc - ] + let expr = Mlvalue.Block.field cx 0 in + let expr' = + match n with + | 1 -> J.EUn (J.IncrA, expr) + | -1 -> J.EUn (J.DecrA, expr) + | n when n < 0 (* *) -> J.EBin (J.MinusEq, expr, int (-n)) + | n (* n > 0 *) -> J.EBin (J.PlusEq, expr, int n) + in + flush_queue expr_queue mutator_p [ J.Expression_statement expr', loc ] | Array_set (x, y, z) -> let loc = source_location_ctx ctx pc in let (_px, cx), expr_queue = access_queue expr_queue x in @@ -1567,54 +1409,159 @@ and translate_instr ctx expr_queue instr = mutator_p [ J.Expression_statement (J.EBin (J.Eq, Mlvalue.Array.field cx cy, cz)), loc ] -and translate_instrs ctx expr_queue instr last = - match instr with - | [] -> [], expr_queue +and translate_instrs_rev (ctx : Ctx.t) expr_queue instrs acc_rev muts_map : _ * _ = + match instrs with + | [] -> acc_rev, expr_queue + | (Let (_, Closure _), _) :: _ -> + let names, pcs, all, rem = collect_closures instrs in + let fvs = + List.fold_left pcs ~init:Code.Var.Set.empty ~f:(fun acc pc -> + Code.Var.Set.union acc (Addr.Map.find pc ctx.freevars)) + in + let muts = + List.fold_left pcs ~init:Code.Var.Set.empty ~f:(fun acc pc -> + Code.Var.Set.union acc (Code.Addr.Map.find pc ctx.Ctx.mutated_vars)) + in + let names = + List.fold_left names ~init:Code.Var.Set.empty ~f:(fun acc name -> + Code.Var.Set.add name acc) + in + assert (Code.Var.Set.cardinal names = List.length all); + assert (Code.Var.Set.(is_empty (diff muts fvs))); + let old_muts_map = muts_map in + let muts_map_l = + Code.Var.Set.elements muts + |> List.map ~f:(fun x -> + ( x + , match Code.Var.Map.find_opt x old_muts_map with + | None -> Code.Var.fork x + | Some x' -> x' )) + in + let muts_map = + List.fold_left muts_map_l ~init:old_muts_map ~f:(fun acc (x, x') -> + Var.Map.add x x' acc) + in + (* Rewrite blocks using well-scoped closure variables *) + let ctx = + if List.is_empty muts_map_l + then ctx + else + let subst = Subst.from_map muts_map in + let p, _visited = + List.fold_left + pcs + ~init:(ctx.blocks, Addr.Set.empty) + ~f:(fun (blocks, visited) pc -> Subst.cont' subst pc blocks visited) + in + { ctx with blocks = p } + in + let vd kind = function + | [] -> [] + | l -> [ J.variable_declaration ~kind (List.rev l), J.N ] + in + (* flush variables part of closures env from the queue *) + let bind_fvs, bind_fvs_muts, expr_queue = + let expr_queue, vars, lets = + Code.Var.Set.fold + (fun v (expr_queue, vars, lets) -> + assert (not (Code.Var.Set.mem v names)); + let (px, cx, locx), expr_queue = access_queue_loc expr_queue v in + let flushed = Code.Var.Set.(equal (snd px) (singleton v)) in + match + ( flushed + , Code.Var.Map.find_opt v muts_map + , Code.Var.Map.find_opt v old_muts_map ) + with + | true, None, _ -> expr_queue, vars, lets + | (true | false), Some _, Some _ -> expr_queue, vars, lets + | (true | false), Some v', None -> + let lets = (J.V v', (cx, locx)) :: lets in + expr_queue, vars, lets + | false, None, _ -> + let vars = (J.V v, (cx, locx)) :: vars in + expr_queue, vars, lets) + (Code.Var.Set.diff fvs names) + (expr_queue, [], []) + in + vars, lets, expr_queue + in + (* Mutually recursive functions need to be properly scoped. *) + let bind_fvs_rec, funs_rev, expr_queue = + List.fold_left + all + ~init:([], [], expr_queue) + ~f:(fun (mut_rec, st_rev, expr_queue) i -> + let x' = + match i with + | Let (x', _), _ -> x' + | _ -> assert false + in + let l, expr_queue = translate_instr ctx expr_queue i in + if Code.Var.Set.mem x' fvs + then + let mut_rec = + match Code.Var.Map.find_opt x' muts_map with + | None -> mut_rec + | Some v' -> (J.V v', (J.EVar (J.V x'), J.N)) :: mut_rec + in + match l with + | [ i ] -> mut_rec, i :: st_rev, expr_queue + | [] -> + let (_px, cx, locx), expr_queue = access_queue_loc expr_queue x' in + ( mut_rec + , (J.variable_declaration [ J.V x', (cx, locx) ], locx) :: st_rev + , expr_queue ) + | _ :: _ :: _ -> assert false + else mut_rec, List.rev_append l st_rev, expr_queue) + in + let acc_rev = vd Var bind_fvs @ acc_rev in + let acc_rev = vd Let bind_fvs_muts @ acc_rev in + let acc_rev = funs_rev @ acc_rev in + let acc_rev = vd Let bind_fvs_rec @ acc_rev in + translate_instrs_rev ctx expr_queue rem acc_rev muts_map | instr :: rem -> let st, expr_queue = translate_instr ctx expr_queue instr in - let instrs, expr_queue = translate_instrs ctx expr_queue rem last in - st @ instrs, expr_queue + let acc_rev = List.rev_append st acc_rev in + translate_instrs_rev ctx expr_queue rem acc_rev muts_map + +and translate_instrs (ctx : Ctx.t) expr_queue instrs = + let st_rev, expr_queue = + translate_instrs_rev (ctx : Ctx.t) expr_queue instrs [] Var.Map.empty + in + List.rev st_rev, expr_queue (* Compile loops. *) -and compile_block st queue (pc : Addr.t) loop_stack frontier interm = +and compile_block st queue (pc : Addr.t) scope_stack ~fall_through = if (not (List.is_empty queue)) - && (Addr.Set.mem pc st.loops || not (Config.Flag.inline ())) + && (Structure.is_loop_header st.structure pc + || (* Do not inline expressions across block boundaries when --no-inline is used + Single-stepping in the debugger should work better this way (fixes #290). *) + not (Config.Flag.inline ())) then - let never, code = compile_block st [] pc loop_stack frontier interm in + let never, code = compile_block st [] pc scope_stack ~fall_through in never, flush_all queue code else - match Addr.Set.mem pc st.loops with - | false -> compile_block_no_loop st queue pc loop_stack frontier interm + match Structure.is_loop_header st.structure pc with + | false -> compile_block_no_loop st queue pc scope_stack ~fall_through | true -> if debug () then Format.eprintf "@[for(;;) {@,"; let never_body, body = let lab = J.Label.fresh () in let lab_used = ref false in - let loop_stack = (pc, (lab, lab_used)) :: loop_stack in - let never_body, body = - compile_block_no_loop st queue pc loop_stack frontier interm + let exit_branch_used = ref false in + let scope_stack = (pc, (lab, lab_used, Loop)) :: scope_stack in + let scope_stack = + match fall_through with + | Block fall_through -> + (fall_through, (lab, lab_used, Exit_loop exit_branch_used)) :: scope_stack + | Return -> scope_stack in - let body = - let rec remove_tailing_continue acc = function - | [] -> body - | [ (J.Continue_statement None, _) ] -> List.rev acc - | x :: xs -> remove_tailing_continue (x :: acc) xs - in - remove_tailing_continue [] body + let never_body, body = + compile_block_no_loop st queue pc scope_stack ~fall_through:(Block pc) in + if debug () then Format.eprintf "}@]@,"; let for_loop = - ( J.For_statement - ( J.Left None - , None - , None - , Js_simpl.block - (if never_body - then ( - if debug () then Format.eprintf "}@]@,"; - body) - else ( - if debug () then Format.eprintf "break;@;}@]@,"; - body @ [ J.Break_statement None, J.N ])) ) + ( J.For_statement (J.Left None, None, None, Js_simpl.block body) , source_location_ctx st.ctx (Code.location_of_pc pc) ) in let label = if !lab_used then Some lab else None in @@ -1623,172 +1570,77 @@ and compile_block st queue (pc : Addr.t) loop_stack frontier interm = | None -> for_loop | Some label -> J.Labelled_statement (label, for_loop), J.N in - never_body, [ for_loop ] + (not !exit_branch_used) && never_body, [ for_loop ] in never_body, body (* Compile block. Loops have already been handled. *) -and compile_block_no_loop st queue (pc : Addr.t) loop_stack frontier interm = +and compile_block_no_loop st queue (pc : Addr.t) ~fall_through scope_stack = if pc < 0 then assert false; if Addr.Set.mem pc !(st.visited_blocks) then ( Format.eprintf "Trying to compile a block twice !!!! %d@." pc; assert false); - let seen = get_seen st pc and pred = get_preds st pc in - if seen > pred - then ( - Format.eprintf "This block has too many incoming edges. !!!! %d@." pc; - assert false); - if seen < pred - then ( - Format.eprintf - "Trying to compile %d, but some (%d) of its predecessors have not been compiled \ - yet. !!!!." - pc - (pred - seen); - assert false); - assert (seen = pred); + if debug () then Format.eprintf "Compiling block %d@;" pc; st.visited_blocks := Addr.Set.add pc !(st.visited_blocks); - if debug () then Format.eprintf "block %d; frontier: %s;@," pc (string_of_set frontier); - let block = Addr.Map.find pc st.blocks in - let seq, queue = translate_instrs st.ctx queue block.body block.branch in - let new_frontier = - List.fold_left - (get_succs st pc) - ~f:(fun acc pc -> - let grey = dominance_frontier st pc in - Addr.Set.union acc grey) - ~init:Addr.Set.empty + let block = Addr.Map.find pc st.ctx.blocks in + let seq, queue = translate_instrs st.ctx queue block.body in + let nbbranch = + match fst block.branch with + | Switch (_, a) -> + (* Build an artifical dtree with the correct layout so that + [Dtree.nbbranch dtree pc] is correct *) + let dtree = DTree.build_switch a in + fun pc -> DTree.nbbranch dtree pc + | Cond (_, a, b) -> + let dtree = DTree.build_if a b in + fun pc -> DTree.nbbranch dtree pc + | _ -> fun _pc -> 0 in - let prefix, frontier_cont, new_interm, merge_node = - colapse_frontier "default" st new_frontier interm + let new_scopes = + Structure.get_edges st.dom pc + |> Addr.Set.elements + |> List.filter ~f:(fun pc' -> + nbbranch pc' >= 2 || Structure.is_merge_node st.structure pc') + |> Structure.sort_in_post_order st.structure in - List.iter (get_succs st pc) ~f:(fun pc -> incr_seen st pc); - (* Beware evaluation order! *) - let never_cond, cond = - compile_conditional - st - queue - block.branch - loop_stack - (Hashtbl.find st.backs pc) - (Addr.Set.union frontier frontier_cont) - new_interm + let rec loop ~scope_stack ~fall_through l = + match l with + | [] -> compile_conditional st queue ~fall_through block.branch scope_stack + | x :: xs -> ( + let l = J.Label.fresh () in + let used = ref false in + let scope_stack = (x, (l, used, Forward)) :: scope_stack in + let _never_inner, inner = loop ~scope_stack ~fall_through:(Block x) xs in + let never, code = compile_block st [] x scope_stack ~fall_through in + match !used with + | true -> never, [ J.Labelled_statement (l, (J.Block inner, J.N)), J.N ] @ code + | false -> never, inner @ code) in - let never_after, after = - compile_merge_node st frontier_cont loop_stack frontier interm merge_node - in - never_cond || never_after, seq @ prefix @ cond @ after - -(* Compile a merge_node if present *) -and compile_merge_node - st - (pc : Addr.Set.t) - loop_stack - (frontier : Addr.Set.t) - interm - merge_node = - assert (Addr.Set.cardinal pc <= 1); - match Addr.Set.choose_opt pc, merge_node with - | None, Some _ -> assert false - | None, None -> (* Nothing to compile *) false, [] - | Some pc, None -> - (* merge node with a one block frontier *) - compile_branch st [] (pc, []) loop_stack Addr.Set.empty frontier interm - | Some _, Some (members, branch) -> - (* merge node *) - let new_frontier = - members - |> List.map ~f:(fun pc -> - let seen = get_seen st pc in - dominance_frontier ~seen st pc) - |> List.fold_left ~init:Addr.Set.empty ~f:Addr.Set.union - in - (* The frontier has to move when compiling a merge node. Fail early instead of infinite recursion. *) - if List.for_all members ~f:(fun pc -> Addr.Set.mem pc new_frontier) - then assert false; - let prefix, frontier_cont, new_interm, merge_node = - colapse_frontier "merge_node" st new_frontier interm - in - let never_cond, cond = - compile_conditional - st - [] - branch - loop_stack - Addr.Set.empty - (Addr.Set.union frontier frontier_cont) - new_interm - in - let never_after, after = - compile_merge_node st frontier_cont loop_stack frontier interm merge_node - in - never_cond || never_after, prefix @ cond @ after - -and colapse_frontier name st (new_frontier' : Addr.Set.t) interm = - let new_frontier = Interm.resolve_nodes interm new_frontier' in - if debug () - then - Format.eprintf - "Resove %s to %s;@," - (string_of_set new_frontier') - (string_of_set new_frontier); - if Addr.Set.cardinal new_frontier <= 1 - then [], new_frontier, interm, None - else - let idx = - decr st.last_interm_idx; - !(st.last_interm_idx) - in - if debug () - then - Format.eprintf - "colapse frontier(%s) into %d: %s@," - name - idx - (string_of_set new_frontier); - let x = Code.Var.fresh_n "switch" in - let a = - Addr.Set.elements new_frontier - |> List.map ~f:(fun pc -> pc, get_preds st pc - get_seen st pc) - |> List.sort ~cmp:(fun (pc1, (c1 : int)) (pc2, (c2 : int)) -> - match compare c2 c1 with - | 0 -> compare pc1 pc2 - | c -> c) - |> List.map ~f:fst - in - if debug () then Format.eprintf "var %a;@," Code.Var.print x; - Hashtbl.add st.succs idx a; - Hashtbl.add st.preds idx (List.length a); - let pc_i = List.mapi a ~f:(fun i pc -> pc, i) in - let default = 0 in - let interm = - Interm.add interm ~idx ~var:x (List.map pc_i ~f:(fun (pc, i) -> pc, i, default = i)) - in - let branch = - let cases = Array.of_list (List.map a ~f:(fun pc -> pc, [])) in - if Array.length cases > 2 - then Code.Switch (x, cases), Code.noloc - else Code.Cond (x, cases.(1), cases.(0)), Code.noloc - in - ( [ J.variable_declaration [ J.V x, (int default, J.N) ], J.N ] - , Addr.Set.singleton idx - , interm - , Some (a, branch) ) + let never_after, after = loop ~scope_stack ~fall_through (List.rev new_scopes) in + never_after, seq @ after -and compile_decision_tree st loop_stack backs frontier interm loc cx dtree = +and compile_decision_tree kind st scope_stack loc cx dtree ~fall_through = (* Some changes here may require corresponding changes in function [DTree.fold_cont] above. *) - let rec loop cx : _ -> bool * _ = function - | DTree.Empty -> assert false - | DTree.Branch cont -> - if debug () then Format.eprintf "@[case {@;"; - let never, code = compile_branch st [] cont loop_stack backs frontier interm in + let rec loop cx scope_stack : _ -> bool * _ = function + | DTree.Branch (l, cont) -> + if debug () + then + Format.eprintf + "@[case %s(%a) {@;" + kind + Format.( + pp_print_list + ~pp_sep:(fun fmt () -> Format.pp_print_string fmt ", ") + (fun fmt pc -> Format.fprintf fmt "%d" pc)) + l; + let never, code = compile_branch st [] cont scope_stack ~fall_through in if debug () then Format.eprintf "}@]@;"; never, code | DTree.If (cond, cont1, cont2) -> - let never1, iftrue = loop cx cont1 in - let never2, iffalse = loop cx cont2 in + let never1, iftrue = loop cx scope_stack cont1 in + let never2, iffalse = loop cx scope_stack cont2 in let e' = match cond with | IsTrue -> cx @@ -1808,25 +1660,48 @@ and compile_decision_tree st loop_stack backs frontier interm loc cx dtree = let all_never = ref true in let len = Array.length a in let last_index = len - 1 in - let arr = - Array.mapi a ~f:(fun i (ints, cont) -> - let never, cont = loop cx cont in - if not never then all_never := false; - let cont = - if never || (* default case *) i = last_index - then cont - else cont @ [ J.Break_statement None, J.N ] - in - ints, cont) + let lab = J.Label.fresh () in + let label_used = ref false in + let exit_branch_used = ref false in + let scope_stack = + match fall_through with + | Block fall_through -> + (fall_through, (lab, label_used, Exit_switch exit_branch_used)) + :: scope_stack + | Return -> scope_stack in - let _, last = arr.(last_index) in - let l = Array.to_list (Array.sub arr ~pos:0 ~len:(len - 1)) in - let l = - List.flatten - (List.map l ~f:(fun (ints, br) -> - List.map_last ~f:(fun last i -> int i, if last then br else []) ints)) + let last = + let case = a.(last_index) in + let never, code = loop cx scope_stack (Branch case) in + if not never then all_never := false; + code in - !all_never, [ J.Switch_statement (cx, l, Some last, []), loc ] + let rec loop_cases pos acc = + let ((ints, _cont) as case) = a.(pos) in + let never, code = loop cx scope_stack (Branch case) in + if not never then all_never := false; + let _, acc = + List.fold_right ints ~init:(true, acc) ~f:(fun i (first, acc) -> + ( false + , ( int i + , if first + then if not never then code @ [ Break_statement None, J.N ] else code + else [] ) + :: acc )) + in + if pos = 0 then acc else loop_cases (pred pos) acc + in + let l = loop_cases (last_index - 1) [] in + let code = + if !label_used + then + [ ( J.Labelled_statement + (lab, (J.Switch_statement (cx, l, Some last, []), loc)) + , loc ) + ] + else [ J.Switch_statement (cx, l, Some last, []), loc ] + in + (not !exit_branch_used) && !all_never, code in let cx, binds = match cx with @@ -1835,10 +1710,10 @@ and compile_decision_tree st loop_stack backs frontier interm loc cx dtree = let v = J.V (Code.Var.fresh ()) in J.EVar v, [ J.variable_declaration [ v, (cx, J.N) ], J.N ] in - let never, code = loop cx dtree in + let never, code = loop cx scope_stack dtree in never, binds @ code -and compile_conditional st queue last loop_stack backs frontier interm = +and compile_conditional st queue ~fall_through last scope_stack : _ * _ = let last, pc = last in (if debug () then @@ -1855,7 +1730,10 @@ and compile_conditional st queue last loop_stack backs frontier interm = match last with | Return x -> let (_px, cx), queue = access_queue queue x in - true, flush_all queue [ J.Return_statement (Some cx), loc ] + let return_expr = + if Var.equal st.ctx.deadcode_sentinal x then None else Some cx + in + true, flush_all queue [ J.Return_statement return_expr, loc ] | Raise (x, k) -> let (_px, cx), queue = access_queue queue x in true, flush_all queue (throw_statement st.ctx cx k loc) @@ -1864,13 +1742,11 @@ and compile_conditional st queue last loop_stack backs frontier interm = if st.ctx.Ctx.should_export then Some (s_var Global_constant.exports) else None in true, flush_all queue [ J.Return_statement e_opt, loc ] - | Branch cont -> compile_branch st queue cont loop_stack backs frontier interm + | Branch cont -> compile_branch st queue cont scope_stack ~fall_through | Pushtrap (c1, x, e1) -> - let never_body, body = compile_branch st [] c1 loop_stack backs frontier interm in + let never_body, body = compile_branch st [] c1 scope_stack ~fall_through in if debug () then Format.eprintf "@,}@]@,@[catch {@;"; - let never_handler, handler = - compile_branch st [] e1 loop_stack backs frontier interm - in + let never_handler, handler = compile_branch st [] e1 scope_stack ~fall_through in let exn_var, handler = assert (not (List.mem x ~set:(snd e1))); let wrap_exn x = @@ -1895,17 +1771,16 @@ and compile_conditional st queue last loop_stack backs frontier interm = , loc ) ] ) | Poptrap cont -> - let never, code = compile_branch st [] cont loop_stack backs frontier interm in + let never, code = compile_branch st [] cont scope_stack ~fall_through in never, flush_all queue code | Cond (x, c1, c2) -> let (_px, cx), queue = access_queue queue x in let never, b = compile_decision_tree + "Bool" st - loop_stack - backs - frontier - interm + scope_stack + ~fall_through loc cx (DTree.build_if c1 c2) @@ -1915,11 +1790,10 @@ and compile_conditional st queue last loop_stack backs frontier interm = let (_px, cx), queue = access_queue queue x in let never, code = compile_decision_tree + "Int" st - loop_stack - backs - frontier - interm + scope_stack + ~fall_through loc cx (DTree.build_switch a1) @@ -1933,62 +1807,90 @@ and compile_conditional st queue last loop_stack backs frontier interm = | Switch _ | Cond _ | Pushtrap _ -> Format.eprintf "}@]@;"); res -and compile_argument_passing ctx queue (pc, args) _backs continuation = +and compile_argument_passing ctx queue (pc, args) back_edge continuation = if List.is_empty args then continuation queue else let block = Addr.Map.find pc ctx.Ctx.blocks in - parallel_renaming block.params args continuation queue - -and compile_branch st queue ((pc, _) as cont) loop_stack backs frontier interm : bool * _ - = - compile_argument_passing st.ctx queue cont backs (fun queue -> - if Addr.Set.mem pc backs - then ( - let label = - match loop_stack with - | [] -> assert false - | (pc', _) :: rem -> - if pc = pc' + parallel_renaming back_edge block.params args continuation queue + +and compile_branch st queue ((pc, _) as cont) scope_stack ~fall_through : bool * _ = + let scope = List.assoc_opt pc scope_stack in + let back_edge = + List.exists + ~f:(function + | pc', (_, _, Loop) when pc' = pc -> true + | _ -> false) + scope_stack + in + compile_argument_passing st.ctx queue cont back_edge (fun queue -> + if match fall_through with + | Block pc' -> pc' = pc + | Return -> false + then false, flush_all queue [] + else + match scope with + | Some (l, used, Loop) -> + (* Loop back to the beginning of the loop using continue. + We can skip the label if we're not inside a nested loop. *) + let rec can_skip_label scope_stack = + match scope_stack with + | [] -> assert false + | (_, (_, _, (Forward | Exit_switch _))) :: rem -> can_skip_label rem + | (pc', (l', _, (Loop | Exit_loop _))) :: rem -> + Poly.(l' = l) && (pc = pc' || can_skip_label rem) + in + let label = + if can_skip_label scope_stack then None - else - let lab, used = List.assoc pc rem in + else ( used := true; - Some lab - in - if debug () - then - if Option.is_none label - then Format.eprintf "continue;@," - else Format.eprintf "continue (%d);@," pc; - true, flush_all queue [ J.Continue_statement label, J.N ]) - else if Addr.Set.mem pc frontier || Interm.mem pc interm - then ( - if debug () then Format.eprintf "(br %d)@;" pc; - false, flush_all queue (compile_branch_selection pc interm)) - else compile_block st queue pc loop_stack frontier interm) - -and compile_branch_selection pc interm = - try - let { Interm.pc; var = x; value = i; default } = Interm.find pc interm in - if debug () then Format.eprintf "%a=%d;@;" Code.Var.print x i; - let branch = compile_branch_selection pc interm in - if default - then branch - else (J.Expression_statement (EBin (Eq, EVar (J.V x), int i)), J.N) :: branch - with Not_found -> [] + Some l) + in + if debug () + then + if Option.is_none label + then Format.eprintf "continue;@," + else Format.eprintf "continue (%d);@," pc; + true, flush_all queue [ J.Continue_statement label, J.N ] + | Some (l, used, (Exit_loop branch_used | Exit_switch branch_used)) -> + (* Break out of a loop or switch (using Break) + We can skip the label if we're not inside a nested loop or switch. + *) + branch_used := true; + let rec can_skip_label scope_stack = + match scope_stack with + | [] -> assert false + | (_, (_, _, Forward)) :: rem -> can_skip_label rem + | (pc', (l', _, (Loop | Exit_loop _ | Exit_switch _))) :: rem -> + Poly.(l' = l) && (pc = pc' || can_skip_label rem) + in + let label = + if can_skip_label scope_stack + then None + else ( + used := true; + Some l) + in + if debug () + then + if Option.is_none label + then Format.eprintf "break;@," + else Format.eprintf "break (%d);@," pc; + true, flush_all queue [ J.Break_statement label, J.N ] + | Some (l, used, Forward) -> + (* break outside a labelled statement. The label is mandatory in this case. *) + if debug () then Format.eprintf "(br %d)@;" pc; + used := true; + true, flush_all queue [ J.Break_statement (Some l), J.N ] + | None -> compile_block st queue pc scope_stack ~fall_through) and compile_closure ctx (pc, args) = let st = build_graph ctx pc in - let current_blocks = !(st.visited_blocks) in - st.visited_blocks := Addr.Set.empty; + let current_blocks = Structure.get_nodes st.structure in if debug () then Format.eprintf "@[closure {@;"; - let backs = Addr.Set.empty in - let loop_stack = [] in - incr_seen st pc; - let _never, res = - compile_branch st [] (pc, args) loop_stack backs Addr.Set.empty Interm.empty - in + let scope_stack = [] in + let _never, res = compile_branch st [] (pc, args) scope_stack ~fall_through:Return in if Addr.Set.cardinal !(st.visited_blocks) <> Addr.Set.cardinal current_blocks then ( let missing = Addr.Set.diff current_blocks !(st.visited_blocks) in @@ -1997,6 +1899,13 @@ and compile_closure ctx (pc, args) = if debug () then Format.eprintf "}@]@;"; res +and collect_closures l = + match l with + | ((Let (x, Closure (_, (pc, _))), _loc) as i) :: rem -> + let names', pcs', i', rem' = collect_closures rem in + x :: names', pc :: pcs', i :: i', rem' + | _ -> [], [], [], l + let generate_shared_value ctx = let strings = ( J.variable_declaration @@ -2041,6 +1950,40 @@ let compile_program ctx pc = if debug () then Format.eprintf "@]@."; res +let f + (p : Code.program) + ~exported_runtime + ~live_vars + ~trampolined_calls + ~should_export + ~warn_on_unhandled_effect + ~deadcode_sentinal + debug = + let t' = Timer.make () in + let share = Share.get ~trampolined_calls ~alias_prims:exported_runtime p in + let exported_runtime = + if exported_runtime then Some (Code.Var.fresh_n "runtime", ref false) else None + in + let mutated_vars = Freevars.f_mutable p in + let freevars = Freevars.f p in + let ctx = + Ctx.initial + ~warn_on_unhandled_effect + ~exported_runtime + ~should_export + ~deadcode_sentinal + ~mutated_vars + ~freevars + p.blocks + live_vars + trampolined_calls + share + debug + in + let p = compile_program ctx p.start in + if times () then Format.eprintf " code gen.: %a@." Timer.print t'; + p + let init () = List.iter ~f:(fun (nm, nm') -> Primitive.alias nm nm') @@ -2119,31 +2062,3 @@ let init () = Hashtbl.iter (fun name (k, _) -> Primitive.register name k None None) internal_primitives - -let f - (p : Code.program) - ~exported_runtime - ~live_vars - ~trampolined_calls - ~should_export - ~warn_on_unhandled_effect - debug = - let t' = Timer.make () in - let share = Share.get ~trampolined_calls ~alias_prims:exported_runtime p in - let exported_runtime = - if exported_runtime then Some (Code.Var.fresh_n "runtime", ref false) else None - in - let ctx = - Ctx.initial - ~warn_on_unhandled_effect - ~exported_runtime - ~should_export - p.blocks - live_vars - trampolined_calls - share - debug - in - let p = compile_program ctx p.start in - if times () then Format.eprintf " code gen.: %a@." Timer.print t'; - p diff --git a/compiler/lib/generate.mli b/compiler/lib/generate.mli index d8fe84647..60c98959f 100644 --- a/compiler/lib/generate.mli +++ b/compiler/lib/generate.mli @@ -25,6 +25,7 @@ val f : -> trampolined_calls:Effects.trampolined_calls -> should_export:bool -> warn_on_unhandled_effect:bool + -> deadcode_sentinal:Code.Var.t -> Parse_bytecode.Debug.t -> Javascript.program diff --git a/compiler/lib/generate_closure.ml b/compiler/lib/generate_closure.ml index 3094ac98c..dea24f8d7 100644 --- a/compiler/lib/generate_closure.ml +++ b/compiler/lib/generate_closure.ml @@ -27,13 +27,8 @@ type closure_info = ; args : Code.Var.t list ; cont : Code.cont ; tc : Code.Addr.Set.t Code.Var.Map.t - ; mutated_vars : Code.Var.Set.t ; loc : Code.loc - } - -type 'a int_ext = - { int : 'a - ; ext : 'a + ; pos : int } module SCC = Strongly_connected_components.Make (Var) @@ -67,16 +62,15 @@ let rec collect_apply pc blocks visited tc = (fun pc (visited, tc) -> collect_apply pc blocks visited tc) (visited, tc) -let rec collect_closures blocks mutated_vars l = +let rec collect_closures blocks l pos = match l with | (Let (f_name, Closure (args, ((pc, _) as cont))), loc) :: rem -> let _, tc = collect_apply pc blocks Addr.Set.empty Var.Map.empty in - let l, rem = collect_closures blocks mutated_vars rem in - let mutated_vars = Addr.Map.find pc mutated_vars in - { f_name; args; cont; tc; mutated_vars; loc } :: l, rem + let l, rem = collect_closures blocks rem (succ pos) in + { f_name; args; cont; tc; loc; pos } :: l, rem | rem -> [], rem -let group_closures ~tc_only closures_map = +let group_closures closures_map = let names = Var.Map.fold (fun _ x names -> Var.Set.add x.f_name names) closures_map Var.Set.empty in @@ -84,13 +78,22 @@ let group_closures ~tc_only closures_map = Var.Map.fold (fun _ x graph -> let calls = Var.Map.fold (fun x _ tc -> Var.Set.add x tc) x.tc Var.Set.empty in - let calls = if tc_only then calls else Var.Set.union calls x.mutated_vars in Var.Map.add x.f_name (Var.Set.inter names calls) graph) closures_map Var.Map.empty in + SCC.connected_components_sorted_from_roots_to_leaf graph |> Array.to_list - SCC.connected_components_sorted_from_roots_to_leaf graph +type w = + | One of + { name : Code.Var.t + ; code : Code.instr * loc + } + | Wrapper of + { name : Code.Var.t + ; code : Code.instr * loc + ; wrapper : Code.instr + } module Trampoline = struct let direct_call_block ~counter ~x ~f ~args loc = @@ -158,7 +161,7 @@ module Trampoline = struct | SCC.No_loop id -> let ci = Var.Map.find id closures_map in let instr = Let (ci.f_name, Closure (ci.args, ci.cont)), ci.loc in - free_pc, blocks, { int = []; ext = [ instr ] } + free_pc, blocks, [ One { name = ci.f_name; code = instr } ] | SCC.Has_loop all -> if debug_tc () then ( @@ -172,11 +175,11 @@ module Trampoline = struct ( (if tailcall_max_depth = 0 then None else Some (Code.Var.fresh_n "counter")) , Var.Map.find id closures_map )) in - let blocks, free_pc, instrs, instrs_wrapper = + let blocks, free_pc, closures = List.fold_left all - ~init:(blocks, free_pc, [], []) - ~f:(fun (blocks, free_pc, instrs, instrs_wrapper) (counter, ci) -> + ~init:(blocks, free_pc, []) + ~f:(fun (blocks, free_pc, closures) (counter, ci) -> if debug_tc () then Format.eprintf "Rewriting for %s\n%!" (Var.to_string ci.f_name); let new_f = Code.Var.fork ci.f_name in @@ -188,9 +191,7 @@ module Trampoline = struct wrapper_block new_f ~args:new_args ~counter:new_counter ci.loc in let blocks = Addr.Map.add wrapper_pc wrapper_block blocks in - let instr_wrapper = - Let (ci.f_name, wrapper_closure wrapper_pc new_args), ci.loc - in + let instr_wrapper = Let (ci.f_name, wrapper_closure wrapper_pc new_args) in let instr_real = match counter with | None -> Let (new_f, Closure (ci.args, ci.cont)), ci.loc @@ -258,225 +259,78 @@ module Trampoline = struct Addr.Map.add pc block blocks, free_pc | _ -> assert false) in - blocks, free_pc, instr_real :: instrs, instr_wrapper :: instrs_wrapper) - in - free_pc, blocks, { int = instrs; ext = instrs_wrapper } -end - -module Ident = struct - let f free_pc blocks closures_map component = - match component with - | SCC.No_loop id -> - let ci = Var.Map.find id closures_map in - let instr = Let (ci.f_name, Closure (ci.args, ci.cont)), ci.loc in - free_pc, blocks, { int = []; ext = [ instr ] } - | SCC.Has_loop ids -> - let instrs = - List.map ids ~f:(fun id -> - let ci = Var.Map.find id closures_map in - let instr = Let (ci.f_name, Closure (ci.args, ci.cont)), ci.loc in - instr) + ( blocks + , free_pc + , Wrapper { name = ci.f_name; code = instr_real; wrapper = instr_wrapper } + :: closures )) in - free_pc, blocks, { int = []; ext = instrs } + free_pc, blocks, closures end -let rewrite_tc free_pc blocks closures_map component = - let open Config.Param in - let trampoline = - (not (Config.Flag.effects ())) - && - match tailcall_optim () with - | TcTrampoline -> true - | TcNone -> false - in - if trampoline - then Trampoline.f free_pc blocks closures_map component - else Ident.f free_pc blocks closures_map component - -let rewrite_mutable - free_pc - blocks - mutated_vars - rewrite_list - { int = closures_intern; ext = closures_extern } = - let internal_and_external = closures_intern @ closures_extern in - assert (not (List.is_empty closures_extern)); - let all_mut, names = - List.fold_left - internal_and_external - ~init:(Var.Set.empty, Var.Set.empty) - ~f:(fun (all_mut, names) i -> - match i with - | Let (x, Closure (_, (pc, _))), _ -> - let all_mut = - try Var.Set.union all_mut (Addr.Map.find pc mutated_vars) - with Not_found -> all_mut - in - let names = Var.Set.add x names in - all_mut, names - | _ -> assert false) - in - let vars = Var.Set.elements (Var.Set.diff all_mut names) in - if List.is_empty vars - then free_pc, blocks, internal_and_external - else - match internal_and_external with - | [ (Let (x, Closure (params, (pc, pc_args))), loc) ] -> - let new_pc = free_pc in - let free_pc = free_pc + 1 in - let closure = Code.Var.fork x in - let args = List.map vars ~f:Code.Var.fork in - let new_x = Code.Var.fork x in - let mapping = Subst.from_map (Subst.build_mapping (x :: vars) (new_x :: args)) in - rewrite_list := (mapping, pc) :: !rewrite_list; - let new_block = - { params = [] - ; body = - [ Let (new_x, Closure (params, (pc, List.map pc_args ~f:mapping))), loc ] - ; branch = Return new_x, loc - } - in - let blocks = Addr.Map.add new_pc new_block blocks in - let body = - [ Let (closure, Closure (args, (new_pc, []))), noloc - ; Let (x, Apply { f = closure; args = vars; exact = true }), loc - ] - in - free_pc, blocks, body - | _ -> - let new_pc = free_pc in - let free_pc = free_pc + 1 in - let closure = Code.Var.fresh_n "closures" in - let closure' = Code.Var.fresh_n "closures" in - let b = Code.Var.fresh_n "block" in - let args = List.map vars ~f:Code.Var.fork in - let pcs = - List.map internal_and_external ~f:(function - | Let (_, Closure (_, (pc, _))), _ -> pc - | _ -> assert false) - in - let old_xs = - List.map closures_extern ~f:(function - | Let (x, Closure _), _ -> x - | _ -> assert false) - in - let new_xs = List.map old_xs ~f:Code.Var.fork in - let mapping = - Subst.from_map (Subst.build_mapping (old_xs @ vars) (new_xs @ args)) - in - rewrite_list := List.map pcs ~f:(fun pc -> mapping, pc) @ !rewrite_list; - let new_block = - let proj = - List.map2 closures_extern new_xs ~f:(fun cl new_x -> - match cl with - | Let (_, Closure (params, (pc, pc_args))), loc -> - Let (new_x, Closure (params, (pc, List.map pc_args ~f:mapping))), loc - | _ -> assert false) - in - { params = [] - ; body = - closures_intern - @ proj - @ [ Let (b, Block (0, Array.of_list new_xs, NotArray, Immutable)), noloc ] - ; branch = Return b, noloc - } - in - let blocks = Addr.Map.add new_pc new_block blocks in - let body = - [ Let (closure, Closure (args, (new_pc, []))), noloc - ; Let (closure', Apply { f = closure; args = vars; exact = true }), noloc - ] - @ List.mapi closures_extern ~f:(fun i x -> - match x with - | Let (x, Closure _), loc -> Let (x, Field (closure', i)), loc - | _ -> assert false) - in - free_pc, blocks, body - -let rec rewrite_closures mutated_vars rewrite_list free_pc blocks body : int * _ * _ list - = +let rec rewrite_closures free_pc blocks body : int * _ * _ list = match body with | (Let (_, Closure _), _) :: _ -> - let closures, rem = collect_closures blocks mutated_vars body in + let closures, rem = collect_closures blocks body 0 in let closures_map = List.fold_left closures ~init:Var.Map.empty ~f:(fun closures_map x -> Var.Map.add x.f_name x closures_map) in - let components = group_closures ~tc_only:false closures_map in + let components = group_closures closures_map in let free_pc, blocks, closures = List.fold_left - (Array.to_list components) + components ~init:(free_pc, blocks, []) ~f:(fun (free_pc, blocks, acc) component -> let free_pc, blocks, closures = - let components = - match component with - | SCC.No_loop _ as one -> [ one ] - | SCC.Has_loop all -> - group_closures - ~tc_only:true - (Var.Map.filter - (fun v _ -> List.exists all ~f:(Var.equal v)) - closures_map) - |> Array.to_list - in - List.fold_left - ~init:(free_pc, blocks, { int = []; ext = [] }) - components - ~f:(fun (free_pc, blocks, acc) component -> - let free_pc, blocks, ie = - rewrite_tc free_pc blocks closures_map component - in - free_pc, blocks, { int = ie.int :: acc.int; ext = ie.ext :: acc.ext }) - in - let closures = - { int = List.concat (List.rev closures.int) - ; ext = List.concat (List.rev closures.ext) - } + Trampoline.f free_pc blocks closures_map component in - let free_pc, blocks, intrs = - rewrite_mutable free_pc blocks mutated_vars rewrite_list closures - in - free_pc, blocks, intrs :: acc) + let intrs = closures :: acc in + free_pc, blocks, intrs) in - let free_pc, blocks, rem = - rewrite_closures mutated_vars rewrite_list free_pc blocks rem + let closures = + let pos_of_var x = (Var.Map.find x closures_map).pos in + let pos = function + | One { name; _ } -> pos_of_var name + | Wrapper { name; _ } -> pos_of_var name + in + List.flatten closures + |> List.sort ~cmp:(fun a b -> compare (pos a) (pos b)) + |> List.concat_map ~f:(function + | One { code; _ } -> [ code ] + | Wrapper { code = (_, loc) as code; wrapper; _ } -> [ code; wrapper, loc ]) in - free_pc, blocks, List.flatten closures @ rem + let free_pc, blocks, rem = rewrite_closures free_pc blocks rem in + free_pc, blocks, closures @ rem | i :: rem -> - let free_pc, blocks, rem = - rewrite_closures mutated_vars rewrite_list free_pc blocks rem - in + let free_pc, blocks, rem = rewrite_closures free_pc blocks rem in free_pc, blocks, i :: rem | [] -> free_pc, blocks, [] let f p : Code.program = Code.invariant p; - let mutated_vars = Freevars.f p in - let rewrite_list = ref [] in let blocks, free_pc = Addr.Map.fold (fun pc _ (blocks, free_pc) -> (* make sure we have the latest version *) let block = Addr.Map.find pc blocks in - let free_pc, blocks, body = - rewrite_closures mutated_vars rewrite_list free_pc blocks block.body - in + let free_pc, blocks, body = rewrite_closures free_pc blocks block.body in Addr.Map.add pc { block with body } blocks, free_pc) p.blocks (p.blocks, p.free_pc) in (* Code.invariant (pc, blocks, free_pc); *) let p = { p with blocks; free_pc } in - let p = - List.fold_left !rewrite_list ~init:p ~f:(fun program (mapping, pc) -> - Subst.cont mapping pc program) - in Code.invariant p; p let f p = - let t = Timer.make () in - let p' = f p in - if Debug.find "times" () then Format.eprintf " generate closures: %a@." Timer.print t; - p' + assert (not (Config.Flag.effects ())); + let open Config.Param in + match tailcall_optim () with + | TcNone -> p + | TcTrampoline -> + let t = Timer.make () in + let p' = f p in + if Debug.find "times" () + then Format.eprintf " generate closures: %a@." Timer.print t; + p' diff --git a/compiler/lib/global_deadcode.ml b/compiler/lib/global_deadcode.ml new file mode 100644 index 000000000..c3670b350 --- /dev/null +++ b/compiler/lib/global_deadcode.ml @@ -0,0 +1,468 @@ +(* Js_of_ocaml compiler + * http://www.ocsigen.org/js_of_ocaml/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +open Code +open Stdlib + +let debug = Debug.find "globaldeadcode" + +let times = Debug.find "times" + +(** Definition of a variable [x]. *) +type def = + | Expr of expr (** [x] is defined by an expression. *) + | Param (** [x] is a block or closure parameter. *) + +(** Liveness of a variable [x], forming a lattice structure. *) +type live = + | Top (** [x] is live and not a block. *) + | Live of IntSet.t (** [x] is a live block with a (non-empty) set of live fields. *) + | Dead (** [x] is dead. *) + +module G = Dgraph.Make_Imperative (Var) (Var.ISet) (Var.Tbl) + +module Domain = struct + type t = live + + let equal l1 l2 = + match l1, l2 with + | Top, Top | Dead, Dead -> true + | Live f1, Live f2 -> IntSet.equal f1 f2 + | Top, (Dead | Live _) | Live _, (Dead | Top) | Dead, (Live _ | Top) -> false + + let bot = Dead + + (** Join the liveness according to lattice structure. *) + let join l1 l2 = + match l1, l2 with + | _, Top | Top, _ -> Top + | Live f1, Live f2 -> Live (IntSet.union f1 f2) + | Dead, Live f | Live f, Dead -> Live f + | Dead, Dead -> Dead +end + +module Solver = G.Solver (Domain) + +let definitions prog = + let defs = Var.Tbl.make () Param in + let set_def x d = Var.Tbl.set defs x d in + Addr.Map.iter + (fun _ block -> + (* Add defs from block body *) + List.iter + ~f:(fun (i, _) -> + match i with + | Let (x, e) -> set_def x (Expr e) + | Assign (x, _) -> set_def x Param + | Set_field (_, _, _, _) | Offset_ref (_, _) | Array_set (_, _, _) -> ()) + block.body) + prog.blocks; + defs + +let variable_may_escape x (global_info : Global_flow.info) = + match global_info.info_variable_may_escape.(Var.idx x) with + | Escape | Escape_constant -> true + | No -> false + +(** Type of variable usage. *) +type usage_kind = + | Compute (** variable y is used to compute x *) + | Propagate (** values of y propagate to x *) + +(** Compute the adjacency list for the dependency graph of given program. An edge between + variables [x] and [y] is marked [Compute] if [x] is used in the definition of [y]. It is marked + as [Propagate] if [x] is applied as a closure or block argument the parameter [y]. + + We use information from global flow to try to add edges between function calls and their return values + at known call sites. *) +let usages prog (global_info : Global_flow.info) : + (Var.t, usage_kind) Var.Tbl.DataMap.t Var.Tbl.t = + let uses = Var.Tbl.make_map () in + let add_use kind x y = Var.Tbl.add_map uses y x kind in + let add_arg_dep params args = + List.iter2 ~f:(fun x y -> add_use Propagate x y) params args + in + let add_cont_deps (pc, args) = + match try Some (Addr.Map.find pc prog.blocks) with Not_found -> None with + | Some block -> add_arg_dep block.params args + | None -> () (* Dead continuation *) + in + let add_expr_uses x e : unit = + match e with + | Apply { f; args; _ } -> + (match Var.Tbl.get global_info.info_approximation f with + | Top -> () + | Values { known; _ } -> + Var.Set.iter (* For each known closure value of f *) + (fun k -> + (* 1. Look at return values, and add edge between x and these values. *) + (* 2. Add an edge pairwise between the parameters and arguments *) + match global_info.info_defs.(Var.idx k) with + | Expr (Closure (params, _)) -> + (* If the function is under/over-applied then global flow will mark arguments and return value as escaping. + So we only need to consider the case when there is an exact application. *) + if List.compare_lengths params args = 0 + then ( + let return_values = Var.Map.find k global_info.info_return_vals in + Var.Set.iter (add_use Propagate x) return_values; + List.iter2 ~f:(add_use Propagate) params args) + | _ -> ()) + known); + add_use Compute x f; + List.iter + ~f:(fun a -> if variable_may_escape a global_info then add_use Compute x a) + args + | Block (_, vars, _, _) -> Array.iter ~f:(add_use Compute x) vars + | Field (z, _, _) -> add_use Compute x z + | Constant _ -> () + | Special _ -> () + | Closure (_, cont) -> add_cont_deps cont + | Prim (_, args) -> + List.iter + ~f:(fun arg -> + match arg with + | Pv v -> add_use Compute x v + | Pc _ -> ()) + args + in + Addr.Map.iter + (fun _ block -> + (* Add uses from block body *) + List.iter + ~f:(fun (i, _) -> + match i with + | Let (x, e) -> add_expr_uses x e + (* For assignment, propagate liveness from new to old variable like a block parameter *) + | Assign (x, y) -> add_use Propagate x y + | Set_field (_, _, _, _) | Offset_ref (_, _) | Array_set (_, _, _) -> ()) + block.body; + (* Add uses from block branch *) + match fst block.branch with + | Return _ | Raise _ | Stop -> () + | Branch cont -> add_cont_deps cont + | Cond (_, cont1, cont2) -> + add_cont_deps cont1; + add_cont_deps cont2 + | Switch (_, a) -> Array.iter ~f:add_cont_deps a + | Pushtrap (cont, _, cont_h) -> + add_cont_deps cont; + add_cont_deps cont_h + | Poptrap cont -> add_cont_deps cont) + prog.blocks; + uses + +(** Return the set of variables used in a given expression *) +let expr_vars e = + let vars = Var.Set.empty in + match e with + | Apply { f; args; _ } -> + let vars = Var.Set.add f vars in + List.fold_left ~f:(fun acc x -> Var.Set.add x acc) ~init:vars args + | Block (_, params, _, _) -> + Array.fold_left ~f:(fun acc x -> Var.Set.add x acc) ~init:vars params + | Field (z, _, _) -> Var.Set.add z vars + | Prim (_, args) -> + List.fold_left + ~f:(fun acc v -> + match v with + | Pv v -> Var.Set.add v acc + | Pc _ -> acc) + ~init:vars + args + (* We can ignore closures. We want the set of previously defined variables used + in the expression, so not parameters. The continuation may use some variables + but we will add these when we visit the body *) + | Constant _ | Closure (_, _) | Special _ -> vars + +(** Compute the initial liveness of each variable in the program. + + A variable [x] is marked as [Top] if + + It is used in an impure expression (as defined by [Pure_fun.pure_expr]); + + It is used in a conditonal/switch; + + It is raised by an exception; + + It is used in another stateful instruction (like setting a block or array field); + + Or, it is returned or applied to a function and the global flow analysis marked it as escaping. + + A variable [x[i]] is marked as [Live {i}] if it is used in an instruction where field [i] is referenced or set. *) +let liveness prog pure_funs (global_info : Global_flow.info) = + let live_vars = Var.Tbl.make () Dead in + let add_top v = Var.Tbl.set live_vars v Top in + let add_live_field v i = + let live_fields = + match Var.Tbl.get live_vars v with + | Live fields -> Live (IntSet.add i fields) + | Top | Dead -> Live (IntSet.singleton i) + in + Var.Tbl.set live_vars v live_fields + in + let live_instruction i = + match i with + (* If e is impure, set all variables in e as Top. The only exception is for function applications, + where we may be able to do better. Global flow gives us information about which arguments in + a function application escape, so set only these as top. *) + | Let (_, e) -> ( + if not (Pure_fun.pure_expr pure_funs e) + then + match e with + | Apply { f; args; _ } -> + add_top f; + List.iter + ~f:(fun x -> if variable_may_escape x global_info then add_top x) + args + | Block (_, _, _, _) + | Field (_, _, _) + | Closure (_, _) + | Constant _ + | Prim (_, _) + | Special _ -> + let vars = expr_vars e in + Var.Set.iter add_top vars) + | Set_field (x, i, _, y) -> + add_live_field x i; + add_top y + | Array_set (x, y, z) -> + add_top x; + add_top y; + add_top z + | Offset_ref (x, _) -> add_live_field x 0 + (* Assignment can be ignored. Liveness of old variable is just propagated to new variable. See [usages]. *) + | Assign (_, _) -> () + in + let live_block block = + List.iter ~f:(fun (i, _) -> live_instruction i) block.body; + match fst block.branch with + | Return x -> if variable_may_escape x global_info then add_top x + | Raise (x, _) -> add_top x + | Cond (x, _, _) -> add_top x + | Switch (x, _) -> add_top x + | Stop | Branch _ | Poptrap _ | Pushtrap _ -> () + in + Addr.Map.iter (fun _ block -> live_block block) prog.blocks; + Code.traverse + { Code.fold = Code.fold_children } + (fun pc () -> + match Addr.Map.find pc prog.blocks with + | { branch = Return x, _; _ } -> add_top x + | _ -> ()) + prog.start + prog.blocks + (); + live_vars + +(* Returns the set of variables given a table of variables. *) +let variables deps = + let vars = Var.ISet.empty () in + Var.Tbl.iter (fun v _ -> Var.ISet.add vars v) deps; + vars + +(** Propagate liveness of the usages of a variable [x] to [x]. The liveness of [x] is + defined by joining its current liveness and the contribution of each vairable [y] + that uses [x]. *) +let propagate uses defs live_vars live_table x = + (* Variable [y] uses [x] either in its definition ([Compute]) or as a closure/block parameter + ([Propagate]). In the latter case, the contribution is simply the liveness of [y]. In the former, + the contribution depends on the liveness of [y] and its definition. *) + let contribution y usage_kind = + match usage_kind with + (* If x is used to compute y, we consider the liveness of y *) + | Compute -> ( + match Var.Tbl.get live_table y with + (* If y is dead, then x is dead. *) + | Dead -> Dead + (* If y is a live block, then x is the join of liveness fields that are x *) + | Live fields -> ( + match Var.Tbl.get defs y with + | Expr (Block (_, vars, _, _)) -> + let found = ref false in + Array.iteri + ~f:(fun i v -> + if Var.equal v x && IntSet.mem i fields then found := true) + vars; + if !found then Top else Dead + | Expr (Field (_, i, _)) -> Live (IntSet.singleton i) + | _ -> Top) + (* If y is top and y is a field access, x depends only on that field *) + | Top -> ( + match Var.Tbl.get defs y with + | Expr (Field (_, i, _)) -> Live (IntSet.singleton i) + | _ -> Top)) + (* If x is used as an argument for parameter y, then contribution is liveness of y *) + | Propagate -> Var.Tbl.get live_table y + in + Var.Tbl.DataMap.fold + (fun y usage_kind live -> Domain.join (contribution y usage_kind) live) + (Var.Tbl.get uses x) + (Domain.join (Var.Tbl.get live_vars x) (Var.Tbl.get live_table x)) + +let solver vars uses defs live_vars = + let g = + { G.domain = vars + ; G.iter_children = + (fun f x -> Var.Tbl.DataMap.iter (fun y _ -> f y) (Var.Tbl.get uses x)) + } + in + Solver.f () (G.invert () g) (propagate uses defs live_vars) + +(** Replace each instance of a dead variable with a sentinal value. + Blocks that end in dead variables are compacted to the first live entry. + Dead variables are replaced when + + They appear in a dead field of a block; or + + They are returned; or + + They are applied to a function. + *) +let zero prog sentinal live_table = + let compact_vars vars = + let i = ref (Array.length vars - 1) in + while !i >= 0 && Var.equal vars.(!i) sentinal do + i := !i - 1 + done; + if !i + 1 < Array.length vars then Array.sub vars ~pos:0 ~len:(!i + 1) else vars + in + let is_live v = + match Var.Tbl.get live_table v with + | Dead -> false + | Top | Live _ -> true + in + let zero_var x = if is_live x then x else sentinal in + let zero_instr instr = + match instr with + | Let (x, e) -> ( + match e with + | Block (start, vars, is_array, mut) -> ( + match Var.Tbl.get live_table x with + | Live fields -> + let vars = + Array.mapi + ~f:(fun i v -> if IntSet.mem i fields then v else sentinal) + vars + |> compact_vars + in + let e = Block (start, vars, is_array, mut) in + Let (x, e) + | _ -> instr) + | Apply ap -> + let args = List.map ~f:zero_var ap.args in + Let (x, Apply { ap with args }) + | Field (_, _, _) | Closure (_, _) | Constant _ | Prim (_, _) | Special _ -> instr + ) + | Assign (_, _) | Set_field (_, _, _, _) | Offset_ref (_, _) | Array_set (_, _, _) -> + instr + in + let zero_block block = + (* Analyze block instructions *) + let body = List.map ~f:(fun (instr, loc) -> zero_instr instr, loc) block.body in + (* Analyze branch *) + let branch = + (* Zero out return values in last instruction, otherwise do nothing. *) + match block.branch with + | Return x, loc -> + let tc = + (* We don't want to break tailcalls. *) + match List.last body with + | Some (Let (x', Apply _), _) when Code.Var.equal x' x -> true + | Some _ | None -> false + in + if tc then Return x, loc else Return (zero_var x), loc + | Raise (_, _), _ + | Stop, _ + | Branch _, _ + | Cond (_, _, _), _ + | Switch (_, _), _ + | Pushtrap (_, _, _), _ + | Poptrap _, _ -> block.branch + in + { block with body; branch } + in + let blocks = prog.blocks |> Addr.Map.map zero_block in + { prog with blocks } + +module Print = struct + let live_to_string = function + | Live fields -> + "live { " ^ IntSet.fold (fun i s -> s ^ Format.sprintf "%d " i) fields "" ^ "}" + | Top -> "top" + | Dead -> "dead" + + let print_uses uses = + Format.eprintf "Usages:\n"; + Var.Tbl.iter + (fun v ds -> + Format.eprintf "%a: { " Var.print v; + Var.Tbl.DataMap.iter + (fun d k -> + Format.eprintf + "(%a, %s) " + Var.print + d + (match k with + | Compute -> "C" + | Propagate -> "P")) + ds; + Format.eprintf "}\n") + uses + + let print_liveness live_vars = + Format.eprintf "Liveness:\n"; + Var.Tbl.iter + (fun v l -> Format.eprintf "%a: %s\n" Var.print v (live_to_string l)) + live_vars + + let print_live_tbl live_table = + Format.eprintf "Liveness with dependencies:\n"; + Var.Tbl.iter + (fun v l -> Format.eprintf "%a: %s\n" Var.print v (live_to_string l)) + live_table +end + +(** Add a sentinal variable declaration to the IR. The fresh variable is assigned to `undefined`. *) +let add_sentinal p sentinal = + let instr, loc = Let (sentinal, Special Undefined), noloc in + Code.prepend p [ instr, loc ] + +(** Run the liveness analysis and replace dead variables with the given sentinal. *) +let f p ~deadcode_sentinal global_info = + Code.invariant p; + let t = Timer.make () in + (* Add sentinal variable *) + let p = add_sentinal p deadcode_sentinal in + (* Compute definitions *) + let defs = definitions p in + (* Compute usages *) + let uses = usages p global_info in + (* Compute initial liveness *) + let pure_funs = Pure_fun.f p in + let live_vars = liveness p pure_funs global_info in + (* Propagate liveness to dependencies *) + let vars = variables uses in + let live_table = solver vars uses defs live_vars in + (* Print debug info *) + if debug () + then ( + Format.eprintf "Before Zeroing:\n"; + Code.Print.program (fun _ _ -> "") p; + Print.print_liveness live_vars; + Print.print_uses uses; + Print.print_live_tbl live_table); + (* Zero out dead fields *) + let p = zero p deadcode_sentinal live_table in + if debug () + then ( + Format.printf "After Zeroing:\n"; + Code.Print.program (fun _ _ -> "") p); + if times () then Format.eprintf " deadcode dgraph.: %a@." Timer.print t; + p diff --git a/compiler/lib/global_deadcode.mli b/compiler/lib/global_deadcode.mli new file mode 100644 index 000000000..0c44ef8d9 --- /dev/null +++ b/compiler/lib/global_deadcode.mli @@ -0,0 +1,37 @@ +(* Js_of_ocaml compiler + * http://www.ocsigen.org/js_of_ocaml/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +(** Global deadcode elimination pass. + +This module provides a global liveness analysis more powerful than +that found in [deadcode.ml]. In particular, this analysis annotates +blocks with the specific fields that are live. It also uses +[global_flow.ml] to determine the liveness of function return +values. It first computes an initial liveness of each variable by +traversing the program IR. Then it propagates this information to +the dependencies of each variable using a flow analysis +solver. Lastly it replaces dead variables with a sentinal zero +variable (the JS value `undefined`). + +Although this module does not perform any dead-code elimination +itself, it is designed to be used to identify and substitute dead +variables that are then removed by [deadcode.ml]. In particular it +allows for the elimination of unused functions defined in functors, +which the original deadcode elimination cannot. *) + +val f : Code.program -> deadcode_sentinal:Code.Var.t -> Global_flow.info -> Code.program diff --git a/compiler/lib/global_flow.ml b/compiler/lib/global_flow.ml index 12c5caaee..afd647d26 100644 --- a/compiler/lib/global_flow.ml +++ b/compiler/lib/global_flow.ml @@ -83,14 +83,14 @@ type escape_status = type state = { vars : Var.ISet.t (* Set of all veriables considered *) - ; deps : Var.Set.t array (* Dependency between variables *) + ; deps : Var.t Var.Tbl.DataSet.t Var.Tbl.t (* Dependency between variables *) ; defs : def array (* Definition of each variable *) ; variable_may_escape : escape_status array (* Any value bound to this variable may escape *) - ; variable_possibly_mutable : bool array + ; variable_possibly_mutable : Var.ISet.t (* Any value bound to this variable may be mutable *) ; may_escape : escape_status array (* This value may escape *) - ; possibly_mutable : bool array (* This value may be mutable *) + ; possibly_mutable : Var.ISet.t (* This value may be mutable *) ; return_values : Var.Set.t Var.Map.t (* Set of variables holding return values of each function *) ; known_cases : (Var.t, int list) Hashtbl.t @@ -106,9 +106,7 @@ type state = let add_var st x = Var.ISet.add st.vars x (* x depends on y *) -let add_dep st x y = - let idx = Var.idx y in - st.deps.(idx) <- Var.Set.add x st.deps.(idx) +let add_dep st x y = Var.Tbl.add_set st.deps y x let add_expr_def st x e = add_var st x; @@ -139,7 +137,8 @@ let rec arg_deps st ?ignore params args = | Some y' when Var.equal y y' -> () | _ -> add_assign_def st x y); arg_deps st params args - | _ -> () + | [], [] -> () + | _ -> assert false let cont_deps blocks st ?ignore (pc, args) = let block = Addr.Map.find pc blocks in @@ -147,7 +146,7 @@ let cont_deps blocks st ?ignore (pc, args) = let do_escape st level x = st.variable_may_escape.(Var.idx x) <- level -let possibly_mutable st x = st.variable_possibly_mutable.(Var.idx x) <- true +let possibly_mutable st x = Var.ISet.add st.variable_possibly_mutable x let expr_deps blocks st x e = match e with @@ -224,7 +223,9 @@ let expr_deps blocks st x e = match st.defs.(Var.idx f) with | Expr (Closure (params, _)) when List.length args = List.length params -> Hashtbl.add st.applied_functions (x, f) (); - if not st.fast then List.iter2 ~f:(fun p a -> add_assign_def st p a) params args; + if st.fast + then List.iter ~f:(fun a -> do_escape st Escape a) args + else List.iter2 ~f:(fun p a -> add_assign_def st p a) params args; Var.Set.iter (fun y -> add_dep st x y) (Var.Map.find f st.return_values) | _ -> ()) | Closure (l, cont) -> @@ -330,12 +331,13 @@ module Domain = struct then ( st.may_escape.(idx) <- s; match st.defs.(idx) with - | Expr (Block (_, a, _, _)) -> + | Expr (Block (_, a, _, _)) -> ( Array.iter ~f:(fun y -> variable_escape ~update ~st ~approx s y) a; - if Poly.equal s Escape - then ( - st.possibly_mutable.(idx) <- true; - update ~children:true x) + match s with + | Escape -> + Var.ISet.add st.possibly_mutable x; + update ~children:true x + | Escape_constant | No -> ()) | Expr (Closure (params, _)) -> List.iter ~f:(fun y -> @@ -384,9 +386,9 @@ module Domain = struct | Values { known; _ } -> Var.Set.iter (fun x -> - if not st.possibly_mutable.(Var.idx x) + if not (Var.ISet.mem st.possibly_mutable x) then ( - st.possibly_mutable.(Var.idx x) <- true; + Var.ISet.add st.possibly_mutable x; update ~children:true x)) known end @@ -423,7 +425,7 @@ let propagate st ~update approx x = let t = a.(n) in add_dep st x t; let a = Var.Tbl.get approx t in - if st.possibly_mutable.(Var.idx z) + if Var.ISet.mem st.possibly_mutable z then Domain.join ~update ~st ~approx Domain.others a else a | Expr (Block _ | Closure _) -> Domain.bot @@ -457,7 +459,7 @@ let propagate st ~update approx x = ~init:Domain.bot lst in - if st.possibly_mutable.(Var.idx z) + if Var.ISet.mem st.possibly_mutable z then Domain.join ~update ~st ~approx Domain.others a else a | Expr (Closure _) -> Domain.bot @@ -491,8 +493,13 @@ let propagate st ~update approx x = if not (Hashtbl.mem st.applied_functions (x, g)) then ( Hashtbl.add st.applied_functions (x, g) (); - if not st.fast + if st.fast then + List.iter + ~f:(fun y -> + Domain.variable_escape ~update ~st ~approx Escape y) + args + else List.iter2 ~f:(fun p a -> add_assign_def st p a; @@ -540,7 +547,8 @@ let propagate st ~update approx x = (match st.variable_may_escape.(Var.idx x) with | (Escape | Escape_constant) as s -> Domain.approx_escape ~update ~st ~approx s res | No -> ()); - if st.variable_possibly_mutable.(Var.idx x) then Domain.mark_mutable ~update ~st res; + if Var.ISet.mem st.variable_possibly_mutable x + then Domain.mark_mutable ~update ~st res; res | Top -> Top @@ -550,7 +558,8 @@ module Solver = G.Solver (Domain) let solver st = let g = { G.domain = st.vars - ; G.iter_children = (fun f x -> Var.Set.iter f st.deps.(Var.idx x)) + ; G.iter_children = + (fun f x -> Var.Tbl.DataSet.iter (fun k -> f k) (Var.Tbl.get st.deps x)) } in Solver.f' () g (propagate st) @@ -561,6 +570,8 @@ type info = { info_defs : def array ; info_approximation : Domain.t Var.Tbl.t ; info_may_escape : Var.ISet.t + ; info_variable_may_escape : escape_status array + ; info_return_vals : Var.Set.t Var.Map.t } let f ~fast p = @@ -569,12 +580,12 @@ let f ~fast p = let rets = return_values p in let nv = Var.count () in let vars = Var.ISet.empty () in - let deps = Array.make nv Var.Set.empty in + let deps = Var.Tbl.make_set () in let defs = Array.make nv undefined in let variable_may_escape = Array.make nv No in - let variable_possibly_mutable = Array.make nv false in + let variable_possibly_mutable = Var.ISet.empty () in let may_escape = Array.make nv No in - let possibly_mutable = Array.make nv false in + let possibly_mutable = Var.ISet.empty () in let st = { vars ; deps @@ -614,7 +625,7 @@ let f ~fast p = | Values { known; others } -> Format.fprintf f - "{%a/%b} mut:%b vmut:%b esc:%s" + "{%a/%b} mut:%b vmut:%b vesc:%s esc:%s" (Format.pp_print_list ~pp_sep:(fun f () -> Format.fprintf f ", ") (fun f x -> @@ -625,28 +636,38 @@ let f ~fast p = x (match st.defs.(Var.idx x) with | Expr (Closure _) -> "C" - | Expr (Block _) -> + | Expr (Block _) -> ( "B" ^ - if Poly.equal st.may_escape.(Var.idx x) Escape - then "X" - else "" + match st.may_escape.(Var.idx x) with + | Escape -> "X" + | _ -> "") | _ -> "O"))) (Var.Set.elements known) others - st.possibly_mutable.(Var.idx x) - st.variable_possibly_mutable.(Var.idx x) + (Var.ISet.mem st.possibly_mutable x) + (Var.ISet.mem st.variable_possibly_mutable x) + (match st.variable_may_escape.(Var.idx x) with + | Escape -> "Y" + | Escape_constant -> "y" + | No -> "n") (match st.may_escape.(Var.idx x) with | Escape -> "Y" | Escape_constant -> "y" | No -> "n")) s) vars; + let info_variable_may_escape = variable_may_escape in let info_may_escape = Var.ISet.empty () in Array.iteri ~f:(fun i s -> if Poly.(s <> No) then Var.ISet.add info_may_escape (Var.of_idx i)) may_escape; - { info_defs = defs; info_approximation = approximation; info_may_escape } + { info_defs = defs + ; info_approximation = approximation + ; info_variable_may_escape + ; info_may_escape + ; info_return_vals = rets + } let exact_call info f n = match Var.Tbl.get info.info_approximation f with diff --git a/compiler/lib/global_flow.mli b/compiler/lib/global_flow.mli index 576f45f8b..61f5dbfb6 100644 --- a/compiler/lib/global_flow.mli +++ b/compiler/lib/global_flow.mli @@ -31,10 +31,17 @@ type approx = ; others : bool (* Whether other values are possible *) } +type escape_status = + | Escape + | Escape_constant (* Escapes but we know the value is not modified *) + | No + type info = { info_defs : def array ; info_approximation : approx Var.Tbl.t ; info_may_escape : Var.ISet.t + ; info_variable_may_escape : escape_status array + ; info_return_vals : Var.Set.t Var.Map.t } val f : fast:bool -> Code.program -> info diff --git a/compiler/lib/inline.ml b/compiler/lib/inline.ml index 40cebb0ad..edcc62647 100644 --- a/compiler/lib/inline.ml +++ b/compiler/lib/inline.ml @@ -26,21 +26,82 @@ type prop = ; optimizable : bool } -let optimizable blocks pc _ = +type closure_info = + { cl_params : Var.t list + ; cl_cont : int * Var.t list + ; cl_prop : prop + ; cl_simpl : (Var.Set.t * int Var.Map.t * bool * Var.Set.t) option + } + +let block_size { branch; body; _ } = + List.length body + + + match fst branch with + | Cond _ -> 2 + | Switch (_, a1) -> Array.length a1 + | _ -> 0 + +let simple_function blocks size name params pc = + let bound_vars = + ref (List.fold_left ~f:(fun s x -> Var.Set.add x s) ~init:Var.Set.empty params) + in + let free_vars = ref Var.Map.empty in + let tc = ref Var.Set.empty in + try + (* Ignore large functions *) + if size > 10 then raise Exit; + Code.preorder_traverse + { fold = Code.fold_children } + (fun pc () -> + let block = Addr.Map.find pc blocks in + (match block.branch with + (* We currenly disable inlining when raising and catching exception *) + | (Poptrap _ | Pushtrap _), _ -> raise Exit + | Raise _, _ -> raise Exit + | Stop, _ -> raise Exit + | Return x, _ -> ( + match List.last block.body with + | None -> () + | Some (Let (y, Apply { f; _ }), _) -> + (* track if some params are called in tail position *) + if Code.Var.equal x y && List.mem f ~set:params + then tc := Var.Set.add f !tc + | Some _ -> ()) + | Branch _, _ | Cond _, _ | Switch _, _ -> ()); + List.iter block.body ~f:(fun (i, _loc) -> + match i with + (* We currenly don't want to duplicate Closure *) + | Let (_, Closure _) -> raise Exit + | _ -> ()); + Freevars.iter_block_bound_vars + (fun x -> bound_vars := Var.Set.add x !bound_vars) + block; + Freevars.iter_block_free_vars + (fun x -> + if not (Var.Set.mem x !bound_vars) + then + free_vars := + Var.Map.update + x + (function + | None -> Some 1 + | Some n -> Some (succ n)) + !free_vars) + block) + pc + blocks + (); + Some (!bound_vars, !free_vars, Var.Map.mem name !free_vars, !tc) + with Exit -> None + +(****) + +let optimizable blocks pc = Code.traverse { fold = Code.fold_children } (fun pc { size; optimizable } -> let b = Addr.Map.find pc blocks in - let this_size = - match b with - | { branch; body; _ } -> ( - List.length body - + - match fst branch with - | Cond _ -> 2 - | Switch (_, a1) -> Array.length a1 - | _ -> 0) - in + let this_size = block_size b in let optimizable = optimizable && List.for_all b.body ~f:(function @@ -62,30 +123,19 @@ let optimizable blocks pc _ = blocks { optimizable = true; size = 0 } -let rec follow_branch_rec seen blocks = function - | (pc, []) as k -> ( - let seen = Addr.Set.add pc seen in - try - match Addr.Map.find pc blocks with - | { body = []; branch = Branch (pc, []), _; _ } when not (Addr.Set.mem pc seen) -> - follow_branch_rec seen blocks (pc, []) - | _ -> k - with Not_found -> k) - | k -> k - -let follow_branch = follow_branch_rec Addr.Set.empty - let get_closures { blocks; _ } = Addr.Map.fold (fun _ block closures -> List.fold_left block.body ~init:closures ~f:(fun closures i -> match i with - | Let (x, Closure (l, cont)), _loc -> - let cont = follow_branch blocks cont in + | Let (x, Closure (cl_params, cl_cont)), _loc -> (* we can compute this once during the pass as the property won't change with inlining *) - let f_optimizable = optimizable blocks (fst cont) true in - Var.Map.add x (l, cont, f_optimizable) closures + let cl_prop = optimizable blocks (fst cl_cont) in + let cl_simpl = + simple_function blocks cl_prop.size x cl_params (fst cl_cont) + in + Var.Map.add x { cl_params; cl_cont; cl_prop; cl_simpl } closures | _ -> closures)) blocks Var.Map.empty @@ -101,149 +151,157 @@ let rewrite_block pc' pc blocks = in Addr.Map.add pc block blocks -(* Skip try body *) -let fold_children blocks pc f accu = - let block = Addr.Map.find pc blocks in - match fst block.branch with - | Return _ | Raise _ | Stop -> accu - | Branch (pc', _) | Poptrap (pc', _) -> f pc' accu - | Pushtrap ((try_body, _), _, (pc1, _)) -> - f pc1 (Addr.Set.fold f (Code.poptraps blocks try_body) accu) - | Cond (_, (pc1, _), (pc2, _)) -> - let accu = f pc1 accu in - let accu = f pc2 accu in - accu - | Switch (_, a1) -> - let accu = Array.fold_right a1 ~init:accu ~f:(fun (pc, _) accu -> f pc accu) in - accu - let rewrite_closure blocks cont_pc clos_pc = - Code.traverse { fold = fold_children } (rewrite_block cont_pc) clos_pc blocks blocks + Code.traverse + { fold = Code.fold_children_skip_try_body } + (rewrite_block cont_pc) + clos_pc + blocks + blocks (****) -let rec find_mapping mapping x = - match mapping with - | [] -> x - | ([], []) :: rest -> find_mapping rest x - | (a :: _, b :: _) :: rest when Code.Var.compare a x = 0 -> find_mapping rest b - | (_ :: ax, _ :: bx) :: rest -> find_mapping ((ax, bx) :: rest) x - | ([], _ | _, []) :: _ -> assert false - -let simple blocks cont mapping = - let map_var mapping x = - let x' = find_mapping mapping x in - if Var.equal x x' then raise Not_found else x' - in - let map_prim_arg mapping = function - | Pc c -> Pc c - | Pv x -> Pv (map_var mapping x) - in - let rec follow seen (pc, args) (instr : [ `Empty | `Ok of 'a ]) mapping = - if Addr.Set.mem pc seen - then `Fail - else - let b = Addr.Map.find pc blocks in - let mapping = (b.params, args) :: mapping in - let instr : [ `Empty | `Ok of 'a | `Fail ] = - match b.body, instr with - | [], _ -> (instr :> [ `Empty | `Ok of 'a | `Fail ]) - | [ (Let (y, exp), _) ], `Empty -> `Ok (y, exp) - | _, _ -> `Fail - in - match instr, b.branch with - | `Fail, _ -> `Fail - | `Empty, (Return ret, _) -> `Alias (map_var mapping ret) - | `Ok (x, exp), (Return ret, _) - when Code.Var.compare x (find_mapping mapping ret) = 0 -> ( - match exp with - | Constant (Float _ | Int64 _ | Int _ | NativeString _) -> `Exp exp - | Apply { f; args; exact = true } -> - `Exp - (Apply - { f = map_var mapping f - ; args = List.map args ~f:(map_var mapping) - ; exact = true - }) - | Prim (prim, args) -> - `Exp (Prim (prim, List.map args ~f:(map_prim_arg mapping))) - | Special _ -> `Exp exp - | Block (tag, args, aon, mut) -> - `Exp (Block (tag, Array.map args ~f:(map_var mapping), aon, mut)) - | Field (x, i) -> `Exp (Field (map_var mapping x, i)) - | Closure _ -> `Fail - | Constant _ -> `Fail - | Apply _ -> `Fail) - | ((`Empty | `Ok _) as instr), (Branch cont, _) -> - follow (Addr.Set.add pc seen) cont instr mapping - | (`Empty | `Ok _), _ -> `Fail - in - try follow Addr.Set.empty cont `Empty mapping with Not_found -> `Fail - let rec args_equal xs ys = match xs, ys with | [], [] -> true | x :: xs, Pv y :: ys -> Code.Var.compare x y = 0 && args_equal xs ys | _ -> false -let inline ~first_class_primitives live_vars closures pc (outer, blocks, free_pc) = - let block = Addr.Map.find pc blocks in - let body, (outer, branch, blocks, free_pc) = +let inline ~first_class_primitives live_vars closures name pc (outer, p) = + let block = Addr.Map.find pc p.blocks in + let body, (outer, branch, p) = List.fold_right block.body - ~init:([], (outer, block.branch, blocks, free_pc)) + ~init:([], (outer, block.branch, p)) ~f:(fun i (rem, state) -> match i with - | Let (x, Apply { f; args; exact = true }), loc when Var.Map.mem f closures -> ( - let outer, branch, blocks, free_pc = state in - let params, clos_cont, { size = f_size; optimizable = f_optimizable } = + | Let (x, Apply { f; args; exact = true; _ }), loc when Var.Map.mem f closures + -> ( + let outer, branch, p = state in + let { cl_params = params + ; cl_cont = clos_cont + ; cl_prop = { size = f_size; optimizable = f_optimizable } + ; cl_simpl + } = Var.Map.find f closures in - match simple blocks clos_cont [ params, args ] with - | `Alias arg -> ( + let map_param_to_arg = + List.fold_left2 + ~f:(fun map a b -> Var.Map.add a b map) + ~init:Var.Map.empty + params + args + in + if live_vars.(Var.idx f) = 1 + && Bool.equal outer.optimizable f_optimizable + (* Inlining the code of an optimizable function could + make this code unoptimized. (wrt to Jit compilers) *) + && f_size < Config.Param.inlining_limit () + then + let blocks, cont_pc, free_pc = match rem, branch with - | [], (Return y, loc) when Var.compare x y = 0 -> - [], (outer, (Return arg, loc), blocks, free_pc) + | [], (Return y, _) when Var.compare x y = 0 -> + (* We do not need a continuation block for tail calls *) + p.blocks, None, p.free_pc | _ -> - let blocks = - Addr.Map.add free_pc { params = [ x ]; body = rem; branch } blocks - in - [], (outer, (Branch (free_pc, [ arg ]), loc), blocks, free_pc + 1)) - | `Exp exp -> (Let (x, exp), loc) :: rem, state - | `Fail -> - if live_vars.(Var.idx f) = 1 - && Bool.equal outer.optimizable f_optimizable - (* Inlining the code of an optimizable function could - make this code unoptimized. (wrt to Jit compilers) *) - && f_size < Config.Param.inlining_limit () - then - let blocks, cont_pc = - match rem, branch with - | [], (Return y, _) when Var.compare x y = 0 -> - (* We do not need a continuation block for tail calls *) - blocks, None - | _ -> - ( Addr.Map.add - free_pc - { params = [ x ]; body = rem; branch } - blocks - , Some free_pc ) + let fresh_addr = p.free_pc in + let free_pc = fresh_addr + 1 in + ( Addr.Map.add + fresh_addr + { params = [ x ]; body = rem; branch } + p.blocks + , Some fresh_addr + , free_pc ) + in + let blocks = rewrite_closure blocks cont_pc (fst clos_cont) in + (* We do not really need this intermediate block. + It just avoids the need to find which function + parameters are used in the function body. *) + let fresh_addr = free_pc in + let free_pc = fresh_addr + 1 in + let blocks = + Addr.Map.add + fresh_addr + { params; body = []; branch = Branch clos_cont, loc } + blocks + in + let outer = { outer with size = outer.size + f_size } in + [], (outer, (Branch (fresh_addr, args), loc), { p with blocks; free_pc }) + else + match cl_simpl with + | Some (bound_vars, free_vars, recursive, tc_params) + (* We inline/duplicate + - single instruction functions (f_size = 1) + - small funtions that call one of their arguments in + tail position when the argument is a direct closure + used only once. *) + when (Code.Var.Set.exists + (fun x -> + let farg_tc = Var.Map.find x map_param_to_arg in + Var.Map.mem farg_tc closures && live_vars.(Var.idx farg_tc) = 1) + tc_params + || f_size <= 1) + && ((not recursive) + || + match name with + | None -> true + | Some f' -> not (Var.equal f f')) -> + let () = + (* Update live_vars *) + Var.Map.iter + (fun fv c -> + if not (Var.equal fv f) + then + let idx = Var.idx fv in + live_vars.(idx) <- live_vars.(idx) + c) + free_vars; + live_vars.(Var.idx f) <- live_vars.(Var.idx f) - 1 in - let blocks = rewrite_closure blocks cont_pc (fst clos_cont) in - (* We do not really need this intermediate block. - It just avoids the need to find which function - parameters are used in the function body. *) - let blocks = - Addr.Map.add - (free_pc + 1) - { params; body = []; branch = Branch clos_cont, loc } - blocks + let p, f, params, clos_cont = + let bound_vars = Var.Set.add f bound_vars in + Duplicate.closure p ~bound_vars ~f ~params ~cont:clos_cont in - let outer = { outer with size = outer.size + f_size } in - [], (outer, (Branch (free_pc + 1, args), loc), blocks, free_pc + 2) - else i :: rem, state) + if recursive + then + ( (Let (f, Closure (params, clos_cont)), No) + :: (Let (x, Apply { f; args; exact = true }), loc) + :: rem + , (outer, branch, p) ) + else + let blocks, cont_pc, free_pc = + match rem, branch with + | [], (Return y, _) when Var.compare x y = 0 -> + (* We do not need a continuation block for tail calls *) + p.blocks, None, p.free_pc + | _ -> + let fresh_addr = p.free_pc in + let free_pc = fresh_addr + 1 in + ( Addr.Map.add + fresh_addr + { params = [ x ]; body = rem; branch } + p.blocks + , Some fresh_addr + , free_pc ) + in + let blocks = rewrite_closure blocks cont_pc (fst clos_cont) in + (* We do not really need this intermediate block. + It just avoids the need to find which function + parameters are used in the function body. *) + let fresh_addr = free_pc in + let free_pc = fresh_addr + 1 in + let blocks = + Addr.Map.add + fresh_addr + { params; body = []; branch = Branch clos_cont, No } + blocks + in + let outer = { outer with size = outer.size + f_size } in + ( [] + , (outer, (Branch (fresh_addr, args), No), { p with blocks; free_pc }) + ) + | _ -> i :: rem, state) | Let (x, Closure (l, (pc, []))), loc when first_class_primitives -> ( - let block = Addr.Map.find pc blocks in + let block = Addr.Map.find pc p.blocks in match block with | { body = [ (Let (y, Prim (Extern prim, args)), _loc) ] ; branch = Return y', _ @@ -258,7 +316,7 @@ let inline ~first_class_primitives live_vars closures pc (outer, blocks, free_pc | _ -> i :: rem, state) | _ -> i :: rem, state) in - outer, Addr.Map.add pc { block with body; branch } blocks, free_pc + outer, { p with blocks = Addr.Map.add pc { block with body; branch } p.blocks } (****) @@ -273,30 +331,32 @@ let f ~target p live_vars = Code.invariant p; let t = Timer.make () in let closures = get_closures p in - let _closures, blocks, free_pc = - Code.fold_closures + let _closures, p = + Code.fold_closures_innermost_first p - (fun name _ (pc, _) (closures, blocks, free_pc) -> + (fun name cl_params (pc, _) (closures, p) -> let traverse outer = Code.traverse { fold = Code.fold_children } - (inline ~first_class_primitives live_vars closures) + (inline ~first_class_primitives live_vars closures name) pc - blocks - (outer, blocks, free_pc) + p.blocks + (outer, p) in match name with | None -> - let _, blocks, free_pc = traverse (optimizable blocks pc true) in - closures, blocks, free_pc + let _, p = traverse (optimizable p.blocks pc) in + closures, p | Some x -> - let l, c, outer = Var.Map.find x closures in - let outer, blocks, free_pc = traverse outer in - let closures = Var.Map.add x (l, c, outer) closures in - closures, blocks, free_pc) - (closures, p.blocks, p.free_pc) + let info = Var.Map.find x closures in + let outer, p = traverse info.cl_prop in + let cl_simpl = simple_function p.blocks outer.size x cl_params pc in + let closures = + Var.Map.add x { info with cl_prop = outer; cl_simpl } closures + in + closures, p) + (closures, p) in if times () then Format.eprintf " inlining: %a@." Timer.print t; - let p = { p with blocks; free_pc } in Code.invariant p; p diff --git a/compiler/lib/instr.ml b/compiler/lib/instr.ml index 1dd0e061f..c5a49984b 100644 --- a/compiler/lib/instr.ml +++ b/compiler/lib/instr.ml @@ -200,10 +200,9 @@ type desc = let ops = let if_v500 = - match Ocaml_version.v with - | `V4_08 | `V4_09 | `V4_10 | `V4_11 | `V4_12 | `V4_13 | `V4_14 -> - fun _ -> K_will_not_happen - | `V5_00 | `V5_01 | `V5_02 -> fun k -> k + match Ocaml_version.compare Ocaml_version.current [ 5; 0 ] < 0 with + | true -> fun _ -> K_will_not_happen + | false -> fun k -> k in let instrs = [| ACC0, KNullary, "ACC0" @@ -367,6 +366,11 @@ let ops = in ops +let find i = + match Array.find_opt ~f:(fun { code; _ } -> Poly.(i = code)) ops with + | None -> assert false + | Some x -> x + let get code i = Char.code code.[i] let getu code pc = diff --git a/compiler/lib/instr.mli b/compiler/lib/instr.mli index 4f0e7b268..43fe2cbfb 100644 --- a/compiler/lib/instr.mli +++ b/compiler/lib/instr.mli @@ -197,6 +197,8 @@ type desc = ; opcode : int } +val find : t -> desc + val get_instr_exn : string -> int -> desc val gets : string -> int -> int diff --git a/compiler/lib/javascript.ml b/compiler/lib/javascript.ml index acd03eee3..1a13813fe 100644 --- a/compiler/lib/javascript.ml +++ b/compiler/lib/javascript.ml @@ -279,6 +279,7 @@ and expression = | ECallTemplate of expression * template * location | EAccess of expression * access_kind * expression | EDot of expression * access_kind * identifier + | EDotPrivate of expression * access_kind * identifier | ENew of expression * arguments option | EVar of ident | EFun of ident option * function_declaration @@ -291,7 +292,11 @@ and expression = | ENum of Num.t | EObj of property_list | ERegexp of string * string option - | EYield of expression option + | EYield of + { delegate : bool + ; expr : expression option + } + | EPrivName of identifier | CoverParenthesizedExpressionAndArrowParameterList of early_error | CoverCallExpressionAndAsyncArrowHead of early_error @@ -336,10 +341,14 @@ and statement = (expression, variable_declaration_kind * for_binding) either * expression * (statement * location) + | ForAwaitOf_statement of + (expression, variable_declaration_kind * for_binding) either + * expression + * (statement * location) | Continue_statement of Label.t option | Break_statement of Label.t option | Return_statement of expression option - (* | With_statement of expression * statement *) + | With_statement of expression * (statement * location) | Labelled_statement of Label.t * (statement * location) | Switch_statement of expression * case_clause list * statement_list option * case_clause list @@ -358,7 +367,7 @@ and block = statement_list and statement_list = (statement * location) list and variable_declaration = - | DeclIdent of binding_ident * initialiser option + | DeclIdent of ident * initialiser option | DeclPattern of binding_pattern * initialiser and variable_declaration_kind = @@ -391,7 +400,7 @@ and class_element = and class_element_name = | PropName of property_name - | PrivName of ident + | PrivName of identifier and ('a, 'b) list_with_rest = { list : 'a list @@ -407,16 +416,16 @@ and for_binding = binding and binding_element = binding * initialiser option and binding = - | BindingIdent of binding_ident + | BindingIdent of ident | BindingPattern of binding_pattern and binding_pattern = - | ObjectBinding of (binding_property, binding_ident) list_with_rest + | ObjectBinding of (binding_property, ident) list_with_rest | ArrayBinding of (binding_element option, binding) list_with_rest and object_target_elt = - | TargetPropertyId of ident * initialiser option - | TargetProperty of property_name * expression + | TargetPropertyId of ident_prop * initialiser option + | TargetProperty of property_name * expression * initialiser option | TargetPropertySpread of expression | TargetPropertyMethod of property_name * method_ @@ -430,11 +439,11 @@ and assignment_target = | ObjectTarget of object_target_elt list | ArrayTarget of array_target_elt list -and binding_ident = ident +and ident_prop = Prop_and_ident of ident and binding_property = | Prop_binding of property_name * binding_element - | Prop_ident of binding_ident * initialiser option + | Prop_ident of ident_prop * initialiser option and function_body = statement_list @@ -446,8 +455,8 @@ and export = | ExportClass of ident * class_declaration | ExportNames of (ident * Utf8_string.t) list (* default *) - | ExportDefaultFun of ident * function_declaration - | ExportDefaultClass of ident * class_declaration + | ExportDefaultFun of ident option * function_declaration + | ExportDefaultClass of ident option * class_declaration | ExportDefaultExpression of expression (* from *) | ExportFrom of @@ -521,7 +530,7 @@ and bound_idents_of_pattern p = match p with | ObjectBinding { list; rest } -> ( List.concat_map list ~f:(function - | Prop_ident (i, _) -> [ i ] + | Prop_ident (Prop_and_ident i, _) -> [ i ] | Prop_binding (_, e) -> bound_idents_of_element e) @ match rest with @@ -556,8 +565,8 @@ end) let dot e l = EDot (e, ANormal, l) -let variable_declaration l = - Variable_statement (Var, List.map l ~f:(fun (i, e) -> DeclIdent (i, Some e))) +let variable_declaration ?(kind = Var) l = + Variable_statement (kind, List.map l ~f:(fun (i, e) -> DeclIdent (i, Some e))) let array l = EArr (List.map l ~f:(fun x -> Element x)) @@ -579,10 +588,17 @@ let rec assignment_target_of_expr' x = let list = List.map l ~f:(function | Property (PNI n, EVar (S { name = n'; _ } as id)) - when Utf8_string.equal n n' -> TargetPropertyId (id, None) - | Property (n, e) -> TargetProperty (n, assignment_target_of_expr' e) + when Utf8_string.equal n n' -> TargetPropertyId (Prop_and_ident id, None) + | Property (n, e) -> + let e, i = + match e with + | EBin (Eq, e, i) -> e, Some (i, N) + | _ -> e, None + in + TargetProperty (n, assignment_target_of_expr' e, i) | CoverInitializedName (_, i, (e, loc)) -> - TargetPropertyId (i, Some (assignment_target_of_expr' e, loc)) + TargetPropertyId + (Prop_and_ident i, Some (assignment_target_of_expr' e, loc)) | PropertySpread e -> TargetPropertySpread (assignment_target_of_expr' e) | PropertyMethod (n, m) -> TargetPropertyMethod (n, m)) in diff --git a/compiler/lib/javascript.mli b/compiler/lib/javascript.mli index 10716a427..2ad6e2e18 100644 --- a/compiler/lib/javascript.mli +++ b/compiler/lib/javascript.mli @@ -196,6 +196,7 @@ and expression = | ECallTemplate of expression * template * location | EAccess of expression * access_kind * expression | EDot of expression * access_kind * identifier + | EDotPrivate of expression * access_kind * identifier | ENew of expression * arguments option | EVar of ident | EFun of ident option * function_declaration @@ -209,7 +210,11 @@ and expression = | ENum of Num.t | EObj of property_list | ERegexp of string * string option - | EYield of expression option + | EYield of + { delegate : bool + ; expr : expression option + } + | EPrivName of identifier | CoverParenthesizedExpressionAndArrowParameterList of early_error | CoverCallExpressionAndAsyncArrowHead of early_error @@ -254,12 +259,14 @@ and statement = (expression, variable_declaration_kind * for_binding) either * expression * (statement * location) + | ForAwaitOf_statement of + (expression, variable_declaration_kind * for_binding) either + * expression + * (statement * location) | Continue_statement of Label.t option | Break_statement of Label.t option | Return_statement of expression option - (* - | With_statement -*) + | With_statement of expression * (statement * location) | Labelled_statement of Label.t * (statement * location) | Switch_statement of expression * case_clause list * statement_list option * case_clause list @@ -278,7 +285,7 @@ and block = statement_list and statement_list = (statement * location) list and variable_declaration = - | DeclIdent of binding_ident * initialiser option + | DeclIdent of ident * initialiser option | DeclPattern of binding_pattern * initialiser and variable_declaration_kind = @@ -311,7 +318,7 @@ and class_element = and class_element_name = | PropName of property_name - | PrivName of ident + | PrivName of identifier and ('a, 'b) list_with_rest = { list : 'a list @@ -327,16 +334,16 @@ and for_binding = binding and binding_element = binding * initialiser option and binding = - | BindingIdent of binding_ident + | BindingIdent of ident | BindingPattern of binding_pattern and binding_pattern = - | ObjectBinding of (binding_property, binding_ident) list_with_rest + | ObjectBinding of (binding_property, ident) list_with_rest | ArrayBinding of (binding_element option, binding) list_with_rest and object_target_elt = - | TargetPropertyId of ident * initialiser option - | TargetProperty of property_name * expression + | TargetPropertyId of ident_prop * initialiser option + | TargetProperty of property_name * expression * initialiser option | TargetPropertySpread of expression | TargetPropertyMethod of property_name * method_ @@ -350,11 +357,11 @@ and assignment_target = | ObjectTarget of object_target_elt list | ArrayTarget of array_target_elt list -and binding_ident = ident +and ident_prop = Prop_and_ident of ident and binding_property = | Prop_binding of property_name * binding_element - | Prop_ident of binding_ident * initialiser option + | Prop_ident of ident_prop * initialiser option and function_body = statement_list @@ -366,8 +373,8 @@ and export = | ExportClass of ident * class_declaration | ExportNames of (ident * Utf8_string.t) list (* default *) - | ExportDefaultFun of ident * function_declaration - | ExportDefaultClass of ident * class_declaration + | ExportDefaultFun of ident option * function_declaration + | ExportDefaultClass of ident option * class_declaration | ExportDefaultExpression of expression (* from *) | ExportFrom of @@ -432,7 +439,8 @@ val array : expression list -> expression val call : expression -> expression list -> location -> expression -val variable_declaration : (ident * initialiser) list -> statement +val variable_declaration : + ?kind:variable_declaration_kind -> (ident * initialiser) list -> statement val list : 'a list -> ('a, _) list_with_rest diff --git a/compiler/lib/js_assign.ml b/compiler/lib/js_assign.ml index 67974304f..c12257d20 100644 --- a/compiler/lib/js_assign.ml +++ b/compiler/lib/js_assign.ml @@ -257,7 +257,9 @@ module Preserve : Strategy = struct let record_block t scope (b : Js_traverse.block) = let defs = match b with - | Catch (p, _) -> bound_idents_of_binding p + | Catch (p, _) -> + bound_idents_of_binding p + @ Javascript.IdentSet.elements scope.Js_traverse.def_local | Normal -> Javascript.IdentSet.elements scope.Js_traverse.def_local | Params _ -> Javascript.IdentSet.elements @@ -380,6 +382,7 @@ let program' (module Strategy : Strategy) p = mapper#get_free in let has_free_var = IdentSet.cardinal free <> 0 in + let unallocated_names = ref Var.Set.empty in let names = Strategy.allocate_variables state ~count:mapper#get_count in (* ignore the choosen name for escaping/free [V _] variables *) IdentSet.iter @@ -389,11 +392,16 @@ let program' (module Strategy : Strategy) p = free; let ident = function | V v -> ( - let name = names.(Var.idx v) in - match name, has_free_var with - | "", true -> V v - | "", false -> assert false - | _, (true | false) -> ident ~var:v (Utf8_string.of_string_exn name)) + if Config.Flag.stable_var () + then + ident ~var:v (Utf8_string.of_string_exn (Printf.sprintf "v%d" (Code.Var.idx v))) + else + let name = names.(Var.idx v) in + match name with + | "" -> + unallocated_names := Var.Set.add v !unallocated_names; + V v + | _ -> ident ~var:v (Utf8_string.of_string_exn name)) | x -> x in let label_printer = Var_printer.create Var_printer.Alphabet.javascript in @@ -408,7 +416,7 @@ let program' (module Strategy : Strategy) p = S (Utf8_string.of_string_exn lname_per_depth.(i)) in let p = (new name ident label)#program p in - (if has_free_var + (if has_free_var || Var.Set.cardinal !unallocated_names > 0 then let () = if not (debug_shortvar () || debug ()) diff --git a/compiler/lib/js_output.ml b/compiler/lib/js_output.ml index c003ef47b..33c57f23f 100644 --- a/compiler/lib/js_output.ml +++ b/compiler/lib/js_output.ml @@ -273,8 +273,10 @@ struct | If_statement (_, _, Some st) | While_statement (_, st) | For_statement (_, _, _, st) + | With_statement (_, st) | ForIn_statement (_, _, st) -> ends_with_if_without_else st | ForOf_statement (_, _, st) -> ends_with_if_without_else st + | ForAwaitOf_statement (_, _, st) -> ends_with_if_without_else st | If_statement (_, _, None) -> true | Block _ | Variable_statement _ @@ -293,11 +295,12 @@ struct | Import _ | Export _ -> false - let starts_with ~obj ~funct ~let_identifier ~async_identifier l e = + let starts_with ~obj ~funct ~class_ ~let_identifier ~async_identifier l e = let rec traverse l e = match e with | EObj _ -> obj | EFun _ -> funct + | EClass _ -> class_ | EVar (S { name = Utf8 "let"; _ }) -> let_identifier | EVar (S { name = Utf8 "async"; _ }) -> async_identifier | ESeq (e, _) -> Prec.(l <= Expression) && traverse Expression e @@ -310,8 +313,14 @@ struct Prec.(l <= out) && traverse lft e | EUn ((IncrA | DecrA), e) -> Prec.(l <= UpdateExpression) && traverse LeftHandSideExpression e - | ECallTemplate (e, _, _) | ECall (e, _, _, _) | EAccess (e, _, _) | EDot (e, _, _) - -> traverse CallOrMemberExpression e + | ECallTemplate (EFun _, _, _) -> + (* We force parens around the function in that case.*) + false + | ECallTemplate (e, _, _) + | ECall (e, _, _, _) + | EAccess (e, _, _) + | EDot (e, _, _) + | EDotPrivate (e, _, _) -> traverse CallOrMemberExpression e | EArrow _ | EVar _ | EStr _ @@ -322,8 +331,54 @@ struct | ERegexp _ | EUn _ | ENew _ - | EClass _ - | EYield _ -> false + | EYield _ + | EPrivName _ -> false + | CoverCallExpressionAndAsyncArrowHead e + | CoverParenthesizedExpressionAndArrowParameterList e -> early_error e + in + traverse l e + + let contains ~in_ l e = + let rec traverse l e = + match e with + | EObj _ -> false + | EFun _ -> false + | EClass _ -> false + | EVar (S { name = Utf8 "in"; _ }) -> true + | ESeq (e1, e2) -> + Prec.(l <= Expression) && (traverse Expression e1 || traverse Expression e2) + | ECond (e1, e2, e3) -> + Prec.(l <= ConditionalExpression) + && (traverse ShortCircuitExpression e1 + || traverse ShortCircuitExpression e2 + || traverse ShortCircuitExpression e3) + | EAssignTarget (ObjectTarget _) -> false + | EAssignTarget (ArrayTarget _) -> false + | EBin (op, e1, e2) -> + let out, lft, rght = op_prec op in + Prec.(l <= out) && (Poly.(op = In && in_) || traverse lft e1 || traverse rght e2) + | EUn ((IncrA | DecrA | IncrB | DecrB), e) -> + Prec.(l <= UpdateExpression) && traverse LeftHandSideExpression e + | EUn (_, e) -> Prec.(l <= UnaryExpression) && traverse UnaryExpression e + | ECallTemplate (EFun _, _, _) -> + (* We force parens around the function in that case.*) + false + | ECallTemplate (e, _, _) + | ECall (e, _, _, _) + | EAccess (e, _, _) + | EDot (e, _, _) + | EDotPrivate (e, _, _) -> traverse CallOrMemberExpression e + | EArrow _ + | EVar _ + | EStr _ + | ETemplate _ + | EArr _ + | EBool _ + | ENum _ + | ERegexp _ + | ENew _ + | EYield _ + | EPrivName _ -> false | CoverCallExpressionAndAsyncArrowHead e | CoverParenthesizedExpressionAndArrowParameterList e -> early_error e in @@ -377,12 +432,13 @@ struct let pp_ident_or_string_lit f (Stdlib.Utf8_string.Utf8 s_lit as s) = if is_ident s_lit then PP.string f s_lit else pp_string_lit f s - let rec comma_list f f_elt l = + let rec comma_list f ~force_last_comma f_elt l = match l with | [] -> () | [ x ] -> PP.start_group f 0; f_elt f x; + if force_last_comma x then PP.string f ","; PP.end_group f | x :: r -> PP.start_group f 0; @@ -390,9 +446,9 @@ struct PP.end_group f; PP.string f ","; PP.space f; - comma_list f f_elt r + comma_list f ~force_last_comma f_elt r - let comma_list_rest f f_elt l f_rest rest = + let comma_list_rest f ~force_last_comma f_elt l f_rest rest = match l, rest with | [], None -> () | [], Some rest -> @@ -400,9 +456,9 @@ struct PP.string f "..."; f_rest f rest; PP.end_group f - | l, None -> comma_list f f_elt l + | l, None -> comma_list f ~force_last_comma f_elt l | l, Some r -> - comma_list f f_elt l; + comma_list f ~force_last_comma:(fun _ -> false) f_elt l; PP.string f ","; PP.space f; PP.start_group f 0; @@ -426,15 +482,7 @@ struct then ( PP.string f ")"; PP.end_group f) - | EFun (i, (k, l, b, pc)) -> - let prefix = - match k with - | { async = false; generator = false } -> "function" - | { async = true; generator = false } -> "async function" - | { async = true; generator = true } -> "async function*" - | { async = false; generator = true } -> "function*" - in - function_declaration f prefix ident i l b pc + | EFun (i, decl) -> function_declaration' f i decl | EClass (i, cl_decl) -> class_declaration f i cl_decl | EArrow ((k, p, b, pc), consise, _) -> if Prec.(l > AssignementExpression) @@ -449,7 +497,6 @@ struct PP.non_breaking_space f | { async = false; generator = false } -> () | { async = true | false; generator = true } -> assert false); - PP.break f; (match p with | { list = [ ((BindingIdent _, None) as x) ]; rest = None } -> formal_parameter f x; @@ -515,7 +562,7 @@ struct PP.string f "("); output_debug_info f loc; PP.start_group f 1; - expression CallOrMemberExpression f e; + parenthesized_expression ~funct:true CallOrMemberExpression f e; PP.break f; PP.start_group f 1; template f t; @@ -693,19 +740,30 @@ struct | EAssignTarget t -> ( let property f p = match p with - | TargetPropertyId (id, None) -> ident f id - | TargetPropertyId (id, Some (e, _)) -> + | TargetPropertyId (Prop_and_ident id, None) -> ident f id + | TargetPropertyId (Prop_and_ident id, Some (e, _)) -> ident f id; PP.space f; PP.string f "="; PP.space f; expression AssignementExpression f e - | TargetProperty (pn, e) -> + | TargetProperty (pn, e, None) -> + PP.start_group f 0; + property_name f pn; + PP.string f ":"; + PP.space f; + expression AssignementExpression f e; + PP.end_group f + | TargetProperty (pn, e, Some (ini, _)) -> PP.start_group f 0; property_name f pn; PP.string f ":"; PP.space f; expression AssignementExpression f e; + PP.space f; + PP.string f "="; + PP.space f; + expression AssignementExpression f ini; PP.end_group f | TargetPropertySpread e -> PP.string f "..."; @@ -731,13 +789,19 @@ struct | ObjectTarget list -> PP.start_group f 1; PP.string f "{"; - comma_list f property list; + comma_list f ~force_last_comma:(fun _ -> false) property list; PP.string f "}"; PP.end_group f | ArrayTarget list -> PP.start_group f 1; PP.string f "["; - comma_list f element list; + comma_list + f + ~force_last_comma:(function + | TargetElementHole -> true + | _ -> false) + element + list; PP.string f "]"; PP.end_group f) | EArr el -> @@ -776,6 +840,19 @@ struct | ANormal -> PP.string f "." | ANullish -> PP.string f "?."); PP.string f nm + | EDotPrivate (e, access_kind, Utf8 nm) -> + (* We keep tracks of whether call expression are allowed + without parentheses within this expression *) + let l' = + match l with + | NewExpression | MemberExpression -> MemberExpression + | _ -> CallOrMemberExpression + in + expression l' f e; + (match access_kind with + | ANormal -> PP.string f ".#" + | ANullish -> PP.string f "?.#"); + PP.string f nm | ENew (e, None) -> if Prec.(l > NewExpression) then ( @@ -845,16 +922,21 @@ struct match opt with | None -> () | Some o -> PP.string f o) - | EYield e -> ( + | EYield { delegate; expr = e } -> ( + let kw = + match delegate with + | false -> "yield" + | true -> "yield*" + in match e with - | None -> PP.string f "yield" + | None -> PP.string f kw | Some e -> if Prec.(l > AssignementExpression) then ( PP.start_group f 1; PP.string f "("); PP.start_group f 7; - PP.string f "yield"; + PP.string f kw; PP.non_breaking_space f; PP.start_group f 0; expression AssignementExpression f e; @@ -862,10 +944,13 @@ struct PP.end_group f; if Prec.(l > AssignementExpression) then ( - PP.start_group f 1; + PP.end_group f; PP.string f ")" (* There MUST be a space between the yield and its argument. A line return will not work *))) + | EPrivName (Utf8 i) -> + PP.string f "#"; + PP.string f i | CoverCallExpressionAndAsyncArrowHead e | CoverParenthesizedExpressionAndArrowParameterList e -> early_error e @@ -889,7 +974,7 @@ struct expression Expression f e; PP.string f "]" - and property_list f l = comma_list f property l + and property_list f l = comma_list f ~force_last_comma:(fun _ -> false) property l and property f p = match p with @@ -937,7 +1022,14 @@ struct in function_declaration f "" fpn (Some ()) l b loc' - and element_list f el = comma_list f element el + and element_list f el = + comma_list + f + ~force_last_comma:(function + | ElementHole -> true + | _ -> false) + element + el and element f (e : element) = match e with @@ -955,7 +1047,13 @@ struct and formal_parameter f e = binding_element f e and formal_parameter_list f { list; rest } = - comma_list_rest f formal_parameter list binding rest + comma_list_rest + f + ~force_last_comma:(fun _ -> false) + formal_parameter + list + binding + rest and function_body f b = statement_list f ~skip_last_semi:true b @@ -968,9 +1066,9 @@ struct expression AssignementExpression f e); PP.end_group f - and arguments f l = comma_list f argument l + and arguments f l = comma_list f ~force_last_comma:(fun _ -> false) argument l - and variable_declaration f x = + and variable_declaration f ?(in_ = true) x = match x with | DeclIdent (i, None) -> ident f i | DeclIdent (i, Some (e, loc)) -> @@ -983,7 +1081,16 @@ struct PP.end_group f; PP.start_group f 1; PP.space f; + let p = (not in_) && contains ~in_:true Expression e in + if p + then ( + PP.start_group f 1; + PP.string f "("); expression AssignementExpression f e; + if p + then ( + PP.string f ")"; + PP.end_group f); PP.end_group f; PP.end_group f | DeclPattern (p, (e, loc)) -> @@ -996,7 +1103,16 @@ struct PP.end_group f; PP.start_group f 1; PP.space f; + let p = (not in_) && contains ~in_:true Expression e in + if p + then ( + PP.start_group f 1; + PP.string f "("); expression AssignementExpression f e; + if p + then ( + PP.string f ")"; + PP.end_group f); PP.end_group f; PP.end_group f @@ -1007,8 +1123,8 @@ struct PP.string f ":"; PP.space f; binding_element f e - | Prop_ident (i, None) -> ident f i - | Prop_ident (i, Some (e, loc)) -> + | Prop_ident (Prop_and_ident i, None) -> ident f i + | Prop_ident (Prop_and_ident i, Some (e, loc)) -> ident f i; PP.space f; PP.string f "="; @@ -1042,25 +1158,39 @@ struct | ObjectBinding { list; rest } -> PP.start_group f 1; PP.string f "{"; - comma_list_rest f binding_property list ident rest; + comma_list_rest + f + ~force_last_comma:(fun _ -> false) + binding_property + list + ident + rest; PP.string f "}"; PP.end_group f | ArrayBinding { list; rest } -> PP.start_group f 1; PP.string f "["; - comma_list_rest f binding_array_elt list binding rest; + comma_list_rest + f + ~force_last_comma:(function + | None -> true + | Some _ -> false) + binding_array_elt + list + binding + rest; PP.string f "]"; PP.end_group f - and variable_declaration_list_aux f l = + and variable_declaration_list_aux f ?in_ l = match l with | [] -> assert false - | [ d ] -> variable_declaration f d + | [ d ] -> variable_declaration f ?in_ d | d :: r -> - variable_declaration f d; + variable_declaration f ?in_ d; PP.string f ","; PP.space f; - variable_declaration_list_aux f r + variable_declaration_list_aux f ?in_ r and variable_declaration_kind f kind = match kind with @@ -1068,7 +1198,7 @@ struct | Let -> PP.string f "let" | Const -> PP.string f "const" - and variable_declaration_list kind close f = function + and variable_declaration_list ?in_ kind close f = function | [] -> () | [ x ] -> let x, loc = @@ -1081,14 +1211,14 @@ struct output_debug_info f loc; variable_declaration_kind f kind; PP.space f; - variable_declaration f x; + variable_declaration f ?in_ x; if close then PP.string f ";"; PP.end_group f | l -> PP.start_group f 1; variable_declaration_kind f kind; PP.space f; - variable_declaration_list_aux f l; + variable_declaration_list_aux f ?in_ l; if close then PP.string f ";"; PP.end_group f @@ -1096,12 +1226,14 @@ struct ?(last_semi = fun () -> ()) ?(obj = false) ?(funct = false) + ?(class_ = false) ?(let_identifier = false) ?(async_identifier = false) + ?(force = false) l f e = - if starts_with ~obj ~funct ~let_identifier ~async_identifier l e + if force || starts_with ~obj ~funct ~class_ ~let_identifier ~async_identifier l e then ( PP.start_group f 1; PP.string f "("; @@ -1136,15 +1268,7 @@ struct match s with | Block b -> block f b | Variable_statement (k, l) -> variable_declaration_list k (not can_omit_semi) f l - | Function_declaration (i, (k, l, b, loc')) -> - let prefix = - match k with - | { async = false; generator = false } -> "function" - | { async = true; generator = false } -> "async function" - | { async = true; generator = true } -> "async function*" - | { async = false; generator = true } -> "function*" - in - function_declaration f prefix ident (Some i) l b loc' + | Function_declaration (i, decl) -> function_declaration' f (Some i) decl | Class_declaration (i, cl_decl) -> class_declaration f (Some i) cl_decl | Empty_statement -> PP.string f ";" | Debugger_statement -> @@ -1158,6 +1282,7 @@ struct ~last_semi ~obj:true ~funct:true + ~class_:true ~let_identifier:true Expression f @@ -1233,9 +1358,10 @@ struct (match e1 with | Left None -> () | Left (Some e) -> - (* Should not starts with "let [" *) - parenthesized_expression ~let_identifier:true Expression f e - | Right (k, l) -> variable_declaration_list k false f l); + (* Should not starts with "let [" and should not contain "in" *) + let force = contains ~in_:true Expression e in + parenthesized_expression ~force ~let_identifier:true Expression f e + | Right (k, l) -> variable_declaration_list k ~in_:false false f l); PP.string f ";"; (match e2 with | None -> () @@ -1263,7 +1389,7 @@ struct (match e1 with | Left e -> (* Should not starts with "let [" *) - parenthesized_expression ~let_identifier:true Expression f e + parenthesized_expression ~let_identifier:true LeftHandSideExpression f e | Right (k, v) -> for_binding f k v); PP.space f; PP.string f "in"; @@ -1288,7 +1414,7 @@ struct parenthesized_expression ~let_identifier:true ~async_identifier:true - Expression + LeftHandSideExpression f e | Right (k, v) -> for_binding f k v); @@ -1296,7 +1422,29 @@ struct PP.string f "of"; PP.break f; PP.space f; - expression Expression f e2; + expression AssignementExpression f e2; + PP.string f ")"; + PP.end_group f; + PP.end_group f; + statement1 ~last f s; + PP.end_group f + | ForAwaitOf_statement (e1, e2, s) -> + PP.start_group f 0; + PP.start_group f 0; + PP.string f "for await"; + PP.break f; + PP.start_group f 1; + PP.string f "("; + (match e1 with + | Left e -> + (* Should not starts with "let" *) + parenthesized_expression ~let_identifier:true LeftHandSideExpression f e + | Right (k, v) -> for_binding f k v); + PP.space f; + PP.string f "of"; + PP.break f; + PP.space f; + expression AssignementExpression f e2; PP.string f ")"; PP.end_group f; PP.end_group f; @@ -1452,6 +1600,14 @@ struct PP.string f "finally"; block f b); PP.end_group f + | With_statement (e, s) -> + PP.start_group f 0; + PP.string f "with("; + expression Expression f e; + PP.string f ")"; + PP.break f; + statement f s; + PP.end_group f | Import ({ kind; from }, _loc) -> PP.start_group f 0; PP.string f "import"; @@ -1478,6 +1634,7 @@ struct PP.space f; comma_list f + ~force_last_comma:(fun _ -> false) (fun f (s, i) -> if match i with | S { name; _ } when Stdlib.Utf8_string.equal name s -> true @@ -1508,6 +1665,7 @@ struct PP.string f "{"; PP.space f; comma_list + ~force_last_comma:(fun _ -> false) f (fun f (i, s) -> if match i with @@ -1532,6 +1690,7 @@ struct PP.string f "{"; PP.space f; comma_list + ~force_last_comma:(fun _ -> false) f (fun f (a, b) -> if Stdlib.Utf8_string.equal a b @@ -1548,11 +1707,6 @@ struct PP.space f; pp_string_lit f from; PP.string f ";" - | ExportDefaultExpression ((EFun _ | EClass _) as e) -> - PP.space f; - PP.string f "default"; - PP.space f; - expression Expression f e | ExportDefaultExpression e -> PP.space f; PP.string f "default"; @@ -1561,26 +1715,27 @@ struct ~last_semi ~obj:true ~funct:true + ~class_:true ~let_identifier:true Expression f e - | ExportDefaultFun (id, decl) -> + | ExportDefaultFun (i, decl) -> PP.space f; PP.string f "default"; PP.space f; - statement f (Function_declaration (id, decl), loc) + function_declaration' f i decl | ExportDefaultClass (id, decl) -> PP.space f; PP.string f "default"; PP.space f; - statement f (Class_declaration (id, decl), loc) + class_declaration f id decl | ExportFun (id, decl) -> PP.space f; - statement f (Function_declaration (id, decl), loc) + function_declaration' f (Some id) decl | ExportClass (id, decl) -> PP.space f; - statement f (Class_declaration (id, decl), loc) + class_declaration f (Some id) decl | ExportVar (k, l) -> PP.space f; variable_declaration_list k (not can_omit_semi) f l @@ -1637,6 +1792,16 @@ struct PP.string f "}"; PP.end_group f + and function_declaration' f (name : _ option) (k, l, b, loc') = + let prefix = + match k with + | { async = false; generator = false } -> "function" + | { async = true; generator = false } -> "async function" + | { async = true; generator = true } -> "async function*" + | { async = false; generator = true } -> "function*" + in + function_declaration f prefix ident name l b loc' + and class_declaration f i x = PP.start_group f 1; PP.start_group f 0; @@ -1652,7 +1817,7 @@ struct PP.space f; PP.string f "extends"; PP.space f; - expression Expression f e; + expression LeftHandSideExpression f e; PP.space f); PP.end_group f; PP.start_group f 2; @@ -1682,7 +1847,7 @@ struct PP.string f "="; PP.space f; output_debug_info f loc; - expression Expression f e); + expression AssignementExpression f e); PP.string f ";"; PP.end_group f | CEStaticBLock l -> @@ -1700,9 +1865,9 @@ struct and class_element_name f x = match x with | PropName n -> property_name f n - | PrivName i -> + | PrivName (Utf8 i) -> PP.string f "#"; - ident f i + PP.string f i and program f s = statement_list f s end @@ -1849,6 +2014,7 @@ let program ?(accept_unnamed_var = false) f ?source_map p = in Some { sm with Source_map.sources; names; sources_content; mappings } in + PP.check f; (if stats () then let size i = Printf.sprintf "%.2fKo" (float_of_int i /. 1024.) in diff --git a/compiler/lib/js_parser.mly b/compiler/lib/js_parser.mly index 8c31449a4..b649a8acd 100644 --- a/compiler/lib/js_parser.mly +++ b/compiler/lib/js_parser.mly @@ -171,6 +171,8 @@ T_BACKQUOTE (*-----------------------------------------*) %token T_VIRTUAL_SEMICOLON +%token T_VIRTUAL_SEMICOLON_DO_WHILE +%token T_VIRTUAL_SEMICOLON_EXPORT_DEFAULT %token T_LPAREN_ARROW %token T_INCR_NB T_DECR_NB @@ -230,14 +232,28 @@ listc_rev(X): | listc_rev(X) { List.rev $1 } listc_with_empty_trail_rev(X): - | e=elision { (List.rev_map (fun () -> None) e) } - | x=X e=elision { List.rev_append (List.rev_map (fun () -> None) e) [ Some x ] } - | listc_with_empty_trail_rev(X) x=X e=elision { List.rev_append (List.rev_map (fun () -> None) e) (Some x :: $1) } + | "," { [ None ] } + | X "," { [ Some $1 ] } + | listc_with_empty_trail_rev(X) X "," { Some $2 :: $1 } + | listc_with_empty_trail_rev(X) "," { None :: $1 } listc_with_empty(X): - | X { [ Some $1 ] } - | listc_with_empty_trail_rev(X) { List.rev $1 } - | listc_with_empty_trail_rev(X) X { List.rev ((Some $2) :: $1) } + | listc_with_empty_trail_rev(X) x=X? { + match x with + | None -> List.rev $1 + | Some _ -> List.rev (x :: $1) + } + | x=X { [ Some x ] } + | (* empty *) { [] } + +listc_with_empty2(X,Y): + | listc_with_empty_trail_rev(X) x=X { List.rev (Some x :: $1), None } + | listc_with_empty_trail_rev(X) { List.rev $1, None } + | listc_with_empty_trail_rev(X) y=Y { List.rev $1, Some y } + | X { [Some $1], None } + | Y { [], Some $1 } + | (* empty *) { [], None } + optl(X): | (* empty *) { [] } | X { $1 } @@ -271,6 +287,8 @@ decl: { let i,f = $1 in Function_declaration (i,f), p $symbolstartpos } | generator_decl { let i,f = $1 in Function_declaration (i,f), p $symbolstartpos } + | async_generator_decl + { let i,f = $1 in Function_declaration (i,f), p $symbolstartpos } | async_decl { let i,f = $1 in Function_declaration (i,f), p $symbolstartpos } | lexical_decl { $1, p $symbolstartpos } @@ -317,8 +335,8 @@ import_specifier: %inline string_or_ident: | T_STRING { `String, fst $1, $symbolstartpos } - | T_DEFAULT { `Ident, Stdlib.Utf8_string.of_string_exn "default", $symbolstartpos } | id { `Ident, $1, $symbolstartpos } + | ident_keyword { `Ident, $1, $symbolstartpos } module_specifier: | T_STRING { (fst $1) } @@ -327,6 +345,16 @@ module_specifier: (* export *) (*----------------------------*) +export_fun_class: + | function_expr { $1 } + | class_expr { $1 } + (* es6: *) + | generator_expr { $1 } + (* es7: *) + | async_function_expr { $1 } + | async_generator_expr{ $1 } + + export_decl: | T_EXPORT names=export_clause sc { let exception Invalid of Lexing.position in @@ -362,15 +390,24 @@ export_decl: in let pos = $symbolstartpos in Export (k,pi pos), p pos } - (* in theory just func/gen/class, no lexical_decl *) - | T_EXPORT T_DEFAULT e=assignment_expr sc + | T_EXPORT T_DEFAULT e=assignment_expr_no_stmt sc + { + let k = ExportDefaultExpression e in + let pos = $symbolstartpos in + Export (k,pi pos), p pos } + | T_EXPORT T_DEFAULT e=object_literal sc + { + let k = ExportDefaultExpression e in + let pos = $symbolstartpos in + Export (k,pi pos), p pos } + | T_EXPORT T_DEFAULT e=export_fun_class endrule(sc | T_VIRTUAL_SEMICOLON_EXPORT_DEFAULT { () } ) { let k = match e with - | EFun (Some id, decl) -> + | EFun (id, decl) -> ExportDefaultFun (id,decl) - | EClass (Some id, decl) -> + | EClass (id, decl) -> ExportDefaultClass (id, decl) - | e -> ExportDefaultExpression e + | _ -> assert false in let pos = $symbolstartpos in Export (k,pi pos), p pos } @@ -466,10 +503,7 @@ object_binding_pattern: { ObjectBinding {list=l;rest= Some r} } binding_property: - | i=ident e=initializer_? { let id = match i with - | S { name; _ } -> name - | _ -> assert false in - Prop_binding (PNI id, (BindingIdent i, e)) } + | i=ident e=initializer_? { Prop_ident (Prop_and_ident i, e) } | pn=property_name ":" e=binding_element { Prop_binding (pn, e) } binding_property_rest: @@ -482,20 +516,10 @@ binding_element: (* array destructuring *) -(* TODO use elision below. - * invent a new Hole category or maybe an array_argument special - * type like for the (call)argument type. - *) array_binding_pattern: - | "[" "]" { ArrayBinding (list []) } - | "[" r=binding_element_rest "]" { ArrayBinding {list = []; rest = Some r }} - | "[" l=binding_element_list "]" { ArrayBinding (list l) } - | "[" l=binding_element_list r=binding_element_rest "]" - { ArrayBinding {list=l;rest= Some r} } - -(* can't use listc() here, it's $1 not [$1] below *) -binding_element_list: - | l=listc_with_empty(binding_element) { l } + | "[" l=listc_with_empty2(binding_element, binding_element_rest) "]" { + ArrayBinding {list = fst l; rest = snd l } + } binding_element_rest: (* can appear only at the end of a array_binding_pattern in ECMA *) @@ -568,6 +592,18 @@ async_function_expr: | T_ASYNC T_FUNCTION name=ident? args=call_signature "{" b=function_body "}" { EFun (name, ({async = true; generator = false}, args, b, p $symbolstartpos)) } +(*************************************************************************) +(* async generators *) +(*************************************************************************) + +async_generator_decl: + | T_ASYNC T_FUNCTION "*" name=ident args=call_signature "{" b=function_body "}" + { (name, ({async = true; generator = true}, args, b, p $symbolstartpos)) } + +async_generator_expr: + | T_ASYNC T_FUNCTION "*" name=ident? args=call_signature "{" b=function_body "}" + { EFun (name, ({async = true; generator = true}, args, b, p $symbolstartpos)) } + (*************************************************************************) (* Class declaration *) (*************************************************************************) @@ -604,7 +640,7 @@ class_element: class_property_name: | property_name { PropName $1 } - | T_POUND ident { PrivName $2 } + | T_POUND id { PrivName $2 } method_definition(name): | T_GET name=name args=call_signature "{" b=function_body "}" { name, MethodGet(({async = false; generator = false}, args, b, p $symbolstartpos)) } @@ -638,6 +674,7 @@ stmt1: | switch_stmt { $1 } | throw_stmt { $1 } | try_stmt { $1 } + | with_stmt { $1 } | debugger_stmt { $1 } label: @@ -662,7 +699,7 @@ if_stmt: { If_statement (c, t, None) } iteration_stmt: - | T_DO body=stmt T_WHILE "(" condition=expr ")" sc + | T_DO body=stmt T_WHILE "(" condition=expr ")" endrule(sc | T_VIRTUAL_SEMICOLON_DO_WHILE { () } ) { Do_while_statement (body, condition) } | T_WHILE "(" condition=expr ")" body=stmt { While_statement (condition, body) } @@ -683,6 +720,11 @@ iteration_stmt: ForOf_statement (Left left, right, body) } | T_FOR "(" left=for_single_variable_decl T_OF right=assignment_expr ")" body=stmt { ForOf_statement (Right left, right, body) } + | T_FOR T_AWAIT "(" left=left_hand_side_expr T_OF right=assignment_expr ")" body=stmt + { let left = assignment_target_of_expr None left in + ForAwaitOf_statement (Left left, right, body) } + | T_FOR T_AWAIT "(" left=for_single_variable_decl T_OF right=assignment_expr ")" body=stmt + { ForAwaitOf_statement (Right left, right, body) } initializer_no_in: | "=" e=assignment_expr_no_in { e, p $symbolstartpos } @@ -708,6 +750,9 @@ labelled_stmt: throw_stmt: | T_THROW e=expr sc { (Throw_statement e) } +with_stmt: + | T_WITH "(" e=expr ")" s=stmt { (With_statement (e,s)) } + try_stmt: | T_TRY b=block c=catch { (Try_statement (b, Some c, None)) } | T_TRY b=block f=finally { (Try_statement (b, None, Some f)) } @@ -721,7 +766,7 @@ finally: | T_FINALLY b=block { b } debugger_stmt: - | T_DEBUGGER { Debugger_statement } + | T_DEBUGGER sc { Debugger_statement } (*----------------------------*) (* auxillary stmts *) @@ -754,9 +799,9 @@ assignment_expr: } | arrow_function { $1 } | async_arrow_function { $1 } - | T_YIELD { EYield None } - | T_YIELD e=assignment_expr { EYield (Some e) } - | T_YIELD "*" e=assignment_expr { EYield (Some e) } + | T_YIELD { EYield { delegate= false; expr = None } } + | T_YIELD e=assignment_expr { EYield {delegate=false; expr = (Some e) } } + | T_YIELD "*" e=assignment_expr { EYield {delegate=true; expr = (Some e) } } left_hand_side_expr: left_hand_side_expr_(d1) { $1 } @@ -856,6 +901,8 @@ call_expr(x): | T_SUPER a=arguments { ECall(vartok $startpos($1) T_SUPER,ANormal, a, p $symbolstartpos) } | e=call_expr(x) a=access i=method_name { EDot (e,a,i) } + | e=call_expr(x) a=access T_POUND i=method_name + { EDotPrivate (e,a,i) } new_expr(x): | e=member_expr(x) { e } @@ -867,7 +914,9 @@ access: member_expr(x): | e=primary_expr(x) - { e } + { e } + | T_IMPORT "." T_META + { EDot (vartok $startpos($1) T_IMPORT,ANormal,(Stdlib.Utf8_string.of_string_exn "meta")) } | e1=member_expr(x) "[" e2=expr "]" { (EAccess (e1,ANormal, e2)) } | e1=member_expr(x) T_PLING_PERIOD "[" e2=expr "]" @@ -884,7 +933,8 @@ member_expr(x): { (EDot(vartok $startpos($1) T_SUPER,ak,i)) } | T_NEW "." T_TARGET { (EDot(vartok $startpos($1) T_NEW,ANormal,Stdlib.Utf8_string.of_string_exn "target")) } - + | e1=member_expr(x) a=access T_POUND i=field_name + { (EDotPrivate(e1,a,i)) } primary_expr(x): | e=primary_expr_no_braces | e=x { e } @@ -899,11 +949,13 @@ primary_with_stmt: | generator_expr { $1 } (* es7: *) | async_function_expr { $1 } + | async_generator_expr{ $1 } primary_expr_no_braces: | T_THIS { EVar (var (p $symbolstartpos) (Stdlib.Utf8_string.of_string_exn "this")) } | i=ident { EVar i } + | T_POUND id { EPrivName $2 } | n=null_literal { n } | b=boolean_literal { b } | n=numeric_literal { ENum (Num.of_string_unsafe n) } @@ -970,7 +1022,6 @@ assignment_operator: (*----------------------------*) array_literal: - | "[" "]" { EArr [] } | "[" l=listc_with_empty (element) "]" { (EArr (List.map (function None -> ElementHole | Some x -> x) l)) } @@ -1112,9 +1163,9 @@ assignment_expr_no_stmt: | arrow_function { $1 } | async_arrow_function { $1 } (* es6: *) - | T_YIELD { EYield None } - | T_YIELD e=assignment_expr { EYield (Some e) } - | T_YIELD "*" e=assignment_expr { EYield (Some e) } + | T_YIELD { EYield {delegate = false; expr = None} } + | T_YIELD e=assignment_expr { EYield {delegate = false; expr = Some e } } + | T_YIELD "*" e=assignment_expr { EYield { delegate = true; expr = (Some e) } } primary_for_consise_body: @@ -1124,6 +1175,7 @@ primary_for_consise_body: | generator_expr { $1 } (* es7: *) | async_function_expr { $1 } + | async_generator_expr{ $1 } assignment_expr_for_consise_body: | conditional_expr(primary_for_consise_body) { $1 } @@ -1136,9 +1188,9 @@ assignment_expr_for_consise_body: | arrow_function { $1 } | async_arrow_function { $1 } (* es6: *) - | T_YIELD { EYield None } - | T_YIELD e=assignment_expr { EYield (Some e) } - | T_YIELD "*" e=assignment_expr { EYield (Some e) } + | T_YIELD { EYield { delegate = false; expr = None } } + | T_YIELD e=assignment_expr { EYield {delegate = false; expr = (Some e) } } + | T_YIELD "*" e=assignment_expr { EYield {delegate = true; expr = (Some e) } } (* no object_literal here *) primary_no_stmt: T_ERROR TComment { assert false } @@ -1157,7 +1209,7 @@ ident: (* add here keywords which are not considered reserved by ECMA *) ident_semi_keyword: (* TODO: would like to add T_IMPORT here, but cause conflicts *) - (* can have AS and ASYNC here but need to restrict arrow_function then *) + | T_AS { T_AS } | T_ASYNC { T_ASYNC } | T_FROM { T_FROM } | T_GET { T_GET } @@ -1245,7 +1297,3 @@ property_name: sc: | ";" { $1 } | T_VIRTUAL_SEMICOLON { $1 } - -elision: - | "," { [] } - | elision "," { () :: $1 } diff --git a/compiler/lib/js_simpl.ml b/compiler/lib/js_simpl.ml index f552f5249..ba61a7df4 100644 --- a/compiler/lib/js_simpl.ml +++ b/compiler/lib/js_simpl.ml @@ -72,8 +72,10 @@ let rec enot_rec e = | J.ECallTemplate _ | J.EAccess _ | J.EDot _ + | J.EDotPrivate _ | J.ENew _ | J.EVar _ + | J.EPrivName _ | J.EFun _ | J.EArrow _ | J.EStr _ @@ -160,10 +162,10 @@ let rec depth = function | For_statement (_, _, _, (s, _)) -> depth s + 1 | ForIn_statement (_, _, (s, _)) -> depth s + 1 | ForOf_statement (_, _, (s, _)) -> depth s + 1 + | ForAwaitOf_statement (_, _, (s, _)) -> depth s + 1 | Continue_statement _ -> 1 | Break_statement _ -> 1 | Return_statement _ -> 1 - (* | With_statement of expression * statement *) | Labelled_statement (_, (s, _)) -> depth s | Switch_statement (_, c1, None, c2) -> max @@ -178,6 +180,7 @@ let rec depth = function | Throw_statement _ -> 1 | Try_statement (b, _, None) -> depth_block b + 1 | Try_statement (b, _, Some b2) -> max (depth_block b) (depth_block b2) + 1 + | With_statement (_, (st, _)) -> depth st + 1 | Debugger_statement -> 1 | Import _ -> 1 | Export _ -> 1 @@ -218,7 +221,7 @@ let rec if_statement_2 e loc iftrue truestop iffalse falsestop = if Poly.(e1 = e) then J.EBin (J.Or, e, e2) else J.ECond (e, e1, e2) in [ J.Variable_statement (Var, [ DeclPattern (p1, (exp, loc)) ]), loc ] - | _ -> assert false + | _ -> raise Not_assignment with Not_assignment -> ( try let e1 = expression_of_statement iftrue in diff --git a/compiler/lib/js_token.ml b/compiler/lib/js_token.ml index e6a4a7b61..9e3780b05 100644 --- a/compiler/lib/js_token.ml +++ b/compiler/lib/js_token.ml @@ -153,6 +153,8 @@ type t = | T_ERROR of string | T_EOF | T_VIRTUAL_SEMICOLON + | T_VIRTUAL_SEMICOLON_DO_WHILE + | T_VIRTUAL_SEMICOLON_EXPORT_DEFAULT | T_DECR_NB | T_INCR_NB | T_LPAREN_ARROW @@ -264,6 +266,8 @@ let to_string = function | T_TYPEOF -> "typeof" | T_VOID -> "void" | T_VIRTUAL_SEMICOLON -> ";" + | T_VIRTUAL_SEMICOLON_DO_WHILE -> ";" + | T_VIRTUAL_SEMICOLON_EXPORT_DEFAULT -> ";" | T_ARROW -> "=>" | T_AT -> "@" | T_POUND -> "#" @@ -316,6 +320,8 @@ let to_string_extra x = | T_DECR_NB -> " (DECR_NB)" | T_DECR -> " (DECR)" | T_VIRTUAL_SEMICOLON -> " (virtual)" + | T_VIRTUAL_SEMICOLON_DO_WHILE -> " (virtual-do-while)" + | T_VIRTUAL_SEMICOLON_EXPORT_DEFAULT -> " (virtual-export-default)" | TAnnot _ -> "(annot)" | T_ERROR _ -> "(error)" | T_LPAREN_ARROW -> "(arrow)" diff --git a/compiler/lib/js_token.mli b/compiler/lib/js_token.mli index 2771555d8..df389d9b6 100644 --- a/compiler/lib/js_token.mli +++ b/compiler/lib/js_token.mli @@ -152,6 +152,8 @@ type t = | T_ERROR of string | T_EOF | T_VIRTUAL_SEMICOLON + | T_VIRTUAL_SEMICOLON_DO_WHILE + | T_VIRTUAL_SEMICOLON_EXPORT_DEFAULT | T_DECR_NB | T_INCR_NB | T_LPAREN_ARROW diff --git a/compiler/lib/js_traverse.ml b/compiler/lib/js_traverse.ml index fdf631616..aea066c1e 100644 --- a/compiler/lib/js_traverse.ml +++ b/compiler/lib/js_traverse.ml @@ -23,6 +23,8 @@ open Javascript class type mapper = object method loc : Javascript.location -> Javascript.location + method parse_info : Parse_info.t -> Parse_info.t + method expression : Javascript.expression -> Javascript.expression method expression_o : Javascript.expression option -> Javascript.expression option @@ -50,6 +52,8 @@ class type mapper = object -> Javascript.for_binding -> Javascript.for_binding + method binding_property : Javascript.binding_property -> Javascript.binding_property + method variable_declaration : Javascript.variable_declaration_kind -> Javascript.variable_declaration @@ -80,14 +84,20 @@ end (* generic js ast walk/map *) class map : mapper = object (m) - method loc i = i + method loc = + function + | N -> N + | U -> U + | Pi x -> Pi (m#parse_info x) + + method parse_info i = i method ident i = match i with | V v -> V v | S { name; var; loc } -> S { name; var; loc = m#loc loc } - method private early_error e = e + method private early_error { reason; loc } = { reason; loc = m#parse_info loc } method statements l = List.map l ~f:(fun (s, pc) -> m#statement s, m#loc pc) @@ -123,7 +133,7 @@ class map : mapper = method private class_element_name x = match x with | PropName n -> PropName (m#property_name n) - | PrivName x -> PrivName (m#ident x) + | PrivName x -> PrivName x method block l = m#statements l @@ -168,6 +178,13 @@ class map : mapper = | Right (k, d) -> Right (k, m#for_binding k d) in ForOf_statement (e1, m#expression e2, (m#statement s, m#loc loc)) + | ForAwaitOf_statement (e1, e2, (s, loc)) -> + let e1 = + match e1 with + | Left e -> Left (m#expression e) + | Right (k, d) -> Right (k, m#for_binding k d) + in + ForAwaitOf_statement (e1, m#expression e2, (m#statement s, m#loc loc)) | Continue_statement s -> Continue_statement s | Break_statement s -> Break_statement s | Return_statement e -> Return_statement (m#expression_o e) @@ -191,8 +208,10 @@ class map : mapper = , match final with | None -> None | Some s -> Some (m#block s) ) - | Import (import, loc) -> Import (m#import import, loc) - | Export (export, loc) -> Export (m#export export, loc) + | With_statement (e, (s, loc)) -> + With_statement (m#expression e, (m#statement s, m#loc loc)) + | Import (import, loc) -> Import (m#import import, m#parse_info loc) + | Export (export, loc) -> Export (m#export export, m#parse_info loc) method import { from; kind } = let kind = @@ -221,13 +240,21 @@ class map : mapper = | Class_declaration (id, f) -> ExportClass (id, f) | _ -> assert false) | ExportNames l -> ExportNames (List.map ~f:(fun (id, s) -> m#ident id, s) l) - | ExportDefaultFun (id, decl) -> ( + | ExportDefaultFun (Some id, decl) -> ( match m#statement (Function_declaration (id, decl)) with - | Function_declaration (id, decl) -> ExportDefaultFun (id, decl) + | Function_declaration (id, decl) -> ExportDefaultFun (Some id, decl) | _ -> assert false) - | ExportDefaultClass (id, decl) -> ( + | ExportDefaultFun (None, decl) -> ( + match m#expression (EFun (None, decl)) with + | EFun (None, decl) -> ExportDefaultFun (None, decl) + | _ -> assert false) + | ExportDefaultClass (Some id, decl) -> ( match m#statement (Class_declaration (id, decl)) with - | Class_declaration (id, decl) -> ExportDefaultClass (id, decl) + | Class_declaration (id, decl) -> ExportDefaultClass (Some id, decl) + | _ -> assert false) + | ExportDefaultClass (None, decl) -> ( + match m#expression (EClass (None, decl)) with + | EClass (None, decl) -> ExportDefaultClass (None, decl) | _ -> assert false) | ExportDefaultExpression e -> ExportDefaultExpression (m#expression e) | ExportFrom l -> ExportFrom l @@ -270,10 +297,11 @@ class map : mapper = EAssignTarget (ObjectTarget (List.map l ~f:(function - | TargetPropertyId (i, e) -> - TargetPropertyId (m#ident i, m#initialiser_o e) - | TargetProperty (i, e) -> - TargetProperty (m#property_name i, m#expression e) + | TargetPropertyId (Prop_and_ident i, e) -> + TargetPropertyId (Prop_and_ident (m#ident i), m#initialiser_o e) + | TargetProperty (n, e, i) -> + TargetProperty + (m#property_name n, m#expression e, m#initialiser_o i) | TargetPropertyMethod (n, x) -> TargetPropertyMethod (m#property_name n, m#method_ x) | TargetPropertySpread e -> TargetPropertySpread (m#expression e)))) @@ -285,6 +313,7 @@ class map : mapper = ECall (m#expression e1, ak, List.map e2 ~f:m#argument, m#loc loc) | EAccess (e1, ak, e2) -> EAccess (m#expression e1, ak, m#expression e2) | EDot (e1, ak, id) -> EDot (m#expression e1, ak, id) + | EDotPrivate (e1, ak, id) -> EDotPrivate (m#expression e1, ak, id) | ENew (e1, args) -> ENew (m#expression e1, Option.map ~f:(List.map ~f:m#argument) args) | EVar v -> EVar (m#ident v) @@ -310,7 +339,8 @@ class map : mapper = CoverInitializedName (m#early_error e, a, b))) | (EStr _ as x) | (EBool _ as x) | (ENum _ as x) | (ERegexp _ as x) -> x | ETemplate t -> ETemplate (m#template t) - | EYield e -> EYield (m#expression_o e) + | EYield { delegate; expr } -> EYield { delegate; expr = m#expression_o expr } + | EPrivName i -> EPrivName i | CoverParenthesizedExpressionAndArrowParameterList e -> CoverParenthesizedExpressionAndArrowParameterList (m#early_error e) | CoverCallExpressionAndAsyncArrowHead e -> @@ -349,10 +379,11 @@ class map : mapper = | None -> None | Some (b, e) -> Some (m#binding b, m#initialiser_o e) - method private binding_property x = + method binding_property x = match x with | Prop_binding (i, e) -> Prop_binding (m#property_name i, m#binding_element e) - | Prop_ident (i, e) -> Prop_ident (m#ident i, m#initialiser_o e) + | Prop_ident (Prop_and_ident i, e) -> + Prop_ident (Prop_and_ident (m#ident i), m#initialiser_o e) method expression_o x = match x with @@ -465,7 +496,7 @@ class iter : iterator = method private class_element_name x = match x with | PropName n -> m#property_name n - | PrivName x -> m#ident x + | PrivName (Utf8 _) -> () method statement s = match s with @@ -508,7 +539,12 @@ class iter : iterator = (match e1 with | Left e -> m#expression e | Right (k, d) -> m#for_binding k d); - + m#expression e2; + m#statement s + | ForAwaitOf_statement (e1, e2, (s, _)) -> + (match e1 with + | Left e -> m#expression e + | Right (k, d) -> m#for_binding k d); m#expression e2; m#statement s | Continue_statement _ -> () @@ -537,6 +573,9 @@ class iter : iterator = match final with | None -> () | Some s -> m#block s) + | With_statement (e, (s, _)) -> + m#expression e; + m#statement s | Import (x, _loc) -> m#import x | Export (x, _loc) -> m#export x @@ -557,8 +596,10 @@ class iter : iterator = | ExportFun (id, f) -> m#statement (Function_declaration (id, f)) | ExportClass (id, f) -> m#statement (Class_declaration (id, f)) | ExportNames l -> List.iter ~f:(fun (id, _) -> m#ident id) l - | ExportDefaultFun (id, decl) -> m#statement (Function_declaration (id, decl)) - | ExportDefaultClass (id, decl) -> m#statement (Class_declaration (id, decl)) + | ExportDefaultFun (Some id, decl) -> m#statement (Function_declaration (id, decl)) + | ExportDefaultFun (None, decl) -> m#expression (EFun (None, decl)) + | ExportDefaultClass (Some id, decl) -> m#statement (Class_declaration (id, decl)) + | ExportDefaultClass (None, decl) -> m#expression (EClass (None, decl)) | ExportDefaultExpression e -> m#expression e | ExportFrom { from = _; kind = _ } -> () | CoverExportFrom e -> m#early_error e @@ -604,12 +645,13 @@ class iter : iterator = | TargetElementSpread e -> m#expression e) | ObjectTarget l -> List.iter l ~f:(function - | TargetPropertyId (i, e) -> + | TargetPropertyId (Prop_and_ident i, e) -> m#ident i; m#initialiser_o e - | TargetProperty (i, e) -> - m#property_name i; - m#expression e + | TargetProperty (n, e, i) -> + m#property_name n; + m#expression e; + m#initialiser_o i | TargetPropertyMethod (n, x) -> m#property_name n; m#method_ x @@ -625,6 +667,7 @@ class iter : iterator = m#expression e1; m#expression e2 | EDot (e1, _ak, _) -> m#expression e1 + | EDotPrivate (e1, _, _) -> m#expression e1 | ENew (e1, Some args) -> m#expression e1; List.iter args ~f:m#argument @@ -657,7 +700,8 @@ class iter : iterator = | CoverInitializedName (e, _, _) -> m#early_error e) | EStr _ | EBool _ | ENum _ | ERegexp _ -> () | ETemplate l -> m#template l - | EYield e -> m#expression_o e + | EYield { delegate = _; expr } -> m#expression_o expr + | EPrivName (Utf8 _) -> () | CoverParenthesizedExpressionAndArrowParameterList e -> m#early_error e | CoverCallExpressionAndAsyncArrowHead e -> m#early_error e @@ -697,7 +741,7 @@ class iter : iterator = method private binding_property x = match x with | Prop_binding ((_ : property_name), e) -> m#binding_element e - | Prop_ident (i, e) -> + | Prop_ident (Prop_and_ident i, e) -> m#ident i; m#initialiser_o e @@ -900,18 +944,33 @@ class free = } method use_var x = - let n = try IdentMap.find x !count with Not_found -> 0 in - count := IdentMap.add x (succ n) !count; + count := + IdentMap.update + x + (function + | None -> Some 1 + | Some n -> Some (succ n)) + !count; state_ <- { state_ with use = IdentSet.add x state_.use } method def_var x = - let n = try IdentMap.find x !count with Not_found -> 0 in - count := IdentMap.add x (succ n) !count; + count := + IdentMap.update + x + (function + | None -> Some 1 + | Some n -> Some (succ n)) + !count; state_ <- { state_ with def_var = IdentSet.add x state_.def_var } method def_local x = - let n = try IdentMap.find x !count with Not_found -> 0 in - count := IdentMap.add x (succ n) !count; + count := + IdentMap.update + x + (function + | None -> Some 1 + | Some n -> Some (succ n)) + !count; state_ <- { state_ with def_local = IdentSet.add x state_.def_local } method fun_decl (k, params, body, nid) = @@ -919,6 +978,7 @@ class free = let ids = bound_idents_of_params params in List.iter ids ~f:tbody#def_var; let body = tbody#function_body body in + let params = tbody#formal_parameter_list params in tbody#record_block (Params params); m#merge_info tbody; k, params, body, nid @@ -933,6 +993,7 @@ class free = let ids = bound_idents_of_params params in List.iter ids ~f:tbody#def_var; let body = tbody#function_body body in + let params = tbody#formal_parameter_list params in let ident = match ident with | Some i -> @@ -996,8 +1057,9 @@ class free = let ids = bound_idents_of_params params in List.iter ids ~f:tbody#def_var; let body = tbody#function_body body in + let params = tbody#formal_parameter_list params in tbody#record_block (Params params); - m#def_var id; + m#def_local id; m#merge_info tbody; Function_declaration (id, (k, params, body, nid)) | Class_declaration (id, cl_decl) -> @@ -1006,7 +1068,7 @@ class free = let cl_decl = cbody#class_decl cl_decl in cbody#record_block Normal; m#merge_block_info cbody; - m#def_var id; + m#def_local id; Class_declaration (id, cl_decl) | Block b -> Block (m#block b) | For_statement (Right (((Const | Let) as k), l), e1, e2, (st, loc)) -> @@ -1037,6 +1099,15 @@ class free = m'#record_block Normal; m#merge_block_info m'; ForOf_statement (Right (k, l), e2, (st, m#loc loc)) + | ForAwaitOf_statement (Right (((Const | Let) as k), l), e2, (st, loc)) -> + let same_level = level in + let m' = {} in + let l = m'#for_binding k l in + let e2 = m'#expression e2 in + let st = m'#statement st in + m'#record_block Normal; + m#merge_block_info m'; + ForAwaitOf_statement (Right (k, l), e2, (st, m#loc loc)) | Switch_statement (e, l, def, l') -> let same_level = level in let m' = {} in @@ -1160,6 +1231,10 @@ class rename_variable ~esm = let m = {} in m#for_binding k l; m#statement st + | _, ForAwaitOf_statement (Right (((Const | Let) as k), l), _e2, (st, _loc)) -> + let m = {} in + m#for_binding k l; + m#statement st | _, ForIn_statement (Right (((Const | Let) as k), l), _e2, (st, _loc)) -> let m = {} in m#for_binding k l; @@ -1187,8 +1262,12 @@ class rename_variable ~esm = | ExportFun (_id, _f) -> () | ExportClass (_id, _f) -> () | ExportNames l -> List.iter ~f:(fun (id, _) -> self#ident id) l - | ExportDefaultFun (id, decl) -> self#statement (Function_declaration (id, decl)) - | ExportDefaultClass (id, decl) -> self#statement (Class_declaration (id, decl)) + | ExportDefaultFun (Some id, decl) -> + self#statement (Function_declaration (id, decl)) + | ExportDefaultClass (Some id, decl) -> + self#statement (Class_declaration (id, decl)) + | ExportDefaultFun (None, decl) -> self#fun_decl decl + | ExportDefaultClass (None, decl) -> self#class_decl decl | ExportDefaultExpression e -> self#expression e | ExportFrom { from = _; kind = _ } -> () | CoverExportFrom _ -> () @@ -1266,6 +1345,14 @@ class rename_variable ~esm = let m' = m#update_state Lexical_block [] p in m'#statements p + method binding_property x = + match x with + | Prop_ident (Prop_and_ident (S { name = Utf8 name' as name; _ } as ident), e) + when StringMap.mem name' subst -> + let x = Prop_binding (PNI name, (BindingIdent ident, e)) in + super#binding_property x + | x -> super#binding_property x + method expression e = match e with | EFun (ident, (k, params, body, nid)) -> @@ -1277,6 +1364,16 @@ class rename_variable ~esm = | EClass (Some id, cl_decl) -> let m' = m#update_state Lexical_block [ id ] [] in EClass (Some (m'#ident id), m'#class_decl cl_decl) + | EAssignTarget (ObjectTarget l) -> + let l = + List.map l ~f:(function + | TargetPropertyId + (Prop_and_ident (S { name = Utf8 name' as name; _ } as ident), rhs) + when StringMap.mem name' subst -> + TargetProperty (PNI name, EVar ident, rhs) + | b -> b) + in + super#expression (EAssignTarget (ObjectTarget l)) | _ -> super#expression e method statement s = @@ -1326,10 +1423,17 @@ class rename_variable ~esm = ( Right (k, m'#for_binding k l) , m'#expression e2 , (m'#statement st, m'#loc loc) ) + | ForAwaitOf_statement (Right (((Const | Let) as k), l), e2, (st, loc)) -> + let ids = bound_idents_of_binding l in + let m' = m#update_state Lexical_block ids [] in + ForAwaitOf_statement + ( Right (k, m'#for_binding k l) + , m'#expression e2 + , (m'#statement st, m'#loc loc) ) | ForIn_statement (Right (((Const | Let) as k), l), e2, (st, loc)) -> let ids = bound_idents_of_binding l in let m' = m#update_state Lexical_block ids [] in - ForOf_statement + ForIn_statement ( Right (k, m'#for_binding k l) , m'#expression e2 , (m'#statement st, m'#loc loc) ) @@ -1396,78 +1500,20 @@ class rename_variable ~esm = end class compact_vardecl = + let expr_eq id e = EBin (Eq, EVar id, e) in object (m) - inherit free as super - - val mutable exc_ = IdentSet.empty + inherit map as super val mutable insert_ = IdentSet.empty - method exc = exc_ - - method private translate l = - List.filter_map l ~f:(function - | DeclPattern _ -> None - | DeclIdent (id, eopt) -> ( - match eopt with - | None -> None - | Some (e, _) -> Some (EBin (Eq, EVar id, e)))) - - method private translate_st l = - let l = m#translate l in - match l with - | [] -> Empty_statement - | x :: l -> - Expression_statement (List.fold_left l ~init:x ~f:(fun acc e -> ESeq (acc, e))) - - method private translate_ex l = - let l = m#translate l in - match l with - | [] -> None - | x :: l -> Some (List.fold_left l ~init:x ~f:(fun acc e -> ESeq (acc, e))) - - method private except_ids l = - exc_ <- List.fold_left l ~init:exc_ ~f:(fun acc s -> IdentSet.add s acc) - - method private except_ident e = exc_ <- IdentSet.add e exc_ - - method statement s = - let s = super#statement s in - match s with - | Function_declaration (id, fun_decl) -> - let fun_decl = m#fun_decl fun_decl in - m#except_ident id; - Function_declaration (id, fun_decl) - | Variable_statement (_, l) -> m#translate_st l - | For_statement (Right (Var, l), e2, e3, s) -> - For_statement (Left (m#translate_ex l), e2, e3, s) - | Try_statement (b, w, f) -> - (match w with - | None -> () - | Some (None, _) -> () - | Some (Some (id, _), _) -> - let ids = bound_idents_of_binding id in - m#except_ids ids); - Try_statement (b, w, f) - | s -> s - - method record_block block = - (match block with - | Catch (id, _) -> - let ids = bound_idents_of_binding id in - m#except_ids ids - | Params p -> - let s = bound_idents_of_params p in - m#except_ids s - | Normal -> ()); - super#record_block block + method private var x = insert_ <- IdentSet.add x insert_ - method merge_info from = - super#merge_info from; - let all = - IdentSet.fold (fun e acc -> IdentSet.add e acc) from#state.def_var IdentSet.empty - in - insert_ <- IdentSet.diff all from#exc + method fun_decl (k, params, body, nid) = + let m' = {} in + let params = m'#formal_parameter_list params in + let body = m'#function_body body in + let body = m'#pack body in + k, params, body, m#loc nid method private split x = let rec loop = function @@ -1476,14 +1522,15 @@ class compact_vardecl = in loop x - method private pack (all : IdentSet.t) sources = + method pack rest = + let all = insert_ in let may_flush rem vars s instr = if List.is_empty vars then rem, [], s :: instr else rem, [], s :: (Variable_statement (Var, List.rev vars), N) :: instr in let rem, vars, instr = - List.fold_left sources ~init:(all, [], []) ~f:(fun (rem, vars, instr) (s, loc) -> + List.fold_left rest ~init:(all, [], []) ~f:(fun (rem, vars, instr) (s, loc) -> match s with | Expression_statement e -> let l = m#split e in @@ -1511,41 +1558,24 @@ class compact_vardecl = (Variable_statement (Var, List.rev_append l l'), loc) :: rest | l, _ -> (Variable_statement (Var, l), N) :: instr - method fun_decl (k, params, body, nid) = - let all = IdentSet.diff insert_ exc_ in - let body = m#pack all body in - k, params, body, nid - - method expression x = - let x = super#expression x in - match x with - | EFun (ident, fun_decl) -> - let fun_decl = m#fun_decl fun_decl in - Option.iter ~f:m#except_ident ident; - EFun (ident, fun_decl) - | _ -> x - - method statements l = - let l = super#statements l in - let l = - List.fold_left l ~init:[] ~f:(fun acc (x, loc) -> - match x with - | Expression_statement e -> - let l = m#split e in - let l = - List.fold_left l ~init:acc ~f:(fun acc e -> - (Expression_statement e, N) :: acc) - in - l - | _ -> (x, loc) :: acc) - in - List.rev l + method statements s = + let s = super#statements s in + List.concat_map s ~f:(fun (s, loc) -> + match s with + | Variable_statement (Var, l) -> + List.filter_map l ~f:(function + | DeclIdent (x, Some (init, loc)) -> + m#var x; + Some (Expression_statement (expr_eq x init), loc) + | DeclIdent (x, None) -> + m#var x; + None + | DeclPattern _ as x -> Some (Variable_statement (Var, [ x ]), loc)) + | s -> [ s, loc ]) method program p = let p = super#program p in - m#merge_info m; - let all = IdentSet.diff insert_ exc_ in - let body = m#pack all p in + let body = m#pack p in body end @@ -1606,6 +1636,7 @@ class clean = | For_statement (p1, p2, p3, st) -> For_statement (p1, p2, p3, b st) | ForIn_statement (param, e, st) -> ForIn_statement (param, e, b st) | ForOf_statement (param, e, st) -> ForOf_statement (param, e, b st) + | ForAwaitOf_statement (param, e, st) -> ForAwaitOf_statement (param, e, b st) | Switch_statement (e, l, Some [], []) -> Switch_statement (e, l, None, []) | s -> s end @@ -1713,17 +1744,33 @@ class simpl = let s = super#statements s in List.fold_right s ~init:[] ~f:(fun (st, loc) rem -> match st with + (* if (1) e1 ... --> e1 *) | If_statement (ENum n, iftrue, _) when Num.is_one n -> iftrue :: rem + (* if (0) e1 else e2 --> e2 *) | If_statement (ENum n, _, iffalse) when Num.is_zero n -> opt_cons iffalse rem + (* if (e1) return e2 else return e3 --> return e1 ? e2 : e3 *) | If_statement (cond, (Return_statement (Some e1), _), Some (Return_statement (Some e2), _)) -> (Return_statement (Some (ECond (cond, e1, e2))), loc) :: rem + (* if (e1) v1 = e2 else v1 = e3 --> v1 = e1 ? e2 : e3 *) | If_statement ( cond , (Expression_statement (EBin (Eq, v1, e1)), _) , Some (Expression_statement (EBin (Eq, v2, e2)), _) ) when Poly.(v1 = v2) -> (Expression_statement (EBin (Eq, v1, ECond (cond, e1, e2))), loc) :: rem + (* The following optimizations cause the generated JS to compress less. + (* if (e1) e2 else e3 --> e1 ? e2 : e3 *) + | If_statement + (e1, (Expression_statement e2, _), Some (Expression_statement e3, _)) -> + (Expression_statement (ECond (e1, e2, e3)), loc) :: rem + (* if (!e1) e2 --> e1 || e2 *) + | If_statement (EUn (Not, e1), (Expression_statement e2, _), None) -> + (Expression_statement (EBin (Or, e1, e2)), loc) :: rem + (* if (e1) e2 --> e1 && e2 *) + | If_statement (e1, (Expression_statement e2, _), None) -> + (Expression_statement (EBin (And, e1, e2)), loc) :: rem + *) | Variable_statement (((Var | Let | Const) as k), l1) -> let x = List.map l1 ~f:(fun d -> Variable_statement (k, [ d ]), loc) in x @ rem diff --git a/compiler/lib/js_traverse.mli b/compiler/lib/js_traverse.mli index 062402ece..3209b6faa 100644 --- a/compiler/lib/js_traverse.mli +++ b/compiler/lib/js_traverse.mli @@ -22,6 +22,8 @@ open Javascript class type mapper = object method loc : Javascript.location -> Javascript.location + method parse_info : Parse_info.t -> Parse_info.t + method expression : expression -> expression method expression_o : expression option -> expression option @@ -45,6 +47,8 @@ class type mapper = object -> Javascript.for_binding -> Javascript.for_binding + method binding_property : Javascript.binding_property -> Javascript.binding_property + method variable_declaration : Javascript.variable_declaration_kind -> Javascript.variable_declaration @@ -173,9 +177,9 @@ end class share_constant : mapper class compact_vardecl : object ('a) - inherit free + inherit map - method exc : IdentSet.t + method pack : Javascript.statement_list -> Javascript.statement_list end class clean : mapper diff --git a/compiler/lib/link_js.ml b/compiler/lib/link_js.ml index cdd4d610c..0884dfa31 100644 --- a/compiler/lib/link_js.ml +++ b/compiler/lib/link_js.ml @@ -415,7 +415,7 @@ let link ~output ~linkall ~mklib ~toplevel ~files ~resolve_sourcemap_url ~source let code = Parse_bytecode.link_info ~target:`JavaScript - ~symtable:!sym + ~symbols:!sym ~primitives ~crcs:[] in diff --git a/compiler/lib/loc.ml b/compiler/lib/loc.ml new file mode 100644 index 000000000..6ae745a22 --- /dev/null +++ b/compiler/lib/loc.ml @@ -0,0 +1,88 @@ +type line = + { pos_fname : string + ; pos_lnum : int + ; pos_bol : int + } + +type t = + | SameLine of + { line : line + ; cnum_start : int + ; offset : int + } + | MultiLine of + { line_start : line + ; cnum_start : int + ; line_end : line + ; offset : int + } + +let filename = function + | SameLine { line = { pos_fname; _ }; _ } -> pos_fname + | MultiLine { line_start = { pos_fname; _ }; _ } -> pos_fname + +let line' = function + | SameLine { line; _ } -> line + | MultiLine { line_start; _ } -> line_start + +let line_end' = function + | SameLine { line; _ } -> line + | MultiLine { line_end; _ } -> line_end + +let cnum = function + | SameLine { cnum_start; _ } -> cnum_start + | MultiLine { cnum_start; _ } -> cnum_start + +let line t = (line' t).pos_lnum + +let line_end t = (line_end' t).pos_lnum + +let column = function + | SameLine { line = { pos_bol; _ }; cnum_start; _ } -> cnum_start - pos_bol + | MultiLine { line_start = { pos_bol; _ }; cnum_start; _ } -> cnum_start - pos_bol + +let dummy_line = { pos_fname = ""; pos_lnum = 0; pos_bol = 0 } + +let dummy = SameLine { line = dummy_line; cnum_start = 0; offset = 0 } + +let create ?(last_line = dummy_line) (p1 : Lexing.position) (p2 : Lexing.position) : t = + if p1.pos_fname = p2.pos_fname && p1.pos_lnum = p2.pos_lnum && p1.pos_bol = p2.pos_bol + then + let line = + if last_line.pos_fname == p1.pos_fname + && last_line.pos_lnum = p1.pos_lnum + && last_line.pos_bol = p1.pos_bol + then last_line + else { pos_fname = p1.pos_fname; pos_lnum = p1.pos_lnum; pos_bol = p1.pos_bol } + in + SameLine { line; cnum_start = p1.pos_cnum; offset = p2.pos_cnum - p1.pos_cnum } + else + let line_start = + { pos_fname = p1.pos_fname; pos_lnum = p1.pos_lnum; pos_bol = p1.pos_bol } + in + let line_end = + { pos_fname = p2.pos_fname; pos_lnum = p2.pos_lnum; pos_bol = p2.pos_bol } + in + MultiLine + { line_start + ; cnum_start = p1.pos_cnum + ; line_end + ; offset = p2.pos_cnum - p1.pos_cnum + } + +let p1 : t -> Lexing.position = function + | SameLine { line = { pos_fname; pos_lnum; pos_bol }; cnum_start; offset = _ } -> + { pos_bol; pos_lnum; pos_fname; pos_cnum = cnum_start } + | MultiLine + { line_start = { pos_fname; pos_lnum; pos_bol } + ; cnum_start + ; line_end = _ + ; offset = _ + } -> { pos_bol; pos_lnum; pos_fname; pos_cnum = cnum_start } + +let p2 : t -> Lexing.position = function + | SameLine { line = { pos_fname; pos_lnum; pos_bol }; cnum_start; offset } -> + { pos_bol; pos_lnum; pos_fname; pos_cnum = cnum_start + offset } + | MultiLine + { line_end = { pos_fname; pos_lnum; pos_bol }; line_start = _; cnum_start; offset } + -> { pos_bol; pos_lnum; pos_fname; pos_cnum = cnum_start + offset } diff --git a/compiler/lib/macro.ml b/compiler/lib/macro.ml index 8904d212a..c9e9fb204 100644 --- a/compiler/lib/macro.ml +++ b/compiler/lib/macro.ml @@ -47,7 +47,7 @@ class macro_mapper ~flags = let tag = Int32.to_int (J.Num.to_int32 tag) in let args = List.map args ~f:(function - | J.Arg e -> m#expression e + | J.Arg e -> J.Element (m#expression e) | J.ArgSpread _ -> assert false) in Mlvalue.Block.make ~tag ~args diff --git a/compiler/lib/magic_number.ml b/compiler/lib/magic_number.ml index d678c3235..e47641000 100644 --- a/compiler/lib/magic_number.ml +++ b/compiler/lib/magic_number.ml @@ -58,59 +58,38 @@ let kind (s, _) = let to_string (k, v) = Printf.sprintf "%s%03d" k v let compare (p1, n1) (p2, n2) = - match Poly.compare (p1 : string) p2 with - | 0 -> compare (n1 : int) n2 + match String.compare p1 p2 with + | 0 -> compare n1 n2 | n -> n let equal a b = compare a b = 0 -let current_exe = - let v = - match Ocaml_version.v with - | `V4_08 -> 25 - | `V4_09 -> 26 - | `V4_10 -> 27 - | `V4_11 -> 28 - | `V4_12 -> 29 - | `V4_13 -> 30 - | `V4_14 -> 31 - | `V5_00 -> 32 - | `V5_01 -> 33 - | `V5_02 -> 33 - in - "Caml1999X", v - -let current_cmo = - let v = - match Ocaml_version.v with - | `V4_08 -> 25 - | `V4_09 -> 26 - | `V4_10 -> 27 - | `V4_11 -> 28 - | `V4_12 -> 29 - | `V4_13 -> 30 - | `V4_14 -> 31 - | `V5_00 -> 32 - | `V5_01 -> 33 - | `V5_02 -> 33 - in - "Caml1999O", v - -let current_cma = - let v = - match Ocaml_version.v with - | `V4_08 -> 25 - | `V4_09 -> 26 - | `V4_10 -> 27 - | `V4_11 -> 28 - | `V4_12 -> 29 - | `V4_13 -> 30 - | `V4_14 -> 31 - | `V5_00 -> 32 - | `V5_01 -> 33 - | `V5_02 -> 33 - in - "Caml1999A", v +let v = + let current = Ocaml_version.current in + match current with + | 4 :: 08 :: _ -> 25 + | 4 :: 09 :: _ -> 26 + | 4 :: 10 :: _ -> 27 + | 4 :: 11 :: _ -> 28 + | 4 :: 12 :: _ -> 29 + | 4 :: 13 :: _ -> 30 + | 4 :: 14 :: _ -> 31 + | 5 :: 00 :: _ -> 32 + | 5 :: 01 :: _ -> 33 + | 5 :: 02 :: _ -> 34 + | 5 :: 03 :: _ -> 35 + | _ -> + if Ocaml_version.compare current [ 4; 8 ] < 0 + then failwith "OCaml version unsupported. Upgrade to OCaml 4.08 or newer." + else ( + assert (Ocaml_version.compare current [ 5; 4 ] >= 0); + failwith "OCaml version unsupported. Upgrade js_of_ocaml.") + +let current_exe = "Caml1999X", v + +let current_cmo = "Caml1999O", v + +let current_cma = "Caml1999A", v let current = function | `Exe -> current_exe diff --git a/compiler/lib/mlvalue.ml b/compiler/lib/mlvalue.ml index 8b5de2ca7..675252240 100644 --- a/compiler/lib/mlvalue.ml +++ b/compiler/lib/mlvalue.ml @@ -35,10 +35,8 @@ let is_immediate e = type_of_is_number J.EqEqEq e module Block = struct let make ~tag ~args = - J.EArr - (List.map - ~f:(fun x -> J.Element x) - (J.ENum (J.Num.of_int32 (Int32.of_int tag)) :: args)) + let tag_elt = J.Element (J.ENum (J.Num.of_int32 (Int32.of_int tag))) in + J.EArr (tag_elt :: args) let tag e = J.EAccess (e, ANormal, zero) diff --git a/compiler/lib/mlvalue.mli b/compiler/lib/mlvalue.mli index c0595eac3..a4d847783 100644 --- a/compiler/lib/mlvalue.mli +++ b/compiler/lib/mlvalue.mli @@ -18,7 +18,7 @@ *) module Block : sig - val make : tag:int -> args:Javascript.expression list -> Javascript.expression + val make : tag:int -> args:Javascript.element list -> Javascript.expression val tag : Javascript.expression -> Javascript.expression @@ -26,7 +26,7 @@ module Block : sig end module Array : sig - val make : tag:int -> args:Javascript.expression list -> Javascript.expression + val make : tag:int -> args:Javascript.element list -> Javascript.expression val length : Javascript.expression -> Javascript.expression diff --git a/compiler/lib/ocaml_compiler.ml b/compiler/lib/ocaml_compiler.ml index d42742b84..f28f1a352 100644 --- a/compiler/lib/ocaml_compiler.ml +++ b/compiler/lib/ocaml_compiler.ml @@ -47,8 +47,8 @@ let rec constant_of_const ~target c : Code.constant = | ((Const_pointer i) [@if ocaml_version < (4, 12, 0)]) -> Int (match target with - | `JavaScript -> Int32.of_int_warning_on_overflow i - | `Wasm -> Int31.of_int_warning_on_overflow i) + | `JavaScript -> Int32.of_int_warning_on_overflow i + | `Wasm -> Int31.of_int_warning_on_overflow i) | Const_block (tag, l) -> let l = Array.of_list (List.map l ~f:(fun c -> constant_of_const ~target c)) in Tuple (tag, l, Unknown) @@ -124,6 +124,7 @@ module Symtable = struct let to_ident = function | Glob_compunit x -> Ident.create_persistent x | Glob_predef x -> Ident.create_predef x + [@@ocaml.warning "-32"] end module GlobalMap = struct @@ -206,10 +207,41 @@ module Symtable = struct let get i = Char.code (Bytes.get buf i) in let n = get 0 + (get 1 lsl 8) + (get 2 lsl 16) + (get 3 lsl 24) in n + [@@if ocaml_version < (5, 2, 0)] + + let reloc_ident name = + let buf = Bigarray.(Array1.create char c_layout 4) in + let () = + try Symtable.patch_object buf [ reloc_get_of_string name, 0 ] + with _ -> Symtable.patch_object buf [ reloc_set_of_string name, 0 ] + in + + let get i = Char.code (Bigarray.Array1.get buf i) in + let n = get 0 + (get 1 lsl 8) + (get 2 lsl 16) + (get 3 lsl 24) in + n + [@@if ocaml_version >= (5, 2, 0)] let current_state () : GlobalMap.t = let x : Symtable.global_map = Symtable.current_state () in Obj.magic x + + let all_primitives () : string list = + let split_primitives p = + let len = String.length p in + let rec split beg cur = + if cur >= len + then [] + else if Char.equal p.[cur] '\000' + then String.sub p ~pos:beg ~len:(cur - beg) :: split (cur + 1) (cur + 1) + else split beg (cur + 1) + in + split 0 0 + in + split_primitives (Symtable.data_primitive_names ()) + [@@if ocaml_version < (5, 2)] + + let all_primitives () : string list = Symtable.data_primitive_names () + [@@if ocaml_version >= (5, 2)] end module Cmo_format = struct @@ -228,35 +260,24 @@ module Cmo_format = struct let requires (t : t) = List.map t.cu_required_compunits ~f:(fun (Compunit u) -> u) [@@if ocaml_version >= (5, 2, 0)] + let provides (t : t) = + List.filter_map t.cu_reloc ~f:(fun ((reloc : Cmo_format.reloc_info), _) -> + match reloc with + | Reloc_setglobal i -> Some (Ident.name i) + | Reloc_getglobal _ | Reloc_literal _ | Reloc_primitive _ -> None) + [@@if ocaml_version < (5, 2, 0)] + + let provides (t : t) = + List.filter_map t.cu_reloc ~f:(fun ((reloc : Cmo_format.reloc_info), _) -> + match reloc with + | Reloc_setcompunit (Compunit u) -> Some u + | Reloc_getcompunit _ | Reloc_getpredef _ | Reloc_literal _ | Reloc_primitive _ -> + None) + [@@if ocaml_version >= (5, 2, 0)] + let primitives (t : t) = t.cu_primitives let imports (t : t) = t.cu_imports let force_link (t : t) = t.cu_force_link end - -module Ident = struct - [@@@ocaml.warning "-unused-field"] - - (* Copied from ocaml/typing/ident.ml *) - type 'a tbl' = - | Empty - | Node of 'a tbl' * 'a data * 'a tbl' * int - - and 'a data = - { ident : Ident.t - ; data : 'a - ; previous : 'a data option - } - - type 'a tbl = 'a Ident.tbl - - let rec table_contents_rec t rem = - match t with - | Empty -> rem - | Node (l, v, r, _) -> - table_contents_rec l ((v.data, v.ident) :: table_contents_rec r rem) - - let table_contents (t : 'a tbl) = - table_contents_rec (Obj.magic (t : 'a tbl) : 'a tbl') [] -end diff --git a/compiler/lib/ocaml_compiler.mli b/compiler/lib/ocaml_compiler.mli index 5fec5260e..409381a56 100644 --- a/compiler/lib/ocaml_compiler.mli +++ b/compiler/lib/ocaml_compiler.mli @@ -51,12 +51,8 @@ module Symtable : sig val reloc_ident : string -> int val current_state : unit -> GlobalMap.t -end - -module Ident : sig - type 'a tbl = 'a Ident.tbl - val table_contents : int Ident.tbl -> (int * Ident.t) list + val all_primitives : unit -> string list end module Cmo_format : sig @@ -66,6 +62,8 @@ module Cmo_format : sig val requires : t -> string list + val provides : t -> string list + val primitives : t -> string list val force_link : t -> bool diff --git a/compiler/lib/ocaml_version.ml b/compiler/lib/ocaml_version.ml index 4cc045220..fca057fc9 100644 --- a/compiler/lib/ocaml_version.ml +++ b/compiler/lib/ocaml_version.ml @@ -63,22 +63,3 @@ let rec compare v v' = match compint x y with | 0 -> compare xs ys | n -> n) - -let v = - match current with - | 4 :: 8 :: _ -> `V4_08 - | 4 :: 9 :: _ -> `V4_09 - | 4 :: 10 :: _ -> `V4_10 - | 4 :: 11 :: _ -> `V4_11 - | 4 :: 12 :: _ -> `V4_12 - | 4 :: 13 :: _ -> `V4_13 - | 4 :: 14 :: _ -> `V4_14 - | 5 :: 0 :: _ -> `V5_00 - | 5 :: 1 :: _ -> `V5_01 - | 5 :: 2 :: _ -> `V5_02 - | _ -> - if compare current [ 4; 4 ] < 0 - then failwith "OCaml version unsupported. Upgrade to OCaml 4.08 or newer." - else ( - assert (compare current [ 5; 1 ] >= 0); - failwith "OCaml version unsupported. Upgrade js_of_ocaml.") diff --git a/compiler/lib/ocaml_version.mli b/compiler/lib/ocaml_version.mli index 8f02917d8..9a128ee0a 100644 --- a/compiler/lib/ocaml_version.mli +++ b/compiler/lib/ocaml_version.mli @@ -23,16 +23,3 @@ val current : t val compare : t -> t -> int val split : string -> t - -val v : - [ `V4_08 (* OCaml 4.08 *) - | `V4_09 (* OCaml 4.09 *) - | `V4_10 (* OCaml 4.10 *) - | `V4_11 (* OCaml 4.11 *) - | `V4_12 (* OCaml 4.12 *) - | `V4_13 (* OCaml 4.13 *) - | `V4_14 (* OCaml 4.14 *) - | `V5_00 - | `V5_01 - | `V5_02 - ] diff --git a/compiler/lib/parse_bytecode.ml b/compiler/lib/parse_bytecode.ml index 9f5c4fa43..5df3af49a 100644 --- a/compiler/lib/parse_bytecode.ml +++ b/compiler/lib/parse_bytecode.ml @@ -33,10 +33,7 @@ type bytecode = string let predefined_exceptions = Runtimedef.builtin_exceptions |> Array.to_list |> List.mapi ~f:(fun i name -> i, name) -let new_closure_repr = - match Ocaml_version.v with - | `V4_08 | `V4_09 | `V4_10 | `V4_11 -> false - | `V4_12 | `V4_13 | `V4_14 | `V5_00 | `V5_01 | `V5_02 -> true +let new_closure_repr = Ocaml_version.compare Ocaml_version.current [ 4; 12 ] >= 0 (* Read and manipulate debug section *) module Debug : sig @@ -256,8 +253,10 @@ end = struct try let { event; _ } = Int_table.find events_by_pc pc in let l = - Ocaml_compiler.Ident.table_contents event.ev_compenv.ce_stack - |> List.map ~f:(fun (i, ident) -> event.ev_stacksize - i, ident) + Ident.fold_name + (fun ident i acc -> (event.ev_stacksize - i, ident) :: acc) + event.ev_compenv.ce_stack + [] |> List.sort ~cmp:(fun (i, _) (j, _) -> compare i j) in @@ -267,11 +266,36 @@ end = struct let find_rec { events_by_pc; _ } pc = try let { event; _ } = Int_table.find events_by_pc pc in - Ocaml_compiler.Ident.table_contents event.ev_compenv.ce_rec - |> List.map ~f:(fun (i, ident) -> - (if new_closure_repr then i / 3 else i / 2), ident) - |> List.sort ~cmp:(fun (i, _) (j, _) -> compare i j) + let env = event.ev_compenv in + let names = + Ident.fold_name + (fun ident i acc -> ((if new_closure_repr then i / 3 else i / 2), ident) :: acc) + env.ce_rec + [] + in + List.sort names ~cmp:(fun (i, _) (j, _) -> compare i j) with Not_found -> [] + [@@if ocaml_version < (5, 2, 0)] + + let find_rec { events_by_pc; _ } pc = + try + let { event; _ } = Int_table.find events_by_pc pc in + let env = event.ev_compenv in + let names = + match env.ce_closure with + | Not_in_closure -> raise Not_found + | In_closure { entries; _ } -> + Ident.fold_name + (fun ident ent acc -> + match ent with + | Function i -> (i / 3, ident) :: acc + | Free_variable _ -> acc) + entries + [] + in + List.sort names ~cmp:(fun (i, _) (j, _) -> compare i j) + with Not_found -> [] + [@@if ocaml_version >= (5, 2, 0)] let mem { events_by_pc; _ } pc = Int_table.mem events_by_pc pc @@ -310,7 +334,8 @@ end = struct | v1 :: r1, v2 :: r2 -> Var.propagate_name v1 v2; propagate r1 r2 - | _ -> () + | [], [] -> () + | _ -> assert false let fold t f acc = Int_table.fold (fun k { event; _ } acc -> f k event acc) t.events_by_pc acc @@ -548,7 +573,8 @@ let resize_globals g size = module State = struct type elt = | Var of Var.t * loc - | Dummy + | Dummy of string + | Unset let elt_to_var e = match e with @@ -558,7 +584,8 @@ module State = struct let print_elt f v = match v with | Var (x, _) -> Format.fprintf f "%a" Var.print x - | Dummy -> Format.fprintf f "???" + | Dummy _ -> Format.fprintf f "٭" + | Unset -> Format.fprintf f "∅" type handler = { stack : elt list } @@ -603,7 +630,8 @@ module State = struct { st with stack = (match st.accu with - | Dummy -> Dummy + | Dummy x -> Dummy x + | Unset -> Unset | Var (x, _) -> Var (x, loc)) :: st.stack } @@ -617,7 +645,8 @@ module State = struct { st with accu = (match List.nth st.stack n with - | Dummy -> Dummy + | Dummy x -> Dummy x + | Unset -> Unset | Var (x, _) -> Var (x, loc)) } @@ -629,11 +658,11 @@ module State = struct List.fold_left (st.accu :: st.stack) ~init:[] ~f:(fun l e -> match e with | Var (x, _) -> x :: l - | Dummy -> l) + | Dummy _ | Unset -> l) let set_accu st x loc = { st with accu = Var (x, loc) } - let clear_accu st = { st with accu = Dummy } + let clear_accu st = { st with accu = Unset } let peek n st = elt_to_var (List.nth st.stack n) @@ -647,20 +676,21 @@ module State = struct let assign st n = { st with stack = st_assign st.stack n st.accu } let start_function state env offset = - { state with accu = Dummy; stack = []; env; env_offset = offset; handlers = [] } + { state with accu = Unset; stack = []; env; env_offset = offset; handlers = [] } let start_block _current_pc state = let stack = List.fold_right state.stack ~init:[] ~f:(fun e stack -> match e with - | Dummy -> Dummy :: stack + | Dummy x -> Dummy x :: stack + | Unset -> Unset :: stack | Var (x, l) -> let y = Var.fork x in Var (y, l) :: stack) in let state = { state with stack } in match state.accu with - | Dummy -> state + | Dummy _ | Unset -> state | Var (x, loc) -> let y, state = fresh_var state loc in Var.propagate_name x y; @@ -672,7 +702,7 @@ module State = struct let pop_handler state = { state with handlers = List.tl state.handlers } let initial g = - { accu = Dummy; stack = []; env = [||]; env_offset = 0; handlers = []; globals = g } + { accu = Unset; stack = []; env = [||]; env_offset = 0; handlers = []; globals = g } let rec print_stack f l = match l with @@ -816,7 +846,7 @@ let get_global ~target state instrs i loc = , (Let (x, Prim (Extern "caml_get_global", [ Pc (String name) ])), loc) :: instrs )) -let tagged_blocks = ref Addr.Set.empty +let tagged_blocks = ref Addr.Map.empty let compiled_blocks = ref Addr.Map.empty @@ -858,27 +888,75 @@ let ( ||| ) x y = | _ -> x let rec compile_block blocks debug_data ~target code pc state = - if not (Addr.Set.mem pc !tagged_blocks) - then ( - let limit = Blocks.next blocks pc in - assert (limit > pc); - if debug_parser () then Format.eprintf "Compiling from %d to %d@." pc (limit - 1); - let state = State.start_block pc state in - tagged_blocks := Addr.Set.add pc !tagged_blocks; - let instr, last, state' = - compile { blocks; code; limit; debug = debug_data; target } pc state [] - in - assert (not (Addr.Map.mem pc !compiled_blocks)); - compiled_blocks := Addr.Map.add pc (state, List.rev instr, last) !compiled_blocks; - match fst last with - | Branch (pc', _) | Poptrap (pc', _) -> - compile_block blocks debug_data ~target code pc' state' - | Cond (_, (pc1, _), (pc2, _)) -> - compile_block blocks debug_data ~target code pc1 state'; - compile_block blocks debug_data ~target code pc2 state' - | Switch (_, _) -> () - | Pushtrap _ -> () - | Raise _ | Return _ | Stop -> ()) + match Addr.Map.find_opt pc !tagged_blocks with + | Some old_state -> ( + (* Check that the shape of the stack is compatible with the one used to compile the block *) + let rec check (xs : State.elt list) (ys : State.elt list) = + match xs, ys with + | Var _ :: xs, Var _ :: ys -> check xs ys + | Dummy _ :: xs, Dummy _ :: ys -> check xs ys + | Unset :: _, _ -> assert false + | _, Unset :: _ -> assert false + | [], [] -> () + | Var _ :: _, Dummy _ :: _ -> assert false + | Dummy _ :: _, Var _ :: _ -> assert false + | _ :: _, [] -> assert false + | [], _ :: _ -> assert false + in + check old_state.State.stack state.State.stack; + match old_state.State.accu, state.State.accu with + | Dummy _, Dummy _ -> () + | Var _, Var _ -> () + | Unset, Unset -> () + | Var _, Dummy _ -> assert false + | Dummy _, Var _ -> assert false + | Unset, _ -> assert false + | _, Unset -> assert false) + | None -> ( + let limit = Blocks.next blocks pc in + assert (limit > pc); + if debug_parser () then Format.eprintf "Compiling from %d to %d@." pc (limit - 1); + let state = State.start_block pc state in + tagged_blocks := Addr.Map.add pc state !tagged_blocks; + let instr, last, state' = + compile { blocks; code; limit; debug = debug_data; target } pc state [] + in + assert (not (Addr.Map.mem pc !compiled_blocks)); + (* When jumping to a block that was already visited and the + [accu] was [Unset] for that block, we make the current accu + [Unset] *) + let adjust_state pc = + match state', Addr.Map.find_opt pc !tagged_blocks with + | _, None -> state' + | { State.accu = Var _; _ }, Some { State.accu = Unset; _ } -> + State.clear_accu state' + | _, _ -> state' + in + let mk_cont pc = + let state = adjust_state pc in + pc, State.stack_vars state + in + let last = + match last with + | Branch (pc, _), loc -> Branch (mk_cont pc), loc + | Cond (x, (pc1, _), (pc2, _)), loc -> Cond (x, mk_cont pc1, mk_cont pc2), loc + | Poptrap (pc, _), loc -> Poptrap (mk_cont pc), loc + | Switch (x, a), loc -> + Switch (x, Array.map a ~f:(fun (pc, _) -> mk_cont pc)), loc + | (Raise _ | Return _ | Stop), _ -> last + | Pushtrap _, _ -> assert false + in + compiled_blocks := Addr.Map.add pc (state, List.rev instr, last) !compiled_blocks; + match fst last with + | Branch (pc', _) -> + compile_block blocks debug_data ~target code pc' (adjust_state pc') + | Cond (_, (pc1, _), (pc2, _)) -> + compile_block blocks debug_data ~target code pc1 (adjust_state pc1); + compile_block blocks debug_data ~target code pc2 (adjust_state pc2) + | Poptrap (_, _) -> () + | Switch (_, _) -> () + | Raise _ | Return _ | Stop -> () + | Pushtrap _ -> assert false) and compile infos pc state instrs = if debug_parser () then State.print state; @@ -897,9 +975,9 @@ and compile infos pc state instrs = instrs, (Stop, noloc), state) else ( State.name_vars state infos.debug pc; - let stack = State.stack_vars state in - if debug_parser () then Format.eprintf "Branch %d (%a) @." pc Print.var_list stack; - instrs, (Branch (pc, stack), Code.noloc), state) + if debug_parser () + then Format.eprintf "Branch %d (%a) @." pc Print.var_list (State.stack_vars state); + instrs, (Branch (pc, []), Code.noloc), state) else ( if debug_parser () then Format.eprintf "%4d " pc; State.name_vars state infos.debug pc; @@ -1038,7 +1116,10 @@ and compile infos pc state instrs = { state with State.stack = (* See interp.c *) - State.Dummy :: State.Dummy :: State.Dummy :: state.State.stack + State.Dummy "push_retaddr(retaddr)" + :: State.Dummy "push_retaddr(env)" + :: State.Dummy "push_retaddr(extra_args)" + :: state.State.stack } instrs | APPLY -> @@ -1198,8 +1279,8 @@ and compile infos pc state instrs = let x, state = State.fresh_var state loc in let env = List.map vals ~f:(fun (x, loc) -> State.Var (x, loc)) in let env = - let code = State.Dummy in - let closure_info = State.Dummy in + let code = State.Dummy "closure(code)" in + let closure_info = State.Dummy "closure(info)" in if new_closure_repr then code :: closure_info :: env else code :: env in let env = Array.of_list env in @@ -1246,13 +1327,13 @@ and compile infos pc state instrs = let env = ref (List.map vals ~f:(fun (x, loc) -> State.Var (x, loc))) in List.iter !vars ~f:(fun (i, x) -> let code = State.Var (x, noloc) in - let closure_info = State.Dummy in + let closure_info = State.Dummy "closurerec(info)" in if new_closure_repr then env := code :: closure_info :: !env else env := code :: !env; if i > 0 then - let infix_tag = State.Dummy in + let infix_tag = State.Dummy "closurerec(infix_tag)" in env := infix_tag :: !env); let env = Array.of_list !env in let state = !state in @@ -1671,23 +1752,20 @@ and compile infos pc state instrs = | BRANCH -> let offset = gets code (pc + 1) in if debug_parser () then Format.printf "... (branch)@."; - instrs, (Branch (pc + offset + 1, State.stack_vars state), loc), state + instrs, (Branch (pc + offset + 1, []), loc), state | BRANCHIF -> let offset = gets code (pc + 1) in let x, loc_x = State.accu state in let loc = loc ||| loc_x in - let args = State.stack_vars state in - instrs, (Cond (x, (pc + offset + 1, args), (pc + 2, args)), loc), state + instrs, (Cond (x, (pc + offset + 1, []), (pc + 2, [])), loc), state | BRANCHIFNOT -> let offset = gets code (pc + 1) in let x, _ = State.accu state in - let args = State.stack_vars state in - instrs, (Cond (x, (pc + 2, args), (pc + offset + 1, args)), loc), state + instrs, (Cond (x, (pc + 2, []), (pc + offset + 1, [])), loc), state | SWITCH -> ( if debug_parser () then Format.printf "switch ...@."; let sz = getu code (pc + 1) in let x, _ = State.accu state in - let args = State.stack_vars state in let isize = sz land 0XFFFF in let bsize = sz lsr 16 in let base = pc + 2 in @@ -1698,18 +1776,18 @@ and compile infos pc state instrs = Array.iter bt ~f:(fun pc' -> compile_block infos.blocks infos.debug ~target:infos.target code pc' state); match isize, bsize with - | _, 0 -> instrs, (Switch (x, Array.map it ~f:(fun pc -> pc, args)), loc), state + | _, 0 -> instrs, (Switch (x, Array.map it ~f:(fun pc -> pc, [])), loc), state | 0, _ -> let x_tag = Var.fresh () in let instrs = (Let (x_tag, Prim (Extern "%direct_obj_tag", [ Pv x ])), loc) :: instrs in - instrs, (Switch (x_tag, Array.map bt ~f:(fun pc -> pc, args)), loc), state + instrs, (Switch (x_tag, Array.map bt ~f:(fun pc -> pc, [])), loc), state | _, _ -> let isint_branch = pc + 1 in let isblock_branch = pc + 2 in let () = - tagged_blocks := Addr.Set.add isint_branch !tagged_blocks; + tagged_blocks := Addr.Map.add isint_branch state !tagged_blocks; let i_state = State.start_block isint_branch state in let i_args = State.stack_vars i_state in compiled_blocks := @@ -1719,7 +1797,7 @@ and compile infos pc state instrs = !compiled_blocks in let () = - tagged_blocks := Addr.Set.add isblock_branch !tagged_blocks; + tagged_blocks := Addr.Map.add isblock_branch state !tagged_blocks; let x_tag = Var.fresh () in let b_state = State.start_block isblock_branch state in let b_args = State.stack_vars b_state in @@ -1737,7 +1815,7 @@ and compile infos pc state instrs = let isint_var = Var.fresh () in let instrs = (Let (isint_var, Prim (IsInt, [ Pv x ])), loc) :: instrs in ( instrs - , (Cond (isint_var, (isint_branch, args), (isblock_branch, args)), loc) + , (Cond (isint_var, (isint_branch, []), (isblock_branch, [])), loc) , state )) | BOOLNOT -> let y, _ = State.accu state in @@ -1755,7 +1833,7 @@ and compile infos pc state instrs = let handler_addr = pc + 1 + gets code (pc + 1) in let x, handler_state = State.fresh_var handler_ctx_state loc in - tagged_blocks := Addr.Set.add interm_addr !tagged_blocks; + tagged_blocks := Addr.Map.add interm_addr state !tagged_blocks; compiled_blocks := Addr.Map.add interm_addr @@ -1783,13 +1861,13 @@ and compile infos pc state instrs = { (State.push_handler handler_ctx_state) with State.stack = (* See interp.c *) - State.Dummy - :: State.Dummy - :: State.Dummy - :: State.Dummy + State.Dummy "pushtrap(pc)" + :: State.Dummy "pushtrap(sp_off)" + :: State.Dummy "pushtrap(env)" + :: State.Dummy "pushtrap(extra_args)" :: state.State.stack }; - instrs, (Branch (interm_addr, State.stack_vars state), loc), state + instrs, (Branch (interm_addr, []), loc), state | POPTRAP -> let addr = pc + 1 in compile_block @@ -1799,7 +1877,7 @@ and compile infos pc state instrs = code addr (State.pop 4 (State.pop_handler state)); - instrs, (Poptrap (addr, State.stack_vars state), loc), state + instrs, (Poptrap (addr, []), loc), state | RERAISE | RAISE_NOTRACE | RAISE -> let x, _ = State.accu state in let kind = @@ -2225,81 +2303,72 @@ and compile infos pc state instrs = let n = gets32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in ( (Let (y, Prim (Eq, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + offset + 2, args), (pc + 3, args)), loc) + , (Cond (y, (pc + offset + 2, []), (pc + 3, [])), loc) , state ) | BNEQ -> let n = gets32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in ( (Let (y, Prim (Eq, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + 3, args), (pc + offset + 2, args)), loc) + , (Cond (y, (pc + 3, []), (pc + offset + 2, [])), loc) , state ) | BLTINT -> let n = gets32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in ( (Let (y, Prim (Lt, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + offset + 2, args), (pc + 3, args)), loc) + , (Cond (y, (pc + offset + 2, []), (pc + 3, [])), loc) , state ) | BLEINT -> let n = gets32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in ( (Let (y, Prim (Le, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + offset + 2, args), (pc + 3, args)), loc) + , (Cond (y, (pc + offset + 2, []), (pc + 3, [])), loc) , state ) | BGTINT -> let n = gets32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in ( (Let (y, Prim (Le, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + 3, args), (pc + offset + 2, args)), loc) + , (Cond (y, (pc + 3, []), (pc + offset + 2, [])), loc) , state ) | BGEINT -> let n = gets32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in ( (Let (y, Prim (Lt, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + 3, args), (pc + offset + 2, args)), loc) + , (Cond (y, (pc + 3, []), (pc + offset + 2, [])), loc) , state ) | BULTINT -> let n = getu32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in ( (Let (y, Prim (Ult, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + offset + 2, args), (pc + 3, args)), loc) + , (Cond (y, (pc + offset + 2, []), (pc + 3, [])), loc) , state ) | BUGEINT -> let n = getu32 code (pc + 1) in let offset = gets code (pc + 2) in let x, _ = State.accu state in - let args = State.stack_vars state in let y = Var.fresh () in - ( (Let (y, Prim (Ult, [ Pc (Int n); Pv x ])), loc) :: instrs - , (Cond (y, (pc + 3, args), (pc + offset + 2, args)), loc) + , (Cond (y, (pc + 3, []), (pc + offset + 2, [])), loc) , state ) | ULTINT -> let y, _ = State.accu state in @@ -2425,10 +2494,16 @@ and compile infos pc state instrs = func Var.print arg; + let state = + match Ocaml_version.compare Ocaml_version.current [ 5; 2 ] < 0 with + | true -> State.pop 2 state + | false -> State.pop 3 state + in + compile infos (pc + 1) - (State.pop 2 state) + state ((Let (x, Prim (Extern "%resume", [ Pv stack; Pv func; Pv arg ])), loc) :: instrs) | RESUMETERM -> @@ -2512,15 +2587,15 @@ let parse_bytecode code globals debug_data ~target = else Code.empty in compiled_blocks := Addr.Map.empty; - tagged_blocks := Addr.Set.empty; + tagged_blocks := Addr.Map.empty; p (* HACK - override module *) let override_global = - match Ocaml_version.v with - | `V4_13 | `V4_14 | `V5_00 | `V5_01 | `V5_02 -> [] - | `V4_08 | `V4_09 | `V4_10 | `V4_11 | `V4_12 -> + match Ocaml_version.compare Ocaml_version.current [ 4; 13 ] >= 0 with + | true -> [] + | false -> [ ( "CamlinternalMod" , fun _orig instrs -> let x = Var.fresh_n "internalMod" in @@ -2611,6 +2686,14 @@ let read_primitives toc ic = assert (Char.equal (String.get prim (String.length prim - 1)) '\000'); String.split_char ~sep:'\000' (String.sub prim ~pos:0 ~len:(String.length prim - 1)) +type bytesections = + { symb : Ocaml_compiler.Symtable.GlobalMap.t + ; crcs : (string * Digest.t option) list + ; prim : string list + ; dlpt : string list + } +[@@ocaml.warning "-unused-field"] + let from_exe ~target ?(includes = []) @@ -2701,7 +2784,7 @@ let from_exe let body = if link_info then - let symtable_js = + let symbols_array = Ocaml_compiler.Symtable.GlobalMap.fold (fun i p acc -> (Ocaml_compiler.Symtable.Global.name i, p) :: acc) symbols @@ -2709,17 +2792,12 @@ let from_exe |> Array.of_list in (* Include linking information *) - let toc = - [ "SYMB", Obj.repr symbols - ; "SYJS", Obj.repr symtable_js - ; "CRCS", Obj.repr crcs - ; "PRIM", Obj.repr (String.concat ~sep:"\000" primitives ^ "\000") - ] - in + let sections = { symb = symbols; crcs; prim = primitives; dlpt = [] } in let gdata = Var.fresh () in let need_gdata = ref false in let infos = - [ "toc", Constants.parse ~target (Obj.repr toc) + [ "sections", Constants.parse ~target (Obj.repr sections) + ; "symbols", Constants.parse ~target (Obj.repr symbols_array) ; "prim_count", Int (Int32.of_int (Array.length globals.primitives)) ] in @@ -3104,7 +3182,7 @@ let predefined_exceptions ~target = (Int ((* Predefined exceptions are registered in Symtable.init with [-index - 1] *) - Int32.of_int (-index - 1) ))) + Int32.of_int (-index - 1))) ) , noloc ) ; Let (exn, Block (248, [| v_name; v_index |], NotArray, Immutable)), noloc ; ( Let @@ -3143,12 +3221,12 @@ let predefined_exceptions ~target = in { start = 0; blocks = Addr.Map.singleton 0 block; free_pc = 1 }, unit_info -let link_info ~target ~symtable ~primitives ~crcs = +let link_info ~target ~symbols ~primitives ~crcs = let gdata = Code.Var.fresh_n "global_data" in - let symtable_js = + let symbols_array = Ocaml_compiler.Symtable.GlobalMap.fold (fun i p acc -> (Ocaml_compiler.Symtable.Global.name i, p) :: acc) - symtable + symbols [] |> Array.of_list in @@ -3159,15 +3237,10 @@ let link_info ~target ~symtable ~primitives ~crcs = let body = [] in let body = (* Include linking information *) - let toc = - [ "SYMB", Obj.repr symtable - ; "SYJS", Obj.repr symtable_js - ; "CRCS", Obj.repr crcs - ; "PRIM", Obj.repr (String.concat ~sep:"\000" primitives ^ "\000") - ] - in + let sections = { symb = symbols; crcs; prim = primitives; dlpt = [] } in let infos = - [ "toc", Constants.parse ~target (Obj.repr toc) + [ "sections", Constants.parse ~target (Obj.repr sections) + ; "symbols", Constants.parse ~target (Obj.repr symbols_array) ; "prim_count", Int (Int32.of_int (List.length primitives)) ] in diff --git a/compiler/lib/parse_bytecode.mli b/compiler/lib/parse_bytecode.mli index 244472cd4..33edf53f1 100644 --- a/compiler/lib/parse_bytecode.mli +++ b/compiler/lib/parse_bytecode.mli @@ -94,7 +94,7 @@ val predefined_exceptions : target:[ `JavaScript | `Wasm ] -> Code.program * Uni val link_info : target:[ `JavaScript | `Wasm ] - -> symtable:Ocaml_compiler.Symtable.GlobalMap.t + -> symbols:Ocaml_compiler.Symtable.GlobalMap.t -> primitives:StringSet.t -> crcs:(string * Digest.t option) list -> Code.program diff --git a/compiler/lib/parse_js.ml b/compiler/lib/parse_js.ml index 5dcbfb347..e8a4e5353 100644 --- a/compiler/lib/parse_js.ml +++ b/compiler/lib/parse_js.ml @@ -21,24 +21,36 @@ open! Stdlib module Lexer : sig type t + type error + val of_file : string -> t val of_channel : in_channel -> t - val of_string : ?pos:Lexing.position -> ?filename:string -> string -> t + val of_string : + ?report_error:(error -> unit) + -> ?pos:Lexing.position + -> ?filename:string + -> string + -> t + + val print_error : error -> unit val curr_pos : t -> Lexing.position - val token : t -> Js_token.t * Lexing.position * Lexing.position + val token : t -> Js_token.t * Loc.t - val lex_as_regexp : t -> Js_token.t * Lexing.position * Lexing.position + val lex_as_regexp : t -> Js_token.t * Loc.t val rollback : t -> unit val dummy_pos : Lexing.position end = struct + type error = Loc.t * Flow_lexer.Parse_error.t + type t = { l : Sedlexing.lexbuf + ; report_error : error -> unit ; mutable env : Flow_lexer.Lex_env.t } @@ -46,7 +58,13 @@ end = struct let zero_pos = { Lexing.pos_fname = ""; pos_lnum = 1; pos_cnum = 0; pos_bol = 0 } - let create l = { l; env = Flow_lexer.Lex_env.create l } + let print_error (loc, e) = + let f = Loc.filename loc in + let loc = Printf.sprintf "%s:%d:%d" f (Loc.line loc) (Loc.column loc) in + Printf.eprintf "Lexer error: %s: %s\n" loc (Flow_lexer.Parse_error.to_string e) + + let create ?(report_error = print_error) l = + { l; env = Flow_lexer.Lex_env.create l; report_error } let of_file file : t = let ic = open_in file in @@ -56,7 +74,7 @@ end = struct let of_channel ci : t = create (Sedlexing.Utf8.from_channel ci) - let of_string ?(pos = zero_pos) ?filename s = + let of_string ?report_error ?(pos = zero_pos) ?filename s = let l = Sedlexing.Utf8.from_string s in let pos = match filename with @@ -65,42 +83,22 @@ end = struct in Sedlexing.set_position l pos; Option.iter filename ~f:(Sedlexing.set_filename l); - create l + create ?report_error l let curr_pos lexbuf = snd (Sedlexing.lexing_positions lexbuf.l) - let report_errors res = + let report_errors t res = match Flow_lexer.Lex_result.errors res with | [] -> () - | l -> - List.iter l ~f:(fun (loc, e) -> - let loc = - match loc.Flow_lexer.Loc.source with - | None -> - Printf.sprintf - "%d:%d" - loc.start.pos_lnum - (loc.start.pos_cnum - loc.start.pos_bol) - | Some f -> - Printf.sprintf - "%s:%d:%d" - f - loc.start.pos_lnum - (loc.start.pos_cnum - loc.start.pos_bol) - in - - Printf.eprintf - "Lexer error: %s: %s\n" - loc - (Flow_lexer.Parse_error.to_string e)) + | l -> List.iter l ~f:t.report_error let token (t : t) = let env, res = Flow_lexer.lex t.env in t.env <- env; let tok = Flow_lexer.Lex_result.token res in - let p1, p2 = Flow_lexer.Lex_result.loc res in - report_errors res; - tok, p1, p2 + let loc = Flow_lexer.Lex_result.loc res in + report_errors t res; + tok, loc let rollback t = Sedlexing.rollback t.l @@ -109,30 +107,30 @@ end = struct let env, res = Flow_lexer.regexp t.env in t.env <- env; let tok = Flow_lexer.Lex_result.token res in - let p1, p2 = Flow_lexer.Lex_result.loc res in - report_errors res; - tok, p1, p2 + let loc = Flow_lexer.Lex_result.loc res in + report_errors t res; + tok, loc end exception Parsing_error of Parse_info.t let is_comment = function - | (Js_token.TComment _ | TAnnot _ | TCommentLineDirective _), _, _ -> true + | Js_token.TComment _ | TAnnot _ | TCommentLineDirective _ -> true | _ -> false module State : sig - type token = Js_token.t * Lexing.position * Lexing.position + type token = Js_token.t * Loc.t module Cursor : sig type 'a t - val insert_token : 'a t -> token -> 'a t + val insert_token : 'a t -> Js_token.t -> Loc.t -> 'a t - val replace_token : 'a t -> token -> 'a t + val replace_token : 'a t -> Js_token.t -> Loc.t -> 'a t - val last_token : 'a t -> (token * 'a t) option + val last_token : 'a t -> (Js_token.t * Loc.t * 'a t) option - val rewind_block : 'a t -> (token * 'a t) option + val rewind_block : 'a t -> (Js_token.t * Loc.t * 'a t) option end type 'a t @@ -143,7 +141,7 @@ module State : sig val checkpoint : 'a t -> 'a Js_parser.MenhirInterpreter.checkpoint - val offer : 'a t -> token -> 'a t + val offer : 'a t -> Js_token.t -> Loc.t -> 'a t val finalize_error : 'a t -> 'a t @@ -153,50 +151,55 @@ module State : sig val all_tokens : 'a t -> token list end = struct - type token = Js_token.t * Lexing.position * Lexing.position + type token = Js_token.t * Loc.t type 'a checkpoint = 'a Js_parser.MenhirInterpreter.checkpoint type 'a w = | Start of 'a checkpoint | Checkpoint of 'a checkpoint * 'a w - | Token of token * 'a w + | Token of Js_token.t * Loc.t * 'a w module Cursor = struct type 'a t = 'a w * token list - let last_token ((h, next) : _ t) : (_ * _ t) option = + let last_token ((h, next) : _ t) : (_ * _ * _ t) option = let rec find next = function | Start _ -> None | Checkpoint (_, t) -> find next t - | Token (tok, t) -> - if is_comment tok then find (tok :: next) t else Some (tok, (t, tok :: next)) + | Token (tok, loc, t) -> + if is_comment tok + then find ((tok, loc) :: next) t + else Some (tok, loc, (t, (tok, loc) :: next)) in find next h - let replace_token ((h, next) : _ t) tok : _ t = + let replace_token ((h, next) : _ t) tok loc : _ t = match next with | [] -> assert false - | _ :: next -> h, tok :: next + | _ :: next -> h, (tok, loc) :: next - let insert_token ((h, next) : _ t) tok : _ t = h, tok :: next + let insert_token ((h, next) : _ t) tok loc : _ t = h, (tok, loc) :: next - let rewind_block : 'a t -> (token * 'a t) option = + let rewind_block : 'a t -> (Js_token.t * Loc.t * 'a t) option = fun h -> let rec rewind (stack : Js_token.t list) (h : _ t) = match last_token h with | None -> None - | Some (((tok, _, _) as tok'), h) -> ( + | Some (tok, loc, h) -> ( match tok, stack with | (T_RPAREN | T_RCURLY | T_RBRACKET), _ -> let stack = tok :: stack in rewind stack h - | T_LPAREN, [ T_RPAREN ] | T_LBRACKET, [ T_RBRACKET ] | T_LCURLY, [ T_RCURLY ] - -> Some (tok', h) - | T_LPAREN, T_RPAREN :: stack + | (T_LPAREN | T_LPAREN_ARROW), [ T_RPAREN ] + | T_LBRACKET, [ T_RBRACKET ] + | T_LCURLY, [ T_RCURLY ] -> Some (tok, loc, h) + | (T_LPAREN | T_LPAREN_ARROW), T_RPAREN :: stack | T_LBRACKET, T_RBRACKET :: stack | T_LCURLY, T_RCURLY :: stack -> rewind stack h - | T_LPAREN, _ | T_LBRACKET, _ | T_LCURLY, _ -> assert false + | T_LPAREN, _ -> assert false + | T_LBRACKET, _ -> assert false + | T_LCURLY, _ -> assert false | _, [] -> None | _, (_ :: _ as stack) -> rewind stack h) in @@ -223,39 +226,40 @@ end = struct let checkpoint { checkpoint; _ } = checkpoint - let offer { checkpoint; history; next } tok : _ t = + let offer { checkpoint; history; next } tok loc : _ t = match (checkpoint : _ checkpoint) with | Accepted _ -> assert false - | Rejected | HandlingError _ -> { checkpoint; history; next = tok :: next } + | Rejected | HandlingError _ -> { checkpoint; history; next = (tok, loc) :: next } | Shifting _ | AboutToReduce _ -> assert false | InputNeeded _ -> ( if is_comment tok - then { checkpoint; history = Token (tok, history); next } + then { checkpoint; history = Token (tok, loc, history); next } else let new_checkpoint = - advance (Js_parser.MenhirInterpreter.offer checkpoint tok) + advance + (Js_parser.MenhirInterpreter.offer checkpoint (tok, Loc.p1 loc, Loc.p2 loc)) in match (new_checkpoint : 'a checkpoint) with | Shifting _ | AboutToReduce _ -> assert false | Rejected | Accepted _ | InputNeeded _ -> let history = match tok with - | T_VIRTUAL_SEMICOLON, _, _ -> + | T_VIRTUAL_SEMICOLON -> let rec insert = function - | Start _ as start -> Token (tok, start) + | Start _ as start -> Token (tok, loc, start) | Checkpoint (_, x) -> insert x - | Token (inner_tok, tail) as x -> + | Token (inner_tok, loc', tail) as x -> if is_comment inner_tok - then Token (inner_tok, insert tail) - else Token (tok, x) + then Token (inner_tok, loc', insert tail) + else Token (tok, loc, x) in insert history - | _ -> Token (tok, history) + | _ -> Token (tok, loc, history) in { checkpoint = new_checkpoint; history; next } | HandlingError _ -> { checkpoint = new_checkpoint - ; history = Token (tok, Checkpoint (checkpoint, history)) + ; history = Token (tok, loc, Checkpoint (checkpoint, history)) ; next }) @@ -264,19 +268,24 @@ end = struct match t with | Start env -> advance env | Checkpoint (env, _) -> advance env - | Token (tok, t) -> ( + | Token (tok, loc, t) -> ( if is_comment tok then compute t else match compute t with | InputNeeded _ as checkpoint -> - advance (Js_parser.MenhirInterpreter.offer checkpoint tok) + advance + (Js_parser.MenhirInterpreter.offer + checkpoint + (tok, Loc.p1 loc, Loc.p2 loc)) | Shifting _ | AboutToReduce _ -> assert false | Accepted _ | Rejected | HandlingError _ -> assert false) in let checkpoint = compute h in - List.fold_left next ~init:{ checkpoint; history = h; next = [] } ~f:(fun t tok -> - offer t tok) + List.fold_left + next + ~init:{ checkpoint; history = h; next = [] } + ~f:(fun t (tok, loc) -> offer t tok loc) let finalize_error { checkpoint; history; next } = let rec loop (t : _ Js_parser.MenhirInterpreter.checkpoint) = @@ -293,7 +302,7 @@ end = struct match t with | Start _ -> acc | Checkpoint (_, tail) -> collect acc tail - | Token (tok, tail) -> collect (tok :: acc) tail + | Token (tok, loc, tail) -> collect ((tok, loc) :: acc) tail in collect [] history end @@ -307,41 +316,43 @@ let parse_annot s = | Not_found -> None | _ -> None) -let rec nl_separated prev ((_, c, _) as ctok) = +let rec nl_separated prev loc' = match State.Cursor.last_token prev with | None -> true - | Some ((T_VIRTUAL_SEMICOLON, _, _), prev) -> nl_separated prev ctok - | Some ((_, _, p2), _) -> c.Lexing.pos_lnum <> p2.Lexing.pos_lnum + | Some (T_VIRTUAL_SEMICOLON, _, prev) -> nl_separated prev loc' + | Some (_, loc, _) -> Loc.line loc' <> Loc.line_end loc let acceptable checkpoint token = let module I = Js_parser.MenhirInterpreter in let checkpoint = State.checkpoint checkpoint in I.acceptable checkpoint token Lexer.dummy_pos -let semicolon = Js_token.T_VIRTUAL_SEMICOLON, Lexer.dummy_pos, Lexer.dummy_pos +let semicolon = Js_token.T_VIRTUAL_SEMICOLON + +let dummy_loc = Loc.create Lexer.dummy_pos Lexer.dummy_pos let rec offer_one t (lexbuf : Lexer.t) = - let tok = Lexer.token lexbuf in + let tok, loc = Lexer.token lexbuf in match tok with - | TCommentLineDirective _, _, _ -> - let t = State.offer t tok in + | TCommentLineDirective _ -> + let t = State.offer t tok loc in offer_one t lexbuf - | (TComment s, p1, p2) as tok -> + | TComment s as tok -> let tok = match parse_annot s with | None -> tok - | Some a -> TAnnot (s, a), p1, p2 + | Some a -> TAnnot (s, a) in - let t = State.offer t tok in + let t = State.offer t tok loc in offer_one t lexbuf | _ -> let t = match tok with - | T_LPAREN, _, _ when acceptable t T_LPAREN_ARROW -> State.save_checkpoint t + | T_LPAREN when acceptable t T_LPAREN_ARROW -> State.save_checkpoint t | _ -> t in let h = State.cursor t in - let tok = + let tok, loc = (* restricted productions * 7.9.1 - 3 * When, as the program is parsed from left to right, a token is encountered @@ -353,65 +364,40 @@ let rec offer_one t (lexbuf : Lexer.t) = * one LineTerminator, then a semicolon is automatically inserted before the * restricted token. *) match State.Cursor.last_token h, tok with - | ( Some (((T_RETURN | T_CONTINUE | T_BREAK | T_THROW | T_YIELD), _, _), _) - , (((T_SEMICOLON | T_VIRTUAL_SEMICOLON), _, _) as tok) ) -> tok - | Some (((T_RETURN | T_CONTINUE | T_BREAK | T_THROW | T_YIELD), _, _), _), _ - when nl_separated h tok && acceptable t T_VIRTUAL_SEMICOLON -> + | ( Some ((T_RETURN | T_CONTINUE | T_BREAK | T_THROW | T_YIELD | T_ASYNC), _, _) + , ((T_SEMICOLON | T_VIRTUAL_SEMICOLON) as tok) ) -> tok, loc + | Some ((T_RETURN | T_CONTINUE | T_BREAK | T_THROW | T_YIELD | T_ASYNC), _, _), _ + when nl_separated h loc && acceptable t T_VIRTUAL_SEMICOLON -> (* restricted token can also appear as regular identifier such as in [x.return]. In such case, feeding a virtual semicolon could trigger a parser error. Here, we first checkpoint that a virtual semicolon is acceptable. *) Lexer.rollback lexbuf; - semicolon + semicolon, dummy_loc (* The practical effect of these restricted productions is as follows: * When a ++ or -- token is encountered where the parser would treat it * as a postfix operator, and at least one LineTerminator occurred between * the preceding token and the ++ or -- token, then a semicolon is automatically * inserted before the ++ or -- token. *) - | _, ((T_DECR, p1, p2) as tok) when not (nl_separated h tok) -> - Js_token.T_DECR_NB, p1, p2 - | _, ((T_INCR, p1, p2) as tok) when not (nl_separated h tok) -> - Js_token.T_INCR_NB, p1, p2 - | _, ((((T_DIV | T_DIV_ASSIGN) as tok), _, _) as tok_and_pos) -> - if acceptable t tok then tok_and_pos else Lexer.lex_as_regexp lexbuf - | _ -> tok + | _, T_DECR when not (nl_separated h loc) -> Js_token.T_DECR_NB, loc + | _, T_INCR when not (nl_separated h loc) -> Js_token.T_INCR_NB, loc + | _, ((T_DIV | T_DIV_ASSIGN) as tok) -> + if acceptable t tok + then tok, loc + else + let t, loc = Lexer.lex_as_regexp lexbuf in + t, loc + | _ -> tok, loc in - State.offer t tok + State.offer t tok loc let dummy_ident = let dummy = "" in Js_token.T_IDENTIFIER (Stdlib.Utf8_string.of_string_exn dummy, dummy) -let token_to_ident (t, p1, p2) = +let token_to_ident t = let name = Js_token.to_string t in - Js_token.T_IDENTIFIER (Stdlib.Utf8_string.of_string_exn name, name), p1, p2 - -let end_of_do_whle prev = - match State.Cursor.rewind_block prev with - | None -> false - | Some ((T_LPAREN, _, _), prev) -> ( - match State.Cursor.last_token prev with - | None -> false - | Some ((T_WHILE, _, _), prev) -> ( - match State.Cursor.last_token prev with - | None -> false - | Some ((T_SEMICOLON, _, _), prev) -> ( - match State.Cursor.last_token prev with - | None -> false - | Some ((T_DO, _, _), _) -> true - | Some (_, _) -> false) - | Some ((T_RCURLY, _, _), _) -> ( - match State.Cursor.rewind_block prev with - | None -> false - | Some ((T_LCURLY, _, _), prev) -> ( - match State.Cursor.last_token prev with - | None -> false - | Some ((T_DO, _, _), _) -> true - | Some (_, _) -> false) - | Some _ -> assert false) - | Some (_, _) -> false) - | Some (_, _) -> false) - | Some _ -> assert false + Js_token.T_IDENTIFIER (Stdlib.Utf8_string.of_string_exn name, name) let recover error_checkpoint previous_checkpoint = (* 7.9.1 - 1 *) @@ -429,44 +415,50 @@ let recover error_checkpoint previous_checkpoint = (* complete ECMAScript Program, then a semicolon is automatically inserted at the end *) match State.Cursor.last_token (State.cursor error_checkpoint) with | None -> error_checkpoint - | Some (offending_token, rest) -> ( + | Some (offending_token, offending_loc, rest) -> ( match State.Cursor.last_token rest with | None -> error_checkpoint - | Some ((last_token, _, _), _) -> ( + | Some (last_token, _, _) -> ( match offending_token with - | T_VIRTUAL_SEMICOLON, _, _ -> error_checkpoint + | T_VIRTUAL_SEMICOLON -> error_checkpoint (* contextually allowed as identifiers, namely await and yield; *) - | (T_YIELD | T_AWAIT), _, _ when acceptable previous_checkpoint dummy_ident -> - State.Cursor.replace_token rest (token_to_ident offending_token) + | (T_YIELD | T_AWAIT) when acceptable previous_checkpoint dummy_ident -> + State.Cursor.replace_token + rest + (token_to_ident offending_token) + offending_loc |> State.try_recover - | T_RCURLY, _, _ - when acceptable previous_checkpoint Js_token.T_VIRTUAL_SEMICOLON -> - State.Cursor.insert_token rest semicolon |> State.try_recover - | T_EOF, _, _ when acceptable previous_checkpoint Js_token.T_VIRTUAL_SEMICOLON - -> State.Cursor.insert_token rest semicolon |> State.try_recover - | (T_ARROW, _, _) as tok when not (nl_separated rest tok) -> ( + | T_RCURLY when acceptable previous_checkpoint Js_token.T_VIRTUAL_SEMICOLON -> + State.Cursor.insert_token rest semicolon dummy_loc |> State.try_recover + | T_EOF when acceptable previous_checkpoint Js_token.T_VIRTUAL_SEMICOLON -> + State.Cursor.insert_token rest semicolon dummy_loc |> State.try_recover + | T_ARROW when not (nl_separated rest offending_loc) -> ( (* Restart parsing from the openning parens, patching the token to be T_LPAREN_ARROW to help the parser *) match last_token with | T_RPAREN -> ( match State.Cursor.rewind_block rest with - | Some ((T_LPAREN, p1, p2), prev) -> - State.Cursor.replace_token prev (T_LPAREN_ARROW, p1, p2) + | Some (T_LPAREN, loc, prev) -> + State.Cursor.replace_token prev T_LPAREN_ARROW loc |> State.try_recover | Some _ -> assert false | None -> error_checkpoint) | _ -> error_checkpoint) - | last -> ( + | _ -> ( match last_token with | T_VIRTUAL_SEMICOLON -> error_checkpoint | _ - when nl_separated rest last + when nl_separated rest offending_loc && acceptable previous_checkpoint Js_token.T_VIRTUAL_SEMICOLON -> - State.Cursor.insert_token rest semicolon |> State.try_recover + State.Cursor.insert_token rest semicolon dummy_loc |> State.try_recover | T_RPAREN - when end_of_do_whle rest - && acceptable previous_checkpoint Js_token.T_VIRTUAL_SEMICOLON -> - State.Cursor.insert_token rest semicolon |> State.try_recover + when acceptable previous_checkpoint Js_token.T_VIRTUAL_SEMICOLON_DO_WHILE + -> State.Cursor.insert_token rest semicolon dummy_loc |> State.try_recover + | T_RCURLY + when acceptable + previous_checkpoint + Js_token.T_VIRTUAL_SEMICOLON_EXPORT_DEFAULT -> + State.Cursor.insert_token rest semicolon dummy_loc |> State.try_recover | _ -> error_checkpoint))) let parse_aux the_parser (lexbuf : Lexer.t) = @@ -498,14 +490,15 @@ let parse_aux the_parser (lexbuf : Lexer.t) = | _ -> loop new_checkpoint new_checkpoint) in let checkpoint = State.create init in - match loop checkpoint checkpoint with - | `Ok x -> x + let res = loop checkpoint checkpoint in + match res with + | `Ok all -> all | `Error t -> let rec last cursor = match State.Cursor.last_token cursor with | None -> assert false - | Some ((T_VIRTUAL_SEMICOLON, _, _), cursor) -> last cursor - | Some ((_, p, _), _) -> p + | Some (T_VIRTUAL_SEMICOLON, _, cursor) -> last cursor + | Some (_, loc, _) -> Loc.p1 loc in let p = last (State.cursor t) in raise (Parsing_error (Parse_info.t_of_pos p)) @@ -541,13 +534,14 @@ let parse' lex = let toks = State.all_tokens toks in let take_annot_before = let toks_r = ref toks in - let rec loop start_pos acc (toks : (Js_token.t * _ * _) list) = + let rec loop start_pos acc (toks : (Js_token.t * _) list) = match toks with | [] -> assert false - | (TAnnot a, p1, _) :: xs -> loop start_pos ((a, Parse_info.t_of_pos p1) :: acc) xs - | ((TComment _ | TCommentLineDirective _), _, _) :: xs -> loop start_pos acc xs - | (_, p1, _p2) :: xs -> - if p1.Lexing.pos_cnum = start_pos.Lexing.pos_cnum + | (TAnnot a, loc) :: xs -> + loop start_pos ((a, Parse_info.t_of_pos (Loc.p1 loc)) :: acc) xs + | ((TComment _ | TCommentLineDirective _), _) :: xs -> loop start_pos acc xs + | (_, loc) :: xs -> + if Loc.cnum loc = start_pos.Lexing.pos_cnum then ( toks_r := toks; List.rev acc) diff --git a/compiler/lib/parse_js.mli b/compiler/lib/parse_js.mli index ff47ffb96..71b9c0531 100644 --- a/compiler/lib/parse_js.mli +++ b/compiler/lib/parse_js.mli @@ -20,9 +20,18 @@ module Lexer : sig type t + type error + val of_file : string -> t - val of_string : ?pos:Lexing.position -> ?filename:string -> string -> t + val of_string : + ?report_error:(error -> unit) + -> ?pos:Lexing.position + -> ?filename:string + -> string + -> t + + val print_error : error -> unit val of_channel : in_channel -> t end @@ -34,6 +43,6 @@ val parse : Lexer.t -> Javascript.program val parse' : Lexer.t -> ((Js_token.Annot.t * Parse_info.t) list * Javascript.program) list - * (Js_token.t * Lexing.position * Lexing.position) list + * (Js_token.t * Loc.t) list val parse_expr : Lexer.t -> Javascript.expression diff --git a/compiler/lib/phisimpl.ml b/compiler/lib/phisimpl.ml index 88e541e69..285bfec8d 100644 --- a/compiler/lib/phisimpl.ml +++ b/compiler/lib/phisimpl.ml @@ -42,7 +42,8 @@ let rec arg_deps vars deps defs params args = add_dep deps x y; add_def vars defs x y; arg_deps vars deps defs params args - | _ -> () + | [], [] -> () + | _ -> assert false let cont_deps blocks vars deps defs (pc, args) = let block = Addr.Map.find pc blocks in diff --git a/compiler/lib/pretty_print.ml b/compiler/lib/pretty_print.ml index 6124279c4..24cbb0d01 100644 --- a/compiler/lib/pretty_print.ml +++ b/compiler/lib/pretty_print.ml @@ -144,6 +144,8 @@ let rec push st e = st.cur <- st.cur + st.w; st.l <- [])) +let check st = assert (List.is_empty st.prev_indents) + (****) let string st (s : string) = diff --git a/compiler/lib/pretty_print.mli b/compiler/lib/pretty_print.mli index 75ca1356a..7ebb22ae5 100644 --- a/compiler/lib/pretty_print.mli +++ b/compiler/lib/pretty_print.mli @@ -58,3 +58,5 @@ val compact : t -> bool val set_needed_space_function : t -> (char -> char -> bool) -> unit val set_adjust_indentation_function : t -> (int -> int) -> unit + +val check : t -> unit diff --git a/compiler/lib/pseudo_fs.ml b/compiler/lib/pseudo_fs.ml index 1899d767d..b7e915d03 100644 --- a/compiler/lib/pseudo_fs.ml +++ b/compiler/lib/pseudo_fs.ml @@ -45,7 +45,7 @@ let expand_path exts real virt = let list_files name paths = let name, virtname = - match String.lsplit2 name ~on:':' with + match String.rsplit2 name ~on:':' with | Some (src, dest) -> if String.length dest > 0 && not (Char.equal dest.[0] '/') then failwith (Printf.sprintf "path '%s' for file '%s' must be absolute" dest src); diff --git a/compiler/lib/reserved.ml b/compiler/lib/reserved.ml index 42284e4e6..10388ab17 100644 --- a/compiler/lib/reserved.ml +++ b/compiler/lib/reserved.ml @@ -150,6 +150,7 @@ let provided = ; "Int32Array" ; "Int8Array" ; "TextDecoder" + ; "TextEncoder" ; "Uint16Array" ; "Uint32Array" ; "Uint8Array" diff --git a/compiler/lib/source_map.ml b/compiler/lib/source_map.ml index 50aa2d0b3..fd04f29db 100644 --- a/compiler/lib/source_map.ml +++ b/compiler/lib/source_map.ml @@ -331,10 +331,9 @@ let json ?replace_mappings t = | Some s -> rewrite_path s) ) ; "names", `List (List.map t.names ~f:(fun s -> stringlit s)) ; "sources", `List (List.map t.sources ~f:(fun s -> stringlit (rewrite_path s))) - ; ( "mappings" - , stringlit (match replace_mappings with - | None -> string_of_mapping t.mappings - | Some m -> m) ) + ; "mappings", stringlit (match replace_mappings with + | None -> string_of_mapping t.mappings + | Some m -> m) ; ( "sourcesContent" , `List (match t.sources_content with @@ -414,10 +413,9 @@ let of_json ~parse_mappings (json : Yojson.Raw.t) = in let mappings_str = string "mappings" rest in let mappings = - match parse_mappings, mappings_str with - | false, _ -> mapping_of_string "" - | true, None -> mapping_of_string "" - | true, Some s -> mapping_of_string s + match mappings_str with + | None -> mapping_of_string "" + | Some s -> mapping_of_string s in ( { version = int_of_float (float_of_string version) ; file diff --git a/compiler/lib/specialize.ml b/compiler/lib/specialize.ml index 1ab1f7174..2c7a7b1d2 100644 --- a/compiler/lib/specialize.ml +++ b/compiler/lib/specialize.ml @@ -26,11 +26,11 @@ let function_arity info x = get_approx info (fun x -> - match info.info_defs.(Var.idx x) with - | Expr (Closure (l, _)) -> Some (List.length l) - | Expr (Special (Alias_prim prim)) -> ( + match Flow.Info.def info x with + | Some (Closure (l, _)) -> Some (List.length l) + | Some (Special (Alias_prim prim)) -> ( try Some (Primitive.arity prim) with Not_found -> None) - | Expr (Apply { f; args; _ }) -> ( + | Some (Apply { f; args; _ }) -> ( if List.mem f ~set:acc then None else diff --git a/compiler/lib/specialize.mli b/compiler/lib/specialize.mli index 5559679a4..39f0f7fed 100644 --- a/compiler/lib/specialize.mli +++ b/compiler/lib/specialize.mli @@ -18,6 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val function_arity : Flow.info -> Code.Var.t -> int option +val function_arity : Flow.Info.t -> Code.Var.t -> int option val f : function_arity:(Code.Var.t -> int option) -> Code.program -> Code.program diff --git a/compiler/lib/specialize_js.ml b/compiler/lib/specialize_js.ml index 314086521..729f54f16 100644 --- a/compiler/lib/specialize_js.ml +++ b/compiler/lib/specialize_js.ml @@ -150,10 +150,48 @@ let specialize_instr ~target info i = | _ -> i) | _, _ -> i +let equal2 a b = Code.Var.equal a b + +let equal3 a b c = Code.Var.equal a b && Code.Var.equal b c + +let equal4 a b c d = Code.Var.equal a b && Code.Var.equal b c && Code.Var.equal c d + let specialize_instrs ~target info l = let rec aux info checks l acc = match l with | [] -> List.rev acc + | [ ((Let (alen, Prim (Extern "caml_ml_string_length", [ Pv a ])), _) as len1) + ; ((Let (blen, Prim (Extern "caml_ml_string_length", [ Pv b ])), _) as len2) + ; ((Let (len, Prim (Extern "%int_add", [ Pv alen'; Pv blen' ])), _) as len3) + ; (Let (bytes, Prim (Extern "caml_create_bytes", [ Pv len' ])), _) + ; ( Let + ( u1 + , Prim + ( Extern "caml_blit_string" + , [ Pv a'; Pc (Int 0l); Pv bytes'; Pc (Int 0l); Pv alen'' ] ) ) + , _ ) + ; ( Let + ( u2 + , Prim + ( Extern "caml_blit_string" + , [ Pv b'; Pc (Int 0l); Pv bytes''; Pv alen'''; Pv blen'' ] ) ) + , _ ) + ; (Let (res, Prim (Extern "caml_string_of_bytes", [ Pv bytes''' ])), _) + ] + when equal2 a a' + && equal2 b b' + && equal2 len len' + && equal4 alen alen' alen'' alen''' + && equal3 blen blen' blen'' + && equal4 bytes bytes' bytes'' bytes''' -> + [ len1 + ; len2 + ; len3 + ; Let (u1, Constant (Int 0l)), No + ; Let (u2, Constant (Int 0l)), No + ; Let (res, Prim (Extern "caml_string_concat", [ Pv a; Pv b ])), No + ; Let (bytes, Prim (Extern "caml_bytes_of_string", [ Pv res ])), No + ] | (i, loc) :: r -> ( (* We make bound checking explicit. Then, we can remove duplicated bound checks. Also, it appears to be more efficient to inline diff --git a/compiler/lib/specialize_js.mli b/compiler/lib/specialize_js.mli index 4bf26256a..d82ef2916 100644 --- a/compiler/lib/specialize_js.mli +++ b/compiler/lib/specialize_js.mli @@ -18,6 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -val f : target:[ `JavaScript | `Wasm ] -> Flow.info -> Code.program -> Code.program +val f : target:[ `JavaScript | `Wasm ] -> Flow.Info.t -> Code.program -> Code.program val f_once : Code.program -> Code.program diff --git a/compiler/lib/stdlib.ml b/compiler/lib/stdlib.ml index d5c7122c4..d67f4b048 100644 --- a/compiler/lib/stdlib.ml +++ b/compiler/lib/stdlib.ml @@ -417,7 +417,7 @@ end module Int64 = struct include Int64 - let equal (a : int64) (b : int64) = Poly.( = ) a b + let equal (a : int64) (b : int64) = Poly.(a = b) end module Float = struct @@ -766,6 +766,12 @@ module String = struct Some (sub line ~pos:0 ~len:pos, sub line ~pos:(pos + 1) ~len:(length line - pos - 1)) with Not_found -> None + let rsplit2 line ~on:delim = + try + let pos = rindex line delim in + Some (sub line ~pos:0 ~len:pos, sub line ~pos:(pos + 1) ~len:(length line - pos - 1)) + with Not_found -> None + let capitalize_ascii s = apply1 Char.uppercase_ascii s let uncapitalize_ascii s = apply1 Char.lowercase_ascii s @@ -1021,9 +1027,19 @@ module String = struct in loop (length b - 1) b 0 - let fold_left ~f ~init s = Bytes.fold_left ~f ~init (Bytes.unsafe_of_string s) + let fold_left ~f ~init s = + let r = ref init in + for i = 0 to length s - 1 do + r := f !r (unsafe_get s i) + done; + !r - let fold_right ~f s ~init = Bytes.fold_right ~f ~init (Bytes.unsafe_of_string s) + let fold_right ~f s ~init = + let r = ref init in + for i = length s - 1 downto 0 do + r := f (unsafe_get s i) !r + done; + !r end module Utf8_string : sig @@ -1157,6 +1173,17 @@ end module Array = struct include ArrayLabels + let find_opt ~f:p a = + let n = length a in + let rec loop i = + if i = n + then None + else + let x = unsafe_get a i in + if p x then Some x else loop (succ i) + in + loop 0 + let fold_right_i a ~f ~init:x = let r = ref x in for i = Array.length a - 1 downto 0 do diff --git a/compiler/lib/structure.ml b/compiler/lib/structure.ml new file mode 100644 index 000000000..503b6021e --- /dev/null +++ b/compiler/lib/structure.ml @@ -0,0 +1,256 @@ +open Stdlib +open Code + +let get_edges g src = try Hashtbl.find g src with Not_found -> Addr.Set.empty + +let add_edge g src dst = Hashtbl.replace g src (Addr.Set.add dst (get_edges g src)) + +let reverse_tree t = + let g = Hashtbl.create 16 in + Hashtbl.iter (fun child parent -> add_edge g parent child) t; + g + +let reverse_graph g = + let g' = Hashtbl.create 16 in + Hashtbl.iter + (fun child parents -> Addr.Set.iter (fun parent -> add_edge g' parent child) parents) + g; + g' + +type graph = (Addr.t, Addr.Set.t) Hashtbl.t + +type t = + { succs : (Addr.t, Addr.Set.t) Hashtbl.t + ; preds : (Addr.t, Addr.Set.t) Hashtbl.t + ; reverse_post_order : Addr.t list + ; block_order : (Addr.t, int) Hashtbl.t + } + +let get_nodes g = + List.fold_left + ~init:Addr.Set.empty + ~f:(fun s pc -> Addr.Set.add pc s) + g.reverse_post_order + +let block_order g pc = Hashtbl.find g.block_order pc + +let is_backward g pc pc' = Hashtbl.find g.block_order pc >= Hashtbl.find g.block_order pc' + +let is_forward g pc pc' = Hashtbl.find g.block_order pc < Hashtbl.find g.block_order pc' + +(* pc has at least two forward edges moving into it *) +let is_merge_node' block_order preds pc = + let s = try Hashtbl.find preds pc with Not_found -> Addr.Set.empty in + let o = Hashtbl.find block_order pc in + let n = + Addr.Set.fold (fun pc' n -> if Hashtbl.find block_order pc' < o then n + 1 else n) s 0 + in + n > 1 + +let rec leave_try_body block_order preds blocks pc = + if is_merge_node' block_order preds pc + then false + else + match Addr.Map.find pc blocks with + | { body = []; branch = (Return _ | Stop), _; _ } -> false + | { body = []; branch = Branch (pc', _), _; _ } -> + leave_try_body block_order preds blocks pc' + | _ -> true + +let build_graph blocks pc = + let succs = Hashtbl.create 16 in + let l = ref [] in + let visited = Hashtbl.create 16 in + let poptraps = ref [] in + let rec traverse ~englobing_exn_handlers pc = + if not (Hashtbl.mem visited pc) + then ( + Hashtbl.add visited pc (); + let successors = Code.fold_children blocks pc Addr.Set.add Addr.Set.empty in + Hashtbl.add succs pc successors; + let block = Addr.Map.find pc blocks in + Addr.Set.iter + (fun pc' -> + let englobing_exn_handlers = + match fst block.branch with + | Pushtrap ((body_pc, _), _, _) when pc' = body_pc -> + pc :: englobing_exn_handlers + | Poptrap (leave_pc, _) -> ( + match englobing_exn_handlers with + | [] -> assert false + | enter_pc :: rem -> + poptraps := (enter_pc, leave_pc) :: !poptraps; + rem) + | _ -> englobing_exn_handlers + in + traverse ~englobing_exn_handlers pc') + successors; + l := pc :: !l) + in + traverse ~englobing_exn_handlers:[] pc; + let block_order = Hashtbl.create 16 in + List.iteri !l ~f:(fun i pc -> Hashtbl.add block_order pc i); + let preds = reverse_graph succs in + List.iter !poptraps ~f:(fun (enter_pc, leave_pc) -> + if leave_try_body block_order preds blocks leave_pc + then ( + (* Add an edge to limit the [try] body *) + Hashtbl.replace + succs + enter_pc + (Addr.Set.add leave_pc (Hashtbl.find succs enter_pc)); + Hashtbl.replace + preds + leave_pc + (Addr.Set.add enter_pc (Hashtbl.find preds leave_pc)))); + { succs; preds; reverse_post_order = !l; block_order } + +let dominator_tree g = + (* A Simple, Fast Dominance Algorithm + Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy *) + let dom = Hashtbl.create 16 in + let rec inter pc pc' = + (* Compute closest common ancestor *) + if pc = pc' + then pc + else if is_forward g pc pc' + then inter pc (Hashtbl.find dom pc') + else inter (Hashtbl.find dom pc) pc' + in + List.iter g.reverse_post_order ~f:(fun pc -> + let l = Hashtbl.find g.succs pc in + Addr.Set.iter + (fun pc' -> + if is_forward g pc pc' + then + let d = try inter pc (Hashtbl.find dom pc') with Not_found -> pc in + Hashtbl.replace dom pc' d) + l); + (* Check we have reached a fixed point (reducible graph) *) + List.iter g.reverse_post_order ~f:(fun pc -> + let l = Hashtbl.find g.succs pc in + Addr.Set.iter + (fun pc' -> + if is_forward g pc pc' + then + let d = Hashtbl.find dom pc' in + assert (inter pc d = d)) + l); + reverse_tree dom + +(* pc has at least two forward edges moving into it *) +let is_merge_node g pc = is_merge_node' g.block_order g.preds pc + +let is_loop_header g pc = + let s = try Hashtbl.find g.preds pc with Not_found -> Addr.Set.empty in + let o = Hashtbl.find g.block_order pc in + Addr.Set.exists (fun pc' -> Hashtbl.find g.block_order pc' >= o) s + +let sort_in_post_order t l = + List.sort ~cmp:(fun a b -> compare (block_order t a) (block_order t b)) l + +(* + +(* pc dominates pc' *) +let rec dominates g idom pc pc' = + pc = pc' || (is_forward g pc pc' && dominates g idom pc (Hashtbl.find idom pc')) + +let dominance_frontier g idom = + let frontiers = Hashtbl.create 16 in + Hashtbl.iter + (fun pc preds -> + if Addr.Set.cardinal preds > 1 + then + let dom = Hashtbl.find idom pc in + let rec loop runner = + if runner <> dom + then ( + add_edge frontiers runner pc; + loop (Hashtbl.find idom runner)) + in + Addr.Set.iter loop preds) + g.preds; + frontiers +*) + +(* Compute a map from each block to the set of loops it belongs to *) +let mark_loops g = + let in_loop = Hashtbl.create 16 in + Hashtbl.iter + (fun pc preds -> + let rec mark_loop pc' = + if not (Addr.Set.mem pc (get_edges in_loop pc')) + then ( + add_edge in_loop pc' pc; + if pc' <> pc then Addr.Set.iter mark_loop (Hashtbl.find g.preds pc')) + in + Addr.Set.iter (fun pc' -> if is_backward g pc' pc then mark_loop pc') preds) + g.preds; + in_loop + +let rec measure blocks g pc limit = + if is_loop_header g pc + then -1 + else + let b = Addr.Map.find pc blocks in + let limit = + List.fold_left b.body ~init:limit ~f:(fun acc x -> + match x with + (* A closure is never small *) + | Let (_, Closure _), _ -> -1 + | _ -> acc - 1) + in + if limit < 0 + then limit + else + Addr.Set.fold + (fun pc limit -> if limit < 0 then limit else measure blocks g pc limit) + (get_edges g.succs pc) + limit + +let is_small blocks g pc = measure blocks g pc 20 >= 0 + +let shrink_loops blocks ({ succs; preds; reverse_post_order; _ } as g) = + let add_edge pred succ = + Hashtbl.replace succs pred (Addr.Set.add succ (Hashtbl.find succs pred)); + Hashtbl.replace preds succ (Addr.Set.add pred (Hashtbl.find preds succ)) + in + let in_loop = mark_loops g in + let dom = dominator_tree g in + let root = List.hd reverse_post_order in + let rec traverse ignored pc = + let succs = get_edges dom pc in + let loops = get_edges in_loop pc in + let block = Addr.Map.find pc blocks in + Addr.Set.iter + (fun pc' -> + (* Whatever is in the scope of an exception handler should not be + moved outside *) + let ignored = + match fst block.branch with + | Pushtrap ((body_pc, _), _, _) when pc' = body_pc -> + Addr.Set.union ignored loops + | _ -> ignored + in + let loops' = get_edges in_loop pc' in + let left_loops = Addr.Set.diff (Addr.Set.diff loops loops') ignored in + (* If we leave a loop, we add an edge from predecessors of + the loop header to the current block, so that it is + considered outside of the loop. *) + if not (Addr.Set.is_empty left_loops || is_small blocks g pc') + then + Addr.Set.iter + (fun pc0 -> + Addr.Set.iter + (fun pc -> if is_forward g pc pc0 then add_edge pc pc') + (get_edges g.preds pc0)) + left_loops; + traverse ignored pc') + succs + in + traverse Addr.Set.empty root + +let build_graph blocks pc = + let g = build_graph blocks pc in + shrink_loops blocks g; + g diff --git a/compiler/lib/structure.mli b/compiler/lib/structure.mli new file mode 100644 index 000000000..6278174c6 --- /dev/null +++ b/compiler/lib/structure.mli @@ -0,0 +1,24 @@ +open! Stdlib +open Code + +type graph + +type t + +val get_edges : graph -> Addr.t -> Addr.Set.t + +val is_backward : t -> Addr.t -> Addr.t -> bool + +val is_forward : t -> Addr.t -> Addr.t -> bool + +val build_graph : block Addr.Map.t -> Addr.t -> t + +val dominator_tree : t -> graph + +val is_merge_node : t -> Addr.t -> bool + +val is_loop_header : t -> Addr.t -> bool + +val sort_in_post_order : t -> Addr.t list -> Addr.t list + +val get_nodes : t -> Addr.Set.t diff --git a/compiler/lib/subst.mli b/compiler/lib/subst.mli index 78180479d..faa7ac6b2 100644 --- a/compiler/lib/subst.mli +++ b/compiler/lib/subst.mli @@ -34,6 +34,13 @@ val last : (Var.t -> Var.t) -> last * loc -> last * loc val cont : (Var.t -> Var.t) -> int -> program -> program +val cont' : + (Var.t -> Var.t) + -> int + -> block Addr.Map.t + -> Addr.Set.t + -> block Addr.Map.t * Addr.Set.t + val from_array : Var.t array -> Var.t -> Var.t val build_mapping : Var.t list -> Var.t list -> Var.t Var.Map.t diff --git a/compiler/lib/tailcall.ml b/compiler/lib/tailcall.ml index 84d31c368..375a4b749 100644 --- a/compiler/lib/tailcall.ml +++ b/compiler/lib/tailcall.ml @@ -57,29 +57,13 @@ let rewrite_block (f, f_params, f_pc, args) pc blocks = | _ -> blocks) | _ -> blocks -(* Skip try body *) -let fold_children blocks pc f accu = - let block = Addr.Map.find pc blocks in - match fst block.branch with - | Return _ | Raise _ | Stop -> accu - | Branch (pc', _) | Poptrap (pc', _) -> f pc' accu - | Pushtrap ((try_body, _), _, (pc1, _)) -> - f pc1 (Addr.Set.fold f (Code.poptraps blocks try_body) accu) - | Cond (_, (pc1, _), (pc2, _)) -> - let accu = f pc1 accu in - let accu = f pc2 accu in - accu - | Switch (_, a1) -> - let accu = Array.fold_right a1 ~init:accu ~f:(fun (pc, _) accu -> f pc accu) in - accu - let rec traverse f pc visited blocks = if not (Addr.Set.mem pc visited) then let visited = Addr.Set.add pc visited in let blocks = rewrite_block f pc blocks in let visited, blocks = - fold_children + Code.fold_children_skip_try_body blocks pc (fun pc (visited, blocks) -> diff --git a/compiler/lib/unit_info.ml b/compiler/lib/unit_info.ml index bcc168a56..9449b7f65 100644 --- a/compiler/lib/unit_info.ml +++ b/compiler/lib/unit_info.ml @@ -48,7 +48,8 @@ let of_primitives l = let of_cmo (cmo : Cmo_format.compilation_unit) = let open Ocaml_compiler in - let provides = StringSet.singleton (Cmo_format.name cmo) in + (* A packed librariy register global for packed modules. *) + let provides = StringSet.of_list (Cmo_format.name cmo :: Cmo_format.provides cmo) in let requires = StringSet.of_list (Cmo_format.requires cmo) in let requires = StringSet.diff requires provides in let effects_without_cps = diff --git a/compiler/lib/var_printer.ml b/compiler/lib/var_printer.ml index e0caa6d35..7cca64e73 100644 --- a/compiler/lib/var_printer.ml +++ b/compiler/lib/var_printer.ml @@ -114,6 +114,7 @@ let name t v nm_orig = match str, nm_orig with | "", ">>=" -> "symbol_bind" | "", ">>|" -> "symbol_map" + | "", "^" -> "symbol_concat" | "", _ -> "symbol" | str, _ -> str in diff --git a/compiler/tests-check-prim/dune b/compiler/tests-check-prim/dune index 3e592478b..88cf01f81 100644 --- a/compiler/tests-check-prim/dune +++ b/compiler/tests-check-prim/dune @@ -23,7 +23,7 @@ (action (with-stdout-to %{targets} - (run %{bin:js_of_ocaml} check-runtime %{dep:main.bc})))) + (run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:main.bc})))) (rule (targets unix-unix.output) @@ -36,7 +36,7 @@ (action (with-stdout-to %{targets} - (run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc})))) + (run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc})))) (rule (targets unix-win32.output) @@ -49,7 +49,7 @@ (action (with-stdout-to %{targets} - (run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc})))) + (run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc})))) (rule (targets main.output5) @@ -60,7 +60,7 @@ (action (with-stdout-to %{targets} - (run %{bin:js_of_ocaml} check-runtime %{dep:main.bc})))) + (run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:main.bc})))) (rule (targets unix-unix.output5) @@ -73,7 +73,7 @@ (action (with-stdout-to %{targets} - (run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc})))) + (run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc})))) (rule (targets unix-win32.output5) @@ -86,4 +86,4 @@ (action (with-stdout-to %{targets} - (run %{bin:js_of_ocaml} check-runtime %{dep:unix.bc})))) + (run %{bin:js_of_ocaml} check-runtime +toplevel.js %{dep:unix.bc})))) diff --git a/compiler/tests-check-prim/main.output b/compiler/tests-check-prim/main.output index ca4d01f3c..408b06f43 100644 --- a/compiler/tests-check-prim/main.output +++ b/compiler/tests-check-prim/main.output @@ -8,8 +8,6 @@ caml_dynlink_close_lib caml_dynlink_get_current_libs caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_get_current_environment -caml_get_section_table caml_int64_add_native caml_int64_and_native caml_int64_div_native @@ -20,13 +18,8 @@ caml_int64_or_native caml_int64_sub_native caml_int64_xor_native caml_int_as_pointer -caml_invoke_traced_function -caml_realloc_global -caml_reify_bytecode caml_reset_afl_instrumentation caml_signbit -caml_static_release_bytecode -caml_terminfo_rows debugger is_digit_normalized @@ -53,6 +46,7 @@ caml_atomic_cas caml_atomic_exchange caml_atomic_fetch_add caml_atomic_load +caml_atomic_make_contended caml_domain_dls caml_domain_dls_get caml_domain_dls_set @@ -83,6 +77,7 @@ jsoo_create_file jsoo_create_file_extern From +gc.js: +caml_memprof_discard caml_memprof_set From +graphics.js: @@ -143,6 +138,8 @@ caml_mod From +io.js: caml_input_value_to_outside_heap +caml_ml_input_bigarray +caml_ml_output_bigarray From +jslib.js: caml_is_js @@ -160,6 +157,7 @@ caml_array_of_bytes caml_array_of_string caml_bytes_of_utf16_jsstring caml_new_string +caml_string_concat caml_string_set16 caml_string_set32 caml_string_set64 @@ -184,12 +182,12 @@ caml_lxm_next From +runtime_events.js: caml_custom_event_index +caml_ml_runtime_events_pause +caml_ml_runtime_events_resume +caml_ml_runtime_events_start caml_runtime_events_create_cursor caml_runtime_events_free_cursor -caml_runtime_events_pause caml_runtime_events_read_poll -caml_runtime_events_resume -caml_runtime_events_start caml_runtime_events_user_register caml_runtime_events_user_resolve caml_runtime_events_user_write @@ -227,6 +225,15 @@ caml_spacetime_enabled caml_spacetime_only_works_for_native_code caml_sys_is_regular_file +From +toplevel.js: +caml_dynlink_get_bytecode_sections +caml_static_alloc +caml_static_free +caml_terminfo_backup +caml_terminfo_resume +caml_terminfo_setup +caml_terminfo_standout + From +unix.js: caml_unix_cleanup caml_unix_closedir diff --git a/compiler/tests-check-prim/main.output5 b/compiler/tests-check-prim/main.output5 index cf220fbc8..c2501c631 100644 --- a/compiler/tests-check-prim/main.output5 +++ b/compiler/tests-check-prim/main.output5 @@ -10,25 +10,9 @@ caml_dynlink_close_lib caml_dynlink_get_current_libs caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_get_current_environment -caml_get_section_table -caml_int64_add_native -caml_int64_and_native -caml_int64_div_native -caml_int64_mod_native -caml_int64_mul_native -caml_int64_neg_native -caml_int64_or_native -caml_int64_sub_native -caml_int64_xor_native caml_int_as_pointer -caml_invoke_traced_function -caml_realloc_global -caml_reify_bytecode caml_reset_afl_instrumentation caml_signbit -caml_static_release_bytecode -caml_terminfo_rows debugger is_digit_normalized @@ -139,6 +123,7 @@ From +mlBytes.js: caml_array_of_bytes caml_array_of_string caml_bytes_of_utf16_jsstring +caml_string_concat caml_string_set16 caml_string_set32 caml_string_set64 @@ -155,13 +140,10 @@ caml_obj_set_tag caml_obj_truncate From +runtime_events.js: -caml_custom_event_index caml_runtime_events_create_cursor caml_runtime_events_free_cursor caml_runtime_events_read_poll -caml_runtime_events_user_register caml_runtime_events_user_resolve -caml_runtime_events_user_write From +stdlib.js: caml_build_symbols @@ -187,7 +169,15 @@ caml_set_static_env caml_spacetime_enabled caml_spacetime_only_works_for_native_code caml_sys_const_naked_pointers_checked -caml_sys_is_regular_file + +From +toplevel.js: +caml_get_section_table +caml_static_alloc +caml_static_free +caml_terminfo_backup +caml_terminfo_resume +caml_terminfo_setup +caml_terminfo_standout From +unix.js: caml_unix_cleanup diff --git a/compiler/tests-check-prim/unix-unix.output b/compiler/tests-check-prim/unix-unix.output index 8d157ea01..5d54f731d 100644 --- a/compiler/tests-check-prim/unix-unix.output +++ b/compiler/tests-check-prim/unix-unix.output @@ -8,8 +8,6 @@ caml_dynlink_close_lib caml_dynlink_get_current_libs caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_get_current_environment -caml_get_section_table caml_int64_add_native caml_int64_and_native caml_int64_div_native @@ -20,13 +18,8 @@ caml_int64_or_native caml_int64_sub_native caml_int64_xor_native caml_int_as_pointer -caml_invoke_traced_function -caml_realloc_global -caml_reify_bytecode caml_reset_afl_instrumentation caml_signbit -caml_static_release_bytecode -caml_terminfo_rows caml_unix_map_file_bytecode debugger is_digit_normalized @@ -162,6 +155,7 @@ caml_atomic_cas caml_atomic_exchange caml_atomic_fetch_add caml_atomic_load +caml_atomic_make_contended caml_domain_dls caml_domain_dls_get caml_domain_dls_set @@ -192,6 +186,7 @@ jsoo_create_file jsoo_create_file_extern From +gc.js: +caml_memprof_discard caml_memprof_set From +graphics.js: @@ -252,6 +247,8 @@ caml_mod From +io.js: caml_input_value_to_outside_heap +caml_ml_input_bigarray +caml_ml_output_bigarray From +jslib.js: caml_is_js @@ -269,6 +266,7 @@ caml_array_of_bytes caml_array_of_string caml_bytes_of_utf16_jsstring caml_new_string +caml_string_concat caml_string_set16 caml_string_set32 caml_string_set64 @@ -293,12 +291,12 @@ caml_lxm_next From +runtime_events.js: caml_custom_event_index +caml_ml_runtime_events_pause +caml_ml_runtime_events_resume +caml_ml_runtime_events_start caml_runtime_events_create_cursor caml_runtime_events_free_cursor -caml_runtime_events_pause caml_runtime_events_read_poll -caml_runtime_events_resume -caml_runtime_events_start caml_runtime_events_user_register caml_runtime_events_user_resolve caml_runtime_events_user_write @@ -336,6 +334,15 @@ caml_spacetime_enabled caml_spacetime_only_works_for_native_code caml_sys_is_regular_file +From +toplevel.js: +caml_dynlink_get_bytecode_sections +caml_static_alloc +caml_static_free +caml_terminfo_backup +caml_terminfo_resume +caml_terminfo_setup +caml_terminfo_standout + From +unix.js: caml_unix_cleanup caml_unix_closedir diff --git a/compiler/tests-check-prim/unix-unix.output5 b/compiler/tests-check-prim/unix-unix.output5 index b4d909e0f..799210ad4 100644 --- a/compiler/tests-check-prim/unix-unix.output5 +++ b/compiler/tests-check-prim/unix-unix.output5 @@ -10,25 +10,9 @@ caml_dynlink_close_lib caml_dynlink_get_current_libs caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_get_current_environment -caml_get_section_table -caml_int64_add_native -caml_int64_and_native -caml_int64_div_native -caml_int64_mod_native -caml_int64_mul_native -caml_int64_neg_native -caml_int64_or_native -caml_int64_sub_native -caml_int64_xor_native caml_int_as_pointer -caml_invoke_traced_function -caml_realloc_global -caml_reify_bytecode caml_reset_afl_instrumentation caml_signbit -caml_static_release_bytecode -caml_terminfo_rows caml_unix_accept caml_unix_access caml_unix_alarm @@ -99,6 +83,7 @@ caml_unix_outchannel_of_filedescr caml_unix_pipe caml_unix_putenv caml_unix_read +caml_unix_read_bigarray caml_unix_realpath caml_unix_recv caml_unix_recvfrom @@ -138,6 +123,7 @@ caml_unix_utimes caml_unix_wait caml_unix_waitpid caml_unix_write +caml_unix_write_bigarray debugger is_digit_normalized @@ -248,6 +234,7 @@ From +mlBytes.js: caml_array_of_bytes caml_array_of_string caml_bytes_of_utf16_jsstring +caml_string_concat caml_string_set16 caml_string_set32 caml_string_set64 @@ -264,13 +251,10 @@ caml_obj_set_tag caml_obj_truncate From +runtime_events.js: -caml_custom_event_index caml_runtime_events_create_cursor caml_runtime_events_free_cursor caml_runtime_events_read_poll -caml_runtime_events_user_register caml_runtime_events_user_resolve -caml_runtime_events_user_write From +stdlib.js: caml_build_symbols @@ -296,7 +280,15 @@ caml_set_static_env caml_spacetime_enabled caml_spacetime_only_works_for_native_code caml_sys_const_naked_pointers_checked -caml_sys_is_regular_file + +From +toplevel.js: +caml_get_section_table +caml_static_alloc +caml_static_free +caml_terminfo_backup +caml_terminfo_resume +caml_terminfo_setup +caml_terminfo_standout From +unix.js: caml_unix_cleanup diff --git a/compiler/tests-check-prim/unix-win32.output b/compiler/tests-check-prim/unix-win32.output index c4df2ae5a..52ac92cf9 100644 --- a/compiler/tests-check-prim/unix-win32.output +++ b/compiler/tests-check-prim/unix-win32.output @@ -8,8 +8,6 @@ caml_dynlink_close_lib caml_dynlink_get_current_libs caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_get_current_environment -caml_get_section_table caml_int64_add_native caml_int64_and_native caml_int64_div_native @@ -20,13 +18,8 @@ caml_int64_or_native caml_int64_sub_native caml_int64_xor_native caml_int_as_pointer -caml_invoke_traced_function -caml_realloc_global -caml_reify_bytecode caml_reset_afl_instrumentation caml_signbit -caml_static_release_bytecode -caml_terminfo_rows caml_unix_map_file_bytecode debugger is_digit_normalized @@ -127,6 +120,7 @@ caml_atomic_cas caml_atomic_exchange caml_atomic_fetch_add caml_atomic_load +caml_atomic_make_contended caml_domain_dls caml_domain_dls_get caml_domain_dls_set @@ -157,6 +151,7 @@ jsoo_create_file jsoo_create_file_extern From +gc.js: +caml_memprof_discard caml_memprof_set From +graphics.js: @@ -217,6 +212,8 @@ caml_mod From +io.js: caml_input_value_to_outside_heap +caml_ml_input_bigarray +caml_ml_output_bigarray From +jslib.js: caml_is_js @@ -234,6 +231,7 @@ caml_array_of_bytes caml_array_of_string caml_bytes_of_utf16_jsstring caml_new_string +caml_string_concat caml_string_set16 caml_string_set32 caml_string_set64 @@ -258,12 +256,12 @@ caml_lxm_next From +runtime_events.js: caml_custom_event_index +caml_ml_runtime_events_pause +caml_ml_runtime_events_resume +caml_ml_runtime_events_start caml_runtime_events_create_cursor caml_runtime_events_free_cursor -caml_runtime_events_pause caml_runtime_events_read_poll -caml_runtime_events_resume -caml_runtime_events_start caml_runtime_events_user_register caml_runtime_events_user_resolve caml_runtime_events_user_write @@ -300,6 +298,15 @@ caml_spacetime_enabled caml_spacetime_only_works_for_native_code caml_sys_is_regular_file +From +toplevel.js: +caml_dynlink_get_bytecode_sections +caml_static_alloc +caml_static_free +caml_terminfo_backup +caml_terminfo_resume +caml_terminfo_setup +caml_terminfo_standout + From +unix.js: caml_unix_cleanup caml_unix_closedir diff --git a/compiler/tests-check-prim/unix-win32.output5 b/compiler/tests-check-prim/unix-win32.output5 index 253f907ee..72fad0943 100644 --- a/compiler/tests-check-prim/unix-win32.output5 +++ b/compiler/tests-check-prim/unix-win32.output5 @@ -10,25 +10,9 @@ caml_dynlink_close_lib caml_dynlink_get_current_libs caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_get_current_environment -caml_get_section_table -caml_int64_add_native -caml_int64_and_native -caml_int64_div_native -caml_int64_mod_native -caml_int64_mul_native -caml_int64_neg_native -caml_int64_or_native -caml_int64_sub_native -caml_int64_xor_native caml_int_as_pointer -caml_invoke_traced_function -caml_realloc_global -caml_reify_bytecode caml_reset_afl_instrumentation caml_signbit -caml_static_release_bytecode -caml_terminfo_rows caml_unix_accept caml_unix_access caml_unix_bind @@ -80,6 +64,7 @@ caml_unix_outchannel_of_filedescr caml_unix_pipe caml_unix_putenv caml_unix_read +caml_unix_read_bigarray caml_unix_realpath caml_unix_recv caml_unix_recvfrom @@ -104,6 +89,7 @@ caml_unix_truncate_64 caml_unix_utimes caml_unix_waitpid caml_unix_write +caml_unix_write_bigarray debugger is_digit_normalized @@ -214,6 +200,7 @@ From +mlBytes.js: caml_array_of_bytes caml_array_of_string caml_bytes_of_utf16_jsstring +caml_string_concat caml_string_set16 caml_string_set32 caml_string_set64 @@ -230,13 +217,10 @@ caml_obj_set_tag caml_obj_truncate From +runtime_events.js: -caml_custom_event_index caml_runtime_events_create_cursor caml_runtime_events_free_cursor caml_runtime_events_read_poll -caml_runtime_events_user_register caml_runtime_events_user_resolve -caml_runtime_events_user_write From +stdlib.js: caml_build_symbols @@ -262,7 +246,15 @@ caml_set_static_env caml_spacetime_enabled caml_spacetime_only_works_for_native_code caml_sys_const_naked_pointers_checked -caml_sys_is_regular_file + +From +toplevel.js: +caml_get_section_table +caml_static_alloc +caml_static_free +caml_terminfo_backup +caml_terminfo_resume +caml_terminfo_setup +caml_terminfo_standout From +unix.js: caml_unix_getpwuid diff --git a/compiler/tests-compiler/call_gen.ml b/compiler/tests-compiler/call_gen.ml index 84d5543ca..350e475c6 100644 --- a/compiler/tests-compiler/call_gen.ml +++ b/compiler/tests-compiler/call_gen.ml @@ -22,7 +22,7 @@ open Util module M1 = struct let code = {| - let f_prime g = g 1 2 + let f_prime g = try g 1 2 with e -> raise e let f g = f_prime g 3 4 (* [g] will be unknown as long as [f] is not inlined. *) let g () = f (fun a b c d -> print_int (a + b + c + d)) @@ -62,7 +62,13 @@ module M1 = struct {| function f(g){return caml_call2(f_prime(g), 3, 4);} //end - function f_prime(g){return caml_call2(g, 1, 2);} + function f_prime(g){ + try{var _i_ = caml_call2(g, 1, 2); return _i_;} + catch(e$0){ + var e = caml_wrap_exception(e$0); + throw caml_maybe_attach_backtrace(e, 0); + } + } //end function g(param){ return f diff --git a/compiler/tests-compiler/compact.ml b/compiler/tests-compiler/compact.ml index 151db3f39..e91423da8 100644 --- a/compiler/tests-compiler/compact.ml +++ b/compiler/tests-compiler/compact.ml @@ -43,7 +43,10 @@ let rec f x y z = var f = a, e = b, d = c; for(;;){ if(0 === f && 0 === e && 0 === d) return 1; - var g = (d + f | 0) + e | 0, f = f + d | 0, e = e - d | 0, d = g; + var g = (d + f | 0) + e | 0; + f = f + d | 0; + e = e - d | 0; + d = g; } }], "Test"); diff --git a/compiler/tests-compiler/cond.ml b/compiler/tests-compiler/cond.ml index 350e54837..04ce3d0f0 100644 --- a/compiler/tests-compiler/cond.ml +++ b/compiler/tests-compiler/cond.ml @@ -43,25 +43,27 @@ let%expect_test "conditional" = [%expect {| function f(a, b, c, d, e, f){ - var switch$0 = 0; - if(a){ - if(! b && ! c && ! d && ! e && ! f){var x = 1; switch$0 = 1;} + a: + { + b: + if(a){ + if(! b && ! c && ! d && ! e && ! f){var x = 1; break a;} + } + else if(b){ + if(! c && ! d){if(e) break b; if(f) break b; var x = 2; break a;} + } + else if(c){ + if(! d && ! e && ! f){var x = 3; break a;} + } + else if(d){ + if(! e && ! f){var x = 4; break a;} + } + else{ + if(! e){if(f){var x = 6; break a;} var x = 100; break a;} + if(! f){var x = 5; break a;} + } + var x = - 1; } - else if(b){ - var switch$1 = 0; - if(c || d) switch$1 = 1; else if(! e && ! f){var x = 2; switch$0 = 1;} - } - else if(c){ - if(! d && ! e && ! f){var x = 3; switch$0 = 1;} - } - else if(d){ - if(! e && ! f){var x = 4; switch$0 = 1;} - } - else if(e){ - if(! f){var x = 5; switch$0 = 1;} - } - else if(f){var x = 6; switch$0 = 1;} else{var x = 100; switch$0 = 1;} - if(! switch$0) var x = - 1; return x + 2 | 0; } //end |}] diff --git a/compiler/tests-compiler/direct_calls.ml b/compiler/tests-compiler/direct_calls.ml index 30fdcc82f..6b5a65c0a 100644 --- a/compiler/tests-compiler/direct_calls.ml +++ b/compiler/tests-compiler/direct_calls.ml @@ -24,13 +24,13 @@ let%expect_test "direct calls without --enable effects" = {| (* Arity of the argument of a function / direct call *) let test1 () = - let f g x = g x in + let f g x = try g x with e -> raise e in ignore (f (fun x -> x + 1) 7); ignore (f (fun x -> x *. 2.) 4.) (* Arity of the argument of a function / CPS call *) let test2 () = - let f g x = g x in + let f g x = try g x with e -> raise e in ignore (f (fun x -> x + 1) 7); ignore (f (fun x -> x ^ "a") "a") @@ -57,26 +57,35 @@ let%expect_test "direct calls without --enable effects" = [%expect {| function test1(param){ - function f(g, x){return caml_call1(g, x);} - var _d_ = 7; - f(function(x){return x + 1 | 0;}, _d_); - var _e_ = 4.; - f(function(x){return x * 2.;}, _e_); + function f(g, x){ + try{caml_call1(g, x); return;} + catch(e$0){ + var e = caml_wrap_exception(e$0); + throw caml_maybe_attach_backtrace(e, 0); + } + } + f(function(x){return x + 1 | 0;}, 7); + f(function(x){return x * 2.;}, 4.); return 0; } //end function test2(param){ - function f(g, x){return caml_call1(g, x);} - var _c_ = 7; - f(function(x){return x + 1 | 0;}, _c_); + function f(g, x){ + try{caml_call1(g, x); return;} + catch(e$0){ + var e = caml_wrap_exception(e$0); + throw caml_maybe_attach_backtrace(e, 0); + } + } + f(function(x){return x + 1 | 0;}, 7); f(function(x){return caml_call2(Stdlib[28], x, cst_a$0);}, cst_a); return 0; } //end function test3(x){ function F(symbol){function f(x){return x + 1 | 0;} return [0, f];} - var M1 = F([0]), M2 = F([0]), _b_ = M2[1].call(null, 2); - return [0, M1[1].call(null, 1), _b_]; + var M1 = F([0]), M2 = F([0]), _b_ = (0, M2[1])(2); + return [0, (0, M1[1])(1), _b_]; } //end function test4(x){ @@ -85,10 +94,11 @@ let%expect_test "direct calls without --enable effects" = return [0, f]; } var M1 = F([0]), M2 = F([0]); - M1[1].call(null, 1); - return M2[1].call(null, 2); + (0, M1[1])(1); + return (0, M2[1])(2); } - //end |}] + //end + |}] let%expect_test "direct calls with --enable effects" = let code = @@ -97,13 +107,13 @@ let%expect_test "direct calls with --enable effects" = {| (* Arity of the argument of a function / direct call *) let test1 () = - let f g x = g x in + let f g x = try g x with e -> raise e in ignore (f (fun x -> x + 1) 7); ignore (f (fun x -> x *. 2.) 4.) (* Arity of the argument of a function / CPS call *) let test2 () = - let f g x = g x in + let f g x = try g x with e -> raise e in ignore (f (fun x -> x + 1) 7); ignore (f (fun x -> x ^ "a") "a") @@ -130,35 +140,47 @@ let%expect_test "direct calls with --enable effects" = [%expect {| function test1(param, cont){ - function f(g, x){return g(x);} - var _k_ = 7; - f(function(x){return x + 1 | 0;}, _k_); - var _l_ = 4.; - f(function(x){return x * 2.;}, _l_); + function f(g, x){ + try{g(undef); return;} + catch(e$0){ + var e = caml_wrap_exception(e$0); + throw caml_maybe_attach_backtrace(e, 0); + } + } + f(function(x){return;}, undef); + f(function(x){return;}, undef); return cont(0); } //end function test2(param, cont){ - function f(g, x, cont){return caml_cps_exact_call2(g, x, cont);} - var _f_ = 7; - function _g_(x, cont){return cont(x + 1 | 0);} + function f(g, x, cont){ + runtime.caml_push_trap + (function(e){ + var raise = caml_pop_trap(), e$0 = caml_maybe_attach_backtrace(e, 0); + return raise(e$0); + }); + return caml_cps_exact_call2 + (g, x, function(_f_){caml_pop_trap(); return cont(undef);}); + } return caml_cps_exact_call3 (f, - _g_, - _f_, - function(_h_){ - function _i_(x, cont){ - return caml_cps_call3(Stdlib[28], x, cst_a$0, cont); - } + function(x, cont){return cont(undef);}, + 7, + function(_d_){ return caml_cps_exact_call3 - (f, _i_, cst_a, function(_j_){return cont(0);}); + (f, + function(x, cont){ + return caml_cps_call3(Stdlib[28], x, cst_a$0, cont); + }, + cst_a, + function(_e_){return cont(0);}); }); } //end function test3(x, cont){ function F(symbol){function f(x){return x + 1 | 0;} return [0, f];} - var M1 = F([0]), M2 = F([0]), _e_ = M2[1].call(null, 2); - return cont([0, M1[1].call(null, 1), _e_]); + var M1 = F(undef), M2 = F(undef), _c_ = (0, M2[1])(2); + return cont([0, (0, M1[1])(1), _c_]); } //end function test4(x, cont){ @@ -166,10 +188,11 @@ let%expect_test "direct calls with --enable effects" = function f(x, cont){return caml_cps_call3(Stdlib_Printf[2], _a_, x, cont);} return [0, f]; } - var M1 = F([0]), M2 = F([0]), _b_ = 1, _c_ = M1[1]; + var M1 = F(undef), M2 = F(undef); return caml_cps_exact_call2 - (_c_, - _b_, - function(_d_){return caml_cps_exact_call2(M2[1], 2, cont);}); + (M1[1], + 1, + function(_b_){return caml_cps_exact_call2(M2[1], 2, cont);}); } - //end |}] + //end + |}] diff --git a/compiler/tests-compiler/dune.inc b/compiler/tests-compiler/dune.inc index f541039ba..c72f2c334 100644 --- a/compiler/tests-compiler/dune.inc +++ b/compiler/tests-compiler/dune.inc @@ -359,14 +359,74 @@ (preprocess (pps ppx_expect))) +(library + ;; compiler/tests-compiler/gh1481.ml + (name gh1481_15) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (modules gh1481) + (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) + (inline_tests + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (deps + (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) + (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) + (flags (:standard -open Jsoo_compiler_expect_tests_helper)) + (preprocess + (pps ppx_expect))) + +(library + ;; compiler/tests-compiler/gh1494.ml + (name gh1494_15) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (modules gh1494) + (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) + (inline_tests + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (deps + (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) + (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) + (flags (:standard -open Jsoo_compiler_expect_tests_helper)) + (preprocess + (pps ppx_expect))) + +(library + ;; compiler/tests-compiler/gh1559.ml + (name gh1559_15) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (modules gh1559) + (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) + (inline_tests + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (deps + (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) + (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) + (flags (:standard -open Jsoo_compiler_expect_tests_helper)) + (preprocess + (pps ppx_expect))) + +(library + ;; compiler/tests-compiler/gh1599.ml + (name gh1599_15) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (modules gh1599) + (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) + (inline_tests + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (deps + (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) + (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) + (flags (:standard -open Jsoo_compiler_expect_tests_helper)) + (preprocess + (pps ppx_expect))) + (library ;; compiler/tests-compiler/gh1659.ml (name gh1659_15) - (enabled_if true) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) (modules gh1659) (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) (inline_tests - (enabled_if true) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) (deps (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) @@ -404,6 +464,21 @@ (preprocess (pps ppx_expect))) +(library + ;; compiler/tests-compiler/global_deadcode.ml + (name global_deadcode_15) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (modules global_deadcode) + (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) + (inline_tests + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (deps + (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) + (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) + (flags (:standard -open Jsoo_compiler_expect_tests_helper)) + (preprocess + (pps ppx_expect))) + (library ;; compiler/tests-compiler/inlining.ml (name inlining_15) @@ -584,6 +659,21 @@ (preprocess (pps ppx_expect))) +(library + ;; compiler/tests-compiler/scopes.ml + (name scopes_15) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (modules scopes) + (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) + (inline_tests + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (deps + (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) + (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) + (flags (:standard -open Jsoo_compiler_expect_tests_helper)) + (preprocess + (pps ppx_expect))) + (library ;; compiler/tests-compiler/side_effect.ml (name side_effect_15) @@ -689,6 +779,21 @@ (preprocess (pps ppx_expect))) +(library + ;; compiler/tests-compiler/test_string.ml + (name test_string_15) + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (modules test_string) + (libraries js_of_ocaml_compiler unix str jsoo_compiler_expect_tests_helper) + (inline_tests + (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) + (deps + (file %{project_root}/compiler/bin-js_of_ocaml/js_of_ocaml.exe) + (file %{project_root}/compiler/bin-jsoo_minify/jsoo_minify.exe))) + (flags (:standard -open Jsoo_compiler_expect_tests_helper)) + (preprocess + (pps ppx_expect))) + (library ;; compiler/tests-compiler/unix_fs.ml (name unix_fs_15) diff --git a/compiler/tests-compiler/effects.ml b/compiler/tests-compiler/effects.ml index 48ae87ea8..95892eb39 100644 --- a/compiler/tests-compiler/effects.ml +++ b/compiler/tests-compiler/effects.ml @@ -43,28 +43,21 @@ let fff () = [%expect {| function fff(param, cont){ - var - _b_ = - [0, - function(e, cont){ - return e === E - ? cont([0, function(k, cont){return cont(11);}]) - : cont(0); - }], - _c_ = 10; - function _d_(x, cont){return cont(x);} - var _e_ = Stdlib_Effect[3][5]; return caml_cps_call4 - (_e_, - _d_, - _c_, - _b_, - function(_f_){ - var _g_ = Stdlib_Printf[2]; + (Stdlib_Effect[3][5], + function(x, cont){return cont(x);}, + 10, + [0, + function(e, cont){ + return e === E + ? cont([0, function(k, cont){return cont(11);}]) + : cont(0); + }], + function(_b_){ return caml_cps_call2 - (_g_, + (Stdlib_Printf[2], _a_, - function(_h_){return caml_cps_call2(_h_, _f_, cont);}); + function(_c_){return caml_cps_call2(_c_, _b_, cont);}); }); } //end |}] diff --git a/compiler/tests-compiler/effects_continuations.ml b/compiler/tests-compiler/effects_continuations.ml index b42a2d183..0da72bd5e 100644 --- a/compiler/tests-compiler/effects_continuations.ml +++ b/compiler/tests-compiler/effects_continuations.ml @@ -24,6 +24,11 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = compile_and_parse ~effects:true {| + + let list_rev = List.rev + (* Avoid to expose the offset of stdlib modules *) + let () = ignore (list_rev []) + let exceptions s = (* Compiled using 'try ... catch', and 'throw' within the try block *) @@ -78,7 +83,7 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = done let loop3 () = - let l = List.rev [1;2;3] in + let l = list_rev [1;2;3] in let rec f x = match x with | [] -> l @@ -98,120 +103,110 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = {| function exceptions(s, cont){ - try{var _C_ = runtime.caml_int_of_string(s), n = _C_;} - catch(_G_){ - var _v_ = caml_wrap_exception(_G_); - if(_v_[1] !== Stdlib[7]){ + try{var _t_ = runtime.caml_int_of_string(s), n = _t_;} + catch(_x_){ + var _p_ = caml_wrap_exception(_x_); + if(_p_[1] !== Stdlib[7]){ var raise$1 = caml_pop_trap(); - return raise$1(caml_maybe_attach_backtrace(_v_, 0)); + return raise$1(caml_maybe_attach_backtrace(_p_, 0)); } - var n = 0, _w_ = 0; + var n = 0; } try{ if(caml_string_equal(s, cst$0)) throw caml_maybe_attach_backtrace(Stdlib[8], 1); - var _B_ = 7, m = _B_; + var _s_ = 7, m = _s_; } - catch(_F_){ - var _x_ = caml_wrap_exception(_F_); - if(_x_ !== Stdlib[8]){ + catch(_w_){ + var _q_ = caml_wrap_exception(_w_); + if(_q_ !== Stdlib[8]){ var raise$0 = caml_pop_trap(); - return raise$0(caml_maybe_attach_backtrace(_x_, 0)); + return raise$0(caml_maybe_attach_backtrace(_q_, 0)); } - var m = 0, _y_ = 0; + var m = 0; } runtime.caml_push_trap - (function(_E_){ - if(_E_ === Stdlib[8]) return cont(0); + (function(_v_){ + if(_v_ === Stdlib[8]) return cont(0); var raise = caml_pop_trap(); - return raise(caml_maybe_attach_backtrace(_E_, 0)); + return raise(caml_maybe_attach_backtrace(_v_, 0)); }); - if(caml_string_equal(s, cst)){ - var _z_ = Stdlib[8], raise = caml_pop_trap(); - return raise(caml_maybe_attach_backtrace(_z_, 1)); - } - var _A_ = Stdlib[79]; - return caml_cps_call2 - (_A_, - cst_toto, - function(_D_){caml_pop_trap(); return cont([0, [0, _D_, n, m]]);}); + if(! caml_string_equal(s, cst)) + return caml_cps_call2 + (Stdlib[79], + cst_toto, + function(_u_){caml_pop_trap(); return cont([0, [0, _u_, n, m]]);}); + var _r_ = Stdlib[8], raise = caml_pop_trap(); + return raise(caml_maybe_attach_backtrace(_r_, 1)); } //end function cond1(b, cont){ - function _u_(ic){return cont([0, ic, 7]);} + function _o_(ic){return cont([0, ic, 7]);} return b - ? caml_cps_call2(Stdlib[79], cst_toto$0, _u_) - : caml_cps_call2(Stdlib[79], cst_titi, _u_); + ? caml_cps_call2(Stdlib[79], cst_toto$0, _o_) + : caml_cps_call2(Stdlib[79], cst_titi, _o_); } //end function cond2(b, cont){ - function _s_(_t_){return cont(7);} + function _m_(_n_){return cont(7);} return b - ? caml_cps_call2(Stdlib_Printf[3], _a_, _s_) - : caml_cps_call2(Stdlib_Printf[3], _b_, _s_); + ? caml_cps_call2(Stdlib_Printf[3], _a_, _m_) + : caml_cps_call2(Stdlib_Printf[3], _b_, _m_); } //end function cond3(b, cont){ var x = [0, 0]; - function _q_(_r_){return cont(x[1]);} - return b ? (x[1] = 1, _q_(0)) : caml_cps_call2(Stdlib_Printf[3], _c_, _q_); + function _k_(_l_){return cont(x[1]);} + return b ? (x[1] = 1, _k_(0)) : caml_cps_call2(Stdlib_Printf[3], _c_, _k_); } //end function loop1(b, cont){ - var all = [0, 0], _m_ = Stdlib[79]; return caml_cps_call2 - (_m_, + (Stdlib[79], cst_static_examples_ml, function(ic){ - function _n_(_p_){ - var _o_ = Stdlib[83]; + function _i_(_j_){ return caml_cps_call2 - (_o_, + (Stdlib[83], ic, function(line){ - all[1] = [0, line, all[1]]; return b - ? caml_cps_call2(Stdlib[53], line, _n_) - : caml_cps_exact_call1(_n_, 0); + ? caml_cps_call2(Stdlib[53], line, _i_) + : caml_cps_exact_call1(_i_, 0); }); } - return _n_(0); + return _i_(0); }); } //end function loop2(param, cont){ - var all = [0, 0], _h_ = Stdlib[79]; return caml_cps_call2 - (_h_, + (Stdlib[79], cst_static_examples_ml$0, function(ic){ - var _i_ = Stdlib_Printf[3]; - function _j_(_l_){ - var _k_ = Stdlib[83]; + function _g_(_h_){ return caml_cps_call2 - (_k_, + (Stdlib[83], ic, function(line){ - all[1] = [0, line, all[1]]; - return caml_cps_call2(Stdlib[53], line, _j_); + return caml_cps_call2(Stdlib[53], line, _g_); }); } - return caml_cps_call2(_i_, _d_, _j_); + return caml_cps_call2(Stdlib_Printf[3], _d_, _g_); }); } //end function loop3(param, cont){ - var _f_ = Stdlib_List[9]; return caml_cps_call2 - (_f_, + (list_rev, _e_, function(l){ - function _g_(x){ + function _f_(x){ if(! x) return cont(l); var r = x[2]; - return caml_cps_exact_call1(_g_, r); + return caml_cps_exact_call1(_f_, r); } - return _g_(l); + return _f_(l); }); } //end |}] diff --git a/compiler/tests-compiler/effects_exceptions.ml b/compiler/tests-compiler/effects_exceptions.ml index fd3f89291..f227b7b88 100644 --- a/compiler/tests-compiler/effects_exceptions.ml +++ b/compiler/tests-compiler/effects_exceptions.ml @@ -57,43 +57,41 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = {| function exceptions(s, cont){ - try{var _p_ = runtime.caml_int_of_string(s), n = _p_;} - catch(_t_){ - var _i_ = caml_wrap_exception(_t_); - if(_i_[1] !== Stdlib[7]){ + try{var _k_ = runtime.caml_int_of_string(s), n = _k_;} + catch(_o_){ + var _g_ = caml_wrap_exception(_o_); + if(_g_[1] !== Stdlib[7]){ var raise$1 = caml_pop_trap(); - return raise$1(caml_maybe_attach_backtrace(_i_, 0)); + return raise$1(caml_maybe_attach_backtrace(_g_, 0)); } - var n = 0, _j_ = 0; + var n = 0; } try{ if(caml_string_equal(s, cst$0)) throw caml_maybe_attach_backtrace(Stdlib[8], 1); - var _o_ = 7, m = _o_; + var _j_ = 7, m = _j_; } - catch(_s_){ - var _k_ = caml_wrap_exception(_s_); - if(_k_ !== Stdlib[8]){ + catch(_n_){ + var _h_ = caml_wrap_exception(_n_); + if(_h_ !== Stdlib[8]){ var raise$0 = caml_pop_trap(); - return raise$0(caml_maybe_attach_backtrace(_k_, 0)); + return raise$0(caml_maybe_attach_backtrace(_h_, 0)); } - var m = 0, _l_ = 0; + var m = 0; } caml_push_trap - (function(_r_){ - if(_r_ === Stdlib[8]) return cont(0); + (function(_m_){ + if(_m_ === Stdlib[8]) return cont(0); var raise = caml_pop_trap(); - return raise(caml_maybe_attach_backtrace(_r_, 0)); + return raise(caml_maybe_attach_backtrace(_m_, 0)); }); - if(caml_string_equal(s, cst)){ - var _m_ = Stdlib[8], raise = caml_pop_trap(); - return raise(caml_maybe_attach_backtrace(_m_, 1)); - } - var _n_ = Stdlib[79]; - return caml_cps_call2 - (_n_, - cst_toto, - function(_q_){caml_pop_trap(); return cont([0, [0, _q_, n, m]]);}); + if(! caml_string_equal(s, cst)) + return caml_cps_call2 + (Stdlib[79], + cst_toto, + function(_l_){caml_pop_trap(); return cont([0, [0, _l_, n, m]]);}); + var _i_ = Stdlib[8], raise = caml_pop_trap(); + return raise(caml_maybe_attach_backtrace(_i_, 1)); } //end |}]; print_fun_decl code (Some "handler_is_loop"); @@ -101,15 +99,15 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = {| function handler_is_loop(f, g, l, cont){ caml_push_trap - (function(_g_){ - function _h_(l){ + (function(_e_){ + function _f_(l){ return caml_cps_call2 (g, l, function(match){ if(72330306 <= match[1]){ var l = match[2]; - return caml_cps_exact_call1(_h_, l); + return caml_cps_exact_call1(_f_, l); } var exn = match[2], @@ -118,21 +116,18 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = return raise(exn$0); }); } - return _h_(l); + return _f_(l); }); - var _e_ = 0; return caml_cps_call2 - (f, _e_, function(_f_){caml_pop_trap(); return cont(_f_);}); + (f, 0, function(_d_){caml_pop_trap(); return cont(_d_);}); } //end |}]; print_fun_decl code (Some "handler_is_merge_node"); [%expect {| function handler_is_merge_node(g, cont){ - function _b_(s){return caml_cps_call3(Stdlib[28], s, cst_aaa, cont);} - caml_push_trap(function(_d_){return _b_(cst$1);}); - var _a_ = 0; - return caml_cps_call2 - (g, _a_, function(_c_){caml_pop_trap(); return _b_(_c_);}); + function _a_(s){return caml_cps_call3(Stdlib[28], s, cst_aaa, cont);} + caml_push_trap(function(_c_){return _a_(cst$1);}); + return caml_cps_call2(g, 0, function(_b_){caml_pop_trap(); return _a_(_b_);}); } //end |}] diff --git a/compiler/tests-compiler/effects_toplevel.ml b/compiler/tests-compiler/effects_toplevel.ml index 38c9e8d1f..596b47f1b 100644 --- a/compiler/tests-compiler/effects_toplevel.ml +++ b/compiler/tests-compiler/effects_toplevel.ml @@ -65,6 +65,7 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = return caml_callback (function(cont){ var + undef = undefined, global_data = runtime.caml_get_global_data(), Stdlib_Printf = global_data.Stdlib__Printf, _a_ = @@ -74,23 +75,21 @@ let%expect_test "test-compiler/lib-effects/test1.ml" = function g(param, cont){ return caml_cps_call2(Stdlib_Printf[2], _a_, cont); } - caml_callback(g, [0]); - var _b_ = 1; - function _c_(i){ - var _d_ = 0; + caml_callback(g, [undef]); + function _b_(i){ return caml_cps_exact_call2 (g, - _d_, - function(_e_){ - var _f_ = i + 1 | 0; - if(5 !== i) return caml_cps_exact_call1(_c_, _f_); - caml_callback(g, [0]); + undef, + function(_c_){ + var _d_ = i + 1 | 0; + if(5 !== i) return caml_cps_exact_call1(_b_, _d_); + caml_callback(g, [undef]); var Test = [0]; runtime.caml_register_global(2, Test, "Test"); return; }); } - return _c_(_b_); + return _b_(1); }, []); } diff --git a/compiler/tests-compiler/es6.ml b/compiler/tests-compiler/es6.ml index 9b64c1d5d..464a1d7d3 100644 --- a/compiler/tests-compiler/es6.ml +++ b/compiler/tests-compiler/es6.ml @@ -35,3 +35,60 @@ let f x = return;}) (globalThis); //end |}] + +let%expect_test _ = + let prog = + {| +let rec odd n' = function + 0 -> n', false +| 1 -> n', true +| n -> odd (pred (pred n)) (pred (pred n')) + |} + in + let flags = [ "--enable"; "es6" ] in + let program = Util.compile_and_parse ~effects:false ~pretty:false ~flags prog in + Util.print_program program; + [%expect + {| + (a=>{ + "use strict"; + var b = a.jsoo_runtime; + b.caml_register_global + (0, + [0, + (a, b)=>{ + var d = a, c = b; + for(;;){ + if(0 === c) return [0, d, 0]; + if(1 === c) return [0, d, 1]; + [c, d] = [(d - 1 | 0) - 1 | 0, (c - 1 | 0) - 1 | 0]; + }}], + "Test"); + return;}) + (globalThis); + //end |}]; + let program = Util.compile_and_parse ~effects:false ~pretty:false ~flags:[] prog in + Util.print_program program; + [%expect + {| + (function(a){ + "use strict"; + var b = a.jsoo_runtime; + b.caml_register_global + (0, + [0, + function(a, b){ + var d = a, c = b; + for(;;){ + if(0 === c) return [0, d, 0]; + if(1 === c) return [0, d, 1]; + var e = (d - 1 | 0) - 1 | 0; + d = (c - 1 | 0) - 1 | 0; + c = e; + } + }], + "Test"); + return; + } + (globalThis)); + //end |}] diff --git a/compiler/tests-compiler/exports.ml b/compiler/tests-compiler/exports.ml index 724c3610b..0a52fb41d 100644 --- a/compiler/tests-compiler/exports.ml +++ b/compiler/tests-compiler/exports.ml @@ -31,18 +31,21 @@ let%expect_test "static eval of string get" = || Javascript.IdentSet.mem jsoo_exports traverse#get_def in let clean program = - let clean_statement st = + let rec clean_statement st = let open Js_of_ocaml_compiler.Javascript in match st with | Function_declaration (name, (k, param, body, loc1)), loc2 -> ( match List.filter use_jsoo_exports body with | [] -> None - | body -> Some (Function_declaration (name, (k, param, body, loc1)), loc2)) + | body -> + let body = List.filter_map clean_statement body in + Some (Function_declaration (name, (k, param, body, loc1)), loc2)) | ( Expression_statement (ECall (EFun (name, (k, param, body, loc1)), ANormal, a, l)) , loc ) -> ( match List.filter use_jsoo_exports body with | [] -> None | body -> + let body = List.filter_map clean_statement body in Some ( Expression_statement (ECall (EFun (name, (k, param, body, loc1)), ANormal, a, l)) diff --git a/compiler/tests-compiler/gh1007.ml b/compiler/tests-compiler/gh1007.ml index 4b96b037f..b18c496ff 100644 --- a/compiler/tests-compiler/gh1007.ml +++ b/compiler/tests-compiler/gh1007.ml @@ -156,12 +156,11 @@ let () = M.myfun M.x {| function myfun(x){ var x$0 = x; - a: for(;;){ if(! x$0) return 0; var next = x$0[1], - rev_sort = + sort = function(n, l){ if(2 === n){ if(l){ @@ -173,8 +172,8 @@ let () = M.myfun M.x x1 = l[1], s = 0 < caml_int_compare(x1, x2) - ? [0, x1, [0, x2, 0]] - : [0, x2, [0, x1, 0]]; + ? [0, x2, [0, x1, 0]] + : [0, x1, [0, x2, 0]]; return [0, s, tl]; } } @@ -192,19 +191,19 @@ let () = M.myfun M.x s$0 = 0 < caml_int_compare(x1$0, x2$0) ? 0 - < caml_int_compare(x2$0, x3) - ? [0, x1$0, [0, x2$0, [0, x3, 0]]] - : 0 - < caml_int_compare(x1$0, x3) - ? [0, x1$0, [0, x3, [0, x2$0, 0]]] - : [0, x3, [0, x1$0, [0, x2$0, 0]]] - : 0 < caml_int_compare(x1$0, x3) - ? [0, x2$0, [0, x1$0, [0, x3, 0]]] - : 0 + ? 0 < caml_int_compare(x2$0, x3) - ? [0, x2$0, [0, x3, [0, x1$0, 0]]] - : [0, x3, [0, x2$0, [0, x1$0, 0]]]; + ? [0, x3, [0, x2$0, [0, x1$0, 0]]] + : [0, x2$0, [0, x3, [0, x1$0, 0]]] + : [0, x2$0, [0, x1$0, [0, x3, 0]]] + : 0 + < caml_int_compare(x2$0, x3) + ? 0 + < caml_int_compare(x1$0, x3) + ? [0, x3, [0, x1$0, [0, x2$0, 0]]] + : [0, x1$0, [0, x3, [0, x2$0, 0]]] + : [0, x1$0, [0, x2$0, [0, x3, 0]]]; return [0, s$0, tl$1]; } } @@ -212,10 +211,10 @@ let () = M.myfun M.x var n1 = n >> 1, n2 = n - n1 | 0, - match$0 = sort(n1, l), + match$0 = rev_sort$0(n1, l), l2$0 = match$0[2], s1 = match$0[1], - match$1 = sort(n2, l2$0), + match$1 = rev_sort$0(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, @@ -226,10 +225,14 @@ let () = M.myfun M.x if(l2){ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; if(0 < caml_int_compare(h1, h2)){ - var accu$0 = [0, h2, accu], l2 = t2, accu = accu$0; + var accu$0 = [0, h1, accu]; + l1 = t1; + accu = accu$0; continue; } - var accu$1 = [0, h1, accu], l1 = t1, accu = accu$1; + var accu$1 = [0, h2, accu]; + l2 = t2; + accu = accu$1; continue; } var _c_ = rev_append(l1, accu); @@ -239,7 +242,7 @@ let () = M.myfun M.x return [0, _c_, tl$0]; } }, - sort = + rev_sort = function(n, l){ if(2 === n){ if(l){ @@ -251,8 +254,8 @@ let () = M.myfun M.x x1 = l[1], s = 0 < caml_int_compare(x1, x2) - ? [0, x2, [0, x1, 0]] - : [0, x1, [0, x2, 0]]; + ? [0, x1, [0, x2, 0]] + : [0, x2, [0, x1, 0]]; return [0, s, tl]; } } @@ -270,19 +273,19 @@ let () = M.myfun M.x s$0 = 0 < caml_int_compare(x1$0, x2$0) ? 0 - < caml_int_compare(x1$0, x3) - ? 0 - < caml_int_compare(x2$0, x3) - ? [0, x3, [0, x2$0, [0, x1$0, 0]]] - : [0, x2$0, [0, x3, [0, x1$0, 0]]] - : [0, x2$0, [0, x1$0, [0, x3, 0]]] - : 0 < caml_int_compare(x2$0, x3) - ? 0 + ? [0, x1$0, [0, x2$0, [0, x3, 0]]] + : 0 < caml_int_compare(x1$0, x3) - ? [0, x3, [0, x1$0, [0, x2$0, 0]]] - : [0, x1$0, [0, x3, [0, x2$0, 0]]] - : [0, x1$0, [0, x2$0, [0, x3, 0]]]; + ? [0, x1$0, [0, x3, [0, x2$0, 0]]] + : [0, x3, [0, x1$0, [0, x2$0, 0]]] + : 0 + < caml_int_compare(x1$0, x3) + ? [0, x2$0, [0, x1$0, [0, x3, 0]]] + : 0 + < caml_int_compare(x2$0, x3) + ? [0, x2$0, [0, x3, [0, x1$0, 0]]] + : [0, x3, [0, x2$0, [0, x1$0, 0]]]; return [0, s$0, tl$1]; } } @@ -290,10 +293,10 @@ let () = M.myfun M.x var n1 = n >> 1, n2 = n - n1 | 0, - match$0 = rev_sort(n1, l), + match$0 = sort$0(n1, l), l2$0 = match$0[2], s1 = match$0[1], - match$1 = rev_sort(n2, l2$0), + match$1 = sort$0(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, @@ -304,10 +307,14 @@ let () = M.myfun M.x if(l2){ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; if(0 < caml_int_compare(h1, h2)){ - var accu$0 = [0, h1, accu], l1 = t1, accu = accu$0; + var accu$0 = [0, h2, accu]; + l2 = t2; + accu = accu$0; continue; } - var accu$1 = [0, h2, accu], l2 = t2, accu = accu$1; + var accu$1 = [0, h1, accu]; + l1 = t1; + accu = accu$1; continue; } var _a_ = rev_append(l1, accu); @@ -316,18 +323,17 @@ let () = M.myfun M.x var _a_ = rev_append(l2, accu); return [0, _a_, tl$0]; } - }, - len = 0, - param = l; + }; + let sort$0 = sort, rev_sort$0 = rev_sort; + var len = 0, param = l; for(;;){ - if(param){ - var l$0 = param[2], len$0 = len + 1 | 0, len = len$0, param = l$0; - continue; - } - if(2 <= len) sort(len, l); - var x$0 = next; - continue a; + if(! param) break; + var l$0 = param[2], len$0 = len + 1 | 0; + len = len$0; + param = l$0; } + if(2 <= len) sort(len, l); + x$0 = next; } } //end |}] @@ -353,7 +359,7 @@ end = struct let run () = for i = 0 to 4 do - ignore (even (i) : bool) + if even (i) then print_string "" done end @@ -370,32 +376,33 @@ let () = M.run () var i = 0; for(;;){ var - even = + odd = function(n){ - if(2 < n >>> 0) return 1 - (1 - odd(n - 1 | 0)); + if(2 < n >>> 0) return 1 - (1 - even$0(n - 1 | 0)); switch(n){ case 0: - return 1; + return 0; case 1: - return 1 - (1 - odd(0)); - default: return 1 - (1 - odd(1)); + return 1 - (1 - even$0(0)); + default: return 1 - (1 - even$0(1)); } }, - odd = + even = function(n){ - if(2 < n >>> 0) return 1 - (1 - even(n - 1 | 0)); + if(2 < n >>> 0) return 1 - (1 - odd$0(n - 1 | 0)); switch(n){ case 0: - return 0; + return 1; case 1: - return 1 - (1 - even(0)); - default: return 1 - (1 - even(1)); + return 1 - (1 - odd$0(0)); + default: return 1 - (1 - odd$0(1)); } }; - even(i); + let odd$0 = odd, even$0 = even; + if(even(i)) caml_call1(Stdlib[42], cst); var _a_ = i + 1 | 0; if(4 === i) return 0; - var i = _a_; + i = _a_; } } //end |}] @@ -403,6 +410,13 @@ let () = M.run () let%expect_test _ = let prog = {| + +let list_rev = List.rev +let list_iter = List.iter +(* Avoid to expose the offset of stdlib modules *) +let () = ignore (list_rev []) +let () = ignore (list_iter (fun f -> f ()) []) + module M : sig val run : unit -> unit end = struct @@ -430,9 +444,9 @@ end = struct let run () = for i = 0 to 4 do - ignore (even (i) : bool) + if even (i) then print_string "" done; - List.iter (fun f -> f ()) (List.rev !delayed) + list_iter (fun f -> f ()) (list_rev !delayed) end let () = M.run () @@ -458,56 +472,61 @@ let () = M.run () function run(param){ var i = 0; for(;;){ + let i$0 = i; var - closures = - function(i){ - function even(n){ - if(2 < n >>> 0) return 1 - (1 - odd(n - 1 | 0)); - switch(n){ - case 0: - var - f = function(param){return caml_call2(Stdlib_Printf[2], _b_, i);}; - delayed[1] = [0, f, delayed[1]]; - f(0); - return 1; - case 1: - return 1 - (1 - odd(0)); - default: return 1 - (1 - odd(1)); - } - } - function odd(n){ - if(2 < n >>> 0) return 1 - (1 - even(n - 1 | 0)); - switch(n){ - case 0: - var - f = function(param){return caml_call2(Stdlib_Printf[2], _a_, i);}; - delayed[1] = [0, f, delayed[1]]; - f(0); - return 0; - case 1: - return 1 - (1 - even(0)); - default: return 1 - (1 - even(1)); - } + odd = + function(n){ + if(2 < n >>> 0) return 1 - (1 - even$0(n - 1 | 0)); + switch(n){ + case 0: + var + f = function(param){return caml_call2(Stdlib_Printf[2], _a_, i$0);}; + delayed[1] = [0, f, delayed[1]]; + f(0); + return 0; + case 1: + return 1 - (1 - even$0(0)); + default: return 1 - (1 - even$0(1)); } - var block = [0, even, odd]; - return block; }, - closures$0 = closures(i), - even = closures$0[1]; - even(i); - var _e_ = i + 1 | 0; - if(4 !== i){var i = _e_; continue;} - var - _c_ = caml_call1(Stdlib_List[9], delayed[1]), - _d_ = function(f){return caml_call1(f, 0);}; - return caml_call2(Stdlib_List[17], _d_, _c_); + even = + function(n){ + if(2 < n >>> 0) return 1 - (1 - odd$0(n - 1 | 0)); + switch(n){ + case 0: + var + f = function(param){return caml_call2(Stdlib_Printf[2], _b_, i$0);}; + delayed[1] = [0, f, delayed[1]]; + f(0); + return 1; + case 1: + return 1 - (1 - odd$0(0)); + default: return 1 - (1 - odd$0(1)); + } + }; + let odd$0 = odd, even$0 = even; + if(even(i)) caml_call1(Stdlib[42], cst); + var _c_ = i + 1 | 0; + if(4 === i) break; + i = _c_; } + return caml_call2 + (list_iter, + function(f){return caml_call1(f, 0);}, + caml_call1(list_rev, delayed[1])); } //end |}] let%expect_test _ = let prog = {| + +let list_rev = List.rev +let list_iter = List.iter +(* Avoid to expose the offset of stdlib modules *) +let () = ignore (list_rev []) +let () = ignore (list_iter (fun f -> f ()) []) + module M : sig val run : unit -> unit end = struct @@ -541,7 +560,7 @@ end = struct in ignore (r (even (i)) : bool) done; - List.iter (fun f -> f ()) (List.rev !delayed) + list_iter (fun f -> f ()) (list_rev !delayed) end let () = M.run () @@ -566,66 +585,65 @@ let () = M.run () {| function run(param){ var i = 0; - a: for(;;){ + let i$0 = i; var - closures = - function(i){ - function even(n){ - if(2 < n >>> 0) - return [0, 748545554, function(param){return odd(n - 1 | 0);}]; - switch(n){ - case 0: - return [0, - 748545554, - function(param){ - function f(param){ - return caml_call2(Stdlib_Printf[2], _c_, i); - } - delayed[1] = [0, f, delayed[1]]; - f(0); - return _d_; - }]; - case 1: - return [0, 748545554, function(param){return odd(0);}]; - default: return [0, 748545554, function(param){return odd(1);}]; - } - } - function odd(n){ - if(2 < n >>> 0) - return [0, 748545554, function(param){return even(n - 1 | 0);}]; - switch(n){ - case 0: - return [0, - 748545554, - function(param){ - function f(param){ - return caml_call2(Stdlib_Printf[2], _a_, i); - } - delayed[1] = [0, f, delayed[1]]; - f(0); - return _b_; - }]; - case 1: - return [0, 748545554, function(param){return even(0);}]; - default: return [0, 748545554, function(param){return even(1);}]; - } + odd = + function(n){ + if(2 < n >>> 0) + return [0, 748545554, function(param){return even$0(n - 1 | 0);}]; + switch(n){ + case 0: + return [0, + 748545554, + function(param){ + function f(param){ + return caml_call2(Stdlib_Printf[2], _a_, i$0); + } + delayed[1] = [0, f, delayed[1]]; + f(0); + return _b_; + }]; + case 1: + return [0, 748545554, function(param){return even$0(0);}]; + default: return [0, 748545554, function(param){return even$0(1);}]; } - var block = [0, even, odd]; - return block; }, - closures$0 = closures(i), - even = closures$0[1], - param$0 = even(i); + even = + function(n){ + if(2 < n >>> 0) + return [0, 748545554, function(param){return odd$0(n - 1 | 0);}]; + switch(n){ + case 0: + return [0, + 748545554, + function(param){ + function f(param){ + return caml_call2(Stdlib_Printf[2], _c_, i$0); + } + delayed[1] = [0, f, delayed[1]]; + f(0); + return _d_; + }]; + case 1: + return [0, 748545554, function(param){return odd$0(0);}]; + default: return [0, 748545554, function(param){return odd$0(1);}]; + } + }; + let odd$0 = odd, even$0 = even; + var param$0 = even(i); for(;;){ - if(759635106 > param$0[1]){var f = param$0[2], param$0 = f(0); continue;} - var _g_ = i + 1 | 0; - if(4 !== i){var i = _g_; continue a;} - var - _e_ = caml_call1(Stdlib_List[9], delayed[1]), - _f_ = function(f){return caml_call1(f, 0);}; - return caml_call2(Stdlib_List[17], _f_, _e_); + if(759635106 <= param$0[1]) break; + var f = param$0[2]; + param$0 = f(0); } + var _e_ = i + 1 | 0; + if(4 === i) break; + i = _e_; } + return caml_call2 + (list_iter, + function(f){return caml_call1(f, 0);}, + caml_call1(list_rev, delayed[1])); } //end |}] diff --git a/compiler/tests-compiler/gh1320.ml b/compiler/tests-compiler/gh1320.ml index 14d95d6c1..b29ce75b0 100644 --- a/compiler/tests-compiler/gh1320.ml +++ b/compiler/tests-compiler/gh1320.ml @@ -22,7 +22,7 @@ let%expect_test _ = let prog = {| -let app f x = f x +let app f x = try f x with e -> raise e let myfun () = for i = 1 to 4 do @@ -46,23 +46,19 @@ let () = myfun () function myfun(param){ var i = 1; for(;;){ + let i$0 = i; var - closures = - function(i){ - function g(x){return app(f, x);} - function f(x){ - return 0 === x ? 1 : runtime.caml_mul(i, app(g, x - 1 | 0)); - } - var block = [0, g, f]; - return block; + f = + function(x){ + return 0 === x ? 1 : runtime.caml_mul(i$0, app(g$0, x - 1 | 0)); }, - closures$0 = closures(i), - g = closures$0[1], - _b_ = g(i); - caml_call2(Stdlib_Printf[3], _a_, _b_); - var _c_ = i + 1 | 0; + g = function(x){return app(f$0, x);}; + let f$0 = f, g$0 = g; + var _c_ = app(f, i); + caml_call2(Stdlib_Printf[3], _a_, _c_); + var _b_ = i + 1 | 0; if(4 === i) return 0; - var i = _c_; + i = _b_; } } //end |}] diff --git a/compiler/tests-compiler/gh1354.ml b/compiler/tests-compiler/gh1354.ml index 16789258b..f4a23f939 100644 --- a/compiler/tests-compiler/gh1354.ml +++ b/compiler/tests-compiler/gh1354.ml @@ -59,10 +59,10 @@ with Exit -> global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, Stdlib_Printf = global_data.Stdlib__Printf, - _b_ = 0, + _a_ = 0, + _b_ = _a_, _d_ = - [0, [4, 0, 0, 0, [12, 10, 0]], runtime.caml_string_of_jsbytes("%d\n")], - _a_ = 0; + [0, [4, 0, 0, 0, [12, 10, 0]], runtime.caml_string_of_jsbytes("%d\n")]; try{0; _b_ = _a_ + 1 | 0; throw caml_maybe_attach_backtrace(Stdlib[3], 1);} catch(_e_){ var _c_ = caml_wrap_exception(_e_); @@ -123,7 +123,9 @@ with Exit -> global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, Stdlib_Printf = global_data.Stdlib__Printf, - _c_ = 0, + _a_ = 0, + _b_ = 0, + _c_ = _a_, _h_ = [0, [4, 0, 0, 0, [12, 32, [4, 0, 0, 0, [12, 10, 0]]]], @@ -131,9 +133,7 @@ with Exit -> _e_ = [0, [4, 0, 0, 0, [12, 32, [4, 0, 0, 0, [12, 10, 0]]]], - caml_string_of_jsbytes("%d %d\n")], - _a_ = 0, - _b_ = 0; + caml_string_of_jsbytes("%d %d\n")]; try{ var _f_ = _a_ + 1 | 0; 0; @@ -209,10 +209,10 @@ with Exit -> global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, Stdlib_Printf = global_data.Stdlib__Printf, - _b_ = 0, + _a_ = 0, + _b_ = _a_, _f_ = [0, [4, 0, 0, 0, [12, 10, 0]], caml_string_of_jsbytes("%d\n")], - _d_ = [0, [4, 0, 0, 0, [12, 10, 0]], caml_string_of_jsbytes("%d\n")], - _a_ = 0; + _d_ = [0, [4, 0, 0, 0, [12, 10, 0]], caml_string_of_jsbytes("%d\n")]; try{ var _e_ = _a_; try{ diff --git a/compiler/tests-compiler/gh1481.ml b/compiler/tests-compiler/gh1481.ml new file mode 100644 index 000000000..6fe64ef50 --- /dev/null +++ b/compiler/tests-compiler/gh1481.ml @@ -0,0 +1,51 @@ +let%expect_test _ = + let prog = + {| +type test = [ `B | `C | `D | `A ] + +let to_string (tag : test) = + match tag with + | `A -> ("`A") + | `B -> ("`B") + | `C -> ("`C") + | `D -> ("`D") + +let correct x y = + let z = + match x, y with + | (`A, v) | (v, `A) -> v + | `B, _ | _, `B -> `B + | `C, _ | _, `C -> `C + | `D, `D -> `D + in + z + +let incorrect x y = + match x, y with + | (`A, v) | (v, `A) -> v + | `B, _ | _, `B -> `B + | `C, _ | _, `C -> `C + | `D, `D -> `D + +let () = + let a = `C in + Printf.printf "[a] is: %s\n" (to_string a); + + let b = `A in + Printf.printf "[b] is: %s\n" (to_string b); + + let c = correct a b in + Printf.printf "[correct a b] is: %s\n" (to_string c); + + let d = incorrect a b in + Printf.printf "[incorrect a b] is: %s\n" (to_string d); + + |} + in + Util.compile_and_run ~debug:false ~flags:[ "--disable"; "inline" ] prog; + [%expect + {| + [a] is: `C + [b] is: `A + [correct a b] is: `C + [incorrect a b] is: `C |}] diff --git a/compiler/tests-compiler/gh1494.ml b/compiler/tests-compiler/gh1494.ml new file mode 100644 index 000000000..fd646b38f --- /dev/null +++ b/compiler/tests-compiler/gh1494.ml @@ -0,0 +1,45 @@ +(* Js_of_ocaml tests + * http://www.ocsigen.org/js_of_ocaml/ + * Copyright (C) 2020 Hugo Heuzard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +(* https://github.com/ocsigen/js_of_ocaml/issues/1007 *) + +(* Small bug in the global flow analysis in fast mode *) +let%expect_test _ = + let prog = + {| +let () = + let bug () = let g = ref (fun x -> Fun.id) in (fun () -> !g 1), g in + let h f = + let (h, g) = f() in g := (fun x y -> y); Printf.printf "%d\n" (h () 7) in + h bug; h bug +|} + in + Util.compile_and_run prog; + [%expect {| + 7 + 7 |}]; + let program = Util.compile_and_parse prog in + Util.print_fun_decl program (Some "bug"); + [%expect + {| + function bug(param){ + var g = [0, function(x){return function(_c_){return _c_;};}]; + return [0, function(param){return caml_call1(g[1], 1);}, g]; + } + //end |}] diff --git a/compiler/tests-compiler/gh1559.ml b/compiler/tests-compiler/gh1559.ml new file mode 100644 index 000000000..586cd81f4 --- /dev/null +++ b/compiler/tests-compiler/gh1559.ml @@ -0,0 +1,237 @@ +(* Js_of_ocaml tests + * http://www.ocsigen.org/js_of_ocaml/ + * Copyright (C) 2024 Hugo Heuzard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +(* https://github.com/ocsigen/js_of_ocaml/issues/1559 *) + +let%expect_test _ = + let prog = + {| +let my_ref = ref 1 + +module _ : sig end = struct + type 'a thing = + | Thing of 'a + | No + + let f2 t = + match t with + | Thing 1 -> true + | Thing _ | No -> false + ;; + + let length = function + | Thing i -> i + | No -> -1 + ;; + + let () = + let init = Thing 1 in + let nesting = 1 in + let rec handle_state t = + let this_will_be_undefined () = if f2 t then 1 else 2 in + match length t with + | 0 -> this_will_be_undefined () + | 1 -> if Stdlib.Int.equal nesting 0 then nesting else this_will_be_undefined () + | _ -> handle_state (Thing 0) + in + print_endline (Int.to_string (handle_state init)) + ;; + + let _ : _ thing = No +end + +let () = my_ref := 2 +|} + in + Util.compile_and_run prog; + [%expect {| + 1 |}]; + let program = Util.compile_and_parse prog in + Util.print_program program; + [%expect + {| + (function(globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + t$0 = [0, 0], + init = [0, 1], + Stdlib_Int = global_data.Stdlib__Int, + Stdlib = global_data.Stdlib, + my_ref = [0, 1], + nesting = 1; + a: + { + var t = init; + for(;;){ + let t$1 = t; + var + this_will_be_undefined = + function(param){var _c_ = 1 === t$1[1] ? 1 : 0; return _c_ ? 1 : 2;}, + i = t[1]; + if(0 === i){var _a_ = this_will_be_undefined(0); break a;} + if(1 === i) break; + t = t$0; + } + var + _a_ = + caml_call2(Stdlib_Int[8], nesting, 0) + ? nesting + : this_will_be_undefined(0); + } + var _b_ = caml_call1(Stdlib_Int[12], _a_); + caml_call1(Stdlib[46], _b_); + my_ref[1] = 2; + var Test = [0, my_ref]; + runtime.caml_register_global(4, Test, "Test"); + return; + } + (globalThis)); + //end |}] + +let%expect_test _ = + let prog = + {| +let my_ref = ref 1 + +module _ : sig end = struct + type 'a thing = + | Thing of 'a + | No + + let f2 t = + match t with + | Thing 1 -> true + | Thing _ | No -> false + ;; + + let length = function + | Thing i -> i + | No -> -1 + ;; + + let () = + let init = Thing 1 in + let nesting = 1 in + let rec handle_state t = + let this_will_be_undefined () = if f2 t then 1 else 2 in + match length t with + | 0 -> + let g () = 2 + this_will_be_undefined () in + g () + g () + | 1 -> + if Stdlib.Int.equal nesting 0 + then nesting + else + let g () = if Random.int 3 > 1 then 2 + this_will_be_undefined () else 1 in + g () + g () + | _ -> handle_state (Thing 0) + in + print_endline (Int.to_string (handle_state init)) + ;; + + let _ : _ thing = No +end + +let () = my_ref := 2 +|} + in + Util.compile_and_run prog; + [%expect {| + 2 |}]; + let program = Util.compile_and_parse prog in + Util.print_program program; + [%expect + {| + (function(globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + t$0 = [0, 0], + init = [0, 1], + Stdlib_Random = global_data.Stdlib__Random, + Stdlib_Int = global_data.Stdlib__Int, + Stdlib = global_data.Stdlib, + my_ref = [0, 1], + nesting = 1; + a: + { + b: + { + var t = init; + for(;;){ + let t$1 = t; + var + this_will_be_undefined = + function(param){var _e_ = 1 === t$1[1] ? 1 : 0; return _e_ ? 1 : 2;}, + i = t[1]; + if(0 === i) break; + if(1 === i) break b; + t = t$0; + } + var + g = function(param){return 2 + this_will_be_undefined(0) | 0;}, + _a_ = g(0), + _c_ = g(0) + _a_ | 0; + break a; + } + if(caml_call2(Stdlib_Int[8], nesting, 0)) + var _c_ = nesting; + else + var + g$0 = + function(param){ + return 1 < caml_call1(Stdlib_Random[5], 3) + ? 2 + this_will_be_undefined(0) | 0 + : 1; + }, + _b_ = g$0(0), + _c_ = g$0(0) + _b_ | 0; + } + var _d_ = caml_call1(Stdlib_Int[12], _c_); + caml_call1(Stdlib[46], _d_); + my_ref[1] = 2; + var Test = [0, my_ref]; + runtime.caml_register_global(5, Test, "Test"); + return; + } + (globalThis)); + //end |}] diff --git a/compiler/tests-compiler/gh1599.ml b/compiler/tests-compiler/gh1599.ml new file mode 100644 index 000000000..f663b0347 --- /dev/null +++ b/compiler/tests-compiler/gh1599.ml @@ -0,0 +1,33 @@ +let%expect_test _ = + let prog = + {| +type t = + | A + | B + | C + +let f x = + while + match x with + | A -> true + | B -> true + | C -> true + do + () + done + |} + in + let js = Util.compile_and_parse prog in + Util.print_program js; + [%expect + {| + (function(globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function f(x){for(;;) switch(x){case 0: break;case 1: break;}} + var Test = [0, f]; + runtime.caml_register_global(0, Test, "Test"); + return; + } + (globalThis)); + //end |}] diff --git a/compiler/tests-compiler/gh747.ml b/compiler/tests-compiler/gh747.ml index b8b9b1fc3..7aa143ee8 100644 --- a/compiler/tests-compiler/gh747.ml +++ b/compiler/tests-compiler/gh747.ml @@ -266,136 +266,133 @@ end 41: [248, 42: caml_string_of_jsbytes("Test.Unhandled"), 43: runtime.caml_fresh_oo_id(0)], - 44: _c_ = [0, [2, 0, [12, 10, 0]], caml_string_of_jsbytes("%s\n")], - 45: _d_ = - 46: [0, - 47: [11, - 48: caml_string_of_jsbytes - 49: ("(Program not linked with -g, cannot print stack backtrace)\n"), - 50: 0], - 51: caml_string_of_jsbytes - 52: ("(Program not linked with -g, cannot print stack backtrace)\n")], - 53: cst_Raised_at = caml_string_of_jsbytes("Raised at"), - 54: cst_Re_raised_at = caml_string_of_jsbytes("Re-raised at"), - 55: cst_Raised_by_primitive_operat = - 56: caml_string_of_jsbytes("Raised by primitive operation at"), - 57: cst_Called_from = caml_string_of_jsbytes("Called from"), - 58: cst_inlined = caml_string_of_jsbytes(" (inlined)"), - 59: _a_ = - 60: [0, - 61: [2, - 62: 0, - 63: [12, - 64: 32, - 65: [2, - 66: 0, - 67: [11, - 68: caml_string_of_jsbytes(' in file "'), - 69: [2, - 70: 0, - 71: [12, - 72: 34, - 73: [2, - 74: 0, - 75: [11, - 76: caml_string_of_jsbytes(", line "), - 77: [4, - 78: 0, - 79: 0, - 80: 0, - 81: [11, caml_string_of_jsbytes(", characters "), partial]]]]]]]]]], - 82: caml_string_of_jsbytes - 83: ('%s %s in file "%s"%s, line %d, characters %d-%d')], - 84: _b_ = - 85: [0, - 86: [2, 0, [11, caml_string_of_jsbytes(" unknown location"), 0]], - 87: caml_string_of_jsbytes("%s unknown location")], - 88: big_endian = 0, - 89: word_size = 32, - 90: int_size = 32; - 91: function format_backtrace_slot(pos, slot){ - 92: function info(is_raise){ - 93: /*<>*/ return is_raise - 94: ? 0 === pos ? cst_Raised_at : cst_Re_raised_at - 95: : 0 === pos ? cst_Raised_by_primitive_operat : cst_Called_from; - 96: /*<>*/ } - 97: /*<>*/ if(0 === slot[0]){ - 98: /*<>*/ var - 99: _h_ = slot[5], - 100: _i_ = slot[4], - 101: _j_ = slot[3], - 102: _k_ = slot[6] ? cst_inlined : cst, - 103: _l_ = slot[2], - 104: _m_ = slot[7], - 105: /*<>*/ _n_ = info(slot[1]); - 106: /*<>*/ return [0, - 107: /*<>*/ caml_call8 - 108: (Stdlib_Printf[4], _a_, _n_, _m_, _l_, _k_, _j_, _i_, _h_)]; - 109: } - 110: if(slot[1]) /*<>*/ return 0; - 111: /*<>*/ /*<>*/ var _o_ = info(0); - 112: /*<>*/ return [0, - 113: /*<>*/ caml_call2(Stdlib_Printf[4], _b_, _o_)]; - 114: /*<>*/ } - 115: function print_exception_backtrace(outchan, backtrace){ - 116: /*<>*/ if(! backtrace) - 117: /*<>*/ return /*<>*/ caml_call2 - 118: (Stdlib_Printf[1], outchan, _d_); - 119: var a = backtrace[1], _f_ = a.length - 1 - 1 | 0, _e_ = 0; - 120: if(_f_ >= 0){ - 121: var i = _e_; - 122: for(;;){ - 123: /*<>*/ /*<>*/ var - 124: match = format_backtrace_slot(i, runtime.caml_check_bound(a, i)[1 + i]); - 125: if(match){ - 126: var str = match[1]; - 127: /*<>*/ /*<>*/ caml_call3 - 128: (Stdlib_Printf[1], outchan, _c_, str); - 129: } - 130: /*<>*/ /*<>*/ var _g_ = i + 1 | 0; - 131: if(_f_ !== i){var i = _g_; continue;} - 132: break; - 133: } - 134: } - 135: return 0; - 136: /*<>*/ } - 137: function compare(left, right, e1, e2){ - 138: /*<>*/ if(0 === e1[0]){ - 139: var v1 = e1[1]; - 140: if(0 !== e2[0]) /*<>*/ return -1; - 141: var v2 = e2[1]; - 142: /*<>*/ return /*<>*/ caml_call2 - 143: (left, v1, v2); - 144: } - 145: var v1$0 = e1[1]; - 146: if(0 === e2[0]) /*<>*/ return 1; - 147: var v2$0 = e2[1]; - 148: /*<>*/ return /*<>*/ caml_call2 - 149: (right, v1$0, v2$0); - 150: /*<>*/ } - 151: /*<>*/ var - 152: /*<>*/ Either = [0, compare], - 153: Test = - 154: [0, - 155: executable_name, - 156: os_type, - 157: backend_type, - 158: big_endian, - 159: word_size, - 160: int_size, - 161: unix, - 162: win32, - 163: cygwin, - 164: max_array_length, - 165: max_floatarray_length, - 166: max_string_length, - 167: Unhandled, - 168: format_backtrace_slot, - 169: print_exception_backtrace, - 170: Either]; - 171: runtime.caml_register_global(12, Test, "Test"); - 172: return; - 173: /*<>*/ } - 174: (globalThis)); - 175: - 176: //# sourceMappingURL=test.map |}] + 44: cst_Raised_at = caml_string_of_jsbytes("Raised at"), + 45: cst_Re_raised_at = caml_string_of_jsbytes("Re-raised at"), + 46: cst_Raised_by_primitive_operat = + 47: caml_string_of_jsbytes("Raised by primitive operation at"), + 48: cst_Called_from = caml_string_of_jsbytes("Called from"), + 49: cst_inlined = caml_string_of_jsbytes(" (inlined)"), + 50: _a_ = + 51: [0, + 52: [2, + 53: 0, + 54: [12, + 55: 32, + 56: [2, + 57: 0, + 58: [11, + 59: caml_string_of_jsbytes(' in file "'), + 60: [2, + 61: 0, + 62: [12, + 63: 34, + 64: [2, + 65: 0, + 66: [11, + 67: caml_string_of_jsbytes(", line "), + 68: [4, + 69: 0, + 70: 0, + 71: 0, + 72: [11, caml_string_of_jsbytes(", characters "), partial]]]]]]]]]], + 73: caml_string_of_jsbytes + 74: ('%s %s in file "%s"%s, line %d, characters %d-%d')], + 75: _b_ = + 76: [0, + 77: [2, 0, [11, caml_string_of_jsbytes(" unknown location"), 0]], + 78: caml_string_of_jsbytes("%s unknown location")], + 79: _c_ = [0, [2, 0, [12, 10, 0]], caml_string_of_jsbytes("%s\n")], + 80: _d_ = + 81: [0, + 82: [11, + 83: caml_string_of_jsbytes + 84: ("(Program not linked with -g, cannot print stack backtrace)\n"), + 85: 0], + 86: caml_string_of_jsbytes + 87: ("(Program not linked with -g, cannot print stack backtrace)\n")]; + 88: function format_backtrace_slot(pos, slot){ + 89: function info(is_raise){ + 90: /*<>*/ return is_raise + 91: ? 0 === pos ? cst_Raised_at : cst_Re_raised_at + 92: : 0 === pos ? cst_Raised_by_primitive_operat : cst_Called_from; + 93: /*<>*/ } + 94: /*<>*/ if(0 === slot[0]){ + 95: /*<>*/ var + 96: _h_ = slot[5], + 97: _i_ = slot[4], + 98: _j_ = slot[3], + 99: _k_ = slot[6] ? cst_inlined : cst, + 100: _l_ = slot[2], + 101: _m_ = slot[7], + 102: /*<>*/ _n_ = info(slot[1]); + 103: /*<>*/ return [0, + 104: /*<>*/ caml_call8 + 105: (Stdlib_Printf[4], _a_, _n_, _m_, _l_, _k_, _j_, _i_, _h_)]; + 106: } + 107: if(slot[1]) /*<>*/ return 0; + 108: /*<>*/ /*<>*/ var _o_ = info(0); + 109: /*<>*/ return [0, + 110: /*<>*/ caml_call2(Stdlib_Printf[4], _b_, _o_)]; + 111: /*<>*/ } + 112: function print_exception_backtrace(outchan, backtrace){ + 113: /*<>*/ if(! backtrace) + 114: /*<>*/ return /*<>*/ caml_call2 + 115: (Stdlib_Printf[1], outchan, _d_); + 116: var a = backtrace[1], _f_ = a.length - 2 | 0, _e_ = 0; + 117: if(_f_ >= 0){ + 118: var i = _e_; + 119: for(;;){ + 120: /*<>*/ /*<>*/ var + 121: match = format_backtrace_slot(i, runtime.caml_check_bound(a, i)[1 + i]); + 122: if(match){ + 123: var str = match[1]; + 124: /*<>*/ /*<>*/ caml_call3 + 125: (Stdlib_Printf[1], outchan, _c_, str); + 126: } + 127: /*<>*/ /*<>*/ var _g_ = i + 1 | 0; + 128: if(_f_ === i) break; + 129: i = _g_; + 130: } + 131: } + 132: return 0; + 133: /*<>*/ } + 134: function compare(left, right, e1, e2){ + 135: /*<>*/ if(0 === e1[0]){ + 136: var v1 = e1[1]; + 137: if(0 !== e2[0]) /*<>*/ return -1; + 138: var v2 = e2[1]; + 139: /*<>*/ return /*<>*/ caml_call2 + 140: (left, v1, v2); + 141: } + 142: var v1$0 = e1[1]; + 143: if(0 === e2[0]) /*<>*/ return 1; + 144: var v2$0 = e2[1]; + 145: /*<>*/ return /*<>*/ caml_call2 + 146: (right, v1$0, v2$0); + 147: /*<>*/ } + 148: /*<>*/ var + 149: /*<>*/ Either = [0, compare], + 150: Test = + 151: [0, + 152: executable_name, + 153: os_type, + 154: backend_type, + 155: 0, + 156: 32, + 157: 32, + 158: unix, + 159: win32, + 160: cygwin, + 161: max_array_length, + 162: max_floatarray_length, + 163: max_string_length, + 164: Unhandled, + 165: format_backtrace_slot, + 166: print_exception_backtrace, + 167: Either]; + 168: runtime.caml_register_global(12, Test, "Test"); + 169: return; + 170: /*<>*/ } + 171: (globalThis)); + 172: + 173: //# sourceMappingURL=test.map |}] diff --git a/compiler/tests-compiler/global_deadcode.ml b/compiler/tests-compiler/global_deadcode.ml new file mode 100644 index 000000000..d262c999e --- /dev/null +++ b/compiler/tests-compiler/global_deadcode.ml @@ -0,0 +1,132 @@ +open Util + +let%expect_test "Eliminates unused functions from functor" = + let program = + (* Create two instances of Set functor so compiler can't inline one implementation. *) + compile_and_parse_whole_program + {| + module Int_set = Set.Make (Int);; + module String_set = Set.Make (String);; + + let int_set = Int_set.singleton 1 in + let string_set = String_set.empty in + let string_set = String_set.add "hello" string_set in + print_endline (string_of_int (Int_set.find 1 int_set) ^ (String_set.find "hello" string_set)) + |} + in + let app = find_variable program "String_set" in + (let open Js_of_ocaml_compiler in + let open Stdlib in + match app with + | Javascript.ECall (EVar (S { name = Utf8 name; _ }), _, _, _) -> ( + let _, _, body, _ = find_function program name in + match List.rev body with + | (Return_statement (Some (EArr return)), loc) :: rest -> + let return = + ( Javascript.Return_statement + (Some + (EArr + (List.filter return ~f:(function + | Javascript.ElementHole -> false + | _ -> true)))) + , loc ) + in + print_program (List.rev (return :: rest)) + | _ -> ()) + | _ -> ()); + [%expect + {| + function height(param){if(! param) return 0; var h = param[4]; return h;} + function create(l, v, r){ + if(l) var h = l[4], hl = h; else var hl = 0; + if(r) var h$0 = r[4], hr = h$0; else var hr = 0; + var _k_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + return [0, l, v, r, _k_]; + } + function bal(l, v, r){ + if(l) var h = l[4], hl = h; else var hl = 0; + if(r) var h$0 = r[4], hr = h$0; else var hr = 0; + if((hr + 2 | 0) < hl){ + if(! l) return invalid_arg(_b_); + var lr = l[3], lv = l[2], ll = l[1], _f_ = height(lr); + if(_f_ <= height(ll)) return create(ll, lv, create(lr, v, r)); + if(! lr) return invalid_arg(_a_); + var lrr = lr[3], lrv = lr[2], lrl = lr[1], _g_ = create(lrr, v, r); + return create(create(ll, lv, lrl), lrv, _g_); + } + if((hl + 2 | 0) >= hr){ + var _j_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + return [0, l, v, r, _j_]; + } + if(! r) return invalid_arg(_d_); + var rr = r[3], rv = r[2], rl = r[1], _h_ = height(rl); + if(_h_ <= height(rr)) return create(create(l, v, rl), rv, rr); + if(! rl) return invalid_arg(_c_); + var rlr = rl[3], rlv = rl[2], rll = rl[1], _i_ = create(rlr, rv, rr); + return create(create(l, v, rll), rlv, _i_); + } + function add(x, t){ + if(! t) return [0, 0, x, 0, 1]; + var r = t[3], v = t[2], l = t[1], c = caml_call2(Ord[1], x, v); + if(0 === c) return t; + if(0 <= c){var rr = add(x, r); return r === rr ? t : bal(l, v, rr);} + var ll = add(x, l); + return l === ll ? t : bal(ll, v, r); + } + function singleton(x){return [0, 0, x, 0, 1];} + function find(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) throw caml_maybe_attach_backtrace(Not_found, 1); + var + r = param$0[3], + v = param$0[2], + l = param$0[1], + c = caml_call2(Ord[1], x, v); + if(0 === c) return v; + var r$0 = 0 <= c ? r : l; + param$0 = r$0; + } + } + return [0, 0, add, singleton, find]; + //end |}] + +let%expect_test "Omit unused fields" = + let program = + compile_and_parse + {| + let f b x = + let t = if b then (1, 2, x) else (3, x, 4) in + let (u, _, v) = t in + (u, v) + in print_int (fst (f true 1) + snd (f false 2)) + |} + in + (* Expect second field in each triple to be omitted. *) + print_fun_decl program (Some "f"); + [%expect + {| + function f(b, x){ + var t = b ? [0, 1, , x] : [0, 3, , 4], v = t[3], u = t[1]; + return [0, u, v]; + } + //end |}] + +let%expect_test "Omit unused return expressions" = + let program = + compile_and_parse + {| + let f x = + print_int x; + x + 1 + in + ignore (f 5 + f 6) + |} + in + (* Expect return value of f to be omitted. *) + print_fun_decl program (Some "f"); + [%expect + {| + function f(x){caml_call1(Stdlib[44], x); return;} + //end + |}] diff --git a/compiler/tests-compiler/inlining.ml b/compiler/tests-compiler/inlining.ml index 190154630..db5336e6b 100644 --- a/compiler/tests-compiler/inlining.ml +++ b/compiler/tests-compiler/inlining.ml @@ -30,5 +30,31 @@ let%expect_test "inline recursive function" = {| function f(param){for(;;) ;} //end - function g(param){return f(0);} + function g(param){for(;;) ;} //end |}] + +let%expect_test "inline small function exposing more tc" = + let program = + compile_and_parse + {| + let ( >>= ) x f = match x with `Ok v -> f v | `Error _ as e -> e + + let f g x = + x >>= fun x -> + g x >>= fun y -> + y + |} + in + print_fun_decl program (Some "f"); + print_fun_decl program (Some "g"); + [%expect + {| + function f(g, x){ + if(106380200 <= x[1]) return x; + var v$0 = x[2], x$0 = caml_call1(g, v$0); + if(106380200 <= x$0[1]) return x$0; + var v = x$0[2]; + return v; + } + //end + not found |}] diff --git a/compiler/tests-compiler/js_parser_printer.ml b/compiler/tests-compiler/js_parser_printer.ml index d049b811a..79b879db9 100644 --- a/compiler/tests-compiler/js_parser_printer.ml +++ b/compiler/tests-compiler/js_parser_printer.ml @@ -341,6 +341,20 @@ let%expect_test "async/await" = const glslang = await glslangModule.default(); return glslang.compileGLSL(src, "compute"); } + + + async + function test() { } + + async function test() { } + + async + function* test() { } + + async function * test() { } + + 1 + async function * test() { } + |}; [%expect @@ -355,7 +369,14 @@ let%expect_test "async/await" = glslang = await /*<>*/ glslangModule.default(); /*<>*/ return /*<>*/ glslang.compileGLSL (src, "compute"); - /*<>*/ } |}] + /*<>*/ } + /*<>*/ async; + /*<>*/ function test(){ /*<>*/ } + /*<>*/ async function test(){ /*<>*/ } + /*<>*/ async; + /*<>*/ function* test(){ /*<>*/ } + /*<>*/ async function* test(){ /*<>*/ } + /*<>*/ 1 + async function* test(){ /*<>*/ }; |}] let%expect_test "get/set property" = (* GH#1017 *) @@ -419,9 +440,8 @@ let%expect_test "assignment pattern" = /*<>*/ var x, y, rest; /*<>*/ /*<>*/ var [x, y] = [1, 2]; /*<>*/ /*<>*/ var [x, y, ...rest] = [1, 2, ...o]; - /*<>*/ /*<>*/ var {x: x, y: y} = {x: 1, y: 2}; - /*<>*/ /*<>*/ var - {x: x, y: y, ...rest} = {x: 1, y: 2, ...o}; + /*<>*/ /*<>*/ var {x, y} = {x: 1, y: 2}; + /*<>*/ /*<>*/ var {x, y, ...rest} = {x: 1, y: 2, ...o}; /*<>*/ [x, y] = [1, 2]; /*<>*/ [x, y, ...rest] = [1, 2]; /*<>*/ ({x, y} = {x: 1, y: 2}); @@ -431,6 +451,27 @@ let%expect_test "assignment pattern" = /*<>*/ for([a, b, {c, d = e, [f]: [g, h, a, i, j]}] of 3) /*<>*/ ; |}] +let%expect_test "for loops" = + (* GH#1017 *) + print + ~report:true + ~compact:false + {| + for(x in 3); + for(x of 3); + async function f(x) { + for await(x of 3); + } + |}; + + [%expect + {| + /*<>*/ for(x in 3) /*<>*/ ; + /*<>*/ for(x of 3) /*<>*/ ; + /*<>*/ async function f(x){ + /*<>*/ for await(x of 3) /*<>*/ ; + /*<>*/ } |}] + let%expect_test "string template" = (* GH#1017 *) print @@ -644,6 +685,17 @@ let%expect_test "assignment targets" = [[[x = 5]], {a, b}, ...rest] = []; ({a: [a, b] = f(), b = 3, ...rest} = {}); |}] +let%expect_test "as keyword" = + print + ~debuginfo:false + ~compact:false + ~report:true + {| +const as = () => () => ts(void 0, void 0, void 0, function* () {}) +|}; + [%expect {| + const as = ()=>()=>ts(void 0, void 0, void 0, function*(){}); |}] + let%expect_test "error reporting" = (try print ~invalid:true ~compact:false {| @@ -687,8 +739,10 @@ let check_vs_string s toks = in let rec loop offset pos = function | [] -> space pos (String.length s) - | (Js_token.T_VIRTUAL_SEMICOLON, _, _) :: rest -> loop offset pos rest - | ((Js_token.T_STRING (_, codepoint_len) as x), p1, _p2) :: rest -> + | (Js_token.(T_VIRTUAL_SEMICOLON | T_VIRTUAL_SEMICOLON_DO_WHILE), _) :: rest -> + loop offset pos rest + | ((Js_token.T_STRING (_, codepoint_len) as x), loc) :: rest -> + let p1 = Loc.p1 loc in let { Parse_info.idx = codepoint_idx; _ } = Parse_info.t_of_pos p1 in let bytes_idx = codepoint_idx - offset in let bytes_len = @@ -714,7 +768,8 @@ let check_vs_string s toks = a b); loop offset (bytes_idx + bytes_len + 1) rest - | (x, p1, _p2) :: rest -> + | (x, loc) :: rest -> + let p1 = Loc.p1 loc in let { Parse_info.idx; _ } = Parse_info.t_of_pos p1 in let idx = idx - offset in let str = Js_token.to_string x in @@ -741,8 +796,9 @@ let parse_print_token ?(invalid = false) ?(extra = false) s = let prev = ref 0 in let rec loop tokens = match tokens with - | [ (Js_token.T_EOF, _, _) ] | [] -> Printf.printf "\n" - | (tok, p1, _p2) :: xs -> + | [ (Js_token.T_EOF, _) ] | [] -> Printf.printf "\n" + | (tok, loc) :: xs -> + let p1 = Loc.p1 loc in let pos = Parse_info.t_of_pos p1 in let s = if extra then Js_token.to_string_extra tok else Js_token.to_string tok in (match !prev <> pos.Parse_info.line && pos.Parse_info.line <> 0 with @@ -791,7 +847,7 @@ let%expect_test "invalid ident" = 2: 4:var, 8:\uD83B\uDE62, 21:=, 23:42, 25:;, 27:// invalid surrogate escape sequence, 3: 4:var, 8:\u{1F42B}, 18:=, 20:2, 21:;, 23:// U+1F42B is not a valid id, Lexer error: fake:2:8: Illegal Unicode escape - Lexer error: fake:3:8: Unexpected token ILLEGAL |}] + Lexer error: fake:3:8: Unexpected "\240\159\144\171" is not a valid identifier |}] let%expect_test "string" = parse_print_token @@ -950,6 +1006,18 @@ a:while(true){ do { x } while (true) y do ; while (true) y + async + function test() { } + + async function test() { } + + async + function* test() { } + + async function * test() { } + + 1 + async function * test() { } + |}; [%expect {| @@ -976,7 +1044,14 @@ a:while(true){ 26: 4:a (identifier), 6:=, 8:b (identifier), 10:+, 12:c (identifier), 27: 4:(, 5:d (identifier), 7:+, 9:e (identifier), 10:), 11:., 12:print (identifier), 17:(, 18:), 0:; (virtual), 29: 4:do, 7:{, 9:x (identifier), 0:; (virtual), 11:}, 13:while, 19:(, 20:true, 24:), 0:; (virtual), 26:y (identifier), 0:; (virtual), - 30: 4:do, 7:;, 9:while, 15:(, 16:true, 20:), 0:; (virtual), 22:y (identifier), 0:; (virtual), |}] + 30: 4:do, 7:;, 9:while, 15:(, 16:true, 20:), 0:; (virtual), 22:y (identifier), 0:; (virtual), + 32: 4:async, 0:; (virtual), + 33: 4:function, 13:test (identifier), 17:(, 18:), 20:{, 22:}, + 35: 4:async, 10:function, 19:test (identifier), 23:(, 24:), 26:{, 28:}, + 37: 4:async, 0:; (virtual), + 38: 4:function, 12:*, 14:test (identifier), 18:(, 19:), 21:{, 23:}, + 40: 4:async, 10:function, 19:*, 21:test (identifier), 25:(, 26:), 28:{, 30:}, + 42: 4:1, 6:+, 8:async, 14:function, 23:*, 25:test (identifier), 29:(, 30:), 32:{, 34:}, 0:; (virtual), |}] let%expect_test _ = parse_print_token diff --git a/compiler/tests-compiler/jsopt.ml b/compiler/tests-compiler/jsopt.ml index 9c0b6b6dd..a155c36a8 100644 --- a/compiler/tests-compiler/jsopt.ml +++ b/compiler/tests-compiler/jsopt.ml @@ -217,11 +217,11 @@ let%expect_test "delete" = compile_and_parse {| let delete_a o = - Js.delete o (Js.string "aaa") + Js.delete o (Js.string "aaa") let delete_b o = - Js.delete o (Js.string "a b") + Js.delete o (Js.string "a b") let delete_c o = - Js.delete o (Js.string "npiπ") + Js.delete o (Js.string "npiπ") |} in print_fun_decl program (Some "delete_a"); @@ -348,8 +348,8 @@ let%expect_test "string sharing" = var str_npi_xcf_x80 = "npi\xcf\x80", str_abcdef = "abcdef", - str_npi = "npiπ", str_abc_def = "abc\\def", + str_npi = "npiπ", runtime = globalThis.jsoo_runtime, s3 = str_abcdef, s6 = str_npi_xcf_x80, @@ -461,8 +461,8 @@ let%expect_test "string sharing" = var str_npi_xcf_x80 = "npi\xcf\x80", str_abcdef = "abcdef", - str_npi = "npiπ", str_abc_def = "abc\\def", + str_npi = "npiπ", runtime = globalThis.jsoo_runtime, caml_string_of_jsbytes = runtime.caml_string_of_jsbytes, s3 = caml_string_of_jsbytes(str_abcdef), diff --git a/compiler/tests-compiler/lambda_lifting.ml b/compiler/tests-compiler/lambda_lifting.ml index f788ed768..44ba22011 100644 --- a/compiler/tests-compiler/lambda_lifting.ml +++ b/compiler/tests-compiler/lambda_lifting.ml @@ -28,9 +28,9 @@ Printf.printf "%d\n" (f 3) Stdlib_Printf = global_data.Stdlib__Printf, _b_ = [0, [4, 0, 0, 0, [12, 10, 0]], runtime.caml_string_of_jsbytes("%d\n")]; - function f(x){var g$0 = g(x); return g$0(5);} function h(x, y){function h(z){return (x + y | 0) + z | 0;} return h;} function g(x){function g(y){var h$0 = h(x, y); return h$0(7);} return g;} + function f(x){var g$0 = g(x); return g$0(5);} var _a_ = f(3); runtime.caml_callback(Stdlib_Printf[2], [_b_, _a_]); var Test = [0]; diff --git a/compiler/tests-compiler/lazy.ml b/compiler/tests-compiler/lazy.ml index 4369b4367..1ec728acd 100644 --- a/compiler/tests-compiler/lazy.ml +++ b/compiler/tests-compiler/lazy.ml @@ -36,12 +36,12 @@ let%expect_test "static eval of string get" = function do_the_lazy_rec(n){ if(0 === n) return 0; var _b_ = do_the_lazy_rec(n - 1 | 0), _c_ = runtime.caml_obj_tag(lz); + a: if(250 === _c_) var _d_ = lz[1]; else{ - var switch$0 = 0; - if(246 !== _c_ && 244 !== _c_){var _d_ = lz; switch$0 = 1;} - if(! switch$0) var _d_ = caml_call1(CamlinternalLazy[2], lz); + if(246 !== _c_ && 244 !== _c_){var _d_ = lz; break a;} + var _d_ = caml_call1(CamlinternalLazy[2], lz); } return [0, _d_, _b_]; } diff --git a/compiler/tests-compiler/loops.ml b/compiler/tests-compiler/loops.ml index 14332852d..eefa2ef72 100644 --- a/compiler/tests-compiler/loops.ml +++ b/compiler/tests-compiler/loops.ml @@ -23,8 +23,13 @@ let%expect_test "rec-fun" = let program = compile_and_parse {| - let rec fun_with_loop acc = function - | [] -> List.rev (List.rev (List.rev acc)) + +let list_rev = List.rev +(* Avoid to expose the offset of stdlib modules *) +let () = ignore (list_rev []) + +let rec fun_with_loop acc = function + | [] -> list_rev (list_rev (list_rev acc)) | x :: xs -> fun_with_loop (x :: acc) xs |} in @@ -34,19 +39,12 @@ let%expect_test "rec-fun" = function fun_with_loop(acc, param){ var acc$0 = acc, param$0 = param; for(;;){ - if(param$0){ - var - xs = param$0[2], - x = param$0[1], - acc$1 = [0, x, acc$0], - acc$0 = acc$1, - param$0 = xs; - continue; - } - var - _a_ = caml_call1(Stdlib_List[9], acc$0), - _b_ = caml_call1(Stdlib_List[9], _a_); - return caml_call1(Stdlib_List[9], _b_); + if(! param$0) + return caml_call1 + (list_rev, caml_call1(list_rev, caml_call1(list_rev, acc$0))); + var xs = param$0[2], x = param$0[1], acc$1 = [0, x, acc$0]; + acc$0 = acc$1; + param$0 = xs; } } //end |}] @@ -55,8 +53,13 @@ let%expect_test "rec-fun-2" = let program = compile_and_parse {| +let list_rev = List.rev +(* Avoid to expose the offset of stdlib modules *) +let () = ignore (list_rev []) + + let rec fun_with_loop acc = function - | [] -> List.rev (List.rev (List.rev acc)) + | [] -> list_rev (list_rev (list_rev acc)) | [ 1 ] -> let a = ref acc in for i = 0 to 10 do @@ -76,14 +79,10 @@ let rec fun_with_loop acc = function {| function fun_with_loop(acc, param){ var acc$0 = acc, param$0 = param; - a: for(;;){ - if(! param$0){ - var - _c_ = caml_call1(Stdlib_List[9], acc$0), - _d_ = caml_call1(Stdlib_List[9], _c_); - return caml_call1(Stdlib_List[9], _d_); - } + if(! param$0) + return caml_call1 + (list_rev, caml_call1(list_rev, caml_call1(list_rev, acc$0))); var x = param$0[1]; if(1 === x && ! param$0[2]){ var a$0 = [0, acc$0], i$0 = 0; @@ -91,17 +90,19 @@ let rec fun_with_loop acc = function a$0[1] = [0, 1, a$0[1]]; var _b_ = i$0 + 1 | 0; if(10 === i$0) return a$0[1]; - var i$0 = _b_; + i$0 = _b_; } } var xs = param$0[2], a = [0, acc$0], i = 0; for(;;){ a[1] = [0, 1, a[1]]; var _a_ = i + 1 | 0; - if(10 !== i){var i = _a_; continue;} - var acc$1 = [0, x, a[1]], acc$0 = acc$1, param$0 = xs; - continue a; + if(10 === i) break; + i = _a_; } + var acc$1 = [0, x, a[1]]; + acc$0 = acc$1; + param$0 = xs; } } //end @@ -127,20 +128,17 @@ let for_for_while () = {| function for_for_while(param){ var k = 1; - a: for(;;){ var j = 1; - b: - for(;;) - for(;;){ - if(10 > runtime.caml_mul(k, j)){id[1]++; continue;} - var _b_ = j + 1 | 0; - if(10 !== j){var j = _b_; continue b;} - var _a_ = k + 1 | 0; - if(10 === k) return 0; - var k = _a_; - continue a; - } + for(;;){ + for(;;){if(10 <= runtime.caml_mul(k, j)) break; id[1]++;} + var _b_ = j + 1 | 0; + if(10 === j) break; + j = _b_; + } + var _a_ = k + 1 | 0; + if(10 === k) return 0; + k = _a_; } } //end |}] @@ -166,25 +164,22 @@ let for_for_while () = {| function for_for_while(param){ var k = 1; - a: for(;;){ var j = 1; - b: - for(;;) + for(;;){ for(;;){ - if(10 > caml_div(k, j)){ - try{caml_div(k, j);} - catch(_c_){throw caml_maybe_attach_backtrace(Stdlib[8], 1);} - id[1]++; - continue; - } - var _b_ = j + 1 | 0; - if(10 !== j){var j = _b_; continue b;} - var _a_ = k + 1 | 0; - if(10 === k) return 0; - var k = _a_; - continue a; + if(10 <= caml_div(k, j)) break; + try{caml_div(k, j);} + catch(_c_){throw caml_maybe_attach_backtrace(Stdlib[8], 1);} + id[1]++; } + var _b_ = j + 1 | 0; + if(10 === j) break; + j = _b_; + } + var _a_ = k + 1 | 0; + if(10 === k) return 0; + k = _a_; } } //end |}] @@ -220,7 +215,9 @@ let rec equal eq xs ys = var match = caml_call1(xs$0, 0), match$0 = caml_call1(ys$0, 0); if(match){ if(match$0){ - var ys$1 = match$0[2], xs$1 = match[2], xs$0 = xs$1, ys$0 = ys$1; + var ys$1 = match$0[2], xs$1 = match[2]; + xs$0 = xs$1; + ys$0 = ys$1; continue; } } @@ -263,22 +260,22 @@ let f t x = if(val$0 && ! val$0[2]){ var x$1 = val$0[1], x$0 = x$1; for(;;){ - var switch$0 = 0; - try{var val = caml_call2(Stdlib_Hashtbl[6], t, x$0); switch$0 = 1;} - catch(_e_){ - var _a_ = caml_wrap_exception(_e_); - if(_a_ !== Stdlib[3]) throw caml_maybe_attach_backtrace(_a_, 0); - var _d_ = 0; - } - if(switch$0){ - var switch$1 = 0; + a: + { + try{var val = caml_call2(Stdlib_Hashtbl[6], t, x$0);} + catch(_e_){ + var _a_ = caml_wrap_exception(_e_); + if(_a_ !== Stdlib[3]) throw caml_maybe_attach_backtrace(_a_, 0); + var _d_ = 0; + break a; + } if(val && ! val[2]){ var y = val[1], _b_ = y === (x$0 + 1 | 0) ? 1 : 0; - if(! _b_){var x$0 = y; continue;} - var _d_ = _b_; - switch$1 = 1; + if(_b_){var _d_ = _b_; break a;} + x$0 = y; + continue; } - if(! switch$1) var _d_ = 0; + var _d_ = 0; } return _d_ ? 1 : 2; } @@ -314,25 +311,26 @@ in loop x var x$1 = x; for(;;){ if(0 === x$1) return 1; - if(1 !== x$1){var x$2 = x$1 + 1 | 0, x$1 = x$2; continue;} - var x$0 = 2; - for(;;){ - var switch$0 = 0; - if(3 < x$0 >>> 0) - switch$0 = 1; - else + if(1 === x$1) break; + var x$2 = x$1 + 1 | 0; + x$1 = x$2; + } + var x$0 = 2; + for(;;){ + a: + { + if(3 >= x$0 >>> 0) switch(x$0){ case 0: - var _a_ = 1; break; + var _a_ = 1; break a; case 2: - var n = caml_call1(Stdlib_Random[5], 2), _a_ = n + n | 0; break; + var n = caml_call1(Stdlib_Random[5], 2), _a_ = n + n | 0; break a; case 3: - var n$0 = caml_call1(Stdlib_Random[5], 2), x$0 = n$0; continue; - default: switch$0 = 1; + var n$0 = caml_call1(Stdlib_Random[5], 2); x$0 = n$0; continue; } - if(switch$0) var _a_ = 2; - return _a_ + 2 | 0; + var _a_ = 2; } + return _a_ + 2 | 0; } } //end |}] @@ -341,6 +339,13 @@ let%expect_test "buffer.add_substitute" = let program = compile_and_parse {| +let string_length = String.length +let string_sub = String.sub + +(* Avoid to expose the offset of stdlib modules *) +let () = ignore (string_length "asd") +let () = ignore (string_sub "asd" 0 3) + let add_substitute = let closing = function | '(' -> ')' @@ -361,7 +366,7 @@ let add_substitute = then if k = 0 then i else advance (k - 1) (i + 1) lim else advance k (i + 1) lim in - advance k start (String.length s) + advance k start (string_length s) in let advance_to_non_alpha s start = let rec advance i lim = @@ -372,7 +377,7 @@ let add_substitute = | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' -> advance (i + 1) lim | _ -> i in - advance start (String.length s) + advance start (string_length s) in (* We are just at the beginning of an ident in s, starting at start. *) let find_ident s start lim = @@ -384,18 +389,18 @@ let add_substitute = | ('(' | '{') as c -> let new_start = start + 1 in let stop = advance_to_closing c (closing c) 0 s new_start in - String.sub s new_start (stop - start - 1), stop + 1 + string_sub s new_start (stop - start - 1), stop + 1 (* Regular ident *) | _ -> let stop = advance_to_non_alpha s (start + 1) in - String.sub s start (stop - start), stop + string_sub s start (stop - start), stop in let add_char = Buffer.add_char in let add_string = Buffer.add_string in (* Substitute $ident, $(ident), or ${ident} in s, according to the function mapping f. *) let add_substitute b f s = - let lim = String.length s in + let lim = string_length s in let rec subst previous i = if i < lim then ( @@ -435,94 +440,176 @@ let add_substitute = return _b_ ? caml_call2(add_char, b, previous) : _b_; } var previous$0 = caml_string_get(s, i$4); - if(36 !== previous$0){ + if(36 === previous$0) if(92 === previous){ - caml_call2(add_char, b, 92); caml_call2(add_char, b, previous$0); - var i$6 = i$4 + 1 | 0, previous = 32, i$4 = i$6; - continue; + var i$5 = i$4 + 1 | 0; + previous = 32; + i$4 = i$5; } - if(92 === previous$0){ - var i$7 = i$4 + 1 | 0, previous = previous$0, i$4 = i$7; - continue; - } - caml_call2(add_char, b, previous$0); - var i$8 = i$4 + 1 | 0, previous = previous$0, i$4 = i$8; - continue; - } - if(92 === previous){ - caml_call2(add_char, b, previous$0); - var i$5 = i$4 + 1 | 0, previous = 32, i$4 = i$5; - continue; - } - var start$0 = i$4 + 1 | 0; - if(lim$1 <= start$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); - var opening = caml_string_get(s, start$0), switch$0 = 0; - if(40 !== opening && 123 !== opening){ - var start = start$0 + 1 | 0, lim$0 = caml_ml_string_length(s), i$2 = start; - for(;;){ - if(lim$0 <= i$2) - var stop$0 = lim$0; - else{ - var match = caml_string_get(s, i$2), switch$1 = 0; - if(91 <= match){ - if(97 <= match){ - if(123 > match) switch$1 = 1; + else{ + var start$0 = i$4 + 1 | 0; + if(lim$1 <= start$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var opening = caml_string_get(s, start$0); + a: + { + if(40 !== opening && 123 !== opening){ + var start = start$0 + 1 | 0, lim$0 = caml_ml_string_length(s); + b: + { + c: + { + d: + { + var i$2 = start; + for(;;){ + if(lim$0 <= i$2) break c; + var match = caml_string_get(s, i$2); + if(91 <= match){ + if(97 <= match){ + if(123 <= match) break d; + } + else if(95 !== match) break d; + } + else if(58 <= match){ + if(65 > match) break; + } + else if(48 > match) break d; + var i$3 = i$2 + 1 | 0; + i$2 = i$3; + } + } + var stop$0 = i$2; + break b; + } + var stop$0 = lim$0; } - else if(95 === match) switch$1 = 1; + var + match$0 = + [0, caml_call3(string_sub, s, start$0, stop$0 - start$0 | 0), stop$0]; + break a; } - else if(58 <= match){ - if(65 <= match) switch$1 = 1; + var new_start = start$0 + 1 | 0, k$2 = 0; + if(40 === opening) + var closing = 41; + else{ + if(123 !== opening) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + var closing = 125; } - else if(48 <= match) switch$1 = 1; - if(switch$1){var i$3 = i$2 + 1 | 0, i$2 = i$3; continue;} - var stop$0 = i$2; + var lim = caml_ml_string_length(s), k = k$2, stop = new_start; + for(;;){ + if(lim <= stop) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(caml_string_get(s, stop) === opening){ + var i = stop + 1 | 0, k$0 = k + 1 | 0; + k = k$0; + stop = i; + } + else if(caml_string_get(s, stop) === closing){ + if(0 === k) break; + var i$0 = stop + 1 | 0, k$1 = k - 1 | 0; + k = k$1; + stop = i$0; + } + else{var i$1 = stop + 1 | 0; stop = i$1;} + } + var + match$0 = + [0, + caml_call3(string_sub, s, new_start, (stop - start$0 | 0) - 1 | 0), + stop + 1 | 0]; } - var - match$0 = - [0, - caml_call3(Stdlib_String[15], s, start$0, stop$0 - start$0 | 0), - stop$0]; - switch$0 = 1; - break; + var next_i = match$0[2], ident = match$0[1]; + caml_call2(add_string, b, caml_call1(f, ident)); + previous = 32; + i$4 = next_i; } + else if(92 === previous){ + caml_call2(add_char, b, 92); + caml_call2(add_char, b, previous$0); + var i$6 = i$4 + 1 | 0; + previous = 32; + i$4 = i$6; } - if(! switch$0){ - var new_start = start$0 + 1 | 0, k$2 = 0; - if(40 === opening) - var closing = 41; - else{ - if(123 !== opening) - throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); - var closing = 125; - } - var lim = caml_ml_string_length(s), k = k$2, stop = new_start; - for(;;){ - if(lim <= stop) throw caml_maybe_attach_backtrace(Stdlib[8], 1); - if(caml_string_get(s, stop) === opening){ - var i = stop + 1 | 0, k$0 = k + 1 | 0, k = k$0, stop = i; - continue; - } - if(caml_string_get(s, stop) !== closing){ - var i$1 = stop + 1 | 0, stop = i$1; - continue; - } - if(0 !== k){ - var i$0 = stop + 1 | 0, k$1 = k - 1 | 0, k = k$1, stop = i$0; - continue; - } - var - match$0 = - [0, - caml_call3 - (Stdlib_String[15], s, new_start, (stop - start$0 | 0) - 1 | 0), - stop + 1 | 0]; - break; + else if(92 === previous$0){ + var i$7 = i$4 + 1 | 0; + previous = previous$0; + i$4 = i$7; + } + else{ + caml_call2(add_char, b, previous$0); + var i$8 = i$4 + 1 | 0; + previous = previous$0; + i$4 = i$8; + } + } + } + //end |}] + +let%expect_test "Bytes.trim" = + let program = + compile_and_parse_whole_program + {| +let is_space = function + | ' ' | '\012' | '\n' | '\r' | '\t' -> true + | _ -> false + +let trim s = + let open Bytes in + let len = length s in + let i = ref 0 in + while !i < len && is_space (unsafe_get s !i) do + incr i + done; + let j = ref (len - 1) in + while !j >= !i && is_space (unsafe_get s !j) do + decr j + done; + if !j >= !i then + sub s !i (!j - !i + 1) + else + empty + +let trim x = x |> Bytes.of_string |> trim |> Bytes.to_string + +let () = print_endline (trim " ") +let () = print_endline (trim " ") +|} + in + print_fun_decl program (Some "trim"); + [%expect + {| + function trim(x){ + var + s$0 = copy(caml_bytes_of_string(x)), + len = caml_ml_bytes_length(s$0), + i = [0, 0]; + for(;;){ + if(i[1] >= len) break; + if(! is_space(caml_bytes_unsafe_get(s$0, i[1]))) break; + i[1]++; + } + var j = [0, len - 1 | 0]; + for(;;){ + if(i[1] > j[1]) break; + if(! is_space(caml_bytes_unsafe_get(s$0, j[1]))) break; + j[1]--; + } + a: + { + if(i[1] <= j[1]){ + var len$0 = (j[1] - i[1] | 0) + 1 | 0, ofs = i[1]; + if + (0 <= ofs && 0 <= len$0 && (caml_ml_bytes_length(s$0) - len$0 | 0) >= ofs){ + var r = caml_create_bytes(len$0); + caml_blit_bytes(s$0, ofs, r, 0, len$0); + var b = r; + break a; } + throw caml_maybe_attach_backtrace([0, Invalid_argument, s], 1); } - var next_i = match$0[2], ident = match$0[1]; - caml_call2(add_string, b, caml_call1(f, ident)); - var previous = 32, i$4 = next_i; + var b = empty; } + return caml_string_of_bytes(copy(b)); } //end |}] diff --git a/compiler/tests-compiler/match_with_exn.ml b/compiler/tests-compiler/match_with_exn.ml index 060cc93a2..73d2be576 100644 --- a/compiler/tests-compiler/match_with_exn.ml +++ b/compiler/tests-compiler/match_with_exn.ml @@ -73,34 +73,35 @@ let fun2 () = [%expect {| function fun1(param){ - var switch$0 = 0; - try{var i$1 = caml_call1(Stdlib_Random[5], 2);} - catch(_e_){ - var _d_ = caml_wrap_exception(_e_); - if(_d_[1] !== A) throw caml_maybe_attach_backtrace(_d_, 0); - var i = _d_[2]; - if(2 !== i) return i + 2 | 0; - var i$0 = i; - switch$0 = 1; + a: + { + try{var i$1 = caml_call1(Stdlib_Random[5], 2);} + catch(_e_){ + var _d_ = caml_wrap_exception(_e_); + if(_d_[1] !== A) throw caml_maybe_attach_backtrace(_d_, 0); + var i = _d_[2]; + if(2 !== i) return i + 2 | 0; + var i$0 = i; + break a; + } + if(0 !== i$1) return i$1 + 1 | 0; + var i$0 = i$1; } - if(! switch$0){if(0 !== i$1) return i$1 + 1 | 0; var i$0 = i$1;} return i$0; } //end function fun2(param){ - var switch$0 = 0; - try{var i$0 = caml_call1(Stdlib_Random[5], 2);} - catch(_c_){ - var _a_ = caml_wrap_exception(_c_), switch$1 = 0; - if(_a_[1] === A){ - var _b_ = _a_[2]; - if(2 === _b_){var i = _b_; switch$0 = 1;} else switch$1 = 1; + a: + { + try{var i$0 = caml_call1(Stdlib_Random[5], 2);} + catch(_c_){ + var _a_ = caml_wrap_exception(_c_); + if(_a_[1] === A){var _b_ = _a_[2]; if(2 === _b_){var i = _b_; break a;}} + throw caml_maybe_attach_backtrace(_a_, 0); } - else - switch$1 = 1; - if(switch$1) throw caml_maybe_attach_backtrace(_a_, 0); + if(0 !== i$0) return i$0 + 1 | 0; + var i = i$0; } - if(! switch$0){if(0 !== i$0) return i$0 + 1 | 0; var i = i$0;} return i; } //end |}] diff --git a/compiler/tests-compiler/minify.ml b/compiler/tests-compiler/minify.ml index 357f7ea96..ae8dd099e 100644 --- a/compiler/tests-compiler/minify.ml +++ b/compiler/tests-compiler/minify.ml @@ -50,10 +50,7 @@ console.log("xx =", xx); js_prog |> Filetype.js_text_of_string |> Filetype.write_js ~name:"test.js" in let js_min_file = - js_file - |> jsoo_minify - ~flags:[ "--enable"; "stable_var"; "--enable"; "shortvar" ] - ~pretty:false + js_file |> jsoo_minify ~flags:[ "--enable"; "shortvar" ] ~pretty:false in print_file (Filetype.path_of_js_file js_file); run_javascript js_file |> print_endline; @@ -378,3 +375,112 @@ function f () { 2: f(){const 3: a=2;return function(){var 4: a=a+2;return a}} |}]) + +let%expect_test _ = + with_temp_dir ~f:(fun () -> + let js_prog = + {| +function test() { + var x = {a:1,b:2} + function f (a, b = x.b) { + return (a + b); + } + console.log(f(1)); +} +test() +|} + in + let js_file = + js_prog |> Filetype.js_text_of_string |> Filetype.write_js ~name:"test.js" + in + let js_min_file = + js_file |> jsoo_minify ~flags:[ "--enable"; "shortvar" ] ~pretty:false + in + print_file (Filetype.path_of_js_file js_file); + print_file (Filetype.path_of_js_file js_min_file); + [%expect + {| + $ cat "test.js" + 1: + 2: function test() { + 3: var x = {a:1,b:2} + 4: function f (a, b = x.b) { + 5: return (a + b); + 6: } + 7: console.log(f(1)); + 8: } + 9: test() + $ cat "test.min.js" + 1: function + 2: test(){var + 3: c={a:1,b:2};function + 4: a(a,b=c.b){return a+b}console.log(a(1))}test(); |}]; + print_endline (run_javascript js_min_file); + [%expect {| 3 |}]) + +let%expect_test _ = + with_temp_dir ~f:(fun () -> + let minify js_prog = + let js_file = + js_prog |> Filetype.js_text_of_string |> Filetype.write_js ~name:"test.js" + in + let js_min_file = + js_file |> jsoo_minify ~flags:[ "--enable"; "shortvar" ] ~pretty:false + in + print_file (Filetype.path_of_js_file js_min_file) + in + minify {| +function f (x) { + let {toto} = x; + return toto; +} +|}; + [%expect + {| + $ cat "test.min.js" + 1: function + 2: f(a){let{toto:b}=a;return b} |}]; + minify + {| +function g(x) { + var toto, test, tata; + for( { toto : tata = test } in x ) { + console.log(tata); + } +} +|}; + [%expect + {| + $ cat "test.min.js" + 1: function + 2: g(a){var + 3: d,c,b;for({toto:b=c}in + 4: a)console.log(b)} |}]; + minify + {| +function h(x) { + var toto; + for( { toto } in x ) { + console.log(toto); + } +} +|}; + [%expect + {| + $ cat "test.min.js" + 1: function + 2: h(a){var + 3: b;for({toto:b}in + 4: a)console.log(b)} |}]; + minify + {| +function h(f) { + var { toto : c} = f(); + console.log({ toto : c }); +} +|}; + [%expect + {| + $ cat "test.min.js" + 1: function + 2: h(a){var{toto:b}=a();console.log({toto:b})} |}]) diff --git a/compiler/tests-compiler/mutable_closure.ml b/compiler/tests-compiler/mutable_closure.ml index 68a56a6f0..f35c6dcd6 100644 --- a/compiler/tests-compiler/mutable_closure.ml +++ b/compiler/tests-compiler/mutable_closure.ml @@ -91,6 +91,10 @@ let%expect_test _ = let indirect = ref [] + let list_map = List.map + (* Avoid to expose the offset of stdlib modules *) + let () = ignore (list_map (fun f -> f ()) []) + let fun1 () = for i = 0 to 3 do let rec f = function @@ -105,7 +109,7 @@ let%expect_test _ = direct := f i :: !direct; indirect := (fun () -> f i) :: !indirect done; - let indirect = List.map (fun f -> f ()) !indirect in + let indirect = list_map (fun f -> f ()) !indirect in let direct = !direct in assert (indirect = direct) |} @@ -116,56 +120,73 @@ let%expect_test _ = function fun1(param){ var i = 0; for(;;){ + let i$0 = i; var - closures = - function(i){ - function f(counter, n){ - if(- 1 === n){ - var _j_ = - 2; - if(counter >= 50) return caml_trampoline_return(g, [0, _j_]); - var counter$1 = counter + 1 | 0; - return g(counter$1, _j_); - } - if(0 === n) return i; - var _k_ = n - 1 | 0; - if(counter >= 50) return caml_trampoline_return(g, [0, _k_]); - var counter$0 = counter + 1 | 0; - return g(counter$0, _k_); - } - function g(counter, n){ - if(- 1 === n){ - var _h_ = - 2; - if(counter >= 50) return caml_trampoline_return(f, [0, _h_]); - var counter$1 = counter + 1 | 0; - return f(counter$1, _h_); - } - if(0 === n) return i; - var _i_ = n - 1 | 0; - if(counter >= 50) return caml_trampoline_return(f, [0, _i_]); - var counter$0 = counter + 1 | 0; - return f(counter$0, _i_); + f$0 = + function(counter, n){ + if(- 1 === n){ + var _f_ = - 2; + if(counter >= 50) return caml_trampoline_return(g$0, [0, _f_]); + var counter$1 = counter + 1 | 0; + return g$0(counter$1, _f_); } - function f$0(n){return caml_trampoline(f(0, n));} - function g$0(n){return caml_trampoline(g(0, n));} - var block = [0, f$0, g$0]; - return block; + if(0 === n) return i$0; + var _g_ = n - 1 | 0; + if(counter >= 50) return caml_trampoline_return(g$0, [0, _g_]); + var counter$0 = counter + 1 | 0; + return g$0(counter$0, _g_); }, - closures$0 = closures(i), - f = closures$0[1], - _e_ = direct[1]; - direct[1] = [0, f(i), _e_]; - var _f_ = indirect[1]; - indirect[1] = - [0, function(i, f){return function(param){return f(i);};}(i, f), _f_]; - var _g_ = i + 1 | 0; - if(3 !== i){var i = _g_; continue;} - var - _c_ = indirect[1], - _d_ = function(f){return caml_call1(f, 0);}, - indirect$0 = caml_call2(Stdlib_List[19], _d_, _c_), - direct$0 = direct[1]; - if(runtime.caml_equal(indirect$0, direct$0)) return 0; - throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + f = function(n){return caml_trampoline(f$1(0, n));}, + g = + function(counter, n){ + if(- 1 === n){ + var _d_ = - 2; + if(counter >= 50) return caml_trampoline_return(f$1, [0, _d_]); + var counter$1 = counter + 1 | 0; + return f$1(counter$1, _d_); + } + if(0 === n) return i$0; + var _e_ = n - 1 | 0; + if(counter >= 50) return caml_trampoline_return(f$1, [0, _e_]); + var counter$0 = counter + 1 | 0; + return f$1(counter$0, _e_); + }; + let f$1 = f$0, g$0 = g; + var _b_ = direct[1]; + direct[1] = [0, f(i), _b_]; + let f$2 = f; + indirect[1] = [0, function(param){return f$2(i$0);}, indirect[1]]; + var _c_ = i + 1 | 0; + if(3 === i) break; + i = _c_; } + var + indirect$0 = + caml_call2(list_map, function(f){return caml_call1(f, 0);}, indirect[1]), + direct$0 = direct[1]; + if(runtime.caml_equal(indirect$0, direct$0)) return 0; + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); } //end|}] + +let%expect_test _ = + let prog = {| + +let f = + let my_ref = ref 1 in + fun () -> incr my_ref; !my_ref +|} in + let program = Util.compile_and_parse prog in + Util.print_program program; + [%expect + {| + (function(globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime, my_ref = [0, 1]; + function f(param){my_ref[1]++; return my_ref[1];} + var Test = [0, f]; + runtime.caml_register_global(0, Test, "Test"); + return; + } + (globalThis)); + //end |}] diff --git a/compiler/tests-compiler/scopes.ml b/compiler/tests-compiler/scopes.ml new file mode 100644 index 000000000..8cb9dda88 --- /dev/null +++ b/compiler/tests-compiler/scopes.ml @@ -0,0 +1,564 @@ +(* Js_of_ocaml compiler + * http://www.ocsigen.org/js_of_ocaml/ + * Copyright (C) 2022 Hugo Heuzard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) +open Util + +let test js_prog = + let js_file = + js_prog |> Filetype.js_text_of_string |> Filetype.write_js ~name:"test.js" + in + let js_min_file = + js_file + |> jsoo_minify + ~flags:[ "--enable"; "stable_var"; "--enable"; "shortvar" ] + ~pretty:true + in + print_file (Filetype.path_of_js_file js_min_file); + run_javascript js_file |> print_endline + +let%expect_test "let inside forloop" = + test + {| +(function () { + let x = 2 + var y = 0; + for(let x = 0; x < 2; x ++) { + y += x; + } + console.log(y); + console.log(x); +})() +|}; + [%expect + {| + $ cat "test.min.js" + 1: (function(){ + 2: let v1 = 2; + 3: var v2 = 0; + 4: for(let v3 = 0; v3 < 2; v3++) v2 += v3; + 5: console.log(v2); + 6: console.log(v1); + 7: } + 8: ()); + 1 + 2 |}] + +let%expect_test "let inside forin" = + test + {| +(function () { + let x = 2 + var y = 0; + var arr = [1,2,3]; + for(let x in arr) { + console.log(x); + y += arr[x]; + } + console.log(y); + console.log(x); +})() +|}; + [%expect + {| + $ cat "test.min.js" + 1: (function(){ + 2: let v2 = 2; + 3: var v3 = 0, v1 = [1, 2, 3]; + 4: for(let v4 in v1){console.log(v4); v3 += v1[v4];} + 5: console.log(v3); + 6: console.log(v2); + 7: } + 8: ()); + 0 + 1 + 2 + 6 + 2 |}] + +let%expect_test "let inside forof" = + test + {| +(function () { + let x = 2 + var y = 0; + for(let x of [1,2,3]) { + console.log(x); + y += x; + } + console.log(y); + console.log(x); +})() +|}; + [%expect + {| + $ cat "test.min.js" + 1: (function(){ + 2: let v1 = 2; + 3: var v2 = 0; + 4: for(let v3 of [1, 2, 3]){console.log(v3); v2 += v3;} + 5: console.log(v2); + 6: console.log(v1); + 7: } + 8: ()); + 1 + 2 + 3 + 6 + 2 |}] + +let%expect_test "let inside forawaitof" = + test + {| +async function f () { + let x = 2 + var y = 0; + for await(let x of [1,2,3]) { + console.log(x); + y += x; + } + console.log(y); + console.log(x); +} +|}; + [%expect + {| + $ cat "test.min.js" + 1: async function f(){ + 2: let v1 = 2; + 3: var v2 = 0; + 4: for await(let v3 of [1, 2, 3]){console.log(v3); v2 += v3;} + 5: console.log(v2); + 6: console.log(v1); + 7: } |}] + +let%expect_test "let inside switch" = + test + {| +(function () { + let x = 2 + var y = 0; + switch(y){ + case 0: + let x = 3; + console.log(x); + } + console.log(x); +})() +|}; + [%expect + {| + $ cat "test.min.js" + 1: (function(){ + 2: let v1 = 2; + 3: var v2 = 0; + 4: switch(v2){case 0: let v3 = 3; console.log(v3); + 5: } + 6: console.log(v1); + 7: } + 8: ()); + 3 + 2 |}] + +let%expect_test "let and var inside class static block" = + test + {| +(function () { + let x = 2 + var y = 0; + class z { + static z = 2; + static { + let x = 3; + var y = x; + this.z = y + } + getZ(){ return this.z } + } + var t = new z; + console.log(y, x, z.z); +})() +|}; + [%expect + {| + $ cat "test.min.js" + 1: (function(){ + 2: let v2 = 2; + 3: var v3 = 0; + 4: class v4{ + 5: static z = 2; + 6: static {let v5 = 3; var v6 = v5; this.z = v6;} + 7: getZ(){return this.z;} + 8: } + 9: var v1 = new v4; + 10: console.log(v3, v2, v4.z); + 11: } + 12: ()); + 0 2 3 |}] + +let%expect_test "named class expression" = + test + {| +(function () { + var y = 0; + class z { + static z = 0; + } + const x = class z { + static z = 2; + static { + let x = 3; + var y = x; + this.z = y; + } + create(){ return new z } + getZ(){ return this.z } + } + var t = new x; + console.log(y, x.z, z.z); +})() +|}; + [%expect + {| + $ cat "test.min.js" + 1: (function(){ + 2: var v3 = 0; + 3: class v4{static z = 0;} + 4: const + 5: v2 = + 6: class v5{ + 7: static z = 2; + 8: static {let v6 = 3; var v7 = v6; this.z = v7;} + 9: create(){return new v5;} + 10: getZ(){return this.z;} + 11: }; + 12: var v1 = new v2; + 13: console.log(v3, v2.z, v4.z); + 14: } + 15: ()); + 0 3 0 |}] + +let%expect_test "let inside block" = + test + {| +(function () { + let x = 2 + var y = 0; + { + let x = 3; + var y = 4; + } + console.log(y, x); +})() +|}; + [%expect + {| + $ cat "test.min.js" + 1: (function(){ + 2: let v1 = 2; + 3: var v2 = 0; + 4: {let v3 = 3; var v2 = 4;} + 5: console.log(v2, v1); + 6: } + 7: ()); + 4 2 |}] + +let%expect_test "import" = + let test ?(module_ = false) js_prog = + let name = if module_ then "test.mjs" else "test.js" in + let js_file = js_prog |> Filetype.js_text_of_string |> Filetype.write_js ~name in + let js_min_file = + js_file + |> jsoo_minify + ~flags:[ "--enable"; "stable_var"; "--enable"; "shortvar" ] + ~pretty:true + in + print_file (Filetype.path_of_js_file js_min_file); + let js_min_file2 = + js_file + |> jsoo_minify + ~flags:[ "--enable"; "stable_var"; "--disable"; "shortvar" ] + ~pretty:true + in + print_file (Filetype.path_of_js_file js_min_file2); + check_javascript js_file |> print_endline + in + let t = test ~module_:true in + t {| +import defaultExport from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import v1 from "./module-name.mjs"; + $ cat "test.min.js" + 1: import defaultExport from "./module-name.mjs"; |}]; + t {| +import * as name from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import * as v1 from "./module-name.mjs"; + $ cat "test.min.js" + 1: import * as name from "./module-name.mjs"; |}]; + t {| +import { export1 } from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import { export1 as v1 } from "./module-name.mjs"; + $ cat "test.min.js" + 1: import { export1 } from "./module-name.mjs"; |}]; + t {| +import { export1 as alias1 } from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import { export1 as v1 } from "./module-name.mjs"; + $ cat "test.min.js" + 1: import { export1 as alias1 } from "./module-name.mjs"; |}]; + t {| +import { default as alias } from "module-name"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import { default as v1 } from "module-name"; + $ cat "test.min.js" + 1: import { default as alias } from "module-name"; |}]; + t {| +import { export1, export2 } from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import { export1 as v1, export2 as v2 } from "./module-name.mjs"; + $ cat "test.min.js" + 1: import { export1, export2 } from "./module-name.mjs"; |}]; + t {| +import { export1, export2 as alias2, /* … */ } from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import { export1 as v2, export2 as v1 } from "./module-name.mjs"; + $ cat "test.min.js" + 1: import { export1, export2 as alias2 } from "./module-name.mjs"; |}]; + t {| +import { "string name" as alias } from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import { "string name" as v1 } from "./module-name.mjs"; + $ cat "test.min.js" + 1: import { "string name" as alias } from "./module-name.mjs"; |}]; + t {| +import defaultExport, { export1, /* … */ } from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import v1, { export1 as v2 } from "./module-name.mjs"; + $ cat "test.min.js" + 1: import defaultExport, { export1 } from "./module-name.mjs"; |}]; + t {| +import defaultExport, * as name from "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import v1, * as v2 from "./module-name.mjs"; + $ cat "test.min.js" + 1: import defaultExport, * as name from "./module-name.mjs"; |}]; + t {| +import "./module-name.mjs"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: import "./module-name.mjs"; + $ cat "test.min.js" + 1: import "./module-name.mjs"; |}] + +let%expect_test "export" = + let test ?(module_ = false) js_prog = + try + let name = if module_ then "test.mjs" else "test.js" in + let js_file = js_prog |> Filetype.js_text_of_string |> Filetype.write_js ~name in + let js_min_file = + js_file + |> jsoo_minify + ~flags:[ "--enable"; "stable_var"; "--enable"; "shortvar" ] + ~pretty:true + in + print_file (Filetype.path_of_js_file js_min_file); + check_javascript js_file |> print_endline + with e -> print_endline (Printexc.to_string e) + in + let t = test ~module_:true in + t {| +var name1, nameN; +export { name1, /* …, */ nameN }; +|}; + [%expect + {| + $ cat "test.min.js" + 1: var name1, nameN; export { name1, nameN }; |}]; + t + {| +var variable1, variable2, nameN; +export { variable1 as name1, variable2 as name2, /* …, */ nameN }; +|}; + [%expect + {| + $ cat "test.min.js" + 1: var variable1, variable2, nameN; + 2: export { variable1 as name1, variable2 as name2, nameN }; |}]; + t {| +var variable1; +export { variable1 as "string name" }; +|}; + [%expect + {| + $ cat "test.min.js" + 1: var variable1; export { variable1 as "string name" }; |}]; + t {| +var name1 +export { name1 as default /*, … */ }; +|}; + [%expect {| + $ cat "test.min.js" + 1: var name1; export { name1 as default }; |}]; + t {| +export * from "module-name"; +|}; + [%expect {| + $ cat "test.min.js" + 1: export * from "module-name"; |}]; + t {| +export * as name1 from "module-name"; +|}; + [%expect {| + $ cat "test.min.js" + 1: export * as name1 from "module-name"; |}]; + t {| +export { name1, /* …, */ nameN } from "module-name"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: export { name1, nameN } from "module-name"; |}]; + t + {| +export { import1 as name1, import2 as name2, /* …, */ nameN } from "module-name"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: export { import1 as name1, import2 as name2, nameN } from "module-name"; |}]; + t {| +export { default, /* …, */ } from "module-name"; +|}; + [%expect {| + $ cat "test.min.js" + 1: export { default } from "module-name"; |}]; + t {| +export { default as name1 } from "module-name"; +|}; + [%expect + {| + $ cat "test.min.js" + 1: export { default as name1 } from "module-name"; |}]; + t {| +export default expression; +|}; + [%expect {| + $ cat "test.min.js" + 1: export default expression; |}]; + t {| +export default ({obj : 2}); +|}; + [%expect {| + $ cat "test.min.js" + 1: export default ({obj: 2}); |}]; + t {| +export default function functionName() { /* … */ } +|}; + [%expect + {| + $ cat "test.min.js" + 1: export default function functionName(){} |}]; + t {| +export default class ClassName { /* … */ }|}; + [%expect {| + $ cat "test.min.js" + 1: export default class ClassName{} |}]; + t {| +export default function* generatorFunctionName() { /* … */ }|}; + [%expect + {| + $ cat "test.min.js" + 1: export default function* generatorFunctionName(){} |}]; + t {| +export default function () { /* … */ }|}; + [%expect {| + $ cat "test.min.js" + 1: export default function(){} |}]; + t {| +export default class { /* … */ }|}; + [%expect {| + $ cat "test.min.js" + 1: export default class{} |}]; + t {| +export default function* () { /* … */ } +|}; + [%expect {| + $ cat "test.min.js" + 1: export default function*(){} |}]; + t {| export let name1, name2/*, … */; // also var |}; + [%expect {| + $ cat "test.min.js" + 1: export let name1, name2; |}]; + t {| export const name1 = 1, name2 = 2/*, … */; // also var, let |}; + [%expect {| + $ cat "test.min.js" + 1: export const name1 = 1, name2 = 2; |}]; + t {| export function functionName() { /* … */ } |}; + [%expect {| + $ cat "test.min.js" + 1: export function functionName(){} |}]; + t {| export class ClassName { /* … */ } |}; + [%expect {| + $ cat "test.min.js" + 1: export class ClassName{} |}]; + t {| export function* generatorFunctionName() { /* … */ } |}; + [%expect + {| + $ cat "test.min.js" + 1: export function* generatorFunctionName(){} |}]; + t {| export const { name1, name2: bar } = o; |}; + [%expect {| + $ cat "test.min.js" + 1: export const {name1, name2: bar} = o; |}]; + t {| export const [ name1, name2 ] = array; |}; + [%expect {| + $ cat "test.min.js" + 1: export const [name1, name2] = array; |}] diff --git a/compiler/tests-compiler/side_effect.ml b/compiler/tests-compiler/side_effect.ml index 0ff080837..3c0a254a8 100644 --- a/compiler/tests-compiler/side_effect.ml +++ b/compiler/tests-compiler/side_effect.ml @@ -22,7 +22,107 @@ (* https://github.com/ocsigen/js_of_ocaml/pull/178 *) let%expect_test _ = + let prog = + Util.compile_and_parse + ~flags:[] + {| + let i = ref 0 + let log_success () = print_endline "Success!" + let log_failure = Printf.printf "Failure! %s" + + let side_effect yes label = + if yes + then ( + Printf.printf "Side effect: %s\n%!" label; + incr i); + 0 + + let _ = side_effect false "this is only to avoid inlining" + + let f = + match side_effect true "Should only see this once" with + | 0 | 1 | 2 -> Printf.printf "Please don't optimize this away\n%!" + | _ -> Printf.printf "Or this\n%!" + + let _ = if !i = 1 then log_success () else log_failure "side effect computed twice" + |} + in + Util.print_program prog; + [%expect + {| + (function(globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_string_of_jsbytes = runtime.caml_string_of_jsbytes; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Printf = global_data.Stdlib__Printf, + Stdlib = global_data.Stdlib, + i = [0, 0], + cst_Success = caml_string_of_jsbytes("Success!"); + function log_success(param){return caml_call1(Stdlib[46], cst_Success);} + var + log_failure = + caml_call1 + (Stdlib_Printf[2], + [0, + [11, caml_string_of_jsbytes("Failure! "), [2, 0, 0]], + caml_string_of_jsbytes("Failure! %s")]), + _a_ = + [0, + [11, + caml_string_of_jsbytes("Side effect: "), + [2, 0, [12, 10, [10, 0]]]], + caml_string_of_jsbytes("Side effect: %s\n%!")]; + function side_effect(yes, label){ + if(yes){caml_call2(Stdlib_Printf[2], _a_, label); i[1]++;} + return 0; + } + side_effect(0, caml_string_of_jsbytes("this is only to avoid inlining")); + var + _b_ = + [0, + [11, caml_string_of_jsbytes("Or this\n"), [10, 0]], + caml_string_of_jsbytes("Or this\n%!")], + _c_ = + [0, + [11, + caml_string_of_jsbytes("Please don't optimize this away\n"), + [10, 0]], + caml_string_of_jsbytes("Please don't optimize this away\n%!")], + cst_side_effect_computed_twice = + caml_string_of_jsbytes("side effect computed twice"), + f = + 2 + < + side_effect(1, caml_string_of_jsbytes("Should only see this once")) + >>> 0 + ? caml_call1(Stdlib_Printf[2], _b_) + : caml_call1(Stdlib_Printf[2], _c_); + if(1 === i[1]) + log_success(0); + else + caml_call1(log_failure, cst_side_effect_computed_twice); + var Test = [0, i, log_success, log_failure, side_effect, f]; + runtime.caml_register_global(10, Test, "Test"); + return; + } + (globalThis)); + //end |}]; + [%expect {| |}]; Util.compile_and_run + ~flags:[] {| let i = ref 0 let log_success () = print_endline "Success!" diff --git a/compiler/tests-compiler/static_eval.ml b/compiler/tests-compiler/static_eval.ml index 204d45b3e..50c0ff033 100644 --- a/compiler/tests-compiler/static_eval.ml +++ b/compiler/tests-compiler/static_eval.ml @@ -29,7 +29,7 @@ let%expect_test "static eval of string get" = let constant = "abcdefghijklmnopqrstuvwxyz" - let call_with_char c = black_box c + let call_with_char c = try black_box c with _ -> assert false let ex = call_with_char constant.[-10] ;; black_box ex @@ -61,7 +61,7 @@ let%expect_test "static eval of string get" = let constant = "abcdefghijklmnopqrstuvwxyz" - let call_with_char c = black_box c + let call_with_char c = try black_box c with _ -> assert false let ex = call_with_char constant.[-10] ;; black_box ex @@ -88,7 +88,7 @@ let%expect_test "static eval of Sys.backend_type" = compile_and_parse_whole_program {| exception Myfun of (unit -> int) - let myfun () = + let myfun () = let constant = match Sys.backend_type with | Other "js_of_ocaml" -> 42 | Native -> 1 @@ -114,7 +114,7 @@ let%expect_test "static eval of string get" = | Cons of { mutable key: 'a; mutable data: 'b; mutable next: ('a, 'b) bucketlist } - + let copy_bucketlist = function | Empty -> Empty | Cons {key; data; next} -> @@ -153,7 +153,8 @@ let%expect_test "static eval of string get" = next$0 = param$0[3], prec$0 = [0, key$0, data$0, next$0]; prec[3] = prec$0; - var prec = prec$0, param$0 = next$0; + prec = prec$0; + param$0 = next$0; } } //end |}] @@ -195,7 +196,10 @@ let%expect_test "static eval of tags" = _b_ = [1, 0], x = 1 < caml_call1(Stdlib_Random[5], 3) ? _a_ : _b_; x[0]; - var export$0 = [0, 3, 3], Test = [0, 3, export$0]; + var + foobar = 3, + export$0 = [0, foobar, foobar], + Test = [0, foobar, export$0]; runtime.caml_register_global(3, Test, "Test"); return; } diff --git a/compiler/tests-compiler/sys_command.ml b/compiler/tests-compiler/sys_command.ml index 7245bc7bc..20eb7fd80 100644 --- a/compiler/tests-compiler/sys_command.ml +++ b/compiler/tests-compiler/sys_command.ml @@ -45,7 +45,7 @@ let%expect_test _ = * | 0 -> print_endline "BUG" * | _ -> ())|}; * [%expect {||}] - * + * * let%expect_test _ = * compile_and_run * {| diff --git a/compiler/tests-compiler/tailcall.ml b/compiler/tests-compiler/tailcall.ml index 60dc35bd9..9daa98c7f 100644 --- a/compiler/tests-compiler/tailcall.ml +++ b/compiler/tests-compiler/tailcall.ml @@ -47,25 +47,25 @@ let%expect_test _ = function fun1(param){ function odd$0(counter, x){ if(0 === x) return 0; - var _g_ = x - 1 | 0; - if(counter >= 50) return caml_trampoline_return(even$0, [0, _g_]); + var _f_ = x - 1 | 0; + if(counter >= 50) return caml_trampoline_return(even$0, [0, _f_]); var counter$0 = counter + 1 | 0; - return even$0(counter$0, _g_); + return even$0(counter$0, _f_); } + function odd(x){return caml_trampoline(odd$0(0, x));} function even$0(counter, x){ if(0 === x) return 1; - var _f_ = x - 1 | 0; - if(counter >= 50) return caml_trampoline_return(odd$0, [0, _f_]); + var _e_ = x - 1 | 0; + if(counter >= 50) return caml_trampoline_return(odd$0, [0, _e_]); var counter$0 = counter + 1 | 0; - return odd$0(counter$0, _f_); + return odd$0(counter$0, _e_); } - function odd(x){return caml_trampoline(odd$0(0, x));} function even(x){return caml_trampoline(even$0(0, x));} - var _c_ = even(1); - if(odd(1) === _c_) - throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); - try{odd(5000); var _d_ = log_success(0); return _d_;} - catch(_e_){return caml_call1(log_failure, cst_too_much_recursion);} + var _b_ = even(1); + if(odd(1) === _b_) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + try{odd(5000); var _c_ = log_success(0); return _c_;} + catch(_d_){return caml_call1(log_failure, cst_too_much_recursion);} } //end |}] @@ -97,15 +97,15 @@ let%expect_test _ = function odd$0(x){ return 0 === x ? 0 : caml_trampoline_return(even$0, [0, x - 1 | 0]); } + function odd(x){return caml_trampoline(odd$0(x));} function even$0(x){ return 0 === x ? 1 : caml_trampoline_return(odd$0, [0, x - 1 | 0]); } - function odd(x){return caml_trampoline(odd$0(x));} function even(x){return caml_trampoline(even$0(x));} - var _c_ = even(1); - if(odd(1) === _c_) - throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); - try{odd(5000); var _d_ = log_success(0); return _d_;} - catch(_e_){return caml_call1(log_failure, cst_too_much_recursion);} + var _b_ = even(1); + if(odd(1) === _b_) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + try{odd(5000); var _c_ = log_success(0); return _c_;} + catch(_d_){return caml_call1(log_failure, cst_too_much_recursion);} } //end |}] diff --git a/compiler/tests-compiler/test_string.ml b/compiler/tests-compiler/test_string.ml new file mode 100644 index 000000000..414002fcd --- /dev/null +++ b/compiler/tests-compiler/test_string.ml @@ -0,0 +1,118 @@ +(* Js_of_ocaml tests + * http://www.ocsigen.org/js_of_ocaml/ + * Copyright (C) 2019 Ty Overby + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +open Util + +let%expect_test _ = + let program = + compile_and_parse + ~debug:false + ~use_js_string:true + {| +external string_length : string -> int = "%string_length" +external bytes_create : int -> bytes = "caml_create_bytes" +external string_blit : string -> int -> bytes -> int -> int -> unit + = "caml_blit_string" [@@noalloc] +external bytes_unsafe_to_string : bytes -> string = "%bytes_to_string" + +let ( ^ ) s1 s2 = + let l1 = string_length s1 and l2 = string_length s2 in + let s = bytes_create (l1 + l2) in + string_blit s1 0 s 0 l1; + string_blit s2 0 s l1 l2; + bytes_unsafe_to_string s + +let here () = + let a = "a" in + let b = "b" in + a ^ a ^ b ^ b + +let (_ : string) = here () + |} + in + print_program program; + [%expect + {| + (function(globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_a = "a", + cst_b = "b", + caml_string_concat = runtime.caml_string_concat; + function _a_(_b_){return cst_a + cst_a + cst_b + cst_b;} + _a_(0); + var Test = [0, caml_string_concat, _a_]; + runtime.caml_register_global(2, Test, "Test"); + return; + } + (globalThis)); + //end |}] + +let%expect_test _ = + let program = + compile_and_parse + ~debug:false + ~use_js_string:false + {| +external string_length : string -> int = "%string_length" +external bytes_create : int -> bytes = "caml_create_bytes" +external string_blit : string -> int -> bytes -> int -> int -> unit + = "caml_blit_string" [@@noalloc] + +external bytes_unsafe_to_string : bytes -> string = "%bytes_to_string" + +let ( ^ ) s1 s2 = + let l1 = string_length s1 and l2 = string_length s2 in + let s = bytes_create (l1 + l2) in + string_blit s1 0 s 0 l1; + string_blit s2 0 s l1 l2; + bytes_unsafe_to_string s + +let here () = + let a = "a" in + let b = "b" in + a ^ a ^ b ^ b + +let (_ : string) = here () + |} + in + print_program program; + [%expect + {| + (function(globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_string_concat = runtime.caml_string_concat, + caml_string_of_jsbytes = runtime.caml_string_of_jsbytes, + cst_a = caml_string_of_jsbytes("a"), + cst_b = caml_string_of_jsbytes("b"); + function _a_(_b_){ + return caml_string_concat + (cst_a, + caml_string_concat(cst_a, caml_string_concat(cst_b, cst_b))); + } + _a_(0); + var Test = [0, caml_string_concat, _a_]; + runtime.caml_register_global(2, Test, "Test"); + return; + } + (globalThis)); + //end |}] diff --git a/compiler/tests-compiler/unix_fs.ml b/compiler/tests-compiler/unix_fs.ml index 6f8e4b417..07d9353bd 100644 --- a/compiler/tests-compiler/unix_fs.ml +++ b/compiler/tests-compiler/unix_fs.ml @@ -324,7 +324,7 @@ let f () = Sys.remove "aaa/bbb"; Sys.remove "aaa/ccc"; Sys.rmdir "aaa" - with e -> print_endline (Printexc.to_string (norm e)) + with e -> print_endline ("Error: " ^ Printexc.to_string (norm e)) let () = f (); Sys.chdir "/static"; f () |}; [%expect {| @@ -412,7 +412,7 @@ let f () = Sys.remove "ccc"; Sys.chdir ".."; Sys.rmdir "aaa" - with e -> print_endline (Printexc.to_string (norm e)) + with e -> print_endline ("Error: " ^ Printexc.to_string (norm e)) let () = f (); Sys.chdir "/static"; f () |}; [%expect {| diff --git a/compiler/tests-compiler/util/util.ml b/compiler/tests-compiler/util/util.ml index 278dd03fc..946b1472e 100644 --- a/compiler/tests-compiler/util/util.ml +++ b/compiler/tests-compiler/util/util.ml @@ -444,6 +444,14 @@ class find_variable_declaration r n = super#variable_declaration k v end +let find_variable program n = + let r = ref [] in + let o = new find_variable_declaration r n in + ignore (o#program program); + match !r with + | [ DeclIdent (_, Some (expression, _)) ] -> expression + | _ -> raise Not_found + let print_var_decl program n = let r = ref [] in let o = new find_variable_declaration r n in @@ -483,6 +491,14 @@ class find_function_declaration r n = let print_program p = print_string (program_to_string p) +let find_function program n = + let r = ref [] in + let o = new find_function_declaration r (Some n) in + ignore (o#program program); + match !r with + | [ (_, fd) ] -> fd + | _ -> raise Not_found + let print_fun_decl program n = let r = ref [] in let o = new find_function_declaration r n in diff --git a/compiler/tests-compiler/util/util.mli b/compiler/tests-compiler/util/util.mli index a7f5de2c7..578840092 100644 --- a/compiler/tests-compiler/util/util.mli +++ b/compiler/tests-compiler/util/util.mli @@ -71,6 +71,10 @@ val print_var_decl : Javascript.program -> string -> unit val print_fun_decl : Javascript.program -> string option -> unit +val find_variable : Javascript.program -> string -> Javascript.expression + +val find_function : Javascript.program -> string -> Javascript.function_declaration + val compile_and_run : ?debug:bool -> ?pretty:bool diff --git a/compiler/tests-compiler/variable_declaration_output.ml b/compiler/tests-compiler/variable_declaration_output.ml index 70bd6e38b..f4275e9d7 100644 --- a/compiler/tests-compiler/variable_declaration_output.ml +++ b/compiler/tests-compiler/variable_declaration_output.ml @@ -124,10 +124,10 @@ let%expect_test _ = [%expect {| function match_expr(param){ - var switch$1, switch$0, _c_, _b_, _a_; + var _c_, _b_, _a_; + a: if(param){ _a_ = param[1]; - switch$0 = 0; if(_a_){ _b_ = _a_[1]; if(_b_){ @@ -135,13 +135,10 @@ let%expect_test _ = } else if(! param[2]) return 2; } - else if(! param[2]) switch$0 = 1; - if(! switch$0){ - _c_ = param[2]; - switch$1 = 0; - if(_c_ && ! _c_[1]) switch$1 = 1; - if(! switch$1) return 4; - } + else if(! param[2]) break a; + _c_ = param[2]; + if(_c_ && ! _c_[1]) break a; + return 4; } return 1; } @@ -150,8 +147,9 @@ let%expect_test _ = [%expect {| function match_expr(param){ + a: if(param){ - var _a_ = param[1], switch$0 = 0; + var _a_ = param[1]; if(_a_){ var _b_ = _a_[1]; if(_b_){ @@ -159,12 +157,10 @@ let%expect_test _ = } else if(! param[2]) return 2; } - else if(! param[2]) switch$0 = 1; - if(! switch$0){ - var _c_ = param[2], switch$1 = 0; - if(_c_ && ! _c_[1]) switch$1 = 1; - if(! switch$1) return 4; - } + else if(! param[2]) break a; + var _c_ = param[2]; + if(_c_ && ! _c_[1]) break a; + return 4; } return 1; } diff --git a/compiler/tests-full/dune b/compiler/tests-full/dune index 634f4e0d3..802b8da1d 100644 --- a/compiler/tests-full/dune +++ b/compiler/tests-full/dune @@ -1,9 +1,7 @@ (rule (targets stdlib.cma.js) - (mode - (promote (until-clean))) (enabled_if - (= %{ocaml_version} "5.0.0")) + (= %{ocaml_version} "5.2.0")) (action (run %{bin:js_of_ocaml} @@ -16,7 +14,7 @@ (rule (targets stdlib.cma.output.js) (enabled_if - (= %{ocaml_version} "5.0.0")) + (= %{ocaml_version} "5.2.0")) (action (with-stdout-to %{targets} @@ -25,6 +23,6 @@ (rule (alias runtest) (enabled_if - (= %{ocaml_version} "5.0.0")) + (= %{ocaml_version} "5.2.0")) (action (diff stdlib.cma.expected.js stdlib.cma.output.js))) diff --git a/compiler/tests-full/stdlib.cma.expected.js b/compiler/tests-full/stdlib.cma.expected.js index 4d599ef02..019f19cab 100644 --- a/compiler/tests-full/stdlib.cma.expected.js +++ b/compiler/tests-full/stdlib.cma.expected.js @@ -5,7 +5,7 @@ "use strict"; var runtime = globalThis.jsoo_runtime; function erase_rel(param){ - /*<>*/ if(typeof param === "number") + /*<>*/ if(typeof param === "number") /*<>*/ return 0; switch(param[0]){ case 0: @@ -71,7 +71,7 @@ /*<>*/ return [14, erase_rel(rest$13)]; } - /*<>*/ } + } function concat_fmtty(fmtty1, fmtty2){ /*<>*/ if(typeof fmtty1 === "number") /*<>*/ return fmtty2; @@ -303,7 +303,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib -//# unitInfo: Requires: Assert_failure, CamlinternalFormatBasics, Division_by_zero, End_of_file, Failure, Invalid_argument, Match_failure, Not_found, Out_of_memory, Stack_overflow, Sys_blocked_io, Sys_error, Undefined_recursive_module +//# unitInfo: Requires: CamlinternalFormatBasics (function (globalThis){ "use strict"; @@ -313,7 +313,6 @@ cst_true$0 = "true", caml_atomic_cas = runtime.caml_atomic_cas, caml_atomic_load = runtime.caml_atomic_load, - caml_blit_string = runtime.caml_blit_string, caml_create_bytes = runtime.caml_create_bytes, caml_float_of_string = runtime.caml_float_of_string, caml_int64_float_of_bits = runtime.caml_int64_float_of_bits, @@ -334,7 +333,7 @@ caml_ml_set_binary_mode = runtime.caml_ml_set_binary_mode, caml_ml_set_channel_name = runtime.caml_ml_set_channel_name, caml_ml_string_length = runtime.caml_ml_string_length, - caml_string_notequal = runtime.caml_string_notequal, + caml_string_concat = runtime.caml_string_concat, caml_string_of_bytes = runtime.caml_string_of_bytes, caml_sys_open = runtime.caml_sys_open, caml_wrap_exception = runtime.caml_wrap_exception; @@ -350,8 +349,6 @@ } var global_data = runtime.caml_get_global_data(), - cst$0 = "%,", - cst = ".", CamlinternalFormatBasics = global_data.CamlinternalFormatBasics, Invalid_argument = global_data.Invalid_argument, Failure = global_data.Failure, @@ -364,28 +361,7 @@ End_of_file = global_data.End_of_file, Division_by_zero = global_data.Division_by_zero, Sys_blocked_io = global_data.Sys_blocked_io, - Undefined_recursive_module = global_data.Undefined_recursive_module, - cst_really_input = "really_input", - cst_input = "input", - _l_ = [0, 0, [0, 6, 0]], - _k_ = [0, 0, [0, 7, 0]], - cst_output_substring = "output_substring", - cst_output = "output", - _j_ = [0, 1, [0, 3, [0, 4, [0, 6, 0]]]], - _i_ = [0, 1, [0, 3, [0, 4, [0, 7, 0]]]], - _g_ = [0, 1], - _h_ = [0, 0], - cst_bool_of_string = "bool_of_string", - cst_true = cst_true$0, - cst_false = cst_false$0, - cst_char_of_int = "char_of_int", - cst_Stdlib_Exit = "Stdlib.Exit", - _a_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 32752), - _b_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 65520), - _c_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 32752), - _d_ = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 32751), - _e_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 16), - _f_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 15536); + Undefined_recursive_module = global_data.Undefined_recursive_module; function failwith(s){ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Failure, s], 1); @@ -395,7 +371,7 @@ ([0, Invalid_argument, s], 1); /*<>*/ } /*<>*/ /*<>*/ var - Exit = [248, cst_Stdlib_Exit, runtime.caml_fresh_oo_id(0)]; + Exit = [248, "Stdlib.Exit", runtime.caml_fresh_oo_id(0)]; function min(x, y){ /*<>*/ return /*<>*/ runtime.caml_lessequal (x, y) @@ -416,31 +392,30 @@ /*<>*/ } /*<>*/ var /*<>*/ infinity = - /*<>*/ caml_int64_float_of_bits(_a_), + /*<>*/ caml_int64_float_of_bits + (runtime.caml_int64_create_lo_mi_hi(0, 0, 32752)), /*<>*/ neg_infinity = - /*<>*/ caml_int64_float_of_bits(_b_), + /*<>*/ caml_int64_float_of_bits + (runtime.caml_int64_create_lo_mi_hi(0, 0, 65520)), /*<>*/ nan = - /*<>*/ caml_int64_float_of_bits(_c_), + /*<>*/ caml_int64_float_of_bits + (runtime.caml_int64_create_lo_mi_hi(1, 0, 32760)), /*<>*/ max_float = - /*<>*/ caml_int64_float_of_bits(_d_), + /*<>*/ caml_int64_float_of_bits + (runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 32751)), /*<>*/ min_float = - /*<>*/ caml_int64_float_of_bits(_e_), + /*<>*/ caml_int64_float_of_bits + (runtime.caml_int64_create_lo_mi_hi(0, 0, 16)), /*<>*/ epsilon_float = - /*<>*/ caml_int64_float_of_bits(_f_), - max_int = 2147483647, - min_int = -2147483648; - function symbol(s1, s2){ - /*<>*/ var - l1 = caml_ml_string_length(s1), - l2 = caml_ml_string_length(s2), - /*<>*/ s = - /*<>*/ caml_create_bytes(l1 + l2 | 0); - /*<>*/ /*<>*/ caml_blit_string - (s1, 0, s, 0, l1); - /*<>*/ /*<>*/ caml_blit_string - (s2, 0, s, l1, l2); - return caml_string_of_bytes(s); - /*<>*/ } + /*<>*/ caml_int64_float_of_bits + (runtime.caml_int64_create_lo_mi_hi(0, 0, 15536)), + symbol_concat = caml_string_concat, + cst_char_of_int = "char_of_int", + cst_true = cst_true$0, + cst_false = cst_false$0, + cst_bool_of_string = "bool_of_string", + _a_ = [0, 1], + _b_ = [0, 0]; function char_of_int(n){ /*<>*/ if(0 <= n && 255 >= n) /*<>*/ return n; @@ -450,17 +425,14 @@ /*<>*/ return b ? cst_true : cst_false; /*<>*/ } function bool_of_string(param){ - /*<>*/ return caml_string_notequal(param, cst_false$0) - ? caml_string_notequal - (param, cst_true$0) - ? invalid_arg(cst_bool_of_string) - : 1 + /*<>*/ return param !== cst_false$0 + ? param !== cst_true$0 ? invalid_arg(cst_bool_of_string) : 1 : 0; /*<>*/ } function bool_of_string_opt(param){ - /*<>*/ return caml_string_notequal(param, cst_false$0) - ? caml_string_notequal(param, cst_true$0) ? 0 : _g_ - : _h_; + /*<>*/ return param !== cst_false$0 + ? param !== cst_true$0 ? 0 : _a_ + : _b_; /*<>*/ } function string_of_int(n){ /*<>*/ return "" + n; @@ -468,31 +440,28 @@ function int_of_string_opt(s){ /*<>*/ try{ /*<>*/ /*<>*/ var - _B_ = [0, /*<>*/ caml_int_of_string(s)]; - /*<>*/ return _B_; + _w_ = [0, /*<>*/ caml_int_of_string(s)]; + /*<>*/ return _w_; } - catch(_C_){ - var _A_ = caml_wrap_exception(_C_); - if(_A_[1] === Failure) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_A_, 0); + catch(_x_){ + var _v_ = caml_wrap_exception(_x_); + if(_v_[1] === Failure) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_v_, 0); } /*<>*/ } - function valid_float_lexem(s){ - /*<>*/ var l = caml_ml_string_length(s), i = 0; + function valid_float_lexem(s1){ + /*<>*/ var l = caml_ml_string_length(s1), i = 0; /*<>*/ for(;;){ - if(l <= i) /*<>*/ return symbol(s, cst); - /*<>*/ var - /*<>*/ match = - /*<>*/ runtime.caml_string_get(s, i), - switch$0 = 0; - if(48 <= match){ - if(58 > match) switch$0 = 1; + if(l <= i) return s1 + "."; + /*<>*/ /*<>*/ var + match = /*<>*/ runtime.caml_string_get(s1, i); + a: + { + if(48 <= match){if(58 > match) break a;} else if(45 === match) break a; + /*<>*/ return s1; } - else if(45 === match) switch$0 = 1; - if(! switch$0) /*<>*/ return s; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } /*<>*/ } function string_of_float(f){ @@ -502,357 +471,395 @@ function float_of_string_opt(s){ /*<>*/ try{ /*<>*/ /*<>*/ var - _y_ = [0, /*<>*/ caml_float_of_string(s)]; - /*<>*/ return _y_; + _t_ = [0, /*<>*/ caml_float_of_string(s)]; + /*<>*/ return _t_; } - catch(_z_){ - var _x_ = caml_wrap_exception(_z_); - if(_x_[1] === Failure) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_x_, 0); + catch(_u_){ + var _s_ = caml_wrap_exception(_u_); + if(_s_[1] === Failure) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_s_, 0); } /*<>*/ } - function symbol$0(l1, l2){ + function symbol(l1, l2){ /*<>*/ if(! l1) /*<>*/ return l2; - var tl = l1[2], hd = l1[1]; - /*<>*/ return [0, hd, symbol$0(tl, l2)]; - /*<>*/ } - /*<>*/ var - /*<>*/ stdin = - /*<>*/ caml_ml_open_descriptor_in(0), - /*<>*/ stdout = - /*<>*/ caml_ml_open_descriptor_out(1), - /*<>*/ stderr = - /*<>*/ caml_ml_open_descriptor_out(2); + var _q_ = l1[2], h1 = l1[1]; + if(! _q_) /*<>*/ return [0, h1, l2]; + var match = _q_[2], h2 = _q_[1]; + if(! match) /*<>*/ return [0, h1, [0, h2, l2]]; + /*<>*/ var + tl = match[2], + h3 = match[1], + /*<>*/ block = [0, h3, 24029], + dst = block, + offset = 1, + l1$0 = tl; + /*<>*/ for(;;){ + if(l1$0){ + var _r_ = l1$0[2], h1$0 = l1$0[1]; + if(_r_){ + var match$0 = _r_[2], h2$0 = _r_[1]; + if(match$0){ + /*<>*/ var + tl$0 = match$0[2], + h3$0 = match$0[1], + /*<>*/ dst$0 = [0, h3$0, 24029]; + dst[1 + offset] = [0, h1$0, [0, h2$0, dst$0]]; + dst = dst$0; + offset = 1; + l1$0 = tl$0; + continue; + } + dst[1 + offset] = [0, h1$0, [0, h2$0, l2]]; + } + else + dst[1 + offset] = [0, h1$0, l2]; + } + else + dst[1 + offset] = l2; + /*<>*/ return [0, h1, [0, h2, block]]; + } + /*<>*/ } + /*<>*/ var + /*<>*/ stdin = + /*<>*/ caml_ml_open_descriptor_in(0), + /*<>*/ stdout = + /*<>*/ caml_ml_open_descriptor_out(1), + /*<>*/ stderr = + /*<>*/ caml_ml_open_descriptor_out(2), + _c_ = [0, 1, [0, 3, [0, 4, [0, 7, 0]]]], + _d_ = [0, 1, [0, 3, [0, 4, [0, 6, 0]]]], + cst_output = "output", + cst_output_substring = "output_substring", + _e_ = [0, 0, [0, 7, 0]], + _f_ = [0, 0, [0, 6, 0]], + cst_input = "input", + cst_really_input = "really_input"; function open_out_gen(mode, perm, name){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var c = - /*<>*/ caml_ml_open_descriptor_out - ( /*<>*/ caml_sys_open(name, mode, perm)); - /*<>*/ /*<>*/ caml_ml_set_channel_name + /*<>*/ caml_ml_open_descriptor_out + ( /*<>*/ caml_sys_open(name, mode, perm)); + /*<>*/ /*<>*/ caml_ml_set_channel_name (c, name); - /*<>*/ return c; - /*<>*/ } + /*<>*/ return c; + /*<>*/ } function open_out(name){ - /*<>*/ return open_out_gen(_i_, 438, name); - /*<>*/ } + /*<>*/ return open_out_gen(_c_, 438, name); + /*<>*/ } function open_out_bin(name){ - /*<>*/ return open_out_gen(_j_, 438, name); - /*<>*/ } + /*<>*/ return open_out_gen(_d_, 438, name); + /*<>*/ } function flush_all(param){ - /*<>*/ var - param$0 = /*<>*/ runtime.caml_ml_out_channels_list(0); - /*<>*/ for(;;){ - if(! param$0) /*<>*/ return 0; + /*<>*/ var + param$0 = /*<>*/ runtime.caml_ml_out_channels_list(0); + /*<>*/ for(;;){ + if(! param$0) /*<>*/ return 0; var l = param$0[2], a = param$0[1]; - /*<>*/ try{ - /*<>*/ /*<>*/ caml_ml_flush(a); + /*<>*/ try{ + /*<>*/ /*<>*/ caml_ml_flush(a); } - catch(_w_){ - var _v_ = caml_wrap_exception(_w_); - if(_v_[1] !== Sys_error) throw caml_maybe_attach_backtrace(_v_, 0); + catch(_p_){ + var _o_ = caml_wrap_exception(_p_); + if(_o_[1] !== Sys_error) throw caml_maybe_attach_backtrace(_o_, 0); } - var param$0 = l; + param$0 = l; } - /*<>*/ } + /*<>*/ } function output_bytes(oc, s){ - /*<>*/ return /*<>*/ caml_ml_output_bytes + /*<>*/ return /*<>*/ caml_ml_output_bytes (oc, s, 0, caml_ml_bytes_length(s)); - /*<>*/ } + /*<>*/ } function output_string(oc, s){ - /*<>*/ return /*<>*/ caml_ml_output + /*<>*/ return /*<>*/ caml_ml_output (oc, s, 0, caml_ml_string_length(s)); - /*<>*/ } + /*<>*/ } function output(oc, s, ofs, len){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs) - /*<>*/ return /*<>*/ caml_ml_output_bytes + /*<>*/ return /*<>*/ caml_ml_output_bytes (oc, s, ofs, len); - /*<>*/ return invalid_arg(cst_output); - /*<>*/ } + /*<>*/ return invalid_arg(cst_output); + /*<>*/ } function output_substring(oc, s, ofs, len){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (caml_ml_string_length(s) - len | 0) >= ofs) - /*<>*/ return /*<>*/ caml_ml_output + /*<>*/ return /*<>*/ caml_ml_output (oc, s, ofs, len); - /*<>*/ return invalid_arg(cst_output_substring); - /*<>*/ } + /*<>*/ return invalid_arg(cst_output_substring); + /*<>*/ } function output_value(chan, v){ - /*<>*/ return /*<>*/ runtime.caml_output_value + /*<>*/ return /*<>*/ runtime.caml_output_value (chan, v, 0); - /*<>*/ } + /*<>*/ } function close_out(oc){ - /*<>*/ /*<>*/ caml_ml_flush(oc); - /*<>*/ return /*<>*/ caml_ml_close_channel + /*<>*/ /*<>*/ caml_ml_flush(oc); + /*<>*/ return /*<>*/ caml_ml_close_channel (oc); - /*<>*/ } + /*<>*/ } function close_out_noerr(oc){ - /*<>*/ try{ - /*<>*/ /*<>*/ caml_ml_flush(oc); + /*<>*/ try{ + /*<>*/ /*<>*/ caml_ml_flush(oc); } - catch(_u_){} - /*<>*/ try{ - /*<>*/ /*<>*/ var - _s_ = /*<>*/ caml_ml_close_channel(oc); - /*<>*/ return _s_; + catch(_n_){} + /*<>*/ try{ + /*<>*/ /*<>*/ var + _l_ = /*<>*/ caml_ml_close_channel(oc); + /*<>*/ return _l_; } - catch(_t_){ /*<>*/ return 0;} - /*<>*/ } + catch(_m_){ /*<>*/ return 0;} + /*<>*/ } function open_in_gen(mode, perm, name){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var c = - /*<>*/ caml_ml_open_descriptor_in - ( /*<>*/ caml_sys_open(name, mode, perm)); - /*<>*/ /*<>*/ caml_ml_set_channel_name + /*<>*/ caml_ml_open_descriptor_in + ( /*<>*/ caml_sys_open(name, mode, perm)); + /*<>*/ /*<>*/ caml_ml_set_channel_name (c, name); - /*<>*/ return c; - /*<>*/ } + /*<>*/ return c; + /*<>*/ } function open_in(name){ - /*<>*/ return open_in_gen(_k_, 0, name); - /*<>*/ } + /*<>*/ return open_in_gen(_e_, 0, name); + /*<>*/ } function open_in_bin(name){ - /*<>*/ return open_in_gen(_l_, 0, name); - /*<>*/ } + /*<>*/ return open_in_gen(_f_, 0, name); + /*<>*/ } function input(ic, s, ofs, len){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs) - /*<>*/ return /*<>*/ caml_ml_input + /*<>*/ return /*<>*/ caml_ml_input (ic, s, ofs, len); - /*<>*/ return invalid_arg(cst_input); - /*<>*/ } + /*<>*/ return invalid_arg(cst_input); + /*<>*/ } function unsafe_really_input(ic, s, ofs, len){ - /*<>*/ var ofs$0 = ofs, len$0 = len; - /*<>*/ for(;;){ - if(0 >= len$0) /*<>*/ return 0; - /*<>*/ /*<>*/ var - r = /*<>*/ caml_ml_input(ic, s, ofs$0, len$0); - /*<>*/ if(0 === r) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ var ofs$0 = ofs, len$0 = len; + /*<>*/ for(;;){ + if(0 >= len$0) /*<>*/ return 0; + /*<>*/ /*<>*/ var + r = /*<>*/ caml_ml_input(ic, s, ofs$0, len$0); + /*<>*/ if(0 === r) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (End_of_file, 1); - var - len$1 = len$0 - r | 0, - ofs$1 = ofs$0 + r | 0, - ofs$0 = ofs$1, - len$0 = len$1; + var len$1 = len$0 - r | 0, ofs$1 = ofs$0 + r | 0; + ofs$0 = ofs$1; + len$0 = len$1; } - /*<>*/ } + /*<>*/ } function really_input(ic, s, ofs, len){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs) - /*<>*/ return unsafe_really_input(ic, s, ofs, len); - /*<>*/ return invalid_arg(cst_really_input); - /*<>*/ } + /*<>*/ return unsafe_really_input(ic, s, ofs, len); + /*<>*/ return invalid_arg(cst_really_input); + /*<>*/ } function really_input_string(ic, len){ - /*<>*/ /*<>*/ var - s = /*<>*/ caml_create_bytes(len); - /*<>*/ really_input(ic, s, 0, len); + /*<>*/ /*<>*/ var + s = /*<>*/ caml_create_bytes(len); + /*<>*/ really_input(ic, s, 0, len); return caml_string_of_bytes(s); - /*<>*/ } + /*<>*/ } function input_line(chan){ - /*<>*/ function build_result(buf, pos, param){ + /*<>*/ function build_result(buf, pos, param){ var pos$0 = pos, param$0 = param; for(;;){ - if(! param$0) /*<>*/ return buf; - /*<>*/ var + if(! param$0) /*<>*/ return buf; + /*<>*/ var tl = param$0[2], hd = param$0[1], - /*<>*/ len = - /*<>*/ caml_ml_bytes_length(hd); - /*<>*/ /*<>*/ runtime.caml_blit_bytes + /*<>*/ len = + /*<>*/ caml_ml_bytes_length(hd); + /*<>*/ /*<>*/ runtime.caml_blit_bytes (hd, 0, buf, pos$0 - len | 0, len); - var pos$1 = pos$0 - len | 0, pos$0 = pos$1, param$0 = tl; + var pos$1 = pos$0 - len | 0; + pos$0 = pos$1; + param$0 = tl; } } var accu = 0, len = 0; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - n = /*<>*/ runtime.caml_ml_input_scan_line(chan); - /*<>*/ if(0 === n){ + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + n = /*<>*/ runtime.caml_ml_input_scan_line(chan); + /*<>*/ if(0 === n){ if(! accu) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (End_of_file, 1); var - _r_ = + _k_ = build_result - ( /*<>*/ caml_create_bytes(len), len, accu); + ( /*<>*/ caml_create_bytes(len), len, accu); } else{ if(0 >= n){ - /*<>*/ /*<>*/ var - beg = /*<>*/ caml_create_bytes(- n | 0); - /*<>*/ /*<>*/ caml_ml_input + /*<>*/ /*<>*/ var + beg = /*<>*/ caml_create_bytes(- n | 0); + /*<>*/ /*<>*/ caml_ml_input (chan, beg, 0, - n | 0); - /*<>*/ var + /*<>*/ var len$1 = len - n | 0, - /*<>*/ accu$0 = [0, beg, accu], - accu = accu$0, - len = len$1; + /*<>*/ accu$0 = [0, beg, accu]; + accu = accu$0; + len = len$1; continue; } - /*<>*/ /*<>*/ var - res = /*<>*/ caml_create_bytes(n - 1 | 0); - /*<>*/ /*<>*/ caml_ml_input + /*<>*/ /*<>*/ var + res = /*<>*/ caml_create_bytes(n - 1 | 0); + /*<>*/ /*<>*/ caml_ml_input (chan, res, 0, n - 1 | 0); - /*<>*/ /*<>*/ caml_ml_input_char + /*<>*/ /*<>*/ caml_ml_input_char (chan); if(accu) var len$0 = (len + n | 0) - 1 | 0, - _r_ = + _k_ = build_result - ( /*<>*/ caml_create_bytes(len$0), + ( /*<>*/ caml_create_bytes(len$0), len$0, [0, res, accu]); else - var _r_ = res; + var _k_ = res; } - /*<>*/ return /*<>*/ caml_string_of_bytes - (_r_); + /*<>*/ return /*<>*/ caml_string_of_bytes + (_k_); } - /*<>*/ } + /*<>*/ } function close_in_noerr(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _p_ = /*<>*/ caml_ml_close_channel(ic); - /*<>*/ return _p_; + /*<>*/ try{ + /*<>*/ /*<>*/ var + _i_ = /*<>*/ caml_ml_close_channel(ic); + /*<>*/ return _i_; } - catch(_q_){ /*<>*/ return 0;} - /*<>*/ } + catch(_j_){ /*<>*/ return 0;} + /*<>*/ } function print_char(c){ - /*<>*/ return /*<>*/ caml_ml_output_char + /*<>*/ return /*<>*/ caml_ml_output_char (stdout, c); - /*<>*/ } + /*<>*/ } function print_string(s){ - /*<>*/ return output_string(stdout, s); - /*<>*/ } + /*<>*/ return output_string(stdout, s); + /*<>*/ } function print_bytes(s){ - /*<>*/ return output_bytes(stdout, s); - /*<>*/ } + /*<>*/ return output_bytes(stdout, s); + /*<>*/ } function print_int(i){ - /*<>*/ return output_string(stdout, "" + i); - /*<>*/ } + /*<>*/ return output_string(stdout, "" + i); + /*<>*/ } function print_float(f){ - /*<>*/ return output_string(stdout, string_of_float(f)); - /*<>*/ } + /*<>*/ return output_string(stdout, string_of_float(f)); + /*<>*/ } function print_endline(s){ - /*<>*/ output_string(stdout, s); - /*<>*/ /*<>*/ caml_ml_output_char + /*<>*/ output_string(stdout, s); + /*<>*/ /*<>*/ caml_ml_output_char (stdout, 10); - /*<>*/ return /*<>*/ caml_ml_flush + /*<>*/ return /*<>*/ caml_ml_flush (stdout); - /*<>*/ } + /*<>*/ } function print_newline(param){ - /*<>*/ /*<>*/ caml_ml_output_char + /*<>*/ /*<>*/ caml_ml_output_char (stdout, 10); - /*<>*/ return /*<>*/ caml_ml_flush + /*<>*/ return /*<>*/ caml_ml_flush (stdout); - /*<>*/ } + /*<>*/ } function prerr_char(c){ - /*<>*/ return /*<>*/ caml_ml_output_char + /*<>*/ return /*<>*/ caml_ml_output_char (stderr, c); - /*<>*/ } + /*<>*/ } function prerr_string(s){ - /*<>*/ return output_string(stderr, s); - /*<>*/ } + /*<>*/ return output_string(stderr, s); + /*<>*/ } function prerr_bytes(s){ - /*<>*/ return output_bytes(stderr, s); - /*<>*/ } + /*<>*/ return output_bytes(stderr, s); + /*<>*/ } function prerr_int(i){ - /*<>*/ return output_string(stderr, "" + i); - /*<>*/ } + /*<>*/ return output_string(stderr, "" + i); + /*<>*/ } function prerr_float(f){ - /*<>*/ return output_string(stderr, string_of_float(f)); - /*<>*/ } + /*<>*/ return output_string(stderr, string_of_float(f)); + /*<>*/ } function prerr_endline(s){ - /*<>*/ output_string(stderr, s); - /*<>*/ /*<>*/ caml_ml_output_char + /*<>*/ output_string(stderr, s); + /*<>*/ /*<>*/ caml_ml_output_char (stderr, 10); - /*<>*/ return /*<>*/ caml_ml_flush + /*<>*/ return /*<>*/ caml_ml_flush (stderr); - /*<>*/ } + /*<>*/ } function prerr_newline(param){ - /*<>*/ /*<>*/ caml_ml_output_char + /*<>*/ /*<>*/ caml_ml_output_char (stderr, 10); - /*<>*/ return /*<>*/ caml_ml_flush + /*<>*/ return /*<>*/ caml_ml_flush (stderr); - /*<>*/ } + /*<>*/ } function read_line(param){ - /*<>*/ /*<>*/ caml_ml_flush(stdout); - /*<>*/ return input_line(stdin); - /*<>*/ } + /*<>*/ /*<>*/ caml_ml_flush(stdout); + /*<>*/ return input_line(stdin); + /*<>*/ } function read_int(param){ - /*<>*/ return /*<>*/ caml_int_of_string + /*<>*/ return /*<>*/ caml_int_of_string (read_line(0)); - /*<>*/ } + /*<>*/ } function read_int_opt(param){ - /*<>*/ return int_of_string_opt(read_line(0)); - /*<>*/ } + /*<>*/ return int_of_string_opt(read_line(0)); + /*<>*/ } function read_float(param){ - /*<>*/ return /*<>*/ caml_float_of_string + /*<>*/ return /*<>*/ caml_float_of_string (read_line(0)); - /*<>*/ } + /*<>*/ } function read_float_opt(param){ - /*<>*/ return float_of_string_opt(read_line(0)); - /*<>*/ } + /*<>*/ return float_of_string_opt(read_line(0)); + /*<>*/ } function string_of_format(param){ var str = param[2]; - /*<>*/ return str; - } - function symbol$1(param, _n_){ - /*<>*/ var - str2 = _n_[2], - fmt2 = _n_[1], - str1 = param[2], - fmt1 = param[1], - /*<>*/ _o_ = symbol(str1, symbol(cst$0, str2)); - /*<>*/ return [0, - /*<>*/ caml_call2 + /*<>*/ return str; + } + function symbol$0(_h_, param){ + var + str2 = param[2], + fmt2 = param[1], + str1 = _h_[2], + fmt1 = _h_[1], + s2 = "%," + str2; + /*<>*/ return [0, + /*<>*/ caml_call2 (CamlinternalFormatBasics[3], fmt1, fmt2), - _o_]; + str1 + s2]; } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var exit_function = [0, flush_all]; function at_exit(f){ - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ f_yet_to_run = [0, 1], - /*<>*/ old_exit = - /*<>*/ caml_atomic_load(exit_function), - new_exit$0 = - function(f_yet_to_run, old_exit){ - function new_exit(param){ - /*<>*/ if(caml_atomic_cas(f_yet_to_run, 1, 0)) - /*<>*/ /*<>*/ caml_call1 - (f, 0); - /*<>*/ return /*<>*/ caml_call1 - (old_exit, 0); - /*<>*/ } - return new_exit; - }, - new_exit = new_exit$0(f_yet_to_run, old_exit), + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ f_yet_to_run = [0, 1], + /*<>*/ old_exit = + /*<>*/ caml_atomic_load(exit_function); + let f_yet_to_run$0 = f_yet_to_run, old_exit$0 = old_exit; + /*<>*/ var + new_exit = + function(param){ + /*<>*/ if(caml_atomic_cas(f_yet_to_run$0, 1, 0)) + /*<>*/ /*<>*/ caml_call1(f, 0); + /*<>*/ return /*<>*/ caml_call1 + (old_exit$0, 0); + /*<>*/ }, success = caml_atomic_cas(exit_function, old_exit, new_exit), - /*<>*/ _m_ = 1 - success; - if(_m_) continue; - /*<>*/ return _m_; + /*<>*/ _g_ = 1 - success; + if(! _g_) /*<>*/ return _g_; } - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var do_domain_local_at_exit = [0, function(param){ - /*<>*/ return 0; - /*<>*/ }]; + /*<>*/ return 0; + /*<>*/ }]; function do_at_exit(param){ - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (do_domain_local_at_exit[1], 0); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (caml_atomic_load(exit_function), 0); - /*<>*/ } + /*<>*/ } function exit(retcode){ - /*<>*/ do_at_exit(0); - /*<>*/ return /*<>*/ runtime.caml_sys_exit + /*<>*/ do_at_exit(0); + /*<>*/ return /*<>*/ runtime.caml_sys_exit (retcode); - /*<>*/ } - /*<>*/ /*<>*/ runtime.caml_register_named_value + /*<>*/ } + /*<>*/ /*<>*/ runtime.caml_register_named_value ("Pervasives.do_at_exit", do_at_exit); var Stdlib = @@ -875,8 +882,8 @@ min, max, abs, - max_int, - min_int, + 2147483647, + -2147483648, lnot, infinity, neg_infinity, @@ -884,7 +891,7 @@ max_float, min_float, epsilon_float, - symbol, + symbol_concat, char_of_int, string_of_bool, bool_of_string_opt, @@ -893,7 +900,7 @@ int_of_string_opt, string_of_float, float_of_string_opt, - symbol$0, + symbol, stdin, stdout, stderr, @@ -960,7 +967,7 @@ runtime.caml_ml_pos_in_64, caml_ml_channel_size_64], string_of_format, - symbol$1, + symbol$0, exit, at_exit, valid_float_lexem, @@ -1107,8 +1114,8 @@ caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception, global_data = runtime.caml_get_global_data(), - ocaml_version = "5.0.0", - ocaml_release = [0, 5, 0, 0, 0], + ocaml_version = "5.2.0", + ocaml_release = [0, 5, 2, 0, 0], Stdlib = global_data.Stdlib, /*<>*/ executable_name = /*<>*/ runtime.caml_sys_executable_name(0), @@ -1119,64 +1126,30 @@ cygwin = runtime.caml_sys_const_ostype_cygwin(0), max_array_length = runtime.caml_sys_const_max_wosize(0), max_floatarray_length = max_array_length / 2 | 0, - max_string_length = (4 * max_array_length | 0) - 1 | 0, - cst_Stdlib_Sys_Break = "Stdlib.Sys.Break", - big_endian = 0, - word_size = 32, - int_size = 32; + max_string_length = (4 * max_array_length | 0) - 1 | 0; function getenv_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _d_ = [0, /*<>*/ runtime.caml_sys_getenv(s)]; - /*<>*/ return _d_; + /*<>*/ try{ + /*<>*/ /*<>*/ var + _d_ = [0, /*<>*/ runtime.caml_sys_getenv(s)]; + /*<>*/ return _d_; } catch(_e_){ var _c_ = caml_wrap_exception(_e_); - if(_c_ === Stdlib[8]) /*<>*/ return 0; + if(_c_ === Stdlib[8]) /*<>*/ return 0; throw caml_maybe_attach_backtrace(_c_, 0); } - /*<>*/ } - /*<>*/ /*<>*/ var interactive = [0, 0]; - function set_signal(sig_num, sig_beh){ /*<>*/ return 0; - /*<>*/ } - /*<>*/ var - /*<>*/ Break = - [248, cst_Stdlib_Sys_Break, runtime.caml_fresh_oo_id(0)], - sigabrt = -1, - sigalrm = -2, - sigfpe = -3, - sighup = -4, - sigill = -5, - sigint = -6, - sigkill = -7, - sigpipe = -8, - sigquit = -9, - sigsegv = -10, - sigterm = -11, - sigusr1 = -12, - sigusr2 = -13, - sigchld = -14, - sigcont = -15, - sigstop = -16, - sigtstp = -17, - sigttin = -18, - sigttou = -19, - sigvtalrm = -20, - sigprof = -21, - sigbus = -22, - sigpoll = -23, - sigsys = -24, - sigtrap = -25, - sigurg = -26, - sigxcpu = -27, - sigxfsz = -28; + /*<>*/ } + /*<>*/ /*<>*/ var interactive = [0, 0]; + function set_signal(sig_num, sig_beh){ /*<>*/ return 0; + /*<>*/ } + /*<>*/ /*<>*/ var + Break = [248, "Stdlib.Sys.Break", runtime.caml_fresh_oo_id(0)]; function catch_break(on){ - /*<>*/ return on ? 0 : 0; - /*<>*/ } - var development_version = 0; - function Make(_b_, _a_){ /*<>*/ return [0, 1];} - /*<>*/ var - /*<>*/ Immediate64 = [0, Make], + /*<>*/ return on ? 0 : 0; + /*<>*/ } + function Make(_b_, _a_){ /*<>*/ return [0, 1];} + /*<>*/ var + /*<>*/ Immediate64 = [0, Make], Stdlib_Sys = [0, executable_name, @@ -1187,45 +1160,45 @@ unix, win32, cygwin, - word_size, - int_size, - big_endian, + 32, + 32, + 0, max_string_length, max_array_length, max_floatarray_length, set_signal, - sigabrt, - sigalrm, - sigfpe, - sighup, - sigill, - sigint, - sigkill, - sigpipe, - sigquit, - sigsegv, - sigterm, - sigusr1, - sigusr2, - sigchld, - sigcont, - sigstop, - sigtstp, - sigttin, - sigttou, - sigvtalrm, - sigprof, - sigbus, - sigpoll, - sigsys, - sigtrap, - sigurg, - sigxcpu, - sigxfsz, + -1, + -2, + -3, + -4, + -5, + -6, + -7, + -8, + -9, + -10, + -11, + -12, + -13, + -14, + -15, + -16, + -17, + -18, + -19, + -20, + -21, + -22, + -23, + -24, + -25, + -26, + -27, + -28, Break, catch_break, ocaml_version, - development_version, + 0, ocaml_release, runtime.caml_ml_enable_runtime_warnings, runtime.caml_ml_runtime_warnings_enabled, @@ -1236,7 +1209,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Obj -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Sys +//# unitInfo: Requires: Stdlib, Stdlib__Sys (function (globalThis){ "use strict"; @@ -1244,7 +1217,6 @@ runtime = globalThis.jsoo_runtime, cst_Obj_extension_constructor$1 = "Obj.extension_constructor", caml_check_bound = runtime.caml_check_bound, - caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_obj_tag = runtime.caml_obj_tag; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 @@ -1254,178 +1226,149 @@ var global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, - Assert_failure = global_data.Assert_failure, - Stdlib_Sys = global_data.Stdlib__Sys, - cst_Obj_Ephemeron_blit_key = "Obj.Ephemeron.blit_key", - cst_Obj_Ephemeron_check_key = "Obj.Ephemeron.check_key", - cst_Obj_Ephemeron_unset_key = "Obj.Ephemeron.unset_key", - cst_Obj_Ephemeron_set_key = "Obj.Ephemeron.set_key", - cst_Obj_Ephemeron_get_key_copy = "Obj.Ephemeron.get_key_copy", - cst_Obj_Ephemeron_get_key = "Obj.Ephemeron.get_key", - cst_Obj_Ephemeron_create = "Obj.Ephemeron.create", - cst_Obj_extension_constructor$0 = cst_Obj_extension_constructor$1, - cst_Obj_extension_constructor = cst_Obj_extension_constructor$1, - _a_ = [0, "obj.ml", 97, 4]; + Stdlib_Sys = global_data.Stdlib__Sys; function is_block(a){ /*<>*/ return 1 - (typeof a === "number" ? 1 : 0); /*<>*/ } function double_field(x, i){ - /*<>*/ return caml_check_bound(x, i)[1 + i]; - /*<>*/ } + /*<>*/ return caml_check_bound(x, i)[1 + i]; + /*<>*/ } function set_double_field(x, i, v){ - /*<>*/ caml_check_bound(x, i)[1 + i] = v; - /*<>*/ return 0; - /*<>*/ } + /*<>*/ caml_check_bound(x, i)[1 + i] = v; + /*<>*/ return 0; + /*<>*/ } var - first_non_constant_constructor = 0, - last_non_constant_constructor_ = 243, - forcing_tag = 244, - cont_tag = 245, - lazy_tag = 246, - closure_tag = 247, - object_tag = 248, - infix_tag = 249, - forward_tag = 250, - no_scan_tag = 251, - abstract_tag = 251, - string_tag = 252, - double_tag = 253, - double_array_tag = 254, - custom_tag = 255, - int_tag = 1000, - out_of_heap_tag = 1001, - unaligned_tag = 1002; - function info(obj){ - /*<>*/ if( /*<>*/ caml_obj_tag(obj) !== 247) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _a_], 1); - /*<>*/ var - /*<>*/ info = - /*<>*/ runtime.caml_obj_raw_field(obj, 1), - arity = 64 === Stdlib_Sys[9] ? info >> 56 : info >> 24, - /*<>*/ start_env = info << 8 >>> 9 | 0; - /*<>*/ return [0, arity, start_env]; - /*<>*/ } + cst_Obj_extension_constructor = cst_Obj_extension_constructor$1, + cst_Obj_extension_constructor$0 = cst_Obj_extension_constructor$1; function of_val(x){ - /*<>*/ var switch$0 = 0; - if - (is_block(x) - && /*<>*/ caml_obj_tag(x) !== 248 && 1 <= x.length - 1){var slot = x[1]; switch$0 = 1;} - if(! switch$0) var slot = x; - var switch$1 = 0; - if(is_block(slot) && /*<>*/ caml_obj_tag(slot) === 248){var name = slot[1]; switch$1 = 1;} - if(! switch$1) + /*<>*/ a: + { + if + (is_block(x) + && /*<>*/ caml_obj_tag(x) !== 248 && 1 <= x.length - 1){var slot = x[1]; break a;} + var slot = x; + } + a: + { + if(is_block(slot) && /*<>*/ caml_obj_tag(slot) === 248){var name = slot[1]; break a;} var name = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib[1], cst_Obj_extension_constructor$0); - return /*<>*/ caml_obj_tag(name) === 252 + } + return /*<>*/ caml_obj_tag(name) === 252 ? slot - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Obj_extension_constructor); - /*<>*/ } + /*<>*/ } function name(slot){ - /*<>*/ return slot[1]; - /*<>*/ } + /*<>*/ return slot[1]; + /*<>*/ } function id(slot){ - /*<>*/ return slot[2]; - /*<>*/ } - /*<>*/ var - /*<>*/ Extension_constructor = [0, of_val, name, id], - max_ephe_length = Stdlib_Sys[13] - 2 | 0; + /*<>*/ return slot[2]; + /*<>*/ } + /*<>*/ var + /*<>*/ Extension_constructor = [0, of_val, name, id], + max_ephe_length = Stdlib_Sys[13] - 2 | 0, + cst_Obj_Ephemeron_create = "Obj.Ephemeron.create", + cst_Obj_Ephemeron_get_key = "Obj.Ephemeron.get_key", + cst_Obj_Ephemeron_get_key_copy = "Obj.Ephemeron.get_key_copy", + cst_Obj_Ephemeron_set_key = "Obj.Ephemeron.set_key", + cst_Obj_Ephemeron_unset_key = "Obj.Ephemeron.unset_key", + cst_Obj_Ephemeron_check_key = "Obj.Ephemeron.check_key", + cst_Obj_Ephemeron_blit_key = "Obj.Ephemeron.blit_key"; function create(l){ - /*<>*/ var - _g_ = 0 <= l ? 1 : 0, - _h_ = _g_ ? l <= max_ephe_length ? 1 : 0 : _g_; - if(1 - _h_) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ var + _f_ = 0 <= l ? 1 : 0, + _g_ = _f_ ? l <= max_ephe_length ? 1 : 0 : _f_; + if(1 - _g_) + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Obj_Ephemeron_create); - /*<>*/ return /*<>*/ runtime.caml_ephe_create + /*<>*/ return /*<>*/ runtime.caml_ephe_create (l); - /*<>*/ } + /*<>*/ } function length(x){ - /*<>*/ return x.length - 1 - 2 | 0; - /*<>*/ } + /*<>*/ return x.length - 3 | 0; + /*<>*/ } function raise_if_invalid_offset(e, o, msg){ - /*<>*/ var - _d_ = 0 <= o ? 1 : 0, - _e_ = _d_ ? o < length(e) ? 1 : 0 : _d_, - _f_ = 1 - _e_; - return _f_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _f_; - /*<>*/ } + /*<>*/ var + _c_ = 0 <= o ? 1 : 0, + _d_ = _c_ ? o < length(e) ? 1 : 0 : _c_, + _e_ = 1 - _d_; + return _e_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _e_; + /*<>*/ } function get_key(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_get_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_get_key + /*<>*/ return /*<>*/ runtime.caml_ephe_get_key (e, o); - /*<>*/ } + /*<>*/ } function get_key_copy(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_get_key_copy); - /*<>*/ return /*<>*/ runtime.caml_ephe_get_key_copy + /*<>*/ return /*<>*/ runtime.caml_ephe_get_key_copy (e, o); - /*<>*/ } + /*<>*/ } function set_key(e, o, x){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_set_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_set_key + /*<>*/ return /*<>*/ runtime.caml_ephe_set_key (e, o, x); - /*<>*/ } + /*<>*/ } function unset_key(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_unset_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_unset_key + /*<>*/ return /*<>*/ runtime.caml_ephe_unset_key (e, o); - /*<>*/ } + /*<>*/ } function check_key(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_check_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_check_key + /*<>*/ return /*<>*/ runtime.caml_ephe_check_key (e, o); - /*<>*/ } + /*<>*/ } function blit_key(e1, o1, e2, o2, l){ - /*<>*/ if + /*<>*/ if (0 <= l && 0 <= o1 && (length(e1) - l | 0) >= o1 && 0 <= o2 && (length(e2) - l | 0) >= o2){ var - _b_ = 0 !== l ? 1 : 0, - _c_ = - _b_ - ? /*<>*/ runtime.caml_ephe_blit_key + _a_ = 0 !== l ? 1 : 0, + _b_ = + _a_ + ? /*<>*/ runtime.caml_ephe_blit_key (e1, o1, e2, o2, l) - : _b_; - /*<>*/ return _c_; + : _a_; + /*<>*/ return _b_; } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Obj_Ephemeron_blit_key); - /*<>*/ } + /*<>*/ } var Stdlib_Obj = [0, is_block, double_field, set_double_field, - first_non_constant_constructor, - last_non_constant_constructor_, - forcing_tag, - cont_tag, - lazy_tag, - closure_tag, - object_tag, - infix_tag, - forward_tag, - no_scan_tag, - abstract_tag, - string_tag, - double_tag, - double_array_tag, - custom_tag, - int_tag, - out_of_heap_tag, - unaligned_tag, - [0, info], + 0, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 251, + 252, + 253, + 254, + 255, + 1000, + 1001, + 1002, Extension_constructor, [0, create, @@ -1443,7 +1386,45 @@ runtime.caml_ephe_check_data, runtime.caml_ephe_blit_data, max_ephe_length]]; - runtime.caml_register_global(13, Stdlib_Obj, "Stdlib__Obj"); + runtime.caml_register_global(11, Stdlib_Obj, "Stdlib__Obj"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Type +//# unitInfo: Requires: Stdlib__Obj +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + /*<>*/ function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Obj = global_data.Stdlib__Obj, + cst_Id = "Id", + _a_ = [0, 0]; + function make(param){ + /*<>*/ /*<>*/ var + Id = [248, cst_Id, runtime.caml_fresh_oo_id(0)]; + /*<>*/ return [0, Id]; + /*<>*/ } + function uid(A){ + /*<>*/ /*<>*/ var + _b_ = /*<>*/ caml_call1(Stdlib_Obj[22][1], A[1]); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Obj[22][3], _b_); + /*<>*/ } + function provably_equal(A, B){ + /*<>*/ return A[1] === B[1] ? _a_ : 0; + /*<>*/ } + /*<>*/ var + /*<>*/ Id = [0, make, uid, provably_equal], + Stdlib_Type = [0, Id]; + runtime.caml_register_global(3, Stdlib_Type, "Stdlib__Type"); return; /*<>*/ } (globalThis)); @@ -1456,30 +1437,27 @@ caml_atomic_exchange = runtime.caml_atomic_exchange, caml_atomic_fetch_add = runtime.caml_atomic_fetch_add; function set(r, x){ - /*<>*/ caml_atomic_exchange(r, x); + /*<>*/ caml_atomic_exchange(r, x); return 0; - /*<>*/ } + /*<>*/ } function incr(r){ - /*<>*/ caml_atomic_fetch_add(r, 1); + /*<>*/ caml_atomic_fetch_add(r, 1); return 0; - /*<>*/ } + /*<>*/ } function decr(r){ - /*<>*/ caml_atomic_fetch_add(r, -1); + /*<>*/ caml_atomic_fetch_add(r, -1); return 0; - /*<>*/ } + /*<>*/ } var - _a_ = caml_atomic_fetch_add, - _b_ = runtime.caml_atomic_cas, - _c_ = caml_atomic_exchange, - _d_ = runtime.caml_atomic_load, Stdlib_Atomic = [0, - function(_e_){ /*<>*/ return [0, _e_];}, - _d_, + function(_a_){ /*<>*/ return [0, _a_];}, + runtime.caml_atomic_make_contended, + runtime.caml_atomic_load, set, - _c_, - _b_, - _a_, + caml_atomic_exchange, + runtime.caml_atomic_cas, + caml_atomic_fetch_add, incr, decr]; runtime.caml_register_global(0, Stdlib_Atomic, "Stdlib__Atomic"); @@ -1621,12 +1599,12 @@ /*<>*/ return [246, function(_f_){ var _g_ = caml_obj_tag(x); + a: if(250 === _g_) var _h_ = x[1]; else{ - var switch$0 = 0; - if(246 !== _g_ && 244 !== _g_){var _h_ = x; switch$0 = 1;} - if(! switch$0) var _h_ = caml_call1(CamlinternalLazy[2], x); + if(246 !== _g_ && 244 !== _g_){var _h_ = x; break a;} + var _h_ = caml_call1(CamlinternalLazy[2], x); } /*<>*/ return /*<>*/ caml_call1 (f, _h_); @@ -1637,23 +1615,23 @@ /*<>*/ return [246, function(_c_){ var _d_ = caml_obj_tag(x); + a: if(250 === _d_) var _e_ = x[1]; else{ - var switch$0 = 0; - if(246 !== _d_ && 244 !== _d_){var _e_ = x; switch$0 = 1;} - if(! switch$0) var _e_ = caml_call1(CamlinternalLazy[2], x); + if(246 !== _d_ && 244 !== _d_){var _e_ = x; break a;} + var _e_ = caml_call1(CamlinternalLazy[2], x); } /*<>*/ return /*<>*/ caml_call1 (f, _e_); }]; var _a_ = caml_obj_tag(x); + a: if(250 === _a_) var _b_ = x[1]; else{ - var switch$0 = 0; - if(246 !== _a_ && 244 !== _a_){var _b_ = x; switch$0 = 1;} - if(! switch$0) var _b_ = caml_call1(CamlinternalLazy[2], x); + if(246 !== _a_ && 244 !== _a_){var _b_ = x; break a;} + var _b_ = caml_call1(CamlinternalLazy[2], x); } /*<>*/ return from_val ( /*<>*/ caml_call1(f, _b_)); @@ -1667,7 +1645,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Seq -//# unitInfo: Requires: Assert_failure, CamlinternalLazy, Stdlib, Stdlib__Atomic, Stdlib__Lazy +//# unitInfo: Requires: CamlinternalLazy, Stdlib, Stdlib__Atomic, Stdlib__Lazy (function (globalThis){ "use strict"; @@ -1696,11 +1674,9 @@ CamlinternalLazy = global_data.CamlinternalLazy, Stdlib = global_data.Stdlib, Stdlib_Lazy = global_data.Stdlib__Lazy, - _a_ = [0, "seq.ml", 596, 4], - cst_Seq_drop = "Seq.drop", - cst_Seq_take = "Seq.take", cst_Seq_init = "Seq.init", - cst_Stdlib_Seq_Forced_twice = "Stdlib.Seq.Forced_twice"; + cst_Seq_take = "Seq.take", + cst_Seq_drop = "Seq.drop"; function empty(param){ /*<>*/ return 0; /*<>*/ } @@ -1718,19 +1694,16 @@ var next = match[2], x = match[1]; /*<>*/ return [0, x, - function(_aM_){ /*<>*/ return append(next, seq2, _aM_);}]; + function(_au_){ /*<>*/ return append(next, seq2, _au_);}]; /*<>*/ } function map(f, seq, param){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(seq, 0); if(! match) /*<>*/ return 0; var next = match[2], x = match[1]; - /*<>*/ function _aK_(_aL_){ - /*<>*/ return map(f, next, _aL_); - } /*<>*/ return [0, /*<>*/ caml_call1(f, x), - _aK_]; + function(_at_){ /*<>*/ return map(f, next, _at_);}]; /*<>*/ } function filter_map(f, seq, param){ /*<>*/ var seq$0 = seq; @@ -1746,9 +1719,9 @@ var y = match$0[1]; /*<>*/ return [0, y, - function(_aJ_){ /*<>*/ return filter_map(f, next, _aJ_);}]; + function(_as_){ /*<>*/ return filter_map(f, next, _as_);}]; } - var seq$0 = next; + seq$0 = next; } /*<>*/ } function filter(f, seq, param){ @@ -1761,28 +1734,27 @@ /*<>*/ if( /*<>*/ caml_call1(f, x)) /*<>*/ return [0, x, - function(_aI_){ /*<>*/ return filter(f, next, _aI_);}]; - var seq$0 = next; + function(_ar_){ /*<>*/ return filter(f, next, _ar_);}]; + seq$0 = next; } /*<>*/ } function concat(seq, param){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(seq, 0); if(! match) /*<>*/ return 0; - var next = match[2], x = match[1], _aG_ = 0; + var next = match[2], x = match[1]; /*<>*/ return append - (x, function(_aH_){ /*<>*/ return concat(next, _aH_);}, _aG_); + (x, function(_aq_){ /*<>*/ return concat(next, _aq_);}, 0); /*<>*/ } function flat_map(f, seq, param){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(seq, 0); if(! match) /*<>*/ return 0; - var next = match[2], x = match[1], _aD_ = 0; - /*<>*/ function _aE_(_aF_){ - /*<>*/ return flat_map(f, next, _aF_); - } + var next = match[2], x = match[1]; /*<>*/ return append - ( /*<>*/ caml_call1(f, x), _aE_, _aD_); + ( /*<>*/ caml_call1(f, x), + function(_ap_){ /*<>*/ return flat_map(f, next, _ap_);}, + 0); /*<>*/ } function fold_left(f, acc, seq){ /*<>*/ var acc$0 = acc, seq$0 = seq; @@ -1794,9 +1766,9 @@ next = match[2], x = match[1], /*<>*/ acc$1 = - /*<>*/ caml_call2(f, acc$0, x), - acc$0 = acc$1, - seq$0 = next; + /*<>*/ caml_call2(f, acc$0, x); + acc$0 = acc$1; + seq$0 = next; } /*<>*/ } function iter(f, seq){ @@ -1807,7 +1779,7 @@ if(! match) /*<>*/ return 0; var next = match[2], x = match[1]; /*<>*/ /*<>*/ caml_call1(f, x); - var seq$0 = next; + seq$0 = next; } /*<>*/ } function unfold(f, u, param){ @@ -1817,7 +1789,7 @@ var match$0 = match[1], u$0 = match$0[2], x = match$0[1]; /*<>*/ return [0, x, - function(_aC_){ /*<>*/ return unfold(f, u$0, _aC_);}]; + function(_ao_){ /*<>*/ return unfold(f, u$0, _ao_);}]; /*<>*/ } function is_empty(xs){ /*<>*/ return /*<>*/ caml_call1(xs, 0) ? 0 : 1; @@ -1837,9 +1809,9 @@ if(! match) /*<>*/ return accu; /*<>*/ var xs$0 = match[2], - /*<>*/ accu$0 = accu + 1 | 0, - accu = accu$0, - xs = xs$0; + /*<>*/ accu$0 = accu + 1 | 0; + accu = accu$0; + xs = xs$0; } /*<>*/ } function iteri(f, xs$1){ @@ -1850,7 +1822,9 @@ if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; /*<>*/ /*<>*/ caml_call2(f, i, x); - var i$0 = i + 1 | 0, i = i$0, xs = xs$0; + var i$0 = i + 1 | 0; + i = i$0; + xs = xs$0; } /*<>*/ } function fold_lefti(f, accu$1, xs$1){ @@ -1864,10 +1838,10 @@ x = match[1], /*<>*/ accu$0 = /*<>*/ caml_call3(f, accu, i, x), - /*<>*/ i$0 = i + 1 | 0, - accu = accu$0, - i = i$0, - xs = xs$0; + /*<>*/ i$0 = i + 1 | 0; + accu = accu$0; + i = i$0; + xs = xs$0; } /*<>*/ } function for_all(p, xs){ @@ -1879,9 +1853,9 @@ /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ _aB_ = /*<>*/ caml_call1(p, x); - /*<>*/ if(! _aB_) /*<>*/ return _aB_; - var xs$0 = xs$1; + /*<>*/ _an_ = /*<>*/ caml_call1(p, x); + /*<>*/ if(! _an_) /*<>*/ return _an_; + xs$0 = xs$1; } /*<>*/ } function exists(p, xs){ @@ -1893,9 +1867,9 @@ /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ _aA_ = /*<>*/ caml_call1(p, x); - /*<>*/ if(_aA_) /*<>*/ return _aA_; - var xs$0 = xs$1; + /*<>*/ _am_ = /*<>*/ caml_call1(p, x); + /*<>*/ if(_am_) /*<>*/ return _am_; + xs$0 = xs$1; } /*<>*/ } function find(p, xs){ @@ -1907,638 +1881,649 @@ var xs$1 = match[2], x = match[1]; /*<>*/ if( /*<>*/ caml_call1(p, x)) /*<>*/ return [0, x]; - var xs$0 = xs$1; + xs$0 = xs$1; } /*<>*/ } + function find_index(p, xs){ + /*<>*/ var i = 0, xs$0 = xs; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + var xs$1 = match[2], x = match[1]; + /*<>*/ if( /*<>*/ caml_call1(p, x)) + /*<>*/ return [0, i]; + var i$0 = i + 1 | 0; + i = i$0; + xs$0 = xs$1; + } + /*<>*/ } function find_map(f, xs){ - /*<>*/ var xs$0 = xs; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var xs$0 = xs; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ result = /*<>*/ caml_call1(f, x); - if(result) /*<>*/ return result; - var xs$0 = xs$1; - } - /*<>*/ } + /*<>*/ result = /*<>*/ caml_call1(f, x); + if(result) /*<>*/ return result; + xs$0 = xs$1; + } + /*<>*/ } + function find_mapi(f, xs){ + /*<>*/ var i = 0, xs$0 = xs; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var + xs$1 = match[2], + x = match[1], + /*<>*/ result = + /*<>*/ caml_call2(f, i, x); + if(result) /*<>*/ return result; + var i$0 = i + 1 | 0; + i = i$0; + xs$0 = xs$1; + } + /*<>*/ } function iter2(f, xs, ys){ - /*<>*/ var xs$0 = xs, ys$0 = ys; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var xs$0 = xs, ys$0 = ys; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ match$0 = - /*<>*/ caml_call1(ys$0, 0); - if(! match$0) /*<>*/ return 0; + /*<>*/ match$0 = + /*<>*/ caml_call1(ys$0, 0); + if(! match$0) /*<>*/ return 0; var ys$1 = match$0[2], y = match$0[1]; - /*<>*/ /*<>*/ caml_call2(f, x, y); - var xs$0 = xs$1, ys$0 = ys$1; + /*<>*/ /*<>*/ caml_call2(f, x, y); + xs$0 = xs$1; + ys$0 = ys$1; } - /*<>*/ } + /*<>*/ } function fold_left2(f, accu, xs, ys){ - /*<>*/ var accu$0 = accu, xs$0 = xs, ys$0 = ys; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return accu$0; - /*<>*/ var + /*<>*/ var accu$0 = accu, xs$0 = xs, ys$0 = ys; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return accu$0; + /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ match$0 = - /*<>*/ caml_call1(ys$0, 0); - if(! match$0) /*<>*/ return accu$0; - /*<>*/ var + /*<>*/ match$0 = + /*<>*/ caml_call1(ys$0, 0); + if(! match$0) /*<>*/ return accu$0; + /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ accu$1 = - /*<>*/ caml_call3(f, accu$0, x, y), - accu$0 = accu$1, - xs$0 = xs$1, - ys$0 = ys$1; + /*<>*/ accu$1 = + /*<>*/ caml_call3(f, accu$0, x, y); + accu$0 = accu$1; + xs$0 = xs$1; + ys$0 = ys$1; } - /*<>*/ } + /*<>*/ } function for_all2(f, xs, ys){ - /*<>*/ var xs$0 = xs, ys$0 = ys; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return 1; - /*<>*/ var + /*<>*/ var xs$0 = xs, ys$0 = ys; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 1; + /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ match$0 = - /*<>*/ caml_call1(ys$0, 0); - if(! match$0) /*<>*/ return 1; - /*<>*/ var + /*<>*/ match$0 = + /*<>*/ caml_call1(ys$0, 0); + if(! match$0) /*<>*/ return 1; + /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ _az_ = /*<>*/ caml_call2(f, x, y); - /*<>*/ if(! _az_) /*<>*/ return _az_; - var xs$0 = xs$1, ys$0 = ys$1; + /*<>*/ _al_ = /*<>*/ caml_call2(f, x, y); + /*<>*/ if(! _al_) /*<>*/ return _al_; + xs$0 = xs$1; + ys$0 = ys$1; } - /*<>*/ } + /*<>*/ } function exists2(f, xs, ys){ - /*<>*/ var xs$0 = xs, ys$0 = ys; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var xs$0 = xs, ys$0 = ys; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ match$0 = - /*<>*/ caml_call1(ys$0, 0); - if(! match$0) /*<>*/ return 0; - /*<>*/ var + /*<>*/ match$0 = + /*<>*/ caml_call1(ys$0, 0); + if(! match$0) /*<>*/ return 0; + /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ _ay_ = /*<>*/ caml_call2(f, x, y); - /*<>*/ if(_ay_) /*<>*/ return _ay_; - var xs$0 = xs$1, ys$0 = ys$1; + /*<>*/ _ak_ = /*<>*/ caml_call2(f, x, y); + /*<>*/ if(_ak_) /*<>*/ return _ak_; + xs$0 = xs$1; + ys$0 = ys$1; } - /*<>*/ } + /*<>*/ } function equal(eq, xs, ys){ - /*<>*/ var xs$0 = xs, ys$0 = ys; - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ match = /*<>*/ caml_call1(xs$0, 0), - /*<>*/ match$0 = - /*<>*/ caml_call1(ys$0, 0); + /*<>*/ var xs$0 = xs, ys$0 = ys; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ match = /*<>*/ caml_call1(xs$0, 0), + /*<>*/ match$0 = + /*<>*/ caml_call1(ys$0, 0); if(match){ if(match$0){ - /*<>*/ var + /*<>*/ var ys$1 = match$0[2], y = match$0[1], xs$1 = match[2], x = match[1], - /*<>*/ _ax_ = - /*<>*/ caml_call2(eq, x, y); - /*<>*/ if(! _ax_) /*<>*/ return _ax_; - var xs$0 = xs$1, ys$0 = ys$1; + /*<>*/ _aj_ = + /*<>*/ caml_call2(eq, x, y); + /*<>*/ if(! _aj_) /*<>*/ return _aj_; + xs$0 = xs$1; + ys$0 = ys$1; continue; } } - else if(! match$0) /*<>*/ return 1; - /*<>*/ return 0; + else if(! match$0) /*<>*/ return 1; + /*<>*/ return 0; } - /*<>*/ } + /*<>*/ } function compare(cmp, xs, ys){ - /*<>*/ var xs$0 = xs, ys$0 = ys; - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ match = /*<>*/ caml_call1(xs$0, 0), - /*<>*/ match$0 = - /*<>*/ caml_call1(ys$0, 0); + /*<>*/ var xs$0 = xs, ys$0 = ys; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ match = /*<>*/ caml_call1(xs$0, 0), + /*<>*/ match$0 = + /*<>*/ caml_call1(ys$0, 0); if(! match) return match$0 ? -1 : 0; var xs$1 = match[2], x = match[1]; - if(! match$0) /*<>*/ return 1; - /*<>*/ var + if(! match$0) /*<>*/ return 1; + /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ c = /*<>*/ caml_call2(cmp, x, y); - /*<>*/ if(0 !== c) /*<>*/ return c; - var xs$0 = xs$1, ys$0 = ys$1; + /*<>*/ c = /*<>*/ caml_call2(cmp, x, y); + /*<>*/ if(0 !== c) /*<>*/ return c; + xs$0 = xs$1; + ys$0 = ys$1; } - /*<>*/ } + /*<>*/ } function init_aux(f, i, j, param){ - /*<>*/ if(i >= j) /*<>*/ return 0; - var _au_ = i + 1 | 0; - /*<>*/ function _av_(_aw_){ - /*<>*/ return init_aux(f, _au_, j, _aw_); - } - /*<>*/ return [0, - /*<>*/ caml_call1(f, i), - _av_]; - /*<>*/ } + /*<>*/ if(i >= j) /*<>*/ return 0; + var _ah_ = i + 1 | 0; + /*<>*/ return [0, + /*<>*/ caml_call1(f, i), + function(_ai_){ /*<>*/ return init_aux(f, _ah_, j, _ai_);}]; + /*<>*/ } function init(n, f){ - /*<>*/ if(0 > n) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 > n) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Seq_init); - var _as_ = 0; - /*<>*/ return function(_at_){ - /*<>*/ return init_aux(f, _as_, n, _at_);}; - /*<>*/ } + var _af_ = 0; + /*<>*/ return function(_ag_){ + /*<>*/ return init_aux(f, _af_, n, _ag_);}; + /*<>*/ } function repeat(x, param){ - /*<>*/ return [0, + /*<>*/ return [0, x, - function(_ar_){ /*<>*/ return repeat(x, _ar_);}]; - /*<>*/ } + function(_ae_){ /*<>*/ return repeat(x, _ae_);}]; + /*<>*/ } function forever(f, param){ - /*<>*/ function _ap_(_aq_){ - /*<>*/ return forever(f, _aq_); - } - /*<>*/ return [0, - /*<>*/ caml_call1(f, 0), - _ap_]; - /*<>*/ } + /*<>*/ return [0, + /*<>*/ caml_call1(f, 0), + function(_ad_){ /*<>*/ return forever(f, _ad_);}]; + /*<>*/ } function cycle_nonempty(xs, param){ - /*<>*/ /*<>*/ var _an_ = 0; - /*<>*/ return append + /*<>*/ return append (xs, - function(_ao_){ /*<>*/ return cycle_nonempty(xs, _ao_);}, - _an_); - /*<>*/ } + function(_ac_){ /*<>*/ return cycle_nonempty(xs, _ac_);}, + 0); + /*<>*/ } function cycle(xs, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; - /*<>*/ function _ak_(_am_){ - /*<>*/ return cycle_nonempty(xs, _am_); + /*<>*/ function _$_(_ab_){ + /*<>*/ return cycle_nonempty(xs, _ab_); } - /*<>*/ return [0, + /*<>*/ return [0, x, - function(_al_){ /*<>*/ return append(xs$0, _ak_, _al_);}]; - /*<>*/ } + function(_aa_){ /*<>*/ return append(xs$0, _$_, _aa_);}]; + /*<>*/ } function iterate1(f, x, param){ - /*<>*/ /*<>*/ var - y = /*<>*/ caml_call1(f, x); - /*<>*/ return [0, + /*<>*/ /*<>*/ var + y = /*<>*/ caml_call1(f, x); + /*<>*/ return [0, y, - function(_aj_){ /*<>*/ return iterate1(f, y, _aj_);}]; - /*<>*/ } + function(___){ /*<>*/ return iterate1(f, y, ___);}]; + /*<>*/ } function iterate(f, x){ - /*<>*/ function _ag_(_ai_){ - /*<>*/ return iterate1(f, x, _ai_); + /*<>*/ function next(_Z_){ + /*<>*/ return iterate1(f, x, _Z_); } - /*<>*/ return function(_ah_){ - /*<>*/ return [0, x, _ag_];}; - /*<>*/ } + /*<>*/ return function(_Y_){ + /*<>*/ return [0, x, next];}; + /*<>*/ } function mapi_aux(f, i, xs, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var - xs$0 = match[2], - x = match[1], - /*<>*/ _ad_ = i + 1 | 0; - /*<>*/ function _ae_(_af_){ - /*<>*/ return mapi_aux(f, _ad_, xs$0, _af_); - } - /*<>*/ return [0, - /*<>*/ caml_call2(f, i, x), - _ae_]; - /*<>*/ } + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; + var xs$0 = match[2], x = match[1], /*<>*/ _W_ = i + 1 | 0; + /*<>*/ return [0, + /*<>*/ caml_call2(f, i, x), + function(_X_){ /*<>*/ return mapi_aux(f, _W_, xs$0, _X_);}]; + /*<>*/ } function mapi(f, xs){ - /*<>*/ var _ab_ = 0; - /*<>*/ return function(_ac_){ - /*<>*/ return mapi_aux(f, _ab_, xs, _ac_);}; - /*<>*/ } + /*<>*/ var _U_ = 0; + /*<>*/ return function(_V_){ + /*<>*/ return mapi_aux(f, _U_, xs, _V_);}; + /*<>*/ } function tail_scan(f, s, xs, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$0 = match[2], x = match[1], - /*<>*/ s$0 = /*<>*/ caml_call2(f, s, x); - /*<>*/ return [0, + /*<>*/ s$0 = /*<>*/ caml_call2(f, s, x); + /*<>*/ return [0, s$0, - function(_aa_){ /*<>*/ return tail_scan(f, s$0, xs$0, _aa_);}]; - /*<>*/ } + function(_T_){ /*<>*/ return tail_scan(f, s$0, xs$0, _T_);}]; + /*<>*/ } function scan(f, s, xs){ - /*<>*/ function _Z_(_$_){ - /*<>*/ return tail_scan(f, s, xs, _$_); + /*<>*/ function next(_S_){ + /*<>*/ return tail_scan(f, s, xs, _S_); } - /*<>*/ return function(___){ - /*<>*/ return [0, s, _Z_];}; - /*<>*/ } + /*<>*/ return function(_R_){ + /*<>*/ return [0, s, next];}; + /*<>*/ } function take_aux(n, xs){ - /*<>*/ return 0 === n + /*<>*/ return 0 === n ? empty : function (param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; - /*<>*/ return [0, x, take_aux(n - 1 | 0, xs$0)]; - /*<>*/ }; - /*<>*/ } + /*<>*/ return [0, x, take_aux(n - 1 | 0, xs$0)]; + /*<>*/ }; + /*<>*/ } function take(n, xs){ - /*<>*/ if(n < 0) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ if(n < 0) + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Seq_take); - /*<>*/ return take_aux(n, xs); - /*<>*/ } + /*<>*/ return take_aux(n, xs); + /*<>*/ } function drop(n, xs){ - /*<>*/ return 0 <= n + /*<>*/ return 0 <= n ? 0 === n ? xs : function (param){ - /*<>*/ var n$0 = n, xs$0 = xs; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var n$0 = n, xs$0 = xs; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$1 = match[2], - /*<>*/ n$1 = n$0 - 1 | 0; - /*<>*/ if(0 === n$1) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ n$1 = n$0 - 1 | 0; + /*<>*/ if(0 === n$1) + /*<>*/ return /*<>*/ caml_call1 (xs$1, 0); - var n$0 = n$1, xs$0 = xs$1; + n$0 = n$1; + xs$0 = xs$1; } - /*<>*/ } - : /*<>*/ caml_call1(Stdlib[1], cst_Seq_drop); - /*<>*/ } + /*<>*/ } + : /*<>*/ caml_call1(Stdlib[1], cst_Seq_drop); + /*<>*/ } function take_while(p, xs, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; - /*<>*/ return /*<>*/ caml_call1(p, x) + /*<>*/ return /*<>*/ caml_call1(p, x) ? [0, x, - function(_Y_){ /*<>*/ return take_while(p, xs$0, _Y_);}] + function(_Q_){ /*<>*/ return take_while(p, xs$0, _Q_);}] : 0; - /*<>*/ } + /*<>*/ } function drop_while(p, xs, param){ - /*<>*/ var xs$0 = xs; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - node = /*<>*/ caml_call1(xs$0, 0); - if(! node) /*<>*/ return 0; + /*<>*/ var xs$0 = xs; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + node = /*<>*/ caml_call1(xs$0, 0); + if(! node) /*<>*/ return 0; var xs$1 = node[2], x = node[1]; - /*<>*/ if(! /*<>*/ caml_call1(p, x)) - /*<>*/ return node; - var xs$0 = xs$1; + /*<>*/ if(! /*<>*/ caml_call1(p, x)) + /*<>*/ return node; + xs$0 = xs$1; } - /*<>*/ } + /*<>*/ } function group(eq, xs, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; + var xs$0 = match[2], x = match[1], - /*<>*/ _P_ = /*<>*/ caml_call1(eq, x); - /*<>*/ function _Q_(_X_){ - /*<>*/ return drop_while(_P_, xs$0, _X_); - } - /*<>*/ function _R_(_W_){ - /*<>*/ return group(eq, _Q_, _W_); - } - /*<>*/ /*<>*/ var - _S_ = /*<>*/ caml_call1(eq, x); - /*<>*/ function _T_(_V_){ - /*<>*/ return take_while(_S_, xs$0, _V_); - } - /*<>*/ return [0, - function(_U_){ /*<>*/ return [0, x, _T_];}, - _R_]; - /*<>*/ } - /*<>*/ var - /*<>*/ Forced_twice = - [248, cst_Stdlib_Seq_Forced_twice, runtime.caml_fresh_oo_id(0)], - /*<>*/ to_lazy = Stdlib_Lazy[6]; + /*<>*/ _J_ = /*<>*/ caml_call1(eq, x); + /*<>*/ function _K_(_P_){ + /*<>*/ return drop_while(_J_, xs$0, _P_); + } + /*<>*/ var _L_ = /*<>*/ caml_call1(eq, x); + /*<>*/ function next(_O_){ + /*<>*/ return take_while(_L_, xs$0, _O_); + } + /*<>*/ return [0, + function(_N_){ /*<>*/ return [0, x, next];}, + function(_M_){ /*<>*/ return group(eq, _K_, _M_);}]; + /*<>*/ } + /*<>*/ var + /*<>*/ Forced_twice = + [248, "Stdlib.Seq.Forced_twice", runtime.caml_fresh_oo_id(0)], + /*<>*/ to_lazy = Stdlib_Lazy[6], + _a_ = [0, "seq.ml", 616, 4]; function failure(param){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Forced_twice, 1); - /*<>*/ } + /*<>*/ } function memoize(xs){ function s$0(param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; - /*<>*/ return [0, x, memoize(xs$0)]; - /*<>*/ } - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call1(to_lazy, s$0); - /*<>*/ return function(_O_){ - var _N_ = runtime.caml_obj_tag(s); - if(250 === _N_) return s[1]; - if(246 !== _N_ && 244 !== _N_) /*<>*/ return s; - /*<>*/ return /*<>*/ caml_call1 - (CamlinternalLazy[2], s);}; - /*<>*/ } + /*<>*/ return [0, x, memoize(xs$0)]; + /*<>*/ } + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call1(to_lazy, s$0); + /*<>*/ return function(param){ + /*<>*/ var _I_ = runtime.caml_obj_tag(s); + if(250 === _I_) return s[1]; + if(246 !== _I_ && 244 !== _I_) /*<>*/ return s; + /*<>*/ return /*<>*/ caml_call1 + (CamlinternalLazy[2], s); /*<>*/ }; + /*<>*/ } function once(xs){ function f(param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; - /*<>*/ return [0, x, once(xs$0)]; - /*<>*/ } - /*<>*/ /*<>*/ var - action = /*<>*/ caml_call1(Stdlib_Atomic[1], f); - /*<>*/ return function(param){ - /*<>*/ /*<>*/ var - f = /*<>*/ caml_call2(Stdlib_Atomic[4], action, failure); - /*<>*/ return /*<>*/ caml_call1(f, 0); /*<>*/ }; - /*<>*/ } + /*<>*/ return [0, x, once(xs$0)]; + /*<>*/ } + /*<>*/ /*<>*/ var + action = /*<>*/ caml_call1(Stdlib_Atomic[1], f); + /*<>*/ return function(param){ + /*<>*/ /*<>*/ var + f = /*<>*/ caml_call2(Stdlib_Atomic[5], action, failure); + /*<>*/ return /*<>*/ caml_call1(f, 0); /*<>*/ }; + /*<>*/ } function zip(xs, ys, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$0 = match[2], x = match[1], - /*<>*/ match$0 = /*<>*/ caml_call1(ys, 0); - if(! match$0) /*<>*/ return 0; + /*<>*/ match$0 = /*<>*/ caml_call1(ys, 0); + if(! match$0) /*<>*/ return 0; var ys$0 = match$0[2], y = match$0[1]; - /*<>*/ return [0, + /*<>*/ return [0, [0, x, y], - function(_M_){ /*<>*/ return zip(xs$0, ys$0, _M_);}]; - /*<>*/ } + function(_H_){ /*<>*/ return zip(xs$0, ys$0, _H_);}]; + /*<>*/ } function map2(f, xs, ys, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$0 = match[2], x = match[1], - /*<>*/ match$0 = /*<>*/ caml_call1(ys, 0); - if(! match$0) /*<>*/ return 0; + /*<>*/ match$0 = /*<>*/ caml_call1(ys, 0); + if(! match$0) /*<>*/ return 0; var ys$0 = match$0[2], y = match$0[1]; - /*<>*/ function _K_(_L_){ - /*<>*/ return map2(f, xs$0, ys$0, _L_); - } - /*<>*/ return [0, - /*<>*/ caml_call2(f, x, y), - _K_]; - /*<>*/ } + /*<>*/ return [0, + /*<>*/ caml_call2(f, x, y), + function(_G_){ /*<>*/ return map2(f, xs$0, ys$0, _G_);}]; + /*<>*/ } function interleave(xs, ys, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); if(! match) - /*<>*/ return /*<>*/ caml_call1(ys, 0); + /*<>*/ return /*<>*/ caml_call1(ys, 0); var xs$0 = match[2], x = match[1]; - /*<>*/ return [0, + /*<>*/ return [0, x, - function(_J_){ /*<>*/ return interleave(ys, xs$0, _J_);}]; - /*<>*/ } + function(_F_){ /*<>*/ return interleave(ys, xs$0, _F_);}]; + /*<>*/ } function sorted_merge1(cmp, x, xs, y, ys){ - /*<>*/ return 0 - < /*<>*/ caml_call2(cmp, x, y) + /*<>*/ return 0 + < /*<>*/ caml_call2(cmp, x, y) ? [0, y, - function(_H_){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(ys, 0); - if(! match) /*<>*/ return [0, x, xs]; + function(_D_){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(ys, 0); + if(! match) /*<>*/ return [0, x, xs]; var ys$0 = match[2], y = match[1]; - /*<>*/ return sorted_merge1(cmp, x, xs, y, ys$0); + /*<>*/ return sorted_merge1(cmp, x, xs, y, ys$0); }] : [0, x, - function(_I_){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs, 0); - if(! match) /*<>*/ return [0, y, ys]; + function(_E_){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs, 0); + if(! match) /*<>*/ return [0, y, ys]; var xs$0 = match[2], x = match[1]; - /*<>*/ return sorted_merge1(cmp, x, xs$0, y, ys); + /*<>*/ return sorted_merge1(cmp, x, xs$0, y, ys); }]; - /*<>*/ } + /*<>*/ } function sorted_merge(cmp, xs, ys, param){ - /*<>*/ var - /*<>*/ match = /*<>*/ caml_call1(xs, 0), - /*<>*/ match$0 = /*<>*/ caml_call1(ys, 0); + /*<>*/ var + /*<>*/ match = /*<>*/ caml_call1(xs, 0), + /*<>*/ match$0 = /*<>*/ caml_call1(ys, 0); if(match){ if(match$0){ var ys$0 = match$0[2], y = match$0[1], xs$0 = match[2], x = match[1]; - /*<>*/ return sorted_merge1(cmp, x, xs$0, y, ys$0); + /*<>*/ return sorted_merge1(cmp, x, xs$0, y, ys$0); } var c = match; } - else{if(! match$0) /*<>*/ return 0; var c = match$0;} - /*<>*/ return c; - /*<>*/ } + else{if(! match$0) /*<>*/ return 0; var c = match$0;} + /*<>*/ return c; + /*<>*/ } function map_fst(xys, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xys, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xys, 0); + if(! match) /*<>*/ return 0; var xys$0 = match[2], x = match[1][1]; - /*<>*/ return [0, + /*<>*/ return [0, x, - function(_G_){ /*<>*/ return map_fst(xys$0, _G_);}]; - /*<>*/ } + function(_C_){ /*<>*/ return map_fst(xys$0, _C_);}]; + /*<>*/ } function map_snd(xys, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xys, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xys, 0); + if(! match) /*<>*/ return 0; var xys$0 = match[2], y = match[1][2]; - /*<>*/ return [0, + /*<>*/ return [0, y, - function(_F_){ /*<>*/ return map_snd(xys$0, _F_);}]; - /*<>*/ } + function(_B_){ /*<>*/ return map_snd(xys$0, _B_);}]; + /*<>*/ } function unzip(xys){ - /*<>*/ function _C_(_E_){ - /*<>*/ return map_snd(xys, _E_); - } - /*<>*/ return [0, - function(_D_){ /*<>*/ return map_fst(xys, _D_);}, - _C_]; - /*<>*/ } + /*<>*/ return [0, + function(_A_){ /*<>*/ return map_fst(xys, _A_);}, + function(_z_){ /*<>*/ return map_snd(xys, _z_);}]; + /*<>*/ } function filter_map_find_left_map(f, xs, param){ - /*<>*/ var xs$0 = xs; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var xs$0 = xs; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ match$0 = /*<>*/ caml_call1(f, x); + /*<>*/ match$0 = /*<>*/ caml_call1(f, x); if(0 === match$0[0]){ var y = match$0[1]; - /*<>*/ return [0, + /*<>*/ return [0, y, - function(_B_){ - /*<>*/ return filter_map_find_left_map(f, xs$1, _B_); + function(_y_){ + /*<>*/ return filter_map_find_left_map(f, xs$1, _y_); }]; } - var xs$0 = xs$1; + xs$0 = xs$1; } - /*<>*/ } + /*<>*/ } function filter_map_find_right_map(f, xs, param){ - /*<>*/ var xs$0 = xs; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xs$0, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var xs$0 = xs; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xs$0, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ match$0 = /*<>*/ caml_call1(f, x); - if(0 === match$0[0]){var xs$0 = xs$1; continue;} - var z = match$0[1]; - /*<>*/ return [0, - z, - function(_A_){ - /*<>*/ return filter_map_find_right_map(f, xs$1, _A_); - }]; + /*<>*/ match$0 = /*<>*/ caml_call1(f, x); + if(0 !== match$0[0]){ + var z = match$0[1]; + /*<>*/ return [0, + z, + function(_x_){ + /*<>*/ return filter_map_find_right_map(f, xs$1, _x_); + }]; + } + xs$0 = xs$1; } - /*<>*/ } + /*<>*/ } function partition_map(f, xs){ - /*<>*/ function _x_(_z_){ - /*<>*/ return filter_map_find_right_map(f, xs, _z_); - } - /*<>*/ return [0, - function(_y_){ - /*<>*/ return filter_map_find_left_map(f, xs, _y_); + /*<>*/ return [0, + function(_w_){ + /*<>*/ return filter_map_find_left_map(f, xs, _w_); }, - _x_]; - /*<>*/ } + function(_v_){ + /*<>*/ return filter_map_find_right_map(f, xs, _v_); + }]; + /*<>*/ } function partition(p, xs){ - function _t_(x){ - /*<>*/ return 1 - /*<>*/ caml_call1(p, x); - /*<>*/ } - /*<>*/ function _u_(_w_){ - /*<>*/ return filter(_t_, xs, _w_); - } - /*<>*/ return [0, - function(_v_){ /*<>*/ return filter(p, xs, _v_);}, - _u_]; - /*<>*/ } + function _s_(x){ + /*<>*/ return 1 - /*<>*/ caml_call1(p, x); + /*<>*/ } + /*<>*/ return [0, + function(_u_){ /*<>*/ return filter(p, xs, _u_);}, + function(_t_){ /*<>*/ return filter(_s_, xs, _t_);}]; + /*<>*/ } function peel(xss){ - /*<>*/ return unzip - (function(_s_){ /*<>*/ return filter_map(uncons, xss, _s_);}); - /*<>*/ } + /*<>*/ return unzip + (function(_r_){ /*<>*/ return filter_map(uncons, xss, _r_);}); + /*<>*/ } function transpose(xss, param){ - /*<>*/ var - /*<>*/ match = peel(xss), + /*<>*/ var + /*<>*/ match = peel(xss), tails = match[2], heads = match[1]; - /*<>*/ if(! is_empty(heads)) - /*<>*/ return [0, + /*<>*/ if(! is_empty(heads)) + /*<>*/ return [0, heads, - function(_r_){ /*<>*/ return transpose(tails, _r_);}]; - /*<>*/ if(is_empty(tails)) /*<>*/ return 0; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + function(_q_){ /*<>*/ return transpose(tails, _q_);}]; + /*<>*/ if(is_empty(tails)) /*<>*/ return 0; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _a_], 1); - /*<>*/ } + /*<>*/ } function _b_(remainders, xss, param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(xss, 0); - if(! match) /*<>*/ return transpose(remainders, 0); - /*<>*/ var + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(xss, 0); + if(! match) /*<>*/ return transpose(remainders, 0); + /*<>*/ var xss$0 = match[2], xs = match[1], - /*<>*/ match$0 = /*<>*/ caml_call1(xs, 0); + /*<>*/ match$0 = /*<>*/ caml_call1(xs, 0); if(match$0){ - /*<>*/ var + /*<>*/ var xs$0 = match$0[2], x = match$0[1], - /*<>*/ match$1 = peel(remainders), + /*<>*/ match$1 = peel(remainders), tails = match$1[2], heads = match$1[1], - /*<>*/ _l_ = - function(_q_){ /*<>*/ return [0, xs$0, tails];}, - /*<>*/ _m_ = - function(_p_){ /*<>*/ return _b_(_l_, xss$0, _p_);}; - /*<>*/ return [0, - function(_o_){ /*<>*/ return [0, x, heads];}, - _m_]; - } - /*<>*/ var - /*<>*/ match$2 = peel(remainders), + /*<>*/ _l_ = + function(_p_){ /*<>*/ return [0, xs$0, tails];}; + /*<>*/ return [0, + function(_o_){ /*<>*/ return [0, x, heads];}, + function(_n_){ /*<>*/ return _b_(_l_, xss$0, _n_);}]; + } + /*<>*/ var + /*<>*/ match$2 = peel(remainders), tails$0 = match$2[2], heads$0 = match$2[1]; - /*<>*/ return [0, + /*<>*/ return [0, heads$0, - function(_n_){ /*<>*/ return _b_(tails$0, xss$0, _n_);}]; - /*<>*/ } + function(_m_){ /*<>*/ return _b_(tails$0, xss$0, _m_);}]; + /*<>*/ } function map_product(f, xs, ys){ function _f_(x){ function _j_(y){ - /*<>*/ return /*<>*/ caml_call2(f, x, y); - /*<>*/ } - /*<>*/ return function(_k_){ + /*<>*/ return /*<>*/ caml_call2(f, x, y); + /*<>*/ } + /*<>*/ return function(_k_){ /*<>*/ return map(_j_, ys, _k_);}; - /*<>*/ } - /*<>*/ function xss(_i_){ + /*<>*/ } + /*<>*/ function xss(_i_){ /*<>*/ return map(_f_, xs, _i_); } - /*<>*/ function _e_(_h_){ + /*<>*/ function _e_(_h_){ /*<>*/ return _b_(empty, xss, _h_); } - /*<>*/ return function(_g_){ + /*<>*/ return function(_g_){ /*<>*/ return concat(_e_, _g_);}; - /*<>*/ } + /*<>*/ } function product(xs, ys){ - /*<>*/ return map_product + /*<>*/ return map_product (function(x, y){ - /*<>*/ return [0, x, y]; - /*<>*/ }, + /*<>*/ return [0, x, y]; + /*<>*/ }, xs, ys); - /*<>*/ } + /*<>*/ } function of_dispenser(it){ function c(param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(it, 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(it, 0); + if(! match) /*<>*/ return 0; var x = match[1]; - /*<>*/ return [0, x, c]; - /*<>*/ } - /*<>*/ return c; - /*<>*/ } + /*<>*/ return [0, x, c]; + /*<>*/ } + /*<>*/ return c; + /*<>*/ } function to_dispenser(xs){ - /*<>*/ /*<>*/ var s = [0, xs]; - /*<>*/ return function(param){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(s[1], 0); - if(! match) /*<>*/ return 0; + /*<>*/ /*<>*/ var s = [0, xs]; + /*<>*/ return function(param){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(s[1], 0); + if(! match) /*<>*/ return 0; var xs = match[2], x = match[1]; s[1] = xs; - /*<>*/ return [0, x]; /*<>*/ }; - /*<>*/ } + /*<>*/ return [0, x]; /*<>*/ }; + /*<>*/ } function ints(i, param){ - /*<>*/ /*<>*/ var _c_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ /*<>*/ var _c_ = i + 1 | 0; + /*<>*/ return [0, i, function(_d_){ /*<>*/ return ints(_c_, _d_);}]; - /*<>*/ } + /*<>*/ } var Stdlib_Seq = [0, @@ -2552,7 +2537,9 @@ for_all, exists, find, + find_index, find_map, + find_mapi, iter2, fold_left2, for_all2, @@ -2624,8 +2611,7 @@ global_data = runtime.caml_get_global_data(), Stdlib_Seq = global_data.Stdlib__Seq, Stdlib = global_data.Stdlib, - cst_option_is_None = "option is None", - none = 0; + cst_option_is_None = "option is None"; function some(v){ /*<>*/ return [0, v]; /*<>*/ } @@ -2706,15 +2692,15 @@ /*<>*/ } function to_seq(param){ /*<>*/ if(! param) - /*<>*/ return Stdlib_Seq[18]; + /*<>*/ return Stdlib_Seq[20]; var v = param[1]; /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Seq[19], v); + (Stdlib_Seq[21], v); /*<>*/ } var Stdlib_Option = [0, - none, + 0, some, value, get, @@ -2755,8 +2741,8 @@ global_data = runtime.caml_get_global_data(), Stdlib_Seq = global_data.Stdlib__Seq, Stdlib = global_data.Stdlib, - cst_result_is_Ok = "result is Ok _", - cst_result_is_Error = "result is Error _"; + cst_result_is_Error = "result is Error _", + cst_result_is_Ok = "result is Ok _"; function ok(v){ /*<>*/ return [0, v]; /*<>*/ } @@ -2878,10 +2864,10 @@ /*<>*/ } function to_seq(param){ /*<>*/ if(0 !== param[0]) - /*<>*/ return Stdlib_Seq[18]; + /*<>*/ return Stdlib_Seq[20]; var v = param[1]; /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Seq[19], v); + (Stdlib_Seq[21], v); /*<>*/ } var Stdlib_Result = @@ -2913,28 +2899,37 @@ //# unitInfo: Provides: Stdlib__Bool (function(globalThis){ "use strict"; + var runtime = globalThis.jsoo_runtime, caml_hash = runtime.caml_hash; + function equal(_d_, _c_){ /*<>*/ return _d_ === _c_ ? 1 : 0;} var - runtime = globalThis.jsoo_runtime, + compare = runtime.caml_int_compare, cst_true = "true", cst_false = "false"; - function equal(_e_, _d_){ /*<>*/ return _e_ === _d_ ? 1 : 0;} - var compare = runtime.caml_int_compare; function to_float(param){ /*<>*/ return param ? 1. : 0.; /*<>*/ } function to_string(param){ /*<>*/ return param ? cst_true : cst_false; /*<>*/ } - function _a_(_c_){ /*<>*/ return _c_;} + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } + function hash(x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, 0, x); + /*<>*/ } var Stdlib_Bool = [0, function(_b_){ /*<>*/ return 1 - _b_;}, equal, compare, - _a_, + function(_a_){ /*<>*/ return _a_;}, to_float, - to_string]; + to_string, + seeded_hash, + hash]; runtime.caml_register_global(4, Stdlib_Bool, "Stdlib__Bool"); return; /*<>*/ } @@ -2949,6 +2944,7 @@ runtime = globalThis.jsoo_runtime, caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, caml_create_bytes = runtime.caml_create_bytes, + caml_hash = runtime.caml_hash, caml_string_of_bytes = runtime.caml_string_of_bytes; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 @@ -2960,11 +2956,11 @@ cst = "\\\\", cst$0 = "\\'", Stdlib = global_data.Stdlib, + cst_Char_chr = "Char.chr", cst_b = "\\b", cst_t = "\\t", cst_n = "\\n", - cst_r = "\\r", - cst_Char_chr = "Char.chr"; + cst_r = "\\r"; function chr(n){ /*<>*/ if(0 <= n && 255 >= n) /*<>*/ return n; @@ -2972,39 +2968,38 @@ (Stdlib[1], cst_Char_chr); /*<>*/ } function escaped(c){ - /*<>*/ var switch$0 = 0; - if(40 <= c){ - if(92 === c) /*<>*/ return cst; - if(127 > c) switch$0 = 1; - } - else if(32 <= c){ - if(39 <= c) /*<>*/ return cst$0; - switch$0 = 1; - } - else if(14 > c) - switch(c){ - case 8: - /*<>*/ return cst_b; - case 9: - /*<>*/ return cst_t; - case 10: - /*<>*/ return cst_n; - case 13: - /*<>*/ return cst_r; - } - if(switch$0){ - /*<>*/ /*<>*/ var - s$0 = /*<>*/ caml_create_bytes(1); - caml_bytes_unsafe_set(s$0, 0, c); - return caml_string_of_bytes(s$0); - } - /*<>*/ /*<>*/ var - s = /*<>*/ caml_create_bytes(4); - caml_bytes_unsafe_set(s, 0, 92); - caml_bytes_unsafe_set(s, 1, 48 + (c / 100 | 0) | 0); - caml_bytes_unsafe_set(s, 2, 48 + ((c / 10 | 0) % 10 | 0) | 0); - caml_bytes_unsafe_set(s, 3, 48 + (c % 10 | 0) | 0); - return caml_string_of_bytes(s); + /*<>*/ a: + { + if(40 <= c){ + if(92 === c) /*<>*/ return cst; + if(127 > c) break a; + } + else{ + if(32 <= c){if(39 <= c) /*<>*/ return cst$0; break a;} + if(14 > c) + switch(c){ + case 8: + /*<>*/ return cst_b; + case 9: + /*<>*/ return cst_t; + case 10: + /*<>*/ return cst_n; + case 13: + /*<>*/ return cst_r; + } + } + /*<>*/ /*<>*/ var + s = /*<>*/ caml_create_bytes(4); + caml_bytes_unsafe_set(s, 0, 92); + caml_bytes_unsafe_set(s, 1, 48 + (c / 100 | 0) | 0); + caml_bytes_unsafe_set(s, 2, 48 + ((c / 10 | 0) % 10 | 0) | 0); + caml_bytes_unsafe_set(s, 3, 48 + (c % 10 | 0) | 0); + return caml_string_of_bytes(s); + } + /*<>*/ /*<>*/ var + s$0 = /*<>*/ caml_create_bytes(1); + caml_bytes_unsafe_set(s$0, 0, c); + return caml_string_of_bytes(s$0); /*<>*/ } function lowercase_ascii(c){ /*<>*/ return 25 < c - 65 >>> 0 ? c : c + 32 | 0; @@ -3018,16 +3013,32 @@ function equal(c1, c2){ /*<>*/ return 0 === (c1 - c2 | 0) ? 1 : 0; /*<>*/ } + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } + function hash(x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, 0, x); + /*<>*/ } var Stdlib_Char = - [0, chr, escaped, lowercase_ascii, uppercase_ascii, compare, equal]; + [0, + chr, + escaped, + lowercase_ascii, + uppercase_ascii, + compare, + equal, + seeded_hash, + hash]; runtime.caml_register_global(8, Stdlib_Char, "Stdlib__Char"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Uchar -//# unitInfo: Requires: Assert_failure, Stdlib +//# unitInfo: Requires: Stdlib (function (globalThis){ "use strict"; @@ -3052,19 +3063,11 @@ err_no_succ = "U+10FFFF has no successor", Assert_failure = global_data.Assert_failure, Stdlib = global_data.Stdlib, - _d_ = [0, cst_uchar_ml, 88, 18], - _c_ = [0, cst_uchar_ml, 91, 7], - _b_ = [0, cst_uchar_ml, 80, 18], - _a_ = [0, cst_uchar_ml, 85, 7], + cst_is_not_an_Unicode_scalar_v = " is not an Unicode scalar value", cst_is_not_a_latin1_character = " is not a latin1 character", cst_U = "U+", - cst_is_not_an_Unicode_scalar_v = " is not an Unicode scalar value", - min = 0, - max = 1114111, lo_bound = 55295, - hi_bound = 57344, - bom = 65279, - rep = 65533; + hi_bound = 57344; function succ(u){ /*<>*/ return u === 55295 ? hi_bound @@ -3077,24 +3080,24 @@ /*<>*/ } function is_valid(i){ /*<>*/ var - _o_ = 0 <= i ? 1 : 0, - _p_ = _o_ ? i <= 55295 ? 1 : 0 : _o_; - if(_p_) - var _q_ = _p_; + _n_ = 0 <= i ? 1 : 0, + _o_ = _n_ ? i <= 55295 ? 1 : 0 : _n_; + if(_o_) + var _p_ = _o_; else - var _r_ = 57344 <= i ? 1 : 0, _q_ = _r_ ? i <= 1114111 ? 1 : 0 : _r_; - return _q_; + var _q_ = 57344 <= i ? 1 : 0, _p_ = _q_ ? i <= 1114111 ? 1 : 0 : _q_; + return _p_; /*<>*/ } function of_int(i){ /*<>*/ if(is_valid(i)) /*<>*/ return i; /*<>*/ /*<>*/ var - _n_ = + _m_ = /*<>*/ caml_call2 (Stdlib[28], /*<>*/ caml_format_int("%X", i), cst_is_not_an_Unicode_scalar_v); /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], _n_); + (Stdlib[1], _m_); /*<>*/ } function is_char(u){ /*<>*/ return u < 256 ? 1 : 0; @@ -3105,20 +3108,25 @@ function to_char(u){ /*<>*/ if(255 >= u) /*<>*/ return u; /*<>*/ var - /*<>*/ _l_ = + /*<>*/ _k_ = /*<>*/ caml_call2 (Stdlib[28], /*<>*/ caml_format_int("%04X", u), cst_is_not_a_latin1_character), - /*<>*/ _m_ = - /*<>*/ caml_call2(Stdlib[28], cst_U, _l_); + /*<>*/ _l_ = + /*<>*/ caml_call2(Stdlib[28], cst_U, _k_); /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], _m_); + (Stdlib[1], _l_); /*<>*/ } - function unsafe_to_char(_k_){ /*<>*/ return _k_;} - function equal(_j_, _i_){ /*<>*/ return _j_ === _i_ ? 1 : 0;} - var compare = runtime.caml_int_compare; - function hash(_h_){ /*<>*/ return _h_;} + function unsafe_to_char(_j_){ /*<>*/ return _j_;} + function equal(_i_, _h_){ /*<>*/ return _i_ === _h_ ? 1 : 0;} + var + compare = runtime.caml_int_compare, + _a_ = [0, cst_uchar_ml, 85, 7], + _b_ = [0, cst_uchar_ml, 80, 18], + _c_ = [0, cst_uchar_ml, 91, 7], + _d_ = [0, cst_uchar_ml, 88, 18]; + function hash(_g_){ /*<>*/ return _g_;} function utf_decode_is_valid(d){ /*<>*/ return 1 === (d >>> 27 | 0) ? 1 : 0; /*<>*/ } @@ -3156,20 +3164,19 @@ ([0, Assert_failure, _c_], 1); /*<>*/ return 4; /*<>*/ } - function _e_(_g_){ /*<>*/ return _g_;} var Stdlib_Uchar = [0, - min, - max, - bom, - rep, + 0, + 1114111, + 65279, + 65533, succ, pred, is_valid, of_int, function(_f_){ /*<>*/ return _f_;}, - _e_, + function(_e_){ /*<>*/ return _e_;}, is_char, of_char, to_char, @@ -3190,12 +3197,13 @@ (globalThis)); //# unitInfo: Provides: Stdlib__List -//# unitInfo: Requires: Stdlib, Stdlib__Seq, Stdlib__Sys +//# unitInfo: Requires: Stdlib (function (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, + cst_List_map2$1 = "List.map2", cst_List_nth$1 = "List.nth", caml_compare = runtime.caml_compare, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; @@ -3217,32 +3225,20 @@ var global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, - Stdlib_Seq = global_data.Stdlib__Seq, - Stdlib_Sys = global_data.Stdlib__Sys, - cst_List_map2 = "List.map2", - cst_List_iter2 = "List.iter2", - cst_List_fold_left2 = "List.fold_left2", - cst_List_fold_right2 = "List.fold_right2", - cst_List_for_all2 = "List.for_all2", - cst_List_exists2 = "List.exists2", - _b_ = [0, 0, 0], - cst_List_combine = "List.combine", - cst_List_rev_map2 = "List.rev_map2", - cst_List_init = "List.init", - cst_List_nth$0 = cst_List_nth$1, + cst_hd = "hd", + cst_tl = "tl", cst_nth = "nth", cst_List_nth = cst_List_nth$1, - cst_tl = "tl", - cst_hd = "hd"; + cst_List_nth$0 = cst_List_nth$1; function length(l$0){ /*<>*/ var len = 0, param = l$0; for(;;){ if(! param) /*<>*/ return len; /*<>*/ var l = param[2], - /*<>*/ len$0 = len + 1 | 0, - len = len$0, - param = l; + /*<>*/ len$0 = len + 1 | 0; + len = len$0; + param = l; } /*<>*/ } function cons(a, l){ @@ -3273,10 +3269,9 @@ (Stdlib[2], cst_nth); var l$1 = l$0[2], a = l$0[1]; /*<>*/ if(0 === n$0) /*<>*/ return a; - /*<>*/ var - /*<>*/ n$1 = n$0 - 1 | 0, - l$0 = l$1, - n$0 = n$1; + /*<>*/ /*<>*/ var n$1 = n$0 - 1 | 0; + l$0 = l$1; + n$0 = n$1; } /*<>*/ } function nth_opt(l, n){ @@ -3289,13 +3284,24 @@ var l$1 = l$0[2], a = l$0[1]; /*<>*/ if(0 === n$0) /*<>*/ return [0, a]; - /*<>*/ var - /*<>*/ n$1 = n$0 - 1 | 0, - l$0 = l$1, - n$0 = n$1; + /*<>*/ /*<>*/ var n$1 = n$0 - 1 | 0; + l$0 = l$1; + n$0 = n$1; } /*<>*/ } - var append = Stdlib[37]; + var + append = Stdlib[37], + cst_List_init = "List.init", + cst_List_map2 = cst_List_map2$1, + cst_List_map2$0 = cst_List_map2$1, + cst_List_rev_map2 = "List.rev_map2", + cst_List_iter2 = "List.iter2", + cst_List_fold_left2 = "List.fold_left2", + cst_List_fold_right2 = "List.fold_right2", + cst_List_for_all2 = "List.for_all2", + cst_List_exists2 = "List.exists2", + _a_ = [0, 0, 0], + cst_List_combine = "List.combine"; function rev_append(l1, l2){ /*<>*/ var l1$0 = l1, l2$0 = l2; /*<>*/ for(;;){ @@ -3303,371 +3309,527 @@ /*<>*/ var l1$1 = l1$0[2], a = l1$0[1], - /*<>*/ l2$1 = [0, a, l2$0], - l1$0 = l1$1, - l2$0 = l2$1; + /*<>*/ l2$1 = [0, a, l2$0]; + l1$0 = l1$1; + l2$0 = l2$1; } /*<>*/ } function rev(l){ /*<>*/ return rev_append(l, 0); /*<>*/ } - function init_aux(i, n, f){ - /*<>*/ if(n <= i) /*<>*/ return 0; - /*<>*/ /*<>*/ var - r = /*<>*/ caml_call1(f, i); - /*<>*/ return [0, r, init_aux(i + 1 | 0, n, f)]; - /*<>*/ } - var rev_init_threshold = typeof Stdlib_Sys[5] === "number" ? 10000 : 50; function init(len, f){ - /*<>*/ if(0 > len) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 > len) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_init); - if(rev_init_threshold >= len) - /*<>*/ return init_aux(0, len, f); - var acc = 0, i = 0; + var last = len - 1 | 0, i$1 = 0; + if(last < 0) /*<>*/ return 0; + if(0 === last) + /*<>*/ return [0, + /*<>*/ caml_call1(f, i$1), + 0]; + /*<>*/ var + /*<>*/ r1 = /*<>*/ caml_call1(f, i$1), + /*<>*/ r2 = /*<>*/ caml_call1(f, 1), + /*<>*/ block = [0, r2, 24029], + dst = block, + offset = 1, + i = 2; /*<>*/ for(;;){ - if(len <= i) /*<>*/ return rev(acc); - /*<>*/ var - i$0 = i + 1 | 0, - /*<>*/ acc$0 = - [0, /*<>*/ caml_call1(f, i), acc], - acc = acc$0, - i = i$0; + if(last < i) + dst[1 + offset] = 0; + else{ + if(i !== last){ + /*<>*/ var + /*<>*/ r1$0 = /*<>*/ caml_call1(f, i), + /*<>*/ r2$0 = + /*<>*/ caml_call1(f, i + 1 | 0), + /*<>*/ dst$0 = [0, r2$0, 24029]; + dst[1 + offset] = [0, r1$0, dst$0]; + var i$0 = i + 2 | 0; + dst = dst$0; + offset = 1; + i = i$0; + continue; + } + dst[1 + offset] = [0, /*<>*/ caml_call1(f, i), 0]; + } + /*<>*/ return [0, r1, block]; } - /*<>*/ } + /*<>*/ } function flatten(param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ var r = param[2], l = param[1], - /*<>*/ _J_ = flatten(r); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[37], l, _J_); - /*<>*/ } + /*<>*/ _I_ = flatten(r); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[37], l, _I_); + /*<>*/ } function map(f, param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var - l = param[2], - a = param[1], - /*<>*/ r = /*<>*/ caml_call1(f, a); - /*<>*/ return [0, r, map(f, l)]; - } - function _a_(i, f, param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var - l = param[2], - a = param[1], - /*<>*/ r = /*<>*/ caml_call2(f, i, a); - /*<>*/ return [0, r, _a_(i + 1 | 0, f, l)]; + /*<>*/ if(! param) /*<>*/ return 0; + var match = param[2], a1 = param[1]; + if(! match){ + /*<>*/ /*<>*/ var + r1$0 = /*<>*/ caml_call1(f, a1); + /*<>*/ return [0, r1$0, 0]; + } + /*<>*/ var + l = match[2], + a2 = match[1], + /*<>*/ r1 = /*<>*/ caml_call1(f, a1), + /*<>*/ r2 = /*<>*/ caml_call1(f, a2), + /*<>*/ block = [0, r2, 24029], + dst = block, + offset = 1, + param$0 = l; + for(;;){ + if(param$0){ + var match$0 = param$0[2], a1$0 = param$0[1]; + if(match$0){ + /*<>*/ var + l$0 = match$0[2], + a2$0 = match$0[1], + /*<>*/ r1$1 = + /*<>*/ caml_call1(f, a1$0), + /*<>*/ r2$0 = + /*<>*/ caml_call1(f, a2$0), + /*<>*/ dst$0 = [0, r2$0, 24029]; + dst[1 + offset] = [0, r1$1, dst$0]; + dst = dst$0; + offset = 1; + param$0 = l$0; + continue; + } + /*<>*/ /*<>*/ var + r1$2 = /*<>*/ caml_call1(f, a1$0); + dst[1 + offset] = [0, r1$2, 0]; + } + else + dst[1 + offset] = 0; + /*<>*/ return [0, r1, block]; + } } - function mapi(f, l){ - /*<>*/ return _a_(0, f, l); - /*<>*/ } + function mapi(f, l$1){ + /*<>*/ var i$1 = 0; + if(! l$1) /*<>*/ return 0; + var match = l$1[2], a1 = l$1[1]; + if(! match){ + /*<>*/ /*<>*/ var + r1$0 = /*<>*/ caml_call2(f, i$1, a1); + /*<>*/ return [0, r1$0, 0]; + } + /*<>*/ var + l = match[2], + a2 = match[1], + /*<>*/ r1 = /*<>*/ caml_call2(f, i$1, a1), + /*<>*/ r2 = /*<>*/ caml_call2(f, 1, a2), + /*<>*/ block = [0, r2, 24029], + dst = block, + offset = 1, + i = 2, + param = l; + for(;;){ + if(param){ + var match$0 = param[2], a1$0 = param[1]; + if(match$0){ + /*<>*/ var + l$0 = match$0[2], + a2$0 = match$0[1], + /*<>*/ r1$1 = + /*<>*/ caml_call2(f, i, a1$0), + /*<>*/ r2$0 = + /*<>*/ caml_call2(f, i + 1 | 0, a2$0), + /*<>*/ dst$0 = [0, r2$0, 24029]; + dst[1 + offset] = [0, r1$1, dst$0]; + var i$0 = i + 2 | 0; + dst = dst$0; + offset = 1; + i = i$0; + param = l$0; + continue; + } + /*<>*/ /*<>*/ var + r1$2 = /*<>*/ caml_call2(f, i, a1$0); + dst[1 + offset] = [0, r1$2, 0]; + } + else + dst[1 + offset] = 0; + /*<>*/ return [0, r1, block]; + } + /*<>*/ } function rev_map(f, l){ - /*<>*/ var accu = 0, param = l; + /*<>*/ var accu = 0, param = l; for(;;){ - if(! param) /*<>*/ return accu; - /*<>*/ var + if(! param) /*<>*/ return accu; + /*<>*/ var l$0 = param[2], a = param[1], - /*<>*/ accu$0 = - [0, /*<>*/ caml_call1(f, a), accu], - accu = accu$0, - param = l$0; + /*<>*/ accu$0 = + [0, /*<>*/ caml_call1(f, a), accu]; + accu = accu$0; + param = l$0; } - /*<>*/ } + /*<>*/ } function iter(f, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var l = param$0[2], a = param$0[1]; - /*<>*/ /*<>*/ caml_call1(f, a); - var param$0 = l; + /*<>*/ /*<>*/ caml_call1(f, a); + param$0 = l; } } function iteri(f, l$0){ - /*<>*/ var i = 0, param = l$0; + /*<>*/ var i = 0, param = l$0; for(;;){ - if(! param) /*<>*/ return 0; + if(! param) /*<>*/ return 0; var l = param[2], a = param[1]; - /*<>*/ /*<>*/ caml_call2(f, i, a); - var i$0 = i + 1 | 0, i = i$0, param = l; + /*<>*/ /*<>*/ caml_call2(f, i, a); + var i$0 = i + 1 | 0; + i = i$0; + param = l; } - /*<>*/ } + /*<>*/ } function fold_left(f, accu, l){ - /*<>*/ var accu$0 = accu, l$0 = l; - /*<>*/ for(;;){ - if(! l$0) /*<>*/ return accu$0; - /*<>*/ var + /*<>*/ var accu$0 = accu, l$0 = l; + /*<>*/ for(;;){ + if(! l$0) /*<>*/ return accu$0; + /*<>*/ var l$1 = l$0[2], a = l$0[1], - /*<>*/ accu$1 = - /*<>*/ caml_call2(f, accu$0, a), - accu$0 = accu$1, - l$0 = l$1; + /*<>*/ accu$1 = + /*<>*/ caml_call2(f, accu$0, a); + accu$0 = accu$1; + l$0 = l$1; } - /*<>*/ } + /*<>*/ } function fold_right(f, l, accu){ - /*<>*/ if(! l) /*<>*/ return accu; + /*<>*/ if(! l) /*<>*/ return accu; var l$0 = l[2], a = l[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (f, a, fold_right(f, l$0, accu)); - /*<>*/ } + /*<>*/ } function map2(f, l1, l2){ - /*<>*/ if(l1){ - if(l2){ - /*<>*/ var - l2$0 = l2[2], - a2 = l2[1], - l1$0 = l1[2], - a1 = l1[1], - /*<>*/ r = - /*<>*/ caml_call2(f, a1, a2); - /*<>*/ return [0, r, map2(f, l1$0, l2$0)]; - } - } - else if(! l2) /*<>*/ return 0; - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(l1){ + var _G_ = l1[2], a1 = l1[1]; + if(_G_){ + if(l2){ + var match = l2[2]; + if(match){ + /*<>*/ var + l2$0 = match[2], + b2 = match[1], + b1 = l2[1], + l1$0 = _G_[2], + a2 = _G_[1], + /*<>*/ r1 = + /*<>*/ caml_call2(f, a1, b1), + /*<>*/ r2 = + /*<>*/ caml_call2(f, a2, b2), + /*<>*/ block = [0, r2, 24029], + dst = block, + offset = 1, + l1$1 = l1$0, + l2$1 = l2$0; + /*<>*/ for(;;){ + a: + { + if(l1$1){ + var _H_ = l1$1[2], a1$0 = l1$1[1]; + if(_H_){ + if(l2$1){ + var match$0 = l2$1[2]; + if(match$0){ + /*<>*/ var + l2$2 = match$0[2], + b2$0 = match$0[1], + b1$1 = l2$1[1], + l1$2 = _H_[2], + a2$0 = _H_[1], + /*<>*/ r1$1 = + /*<>*/ caml_call2(f, a1$0, b1$1), + /*<>*/ r2$0 = + /*<>*/ caml_call2(f, a2$0, b2$0), + /*<>*/ dst$0 = [0, r2$0, 24029]; + dst[1 + offset] = [0, r1$1, dst$0]; + dst = dst$0; + offset = 1; + l1$1 = l1$2; + l2$1 = l2$2; + continue; + } + } + } + else if(l2$1 && ! l2$1[2]){ + /*<>*/ var + b1$2 = l2$1[1], + /*<>*/ r1$2 = + /*<>*/ caml_call2(f, a1$0, b1$2); + dst[1 + offset] = [0, r1$2, 0]; + break a; + } + } + else if(! l2$1){dst[1 + offset] = 0; break a;} + dst[1 + offset] = caml_call1(Stdlib[1], cst_List_map2$0); + } + /*<>*/ return [0, r1, block]; + } + } + } + } + else if(l2 && ! l2[2]){ + /*<>*/ var + b1$0 = l2[1], + /*<>*/ r1$0 = + /*<>*/ caml_call2(f, a1, b1$0); + /*<>*/ return [0, r1$0, 0]; + } + } + else if(! l2) /*<>*/ return 0; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_map2); - /*<>*/ } + /*<>*/ } function rev_map2(f, l1, l2){ - /*<>*/ var accu = 0, l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var accu = 0, l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(l1$0){ if(l2$0){ - /*<>*/ var + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1], - /*<>*/ accu$0 = - [0, /*<>*/ caml_call2(f, a1, a2), accu], - accu = accu$0, - l1$0 = l1$1, - l2$0 = l2$1; + /*<>*/ accu$0 = + [0, /*<>*/ caml_call2(f, a1, a2), accu]; + accu = accu$0; + l1$0 = l1$1; + l2$0 = l2$1; continue; } } - else if(! l2$0) /*<>*/ return accu; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2$0) /*<>*/ return accu; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_rev_map2); } - /*<>*/ } + /*<>*/ } function iter2(f, l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(l1$0){ if(l2$0){ var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1]; - /*<>*/ /*<>*/ caml_call2(f, a1, a2); - var l1$0 = l1$1, l2$0 = l2$1; + /*<>*/ /*<>*/ caml_call2(f, a1, a2); + l1$0 = l1$1; + l2$0 = l2$1; continue; } } - else if(! l2$0) /*<>*/ return 0; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2$0) /*<>*/ return 0; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_iter2); } - /*<>*/ } + /*<>*/ } function fold_left2(f, accu, l1, l2){ - /*<>*/ var accu$0 = accu, l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var accu$0 = accu, l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(l1$0){ if(l2$0){ - /*<>*/ var + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1], - /*<>*/ accu$1 = - /*<>*/ caml_call3(f, accu$0, a1, a2), - accu$0 = accu$1, - l1$0 = l1$1, - l2$0 = l2$1; + /*<>*/ accu$1 = + /*<>*/ caml_call3(f, accu$0, a1, a2); + accu$0 = accu$1; + l1$0 = l1$1; + l2$0 = l2$1; continue; } } - else if(! l2$0) /*<>*/ return accu$0; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2$0) /*<>*/ return accu$0; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_fold_left2); } - /*<>*/ } + /*<>*/ } function fold_right2(f, l1, l2, accu){ - /*<>*/ if(l1){ + /*<>*/ if(l1){ if(l2){ var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (f, a1, a2, fold_right2(f, l1$0, l2$0, accu)); } } - else if(! l2) /*<>*/ return accu; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2) /*<>*/ return accu; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_fold_right2); - /*<>*/ } + /*<>*/ } function for_all(p, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 1; - /*<>*/ var + if(! param$0) /*<>*/ return 1; + /*<>*/ var l = param$0[2], a = param$0[1], - /*<>*/ _I_ = /*<>*/ caml_call1(p, a); - /*<>*/ if(! _I_) /*<>*/ return _I_; - var param$0 = l; + /*<>*/ _F_ = /*<>*/ caml_call1(p, a); + /*<>*/ if(! _F_) /*<>*/ return _F_; + param$0 = l; } } function exists(p, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var l = param$0[2], a = param$0[1], - /*<>*/ _H_ = /*<>*/ caml_call1(p, a); - /*<>*/ if(_H_) /*<>*/ return _H_; - var param$0 = l; + /*<>*/ _E_ = /*<>*/ caml_call1(p, a); + /*<>*/ if(_E_) /*<>*/ return _E_; + param$0 = l; } } function for_all2(p, l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(l1$0){ if(l2$0){ - /*<>*/ var + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1], - /*<>*/ _G_ = - /*<>*/ caml_call2(p, a1, a2); - /*<>*/ if(! _G_) /*<>*/ return _G_; - var l1$0 = l1$1, l2$0 = l2$1; + /*<>*/ _D_ = + /*<>*/ caml_call2(p, a1, a2); + /*<>*/ if(! _D_) /*<>*/ return _D_; + l1$0 = l1$1; + l2$0 = l2$1; continue; } } - else if(! l2$0) /*<>*/ return 1; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2$0) /*<>*/ return 1; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_for_all2); } - /*<>*/ } + /*<>*/ } function exists2(p, l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(l1$0){ if(l2$0){ - /*<>*/ var + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1], - /*<>*/ _F_ = - /*<>*/ caml_call2(p, a1, a2); - /*<>*/ if(_F_) /*<>*/ return _F_; - var l1$0 = l1$1, l2$0 = l2$1; + /*<>*/ _C_ = + /*<>*/ caml_call2(p, a1, a2); + /*<>*/ if(_C_) /*<>*/ return _C_; + l1$0 = l1$1; + l2$0 = l2$1; continue; } } - else if(! l2$0) /*<>*/ return 0; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2$0) /*<>*/ return 0; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_exists2); } - /*<>*/ } + /*<>*/ } function mem(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var l = param$0[2], a = param$0[1], - _E_ = 0 === /*<>*/ caml_compare(a, x) ? 1 : 0; - if(_E_) return _E_; - var param$0 = l; + _B_ = 0 === /*<>*/ caml_compare(a, x) ? 1 : 0; + if(_B_) return _B_; + param$0 = l; } } function memq(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - var l = param$0[2], a = param$0[1], _D_ = a === x ? 1 : 0; - if(_D_) return _D_; - var param$0 = l; + if(! param$0) /*<>*/ return 0; + var l = param$0[2], a = param$0[1], _A_ = a === x ? 1 : 0; + if(_A_) return _A_; + param$0 = l; } } function assoc(x, param){ var param$0 = param; for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; - /*<>*/ if - (0 === /*<>*/ caml_compare(a, x)) - /*<>*/ return b; - var param$0 = l; + /*<>*/ if + (0 === /*<>*/ caml_compare(a, x)) + /*<>*/ return b; + param$0 = l; } } function assoc_opt(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; - /*<>*/ if - (0 === /*<>*/ caml_compare(a, x)) - /*<>*/ return [0, b]; - var param$0 = l; + /*<>*/ if + (0 === /*<>*/ caml_compare(a, x)) + /*<>*/ return [0, b]; + param$0 = l; } } function assq(x, param){ var param$0 = param; for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; - if(a === x) /*<>*/ return b; - var param$0 = l; + if(a === x) /*<>*/ return b; + param$0 = l; } } function assq_opt(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; - if(a === x) /*<>*/ return [0, b]; - var param$0 = l; + if(a === x) /*<>*/ return [0, b]; + param$0 = l; } } function mem_assoc(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var l = param$0[2], a = param$0[1][1], - _C_ = 0 === /*<>*/ caml_compare(a, x) ? 1 : 0; - if(_C_) return _C_; - var param$0 = l; + _z_ = 0 === /*<>*/ caml_compare(a, x) ? 1 : 0; + if(_z_) return _z_; + param$0 = l; } } function mem_assq(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - var l = param$0[2], a = param$0[1][1], _B_ = a === x ? 1 : 0; - if(_B_) return _B_; - var param$0 = l; + if(! param$0) /*<>*/ return 0; + var l = param$0[2], a = param$0[1][1], _y_ = a === x ? 1 : 0; + if(_y_) return _y_; + param$0 = l; } } function remove_assoc(x, param){ - /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ if(! param) /*<>*/ return 0; var l = param[2], pair = param[1], a = pair[1]; - /*<>*/ return 0 - === /*<>*/ caml_compare(a, x) + /*<>*/ return 0 + === /*<>*/ caml_compare(a, x) ? l : [0, pair, remove_assoc(x, l)]; } function remove_assq(x, param){ - /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ if(! param) /*<>*/ return 0; var l = param[2], pair = param[1], a = pair[1]; return a === x ? l : [0, pair, remove_assq(x, l)]; } @@ -3675,741 +3837,891 @@ var param$0 = param; for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var l = param$0[2], x = param$0[1]; - /*<>*/ if( /*<>*/ caml_call1(p, x)) - /*<>*/ return x; - var param$0 = l; + /*<>*/ if( /*<>*/ caml_call1(p, x)) + /*<>*/ return x; + param$0 = l; } } function find_opt(p, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var l = param$0[2], x = param$0[1]; - /*<>*/ if( /*<>*/ caml_call1(p, x)) - /*<>*/ return [0, x]; - var param$0 = l; + /*<>*/ if( /*<>*/ caml_call1(p, x)) + /*<>*/ return [0, x]; + param$0 = l; } } + function find_index(p){ + /*<>*/ /*<>*/ var i = 0; + /*<>*/ return function(param$0){ + var i$0 = i, param = param$0; + for(;;){ + if(! param) /*<>*/ return 0; + var l = param[2], a = param[1]; + /*<>*/ if( /*<>*/ caml_call1(p, a)) + /*<>*/ return [0, i$0]; + var i$1 = i$0 + 1 | 0; + i$0 = i$1; + param = l; + }}; + /*<>*/ } function find_map(f, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var l = param$0[2], x = param$0[1], - /*<>*/ result = - /*<>*/ caml_call1(f, x); - if(result) /*<>*/ return result; - var param$0 = l; + /*<>*/ result = + /*<>*/ caml_call1(f, x); + if(result) /*<>*/ return result; + param$0 = l; } } - function find_all(p){ - /*<>*/ /*<>*/ var accu = 0; - /*<>*/ return function(param$0){ - var accu$0 = accu, param = param$0; + function find_mapi(f){ + /*<>*/ /*<>*/ var i = 0; + /*<>*/ return function(param$0){ + var i$0 = i, param = param$0; for(;;){ - if(! param) /*<>*/ return rev(accu$0); - var l = param[2], x = param[1]; - /*<>*/ if( /*<>*/ caml_call1(p, x)){ - /*<>*/ var - /*<>*/ accu$1 = [0, x, accu$0], - accu$0 = accu$1, - param = l; - continue; - } - var param = l; + if(! param) /*<>*/ return 0; + /*<>*/ var + l = param[2], + x = param[1], + /*<>*/ result = + /*<>*/ caml_call2(f, i$0, x); + if(result) /*<>*/ return result; + var i$1 = i$0 + 1 | 0; + i$0 = i$1; + param = l; }}; - /*<>*/ } - function filteri(p, l){ - /*<>*/ var i = 0, acc = 0, param = l; + /*<>*/ } + function find_all(p, param){ + var param$0 = param; for(;;){ - if(! param) /*<>*/ return rev(acc); - /*<>*/ var - l$0 = param[2], + if(! param$0) /*<>*/ return 0; + var l = param$0[2], x = param$0[1]; + /*<>*/ if( /*<>*/ caml_call1(p, x)){ + /*<>*/ var + /*<>*/ block = [0, x, 24029], + dst = block, + offset = 1, + param$1 = l; + for(;;){ + if(! param$1){ + dst[1 + offset] = 0; + /*<>*/ return block; + } + var l$0 = param$1[2], x$0 = param$1[1]; + /*<>*/ if( /*<>*/ caml_call1(p, x$0)){ + /*<>*/ /*<>*/ var + dst$0 = [0, x$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + param$1 = l$0; + } + else + param$1 = l$0; + } + } + else + param$0 = l; + } + } + function filteri(p, l$1){ + /*<>*/ var i = 0, param = l$1; + for(;;){ + if(! param) /*<>*/ return 0; + /*<>*/ var + l = param[2], x = param[1], - /*<>*/ acc$0 = - /*<>*/ caml_call2(p, i, x) ? [0, x, acc] : acc, - i$0 = i + 1 | 0, - i = i$0, - acc = acc$0, - param = l$0; + /*<>*/ i$0 = i + 1 | 0; + /*<>*/ if( /*<>*/ caml_call2(p, i, x)) + break; + i = i$0; + param = l; } - /*<>*/ } - function filter_map(f){ - /*<>*/ /*<>*/ var accu = 0; - /*<>*/ return function(param$0){ - var accu$0 = accu, param = param$0; - for(;;){ - if(! param) /*<>*/ return rev(accu$0); - /*<>*/ var - l = param[2], - x = param[1], - /*<>*/ match = - /*<>*/ caml_call1(f, x); - if(match){ - /*<>*/ var - v = match[1], - /*<>*/ accu$1 = [0, v, accu$0], - accu$0 = accu$1, - param = l; - continue; + /*<>*/ var + /*<>*/ block = [0, x, 24029], + dst = block, + offset = 1, + i$1 = i$0, + param$0 = l; + for(;;){ + if(! param$0){dst[1 + offset] = 0; /*<>*/ return block;} + /*<>*/ var + l$0 = param$0[2], + x$0 = param$0[1], + /*<>*/ i$2 = i$1 + 1 | 0; + /*<>*/ if( /*<>*/ caml_call2(p, i$1, x$0)){ + /*<>*/ /*<>*/ var + dst$0 = [0, x$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + i$1 = i$2; + param$0 = l$0; + } + else{i$1 = i$2; param$0 = l$0;} + } + /*<>*/ } + function filter_map(f, param){ + var param$0 = param; + for(;;){ + if(! param$0) /*<>*/ return 0; + /*<>*/ var + l = param$0[2], + x = param$0[1], + /*<>*/ match = /*<>*/ caml_call1(f, x); + if(match){ + /*<>*/ var + v = match[1], + /*<>*/ block = [0, v, 24029], + dst = block, + offset = 1, + param$1 = l; + for(;;){ + if(! param$1){ + dst[1 + offset] = 0; + /*<>*/ return block; + } + /*<>*/ var + l$0 = param$1[2], + x$0 = param$1[1], + /*<>*/ match$0 = + /*<>*/ caml_call1(f, x$0); + if(match$0){ + /*<>*/ var + v$0 = match$0[1], + /*<>*/ dst$0 = [0, v$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + param$1 = l$0; + } + else + param$1 = l$0; } - var param = l; - }}; - /*<>*/ } - function concat_map(f, l){ - /*<>*/ var acc = 0, param = l; + } + else + param$0 = l; + } + } + function concat_map(f, param){ + var param$0 = param; for(;;){ - if(! param) /*<>*/ return rev(acc); - /*<>*/ var - l$0 = param[2], - x = param[1], - /*<>*/ xs = /*<>*/ caml_call1(f, x), - /*<>*/ acc$0 = rev_append(xs, acc), - acc = acc$0, - param = l$0; + if(! param$0) /*<>*/ return 0; + /*<>*/ var + xs = param$0[2], + x = param$0[1], + /*<>*/ ys = /*<>*/ caml_call1(f, x); + if(ys){ + /*<>*/ var + ys$1 = ys[2], + y = ys[1], + /*<>*/ block = [0, y, 24029], + dst = block, + offset = 1, + ys$2 = ys$1, + xs$1 = xs; + /*<>*/ for(;;) + if(ys$2){ + /*<>*/ var + ys$3 = ys$2[2], + y$0 = ys$2[1], + /*<>*/ dst$0 = [0, y$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + ys$2 = ys$3; + } + else{ + if(! xs$1){dst[1 + offset] = 0; /*<>*/ return block;} + /*<>*/ var + xs$0 = xs$1[2], + x$0 = xs$1[1], + /*<>*/ ys$0 = + /*<>*/ caml_call1(f, x$0); + ys$2 = ys$0; + xs$1 = xs$0; + } + } + else + param$0 = xs; } - /*<>*/ } + } function fold_left_map(f, accu, l){ - /*<>*/ var accu$0 = accu, l_accu = 0, param = l; + /*<>*/ var accu$0 = accu, l_accu = 0, param = l; for(;;){ - if(! param) /*<>*/ return [0, accu$0, rev(l_accu)]; - /*<>*/ var + if(! param) /*<>*/ return [0, accu$0, rev(l_accu)]; + /*<>*/ var l$0 = param[2], x = param[1], - /*<>*/ match = - /*<>*/ caml_call2(f, accu$0, x), + /*<>*/ match = + /*<>*/ caml_call2(f, accu$0, x), x$0 = match[2], accu$1 = match[1], - /*<>*/ l_accu$0 = [0, x$0, l_accu], - accu$0 = accu$1, - l_accu = l_accu$0, - param = l$0; + /*<>*/ l_accu$0 = [0, x$0, l_accu]; + accu$0 = accu$1; + l_accu = l_accu$0; + param = l$0; } - /*<>*/ } + /*<>*/ } function partition(p, l){ - /*<>*/ var yes = 0, no = 0, param = l; + /*<>*/ var yes = 0, no = 0, param = l; for(;;){ if(! param){ - /*<>*/ /*<>*/ var _A_ = rev(no); - /*<>*/ return [0, rev(yes), _A_]; + /*<>*/ /*<>*/ var _x_ = rev(no); + /*<>*/ return [0, rev(yes), _x_]; } var l$0 = param[2], x = param[1]; - /*<>*/ if( /*<>*/ caml_call1(p, x)){ - /*<>*/ var - /*<>*/ yes$0 = [0, x, yes], - yes = yes$0, - param = l$0; - continue; + /*<>*/ if( /*<>*/ caml_call1(p, x)){ + /*<>*/ /*<>*/ var yes$0 = [0, x, yes]; + yes = yes$0; + param = l$0; } - /*<>*/ var - /*<>*/ no$0 = [0, x, no], - no = no$0, + else{ + /*<>*/ /*<>*/ var no$0 = [0, x, no]; + no = no$0; param = l$0; + } } - /*<>*/ } + /*<>*/ } function partition_map(p, l){ - /*<>*/ var left = 0, right = 0, param = l; + /*<>*/ var left = 0, right = 0, param = l; for(;;){ if(! param){ - /*<>*/ /*<>*/ var _z_ = rev(right); - /*<>*/ return [0, rev(left), _z_]; + /*<>*/ /*<>*/ var _w_ = rev(right); + /*<>*/ return [0, rev(left), _w_]; } - /*<>*/ var + /*<>*/ var l$0 = param[2], x = param[1], - /*<>*/ match = /*<>*/ caml_call1(p, x); + /*<>*/ match = /*<>*/ caml_call1(p, x); if(0 === match[0]){ - /*<>*/ var + /*<>*/ var v = match[1], - /*<>*/ left$0 = [0, v, left], - left = left$0, - param = l$0; - continue; + /*<>*/ left$0 = [0, v, left]; + left = left$0; + param = l$0; } - /*<>*/ var - v$0 = match[1], - /*<>*/ right$0 = [0, v$0, right], - right = right$0, + else{ + /*<>*/ var + v$0 = match[1], + /*<>*/ right$0 = [0, v$0, right]; + right = right$0; param = l$0; + } } - /*<>*/ } + /*<>*/ } function split(param){ - /*<>*/ if(! param) /*<>*/ return _b_; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return _a_; + /*<>*/ var l = param[2], match = param[1], y = match[2], x = match[1], - /*<>*/ match$0 = split(l), + /*<>*/ match$0 = split(l), ry = match$0[2], rx = match$0[1]; - /*<>*/ return [0, [0, x, rx], [0, y, ry]]; - /*<>*/ } + /*<>*/ return [0, [0, x, rx], [0, y, ry]]; + /*<>*/ } function combine(l1, l2){ - /*<>*/ if(l1){ + /*<>*/ if(l1){ if(l2){ var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1]; - /*<>*/ return [0, [0, a1, a2], combine(l1$0, l2$0)]; + /*<>*/ return [0, [0, a1, a2], combine(l1$0, l2$0)]; } } - else if(! l2) /*<>*/ return 0; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2) /*<>*/ return 0; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_combine); - /*<>*/ } + /*<>*/ } function merge(cmp, l1, l2){ - /*<>*/ if(! l1) /*<>*/ return l2; - if(! l2) /*<>*/ return l1; + /*<>*/ if(! l1) /*<>*/ return l2; + if(! l2) /*<>*/ return l1; var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; - /*<>*/ return 0 - < /*<>*/ caml_call2(cmp, h1, h2) + /*<>*/ return 0 + < /*<>*/ caml_call2(cmp, h1, h2) ? [0, h2, merge(cmp, l1, t2)] : [0, h1, merge(cmp, t1, l2)]; - /*<>*/ } + /*<>*/ } function stable_sort(cmp, l){ function sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ s = - 0 < /*<>*/ caml_call2(cmp, x1, x2) + /*<>*/ s = + 0 < /*<>*/ caml_call2(cmp, x1, x2) ? [0, x2, [0, x1, 0]] : [0, x1, [0, x2, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } else if(3 === n && l){ - var _y_ = l[2]; - if(_y_){ - var match$2 = _y_[2]; + var _v_ = l[2]; + if(_v_){ + var match$2 = _v_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], - x2$0 = _y_[1], + x2$0 = _v_[1], x1$0 = l[1], - /*<>*/ s$0 = - 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) + /*<>*/ s$0 = + 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) ? 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? [0, x3, [0, x2$0, [0, x1$0, 0]]] : [0, x2$0, [0, x3, [0, x1$0, 0]]] : [0, x2$0, [0, x1$0, [0, x3, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? [0, x3, [0, x1$0, [0, x2$0, 0]]] : [0, x1$0, [0, x3, [0, x2$0, 0]]] : [0, x1$0, [0, x2$0, [0, x3, 0]]]; - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = rev_sort(n1, l), + /*<>*/ match$0 = rev_sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = rev_sort(n2, l2$0), + /*<>*/ match$1 = rev_sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, h1, h2)){ - /*<>*/ var - /*<>*/ accu$0 = [0, h1, accu], - l1 = t1, - accu = accu$0; + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, h1, h2)){ + /*<>*/ /*<>*/ var + accu$0 = [0, h1, accu]; + l1 = t1; + accu = accu$0; continue; } - /*<>*/ var - /*<>*/ accu$1 = [0, h2, accu], - l2 = t2, - accu = accu$1; + /*<>*/ /*<>*/ var + accu$1 = [0, h2, accu]; + l2 = t2; + accu = accu$1; continue; } - var _x_ = rev_append(l1, accu); + var _u_ = rev_append(l1, accu); } else - var _x_ = rev_append(l2, accu); - /*<>*/ return [0, _x_, tl$0]; + var _u_ = rev_append(l2, accu); + /*<>*/ return [0, _u_, tl$0]; } - /*<>*/ } + /*<>*/ } function rev_sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ s = - 0 < /*<>*/ caml_call2(cmp, x1, x2) + /*<>*/ s = + 0 < /*<>*/ caml_call2(cmp, x1, x2) ? [0, x1, [0, x2, 0]] : [0, x2, [0, x1, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } else if(3 === n && l){ - var _w_ = l[2]; - if(_w_){ - var match$2 = _w_[2]; + var _t_ = l[2]; + if(_t_){ + var match$2 = _t_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], - x2$0 = _w_[1], + x2$0 = _t_[1], x1$0 = l[1], - /*<>*/ s$0 = - 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) + /*<>*/ s$0 = + 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) ? 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? [0, x1$0, [0, x2$0, [0, x3, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? [0, x1$0, [0, x3, [0, x2$0, 0]]] : [0, x3, [0, x1$0, [0, x2$0, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? [0, x2$0, [0, x1$0, [0, x3, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? [0, x2$0, [0, x3, [0, x1$0, 0]]] : [0, x3, [0, x2$0, [0, x1$0, 0]]]; - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = sort(n1, l), + /*<>*/ match$0 = sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = sort(n2, l2$0), + /*<>*/ match$1 = sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, h1, h2)){ - /*<>*/ var - /*<>*/ accu$0 = [0, h2, accu], - l2 = t2, - accu = accu$0; + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, h1, h2)){ + /*<>*/ /*<>*/ var + accu$0 = [0, h2, accu]; + l2 = t2; + accu = accu$0; continue; } - /*<>*/ var - /*<>*/ accu$1 = [0, h1, accu], - l1 = t1, - accu = accu$1; + /*<>*/ /*<>*/ var + accu$1 = [0, h1, accu]; + l1 = t1; + accu = accu$1; continue; } - var _v_ = rev_append(l1, accu); + var _s_ = rev_append(l1, accu); } else - var _v_ = rev_append(l2, accu); - /*<>*/ return [0, _v_, tl$0]; + var _s_ = rev_append(l2, accu); + /*<>*/ return [0, _s_, tl$0]; } - /*<>*/ } - /*<>*/ /*<>*/ var len = length(l); - /*<>*/ return 2 <= len ? sort(len, l)[1] : l; - /*<>*/ } + /*<>*/ } + /*<>*/ /*<>*/ var len = length(l); + /*<>*/ return 2 <= len ? sort(len, l)[1] : l; + /*<>*/ } function sort_uniq(cmp, l){ function sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ c$0 = - /*<>*/ caml_call2(cmp, x1, x2), - /*<>*/ s = + /*<>*/ c$0 = + /*<>*/ caml_call2(cmp, x1, x2), + /*<>*/ s = 0 === c$0 ? [0, x1, 0] : 0 <= c$0 ? [0, x2, [0, x1, 0]] : [0, x1, [0, x2, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } else if(3 === n && l){ - var _p_ = l[2]; - if(_p_){ - var match$2 = _p_[2]; + var _m_ = l[2]; + if(_m_){ + var match$2 = _m_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], - x2$0 = _p_[1], + x2$0 = _m_[1], x1$0 = l[1], - /*<>*/ c$1 = - /*<>*/ caml_call2(cmp, x1$0, x2$0); - /*<>*/ if(0 === c$1) - /*<>*/ var - /*<>*/ c$2 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _q_ = + /*<>*/ c$1 = + /*<>*/ caml_call2(cmp, x1$0, x2$0); + /*<>*/ if(0 === c$1) + /*<>*/ var + /*<>*/ c$2 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _n_ = 0 === c$2 ? [0, x2$0, 0] : 0 <= c$2 ? [0, x3, [0, x2$0, 0]] : [0, x2$0, [0, x3, 0]], - s$0 = _q_; + s$0 = _n_; else if(0 <= c$1){ - /*<>*/ /*<>*/ var - c$3 = /*<>*/ caml_call2(cmp, x1$0, x3); - /*<>*/ if(0 === c$3) - var _r_ = [0, x2$0, [0, x1$0, 0]]; + /*<>*/ /*<>*/ var + c$3 = /*<>*/ caml_call2(cmp, x1$0, x3); + /*<>*/ if(0 === c$3) + var _o_ = [0, x2$0, [0, x1$0, 0]]; else if(0 <= c$3) - /*<>*/ var - /*<>*/ c$4 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _s_ = + /*<>*/ var + /*<>*/ c$4 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _p_ = 0 === c$4 ? [0, x2$0, [0, x1$0, 0]] : 0 <= c$4 ? [0, x3, [0, x2$0, [0, x1$0, 0]]] : [0, x2$0, [0, x3, [0, x1$0, 0]]], - _r_ = _s_; + _o_ = _p_; else - var _r_ = [0, x2$0, [0, x1$0, [0, x3, 0]]]; - var s$0 = _r_; + var _o_ = [0, x2$0, [0, x1$0, [0, x3, 0]]]; + var s$0 = _o_; } else{ - /*<>*/ /*<>*/ var - c$5 = /*<>*/ caml_call2(cmp, x2$0, x3); - /*<>*/ if(0 === c$5) - var _t_ = [0, x1$0, [0, x2$0, 0]]; + /*<>*/ /*<>*/ var + c$5 = /*<>*/ caml_call2(cmp, x2$0, x3); + /*<>*/ if(0 === c$5) + var _q_ = [0, x1$0, [0, x2$0, 0]]; else if(0 <= c$5) - /*<>*/ var - /*<>*/ c$6 = - /*<>*/ caml_call2(cmp, x1$0, x3), - /*<>*/ _u_ = + /*<>*/ var + /*<>*/ c$6 = + /*<>*/ caml_call2(cmp, x1$0, x3), + /*<>*/ _r_ = 0 === c$6 ? [0, x1$0, [0, x2$0, 0]] : 0 <= c$6 ? [0, x3, [0, x1$0, [0, x2$0, 0]]] : [0, x1$0, [0, x3, [0, x2$0, 0]]], - _t_ = _u_; + _q_ = _r_; else - var _t_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; - var s$0 = _t_; + var _q_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; + var s$0 = _q_; } - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = rev_sort(n1, l), + /*<>*/ match$0 = rev_sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = rev_sort(n2, l2$0), + /*<>*/ match$1 = rev_sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ - /*<>*/ var + /*<>*/ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1], - /*<>*/ c = - /*<>*/ caml_call2(cmp, h1, h2); - /*<>*/ if(0 === c){ - /*<>*/ var - /*<>*/ accu$0 = [0, h1, accu], - l1 = t1, - l2 = t2, - accu = accu$0; + /*<>*/ c = + /*<>*/ caml_call2(cmp, h1, h2); + /*<>*/ if(0 === c){ + /*<>*/ /*<>*/ var + accu$0 = [0, h1, accu]; + l1 = t1; + l2 = t2; + accu = accu$0; continue; } if(0 < c){ - /*<>*/ var - /*<>*/ accu$1 = [0, h1, accu], - l1 = t1, - accu = accu$1; + /*<>*/ /*<>*/ var + accu$1 = [0, h1, accu]; + l1 = t1; + accu = accu$1; continue; } - /*<>*/ var - /*<>*/ accu$2 = [0, h2, accu], - l2 = t2, - accu = accu$2; + /*<>*/ /*<>*/ var + accu$2 = [0, h2, accu]; + l2 = t2; + accu = accu$2; continue; } - var _o_ = rev_append(l1, accu); + var _l_ = rev_append(l1, accu); } else - var _o_ = rev_append(l2, accu); - /*<>*/ return [0, _o_, tl$0]; + var _l_ = rev_append(l2, accu); + /*<>*/ return [0, _l_, tl$0]; } - /*<>*/ } + /*<>*/ } function rev_sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ c$0 = - /*<>*/ caml_call2(cmp, x1, x2), - /*<>*/ s = + /*<>*/ c$0 = + /*<>*/ caml_call2(cmp, x1, x2), + /*<>*/ s = 0 === c$0 ? [0, x1, 0] : 0 < c$0 ? [0, x1, [0, x2, 0]] : [0, x2, [0, x1, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } else if(3 === n && l){ - var _i_ = l[2]; - if(_i_){ - var match$2 = _i_[2]; + var _f_ = l[2]; + if(_f_){ + var match$2 = _f_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], - x2$0 = _i_[1], + x2$0 = _f_[1], x1$0 = l[1], - /*<>*/ c$1 = - /*<>*/ caml_call2(cmp, x1$0, x2$0); - /*<>*/ if(0 === c$1) - /*<>*/ var - /*<>*/ c$2 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _j_ = + /*<>*/ c$1 = + /*<>*/ caml_call2(cmp, x1$0, x2$0); + /*<>*/ if(0 === c$1) + /*<>*/ var + /*<>*/ c$2 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _g_ = 0 === c$2 ? [0, x2$0, 0] : 0 < c$2 ? [0, x2$0, [0, x3, 0]] : [0, x3, [0, x2$0, 0]], - s$0 = _j_; + s$0 = _g_; else if(0 < c$1){ - /*<>*/ /*<>*/ var - c$3 = /*<>*/ caml_call2(cmp, x2$0, x3); - /*<>*/ if(0 === c$3) - var _k_ = [0, x1$0, [0, x2$0, 0]]; + /*<>*/ /*<>*/ var + c$3 = /*<>*/ caml_call2(cmp, x2$0, x3); + /*<>*/ if(0 === c$3) + var _h_ = [0, x1$0, [0, x2$0, 0]]; else if(0 < c$3) - var _k_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; + var _h_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; else - /*<>*/ var - /*<>*/ c$4 = - /*<>*/ caml_call2(cmp, x1$0, x3), - /*<>*/ _l_ = + /*<>*/ var + /*<>*/ c$4 = + /*<>*/ caml_call2(cmp, x1$0, x3), + /*<>*/ _i_ = 0 === c$4 ? [0, x1$0, [0, x2$0, 0]] : 0 < c$4 ? [0, x1$0, [0, x3, [0, x2$0, 0]]] : [0, x3, [0, x1$0, [0, x2$0, 0]]], - _k_ = _l_; - var s$0 = _k_; + _h_ = _i_; + var s$0 = _h_; } else{ - /*<>*/ /*<>*/ var - c$5 = /*<>*/ caml_call2(cmp, x1$0, x3); - /*<>*/ if(0 === c$5) - var _m_ = [0, x2$0, [0, x1$0, 0]]; + /*<>*/ /*<>*/ var + c$5 = /*<>*/ caml_call2(cmp, x1$0, x3); + /*<>*/ if(0 === c$5) + var _j_ = [0, x2$0, [0, x1$0, 0]]; else if(0 < c$5) - var _m_ = [0, x2$0, [0, x1$0, [0, x3, 0]]]; + var _j_ = [0, x2$0, [0, x1$0, [0, x3, 0]]]; else - /*<>*/ var - /*<>*/ c$6 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _n_ = + /*<>*/ var + /*<>*/ c$6 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _k_ = 0 === c$6 ? [0, x2$0, [0, x1$0, 0]] : 0 < c$6 ? [0, x2$0, [0, x3, [0, x1$0, 0]]] : [0, x3, [0, x2$0, [0, x1$0, 0]]], - _m_ = _n_; - var s$0 = _m_; + _j_ = _k_; + var s$0 = _j_; } - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = sort(n1, l), + /*<>*/ match$0 = sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = sort(n2, l2$0), + /*<>*/ match$1 = sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ - /*<>*/ var + /*<>*/ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1], - /*<>*/ c = - /*<>*/ caml_call2(cmp, h1, h2); - /*<>*/ if(0 === c){ - /*<>*/ var - /*<>*/ accu$0 = [0, h1, accu], - l1 = t1, - l2 = t2, - accu = accu$0; + /*<>*/ c = + /*<>*/ caml_call2(cmp, h1, h2); + /*<>*/ if(0 === c){ + /*<>*/ /*<>*/ var + accu$0 = [0, h1, accu]; + l1 = t1; + l2 = t2; + accu = accu$0; continue; } if(0 <= c){ - /*<>*/ var - /*<>*/ accu$1 = [0, h2, accu], - l2 = t2, - accu = accu$1; + /*<>*/ /*<>*/ var + accu$1 = [0, h2, accu]; + l2 = t2; + accu = accu$1; continue; } - /*<>*/ var - /*<>*/ accu$2 = [0, h1, accu], - l1 = t1, - accu = accu$2; + /*<>*/ /*<>*/ var + accu$2 = [0, h1, accu]; + l1 = t1; + accu = accu$2; continue; } - var _h_ = rev_append(l1, accu); + var _e_ = rev_append(l1, accu); } else - var _h_ = rev_append(l2, accu); - /*<>*/ return [0, _h_, tl$0]; + var _e_ = rev_append(l2, accu); + /*<>*/ return [0, _e_, tl$0]; } - /*<>*/ } - /*<>*/ /*<>*/ var len = length(l); - /*<>*/ return 2 <= len ? sort(len, l)[1] : l; - /*<>*/ } + /*<>*/ } + /*<>*/ /*<>*/ var len = length(l); + /*<>*/ return 2 <= len ? sort(len, l)[1] : l; + /*<>*/ } function compare_lengths(l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(! l1$0) return l2$0 ? -1 : 0; - if(! l2$0) /*<>*/ return 1; - var l2$1 = l2$0[2], l1$1 = l1$0[2], l1$0 = l1$1, l2$0 = l2$1; + if(! l2$0) /*<>*/ return 1; + var l2$1 = l2$0[2], l1$1 = l1$0[2]; + l1$0 = l1$1; + l2$0 = l2$1; } - /*<>*/ } + /*<>*/ } function compare_length_with(l, n){ - /*<>*/ var l$0 = l, n$0 = n; - /*<>*/ for(;;){ + /*<>*/ var l$0 = l, n$0 = n; + /*<>*/ for(;;){ if(! l$0) return 0 === n$0 ? 0 : 0 < n$0 ? -1 : 1; var l$1 = l$0[2]; - /*<>*/ if(0 >= n$0) /*<>*/ return 1; - /*<>*/ var - /*<>*/ n$1 = n$0 - 1 | 0, - l$0 = l$1, - n$0 = n$1; - } - /*<>*/ } + /*<>*/ if(0 >= n$0) /*<>*/ return 1; + /*<>*/ /*<>*/ var n$1 = n$0 - 1 | 0; + l$0 = l$1; + n$0 = n$1; + } + /*<>*/ } + function is_empty(param){ + /*<>*/ return param ? 0 : 1; + /*<>*/ } function equal(eq, l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(l1$0){ if(l2$0){ - /*<>*/ var + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1], - /*<>*/ _g_ = - /*<>*/ caml_call2(eq, a1, a2); - /*<>*/ if(! _g_) /*<>*/ return _g_; - var l1$0 = l1$1, l2$0 = l2$1; + /*<>*/ _d_ = + /*<>*/ caml_call2(eq, a1, a2); + /*<>*/ if(! _d_) /*<>*/ return _d_; + l1$0 = l1$1; + l2$0 = l2$1; continue; } } - else if(! l2$0) /*<>*/ return 1; - /*<>*/ return 0; + else if(! l2$0) /*<>*/ return 1; + /*<>*/ return 0; } - /*<>*/ } + /*<>*/ } function compare(cmp, l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(! l1$0) return l2$0 ? -1 : 0; var l1$1 = l1$0[2], a1 = l1$0[1]; - if(! l2$0) /*<>*/ return 1; - /*<>*/ var + if(! l2$0) /*<>*/ return 1; + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], - /*<>*/ c = - /*<>*/ caml_call2(cmp, a1, a2); - /*<>*/ if(0 !== c) /*<>*/ return c; - var l1$0 = l1$1, l2$0 = l2$1; + /*<>*/ c = + /*<>*/ caml_call2(cmp, a1, a2); + /*<>*/ if(0 !== c) /*<>*/ return c; + l1$0 = l1$1; + l2$0 = l2$1; } - /*<>*/ } + /*<>*/ } function to_seq(l){ - /*<>*/ function aux(l, param){ - /*<>*/ if(! l) /*<>*/ return 0; + /*<>*/ function aux(l, param){ + /*<>*/ if(! l) /*<>*/ return 0; var tail = l[2], x = l[1]; - /*<>*/ return [0, + /*<>*/ return [0, x, - function(_f_){ /*<>*/ return aux(tail, _f_);}]; - /*<>*/ } - /*<>*/ return function(_e_){ - /*<>*/ return aux(l, _e_);}; - /*<>*/ } + function(_c_){ /*<>*/ return aux(tail, _c_);}]; + /*<>*/ } + /*<>*/ return function(_b_){ + /*<>*/ return aux(l, _b_);}; + /*<>*/ } function of_seq(seq){ - function direct(depth, seq){ - /*<>*/ if(0 === depth){ - var - _c_ = 0, - _d_ = - function(acc, x){ - /*<>*/ return [0, x, acc]; - /*<>*/ }; - /*<>*/ return rev - ( /*<>*/ caml_call3(Stdlib_Seq[5], _d_, _c_, seq)); - } - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(seq, 0); - if(! match) /*<>*/ return 0; - var next = match[2], x = match[1]; - /*<>*/ return [0, x, direct(depth - 1 | 0, next)]; - /*<>*/ } - /*<>*/ return direct(500, seq); - /*<>*/ } + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(seq, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var + seq$0 = match[2], + x1 = match[1], + /*<>*/ match$0 = + /*<>*/ caml_call1(seq$0, 0); + if(! match$0) /*<>*/ return [0, x1, 0]; + /*<>*/ var + seq$1 = match$0[2], + x2 = match$0[1], + /*<>*/ block = [0, x2, 24029], + dst = block, + offset = 1, + seq$2 = seq$1; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match$1 = /*<>*/ caml_call1(seq$2, 0); + if(match$1){ + /*<>*/ var + seq$3 = match$1[2], + x1$0 = match$1[1], + /*<>*/ match$2 = + /*<>*/ caml_call1(seq$3, 0); + if(match$2){ + /*<>*/ var + seq$4 = match$2[2], + x2$0 = match$2[1], + /*<>*/ dst$0 = [0, x2$0, 24029]; + dst[1 + offset] = [0, x1$0, dst$0]; + dst = dst$0; + offset = 1; + seq$2 = seq$4; + continue; + } + dst[1 + offset] = [0, x1$0, 0]; + } + else + dst[1 + offset] = 0; + /*<>*/ return [0, x1, block]; + } + /*<>*/ } var Stdlib_List = [0, length, compare_lengths, compare_length_with, + is_empty, cons, hd, tl, @@ -4446,7 +4758,9 @@ memq, find, find_opt, + find_index, find_map, + find_mapi, find_all, find_all, filteri, @@ -4469,7 +4783,7 @@ merge, to_seq, of_seq]; - runtime.caml_register_global(18, Stdlib_List, "Stdlib__List"); + runtime.caml_register_global(17, Stdlib_List, "Stdlib__List"); return; /*<>*/ } (globalThis)); @@ -4477,11 +4791,10 @@ //# unitInfo: Provides: Stdlib__Int (function(globalThis){ "use strict"; - var runtime = globalThis.jsoo_runtime, zero = 0, one = 1, minus_one = -1; + var runtime = globalThis.jsoo_runtime, caml_hash = runtime.caml_hash; function abs(x){ /*<>*/ return 0 <= x ? x : - x | 0; /*<>*/ } - var max_int = 2147483647, min_int = -2147483648; function lognot(x){ /*<>*/ return x ^ -1; /*<>*/ } @@ -4496,28 +4809,38 @@ function to_string(x){ /*<>*/ return "" + x; /*<>*/ } + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } + function hash(x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, 0, x); + /*<>*/ } var Stdlib_Int = [0, - zero, - one, - minus_one, + 0, + 1, + -1, abs, - max_int, - min_int, + 2147483647, + -2147483648, lognot, equal, compare, min, max, - to_string]; + to_string, + seeded_hash, + hash]; runtime.caml_register_global(1, Stdlib_Int, "Stdlib__Int"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Bytes -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Char, Stdlib__Int, Stdlib__Seq, Stdlib__Sys, Stdlib__Uchar +//# unitInfo: Requires: Stdlib, Stdlib__Char, Stdlib__Int, Stdlib__Seq, Stdlib__Sys, Stdlib__Uchar (function (globalThis){ "use strict"; @@ -4557,6 +4880,7 @@ : runtime.caml_call_gen(f, [a0, a1]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, Stdlib_Uchar = global_data.Stdlib__Uchar, @@ -4564,34 +4888,7 @@ Stdlib_Sys = global_data.Stdlib__Sys, Stdlib_Int = global_data.Stdlib__Int, Stdlib_Seq = global_data.Stdlib__Seq, - Stdlib_Char = global_data.Stdlib__Char, - cst_index_out_of_bounds$2 = cst_index_out_of_bounds$3, - _f_ = [0, cst_bytes_ml, 820, 20], - _e_ = [0, cst_bytes_ml, 831, 9], - cst_index_out_of_bounds$1 = cst_index_out_of_bounds$3, - cst_index_out_of_bounds$0 = cst_index_out_of_bounds$3, - _d_ = [0, cst_bytes_ml, 766, 20], - _c_ = [0, cst_bytes_ml, 777, 9], - cst_index_out_of_bounds = cst_index_out_of_bounds$3, - _b_ = [0, cst_bytes_ml, 654, 20], - _a_ = [0, cst_bytes_ml, 679, 9], - cst_Bytes_of_seq_cannot_grow_b = "Bytes.of_seq: cannot grow bytes", - cst_String_rcontains_from_Byte = - "String.rcontains_from / Bytes.rcontains_from", - cst_String_contains_from_Bytes = - "String.contains_from / Bytes.contains_from", - cst_String_rindex_from_opt_Byt = - "String.rindex_from_opt / Bytes.rindex_from_opt", - cst_String_rindex_from_Bytes_r = "String.rindex_from / Bytes.rindex_from", - cst_String_index_from_opt_Byte = - "String.index_from_opt / Bytes.index_from_opt", - cst_String_index_from_Bytes_in = "String.index_from / Bytes.index_from", - cst_Bytes_concat = "Bytes.concat", - cst_String_blit_Bytes_blit_str = "String.blit / Bytes.blit_string", - cst_Bytes_blit = "Bytes.blit", - cst_String_fill_Bytes_fill = "String.fill / Bytes.fill", - cst_Bytes_extend = "Bytes.extend", - cst_String_sub_Bytes_sub = "String.sub / Bytes.sub"; + Stdlib_Char = global_data.Stdlib__Char; function make(n, c){ /*<>*/ /*<>*/ var s = /*<>*/ caml_create_bytes(n); @@ -4601,21 +4898,38 @@ function init(n, f){ /*<>*/ var /*<>*/ s = /*<>*/ caml_create_bytes(n), - /*<>*/ _aq_ = n - 1 | 0, - /*<>*/ _ap_ = 0; - if(_aq_ >= 0){ - var i = _ap_; + /*<>*/ _ap_ = n - 1 | 0, + /*<>*/ _ao_ = 0; + if(_ap_ >= 0){ + var i = _ao_; for(;;){ caml_bytes_unsafe_set(s, i, /*<>*/ caml_call1(f, i)); - /*<>*/ /*<>*/ var _ar_ = i + 1 | 0; - if(_aq_ !== i){var i = _ar_; continue;} - break; + /*<>*/ /*<>*/ var _aq_ = i + 1 | 0; + if(_ap_ === i) break; + i = _aq_; } } /*<>*/ return s; /*<>*/ } - /*<>*/ /*<>*/ var - empty = /*<>*/ caml_create_bytes(0); + /*<>*/ var + /*<>*/ empty = + /*<>*/ caml_create_bytes(0), + cst_String_sub_Bytes_sub = "String.sub / Bytes.sub", + cst_Bytes_extend = "Bytes.extend", + cst_String_fill_Bytes_fill = "String.fill / Bytes.fill", + cst_Bytes_blit = "Bytes.blit", + cst_String_blit_Bytes_blit_str = "String.blit / Bytes.blit_string", + cst_Bytes_concat = "Bytes.concat", + cst_String_index_from_Bytes_in = "String.index_from / Bytes.index_from", + cst_String_index_from_opt_Byte = + "String.index_from_opt / Bytes.index_from_opt", + cst_String_rindex_from_Bytes_r = "String.rindex_from / Bytes.rindex_from", + cst_String_rindex_from_opt_Byt = + "String.rindex_from_opt / Bytes.rindex_from_opt", + cst_String_contains_from_Bytes = + "String.contains_from / Bytes.contains_from", + cst_String_rcontains_from_Byte = + "String.rcontains_from / Bytes.rcontains_from"; function copy(s){ /*<>*/ var len = caml_ml_bytes_length(s), @@ -4651,16 +4965,15 @@ function symbol(a, b){ /*<>*/ var c = a + b | 0, - _ao_ = b < 0 ? 1 : 0, - match = c < 0 ? 1 : 0, - switch$0 = 0; - if(a < 0){ - if(_ao_ && ! match) switch$0 = 1; - } - else if(! _ao_ && match) switch$0 = 1; - return switch$0 - ? /*<>*/ caml_call1(Stdlib[1], cst_Bytes_extend) - : c; + _an_ = b < 0 ? 1 : 0, + match = c < 0 ? 1 : 0; + a: + { + if(a < 0){if(_an_ && ! match) break a;} else if(! _an_ && match) break a; + /*<>*/ return c; + } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Bytes_extend); /*<>*/ } function extend(s, left, right){ /*<>*/ var @@ -4719,86 +5032,84 @@ /*<>*/ } function iter(f, a){ /*<>*/ var - _am_ = caml_ml_bytes_length(a) - 1 | 0, - /*<>*/ _al_ = 0; - if(_am_ >= 0){ - var i = _al_; + _al_ = caml_ml_bytes_length(a) - 1 | 0, + /*<>*/ _ak_ = 0; + if(_al_ >= 0){ + var i = _ak_; for(;;){ /*<>*/ /*<>*/ caml_call1 (f, caml_bytes_unsafe_get(a, i)); - /*<>*/ /*<>*/ var _an_ = i + 1 | 0; - if(_am_ !== i){var i = _an_; continue;} - break; + /*<>*/ /*<>*/ var _am_ = i + 1 | 0; + if(_al_ === i) break; + i = _am_; } } return 0; /*<>*/ } function iteri(f, a){ /*<>*/ var - _aj_ = caml_ml_bytes_length(a) - 1 | 0, - /*<>*/ _ai_ = 0; - if(_aj_ >= 0){ - var i = _ai_; + _ai_ = caml_ml_bytes_length(a) - 1 | 0, + /*<>*/ _ah_ = 0; + if(_ai_ >= 0){ + var i = _ah_; for(;;){ /*<>*/ /*<>*/ caml_call2 (f, i, caml_bytes_unsafe_get(a, i)); - /*<>*/ /*<>*/ var _ak_ = i + 1 | 0; - if(_aj_ !== i){var i = _ak_; continue;} - break; + /*<>*/ /*<>*/ var _aj_ = i + 1 | 0; + if(_ai_ === i) break; + i = _aj_; } } return 0; /*<>*/ } function concat(sep, l){ /*<>*/ if(! l) /*<>*/ return empty; - var seplen = caml_ml_bytes_length(sep), acc = 0, param = l, pos$1 = 0; - for(;;){ - if(param){ - var hd = param[1]; - if(param[2]){ + var seplen = caml_ml_bytes_length(sep); + a: + { + b: + { + var acc = 0, param = l, pos$1 = 0; + for(;;){ + if(! param) break; + var hd = param[1]; + if(! param[2]) break b; var tl = param[2], x = (caml_ml_bytes_length(hd) + seplen | 0) + acc | 0, acc$0 = acc <= x ? x - : /*<>*/ caml_call1(Stdlib[1], cst_Bytes_concat), - acc = acc$0, - param = tl; - continue; + : /*<>*/ caml_call1(Stdlib[1], cst_Bytes_concat); + acc = acc$0; + param = tl; } - var _ah_ = caml_ml_bytes_length(hd) + acc | 0; + var _ag_ = acc; + break a; } - else - var _ah_ = acc; - /*<>*/ var - /*<>*/ dst = - /*<>*/ caml_create_bytes(_ah_), - pos = pos$1, - param$0 = l; - for(;;){ - if(! param$0) /*<>*/ return dst; - var hd$0 = param$0[1]; - if(param$0[2]){ - var tl$0 = param$0[2]; - /*<>*/ /*<>*/ caml_blit_bytes - (hd$0, - 0, - dst, - pos, - /*<>*/ caml_ml_bytes_length(hd$0)); - /*<>*/ /*<>*/ caml_blit_bytes - (sep, 0, dst, pos + caml_ml_bytes_length(hd$0) | 0, seplen); - var - pos$0 = (pos + caml_ml_bytes_length(hd$0) | 0) + seplen | 0, - pos = pos$0, - param$0 = tl$0; - continue; - } + var _ag_ = caml_ml_bytes_length(hd) + acc | 0; + } + /*<>*/ var + /*<>*/ dst = + /*<>*/ caml_create_bytes(_ag_), + pos = pos$1, + param$0 = l; + for(;;){ + if(! param$0) /*<>*/ return dst; + var hd$0 = param$0[1]; + if(! param$0[2]){ /*<>*/ /*<>*/ caml_blit_bytes (hd$0, 0, dst, pos, caml_ml_bytes_length(hd$0)); /*<>*/ return dst; } + var tl$0 = param$0[2]; + /*<>*/ /*<>*/ caml_blit_bytes + (hd$0, 0, dst, pos, /*<>*/ caml_ml_bytes_length(hd$0)); + /*<>*/ /*<>*/ caml_blit_bytes + (sep, 0, dst, pos + caml_ml_bytes_length(hd$0) | 0, seplen); + var pos$0 = (pos + caml_ml_bytes_length(hd$0) | 0) + seplen | 0; + pos = pos$0; + param$0 = tl$0; } } function cat(s1, s2){ @@ -4815,63 +5126,71 @@ /*<>*/ return r; /*<>*/ } function is_space(param){ - /*<>*/ var - /*<>*/ _ag_ = param - 9 | 0, - switch$0 = 0; - if(4 < _ag_ >>> 0){ - if(23 === _ag_) switch$0 = 1; - } - else if(2 !== _ag_) switch$0 = 1; - return switch$0 ? 1 : 0; + /*<>*/ /*<>*/ var + _af_ = param - 9 | 0; + a: + { + if(4 < _af_ >>> 0){if(23 !== _af_) break a;} else if(2 === _af_) break a; + /*<>*/ return 1; + } + /*<>*/ return 0; /*<>*/ } function trim(s){ /*<>*/ var len = caml_ml_bytes_length(s), /*<>*/ i = [0, 0]; for(;;){ - /*<>*/ if - (i[1] < len && is_space(caml_bytes_unsafe_get(s, i[1]))){i[1]++; continue;} - /*<>*/ /*<>*/ var - j = [0, len - 1 | 0]; - for(;;){ - /*<>*/ if - (i[1] <= j[1] && is_space(caml_bytes_unsafe_get(s, j[1]))){j[1] += -1; continue;} - return i[1] <= j[1] ? sub(s, i[1], (j[1] - i[1] | 0) + 1 | 0) : empty; - } + if(i[1] >= len) break; + /*<>*/ if(! is_space(caml_bytes_unsafe_get(s, i[1]))) + break; + i[1]++; + } + /*<>*/ /*<>*/ var + j = [0, len - 1 | 0]; + for(;;){ + /*<>*/ if + (i[1] <= j[1] && is_space(caml_bytes_unsafe_get(s, j[1]))){j[1]--; continue;} + return i[1] <= j[1] ? sub(s, i[1], (j[1] - i[1] | 0) + 1 | 0) : empty; } /*<>*/ } function unsafe_escape(s){ /*<>*/ var /*<>*/ n = [0, 0], - _$_ = caml_ml_bytes_length(s) - 1 | 0, - /*<>*/ ___ = 0; - if(_$_ >= 0){ - var i$0 = ___; + ___ = caml_ml_bytes_length(s) - 1 | 0, + /*<>*/ _Z_ = 0; + if(___ >= 0){ + var i$0 = _Z_; for(;;){ - var match = caml_bytes_unsafe_get(s, i$0), switch$0 = 0; - if(32 <= match){ - var _ad_ = match - 34 | 0, switch$1 = 0; - if(58 < _ad_ >>> 0){ - if(93 > _ad_) switch$1 = 1; - } - else if(56 < _ad_ - 1 >>> 0) switch$0 = 1; else switch$1 = 1; - if(switch$1){var _ae_ = 1; switch$0 = 2;} - } - else - if(11 <= match){ - if(13 === match) switch$0 = 1; + var match = caml_bytes_unsafe_get(s, i$0); + a: + { + b: + { + c: + { + if(32 <= match){ + var _ac_ = match - 34 | 0; + if(58 < _ac_ >>> 0){ + if(93 <= _ac_) break c; + } + else if(56 < _ac_ - 1 >>> 0) break b; + var _ad_ = 1; + break a; + } + if(11 <= match){ + if(13 === match) break b; + } + else if(8 <= match) break b; + } + var _ad_ = 4; + break a; } - else if(8 <= match) switch$0 = 1; - switch(switch$0){ - case 0: - var _ae_ = 4; break; - case 1: - var _ae_ = 2; break; + var _ad_ = 2; } - n[1] = n[1] + _ae_ | 0; - /*<>*/ /*<>*/ var _af_ = i$0 + 1 | 0; - if(_$_ !== i$0){var i$0 = _af_; continue;} - break; + n[1] = n[1] + _ad_ | 0; + /*<>*/ /*<>*/ var _ae_ = i$0 + 1 | 0; + if(___ === i$0) break; + i$0 = _ae_; } } if(n[1] === caml_ml_bytes_length(s)) /*<>*/ return s; @@ -4879,66 +5198,70 @@ s$0 = /*<>*/ caml_create_bytes(n[1]); n[1] = 0; /*<>*/ var - _ab_ = caml_ml_bytes_length(s) - 1 | 0, - /*<>*/ _aa_ = 0; - if(_ab_ >= 0){ - var i = _aa_; + _aa_ = caml_ml_bytes_length(s) - 1 | 0, + /*<>*/ _$_ = 0; + if(_aa_ >= 0){ + var i = _$_; for(;;){ - var c = caml_bytes_unsafe_get(s, i), switch$2 = 0; - if(35 <= c) - if(92 === c) - switch$2 = 2; - else if(127 <= c) switch$2 = 1; else switch$2 = 3; - else if(32 <= c) - if(34 <= c) switch$2 = 2; else switch$2 = 3; - else if(14 <= c) - switch$2 = 1; - else - switch(c){ - case 8: - caml_bytes_unsafe_set(s$0, n[1], 92); - n[1]++; - caml_bytes_unsafe_set(s$0, n[1], 98); - break; - case 9: - caml_bytes_unsafe_set(s$0, n[1], 92); - n[1]++; - caml_bytes_unsafe_set(s$0, n[1], 116); - break; - case 10: - caml_bytes_unsafe_set(s$0, n[1], 92); - n[1]++; - caml_bytes_unsafe_set(s$0, n[1], 110); - break; - case 13: - caml_bytes_unsafe_set(s$0, n[1], 92); - n[1]++; - caml_bytes_unsafe_set(s$0, n[1], 114); - break; - default: switch$2 = 1; - } - switch(switch$2){ - case 1: - caml_bytes_unsafe_set(s$0, n[1], 92); - n[1]++; - caml_bytes_unsafe_set(s$0, n[1], 48 + (c / 100 | 0) | 0); - n[1]++; - caml_bytes_unsafe_set(s$0, n[1], 48 + ((c / 10 | 0) % 10 | 0) | 0); - n[1]++; - caml_bytes_unsafe_set(s$0, n[1], 48 + (c % 10 | 0) | 0); - break; - case 2: + var c = caml_bytes_unsafe_get(s, i); + a: + { + b: + { + c: + { + if(35 <= c){ + if(92 !== c){if(127 <= c) break c; break b;} + } + else{ + if(32 > c){ + if(14 <= c) break c; + switch(c){ + case 8: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 98); + break a; + case 9: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 116); + break a; + case 10: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 110); + break a; + case 13: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 114); + break a; + default: break c; + } + } + if(34 > c) break b; + } caml_bytes_unsafe_set(s$0, n[1], 92); n[1]++; caml_bytes_unsafe_set(s$0, n[1], c); - break; - case 3: - caml_bytes_unsafe_set(s$0, n[1], c); break; + break a; + } + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 48 + (c / 100 | 0) | 0); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 48 + ((c / 10 | 0) % 10 | 0) | 0); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 48 + (c % 10 | 0) | 0); + break a; + } + caml_bytes_unsafe_set(s$0, n[1], c); } n[1]++; - /*<>*/ /*<>*/ var _ac_ = i + 1 | 0; - if(_ab_ !== i){var i = _ac_; continue;} - break; + /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; + if(_aa_ === i) break; + i = _ab_; } } /*<>*/ return s$0; @@ -4953,18 +5276,18 @@ /*<>*/ var /*<>*/ r = /*<>*/ caml_create_bytes(l), - /*<>*/ _Y_ = l - 1 | 0, - /*<>*/ _X_ = 0; - if(_Y_ >= 0){ - var i = _X_; + /*<>*/ _X_ = l - 1 | 0, + /*<>*/ _W_ = 0; + if(_X_ >= 0){ + var i = _W_; for(;;){ caml_bytes_unsafe_set (r, i, /*<>*/ caml_call1(f, caml_bytes_unsafe_get(s, i))); - /*<>*/ /*<>*/ var _Z_ = i + 1 | 0; - if(_Y_ !== i){var i = _Z_; continue;} - break; + /*<>*/ /*<>*/ var _Y_ = i + 1 | 0; + if(_X_ === i) break; + i = _Y_; } } /*<>*/ return r; @@ -4975,18 +5298,18 @@ /*<>*/ var /*<>*/ r = /*<>*/ caml_create_bytes(l), - /*<>*/ _V_ = l - 1 | 0, - /*<>*/ _U_ = 0; - if(_V_ >= 0){ - var i = _U_; + /*<>*/ _U_ = l - 1 | 0, + /*<>*/ _T_ = 0; + if(_U_ >= 0){ + var i = _T_; for(;;){ caml_bytes_unsafe_set (r, i, /*<>*/ caml_call2(f, i, caml_bytes_unsafe_get(s, i))); - /*<>*/ /*<>*/ var _W_ = i + 1 | 0; - if(_V_ !== i){var i = _W_; continue;} - break; + /*<>*/ /*<>*/ var _V_ = i + 1 | 0; + if(_U_ === i) break; + i = _V_; } } /*<>*/ return r; @@ -4994,17 +5317,17 @@ function fold_left(f, x, a){ /*<>*/ var /*<>*/ r = [0, x], - _S_ = caml_ml_bytes_length(a) - 1 | 0, - /*<>*/ _R_ = 0; - if(_S_ >= 0){ - var i = _R_; + _R_ = caml_ml_bytes_length(a) - 1 | 0, + /*<>*/ _Q_ = 0; + if(_R_ >= 0){ + var i = _Q_; for(;;){ r[1] = /*<>*/ caml_call2 (f, r[1], caml_bytes_unsafe_get(a, i)); - /*<>*/ /*<>*/ var _T_ = i + 1 | 0; - if(_S_ !== i){var i = _T_; continue;} - break; + /*<>*/ /*<>*/ var _S_ = i + 1 | 0; + if(_R_ === i) break; + i = _S_; } } return r[1]; @@ -5012,17 +5335,17 @@ function fold_right(f, a, x){ /*<>*/ var /*<>*/ r = [0, x], - /*<>*/ _P_ = + /*<>*/ _O_ = /*<>*/ caml_ml_bytes_length(a) - 1 | 0; - if(_P_ >= 0){ - var i = _P_; + if(_O_ >= 0){ + var i = _O_; for(;;){ r[1] = /*<>*/ caml_call2 (f, caml_bytes_unsafe_get(a, i), r[1]); - /*<>*/ /*<>*/ var _Q_ = i - 1 | 0; - if(0 !== i){var i = _Q_; continue;} - break; + /*<>*/ /*<>*/ var _P_ = i - 1 | 0; + if(0 === i) break; + i = _P_; } } return r[1]; @@ -5034,9 +5357,8 @@ /*<>*/ if ( /*<>*/ caml_call1(p, caml_bytes_unsafe_get(s, i))) /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } /*<>*/ } function for_all(p, s){ @@ -5046,9 +5368,8 @@ /*<>*/ if (! /*<>*/ caml_call1(p, caml_bytes_unsafe_get(s, i))) /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } /*<>*/ } function uppercase_ascii(s){ @@ -5077,16 +5398,15 @@ /*<>*/ var len_s = caml_ml_bytes_length(s), len_pre = caml_ml_bytes_length(prefix), - _O_ = len_pre <= len_s ? 1 : 0; - if(! _O_) return _O_; + _N_ = len_pre <= len_s ? 1 : 0; + if(! _N_) return _N_; var i = 0; /*<>*/ for(;;){ if(i === len_pre) /*<>*/ return 1; if(caml_bytes_unsafe_get(s, i) !== caml_bytes_unsafe_get(prefix, i)) /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } /*<>*/ } function ends_with(suffix, s){ @@ -5094,8 +5414,8 @@ len_s = caml_ml_bytes_length(s), len_suf = caml_ml_bytes_length(suffix), diff = len_s - len_suf | 0, - _N_ = 0 <= diff ? 1 : 0; - if(! _N_) return _N_; + _M_ = 0 <= diff ? 1 : 0; + if(! _M_) return _M_; var i = 0; /*<>*/ for(;;){ if(i === len_suf) /*<>*/ return 1; @@ -5103,9 +5423,8 @@ (caml_bytes_unsafe_get(s, diff + i | 0) !== caml_bytes_unsafe_get(suffix, i)) /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } /*<>*/ } function index_rec(s, lim, i, c){ @@ -5116,7 +5435,8 @@ (Stdlib[8], 1); if(caml_bytes_unsafe_get(s, i$0) === c) /*<>*/ return i$0; - var i$1 = i$0 + 1 | 0, i$0 = i$1; + var i$1 = i$0 + 1 | 0; + i$0 = i$1; } /*<>*/ } function index(s, c){ @@ -5129,7 +5449,8 @@ if(lim <= i$0) /*<>*/ return 0; if(caml_bytes_unsafe_get(s, i$0) === c) /*<>*/ return [0, i$0]; - var i$1 = i$0 + 1 | 0, i$0 = i$1; + var i$1 = i$0 + 1 | 0; + i$0 = i$1; } /*<>*/ } function index_opt(s, c){ @@ -5157,7 +5478,8 @@ (Stdlib[8], 1); if(caml_bytes_unsafe_get(s, i$0) === c) /*<>*/ return i$0; - var i$1 = i$0 - 1 | 0, i$0 = i$1; + var i$1 = i$0 - 1 | 0; + i$0 = i$1; } /*<>*/ } function rindex(s, c){ @@ -5176,7 +5498,8 @@ if(0 > i$0) /*<>*/ return 0; if(caml_bytes_unsafe_get(s, i$0) === c) /*<>*/ return [0, i$0]; - var i$1 = i$0 - 1 | 0, i$0 = i$1; + var i$1 = i$0 - 1 | 0; + i$0 = i$1; } /*<>*/ } function rindex_opt(s, c){ @@ -5194,13 +5517,13 @@ if(0 <= i && l >= i) /*<>*/ try{ /*<>*/ index_rec(s, l, i, c); - /*<>*/ /*<>*/ var _L_ = 1; - /*<>*/ return _L_; + /*<>*/ /*<>*/ var _K_ = 1; + /*<>*/ return _K_; } - catch(_M_){ - var _K_ = caml_wrap_exception(_M_); - if(_K_ === Stdlib[8]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_K_, 0); + catch(_L_){ + var _J_ = caml_wrap_exception(_L_); + if(_J_ === Stdlib[8]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_J_, 0); } /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_String_contains_from_Bytes); @@ -5212,40 +5535,42 @@ /*<>*/ if(0 <= i && caml_ml_bytes_length(s) > i) /*<>*/ try{ /*<>*/ rindex_rec(s, i, c); - /*<>*/ /*<>*/ var _I_ = 1; - /*<>*/ return _I_; + /*<>*/ /*<>*/ var _H_ = 1; + /*<>*/ return _H_; } - catch(_J_){ - var _H_ = caml_wrap_exception(_J_); - if(_H_ === Stdlib[8]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_H_, 0); + catch(_I_){ + var _G_ = caml_wrap_exception(_I_); + if(_G_ === Stdlib[8]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_G_, 0); } /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_String_rcontains_from_Byte); /*<>*/ } - var compare = runtime.caml_bytes_compare; + var + compare = runtime.caml_bytes_compare, + cst_Bytes_of_seq_cannot_grow_b = "Bytes.of_seq: cannot grow bytes"; function split_on_char(sep, s){ /*<>*/ var /*<>*/ r = [0, 0], /*<>*/ j = [0, /*<>*/ caml_ml_bytes_length(s)], - /*<>*/ _D_ = + /*<>*/ _C_ = /*<>*/ caml_ml_bytes_length(s) - 1 | 0; - if(_D_ >= 0){ - var i = _D_; + if(_C_ >= 0){ + var i = _C_; for(;;){ if(caml_bytes_unsafe_get(s, i) === sep){ - var _F_ = r[1]; - r[1] = [0, sub(s, i + 1 | 0, (j[1] - i | 0) - 1 | 0), _F_]; + var _E_ = r[1]; + r[1] = [0, sub(s, i + 1 | 0, (j[1] - i | 0) - 1 | 0), _E_]; j[1] = i; } - /*<>*/ /*<>*/ var _G_ = i - 1 | 0; - if(0 !== i){var i = _G_; continue;} - break; + /*<>*/ /*<>*/ var _F_ = i - 1 | 0; + if(0 === i) break; + i = _F_; } } - var _E_ = r[1]; - /*<>*/ return [0, sub(s, 0, j[1]), _E_]; + var _D_ = r[1]; + /*<>*/ return [0, sub(s, 0, j[1]), _D_]; /*<>*/ } function to_seq(s){ function aux(i, param){ @@ -5254,14 +5579,14 @@ /*<>*/ var /*<>*/ x = /*<>*/ caml_bytes_get(s, i), - /*<>*/ _B_ = i + 1 | 0; + /*<>*/ _A_ = i + 1 | 0; /*<>*/ return [0, x, - function(_C_){ /*<>*/ return aux(_B_, _C_);}]; + function(_B_){ /*<>*/ return aux(_A_, _B_);}]; /*<>*/ } - /*<>*/ /*<>*/ var _z_ = 0; - /*<>*/ return function(_A_){ - /*<>*/ return aux(_z_, _A_);}; + /*<>*/ var _y_ = 0; + /*<>*/ return function(_z_){ + /*<>*/ return aux(_y_, _z_);}; /*<>*/ } function to_seqi(s){ function aux(i, param){ @@ -5270,42 +5595,43 @@ /*<>*/ var /*<>*/ x = /*<>*/ caml_bytes_get(s, i), - /*<>*/ _x_ = i + 1 | 0; + /*<>*/ _w_ = i + 1 | 0; /*<>*/ return [0, [0, i, x], - function(_y_){ /*<>*/ return aux(_x_, _y_);}]; + function(_x_){ /*<>*/ return aux(_w_, _x_);}]; /*<>*/ } - /*<>*/ /*<>*/ var _v_ = 0; - /*<>*/ return function(_w_){ - /*<>*/ return aux(_v_, _w_);}; + /*<>*/ var _u_ = 0; + /*<>*/ return function(_v_){ + /*<>*/ return aux(_u_, _v_);}; /*<>*/ } function of_seq(i){ /*<>*/ var /*<>*/ n = [0, 0], /*<>*/ buf = [0, make(256, 0)]; - function _u_(c){ - /*<>*/ if(n[1] === caml_ml_bytes_length(buf[1])){ - /*<>*/ /*<>*/ var - new_len = - /*<>*/ caml_call2 - (Stdlib_Int[10], - 2 * caml_ml_bytes_length(buf[1]) | 0, - Stdlib_Sys[12]); - if(caml_ml_bytes_length(buf[1]) === new_len) - /*<>*/ /*<>*/ caml_call1 - (Stdlib[2], cst_Bytes_of_seq_cannot_grow_b); - /*<>*/ /*<>*/ var - new_buf = make(new_len, 0); - /*<>*/ blit(buf[1], 0, new_buf, 0, n[1]); - buf[1] = new_buf; - } - /*<>*/ /*<>*/ caml_bytes_set - (buf[1], n[1], c); - n[1]++; - return 0; - /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Seq[4], _u_, i); + (Stdlib_Seq[4], + function(c){ + /*<>*/ if(n[1] === caml_ml_bytes_length(buf[1])){ + /*<>*/ /*<>*/ var + new_len = + /*<>*/ caml_call2 + (Stdlib_Int[10], + 2 * caml_ml_bytes_length(buf[1]) | 0, + Stdlib_Sys[12]); + if(caml_ml_bytes_length(buf[1]) === new_len) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[2], cst_Bytes_of_seq_cannot_grow_b); + /*<>*/ /*<>*/ var + new_buf = make(new_len, 0); + /*<>*/ blit(buf[1], 0, new_buf, 0, n[1]); + buf[1] = new_buf; + } + /*<>*/ /*<>*/ caml_bytes_set + (buf[1], n[1], c); + n[1]++; + return 0; + /*<>*/ }, + i); return sub(buf[1], 0, n[1]); /*<>*/ } function unsafe_get_uint16_le(b, i){ @@ -5381,14 +5707,22 @@ ( /*<>*/ caml_bytes_get64(b, i)); /*<>*/ } function unsafe_set_uint16_le(b, i, x){ - /*<>*/ return Stdlib_Sys[11] - ? /*<>*/ caml_bytes_set16(b, i, caml_bswap16(x)) - : /*<>*/ caml_bytes_set16(b, i, x); + /*<>*/ if(Stdlib_Sys[11]){ + /*<>*/ /*<>*/ caml_bytes_set16 + (b, i, caml_bswap16(x)); + /*<>*/ return; + } + /*<>*/ /*<>*/ caml_bytes_set16(b, i, x); + /*<>*/ return; /*<>*/ } function unsafe_set_uint16_be(b, i, x){ - /*<>*/ return Stdlib_Sys[11] - ? /*<>*/ caml_bytes_set16(b, i, x) - : /*<>*/ caml_bytes_set16(b, i, caml_bswap16(x)); + /*<>*/ if(Stdlib_Sys[11]){ + /*<>*/ /*<>*/ caml_bytes_set16(b, i, x); + /*<>*/ return; + } + /*<>*/ /*<>*/ caml_bytes_set16 + (b, i, caml_bswap16(x)); + /*<>*/ return; /*<>*/ } function set_int16_le(b, i, x){ /*<>*/ return Stdlib_Sys[11] @@ -5427,7 +5761,17 @@ var set_uint8 = caml_bytes_set, set_uint16_ne = caml_bytes_set16, - dec_invalid = Stdlib_Uchar[22]; + dec_invalid = Stdlib_Uchar[22], + _a_ = [0, cst_bytes_ml, 679, 9], + _b_ = [0, cst_bytes_ml, 654, 20], + cst_index_out_of_bounds = cst_index_out_of_bounds$3, + cst_index_out_of_bounds$0 = cst_index_out_of_bounds$3, + _c_ = [0, cst_bytes_ml, 777, 9], + _d_ = [0, cst_bytes_ml, 766, 20], + cst_index_out_of_bounds$1 = cst_index_out_of_bounds$3, + cst_index_out_of_bounds$2 = cst_index_out_of_bounds$3, + _e_ = [0, cst_bytes_ml, 831, 9], + _f_ = [0, cst_bytes_ml, 820, 20]; function dec_ret(n, u){ /*<>*/ /*<>*/ var _l_ = /*<>*/ caml_call1(Stdlib_Uchar[9], u); @@ -5466,19 +5810,19 @@ /*<>*/ caml_bytes_get(b, i), /*<>*/ max = /*<>*/ caml_ml_bytes_length(b) - 1 | 0; - /*<>*/ if(224 <= b0){ - var switch$0 = 0; - if(237 <= b0){ - if(245 > b0) + a: + { + /*<>*/ if(224 <= b0){ + if(237 <= b0){ + if(245 <= b0) break a; switch(b0 - 237 | 0){ case 0: /*<>*/ /*<>*/ var i$0 = i + 1 | 0; if(max < i$0) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); - /*<>*/ /*<>*/ var - b1 = /*<>*/ caml_bytes_unsafe_get(b, i$0); - /*<>*/ if(not_in_x80_to_x9F(b1)) + var b1$4 = caml_bytes_unsafe_get(b, i$0); + /*<>*/ if(not_in_x80_to_x9F(b1$4)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); /*<>*/ /*<>*/ var @@ -5486,19 +5830,17 @@ if(max < i$1) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); - /*<>*/ /*<>*/ var - b2 = /*<>*/ caml_bytes_unsafe_get(b, i$1); - /*<>*/ return not_in_x80_to_xBF(b2) + var b2$3 = caml_bytes_unsafe_get(b, i$1); + /*<>*/ return not_in_x80_to_xBF(b2$3) ? /*<>*/ caml_call1(dec_invalid, 2) - : dec_ret(3, utf_8_uchar_3(b0, b1, b2)); + : dec_ret(3, utf_8_uchar_3(b0, b1$4, b2$3)); case 3: /*<>*/ /*<>*/ var i$4 = i + 1 | 0; if(max < i$4) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); - /*<>*/ /*<>*/ var - b1$1 = /*<>*/ caml_bytes_unsafe_get(b, i$4); - /*<>*/ if(not_in_x90_to_xBF(b1$1)) + var b1$2 = caml_bytes_unsafe_get(b, i$4); + /*<>*/ if(not_in_x90_to_xBF(b1$2)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); /*<>*/ /*<>*/ var @@ -5506,8 +5848,7 @@ if(max < i$5) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); - /*<>*/ /*<>*/ var - b2$1 = /*<>*/ caml_bytes_unsafe_get(b, i$5); + var b2$1 = caml_bytes_unsafe_get(b, i$5); /*<>*/ if(not_in_x80_to_xBF(b2$1)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); @@ -5516,20 +5857,18 @@ if(max < i$6) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 3); - /*<>*/ /*<>*/ var - b3 = /*<>*/ caml_bytes_unsafe_get(b, i$6); - /*<>*/ return not_in_x80_to_xBF(b3) + var b3$1 = caml_bytes_unsafe_get(b, i$6); + /*<>*/ return not_in_x80_to_xBF(b3$1) ? /*<>*/ caml_call1(dec_invalid, 3) - : dec_ret(4, utf_8_uchar_4(b0, b1$1, b2$1, b3)); + : dec_ret(4, utf_8_uchar_4(b0, b1$2, b2$1, b3$1)); case 7: /*<>*/ /*<>*/ var i$10 = i + 1 | 0; if(max < i$10) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); - /*<>*/ /*<>*/ var - b1$3 = /*<>*/ caml_bytes_unsafe_get(b, i$10); - /*<>*/ if(not_in_x80_to_x8F(b1$3)) + var b1$0 = caml_bytes_unsafe_get(b, i$10); + /*<>*/ if(not_in_x80_to_x8F(b1$0)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); /*<>*/ /*<>*/ var @@ -5537,9 +5876,8 @@ if(max < i$11) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); - /*<>*/ /*<>*/ var - b2$3 = /*<>*/ caml_bytes_unsafe_get(b, i$11); - /*<>*/ if(not_in_x80_to_xBF(b2$3)) + var b2 = caml_bytes_unsafe_get(b, i$11); + /*<>*/ if(not_in_x80_to_xBF(b2)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); /*<>*/ /*<>*/ var @@ -5547,22 +5885,19 @@ if(max < i$12) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 3); - /*<>*/ /*<>*/ var - b3$1 = /*<>*/ caml_bytes_unsafe_get(b, i$12); - /*<>*/ return not_in_x80_to_xBF(b3$1) + var b3 = caml_bytes_unsafe_get(b, i$12); + /*<>*/ return not_in_x80_to_xBF(b3) ? /*<>*/ caml_call1(dec_invalid, 3) - : dec_ret(4, utf_8_uchar_4(b0, b1$3, b2$3, b3$1)); + : dec_ret(4, utf_8_uchar_4(b0, b1$0, b2, b3)); case 1: - case 2: - switch$0 = 1; break; + case 2: break; default: /*<>*/ /*<>*/ var i$7 = i + 1 | 0; if(max < i$7) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); - /*<>*/ /*<>*/ var - b1$2 = /*<>*/ caml_bytes_unsafe_get(b, i$7); - /*<>*/ if(not_in_x80_to_xBF(b1$2)) + var b1$1 = caml_bytes_unsafe_get(b, i$7); + /*<>*/ if(not_in_x80_to_xBF(b1$1)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); /*<>*/ /*<>*/ var @@ -5570,9 +5905,8 @@ if(max < i$8) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); - /*<>*/ /*<>*/ var - b2$2 = /*<>*/ caml_bytes_unsafe_get(b, i$8); - /*<>*/ if(not_in_x80_to_xBF(b2$2)) + var b2$0 = caml_bytes_unsafe_get(b, i$8); + /*<>*/ if(not_in_x80_to_xBF(b2$0)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); /*<>*/ /*<>*/ var @@ -5580,22 +5914,19 @@ if(max < i$9) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 3); - /*<>*/ /*<>*/ var - b3$0 = /*<>*/ caml_bytes_unsafe_get(b, i$9); + var b3$0 = caml_bytes_unsafe_get(b, i$9); /*<>*/ return not_in_x80_to_xBF(b3$0) ? /*<>*/ caml_call1(dec_invalid, 3) - : dec_ret(4, utf_8_uchar_4(b0, b1$2, b2$2, b3$0)); + : dec_ret(4, utf_8_uchar_4(b0, b1$1, b2$0, b3$0)); } - } - else{ - if(225 > b0){ + } + else if(225 > b0){ /*<>*/ /*<>*/ var i$13 = i + 1 | 0; if(max < i$13) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); - /*<>*/ /*<>*/ var - b1$4 = /*<>*/ caml_bytes_unsafe_get(b, i$13); - /*<>*/ if(not_in_xA0_to_xBF(b1$4)) + var b1$5 = caml_bytes_unsafe_get(b, i$13); + /*<>*/ if(not_in_xA0_to_xBF(b1$5)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); /*<>*/ /*<>*/ var @@ -5603,47 +5934,38 @@ if(max < i$14) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); - /*<>*/ /*<>*/ var - b2$4 = /*<>*/ caml_bytes_unsafe_get(b, i$14); + var b2$4 = caml_bytes_unsafe_get(b, i$14); /*<>*/ return not_in_x80_to_xBF(b2$4) ? /*<>*/ caml_call1(dec_invalid, 2) - : dec_ret(3, utf_8_uchar_3(b0, b1$4, b2$4)); + : dec_ret(3, utf_8_uchar_3(b0, b1$5, b2$4)); } - switch$0 = 1; - } - if(switch$0){ /*<>*/ /*<>*/ var i$2 = i + 1 | 0; if(max < i$2) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); - /*<>*/ /*<>*/ var - b1$0 = /*<>*/ caml_bytes_unsafe_get(b, i$2); - /*<>*/ if(not_in_x80_to_xBF(b1$0)) + var b1$3 = caml_bytes_unsafe_get(b, i$2); + /*<>*/ if(not_in_x80_to_xBF(b1$3)) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); /*<>*/ /*<>*/ var i$3 = i$2 + 1 | 0; if(max < i$3) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 2); - /*<>*/ /*<>*/ var - b2$0 = /*<>*/ caml_bytes_unsafe_get(b, i$3); - /*<>*/ return not_in_x80_to_xBF(b2$0) + var b2$2 = caml_bytes_unsafe_get(b, i$3); + /*<>*/ return not_in_x80_to_xBF(b2$2) ? /*<>*/ caml_call1(dec_invalid, 2) - : dec_ret(3, utf_8_uchar_3(b0, b1$0, b2$0)); + : dec_ret(3, utf_8_uchar_3(b0, b1$3, b2$2)); } - } - else{ if(128 > b0) /*<>*/ return dec_ret(1, b0); if(194 <= b0){ /*<>*/ /*<>*/ var i$15 = i + 1 | 0; if(max < i$15) /*<>*/ return /*<>*/ caml_call1 (dec_invalid, 1); - /*<>*/ /*<>*/ var - b1$5 = /*<>*/ caml_bytes_unsafe_get(b, i$15); - /*<>*/ return not_in_x80_to_xBF(b1$5) + var b1 = caml_bytes_unsafe_get(b, i$15); + /*<>*/ return not_in_x80_to_xBF(b1) ? /*<>*/ caml_call1(dec_invalid, 1) - : dec_ret(2, (b0 & 31) << 6 | b1$5 & 63); + : dec_ret(2, (b0 & 31) << 6 | b1 & 63); } } /*<>*/ return /*<>*/ caml_call1 @@ -5652,7 +5974,7 @@ function set_utf_8_uchar(b, i, u){ /*<>*/ function set(_i_, _h_, _g_){ /*<>*/ caml_bytes_unsafe_set(_i_, _h_, _g_); - return 0; + return; } /*<>*/ var /*<>*/ max = @@ -5663,14 +5985,14 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _b_], 1); /*<>*/ if(127 >= u$0){ - /*<>*/ /*<>*/ caml_bytes_set(b, i, u$0); + caml_bytes_set(b, i, u$0); /*<>*/ return 1; } /*<>*/ if(2047 >= u$0){ /*<>*/ /*<>*/ var last$1 = i + 1 | 0; return max < last$1 ? 0 - : ( /*<>*/ caml_bytes_set + : (caml_bytes_set (b, i, 192 | u$0 >>> 6 | 0), set(b, last$1, 128 | u$0 & 63), 2); @@ -5679,7 +6001,7 @@ /*<>*/ /*<>*/ var last$0 = i + 2 | 0; return max < last$0 ? 0 - : ( /*<>*/ caml_bytes_set + : (caml_bytes_set (b, i, 224 | u$0 >>> 12 | 0), set(b, i + 1 | 0, 128 | (u$0 >>> 6 | 0) & 63), set(b, last$0, 128 | u$0 & 63), @@ -5691,7 +6013,7 @@ /*<>*/ /*<>*/ var last = i + 3 | 0; return max < last ? 0 - : ( /*<>*/ caml_bytes_set + : (caml_bytes_set (b, i, 240 | u$0 >>> 18 | 0), set(b, i + 1 | 0, 128 | (u$0 >>> 12 | 0) & 63), set(b, i + 2 | 0, 128 | (u$0 >>> 6 | 0) & 63), @@ -5702,12 +6024,12 @@ /*<>*/ var max = caml_ml_bytes_length(b) - 1 | 0, i = 0; /*<>*/ for(;;){ if(max < i) /*<>*/ return 1; - /*<>*/ /*<>*/ var - match = /*<>*/ caml_bytes_unsafe_get(b, i); - if(224 <= match){ - var switch$0 = 0; - if(237 <= match){ - if(245 > match) + var match = caml_bytes_unsafe_get(b, i); + a: + { + if(224 <= match){ + if(237 <= match){ + if(245 <= match) break a; switch(match - 237 | 0){ case 0: /*<>*/ /*<>*/ var @@ -5716,15 +6038,11 @@ (max >= last && ! - not_in_x80_to_x9F - ( /*<>*/ caml_bytes_unsafe_get(b, i + 1 | 0)) - && - ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, last))){ - /*<>*/ var - /*<>*/ i$0 = last + 1 | 0, - i = i$0; + not_in_x80_to_x9F(caml_bytes_unsafe_get(b, i + 1 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last))){ + /*<>*/ /*<>*/ var + i$0 = last + 1 | 0; + i = i$0; continue; } /*<>*/ return 0; @@ -5735,19 +6053,14 @@ (max >= last$1 && ! - not_in_x90_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, i + 1 | 0)) + not_in_x90_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) && ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, i + 2 | 0)) - && - ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, last$1))){ - /*<>*/ var - /*<>*/ i$2 = last$1 + 1 | 0, - i = i$2; + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$1))){ + /*<>*/ /*<>*/ var + i$2 = last$1 + 1 | 0; + i = i$2; continue; } /*<>*/ return 0; @@ -5758,25 +6071,19 @@ (max >= last$3 && ! - not_in_x80_to_x8F - ( /*<>*/ caml_bytes_unsafe_get(b, i + 1 | 0)) + not_in_x80_to_x8F(caml_bytes_unsafe_get(b, i + 1 | 0)) && ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, i + 2 | 0)) - && - ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, last$3))){ - /*<>*/ var - /*<>*/ i$4 = last$3 + 1 | 0, - i = i$4; + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$3))){ + /*<>*/ /*<>*/ var + i$4 = last$3 + 1 | 0; + i = i$4; continue; } /*<>*/ return 0; case 1: - case 2: - switch$0 = 1; break; + case 2: break; default: /*<>*/ /*<>*/ var last$2 = i + 3 | 0; @@ -5784,85 +6091,62 @@ (max >= last$2 && ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, i + 1 | 0)) + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) && ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, i + 2 | 0)) - && - ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, last$2))){ - /*<>*/ var - /*<>*/ i$3 = last$2 + 1 | 0, - i = i$3; + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$2))){ + /*<>*/ /*<>*/ var + i$3 = last$2 + 1 | 0; + i = i$3; continue; } /*<>*/ return 0; } - } - else{ - if(225 > match){ + } + else if(225 > match){ /*<>*/ /*<>*/ var last$4 = i + 2 | 0; /*<>*/ if (max >= last$4 && ! - not_in_xA0_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, i + 1 | 0)) - && - ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, last$4))){ - /*<>*/ var - /*<>*/ i$5 = last$4 + 1 | 0, - i = i$5; + not_in_xA0_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$4))){ + /*<>*/ /*<>*/ var + i$5 = last$4 + 1 | 0; + i = i$5; continue; } /*<>*/ return 0; } - switch$0 = 1; - } - if(switch$0){ /*<>*/ /*<>*/ var last$0 = i + 2 | 0; /*<>*/ if (max >= last$0 && ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, i + 1 | 0)) - && - ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, last$0))){ - /*<>*/ var - /*<>*/ i$1 = last$0 + 1 | 0, - i = i$1; + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$0))){ + /*<>*/ /*<>*/ var + i$1 = last$0 + 1 | 0; + i = i$1; continue; } /*<>*/ return 0; } - } - else{ if(128 > match){ - /*<>*/ var - /*<>*/ i$7 = i + 1 | 0, - i = i$7; + /*<>*/ /*<>*/ var i$7 = i + 1 | 0; + i = i$7; continue; } if(194 <= match){ /*<>*/ /*<>*/ var last$5 = i + 1 | 0; /*<>*/ if (max >= last$5 - && - ! - not_in_x80_to_xBF - ( /*<>*/ caml_bytes_unsafe_get(b, last$5))){ - /*<>*/ var - /*<>*/ i$6 = last$5 + 1 | 0, - i = i$6; + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$5))){ + /*<>*/ /*<>*/ var + i$6 = last$5 + 1 | 0; + i = i$6; continue; } /*<>*/ return 0; @@ -5944,16 +6228,14 @@ /*<>*/ /*<>*/ var u$0 = unsafe_get_uint16_be(b, i + 2 | 0); if(56320 <= u$0 && 57343 >= u$0){ - /*<>*/ var - /*<>*/ i$1 = i + 4 | 0, - i = i$1; + /*<>*/ /*<>*/ var i$1 = i + 4 | 0; + i = i$1; continue; } /*<>*/ return 0; } - /*<>*/ var - /*<>*/ i$0 = i + 2 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 2 | 0; + i = i$0; } /*<>*/ } function get_utf_16le_uchar(b, i){ @@ -6029,16 +6311,14 @@ /*<>*/ /*<>*/ var u$0 = unsafe_get_uint16_le(b, i + 2 | 0); if(56320 <= u$0 && 57343 >= u$0){ - /*<>*/ var - /*<>*/ i$1 = i + 4 | 0, - i = i$1; + /*<>*/ /*<>*/ var i$1 = i + 4 | 0; + i = i$1; continue; } /*<>*/ return 0; } - /*<>*/ var - /*<>*/ i$0 = i + 2 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 2 | 0; + i = i$0; } /*<>*/ } var @@ -6173,18 +6453,7 @@ Stdlib = global_data.Stdlib, Stdlib_Bytes = global_data.Stdlib__Bytes, bts = Stdlib_Bytes[44], - bos = Stdlib_Bytes[45], - cst_String_rcontains_from_Byte = - "String.rcontains_from / Bytes.rcontains_from", - cst_String_contains_from_Bytes = - "String.contains_from / Bytes.contains_from", - cst_String_rindex_from_opt_Byt = - "String.rindex_from_opt / Bytes.rindex_from_opt", - cst_String_rindex_from_Bytes_r = "String.rindex_from / Bytes.rindex_from", - cst_String_index_from_opt_Byte = - "String.index_from_opt / Bytes.index_from_opt", - cst_String_index_from_Bytes_in = "String.index_from / Bytes.index_from", - cst_String_concat = "String.concat"; + bos = Stdlib_Bytes[45]; function make(n, c){ /*<>*/ return /*<>*/ caml_call1 (bts, /*<>*/ caml_call2(Stdlib_Bytes[1], n, c)); @@ -6202,62 +6471,76 @@ /*<>*/ caml_call3 (Stdlib_Bytes[7], _X_, ofs, len)); /*<>*/ } - var blit = Stdlib_Bytes[12]; + var blit = Stdlib_Bytes[12], cst_String_concat = "String.concat"; function concat(sep, l){ /*<>*/ if(! l) /*<>*/ return cst; - var seplen = caml_ml_string_length(sep), acc = 0, param = l, pos$1 = 0; - for(;;){ - if(param){ - var hd = param[1]; - if(param[2]){ + var seplen = caml_ml_string_length(sep); + a: + { + b: + { + var acc = 0, param = l, pos$1 = 0; + for(;;){ + if(! param) break; + var hd = param[1]; + if(! param[2]) break b; var tl = param[2], x = (caml_ml_string_length(hd) + seplen | 0) + acc | 0, acc$0 = acc <= x ? x - : /*<>*/ caml_call1(Stdlib[1], cst_String_concat), - acc = acc$0, - param = tl; - continue; + : /*<>*/ caml_call1(Stdlib[1], cst_String_concat); + acc = acc$0; + param = tl; } - var _W_ = caml_ml_string_length(hd) + acc | 0; - } - else var _W_ = acc; - /*<>*/ var - /*<>*/ dst = - /*<>*/ runtime.caml_create_bytes(_W_), - pos = pos$1, - param$0 = l; - for(;;){ - if(param$0){ - var hd$0 = param$0[1]; - if(param$0[2]){ - var tl$0 = param$0[2]; - /*<>*/ /*<>*/ caml_blit_string - (hd$0, - 0, - dst, - pos, - /*<>*/ caml_ml_string_length(hd$0)); - /*<>*/ /*<>*/ caml_blit_string - (sep, 0, dst, pos + caml_ml_string_length(hd$0) | 0, seplen); - var - pos$0 = (pos + caml_ml_string_length(hd$0) | 0) + seplen | 0, - pos = pos$0, - param$0 = tl$0; - continue; - } - /*<>*/ /*<>*/ caml_blit_string - (hd$0, 0, dst, pos, caml_ml_string_length(hd$0)); + break a; + } + var _W_ = caml_ml_string_length(hd) + acc | 0; + } + /*<>*/ var + /*<>*/ dst = + /*<>*/ runtime.caml_create_bytes(_W_), + pos = pos$1, + param$0 = l; + for(;;){ + if(param$0){ + var hd$0 = param$0[1]; + if(param$0[2]){ + var tl$0 = param$0[2]; + /*<>*/ /*<>*/ caml_blit_string + (hd$0, + 0, + dst, + pos, + /*<>*/ caml_ml_string_length(hd$0)); + /*<>*/ /*<>*/ caml_blit_string + (sep, 0, dst, pos + caml_ml_string_length(hd$0) | 0, seplen); + var pos$0 = (pos + caml_ml_string_length(hd$0) | 0) + seplen | 0; + pos = pos$0; + param$0 = tl$0; + continue; } - /*<>*/ return /*<>*/ caml_call1 - (bts, dst); + /*<>*/ /*<>*/ caml_blit_string + (hd$0, 0, dst, pos, caml_ml_string_length(hd$0)); } + /*<>*/ return /*<>*/ caml_call1 + (bts, dst); } } - var cat = Stdlib[28]; + var + cat = Stdlib[28], + cst_String_index_from_Bytes_in = "String.index_from / Bytes.index_from", + cst_String_index_from_opt_Byte = + "String.index_from_opt / Bytes.index_from_opt", + cst_String_rindex_from_Bytes_r = "String.rindex_from / Bytes.rindex_from", + cst_String_rindex_from_opt_Byt = + "String.rindex_from_opt / Bytes.rindex_from_opt", + cst_String_contains_from_Bytes = + "String.contains_from / Bytes.contains_from", + cst_String_rcontains_from_Byte = + "String.rcontains_from / Bytes.rcontains_from"; function iter(f, s){ /*<>*/ var _U_ = caml_ml_string_length(s) - 1 | 0, @@ -6268,8 +6551,8 @@ /*<>*/ /*<>*/ caml_call1 (f, caml_string_unsafe_get(s, i)); /*<>*/ /*<>*/ var _V_ = i + 1 | 0; - if(_U_ !== i){var i = _V_; continue;} - break; + if(_U_ === i) break; + i = _V_; } } return 0; @@ -6284,8 +6567,8 @@ /*<>*/ /*<>*/ caml_call2 (f, i, caml_string_unsafe_get(s, i)); /*<>*/ /*<>*/ var _S_ = i + 1 | 0; - if(_R_ !== i){var i = _S_; continue;} - break; + if(_R_ === i) break; + i = _S_; } } return 0; @@ -6329,18 +6612,16 @@ (Stdlib_Bytes[21], f, _K_); /*<>*/ } function is_space(param){ - /*<>*/ var - /*<>*/ _J_ = param - 9 | 0, - switch$0 = 0; - if(4 < _J_ >>> 0){ - if(23 === _J_) switch$0 = 1; - } - else if(2 !== _J_) switch$0 = 1; - return switch$0 ? 1 : 0; + /*<>*/ /*<>*/ var _J_ = param - 9 | 0; + a: + { + if(4 < _J_ >>> 0){if(23 !== _J_) break a;} else if(2 === _J_) break a; + /*<>*/ return 1; + } + /*<>*/ return 0; /*<>*/ } function trim(s){ - /*<>*/ if - ( /*<>*/ caml_string_equal(s, cst$0)) + /*<>*/ if(s == cst$0) /*<>*/ return s; /*<>*/ if (! @@ -6368,7 +6649,8 @@ (Stdlib[8], 1); if(caml_string_unsafe_get(s, i$0) === c) /*<>*/ return i$0; - var i$1 = i$0 + 1 | 0, i$0 = i$1; + var i$1 = i$0 + 1 | 0; + i$0 = i$1; } /*<>*/ } function index(s, c){ @@ -6381,7 +6663,8 @@ if(lim <= i$0) /*<>*/ return 0; if(caml_string_unsafe_get(s, i$0) === c) /*<>*/ return [0, i$0]; - var i$1 = i$0 + 1 | 0, i$0 = i$1; + var i$1 = i$0 + 1 | 0; + i$0 = i$1; } /*<>*/ } function index_opt(s, c){ @@ -6410,7 +6693,8 @@ (Stdlib[8], 1); if(caml_string_unsafe_get(s, i$0) === c) /*<>*/ return i$0; - var i$1 = i$0 - 1 | 0, i$0 = i$1; + var i$1 = i$0 - 1 | 0; + i$0 = i$1; } /*<>*/ } function rindex(s, c){ @@ -6429,7 +6713,8 @@ if(0 > i$0) /*<>*/ return 0; if(caml_string_unsafe_get(s, i$0) === c) /*<>*/ return [0, i$0]; - var i$1 = i$0 - 1 | 0, i$0 = i$1; + var i$1 = i$0 - 1 | 0; + i$0 = i$1; } /*<>*/ } function rindex_opt(s, c){ @@ -6511,9 +6796,8 @@ if(i === len_pre) /*<>*/ return 1; if(caml_string_unsafe_get(s, i) !== caml_string_unsafe_get(prefix, i)) /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } /*<>*/ } function ends_with(suffix, s){ @@ -6530,9 +6814,8 @@ (caml_string_unsafe_get(s, diff + i | 0) !== caml_string_unsafe_get(suffix, i)) /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } /*<>*/ } function hash(x){ @@ -6555,8 +6838,8 @@ j[1] = i; } /*<>*/ /*<>*/ var _v_ = i - 1 | 0; - if(0 !== i){var i = _v_; continue;} - break; + if(0 === i) break; + i = _v_; } } var _t_ = r[1]; @@ -6683,6 +6966,7 @@ empty, of_bytes, to_bytes, + blit, concat, cat, caml_string_equal, @@ -6725,7 +7009,6 @@ is_valid_utf_16be, get_utf_16le_uchar, is_valid_utf_16le, - blit, runtime.caml_string_get, get_int8, runtime.caml_string_get16, @@ -6751,10 +7034,10 @@ (function(globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, cst = "()"; - function equal(param, _b_){ + function equal(_b_, param){ /*<>*/ return 1; /*<>*/ } - function compare(param, _a_){ + function compare(_a_, param){ /*<>*/ return 0; /*<>*/ } function to_string(param){ @@ -6785,50 +7068,50 @@ global_data = runtime.caml_get_global_data(), Stdlib_Bytes = global_data.Stdlib__Bytes, Stdlib = global_data.Stdlib, - cst_Marshal_from_bytes = cst_Marshal_from_bytes$1, - cst_Marshal_from_bytes$0 = cst_Marshal_from_bytes$1, - cst_Marshal_data_size = "Marshal.data_size", cst_Marshal_to_buffer_substrin = "Marshal.to_buffer: substring out of bounds"; function to_buffer(buff, ofs, len, v, flags){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (caml_ml_bytes_length(buff) - len | 0) >= ofs) - /*<>*/ return /*<>*/ runtime.caml_output_value_to_buffer + /*<>*/ return /*<>*/ runtime.caml_output_value_to_buffer (buff, ofs, len, v, flags); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Marshal_to_buffer_substrin); - /*<>*/ } - var header_size = 20; + /*<>*/ } + var + cst_Marshal_data_size = "Marshal.data_size", + cst_Marshal_from_bytes = cst_Marshal_from_bytes$1, + cst_Marshal_from_bytes$0 = cst_Marshal_from_bytes$1; function data_size(buff, ofs){ - /*<>*/ if - (0 <= ofs && (caml_ml_bytes_length(buff) - 20 | 0) >= ofs) - /*<>*/ return /*<>*/ caml_marshal_data_size + /*<>*/ if + (0 <= ofs && (caml_ml_bytes_length(buff) - 16 | 0) >= ofs) + /*<>*/ return /*<>*/ caml_marshal_data_size (buff, ofs); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Marshal_data_size); - /*<>*/ } + /*<>*/ } function total_size(buff, ofs){ - /*<>*/ return 20 + data_size(buff, ofs) | 0; - /*<>*/ } + /*<>*/ return 16 + data_size(buff, ofs) | 0; + /*<>*/ } function from_bytes(buff, ofs){ - /*<>*/ if - (0 <= ofs && (caml_ml_bytes_length(buff) - 20 | 0) >= ofs){ - /*<>*/ /*<>*/ var - len = /*<>*/ caml_marshal_data_size(buff, ofs); - return (caml_ml_bytes_length(buff) - (20 + len | 0) | 0) < ofs - ? /*<>*/ caml_call1 + /*<>*/ if + (0 <= ofs && (caml_ml_bytes_length(buff) - 16 | 0) >= ofs){ + /*<>*/ /*<>*/ var + len = /*<>*/ caml_marshal_data_size(buff, ofs); + return (caml_ml_bytes_length(buff) - (16 + len | 0) | 0) < ofs + ? /*<>*/ caml_call1 (Stdlib[1], cst_Marshal_from_bytes$0) - : /*<>*/ runtime.caml_input_value_from_bytes + : /*<>*/ runtime.caml_input_value_from_bytes (buff, ofs); } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Marshal_from_bytes); - /*<>*/ } + /*<>*/ } function from_string(buff, ofs){ - /*<>*/ return from_bytes - ( /*<>*/ caml_call1(Stdlib_Bytes[45], buff), + /*<>*/ return from_bytes + ( /*<>*/ caml_call1(Stdlib_Bytes[45], buff), ofs); - /*<>*/ } + /*<>*/ } var Stdlib_Marshal = [0, @@ -6837,7 +7120,7 @@ runtime.caml_input_value, from_bytes, from_string, - header_size, + 16, data_size, total_size]; runtime.caml_register_global(6, Stdlib_Marshal, "Stdlib__Marshal"); @@ -6846,7 +7129,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Array -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Seq +//# unitInfo: Requires: Stdlib, Stdlib__Seq (function (globalThis){ "use strict"; @@ -6878,779 +7161,892 @@ Assert_failure = global_data.Assert_failure, Stdlib = global_data.Stdlib, /*<>*/ Floatarray = [0], - _a_ = [0, "array.ml", 319, 4], - cst_Array_combine = "Array.combine", - cst_Array_exists2 = "Array.exists2", - cst_Array_for_all2 = "Array.for_all2", - cst_Array_map2_arrays_must_hav = - "Array.map2: arrays must have the same length", + cst_Array_init = "Array.init", + cst_Array_make_matrix = "Array.make_matrix", + cst_Array_init_matrix = "Array.init_matrix", + cst_Array_sub = "Array.sub", + cst_Array_fill = "Array.fill", + cst_Array_blit = "Array.blit", cst_Array_iter2_arrays_must_ha = "Array.iter2: arrays must have the same length", - cst_Array_blit = "Array.blit", - cst_Array_fill = "Array.fill", - cst_Array_sub = "Array.sub", - cst_Array_init = "Array.init", - cst_Stdlib_Array_Bottom = "Stdlib.Array.Bottom"; + cst_Array_map2_arrays_must_hav = + "Array.map2: arrays must have the same length", + cst_Array_for_all2 = "Array.for_all2", + cst_Array_exists2 = "Array.exists2", + cst_Array_combine = "Array.combine"; function init(l, f){ /*<>*/ if(0 === l) /*<>*/ return [0]; if(0 > l) /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_init); - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call1(f, 0)), - /*<>*/ _as_ = l - 1 | 0, - /*<>*/ _ar_ = 1; - if(_as_ >= 1){ - var i = _ar_; + /*<>*/ var + /*<>*/ res = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, 0)), + /*<>*/ _aE_ = l - 1 | 0, + /*<>*/ _aD_ = 1; + if(_aE_ >= 1){ + var i = _aD_; for(;;){ - /*<>*/ res[1 + i] = - /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _at_ = i + 1 | 0; - if(_as_ !== i){var i = _at_; continue;} - break; + /*<>*/ res[1 + i] = + /*<>*/ caml_call1(f, i); + /*<>*/ /*<>*/ var _aF_ = i + 1 | 0; + if(_aE_ === i) break; + i = _aF_; } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function make_matrix(sx, sy, init){ - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_make_vect(sx, [0]), - /*<>*/ _ap_ = sx - 1 | 0, - /*<>*/ _ao_ = 0; - if(_ap_ >= 0){ - var x = _ao_; - for(;;){ - res[1 + x] = /*<>*/ caml_make_vect(sy, init); - /*<>*/ /*<>*/ var _aq_ = x + 1 | 0; - if(_ap_ !== x){var x = _aq_; continue;} - break; + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Array_make_matrix); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_make_vect(sx, [0]); + if(0 < sy){ + /*<>*/ var + _aB_ = sx - 1 | 0, + /*<>*/ _aA_ = 0; + if(_aB_ >= 0){ + var x = _aA_; + for(;;){ + res[1 + x] = /*<>*/ caml_make_vect(sy, init); + /*<>*/ /*<>*/ var _aC_ = x + 1 | 0; + if(_aB_ === x) break; + x = _aC_; + } + } + } + /*<>*/ return res; + /*<>*/ } + function init_matrix(sx, sy, f){ + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Array_init_matrix); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_make_vect(sx, [0]); + if(0 < sy){ + /*<>*/ var + _av_ = sx - 1 | 0, + /*<>*/ _au_ = 0; + if(_av_ >= 0){ + var x = _au_; + for(;;){ + /*<>*/ var + /*<>*/ row = + /*<>*/ caml_make_vect + (sy, /*<>*/ caml_call2(f, x, 0)), + /*<>*/ _ax_ = sy - 1 | 0, + /*<>*/ _aw_ = 1; + if(_ax_ >= 1){ + var y = _aw_; + for(;;){ + /*<>*/ row[1 + y] = + /*<>*/ caml_call2(f, x, y); + /*<>*/ /*<>*/ var _az_ = y + 1 | 0; + if(_ax_ === y) break; + y = _az_; + } + } + res[1 + x] = row; + /*<>*/ /*<>*/ var _ay_ = x + 1 | 0; + if(_av_ === x) break; + x = _ay_; + } } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function copy(a){ - /*<>*/ var l = a.length - 1; - /*<>*/ return 0 === l + /*<>*/ var l = a.length - 1; + /*<>*/ return 0 === l ? [0] - : /*<>*/ caml_array_sub(a, 0, l); - /*<>*/ } + : /*<>*/ caml_array_sub(a, 0, l); + /*<>*/ } function append(a1, a2){ - /*<>*/ var l1 = a1.length - 1; - /*<>*/ return 0 === l1 + /*<>*/ var l1 = a1.length - 1; + /*<>*/ return 0 === l1 ? copy(a2) : 0 === a2.length - 1 - ? /*<>*/ caml_array_sub(a1, 0, l1) - : /*<>*/ runtime.caml_array_append(a1, a2); - /*<>*/ } + ? /*<>*/ caml_array_sub(a1, 0, l1) + : /*<>*/ runtime.caml_array_append(a1, a2); + /*<>*/ } function sub(a, ofs, len){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs) - /*<>*/ return /*<>*/ caml_array_sub + /*<>*/ return /*<>*/ caml_array_sub (a, ofs, len); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_sub); - /*<>*/ } + /*<>*/ } function fill(a, ofs, len, v){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs) - /*<>*/ return /*<>*/ runtime.caml_array_fill + /*<>*/ return /*<>*/ runtime.caml_array_fill (a, ofs, len, v); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_fill); - /*<>*/ } + /*<>*/ } function blit(a1, ofs1, a2, ofs2, len){ - /*<>*/ if + /*<>*/ if (0 <= len && 0 <= ofs1 && (a1.length - 1 - len | 0) >= ofs1 && 0 <= ofs2 && (a2.length - 1 - len | 0) >= ofs2) - /*<>*/ return /*<>*/ runtime.caml_array_blit + /*<>*/ return /*<>*/ runtime.caml_array_blit (a1, ofs1, a2, ofs2, len); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_blit); - /*<>*/ } + /*<>*/ } function iter(f, a){ - /*<>*/ var - _am_ = a.length - 1 - 1 | 0, - /*<>*/ _al_ = 0; - if(_am_ >= 0){ - var i = _al_; + /*<>*/ var + _as_ = a.length - 2 | 0, + /*<>*/ _ar_ = 0; + if(_as_ >= 0){ + var i = _ar_; for(;;){ - /*<>*/ /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _an_ = i + 1 | 0; - if(_am_ !== i){var i = _an_; continue;} - break; + /*<>*/ /*<>*/ caml_call1 + (f, a[1 + i]); + /*<>*/ /*<>*/ var _at_ = i + 1 | 0; + if(_as_ === i) break; + i = _at_; } } return 0; - /*<>*/ } + /*<>*/ } function iter2(f, a, b){ - /*<>*/ if(a.length - 1 !== b.length - 1) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(a.length - 1 !== b.length - 1) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_iter2_arrays_must_ha); - /*<>*/ var - _aj_ = a.length - 1 - 1 | 0, - /*<>*/ _ai_ = 0; - if(_aj_ >= 0){ - var i = _ai_; + /*<>*/ var + _ap_ = a.length - 2 | 0, + /*<>*/ _ao_ = 0; + if(_ap_ >= 0){ + var i = _ao_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ak_ = i + 1 | 0; - if(_aj_ !== i){var i = _ak_; continue;} - break; + /*<>*/ /*<>*/ var _aq_ = i + 1 | 0; + if(_ap_ === i) break; + i = _aq_; } } return 0; - /*<>*/ } + /*<>*/ } function map(f, a){ - /*<>*/ var l = a.length - 1; - /*<>*/ if(0 === l) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call1(f, a[1])), - /*<>*/ _ag_ = l - 1 | 0, - /*<>*/ _af_ = 1; - if(_ag_ >= 1){ + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, a[1])), + /*<>*/ _am_ = l - 1 | 0, + /*<>*/ _al_ = 1; + if(_am_ >= 1){ + var i = _al_; + for(;;){ + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _an_ = i + 1 | 0; + if(_am_ === i) break; + i = _an_; + } + } + /*<>*/ return r; + /*<>*/ } + function map_inplace(f, a){ + /*<>*/ var + _aj_ = a.length - 2 | 0, + /*<>*/ _ai_ = 0; + if(_aj_ >= 0){ + var i = _ai_; + for(;;){ + /*<>*/ a[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _ak_ = i + 1 | 0; + if(_aj_ === i) break; + i = _ak_; + } + } + return 0; + /*<>*/ } + function mapi_inplace(f, a){ + /*<>*/ var + _ag_ = a.length - 2 | 0, + /*<>*/ _af_ = 0; + if(_ag_ >= 0){ var i = _af_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; - if(_ag_ !== i){var i = _ah_; continue;} - break; + /*<>*/ a[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; + if(_ag_ === i) break; + i = _ah_; } } - /*<>*/ return r; - /*<>*/ } + return 0; + /*<>*/ } function map2(f, a, b){ - /*<>*/ var + /*<>*/ var la = a.length - 1, - /*<>*/ lb = b.length - 1; + /*<>*/ lb = b.length - 1; if(la !== lb) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_map2_arrays_must_hav); - if(0 === la) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_make_vect - (la, /*<>*/ caml_call2(f, a[1], b[1])), - /*<>*/ _ad_ = la - 1 | 0, - /*<>*/ _ac_ = 1; + if(0 === la) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (la, /*<>*/ caml_call2(f, a[1], b[1])), + /*<>*/ _ad_ = la - 1 | 0, + /*<>*/ _ac_ = 1; if(_ad_ >= 1){ var i = _ac_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ae_ = i + 1 | 0; - if(_ad_ !== i){var i = _ae_; continue;} - break; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); + /*<>*/ /*<>*/ var _ae_ = i + 1 | 0; + if(_ad_ === i) break; + i = _ae_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function iteri(f, a){ - /*<>*/ var - _aa_ = a.length - 1 - 1 | 0, - /*<>*/ _$_ = 0; + /*<>*/ var + _aa_ = a.length - 2 | 0, + /*<>*/ _$_ = 0; if(_aa_ >= 0){ var i = _$_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; - if(_aa_ !== i){var i = _ab_; continue;} - break; + /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; + if(_aa_ === i) break; + i = _ab_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi(f, a){ - /*<>*/ var l = a.length - 1; - /*<>*/ if(0 === l) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call2(f, 0, a[1])), - /*<>*/ _Z_ = l - 1 | 0, - /*<>*/ _Y_ = 1; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call2(f, 0, a[1])), + /*<>*/ _Z_ = l - 1 | 0, + /*<>*/ _Y_ = 1; if(_Z_ >= 1){ var i = _Y_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var ___ = i + 1 | 0; - if(_Z_ !== i){var i = ___; continue;} - break; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var ___ = i + 1 | 0; + if(_Z_ === i) break; + i = ___; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function to_list(a){ - /*<>*/ var i$1 = a.length - 1 - 1 | 0, i = i$1, res = 0; - /*<>*/ for(;;){ - if(0 > i) /*<>*/ return res; - /*<>*/ var - /*<>*/ res$0 = [0, a[1 + i], res], - /*<>*/ i$0 = i - 1 | 0, - i = i$0, - res = res$0; - } - /*<>*/ } + /*<>*/ var i$1 = a.length - 2 | 0, i = i$1, res = 0; + /*<>*/ for(;;){ + if(0 > i) /*<>*/ return res; + /*<>*/ var + /*<>*/ res$0 = [0, a[1 + i], res], + /*<>*/ i$0 = i - 1 | 0; + i = i$0; + res = res$0; + } + /*<>*/ } function list_length(accu, param){ var accu$0 = accu, param$0 = param; for(;;){ - if(! param$0) /*<>*/ return accu$0; - /*<>*/ var + if(! param$0) /*<>*/ return accu$0; + /*<>*/ var t = param$0[2], - /*<>*/ accu$1 = accu$0 + 1 | 0, - accu$0 = accu$1, - param$0 = t; + /*<>*/ accu$1 = accu$0 + 1 | 0; + accu$0 = accu$1; + param$0 = t; } } function of_list(l){ - /*<>*/ if(! l) /*<>*/ return [0]; - /*<>*/ var + /*<>*/ if(! l) /*<>*/ return [0]; + /*<>*/ var tl = l[2], hd = l[1], - /*<>*/ a = - /*<>*/ caml_make_vect(list_length(0, l), hd), + /*<>*/ a = + /*<>*/ caml_make_vect(list_length(0, l), hd), i = 1, param = tl; for(;;){ - if(! param) /*<>*/ return a; + if(! param) /*<>*/ return a; var tl$0 = param[2], hd$0 = param[1]; - /*<>*/ a[1 + i] = hd$0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0, - param = tl$0; + /*<>*/ a[1 + i] = hd$0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + param = tl$0; } - /*<>*/ } + /*<>*/ } function fold_left(f, x, a){ - /*<>*/ var - /*<>*/ r = [0, x], - _W_ = a.length - 1 - 1 | 0, - /*<>*/ _V_ = 0; + /*<>*/ var + /*<>*/ r = [0, x], + _W_ = a.length - 2 | 0, + /*<>*/ _V_ = 0; if(_W_ >= 0){ var i = _V_; for(;;){ - r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _X_ = i + 1 | 0; - if(_W_ !== i){var i = _X_; continue;} - break; + r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); + /*<>*/ /*<>*/ var _X_ = i + 1 | 0; + if(_W_ === i) break; + i = _X_; } } return r[1]; - /*<>*/ } + /*<>*/ } function fold_left_map(f, acc, input_array){ - /*<>*/ var len = input_array.length - 1; - /*<>*/ if(0 === len) - /*<>*/ return [0, acc, [0]]; - /*<>*/ var - /*<>*/ match = - /*<>*/ caml_call2(f, acc, input_array[1]), + /*<>*/ var len = input_array.length - 1; + /*<>*/ if(0 === len) + /*<>*/ return [0, acc, [0]]; + /*<>*/ var + /*<>*/ match = + /*<>*/ caml_call2(f, acc, input_array[1]), elt = match[2], acc$0 = match[1], - /*<>*/ output_array = - /*<>*/ caml_make_vect(len, elt), - /*<>*/ acc$1 = [0, acc$0], - /*<>*/ _T_ = len - 1 | 0, - /*<>*/ _S_ = 1; + /*<>*/ output_array = + /*<>*/ caml_make_vect(len, elt), + /*<>*/ acc$1 = [0, acc$0], + /*<>*/ _T_ = len - 1 | 0, + /*<>*/ _S_ = 1; if(_T_ >= 1){ var i = _S_; for(;;){ - /*<>*/ var - /*<>*/ match$0 = - /*<>*/ caml_call2(f, acc$1[1], input_array[1 + i]), + /*<>*/ var + /*<>*/ match$0 = + /*<>*/ caml_call2(f, acc$1[1], input_array[1 + i]), elt$0 = match$0[2], acc$2 = match$0[1]; acc$1[1] = acc$2; - /*<>*/ output_array[1 + i] = elt$0; - /*<>*/ /*<>*/ var _U_ = i + 1 | 0; - if(_T_ !== i){var i = _U_; continue;} - break; + /*<>*/ output_array[1 + i] = elt$0; + /*<>*/ /*<>*/ var _U_ = i + 1 | 0; + if(_T_ === i) break; + i = _U_; } } - /*<>*/ return [0, acc$1[1], output_array]; - /*<>*/ } + /*<>*/ return [0, acc$1[1], output_array]; + /*<>*/ } function fold_right(f, a, x){ - /*<>*/ var - /*<>*/ r = [0, x], - /*<>*/ _Q_ = a.length - 1 - 1 | 0; + /*<>*/ var + /*<>*/ r = [0, x], + /*<>*/ _Q_ = a.length - 2 | 0; if(_Q_ >= 0){ var i = _Q_; for(;;){ - r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _R_ = i - 1 | 0; - if(0 !== i){var i = _R_; continue;} - break; + r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); + /*<>*/ /*<>*/ var _R_ = i - 1 | 0; + if(0 === i) break; + i = _R_; } } return r[1]; - /*<>*/ } + /*<>*/ } function exists(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ if - ( /*<>*/ caml_call1(p, a[1 + i])) - /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function for_all(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 1; - /*<>*/ if - (! /*<>*/ caml_call1(p, a[1 + i])) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 1; + /*<>*/ if + (! /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return 0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function for_all2(p, l1, l2){ - /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; + /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; if(n1 !== n2) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_for_all2); var i = 0; - /*<>*/ for(;;){ - if(i === n1) /*<>*/ return 1; - /*<>*/ if - (! /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ for(;;){ + if(i === n1) /*<>*/ return 1; + /*<>*/ if + (! /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) + /*<>*/ return 0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function exists2(p, l1, l2){ - /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; + /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; if(n1 !== n2) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_exists2); var i = 0; - /*<>*/ for(;;){ - if(i === n1) /*<>*/ return 0; - /*<>*/ if - ( /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) - /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ for(;;){ + if(i === n1) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function mem(x, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ if - (0 === /*<>*/ runtime.caml_compare(a[1 + i], x)) - /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ if + (0 === /*<>*/ runtime.caml_compare(a[1 + i], x)) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function memq(x, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - if(x === a[1 + i]) /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + if(x === a[1 + i]) /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function find_opt(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ /*<>*/ var x = a[1 + i]; - /*<>*/ if( /*<>*/ caml_call1(p, x)) - /*<>*/ return [0, x]; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var x = a[1 + i]; + /*<>*/ if( /*<>*/ caml_call1(p, x)) + /*<>*/ return [0, x]; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } + function find_index(p, a){ + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return [0, i]; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function find_map(f, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ /*<>*/ var - r = /*<>*/ caml_call1(f, a[1 + i]); - if(r) /*<>*/ return r; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var + r = /*<>*/ caml_call1(f, a[1 + i]); + if(r) /*<>*/ return r; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } + function find_mapi(f, a){ + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var + r = /*<>*/ caml_call2(f, i, a[1 + i]); + if(r) /*<>*/ return r; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function split(x){ - /*<>*/ if - ( /*<>*/ runtime.caml_equal(x, [0])) - /*<>*/ return [0, [0], [0]]; - /*<>*/ var + /*<>*/ if + ( /*<>*/ runtime.caml_equal(x, [0])) + /*<>*/ return [0, [0], [0]]; + /*<>*/ var match = x[1], b0 = match[2], a0 = match[1], - /*<>*/ n = x.length - 1, - /*<>*/ a = - /*<>*/ caml_make_vect(n, a0), - /*<>*/ b = - /*<>*/ caml_make_vect(n, b0), - /*<>*/ _O_ = n - 1 | 0, - /*<>*/ _N_ = 1; + /*<>*/ n = x.length - 1, + /*<>*/ a = + /*<>*/ caml_make_vect(n, a0), + /*<>*/ b = + /*<>*/ caml_make_vect(n, b0), + /*<>*/ _O_ = n - 1 | 0, + /*<>*/ _N_ = 1; if(_O_ >= 1){ var i = _N_; for(;;){ var match$0 = x[1 + i], bi = match$0[2], ai = match$0[1]; - /*<>*/ a[1 + i] = ai; - /*<>*/ b[1 + i] = bi; - /*<>*/ /*<>*/ var _P_ = i + 1 | 0; - if(_O_ !== i){var i = _P_; continue;} - break; + /*<>*/ a[1 + i] = ai; + /*<>*/ b[1 + i] = bi; + /*<>*/ /*<>*/ var _P_ = i + 1 | 0; + if(_O_ === i) break; + i = _P_; } } - /*<>*/ return [0, a, b]; - /*<>*/ } + /*<>*/ return [0, a, b]; + /*<>*/ } function combine(a, b){ - /*<>*/ var + /*<>*/ var na = a.length - 1, - /*<>*/ nb = b.length - 1; + /*<>*/ nb = b.length - 1; if(na !== nb) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Array_combine); - if(0 === na) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ x = - /*<>*/ caml_make_vect(na, [0, a[1], b[1]]), - /*<>*/ _L_ = na - 1 | 0, - /*<>*/ _K_ = 1; + if(0 === na) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_make_vect(na, [0, a[1], b[1]]), + /*<>*/ _L_ = na - 1 | 0, + /*<>*/ _K_ = 1; if(_L_ >= 1){ var i = _K_; for(;;){ x[1 + i] = [0, a[1 + i], b[1 + i]]; - /*<>*/ /*<>*/ var _M_ = i + 1 | 0; - if(_L_ !== i){var i = _M_; continue;} - break; + /*<>*/ /*<>*/ var _M_ = i + 1 | 0; + if(_L_ === i) break; + i = _M_; } } - /*<>*/ return x; - /*<>*/ } - /*<>*/ /*<>*/ var - Bottom = [248, cst_Stdlib_Array_Bottom, runtime.caml_fresh_oo_id(0)]; + /*<>*/ return x; + /*<>*/ } + /*<>*/ var + /*<>*/ Bottom = + [248, "Stdlib.Array.Bottom", runtime.caml_fresh_oo_id(0)], + _a_ = [0, "array.ml", 369, 4]; function sort(cmp, a){ function maxson(l, i){ - /*<>*/ var + /*<>*/ var i31 = ((i + i | 0) + i | 0) + 1 | 0, - /*<>*/ x = [0, i31]; + /*<>*/ x = [0, i31]; if((i31 + 2 | 0) < l){ - /*<>*/ var - /*<>*/ _D_ = i31 + 1 | 0, - /*<>*/ _E_ = caml_check_bound(a, _D_)[1 + _D_]; + /*<>*/ var + /*<>*/ _D_ = i31 + 1 | 0, + /*<>*/ _E_ = caml_check_bound(a, _D_)[1 + _D_]; if - ( /*<>*/ caml_call2 + ( /*<>*/ caml_call2 (cmp, caml_check_bound(a, i31)[1 + i31], _E_) < 0) x[1] = i31 + 1 | 0; - /*<>*/ var - /*<>*/ _F_ = i31 + 2 | 0, - /*<>*/ _G_ = caml_check_bound(a, _F_)[1 + _F_], + /*<>*/ var + /*<>*/ _F_ = i31 + 2 | 0, + /*<>*/ _G_ = caml_check_bound(a, _F_)[1 + _F_], _H_ = x[1]; if - ( /*<>*/ caml_call2 + ( /*<>*/ caml_call2 (cmp, caml_check_bound(a, _H_)[1 + _H_], _G_) < 0) x[1] = i31 + 2 | 0; return x[1]; } if((i31 + 1 | 0) < l){ - /*<>*/ var + /*<>*/ var _I_ = i31 + 1 | 0, - /*<>*/ _J_ = caml_check_bound(a, _I_)[1 + _I_]; - /*<>*/ if + /*<>*/ _J_ = caml_check_bound(a, _I_)[1 + _I_]; + /*<>*/ if (0 > - /*<>*/ caml_call2 + /*<>*/ caml_call2 (cmp, caml_check_bound(a, i31)[1 + i31], _J_)) - /*<>*/ return i31 + 1 | 0; + /*<>*/ return i31 + 1 | 0; } - if(i31 < l) /*<>*/ return i31; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(i31 < l) /*<>*/ return i31; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Bottom, i], 1); - /*<>*/ } + /*<>*/ } var l = a.length - 1, _x_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; if(_x_ >= 0){ var i$6 = _x_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e$1 = caml_check_bound(a, i$6)[1 + i$6]; - /*<>*/ try{ + /*<>*/ try{ var i = i$6; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var j = maxson(l, i); - /*<>*/ if + /*<>*/ if (0 - < - /*<>*/ caml_call2 - (cmp, caml_check_bound(a, j)[1 + j], e$1)){ - /*<>*/ /*<>*/ var - _u_ = caml_check_bound(a, j)[1 + j]; - /*<>*/ caml_check_bound(a, i)[1 + i] = _u_; - var i = j; - continue; - } - /*<>*/ caml_check_bound(a, i)[1 + i] = e$1; - break; + >= + /*<>*/ caml_call2 + (cmp, caml_check_bound(a, j)[1 + j], e$1)) + break; + /*<>*/ /*<>*/ var + _u_ = caml_check_bound(a, j)[1 + j]; + /*<>*/ caml_check_bound(a, i)[1 + i] = _u_; + i = j; } + /*<>*/ caml_check_bound(a, i)[1 + i] = e$1; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); if(exn[1] !== Bottom) throw caml_maybe_attach_backtrace(exn, 0); var i$0 = exn[2]; - /*<>*/ caml_check_bound(a, i$0)[1 + i$0] = e$1; + /*<>*/ caml_check_bound(a, i$0)[1 + i$0] = e$1; } - /*<>*/ /*<>*/ var _C_ = i$6 - 1 | 0; - if(0 !== i$6){var i$6 = _C_; continue;} - break; + /*<>*/ /*<>*/ var _C_ = i$6 - 1 | 0; + if(0 === i$6) break; + i$6 = _C_; } } - /*<>*/ /*<>*/ var _y_ = l - 1 | 0; + /*<>*/ /*<>*/ var _y_ = l - 1 | 0; if(_y_ >= 2){ var i$4 = _y_; - a: for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e$0 = caml_check_bound(a, i$4)[1 + i$4]; - /*<>*/ a[1 + i$4] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1 + i$4] = caml_check_bound(a, 0)[1]; var i$5 = 0; - /*<>*/ try{ + /*<>*/ try{ var i$1 = i$5; - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ j$0 = maxson(i$4, i$1), - /*<>*/ _v_ = caml_check_bound(a, j$0)[1 + j$0]; - /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _v_; - var i$1 = j$0; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ j$0 = maxson(i$4, i$1), + /*<>*/ _v_ = caml_check_bound(a, j$0)[1 + j$0]; + /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _v_; + i$1 = j$0; } } catch(exn){ var exn$0 = caml_wrap_exception(exn); if(exn$0[1] !== Bottom) throw caml_maybe_attach_backtrace(exn$0, 0); - var i$2 = exn$0[2], i$3 = i$2; - /*<>*/ for(;;){ - var father = (i$3 - 1 | 0) / 3 | 0; - if(i$3 === father) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _a_], 1); - /*<>*/ if - (0 - <= - /*<>*/ caml_call2 - (cmp, caml_check_bound(a, father)[1 + father], e$0)) - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = e$0; - else{ - /*<>*/ /*<>*/ var - _w_ = caml_check_bound(a, father)[1 + father]; - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _w_; - if(0 < father){var i$3 = father; continue;} - /*<>*/ caml_check_bound(a, 0)[1] = e$0; + var i$2 = exn$0[2]; + a: + { + b: + { + var i$3 = i$2; + /*<>*/ for(;;){ + var father = (i$3 - 1 | 0) / 3 | 0; + if(i$3 === father) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _a_], 1); + /*<>*/ if + (0 + <= + /*<>*/ caml_call2 + (cmp, caml_check_bound(a, father)[1 + father], e$0)) + break; + /*<>*/ /*<>*/ var + _w_ = caml_check_bound(a, father)[1 + father]; + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _w_; + if(0 >= father) break b; + i$3 = father; + } + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = e$0; + break a; } - /*<>*/ /*<>*/ var _B_ = i$4 - 1 | 0; - if(2 !== i$4){var i$4 = _B_; continue a;} - break; + /*<>*/ caml_check_bound(a, 0)[1] = e$0; } + /*<>*/ /*<>*/ var _B_ = i$4 - 1 | 0; + if(2 === i$4) break; + i$4 = _B_; } - break; } } var _z_ = 1 < l ? 1 : 0; if(_z_){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e = caml_check_bound(a, 1)[2]; - /*<>*/ a[2] = caml_check_bound(a, 0)[1]; - /*<>*/ a[1] = e; + /*<>*/ a[2] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1] = e; var _A_ = 0; } else var _A_ = _z_; - /*<>*/ return _A_; - /*<>*/ } + /*<>*/ return _A_; + /*<>*/ } function stable_sort(cmp, a){ function merge(src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs){ - /*<>*/ var + /*<>*/ var src1r = src1ofs + src1len | 0, src2r = src2ofs + src2len | 0, - /*<>*/ s2$1 = + /*<>*/ s2$1 = caml_check_bound(src2, src2ofs)[1 + src2ofs], - /*<>*/ s1$1 = + /*<>*/ s1$1 = caml_check_bound(a, src1ofs)[1 + src1ofs], i1 = src1ofs, s1 = s1$1, i2 = src2ofs, s2 = s2$1, d = dstofs; - /*<>*/ for(;;){ - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, s1, s2)){ - /*<>*/ caml_check_bound(dst, d)[1 + d] = s2; - /*<>*/ /*<>*/ var i2$0 = i2 + 1 | 0; + /*<>*/ for(;;) + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, s1, s2)){ + /*<>*/ caml_check_bound(dst, d)[1 + d] = s2; + /*<>*/ /*<>*/ var i2$0 = i2 + 1 | 0; if(i2$0 >= src2r) return blit(a, i1, dst, d + 1 | 0, src1r - i1 | 0); - /*<>*/ var - /*<>*/ d$0 = d + 1 | 0, - /*<>*/ s2$0 = caml_check_bound(src2, i2$0)[1 + i2$0], - i2 = i2$0, - s2 = s2$0, - d = d$0; - continue; + /*<>*/ var + /*<>*/ d$0 = d + 1 | 0, + /*<>*/ s2$0 = caml_check_bound(src2, i2$0)[1 + i2$0]; + i2 = i2$0; + s2 = s2$0; + d = d$0; } - /*<>*/ caml_check_bound(dst, d)[1 + d] = s1; - /*<>*/ /*<>*/ var i1$0 = i1 + 1 | 0; - if(i1$0 >= src1r) return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0); - /*<>*/ var - /*<>*/ d$1 = d + 1 | 0, - /*<>*/ s1$0 = caml_check_bound(a, i1$0)[1 + i1$0], - i1 = i1$0, - s1 = s1$0, + else{ + /*<>*/ caml_check_bound(dst, d)[1 + d] = s1; + /*<>*/ /*<>*/ var i1$0 = i1 + 1 | 0; + if(i1$0 >= src1r) + return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0); + /*<>*/ var + /*<>*/ d$1 = d + 1 | 0, + /*<>*/ s1$0 = caml_check_bound(a, i1$0)[1 + i1$0]; + i1 = i1$0; + s1 = s1$0; d = d$1; - } - /*<>*/ } + } + /*<>*/ } function isortto(srcofs, dst, dstofs, len){ - /*<>*/ var + /*<>*/ var _m_ = len - 1 | 0, - /*<>*/ _l_ = 0; + /*<>*/ _l_ = 0; if(_m_ >= 0){ var i = _l_; - a: for(;;){ - /*<>*/ var + /*<>*/ var _n_ = srcofs + i | 0, - /*<>*/ e = caml_check_bound(a, _n_)[1 + _n_], - /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; + /*<>*/ e = caml_check_bound(a, _n_)[1 + _n_], + /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; for(;;){ - if(dstofs <= j[1]){ - var _o_ = j[1]; - /*<>*/ if - (0 - < - /*<>*/ caml_call2 - (cmp, caml_check_bound(dst, _o_)[1 + _o_], e)){ - /*<>*/ var - _p_ = j[1], - /*<>*/ _q_ = caml_check_bound(dst, _p_)[1 + _p_], - _r_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _r_)[1 + _r_] = _q_; - j[1] += -1; - continue; - } - } - var _s_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _s_)[1 + _s_] = e; - /*<>*/ /*<>*/ var _t_ = i + 1 | 0; - if(_m_ !== i){var i = _t_; continue a;} - break; + if(dstofs > j[1]) break; + var _o_ = j[1]; + /*<>*/ if + (0 + >= + /*<>*/ caml_call2 + (cmp, caml_check_bound(dst, _o_)[1 + _o_], e)) + break; + /*<>*/ var + _p_ = j[1], + /*<>*/ _q_ = caml_check_bound(dst, _p_)[1 + _p_], + _r_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _r_)[1 + _r_] = _q_; + j[1]--; } - break; + var _s_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _s_)[1 + _s_] = e; + /*<>*/ /*<>*/ var _t_ = i + 1 | 0; + if(_m_ === i) break; + i = _t_; } } return 0; - /*<>*/ } + /*<>*/ } function sortto(srcofs, dst, dstofs, len){ - /*<>*/ if(len <= 5) - /*<>*/ return isortto(srcofs, dst, dstofs, len); + /*<>*/ if(len <= 5) + /*<>*/ return isortto(srcofs, dst, dstofs, len); var l1 = len / 2 | 0, l2 = len - l1 | 0; - /*<>*/ sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); - /*<>*/ sortto(srcofs, a, srcofs + l2 | 0, l1); - /*<>*/ return merge + /*<>*/ sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); + /*<>*/ sortto(srcofs, a, srcofs + l2 | 0, l1); + /*<>*/ return merge (srcofs + l2 | 0, l1, dst, dstofs + l1 | 0, l2, dst, dstofs); - /*<>*/ } + /*<>*/ } var l = a.length - 1; - if(l <= 5) /*<>*/ return isortto(0, a, 0, l); - /*<>*/ var + if(l <= 5) /*<>*/ return isortto(0, a, 0, l); + /*<>*/ var l1 = l / 2 | 0, l2 = l - l1 | 0, - /*<>*/ t = - /*<>*/ caml_make_vect(l2, caml_check_bound(a, 0)[1]); - /*<>*/ sortto(l1, t, 0, l2); - /*<>*/ sortto(0, a, l2, l1); - /*<>*/ return merge(l2, l1, t, 0, l2, a, 0); - /*<>*/ } + /*<>*/ t = + /*<>*/ caml_make_vect(l2, caml_check_bound(a, 0)[1]); + /*<>*/ sortto(l1, t, 0, l2); + /*<>*/ sortto(0, a, l2, l1); + /*<>*/ return merge(l2, l1, t, 0, l2, a, 0); + /*<>*/ } + function shuffle(rand, a){ + /*<>*/ var _j_ = a.length - 2 | 0; + if(_j_ >= 1){ + var i = _j_; + for(;;){ + /*<>*/ var + /*<>*/ j = + /*<>*/ caml_call1(rand, i + 1 | 0), + /*<>*/ v = a[1 + i]; + /*<>*/ a[1 + i] = caml_check_bound(a, j)[1 + j]; + /*<>*/ a[1 + j] = v; + var _k_ = i - 1 | 0; + if(1 === i) break; + i = _k_; + } + } + return 0; + /*<>*/ } function to_seq(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _j_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _h_ = i + 1 | 0; + /*<>*/ return [0, x, - function(_k_){ /*<>*/ return aux(_j_, _k_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _h_ = 0; - /*<>*/ return function(_i_){ - /*<>*/ return aux(_h_, _i_);}; - /*<>*/ } + function(_i_){ /*<>*/ return aux(_h_, _i_);}]; + /*<>*/ } + /*<>*/ var _f_ = 0; + /*<>*/ return function(_g_){ + /*<>*/ return aux(_f_, _g_);}; + /*<>*/ } function to_seqi(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _f_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _d_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], - function(_g_){ /*<>*/ return aux(_f_, _g_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _d_ = 0; - /*<>*/ return function(_e_){ - /*<>*/ return aux(_d_, _e_);}; - /*<>*/ } + function(_e_){ /*<>*/ return aux(_d_, _e_);}]; + /*<>*/ } + /*<>*/ var _b_ = 0; + /*<>*/ return function(_c_){ + /*<>*/ return aux(_b_, _c_);}; + /*<>*/ } function of_seq(i$2){ - /*<>*/ var _b_ = 0; - function _c_(acc, x){ - /*<>*/ return [0, x, acc]; - /*<>*/ } - /*<>*/ /*<>*/ var - l = /*<>*/ caml_call3(Stdlib_Seq[5], _c_, _b_, i$2); - if(! l) /*<>*/ return [0]; - /*<>*/ var + /*<>*/ /*<>*/ var + l = + /*<>*/ caml_call3 + (Stdlib_Seq[5], + function(acc, x){ + /*<>*/ return [0, x, acc]; + /*<>*/ }, + 0, + i$2); + if(! l) /*<>*/ return [0]; + /*<>*/ var tl = l[2], hd = l[1], - /*<>*/ len = list_length(0, l), - /*<>*/ a = - /*<>*/ caml_make_vect(len, hd), - /*<>*/ i$1 = len - 2 | 0, + /*<>*/ len = list_length(0, l), + /*<>*/ a = + /*<>*/ caml_make_vect(len, hd), + /*<>*/ i$1 = len - 2 | 0, i = i$1, param = tl; for(;;){ - if(! param) /*<>*/ return a; + if(! param) /*<>*/ return a; var tl$0 = param[2], hd$0 = param[1]; - /*<>*/ a[1 + i] = hd$0; - /*<>*/ var - /*<>*/ i$0 = i - 1 | 0, - i = i$0, - param = tl$0; + /*<>*/ a[1 + i] = hd$0; + /*<>*/ /*<>*/ var i$0 = i - 1 | 0; + i = i$0; + param = tl$0; } - /*<>*/ } + /*<>*/ } var Stdlib_Array = [0, init, make_matrix, + init_matrix, append, runtime.caml_array_concat, sub, @@ -7662,7 +8058,9 @@ iter, iteri, map, + map_inplace, mapi, + mapi_inplace, fold_left, fold_left_map, fold_right, @@ -7675,23 +8073,26 @@ mem, memq, find_opt, + find_index, find_map, + find_mapi, split, combine, sort, stable_sort, stable_sort, + shuffle, to_seq, to_seqi, of_seq, Floatarray]; - runtime.caml_register_global(14, Stdlib_Array, "Stdlib__Array"); + runtime.caml_register_global(16, Stdlib_Array, "Stdlib__Array"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Float -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Array, Stdlib__List, Stdlib__Seq +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__List, Stdlib__Seq (function (globalThis){ "use strict"; @@ -7703,6 +8104,8 @@ caml_float_compare = runtime.caml_float_compare, caml_floatarray_blit = runtime.caml_floatarray_blit, caml_floatarray_create = runtime.caml_floatarray_create, + caml_hash = runtime.caml_hash, + caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_nextafter_float = runtime.caml_nextafter_float, caml_signbit_float = runtime.caml_signbit_float, @@ -7722,7 +8125,7 @@ ? f(a0, a1, a2) : runtime.caml_call_gen(f, [a0, a1, a2]); } - var + /*<>*/ var global_data = runtime.caml_get_global_data(), Stdlib_Seq = global_data.Stdlib__Seq, Stdlib_List = global_data.Stdlib__List, @@ -7731,884 +8134,991 @@ infinity = Stdlib[22], neg_infinity = Stdlib[23], nan = Stdlib[24], - _b_ = [0, cst_float_ml, 395, 6], - cst_Float_Array_map2_arrays_mu = - "Float.Array.map2: arrays must have the same length", - cst_Float_Array_iter2_arrays_m = - "Float.Array.iter2: arrays must have the same length", - cst_Float_array_blit = cst_Float_array_blit$1, - cst_Float_array_blit$0 = cst_Float_array_blit$1, - cst_Float_Array_fill = "Float.Array.fill", - cst_Float_Array_sub = "Float.Array.sub", - _a_ = [0, cst_float_ml, 222, 14], - cst_Float_Array_concat = "Float.Array.concat", - cst_Float_Array_init = "Float.Array.init", - cst_Stdlib_Float_Array_Bottom = "Stdlib.Float.Array.Bottom", - zero = 0., - one = 1., - minus_one = -1.; + /*<>*/ signaling_nan = + /*<>*/ runtime.caml_int64_float_of_bits + (runtime.caml_int64_create_lo_mi_hi(1, 0, 32752)); function is_finite(x){ - /*<>*/ return x - x == 0. ? 1 : 0; - /*<>*/ } + /*<>*/ return x - x == 0. ? 1 : 0; + /*<>*/ } function is_infinite(x){ - /*<>*/ return 1. / x == 0. ? 1 : 0; - /*<>*/ } + /*<>*/ return 1. / x == 0. ? 1 : 0; + /*<>*/ } function is_nan(x){ - /*<>*/ return x != x ? 1 : 0; - /*<>*/ } + /*<>*/ return x != x ? 1 : 0; + /*<>*/ } var max_float = Stdlib[25], min_float = Stdlib[26], epsilon = Stdlib[27], of_string_opt = Stdlib[36], to_string = Stdlib[35], - pi = 3.141592653589793; + cst_Float_Array_init = "Float.Array.init", + cst_Float_Array_make_matrix = "Float.Array.make_matrix", + cst_Float_Array_init_matrix = "Float.Array.init_matrix", + cst_Float_Array_concat = "Float.Array.concat", + _a_ = [0, cst_float_ml, 254, 14], + cst_Float_Array_sub = "Float.Array.sub", + cst_Float_Array_fill = "Float.Array.fill", + cst_Float_array_blit = cst_Float_array_blit$1, + cst_Float_array_blit$0 = cst_Float_array_blit$1, + cst_Float_Array_iter2_arrays_m = + "Float.Array.iter2: arrays must have the same length", + cst_Float_Array_map2_arrays_mu = + "Float.Array.map2: arrays must have the same length"; function is_integer(x){ - /*<>*/ var - _aQ_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; - return _aQ_ ? is_finite(x) : _aQ_; - /*<>*/ } + /*<>*/ var + _aX_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; + return _aX_ ? is_finite(x) : _aX_; + /*<>*/ } function succ(x){ - /*<>*/ return /*<>*/ caml_nextafter_float + /*<>*/ return /*<>*/ caml_nextafter_float (x, infinity); - /*<>*/ } + /*<>*/ } function pred(x){ - /*<>*/ return /*<>*/ caml_nextafter_float + /*<>*/ return /*<>*/ caml_nextafter_float (x, neg_infinity); - /*<>*/ } + /*<>*/ } function equal(x, y){ - /*<>*/ return 0 === caml_float_compare(x, y) ? 1 : 0; - /*<>*/ } + /*<>*/ return 0 === caml_float_compare(x, y) ? 1 : 0; + /*<>*/ } function min(x, y){ - /*<>*/ if(! (x < y)){ - var switch$0 = 0; - /*<>*/ if - (! - /*<>*/ caml_signbit_float(y) - && /*<>*/ caml_signbit_float(x)) - switch$0 = 1; - if(! switch$0) /*<>*/ return x != x ? x : y; - } - /*<>*/ return y != y ? y : x; - /*<>*/ } - function max(x, y){ - /*<>*/ if(! (x < y)){ - var switch$0 = 0; + /*<>*/ a: + if(! (x < y)){ /*<>*/ if (! /*<>*/ caml_signbit_float(y) && /*<>*/ caml_signbit_float(x)) - switch$0 = 1; - if(! switch$0) /*<>*/ return y != y ? y : x; + break a; + /*<>*/ return x != x ? x : y; } - /*<>*/ return x != x ? x : y; + /*<>*/ return y != y ? y : x; /*<>*/ } + function max(x, y){ + /*<>*/ a: + if(! (x < y)){ + /*<>*/ if + (! + /*<>*/ caml_signbit_float(y) + && /*<>*/ caml_signbit_float(x)) + break a; + /*<>*/ return y != y ? y : x; + } + /*<>*/ return x != x ? x : y; + /*<>*/ } function min_max(x, y){ - /*<>*/ if(x == x && y == y){ + /*<>*/ if(x == x && y == y){ + a: if(! (x < y)){ - var switch$0 = 0; - /*<>*/ if + /*<>*/ if (! - /*<>*/ caml_signbit_float(y) - && /*<>*/ caml_signbit_float(x)) - switch$0 = 1; - if(! switch$0) /*<>*/ return [0, y, x]; + /*<>*/ caml_signbit_float(y) + && /*<>*/ caml_signbit_float(x)) + break a; + /*<>*/ return [0, y, x]; } - /*<>*/ return [0, x, y]; + /*<>*/ return [0, x, y]; } - /*<>*/ return [0, nan, nan]; - /*<>*/ } + /*<>*/ return [0, nan, nan]; + /*<>*/ } function min_num(x, y){ - /*<>*/ if(! (x < y)){ - var switch$0 = 0; - /*<>*/ if - (! - /*<>*/ caml_signbit_float(y) - && /*<>*/ caml_signbit_float(x)) - switch$0 = 1; - if(! switch$0) /*<>*/ return y != y ? x : y; - } - /*<>*/ return x != x ? y : x; - /*<>*/ } - function max_num(x, y){ - /*<>*/ if(! (x < y)){ - var switch$0 = 0; + /*<>*/ a: + if(! (x < y)){ /*<>*/ if (! /*<>*/ caml_signbit_float(y) && /*<>*/ caml_signbit_float(x)) - switch$0 = 1; - if(! switch$0) /*<>*/ return x != x ? y : x; + break a; + /*<>*/ return y != y ? x : y; } - /*<>*/ return y != y ? x : y; + /*<>*/ return x != x ? y : x; /*<>*/ } + function max_num(x, y){ + /*<>*/ a: + if(! (x < y)){ + /*<>*/ if + (! + /*<>*/ caml_signbit_float(y) + && /*<>*/ caml_signbit_float(x)) + break a; + /*<>*/ return x != x ? y : x; + } + /*<>*/ return y != y ? x : y; + /*<>*/ } function min_max_num(x, y){ - /*<>*/ if(x != x) - /*<>*/ return [0, y, y]; - /*<>*/ if(y != y) - /*<>*/ return [0, x, x]; + /*<>*/ if(x != x) + /*<>*/ return [0, y, y]; + /*<>*/ if(y != y) + /*<>*/ return [0, x, x]; + a: if(! (x < y)){ - var switch$0 = 0; - /*<>*/ if + /*<>*/ if (! - /*<>*/ caml_signbit_float(y) - && /*<>*/ caml_signbit_float(x)) - switch$0 = 1; - if(! switch$0) /*<>*/ return [0, y, x]; + /*<>*/ caml_signbit_float(y) + && /*<>*/ caml_signbit_float(x)) + break a; + /*<>*/ return [0, y, x]; } - /*<>*/ return [0, x, y]; - /*<>*/ } + /*<>*/ return [0, x, y]; + /*<>*/ } + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } function hash(x){ - /*<>*/ return /*<>*/ runtime.caml_hash + /*<>*/ return /*<>*/ caml_hash (10, 100, 0, x); - /*<>*/ } + /*<>*/ } function unsafe_fill(a, ofs, len, v){ - /*<>*/ var _aO_ = (ofs + len | 0) - 1 | 0; - if(_aO_ >= ofs){ + /*<>*/ var _aV_ = (ofs + len | 0) - 1 | 0; + if(_aV_ >= ofs){ var i = ofs; for(;;){ - /*<>*/ a[1 + i] = v; - /*<>*/ /*<>*/ var _aP_ = i + 1 | 0; - if(_aO_ !== i){var i = _aP_; continue;} - break; + /*<>*/ a[1 + i] = v; + /*<>*/ /*<>*/ var _aW_ = i + 1 | 0; + if(_aV_ === i) break; + i = _aW_; } } return 0; - /*<>*/ } + /*<>*/ } function check(a, ofs, len, msg){ - /*<>*/ var _aK_ = ofs < 0 ? 1 : 0; - if(_aK_) - var _aL_ = _aK_; + /*<>*/ var _aR_ = ofs < 0 ? 1 : 0; + if(_aR_) + var _aS_ = _aR_; else{ - var _aM_ = len < 0 ? 1 : 0; - if(_aM_) - var _aL_ = _aM_; + var _aT_ = len < 0 ? 1 : 0; + if(_aT_) + var _aS_ = _aT_; else var - _aN_ = (ofs + len | 0) < 0 ? 1 : 0, - _aL_ = _aN_ || (a.length - 1 < (ofs + len | 0) ? 1 : 0); + _aU_ = (ofs + len | 0) < 0 ? 1 : 0, + _aS_ = _aU_ || (a.length - 1 < (ofs + len | 0) ? 1 : 0); } - return _aL_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _aL_; - /*<>*/ } + return _aS_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _aS_; + /*<>*/ } function make(n, v){ - /*<>*/ /*<>*/ var - result = /*<>*/ caml_floatarray_create(n); - /*<>*/ unsafe_fill(result, 0, n, v); - /*<>*/ return result; - /*<>*/ } + /*<>*/ /*<>*/ var + result = /*<>*/ caml_floatarray_create(n); + /*<>*/ unsafe_fill(result, 0, n, v); + /*<>*/ return result; + /*<>*/ } function init(l, f){ - /*<>*/ if(0 > l) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 > l) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_init); - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _aI_ = l - 1 | 0, - /*<>*/ _aH_ = 0; - if(_aI_ >= 0){ - var i = _aH_; + /*<>*/ var + /*<>*/ res = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _aP_ = l - 1 | 0, + /*<>*/ _aO_ = 0; + if(_aP_ >= 0){ + var i = _aO_; for(;;){ - /*<>*/ res[1 + i] = - /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _aJ_ = i + 1 | 0; - if(_aI_ !== i){var i = _aJ_; continue;} - break; + /*<>*/ res[1 + i] = + /*<>*/ caml_call1(f, i); + /*<>*/ /*<>*/ var _aQ_ = i + 1 | 0; + if(_aP_ === i) break; + i = _aQ_; + } + } + /*<>*/ return res; + /*<>*/ } + function make_matrix(sx, sy, v){ + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Float_Array_make_matrix); + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_make_vect + (sx, /*<>*/ caml_floatarray_create(0)); + if(0 < sy){ + /*<>*/ var + _aM_ = sx - 1 | 0, + /*<>*/ _aL_ = 0; + if(_aM_ >= 0){ + var x = _aL_; + for(;;){ + /*<>*/ res[1 + x] = make(sy, v); + /*<>*/ /*<>*/ var _aN_ = x + 1 | 0; + if(_aM_ === x) break; + x = _aN_; + } } } - /*<>*/ return res; - /*<>*/ } - function append(a1, a2){ - /*<>*/ var + /*<>*/ return res; + /*<>*/ } + function init_matrix(sx, sy, f){ + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Float_Array_init_matrix); + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_make_vect + (sx, /*<>*/ caml_floatarray_create(0)); + if(0 < sy){ + /*<>*/ var + _aG_ = sx - 1 | 0, + /*<>*/ _aF_ = 0; + if(_aG_ >= 0){ + var x = _aF_; + for(;;){ + /*<>*/ var + /*<>*/ row = + /*<>*/ caml_floatarray_create(sy), + /*<>*/ _aI_ = sy - 1 | 0, + /*<>*/ _aH_ = 0; + if(_aI_ >= 0){ + var y = _aH_; + for(;;){ + /*<>*/ row[1 + y] = + /*<>*/ caml_call2(f, x, y); + /*<>*/ /*<>*/ var + _aK_ = y + 1 | 0; + if(_aI_ === y) break; + y = _aK_; + } + } + /*<>*/ res[1 + x] = row; + /*<>*/ /*<>*/ var _aJ_ = x + 1 | 0; + if(_aG_ === x) break; + x = _aJ_; + } + } + } + /*<>*/ return res; + /*<>*/ } + function append(a1, a2){ + /*<>*/ var l1 = a1.length - 1, - /*<>*/ l2 = a2.length - 1, - /*<>*/ result = - /*<>*/ caml_floatarray_create(l1 + l2 | 0); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ l2 = a2.length - 1, + /*<>*/ result = + /*<>*/ caml_floatarray_create(l1 + l2 | 0); + /*<>*/ /*<>*/ caml_floatarray_blit (a1, 0, result, 0, l1); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ /*<>*/ caml_floatarray_blit (a2, 0, result, l1, l2); - /*<>*/ return result; - /*<>*/ } + /*<>*/ return result; + /*<>*/ } function concat(l){ - /*<>*/ var acc = 0, param = l; + /*<>*/ var acc = 0, param = l; for(;;){ - if(param){ - var - tl = param[2], - hd = param[1], - x = hd.length - 1 + acc | 0, - acc$0 = - acc <= x - ? x - : /*<>*/ caml_call1 - (Stdlib[1], cst_Float_Array_concat), - acc = acc$0, - param = tl; - continue; - } - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_floatarray_create(acc), - l$0 = l, - i = 0; - /*<>*/ for(;;){ - if(l$0){ - /*<>*/ var - tl$0 = l$0[2], - hd$0 = l$0[1], - /*<>*/ hlen = hd$0.length - 1; - /*<>*/ /*<>*/ caml_floatarray_blit - (hd$0, 0, result, i, hlen); - var i$0 = i + hlen | 0, l$0 = tl$0, i = i$0; - continue; - } - if(i === acc) /*<>*/ return result; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(! param) break; + var + tl = param[2], + hd = param[1], + x = hd.length - 1 + acc | 0, + acc$0 = + acc <= x + ? x + : /*<>*/ caml_call1 + (Stdlib[1], cst_Float_Array_concat); + acc = acc$0; + param = tl; + } + /*<>*/ var + /*<>*/ result = + /*<>*/ caml_floatarray_create(acc), + l$0 = l, + i = 0; + /*<>*/ for(;;){ + if(! l$0){ + if(i === acc) /*<>*/ return result; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _a_], 1); } - } - /*<>*/ } + /*<>*/ var + tl$0 = l$0[2], + hd$0 = l$0[1], + /*<>*/ hlen = hd$0.length - 1; + /*<>*/ /*<>*/ caml_floatarray_blit + (hd$0, 0, result, i, hlen); + var i$0 = i + hlen | 0; + l$0 = tl$0; + i = i$0; + } + /*<>*/ } function sub(a, ofs, len){ - /*<>*/ check(a, ofs, len, cst_Float_Array_sub); - /*<>*/ /*<>*/ var - result = /*<>*/ caml_floatarray_create(len); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ check(a, ofs, len, cst_Float_Array_sub); + /*<>*/ /*<>*/ var + result = /*<>*/ caml_floatarray_create(len); + /*<>*/ /*<>*/ caml_floatarray_blit (a, ofs, result, 0, len); - /*<>*/ return result; - /*<>*/ } + /*<>*/ return result; + /*<>*/ } function copy(a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ result = - /*<>*/ caml_floatarray_create(l); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ result = + /*<>*/ caml_floatarray_create(l); + /*<>*/ /*<>*/ caml_floatarray_blit (a, 0, result, 0, l); - /*<>*/ return result; - /*<>*/ } + /*<>*/ return result; + /*<>*/ } function fill(a, ofs, len, v){ - /*<>*/ check(a, ofs, len, cst_Float_Array_fill); - /*<>*/ return unsafe_fill(a, ofs, len, v); - /*<>*/ } + /*<>*/ check(a, ofs, len, cst_Float_Array_fill); + /*<>*/ return unsafe_fill(a, ofs, len, v); + /*<>*/ } function blit(src, sofs, dst, dofs, len){ - /*<>*/ check(src, sofs, len, cst_Float_array_blit); - /*<>*/ check(dst, dofs, len, cst_Float_array_blit$0); - /*<>*/ return /*<>*/ caml_floatarray_blit + /*<>*/ check(src, sofs, len, cst_Float_array_blit); + /*<>*/ check(dst, dofs, len, cst_Float_array_blit$0); + /*<>*/ return /*<>*/ caml_floatarray_blit (src, sofs, dst, dofs, len); - /*<>*/ } + /*<>*/ } function to_list(a){ - /*<>*/ function _aF_(_aG_){ - /*<>*/ return a[1 + _aG_]; - } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[10], a.length - 1, _aF_); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_List[11], + a.length - 1, + function(_aE_){ /*<>*/ return a[1 + _aE_];}); + /*<>*/ } function of_list(l){ - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_floatarray_create - ( /*<>*/ caml_call1(Stdlib_List[1], l)), + /*<>*/ var + /*<>*/ result = + /*<>*/ caml_floatarray_create + ( /*<>*/ caml_call1(Stdlib_List[1], l)), i = 0, l$0 = l; - /*<>*/ for(;;){ - if(! l$0) /*<>*/ return result; + /*<>*/ for(;;){ + if(! l$0) /*<>*/ return result; var t = l$0[2], h = l$0[1]; - /*<>*/ result[1 + i] = h; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0, - l$0 = t; + /*<>*/ result[1 + i] = h; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + l$0 = t; } - /*<>*/ } + /*<>*/ } function iter(f, a){ - /*<>*/ var - _aD_ = a.length - 1 - 1 | 0, - /*<>*/ _aC_ = 0; - if(_aD_ >= 0){ - var i = _aC_; + /*<>*/ var + _aC_ = a.length - 2 | 0, + /*<>*/ _aB_ = 0; + if(_aC_ >= 0){ + var i = _aB_; for(;;){ - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (f, a[1 + i]); - /*<>*/ /*<>*/ var _aE_ = i + 1 | 0; - if(_aD_ !== i){var i = _aE_; continue;} - break; + /*<>*/ /*<>*/ var _aD_ = i + 1 | 0; + if(_aC_ === i) break; + i = _aD_; } } return 0; - /*<>*/ } + /*<>*/ } function iter2(f, a, b){ - /*<>*/ if(a.length - 1 !== b.length - 1) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(a.length - 1 !== b.length - 1) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_iter2_arrays_m); - /*<>*/ var - _aA_ = a.length - 1 - 1 | 0, - /*<>*/ _az_ = 0; - if(_aA_ >= 0){ - var i = _az_; + /*<>*/ var + _az_ = a.length - 2 | 0, + /*<>*/ _ay_ = 0; + if(_az_ >= 0){ + var i = _ay_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _aB_ = i + 1 | 0; - if(_aA_ !== i){var i = _aB_; continue;} - break; + /*<>*/ /*<>*/ var _aA_ = i + 1 | 0; + if(_az_ === i) break; + i = _aA_; } } return 0; - /*<>*/ } + /*<>*/ } function map(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _ax_ = l - 1 | 0, - /*<>*/ _aw_ = 0; - if(_ax_ >= 0){ - var i = _aw_; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _aw_ = l - 1 | 0, + /*<>*/ _av_ = 0; + if(_aw_ >= 0){ + var i = _av_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ay_ = i + 1 | 0; - if(_ax_ !== i){var i = _ay_; continue;} - break; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _ax_ = i + 1 | 0; + if(_aw_ === i) break; + i = _ax_; + } + } + /*<>*/ return r; + /*<>*/ } + function map_inplace(f, a){ + /*<>*/ var + _at_ = a.length - 2 | 0, + /*<>*/ _as_ = 0; + if(_at_ >= 0){ + var i = _as_; + for(;;){ + /*<>*/ a[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _au_ = i + 1 | 0; + if(_at_ === i) break; + i = _au_; } } - /*<>*/ return r; - /*<>*/ } + return 0; + /*<>*/ } function map2(f, a, b){ - /*<>*/ var + /*<>*/ var la = a.length - 1, - /*<>*/ lb = b.length - 1; + /*<>*/ lb = b.length - 1; if(la !== lb) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_map2_arrays_mu); - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_floatarray_create(la), - /*<>*/ _au_ = la - 1 | 0, - /*<>*/ _at_ = 0; - if(_au_ >= 0){ - var i = _at_; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_floatarray_create(la), + /*<>*/ _aq_ = la - 1 | 0, + /*<>*/ _ap_ = 0; + if(_aq_ >= 0){ + var i = _ap_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _av_ = i + 1 | 0; - if(_au_ !== i){var i = _av_; continue;} - break; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); + /*<>*/ /*<>*/ var _ar_ = i + 1 | 0; + if(_aq_ === i) break; + i = _ar_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function iteri(f, a){ - /*<>*/ var - _ar_ = a.length - 1 - 1 | 0, - /*<>*/ _aq_ = 0; - if(_ar_ >= 0){ - var i = _aq_; + /*<>*/ var + _an_ = a.length - 2 | 0, + /*<>*/ _am_ = 0; + if(_an_ >= 0){ + var i = _am_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _as_ = i + 1 | 0; - if(_ar_ !== i){var i = _as_; continue;} - break; + /*<>*/ /*<>*/ var _ao_ = i + 1 | 0; + if(_an_ === i) break; + i = _ao_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _ao_ = l - 1 | 0, - /*<>*/ _an_ = 0; - if(_ao_ >= 0){ - var i = _an_; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _ak_ = l - 1 | 0, + /*<>*/ _aj_ = 0; + if(_ak_ >= 0){ + var i = _aj_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ap_ = i + 1 | 0; - if(_ao_ !== i){var i = _ap_; continue;} - break; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _al_ = i + 1 | 0; + if(_ak_ === i) break; + i = _al_; + } + } + /*<>*/ return r; + /*<>*/ } + function mapi_inplace(f, a){ + /*<>*/ var + _ah_ = a.length - 2 | 0, + /*<>*/ _ag_ = 0; + if(_ah_ >= 0){ + var i = _ag_; + for(;;){ + /*<>*/ a[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _ai_ = i + 1 | 0; + if(_ah_ === i) break; + i = _ai_; } } - /*<>*/ return r; - /*<>*/ } + return 0; + /*<>*/ } function fold_left(f, x, a){ - /*<>*/ var - /*<>*/ r = [0, x], - _al_ = a.length - 1 - 1 | 0, - /*<>*/ _ak_ = 0; - if(_al_ >= 0){ - var i = _ak_; + /*<>*/ var + /*<>*/ r = [0, x], + _ae_ = a.length - 2 | 0, + /*<>*/ _ad_ = 0; + if(_ae_ >= 0){ + var i = _ad_; for(;;){ - r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _am_ = i + 1 | 0; - if(_al_ !== i){var i = _am_; continue;} - break; + r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); + /*<>*/ /*<>*/ var _af_ = i + 1 | 0; + if(_ae_ === i) break; + i = _af_; } } return r[1]; - /*<>*/ } + /*<>*/ } function fold_right(f, a, x){ - /*<>*/ var - /*<>*/ r = [0, x], - /*<>*/ _ai_ = a.length - 1 - 1 | 0; - if(_ai_ >= 0){ - var i = _ai_; + /*<>*/ var + /*<>*/ r = [0, x], + /*<>*/ _ab_ = a.length - 2 | 0; + if(_ab_ >= 0){ + var i = _ab_; for(;;){ - r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _aj_ = i - 1 | 0; - if(0 !== i){var i = _aj_; continue;} - break; + r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); + /*<>*/ /*<>*/ var _ac_ = i - 1 | 0; + if(0 === i) break; + i = _ac_; } } return r[1]; - /*<>*/ } + /*<>*/ } function exists(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ if - ( /*<>*/ caml_call1(p, a[1 + i])) - /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function for_all(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 1; - /*<>*/ if - (! /*<>*/ caml_call1(p, a[1 + i])) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 1; + /*<>*/ if + (! /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return 0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function mem(x, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - if(0 === /*<>*/ caml_float_compare(a[1 + i], x)) - /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + if(0 === /*<>*/ caml_float_compare(a[1 + i], x)) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } function mem_ieee(x, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - if(x == a[1 + i]) /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } - /*<>*/ /*<>*/ var - Bottom = [248, cst_Stdlib_Float_Array_Bottom, runtime.caml_fresh_oo_id(0)]; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + if(x == a[1 + i]) /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } + function find_opt(p, a){ + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var x = a[1 + i]; + /*<>*/ if( /*<>*/ caml_call1(p, x)) + /*<>*/ return [0, x]; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } + function find_index(p, a){ + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return [0, i]; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } + function find_map(f, a){ + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var + r = /*<>*/ caml_call1(f, a[1 + i]); + if(r) /*<>*/ return r; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } + function find_mapi(f, a){ + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var + r = /*<>*/ caml_call2(f, i, a[1 + i]); + if(r) /*<>*/ return r; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; + } + /*<>*/ } + /*<>*/ var + /*<>*/ Bottom = + [248, "Stdlib.Float.Array.Bottom", runtime.caml_fresh_oo_id(0)], + _b_ = [0, cst_float_ml, 484, 6]; function sort(cmp, a){ function maxson(l, i){ - /*<>*/ var + /*<>*/ var i31 = ((i + i | 0) + i | 0) + 1 | 0, - /*<>*/ x = [0, i31]; + /*<>*/ x = [0, i31]; if((i31 + 2 | 0) < l){ - /*<>*/ var - /*<>*/ _ab_ = i31 + 1 | 0, - /*<>*/ _ac_ = caml_check_bound(a, _ab_)[1 + _ab_]; + /*<>*/ var + /*<>*/ _W_ = i31 + 1 | 0, + /*<>*/ _X_ = caml_check_bound(a, _W_)[1 + _W_]; if - ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _ac_) + ( /*<>*/ caml_call2 + (cmp, caml_check_bound(a, i31)[1 + i31], _X_) < 0) x[1] = i31 + 1 | 0; - /*<>*/ var - /*<>*/ _ad_ = i31 + 2 | 0, - /*<>*/ _ae_ = caml_check_bound(a, _ad_)[1 + _ad_], - _af_ = x[1]; + /*<>*/ var + /*<>*/ _Y_ = i31 + 2 | 0, + /*<>*/ _Z_ = caml_check_bound(a, _Y_)[1 + _Y_], + ___ = x[1]; if - ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, _af_)[1 + _af_], _ae_) + ( /*<>*/ caml_call2 + (cmp, caml_check_bound(a, ___)[1 + ___], _Z_) < 0) x[1] = i31 + 2 | 0; return x[1]; } if((i31 + 1 | 0) < l){ - /*<>*/ var - _ag_ = i31 + 1 | 0, - /*<>*/ _ah_ = caml_check_bound(a, _ag_)[1 + _ag_]; - /*<>*/ if + /*<>*/ var + _$_ = i31 + 1 | 0, + /*<>*/ _aa_ = caml_check_bound(a, _$_)[1 + _$_]; + /*<>*/ if (0 > - /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _ah_)) - /*<>*/ return i31 + 1 | 0; + /*<>*/ caml_call2 + (cmp, caml_check_bound(a, i31)[1 + i31], _aa_)) + /*<>*/ return i31 + 1 | 0; } - if(i31 < l) /*<>*/ return i31; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(i31 < l) /*<>*/ return i31; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Bottom, i], 1); - /*<>*/ } - var l = a.length - 1, _X_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; - if(_X_ >= 0){ - var i$6 = _X_; + /*<>*/ } + var l = a.length - 1, _Q_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; + if(_Q_ >= 0){ + var i$6 = _Q_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e$1 = caml_check_bound(a, i$6)[1 + i$6]; - /*<>*/ try{ + /*<>*/ try{ var i = i$6; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var j = maxson(l, i); - /*<>*/ if + /*<>*/ if (0 - < - /*<>*/ caml_call2 - (cmp, caml_check_bound(a, j)[1 + j], e$1)){ - /*<>*/ /*<>*/ var - _U_ = caml_check_bound(a, j)[1 + j]; - /*<>*/ caml_check_bound(a, i)[1 + i] = _U_; - var i = j; - continue; - } - /*<>*/ caml_check_bound(a, i)[1 + i] = e$1; - break; + >= + /*<>*/ caml_call2 + (cmp, caml_check_bound(a, j)[1 + j], e$1)) + break; + /*<>*/ /*<>*/ var + _N_ = caml_check_bound(a, j)[1 + j]; + /*<>*/ caml_check_bound(a, i)[1 + i] = _N_; + i = j; } + /*<>*/ caml_check_bound(a, i)[1 + i] = e$1; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); if(exn[1] !== Bottom) throw caml_maybe_attach_backtrace(exn, 0); var i$0 = exn[2]; - /*<>*/ caml_check_bound(a, i$0)[1 + i$0] = e$1; + /*<>*/ caml_check_bound(a, i$0)[1 + i$0] = e$1; } - /*<>*/ /*<>*/ var - _aa_ = i$6 - 1 | 0; - if(0 !== i$6){var i$6 = _aa_; continue;} - break; + /*<>*/ /*<>*/ var _V_ = i$6 - 1 | 0; + if(0 === i$6) break; + i$6 = _V_; } } - /*<>*/ /*<>*/ var _Y_ = l - 1 | 0; - if(_Y_ >= 2){ - var i$4 = _Y_; - a: + /*<>*/ /*<>*/ var _R_ = l - 1 | 0; + if(_R_ >= 2){ + var i$4 = _R_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e$0 = caml_check_bound(a, i$4)[1 + i$4]; - /*<>*/ a[1 + i$4] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1 + i$4] = caml_check_bound(a, 0)[1]; var i$5 = 0; - /*<>*/ try{ + /*<>*/ try{ var i$1 = i$5; - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ j$0 = maxson(i$4, i$1), - /*<>*/ _V_ = caml_check_bound(a, j$0)[1 + j$0]; - /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _V_; - var i$1 = j$0; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ j$0 = maxson(i$4, i$1), + /*<>*/ _O_ = caml_check_bound(a, j$0)[1 + j$0]; + /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _O_; + i$1 = j$0; } } catch(exn){ var exn$0 = caml_wrap_exception(exn); if(exn$0[1] !== Bottom) throw caml_maybe_attach_backtrace(exn$0, 0); - var i$2 = exn$0[2], i$3 = i$2; - /*<>*/ for(;;){ - var father = (i$3 - 1 | 0) / 3 | 0; - if(i$3 === father) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _b_], 1); - /*<>*/ if - (0 - <= - /*<>*/ caml_call2 - (cmp, caml_check_bound(a, father)[1 + father], e$0)) - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = e$0; - else{ - /*<>*/ /*<>*/ var - _W_ = caml_check_bound(a, father)[1 + father]; - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _W_; - if(0 < father){var i$3 = father; continue;} - /*<>*/ caml_check_bound(a, 0)[1] = e$0; + var i$2 = exn$0[2]; + a: + { + b: + { + var i$3 = i$2; + /*<>*/ for(;;){ + var father = (i$3 - 1 | 0) / 3 | 0; + if(i$3 === father) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _b_], 1); + /*<>*/ if + (0 + <= + /*<>*/ caml_call2 + (cmp, caml_check_bound(a, father)[1 + father], e$0)) + break; + /*<>*/ /*<>*/ var + _P_ = caml_check_bound(a, father)[1 + father]; + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _P_; + if(0 >= father) break b; + i$3 = father; + } + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = e$0; + break a; } - /*<>*/ /*<>*/ var _$_ = i$4 - 1 | 0; - if(2 !== i$4){var i$4 = _$_; continue a;} - break; + /*<>*/ caml_check_bound(a, 0)[1] = e$0; } + /*<>*/ /*<>*/ var _U_ = i$4 - 1 | 0; + if(2 === i$4) break; + i$4 = _U_; } - break; } } - var _Z_ = 1 < l ? 1 : 0; - if(_Z_){ - /*<>*/ /*<>*/ var + var _S_ = 1 < l ? 1 : 0; + if(_S_){ + /*<>*/ /*<>*/ var e = caml_check_bound(a, 1)[2]; - /*<>*/ a[2] = caml_check_bound(a, 0)[1]; - /*<>*/ a[1] = e; - var ___ = 0; + /*<>*/ a[2] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1] = e; + var _T_ = 0; } else - var ___ = _Z_; - /*<>*/ return ___; - /*<>*/ } + var _T_ = _S_; + /*<>*/ return _T_; + /*<>*/ } function stable_sort(cmp, a){ function merge(src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs){ - /*<>*/ var + /*<>*/ var src1r = src1ofs + src1len | 0, src2r = src2ofs + src2len | 0, - /*<>*/ s2$1 = + /*<>*/ s2$1 = caml_check_bound(src2, src2ofs)[1 + src2ofs], - /*<>*/ s1$1 = + /*<>*/ s1$1 = caml_check_bound(a, src1ofs)[1 + src1ofs], i1 = src1ofs, s1 = s1$1, i2 = src2ofs, s2 = s2$1, d = dstofs; - /*<>*/ for(;;){ - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, s1, s2)){ - /*<>*/ caml_check_bound(dst, d)[1 + d] = s2; - /*<>*/ /*<>*/ var + /*<>*/ for(;;) + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, s1, s2)){ + /*<>*/ caml_check_bound(dst, d)[1 + d] = s2; + /*<>*/ /*<>*/ var i2$0 = i2 + 1 | 0; if(i2$0 >= src2r) return blit(a, i1, dst, d + 1 | 0, src1r - i1 | 0); - /*<>*/ var - /*<>*/ d$0 = d + 1 | 0, - /*<>*/ s2$0 = caml_check_bound(src2, i2$0)[1 + i2$0], - i2 = i2$0, - s2 = s2$0, - d = d$0; - continue; + /*<>*/ var + /*<>*/ d$0 = d + 1 | 0, + /*<>*/ s2$0 = caml_check_bound(src2, i2$0)[1 + i2$0]; + i2 = i2$0; + s2 = s2$0; + d = d$0; } - /*<>*/ caml_check_bound(dst, d)[1 + d] = s1; - /*<>*/ /*<>*/ var i1$0 = i1 + 1 | 0; - if(i1$0 >= src1r) return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0); - /*<>*/ var - /*<>*/ d$1 = d + 1 | 0, - /*<>*/ s1$0 = caml_check_bound(a, i1$0)[1 + i1$0], - i1 = i1$0, - s1 = s1$0, + else{ + /*<>*/ caml_check_bound(dst, d)[1 + d] = s1; + /*<>*/ /*<>*/ var + i1$0 = i1 + 1 | 0; + if(i1$0 >= src1r) + return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0); + /*<>*/ var + /*<>*/ d$1 = d + 1 | 0, + /*<>*/ s1$0 = caml_check_bound(a, i1$0)[1 + i1$0]; + i1 = i1$0; + s1 = s1$0; d = d$1; - } - /*<>*/ } + } + /*<>*/ } function isortto(srcofs, dst, dstofs, len){ - /*<>*/ var - _M_ = len - 1 | 0, - /*<>*/ _L_ = 0; - if(_M_ >= 0){ - var i = _L_; - a: + /*<>*/ var + _F_ = len - 1 | 0, + /*<>*/ _E_ = 0; + if(_F_ >= 0){ + var i = _E_; for(;;){ - /*<>*/ var - _N_ = srcofs + i | 0, - /*<>*/ e = caml_check_bound(a, _N_)[1 + _N_], - /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; + /*<>*/ var + _G_ = srcofs + i | 0, + /*<>*/ e = caml_check_bound(a, _G_)[1 + _G_], + /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; for(;;){ - if(dstofs <= j[1]){ - var _O_ = j[1]; - /*<>*/ if - (0 - < - /*<>*/ caml_call2 - (cmp, caml_check_bound(dst, _O_)[1 + _O_], e)){ - /*<>*/ var - _P_ = j[1], - /*<>*/ _Q_ = caml_check_bound(dst, _P_)[1 + _P_], - _R_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _R_)[1 + _R_] = _Q_; - j[1] += -1; - continue; - } - } - var _S_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _S_)[1 + _S_] = e; - /*<>*/ /*<>*/ var _T_ = i + 1 | 0; - if(_M_ !== i){var i = _T_; continue a;} - break; + if(dstofs > j[1]) break; + var _H_ = j[1]; + /*<>*/ if + (0 + >= + /*<>*/ caml_call2 + (cmp, caml_check_bound(dst, _H_)[1 + _H_], e)) + break; + /*<>*/ var + _I_ = j[1], + /*<>*/ _J_ = caml_check_bound(dst, _I_)[1 + _I_], + _K_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _K_)[1 + _K_] = _J_; + j[1]--; } - break; + var _L_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _L_)[1 + _L_] = e; + /*<>*/ /*<>*/ var _M_ = i + 1 | 0; + if(_F_ === i) break; + i = _M_; } } return 0; - /*<>*/ } + /*<>*/ } function sortto(srcofs, dst, dstofs, len){ - /*<>*/ if(len <= 5) - /*<>*/ return isortto(srcofs, dst, dstofs, len); + /*<>*/ if(len <= 5) + /*<>*/ return isortto(srcofs, dst, dstofs, len); var l1 = len / 2 | 0, l2 = len - l1 | 0; - /*<>*/ sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); - /*<>*/ sortto(srcofs, a, srcofs + l2 | 0, l1); - /*<>*/ return merge + /*<>*/ sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); + /*<>*/ sortto(srcofs, a, srcofs + l2 | 0, l1); + /*<>*/ return merge (srcofs + l2 | 0, l1, dst, dstofs + l1 | 0, l2, dst, dstofs); - /*<>*/ } + /*<>*/ } var l = a.length - 1; - if(l <= 5) /*<>*/ return isortto(0, a, 0, l); - /*<>*/ var + if(l <= 5) /*<>*/ return isortto(0, a, 0, l); + /*<>*/ var l1 = l / 2 | 0, l2 = l - l1 | 0, - /*<>*/ t = - /*<>*/ caml_floatarray_create(l2); - /*<>*/ sortto(l1, t, 0, l2); - /*<>*/ sortto(0, a, l2, l1); - /*<>*/ return merge(l2, l1, t, 0, l2, a, 0); - /*<>*/ } + /*<>*/ t = + /*<>*/ caml_floatarray_create(l2); + /*<>*/ sortto(l1, t, 0, l2); + /*<>*/ sortto(0, a, l2, l1); + /*<>*/ return merge(l2, l1, t, 0, l2, a, 0); + /*<>*/ } + function shuffle(rand, a){ + /*<>*/ var _C_ = a.length - 2 | 0; + if(_C_ >= 1){ + var i = _C_; + for(;;){ + /*<>*/ var + /*<>*/ j = + /*<>*/ caml_call1(rand, i + 1 | 0), + /*<>*/ v = a[1 + i]; + /*<>*/ a[1 + i] = caml_check_bound(a, j)[1 + j]; + /*<>*/ a[1 + j] = v; + var _D_ = i - 1 | 0; + if(1 === i) break; + i = _D_; + } + } + return 0; + /*<>*/ } function to_seq(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _J_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _A_ = i + 1 | 0; + /*<>*/ return [0, x, - function(_K_){ /*<>*/ return aux(_J_, _K_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _H_ = 0; - /*<>*/ return function(_I_){ - /*<>*/ return aux(_H_, _I_);}; - /*<>*/ } + function(_B_){ /*<>*/ return aux(_A_, _B_);}]; + /*<>*/ } + /*<>*/ var _y_ = 0; + /*<>*/ return function(_z_){ + /*<>*/ return aux(_y_, _z_);}; + /*<>*/ } function to_seqi(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _F_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _w_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], - function(_G_){ /*<>*/ return aux(_F_, _G_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _D_ = 0; - /*<>*/ return function(_E_){ - /*<>*/ return aux(_D_, _E_);}; - /*<>*/ } + function(_x_){ /*<>*/ return aux(_w_, _x_);}]; + /*<>*/ } + /*<>*/ var _u_ = 0; + /*<>*/ return function(_v_){ + /*<>*/ return aux(_u_, _v_);}; + /*<>*/ } function of_seq(i$2){ - /*<>*/ var _B_ = 0; - function _C_(acc, x){ - /*<>*/ return [0, x, acc]; - /*<>*/ } - /*<>*/ var - /*<>*/ l = - /*<>*/ caml_call3(Stdlib_Seq[5], _C_, _B_, i$2), - /*<>*/ len = - /*<>*/ caml_call1(Stdlib_List[1], l), - /*<>*/ a = - /*<>*/ caml_floatarray_create(len), - /*<>*/ i$1 = len - 1 | 0, + /*<>*/ var + /*<>*/ l = + /*<>*/ caml_call3 + (Stdlib_Seq[5], + function(acc, x){ + /*<>*/ return [0, x, acc]; + /*<>*/ }, + 0, + i$2), + /*<>*/ len = + /*<>*/ caml_call1(Stdlib_List[1], l), + /*<>*/ a = + /*<>*/ caml_floatarray_create(len), + /*<>*/ i$1 = len - 1 | 0, i = i$1, param = l; for(;;){ - if(! param) /*<>*/ return a; + if(! param) /*<>*/ return a; var tl = param[2], hd = param[1]; - /*<>*/ a[1 + i] = hd; - /*<>*/ var - /*<>*/ i$0 = i - 1 | 0, - i = i$0, - param = tl; + /*<>*/ a[1 + i] = hd; + /*<>*/ /*<>*/ var i$0 = i - 1 | 0; + i = i$0; + param = tl; } - /*<>*/ } + /*<>*/ } function map_to_array(f, a){ - /*<>*/ var l = a.length - 1; - /*<>*/ if(0 === l) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ runtime.caml_make_vect - (l, /*<>*/ caml_call1(f, a[1])), - /*<>*/ _z_ = l - 1 | 0, - /*<>*/ _y_ = 1; - if(_z_ >= 1){ - var i = _y_; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, a[1])), + /*<>*/ _s_ = l - 1 | 0, + /*<>*/ _r_ = 1; + if(_s_ >= 1){ + var i = _r_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _A_ = i + 1 | 0; - if(_z_ !== i){var i = _A_; continue;} - break; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _t_ = i + 1 | 0; + if(_s_ === i) break; + i = _t_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_from_array(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _w_ = l - 1 | 0, - /*<>*/ _v_ = 0; - if(_w_ >= 0){ - var i = _v_; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _p_ = l - 1 | 0, + /*<>*/ _o_ = 0; + if(_p_ >= 0){ + var i = _o_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _x_ = i + 1 | 0; - if(_w_ !== i){var i = _x_; continue;} - break; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _q_ = i + 1 | 0; + if(_p_ === i) break; + i = _q_; } } - /*<>*/ return r; - /*<>*/ } - var _c_ = caml_floatarray_create; - function _d_(_u_, _t_, _s_){ - /*<>*/ caml_check_bound(_u_, _t_)[1 + _t_] = _s_; - return 0; - } - function _e_(_r_, _q_){ - /*<>*/ return caml_check_bound(_r_, _q_)[1 + _q_]; - } - var - _f_ = - [0, - function(_p_){ /*<>*/ return _p_.length - 1;}, - _e_, - _d_, - make, - _c_, - init, - append, - concat, - sub, - copy, - fill, - blit, - to_list, - of_list, - iter, - iteri, - map, - mapi, - fold_left, - fold_right, - iter2, - map2, - for_all, - exists, - mem, - mem_ieee, - sort, - stable_sort, - stable_sort, - to_seq, - to_seqi, - of_seq, - map_to_array, - map_from_array], - _g_ = caml_floatarray_create; - function _h_(_o_, _n_, _m_){ - /*<>*/ caml_check_bound(_o_, _n_)[1 + _n_] = _m_; - return 0; - } - function _i_(_l_, _k_){ - /*<>*/ return caml_check_bound(_l_, _k_)[1 + _k_]; - } + /*<>*/ return r; + /*<>*/ } var Stdlib_Float = [0, - zero, - one, - minus_one, + 0., + 1., + -1., succ, pred, infinity, neg_infinity, nan, - pi, + signaling_nan, + nan, + 3.141592653589793, max_float, min_float, epsilon, @@ -8626,14 +9136,22 @@ min_num, max_num, min_max_num, + seeded_hash, hash, [0, - function(_j_){ /*<>*/ return _j_.length - 1;}, - _i_, - _h_, + function(_n_){ /*<>*/ return _n_.length - 1;}, + function(_m_, _l_){ + /*<>*/ return caml_check_bound(_m_, _l_)[1 + _l_]; + }, + function(_k_, _j_, _i_){ + /*<>*/ caml_check_bound(_k_, _j_)[1 + _j_] = _i_; + return 0; + }, make, - _g_, + caml_floatarray_create, init, + make_matrix, + init_matrix, append, concat, sub, @@ -8645,7 +9163,9 @@ iter, iteri, map, + map_inplace, mapi, + mapi_inplace, fold_left, fold_right, iter2, @@ -8654,29 +9174,85 @@ exists, mem, mem_ieee, + find_opt, + find_index, + find_map, + find_mapi, sort, stable_sort, stable_sort, + shuffle, to_seq, to_seqi, of_seq, map_to_array, map_from_array], - _f_]; - runtime.caml_register_global(22, Stdlib_Float, "Stdlib__Float"); + [0, + function(_h_){ /*<>*/ return _h_.length - 1;}, + function(_g_, _f_){ + /*<>*/ return caml_check_bound(_g_, _f_)[1 + _f_]; + }, + function(_e_, _d_, _c_){ + /*<>*/ caml_check_bound(_e_, _d_)[1 + _d_] = _c_; + return 0; + }, + make, + caml_floatarray_create, + init, + make_matrix, + init_matrix, + append, + concat, + sub, + copy, + fill, + blit, + to_list, + of_list, + iter, + iteri, + map, + map_inplace, + mapi, + mapi_inplace, + fold_left, + fold_right, + iter2, + map2, + for_all, + exists, + mem, + mem_ieee, + find_opt, + find_index, + find_map, + find_mapi, + sort, + stable_sort, + stable_sort, + shuffle, + to_seq, + to_seqi, + of_seq, + map_to_array, + map_from_array]]; + runtime.caml_register_global(25, Stdlib_Float, "Stdlib__Float"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Int32 -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Sys +//# unitInfo: Requires: Stdlib, Stdlib__Sys (function (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, caml_greaterequal = runtime.caml_greaterequal, + caml_hash = runtime.caml_hash, caml_int_compare = runtime.caml_int_compare, + caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_mul = runtime.caml_mul, caml_wrap_exception = runtime.caml_wrap_exception, @@ -8684,10 +9260,8 @@ Stdlib = global_data.Stdlib, Stdlib_Sys = global_data.Stdlib__Sys, Assert_failure = global_data.Assert_failure, - _b_ = [0, "int32.ml", 69, 6], zero = 0, - one = 1, - minus_one = -1; + one = 1; function succ(n){ /*<>*/ return n + 1 | 0; /*<>*/ } @@ -8700,19 +9274,23 @@ ? n : - n | 0; /*<>*/ } - var min_int = -2147483648, max_int = 2147483647; function lognot(n){ /*<>*/ return n ^ -1; /*<>*/ } - var _a_ = Stdlib_Sys[9]; + var + _a_ = Stdlib_Sys[9], + _b_ = [0, "int32.ml", 69, 6], + minus_one = -1, + min_int = -2147483648, + max_int = 2147483647; if(32 === _a_) /*<>*/ var /*<>*/ max_int$0 = Stdlib[19], unsigned_to_int = function(n){ /*<>*/ if - (0 >= /*<>*/ caml_int_compare(0, n) - && 0 >= /*<>*/ caml_int_compare(n, max_int$0)) + ( /*<>*/ caml_greaterequal(n, 0) + && /*<>*/ caml_lessequal(n, max_int$0)) /*<>*/ return [0, n]; /*<>*/ return 0; /*<>*/ }; @@ -8731,56 +9309,64 @@ ("%d", n); /*<>*/ } function of_string_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _d_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; - /*<>*/ return _d_; + /*<>*/ try{ + /*<>*/ /*<>*/ var + _d_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; + /*<>*/ return _d_; } catch(_e_){ var _c_ = caml_wrap_exception(_e_); - if(_c_[1] === Stdlib[7]) /*<>*/ return 0; + if(_c_[1] === Stdlib[7]) /*<>*/ return 0; throw caml_maybe_attach_backtrace(_c_, 0); } - /*<>*/ } - var compare = caml_int_compare; - function equal(x, y){ - /*<>*/ return 0 - === /*<>*/ caml_int_compare(x, y) - ? 1 - : 0; - /*<>*/ } + /*<>*/ } + var compare = caml_int_compare, equal = runtime.caml_equal; function unsigned_compare(n, m){ - /*<>*/ return /*<>*/ caml_int_compare + /*<>*/ var + /*<>*/ y = m + 2147483648 | 0, + /*<>*/ x = n + 2147483648 | 0; + /*<>*/ return /*<>*/ caml_int_compare + (x, y); + /*<>*/ } + function unsigned_lt(n, m){ + /*<>*/ return /*<>*/ caml_lessthan (n + 2147483648 | 0, m + 2147483648 | 0); - /*<>*/ } + /*<>*/ } function min(x, y){ - /*<>*/ return /*<>*/ runtime.caml_lessequal + /*<>*/ return /*<>*/ caml_lessequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function max(x, y){ - /*<>*/ return /*<>*/ caml_greaterequal + /*<>*/ return /*<>*/ caml_greaterequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function unsigned_div(n, d){ - /*<>*/ if - ( /*<>*/ runtime.caml_lessthan(d, 0)) - /*<>*/ return 0 <= unsigned_compare(n, d) ? one : zero; - /*<>*/ var - /*<>*/ q = - /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, - /*<>*/ r = - n - /*<>*/ caml_mul(q, d) | 0; - /*<>*/ return 0 <= unsigned_compare(r, d) ? q + 1 | 0 : q; - /*<>*/ } + /*<>*/ if( /*<>*/ caml_lessthan(d, 0)) + /*<>*/ return unsigned_lt(n, d) ? zero : one; + /*<>*/ var + /*<>*/ q = + /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, + /*<>*/ r = + n - /*<>*/ caml_mul(q, d) | 0; + /*<>*/ return unsigned_lt(r, d) ? q : q + 1 | 0; + /*<>*/ } function unsigned_rem(n, d){ - /*<>*/ return n - - /*<>*/ caml_mul(unsigned_div(n, d), d) + /*<>*/ return n + - /*<>*/ caml_mul(unsigned_div(n, d), d) | 0; - /*<>*/ } + /*<>*/ } + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } + function hash(x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, 0, x); + /*<>*/ } var Stdlib_Int32 = [0, @@ -8802,8 +9388,10 @@ unsigned_compare, equal, min, - max]; - runtime.caml_register_global(14, Stdlib_Int32, "Stdlib__Int32"); + max, + seeded_hash, + hash]; + runtime.caml_register_global(15, Stdlib_Int32, "Stdlib__Int32"); return; /*<>*/ } (globalThis)); @@ -8816,24 +9404,28 @@ var runtime = globalThis.jsoo_runtime, caml_greaterequal = runtime.caml_greaterequal, + caml_hash = runtime.caml_hash, + caml_int64_add = runtime.caml_int64_add, caml_int64_compare = runtime.caml_int64_compare, caml_int64_mul = runtime.caml_int64_mul, caml_int64_sub = runtime.caml_int64_sub, + caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception, global_data = runtime.caml_get_global_data(), + _a_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), zero = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), one = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), minus_one = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 65535), min_int = runtime.caml_int64_create_lo_mi_hi(0, 0, 32768), max_int = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 32767), Stdlib = global_data.Stdlib, - _d_ = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 65535), - _c_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), _b_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), - _a_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0); + _c_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), + _d_ = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 65535); function succ(n){ - /*<>*/ return /*<>*/ runtime.caml_int64_add + /*<>*/ return /*<>*/ caml_int64_add (n, _a_); /*<>*/ } function pred(n){ @@ -8850,13 +9442,14 @@ /*<>*/ return /*<>*/ runtime.caml_int64_xor (n, _d_); /*<>*/ } - /*<>*/ /*<>*/ var - max_int$0 = - /*<>*/ runtime.caml_int64_of_int32(Stdlib[19]); - function unsigned_to_int(n){ + /*<>*/ var + /*<>*/ max_int$0 = + /*<>*/ runtime.caml_int64_of_int32(Stdlib[19]), + _e_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0); + /*<>*/ function unsigned_to_int(n){ /*<>*/ if - (0 >= /*<>*/ caml_int64_compare(zero, n) - && 0 >= /*<>*/ caml_int64_compare(n, max_int$0)) + ( /*<>*/ caml_greaterequal(n, _e_) + && /*<>*/ caml_lessequal(n, max_int$0)) /*<>*/ return [0, runtime.caml_int64_to_int32(n)]; /*<>*/ return 0; /*<>*/ } @@ -8865,34 +9458,38 @@ ("%d", n); /*<>*/ } function of_string_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _f_ = [0, /*<>*/ runtime.caml_int64_of_string(s)]; - /*<>*/ return _f_; - } - catch(_g_){ - var _e_ = caml_wrap_exception(_g_); - if(_e_[1] === Stdlib[7]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_e_, 0); + /*<>*/ try{ + /*<>*/ /*<>*/ var + _g_ = [0, /*<>*/ runtime.caml_int64_of_string(s)]; + /*<>*/ return _g_; + } + catch(_h_){ + var _f_ = caml_wrap_exception(_h_); + if(_f_[1] === Stdlib[7]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_f_, 0); } - /*<>*/ } + /*<>*/ } function compare(x, y){ - /*<>*/ return /*<>*/ caml_int64_compare + /*<>*/ return /*<>*/ caml_int64_compare (x, y); - /*<>*/ } - function equal(x, y){ - /*<>*/ return 0 - === /*<>*/ caml_int64_compare(x, y) - ? 1 - : 0; - /*<>*/ } + /*<>*/ } + var equal = runtime.caml_equal; function unsigned_compare(n, m){ - /*<>*/ return /*<>*/ caml_int64_compare - ( /*<>*/ caml_int64_sub(n, min_int), - /*<>*/ caml_int64_sub(m, min_int)); - /*<>*/ } + /*<>*/ var + /*<>*/ y = + /*<>*/ caml_int64_sub(m, min_int), + /*<>*/ x = + /*<>*/ caml_int64_sub(n, min_int); + /*<>*/ return /*<>*/ caml_int64_compare + (x, y); + /*<>*/ } + function unsigned_lt(n, m){ + /*<>*/ return /*<>*/ caml_lessthan + ( /*<>*/ caml_int64_sub(n, min_int), + /*<>*/ caml_int64_sub(m, min_int)); + /*<>*/ } function min(x, y){ - /*<>*/ return /*<>*/ runtime.caml_lessequal + /*<>*/ return /*<>*/ caml_lessequal (x, y) ? x : y; @@ -8904,9 +9501,8 @@ : y; /*<>*/ } function unsigned_div(n, d){ - /*<>*/ if - ( /*<>*/ runtime.caml_lessthan(d, zero)) - /*<>*/ return 0 <= unsigned_compare(n, d) ? one : zero; + /*<>*/ if( /*<>*/ caml_lessthan(d, zero)) + /*<>*/ return unsigned_lt(n, d) ? zero : one; /*<>*/ var /*<>*/ q = /*<>*/ runtime.caml_int64_shift_left @@ -8918,12 +9514,22 @@ /*<>*/ r = /*<>*/ caml_int64_sub (n, /*<>*/ caml_int64_mul(q, d)); - /*<>*/ return 0 <= unsigned_compare(r, d) ? succ(q) : q; - /*<>*/ } + /*<>*/ return unsigned_lt(r, d) + ? q + : /*<>*/ caml_int64_add(q, _a_); + /*<>*/ } function unsigned_rem(n, d){ /*<>*/ return /*<>*/ caml_int64_sub (n, /*<>*/ caml_int64_mul(unsigned_div(n, d), d)); /*<>*/ } + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } + function hash(x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, 0, x); + /*<>*/ } var Stdlib_Int64 = [0, @@ -8945,8 +9551,10 @@ unsigned_compare, equal, min, - max]; - runtime.caml_register_global(11, Stdlib_Int64, "Stdlib__Int64"); + max, + seeded_hash, + hash]; + runtime.caml_register_global(12, Stdlib_Int64, "Stdlib__Int64"); return; /*<>*/ } (globalThis)); @@ -8959,7 +9567,10 @@ var runtime = globalThis.jsoo_runtime, caml_greaterequal = runtime.caml_greaterequal, + caml_hash = runtime.caml_hash, caml_int_compare = runtime.caml_int_compare, + caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_mul = runtime.caml_mul, caml_wrap_exception = runtime.caml_wrap_exception, @@ -8967,8 +9578,7 @@ Stdlib = global_data.Stdlib, Stdlib_Sys = global_data.Stdlib__Sys, zero = 0, - one = 1, - minus_one = -1; + one = 1; function succ(n){ /*<>*/ return n + 1 | 0; /*<>*/ } @@ -8989,10 +9599,10 @@ /*<>*/ return n ^ -1; /*<>*/ } var max_int$0 = Stdlib[19]; - function unsigned_to_int(n){ + /*<>*/ function unsigned_to_int(n){ /*<>*/ if - (0 >= /*<>*/ caml_int_compare(0, n) - && 0 >= /*<>*/ caml_int_compare(n, max_int$0)) + ( /*<>*/ caml_greaterequal(n, 0) + && /*<>*/ caml_lessequal(n, max_int$0)) /*<>*/ return [0, n]; /*<>*/ return 0; /*<>*/ } @@ -9001,66 +9611,77 @@ ("%d", n); /*<>*/ } function of_string_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _b_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; - /*<>*/ return _b_; + /*<>*/ try{ + /*<>*/ /*<>*/ var + _b_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; + /*<>*/ return _b_; } catch(_c_){ var _a_ = caml_wrap_exception(_c_); - if(_a_[1] === Stdlib[7]) /*<>*/ return 0; + if(_a_[1] === Stdlib[7]) /*<>*/ return 0; throw caml_maybe_attach_backtrace(_a_, 0); } - /*<>*/ } + /*<>*/ } var compare = caml_int_compare; function equal(x, y){ - /*<>*/ return 0 - === /*<>*/ caml_int_compare(x, y) + /*<>*/ return 0 + === /*<>*/ caml_int_compare(x, y) ? 1 : 0; - /*<>*/ } + /*<>*/ } function unsigned_compare(n, m){ - /*<>*/ return /*<>*/ caml_int_compare + /*<>*/ var + /*<>*/ y = m - min_int | 0, + /*<>*/ x = n - min_int | 0; + /*<>*/ return /*<>*/ caml_int_compare + (x, y); + /*<>*/ } + function unsigned_lt(n, m){ + /*<>*/ return /*<>*/ caml_lessthan (n - min_int | 0, m - min_int | 0); - /*<>*/ } + /*<>*/ } function min(x, y){ - /*<>*/ return /*<>*/ runtime.caml_lessequal + /*<>*/ return /*<>*/ caml_lessequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function max(x, y){ - /*<>*/ return /*<>*/ caml_greaterequal + /*<>*/ return /*<>*/ caml_greaterequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function unsigned_div(n, d){ - /*<>*/ if - ( /*<>*/ runtime.caml_lessthan(d, 0)) - /*<>*/ return 0 <= unsigned_compare(n, d) - ? one - : zero; - /*<>*/ var - /*<>*/ q = - /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, - /*<>*/ r = - n - /*<>*/ caml_mul(q, d) | 0; - /*<>*/ return 0 <= unsigned_compare(r, d) - ? q + 1 | 0 - : q; - /*<>*/ } + /*<>*/ if + ( /*<>*/ caml_lessthan(d, 0)) + /*<>*/ return unsigned_lt(n, d) ? zero : one; + /*<>*/ var + /*<>*/ q = + /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, + /*<>*/ r = + n - /*<>*/ caml_mul(q, d) | 0; + /*<>*/ return unsigned_lt(r, d) ? q : q + 1 | 0; + /*<>*/ } function unsigned_rem(n, d){ - /*<>*/ return n - - /*<>*/ caml_mul(unsigned_div(n, d), d) + /*<>*/ return n + - /*<>*/ caml_mul(unsigned_div(n, d), d) | 0; - /*<>*/ } + /*<>*/ } + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } + function hash(x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, 0, x); + /*<>*/ } var Stdlib_Nativeint = [0, zero, one, - minus_one, + -1, unsigned_div, unsigned_rem, succ, @@ -9077,8 +9698,10 @@ unsigned_compare, equal, min, - max]; - runtime.caml_register_global(12, Stdlib_Nativeint, "Stdlib__Nativeint"); + max, + seeded_hash, + hash]; + runtime.caml_register_global(13, Stdlib_Nativeint, "Stdlib__Nativeint"); return; /*<>*/ } (globalThis)); @@ -9133,12 +9756,12 @@ /*<>*/ var /*<>*/ result = /*<>*/ runtime.caml_lex_engine(tbl, state, buf), - _F_ = 0 <= result ? 1 : 0, - _G_ = _F_ ? buf[12] !== dummy_pos ? 1 : 0 : _F_; - if(_G_){ + _n_ = 0 <= result ? 1 : 0, + _o_ = _n_ ? buf[12] !== dummy_pos ? 1 : 0 : _n_; + if(_o_){ buf[11] = buf[12]; - var _H_ = buf[12]; - buf[12] = [0, _H_[1], _H_[2], _H_[3], buf[4] + buf[6] | 0]; + var _p_ = buf[12]; + buf[12] = [0, _p_[1], _p_[2], _p_[3], buf[4] + buf[6] | 0]; } /*<>*/ return result; /*<>*/ } @@ -9146,35 +9769,22 @@ /*<>*/ var /*<>*/ result = /*<>*/ runtime.caml_new_lex_engine(tbl, state, buf), - _C_ = 0 <= result ? 1 : 0, - _D_ = _C_ ? buf[12] !== dummy_pos ? 1 : 0 : _C_; - if(_D_){ + _k_ = 0 <= result ? 1 : 0, + _l_ = _k_ ? buf[12] !== dummy_pos ? 1 : 0 : _k_; + if(_l_){ buf[11] = buf[12]; - var _E_ = buf[12]; - buf[12] = [0, _E_[1], _E_[2], _E_[3], buf[4] + buf[6] | 0]; + var _m_ = buf[12]; + buf[12] = [0, _m_[1], _m_[2], _m_[3], buf[4] + buf[6] | 0]; } /*<>*/ return result; /*<>*/ } function from_function(opt, read_fun){ - /*<>*/ if(opt) - var sth = opt[1], with_positions = sth; - else - var with_positions = 1; /*<>*/ var - /*<>*/ _o_ = with_positions ? zero_pos : dummy_pos, - _p_ = with_positions ? zero_pos : dummy_pos, + with_positions = opt ? opt[1] : 1, + /*<>*/ _f_ = with_positions ? zero_pos : dummy_pos, + _g_ = with_positions ? zero_pos : dummy_pos, /*<>*/ aux_buffer = - /*<>*/ caml_create_bytes(512), - _q_ = [0], - /*<>*/ _r_ = 0, - _s_ = 0, - _t_ = 0, - _u_ = 0, - _v_ = 0, - _w_ = 0, - _x_ = 0, - /*<>*/ _y_ = - /*<>*/ caml_create_bytes(1024); + /*<>*/ caml_create_bytes(512); /*<>*/ return [0, function(lexbuf){ /*<>*/ var @@ -9220,18 +9830,18 @@ lexbuf[5] = 0; lexbuf[7] = lexbuf[7] - s | 0; lexbuf[3] = lexbuf[3] - s | 0; - var t = lexbuf[10], _A_ = t.length - 1 - 1 | 0, _z_ = 0; - if(_A_ >= 0){ - var i = _z_; + var t = lexbuf[10], _i_ = t.length - 2 | 0, _h_ = 0; + if(_i_ >= 0){ + var i = _h_; for(;;){ /*<>*/ /*<>*/ var v = caml_check_bound(t, i)[1 + i]; if(0 <= v) /*<>*/ caml_check_bound(t, i)[1 + i] = v - s | 0; /*<>*/ /*<>*/ var - _B_ = i + 1 | 0; - if(_A_ !== i){var i = _B_; continue;} - break; + _j_ = i + 1 | 0; + if(_i_ === i) break; + i = _j_; } } } @@ -9240,18 +9850,18 @@ lexbuf[3] = lexbuf[3] + n | 0; return 0; }, - _y_, - _x_, - _w_, - _v_, - _u_, - _t_, - _s_, - _r_, - _q_, - _p_, - _o_]; - /*<>*/ } + /*<>*/ caml_create_bytes(1024), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + [0], + _g_, + _f_]; + } function from_channel(with_positions, ic){ /*<>*/ return from_function (with_positions, @@ -9261,40 +9871,27 @@ /*<>*/ }); /*<>*/ } function from_string(opt, s){ - /*<>*/ if(opt) - var sth = opt[1], with_positions = sth; - else - var with_positions = 1; /*<>*/ var + with_positions = opt ? opt[1] : 1, /*<>*/ _d_ = with_positions ? zero_pos : dummy_pos, - _e_ = with_positions ? zero_pos : dummy_pos, - _f_ = [0], - /*<>*/ _g_ = 1, - _h_ = 0, - _i_ = 0, - _j_ = 0, - _k_ = 0, - _l_ = 0, - _m_ = runtime.caml_ml_string_length(s), - /*<>*/ _n_ = - /*<>*/ caml_call1(Stdlib_Bytes[5], s); + _e_ = with_positions ? zero_pos : dummy_pos; /*<>*/ return [0, function(lexbuf){ /*<>*/ lexbuf[9] = 1; return 0; /*<>*/ }, - _n_, - _m_, - _l_, - _k_, - _j_, - _i_, - _h_, - _g_, - _f_, + /*<>*/ caml_call1(Stdlib_Bytes[5], s), + runtime.caml_ml_string_length(s), + 0, + 0, + 0, + 0, + 0, + 1, + [0], _e_, _d_]; - /*<>*/ } + } function set_position(lexbuf, position){ /*<>*/ lexbuf[12] = [0, lexbuf[12][1], position[2], position[3], position[4]]; @@ -9427,6 +10024,7 @@ : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); } /*<>*/ var + undef = undefined, global_data = runtime.caml_get_global_data(), Stdlib_Obj = global_data.Stdlib__Obj, Stdlib_Array = global_data.Stdlib__Array, @@ -9452,8 +10050,7 @@ 0, 0, 0, - 0], - cst_syntax_error = "syntax error"; + 0]; function grow_stacks(param){ /*<>*/ var oldsize = env[5], @@ -9467,32 +10064,33 @@ /*<>*/ new_end = /*<>*/ caml_make_vect(newsize, Stdlib_Lexing[1]); /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[1], 0, new_s, 0, oldsize); + (Stdlib_Array[9], env[1], 0, new_s, 0, oldsize); env[1] = new_s; /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[2], 0, new_v, 0, oldsize); + (Stdlib_Array[9], env[2], 0, new_v, 0, oldsize); env[2] = new_v; /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[3], 0, new_start, 0, oldsize); + (Stdlib_Array[9], env[3], 0, new_start, 0, oldsize); env[3] = new_start; /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[4], 0, new_end, 0, oldsize); + (Stdlib_Array[9], env[4], 0, new_end, 0, oldsize); env[4] = new_end; env[5] = newsize; - return 0; + return; /*<>*/ } function clear_parser(param){ /*<>*/ /*<>*/ caml_call4 - (Stdlib_Array[7], env[2], 0, env[5], 0); + (Stdlib_Array[8], env[2], 0, env[5], 0); env[8] = 0; return 0; /*<>*/ } - /*<>*/ /*<>*/ var - current_lookahead_fun = + /*<>*/ var + /*<>*/ current_lookahead_fun = [0, function(param){ /*<>*/ return 0; - /*<>*/ }]; + /*<>*/ }], + cst_syntax_error = "syntax error"; function yyparse(tables, start, lexer, lexbuf){ /*<>*/ var init_asp = env[11], @@ -9516,19 +10114,16 @@ arg$0 = /*<>*/ caml_call1(lexer, lexbuf); env[9] = lexbuf[11]; env[10] = lexbuf[12]; - var cmd = 1, arg = arg$0; - continue; + cmd = 1; + arg = arg$0; + break; case 1: /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Parse_error, 1); case 2: - /*<>*/ grow_stacks(0); - var cmd = 2, arg = 0; - continue; + /*<>*/ grow_stacks(0); cmd = 2; arg = 0; break; case 3: - /*<>*/ grow_stacks(0); - var cmd = 3, arg = 0; - continue; + /*<>*/ grow_stacks(0); cmd = 3; arg = 0; break; case 4: try{ /*<>*/ var @@ -9545,13 +10140,14 @@ if(_h_ !== Parse_error) throw caml_maybe_attach_backtrace(_h_, 0); var value = 0, action = 5; } - var cmd = action, arg = value; - continue; + cmd = action; + arg = value; + break; default: /*<>*/ /*<>*/ caml_call1 (tables[14], cst_syntax_error); - var cmd = 5, arg = 0; - continue; + cmd = 5; + arg = 0; } } catch(exn$0){ @@ -9609,9 +10205,9 @@ /*<>*/ if ( /*<>*/ runtime.caml_notequal(st, en)) /*<>*/ return st; - /*<>*/ var - /*<>*/ i$0 = i - 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var + i$0 = i - 1 | 0; + i = i$0; } /*<>*/ } function symbol_end_pos(param){ @@ -9670,7 +10266,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Set -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__List, Stdlib__Seq +//# unitInfo: Requires: Stdlib, Stdlib__List, Stdlib__Seq (function (globalThis){ "use strict"; @@ -9699,112 +10295,112 @@ Stdlib_Seq = global_data.Stdlib__Seq, Stdlib_List = global_data.Stdlib__List, Assert_failure = global_data.Assert_failure, - cst_Set_remove_min_elt = "Set.remove_min_elt", - _a_ = [0, 0, 0, 0], - _b_ = [0, 0, 0], - _c_ = [0, "set.ml", 570, 18], cst_Set_bal = cst_Set_bal$3, cst_Set_bal$0 = cst_Set_bal$3, cst_Set_bal$1 = cst_Set_bal$3, cst_Set_bal$2 = cst_Set_bal$3, + cst_Set_remove_min_elt = "Set.remove_min_elt", + _a_ = [0, 0, 0, 0], + _b_ = [0, 0, 0], + _c_ = [0, "set.ml", 571, 18], Stdlib_Set = [0, function(Ord){ function height(param){ - /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ if(! param) /*<>*/ return 0; var h = param[4]; - /*<>*/ return h; - /*<>*/ } + /*<>*/ return h; + /*<>*/ } function create(l, v, r){ - /*<>*/ if(l) var h = l[4], hl = h; else var hl = 0; - /*<>*/ if(r) var h$0 = r[4], hr = h$0; else var hr = 0; - var _Z_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; - /*<>*/ return [0, l, v, r, _Z_]; - /*<>*/ } + /*<>*/ if(l) var h = l[4], hl = h; else var hl = 0; + /*<>*/ if(r) var h$0 = r[4], hr = h$0; else var hr = 0; + var _Y_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + /*<>*/ return [0, l, v, r, _Y_]; + /*<>*/ } function bal(l, v, r){ - /*<>*/ if(l) var h = l[4], hl = h; else var hl = 0; - /*<>*/ if(r) + /*<>*/ if(l) var h = l[4], hl = h; else var hl = 0; + /*<>*/ if(r) var h$0 = r[4], hr = h$0; else var hr = 0; if((hr + 2 | 0) < hl){ if(! l) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Set_bal$0); - /*<>*/ var + /*<>*/ var lr = l[3], lv = l[2], ll = l[1], - /*<>*/ _U_ = height(lr); - if(_U_ <= height(ll)) - /*<>*/ return create(ll, lv, create(lr, v, r)); + /*<>*/ _T_ = height(lr); + if(_T_ <= height(ll)) + /*<>*/ return create(ll, lv, create(lr, v, r)); if(! lr) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Set_bal); - /*<>*/ var + /*<>*/ var lrr = lr[3], lrv = lr[2], lrl = lr[1], - /*<>*/ _V_ = create(lrr, v, r); - /*<>*/ return create(create(ll, lv, lrl), lrv, _V_); + /*<>*/ _U_ = create(lrr, v, r); + /*<>*/ return create(create(ll, lv, lrl), lrv, _U_); } if((hl + 2 | 0) >= hr){ - var _Y_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; - /*<>*/ return [0, l, v, r, _Y_]; + var _X_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + /*<>*/ return [0, l, v, r, _X_]; } if(! r) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Set_bal$2); - /*<>*/ var + /*<>*/ var rr = r[3], rv = r[2], rl = r[1], - /*<>*/ _W_ = height(rl); - if(_W_ <= height(rr)) - /*<>*/ return create(create(l, v, rl), rv, rr); + /*<>*/ _V_ = height(rl); + if(_V_ <= height(rr)) + /*<>*/ return create(create(l, v, rl), rv, rr); if(! rl) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Set_bal$1); - /*<>*/ var + /*<>*/ var rlr = rl[3], rlv = rl[2], rll = rl[1], - /*<>*/ _X_ = create(rlr, rv, rr); - /*<>*/ return create(create(l, v, rll), rlv, _X_); - /*<>*/ } + /*<>*/ _W_ = create(rlr, rv, rr); + /*<>*/ return create(create(l, v, rll), rlv, _W_); + /*<>*/ } function add(x, t){ - /*<>*/ if(! t) /*<>*/ return [0, 0, x, 0, 1]; - /*<>*/ var + /*<>*/ if(! t) /*<>*/ return [0, 0, x, 0, 1]; + /*<>*/ var r = t[3], v = t[2], l = t[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) /*<>*/ return t; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) /*<>*/ return t; if(0 <= c){ - /*<>*/ /*<>*/ var rr = add(x, r); + /*<>*/ /*<>*/ var rr = add(x, r); return r === rr ? t : bal(l, v, rr); } - /*<>*/ /*<>*/ var ll = add(x, l); + /*<>*/ /*<>*/ var ll = add(x, l); return l === ll ? t : bal(ll, v, r); } function singleton(x){ - /*<>*/ return [0, 0, x, 0, 1]; - /*<>*/ } + /*<>*/ return [0, 0, x, 0, 1]; + /*<>*/ } function add_min_element(x, param){ - /*<>*/ if(! param) /*<>*/ return singleton(x); + /*<>*/ if(! param) /*<>*/ return singleton(x); var r = param[3], v = param[2], l = param[1]; - /*<>*/ return bal(add_min_element(x, l), v, r); + /*<>*/ return bal(add_min_element(x, l), v, r); } function add_max_element(x, param){ - /*<>*/ if(! param) /*<>*/ return singleton(x); + /*<>*/ if(! param) /*<>*/ return singleton(x); var r = param[3], v = param[2], l = param[1]; - /*<>*/ return bal(l, v, add_max_element(x, r)); + /*<>*/ return bal(l, v, add_max_element(x, r)); } function join(l, v, r){ - /*<>*/ if(! l) - /*<>*/ return add_min_element(v, r); - if(! r) /*<>*/ return add_max_element(v, l); + /*<>*/ if(! l) + /*<>*/ return add_min_element(v, r); + if(! r) /*<>*/ return add_max_element(v, l); var rh = r[4], rr = r[3], @@ -9822,138 +10418,143 @@ < rh ? bal(join(l, v, rl), rv, rr) : create(l, v, r); - /*<>*/ } + /*<>*/ } function min_elt(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var l = param$0[1]; - if(l){var param$0 = l; continue;} - var v = param$0[2]; - /*<>*/ return v; + if(! l){var v = param$0[2]; /*<>*/ return v;} + param$0 = l; } - /*<>*/ } + /*<>*/ } function min_elt_opt(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ - if(! param$0) /*<>*/ return 0; + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ + if(! param$0) /*<>*/ return 0; var l = param$0[1]; - if(l){var param$0 = l; continue;} - var v = param$0[2]; - /*<>*/ return [0, v]; + if(! l){var v = param$0[2]; /*<>*/ return [0, v];} + param$0 = l; } - /*<>*/ } + /*<>*/ } function max_elt(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); - if(param$0[3]){var r = param$0[3], param$0 = r; continue;} - var v = param$0[2]; - /*<>*/ return v; + if(! param$0[3]){ + var v = param$0[2]; + /*<>*/ return v; + } + var r = param$0[3]; + param$0 = r; } - /*<>*/ } + /*<>*/ } function max_elt_opt(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ - if(! param$0) /*<>*/ return 0; - if(param$0[3]){var r = param$0[3], param$0 = r; continue;} - var v = param$0[2]; - /*<>*/ return [0, v]; + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ + if(! param$0) /*<>*/ return 0; + if(! param$0[3]){ + var v = param$0[2]; + /*<>*/ return [0, v]; + } + var r = param$0[3]; + param$0 = r; } - /*<>*/ } + /*<>*/ } function remove_min_elt(param){ - /*<>*/ if(! param) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(! param) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Set_remove_min_elt); var l = param[1]; if(l){ var r = param[3], v = param[2]; - /*<>*/ return bal(remove_min_elt(l), v, r); + /*<>*/ return bal(remove_min_elt(l), v, r); } var r$0 = param[3]; - /*<>*/ return r$0; - /*<>*/ } + /*<>*/ return r$0; + /*<>*/ } function concat(t1, t2){ - /*<>*/ if(! t1) /*<>*/ return t2; - if(! t2) /*<>*/ return t1; - /*<>*/ /*<>*/ var - _T_ = remove_min_elt(t2); - /*<>*/ return join(t1, min_elt(t2), _T_); - /*<>*/ } + /*<>*/ if(! t1) /*<>*/ return t2; + if(! t2) /*<>*/ return t1; + /*<>*/ /*<>*/ var + _S_ = remove_min_elt(t2); + /*<>*/ return join(t1, min_elt(t2), _S_); + /*<>*/ } function split(x, param){ - /*<>*/ if(! param) /*<>*/ return _a_; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return _a_; + /*<>*/ var r = param[3], v = param[2], l = param[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) - /*<>*/ return [0, l, 1, r]; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) + /*<>*/ return [0, l, 1, r]; if(0 <= c){ - /*<>*/ var - /*<>*/ match = split(x, r), + /*<>*/ var + /*<>*/ match = split(x, r), rr = match[3], pres = match[2], lr = match[1]; - /*<>*/ return [0, join(l, v, lr), pres, rr]; + /*<>*/ return [0, join(l, v, lr), pres, rr]; } - /*<>*/ var - /*<>*/ match$0 = split(x, l), + /*<>*/ var + /*<>*/ match$0 = split(x, l), rl = match$0[3], pres$0 = match$0[2], ll = match$0[1]; - /*<>*/ return [0, ll, pres$0, join(rl, v, r)]; + /*<>*/ return [0, ll, pres$0, join(rl, v, r)]; } var empty = 0; function is_empty(param){ - /*<>*/ return param ? 0 : 1; - /*<>*/ } + /*<>*/ return param ? 0 : 1; + /*<>*/ } function mem(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var r = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v), - _S_ = 0 === c ? 1 : 0; - if(_S_) return _S_; - var r$0 = 0 <= c ? r : l, param$0 = r$0; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v), + _R_ = 0 === c ? 1 : 0; + if(_R_) return _R_; + var r$0 = 0 <= c ? r : l; + param$0 = r$0; } } function remove(x, t){ - /*<>*/ if(! t) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! t) /*<>*/ return 0; + /*<>*/ var t2 = t[3], v = t[2], t1 = t[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c){ - if(! t1) /*<>*/ return t2; - if(! t2) /*<>*/ return t1; - /*<>*/ /*<>*/ var - _R_ = remove_min_elt(t2); - /*<>*/ return bal(t1, min_elt(t2), _R_); + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c){ + if(! t1) /*<>*/ return t2; + if(! t2) /*<>*/ return t1; + /*<>*/ /*<>*/ var + _Q_ = remove_min_elt(t2); + /*<>*/ return bal(t1, min_elt(t2), _Q_); } if(0 <= c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var rr = remove(x, t2); return t2 === rr ? t : bal(t1, v, rr); } - /*<>*/ /*<>*/ var ll = remove(x, t1); + /*<>*/ /*<>*/ var ll = remove(x, t1); return t1 === ll ? t : bal(ll, v, t2); } function union(s1, s2){ - /*<>*/ if(! s1) /*<>*/ return s2; - if(! s2) /*<>*/ return s1; + /*<>*/ if(! s1) /*<>*/ return s2; + if(! s2) /*<>*/ return s1; var h2 = s2[4], r2 = s2[3], @@ -9964,502 +10565,519 @@ v1 = s1[2], l1 = s1[1]; if(h2 <= h1){ - if(1 === h2) /*<>*/ return add(v2, s1); - /*<>*/ var - /*<>*/ match = split(v1, s2), + if(1 === h2) /*<>*/ return add(v2, s1); + /*<>*/ var + /*<>*/ match = split(v1, s2), r2$0 = match[3], l2$0 = match[1], - /*<>*/ _P_ = union(r1, r2$0); - /*<>*/ return join(union(l1, l2$0), v1, _P_); + /*<>*/ _O_ = union(r1, r2$0); + /*<>*/ return join(union(l1, l2$0), v1, _O_); } - if(1 === h1) /*<>*/ return add(v1, s2); - /*<>*/ var - /*<>*/ match$0 = split(v2, s1), + if(1 === h1) /*<>*/ return add(v1, s2); + /*<>*/ var + /*<>*/ match$0 = split(v2, s1), r1$0 = match$0[3], l1$0 = match$0[1], - /*<>*/ _Q_ = union(r1$0, r2); - /*<>*/ return join(union(l1$0, l2), v2, _Q_); - /*<>*/ } + /*<>*/ _P_ = union(r1$0, r2); + /*<>*/ return join(union(l1$0, l2), v2, _P_); + /*<>*/ } function inter(s1, s2){ - /*<>*/ if(! s1) /*<>*/ return 0; - if(! s2) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! s1) /*<>*/ return 0; + if(! s2) /*<>*/ return 0; + /*<>*/ var r1 = s1[3], v1 = s1[2], l1 = s1[1], - /*<>*/ _M_ = split(v1, s2), - l2 = _M_[1]; - if(_M_[2]){ - /*<>*/ var - r2 = _M_[3], - /*<>*/ _N_ = inter(r1, r2); - /*<>*/ return join(inter(l1, l2), v1, _N_); + /*<>*/ _L_ = split(v1, s2), + l2 = _L_[1]; + if(_L_[2]){ + /*<>*/ var + r2 = _L_[3], + /*<>*/ _M_ = inter(r1, r2); + /*<>*/ return join(inter(l1, l2), v1, _M_); } - /*<>*/ var - r2$0 = _M_[3], - /*<>*/ _O_ = inter(r1, r2$0); - /*<>*/ return concat(inter(l1, l2), _O_); - /*<>*/ } + /*<>*/ var + r2$0 = _L_[3], + /*<>*/ _N_ = inter(r1, r2$0); + /*<>*/ return concat(inter(l1, l2), _N_); + /*<>*/ } function split_bis(x, param){ /*<>*/ if(! param) - /*<>*/ return [0, + /*<>*/ return [0, 0, function(param){ - /*<>*/ return 0; - /*<>*/ }]; - /*<>*/ var + /*<>*/ return 0; + /*<>*/ }]; + /*<>*/ var r = param[3], v = param[2], l = param[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) /*<>*/ return 0; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) /*<>*/ return 0; if(0 <= c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = split_bis(x, r); - if(! match) /*<>*/ return 0; + if(! match) /*<>*/ return 0; var rr = match[2], lr = match[1]; - /*<>*/ return [0, join(l, v, lr), rr]; + /*<>*/ return [0, join(l, v, lr), rr]; } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match$0 = split_bis(x, l); - if(! match$0) /*<>*/ return 0; + if(! match$0) /*<>*/ return 0; var rl = match$0[2], ll = match$0[1]; - /*<>*/ return [0, + /*<>*/ return [0, ll, function(param){ - /*<>*/ return join(rl(0), v, r); - /*<>*/ }]; + /*<>*/ return join(rl(0), v, r); + /*<>*/ }]; } function disjoint(s1, s2){ - /*<>*/ var s1$0 = s1, s2$0 = s2; - /*<>*/ for(;;){ + /*<>*/ var s1$0 = s1, s2$0 = s2; + /*<>*/ for(;;){ if(s1$0 && s2$0){ var r1 = s1$0[3], v1 = s1$0[2], l1 = s1$0[1]; - if(s1$0 === s2$0) /*<>*/ return 0; - /*<>*/ /*<>*/ var + if(s1$0 === s2$0) /*<>*/ return 0; + /*<>*/ /*<>*/ var match = split_bis(v1, s2$0); - if(! match) /*<>*/ return 0; - /*<>*/ var + if(! match) /*<>*/ return 0; + /*<>*/ var r2 = match[2], l2 = match[1], - /*<>*/ _L_ = disjoint(l1, l2); - /*<>*/ if(! _L_) /*<>*/ return _L_; - /*<>*/ var - /*<>*/ s2$1 = r2(0), - s1$0 = r1, - s2$0 = s2$1; + /*<>*/ _K_ = disjoint(l1, l2); + /*<>*/ if(! _K_) /*<>*/ return _K_; + /*<>*/ /*<>*/ var s2$1 = r2(0); + s1$0 = r1; + s2$0 = s2$1; continue; } - /*<>*/ return 1; + /*<>*/ return 1; } - /*<>*/ } + /*<>*/ } function diff(s1, s2){ - /*<>*/ if(! s1) /*<>*/ return 0; - if(! s2) /*<>*/ return s1; - /*<>*/ var + /*<>*/ if(! s1) /*<>*/ return 0; + if(! s2) /*<>*/ return s1; + /*<>*/ var r1 = s1[3], v1 = s1[2], l1 = s1[1], - /*<>*/ _I_ = split(v1, s2), - l2 = _I_[1]; - if(_I_[2]){ - /*<>*/ var - r2 = _I_[3], - /*<>*/ _J_ = diff(r1, r2); - /*<>*/ return concat(diff(l1, l2), _J_); + /*<>*/ _H_ = split(v1, s2), + l2 = _H_[1]; + if(_H_[2]){ + /*<>*/ var + r2 = _H_[3], + /*<>*/ _I_ = diff(r1, r2); + /*<>*/ return concat(diff(l1, l2), _I_); } - /*<>*/ var - r2$0 = _I_[3], - /*<>*/ _K_ = diff(r1, r2$0); - /*<>*/ return join(diff(l1, l2), v1, _K_); - /*<>*/ } + /*<>*/ var + r2$0 = _H_[3], + /*<>*/ _J_ = diff(r1, r2$0); + /*<>*/ return join(diff(l1, l2), v1, _J_); + /*<>*/ } function cons_enum(s, e){ - /*<>*/ var s$0 = s, e$0 = e; - /*<>*/ for(;;){ - if(! s$0) /*<>*/ return e$0; - /*<>*/ var + /*<>*/ var s$0 = s, e$0 = e; + /*<>*/ for(;;){ + if(! s$0) /*<>*/ return e$0; + /*<>*/ var r = s$0[3], v = s$0[2], l = s$0[1], - /*<>*/ e$1 = [0, v, r, e$0], - s$0 = l, - e$0 = e$1; + /*<>*/ e$1 = [0, v, r, e$0]; + s$0 = l; + e$0 = e$1; } - /*<>*/ } + /*<>*/ } function compare(s1, s2){ - /*<>*/ var - /*<>*/ e2$2 = cons_enum(s2, 0), - /*<>*/ e1$2 = cons_enum(s1, 0), + /*<>*/ var + /*<>*/ e2$2 = cons_enum(s2, 0), + /*<>*/ e1$2 = cons_enum(s1, 0), e1 = e1$2, e2 = e2$2; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(! e1) return e2 ? -1 : 0; - if(! e2) /*<>*/ return 1; - /*<>*/ var + if(! e2) /*<>*/ return 1; + /*<>*/ var e2$0 = e2[3], r2 = e2[2], v2 = e2[1], e1$0 = e1[3], r1 = e1[2], v1 = e1[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], v1, v2); - /*<>*/ if(0 !== c) /*<>*/ return c; - /*<>*/ var - /*<>*/ e2$1 = cons_enum(r2, e2$0), - /*<>*/ e1$1 = cons_enum(r1, e1$0), - e1 = e1$1, - e2 = e2$1; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], v1, v2); + /*<>*/ if(0 !== c) /*<>*/ return c; + /*<>*/ var + /*<>*/ e2$1 = cons_enum(r2, e2$0), + /*<>*/ e1$1 = cons_enum(r1, e1$0); + e1 = e1$1; + e2 = e2$1; } - /*<>*/ } + /*<>*/ } function equal(s1, s2){ - /*<>*/ return 0 === compare(s1, s2) ? 1 : 0; - /*<>*/ } + /*<>*/ return 0 === compare(s1, s2) ? 1 : 0; + /*<>*/ } function subset(s1, s2){ - /*<>*/ var s1$0 = s1, s2$0 = s2; - /*<>*/ for(;;){ - if(! s1$0) /*<>*/ return 1; - if(! s2$0) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var s1$0 = s1, s2$0 = s2; + /*<>*/ for(;;){ + if(! s1$0) /*<>*/ return 1; + if(! s2$0) /*<>*/ return 0; + /*<>*/ var r2 = s2$0[3], v2 = s2$0[2], l2 = s2$0[1], r1 = s1$0[3], v1 = s1$0[2], l1 = s1$0[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], v1, v2); - /*<>*/ if(0 === c){ - /*<>*/ /*<>*/ var - _F_ = subset(l1, l2); - /*<>*/ if(! _F_) /*<>*/ return _F_; - var s1$0 = r1, s2$0 = r2; - continue; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], v1, v2); + /*<>*/ if(0 === c){ + /*<>*/ /*<>*/ var + _E_ = subset(l1, l2); + /*<>*/ if(! _E_) /*<>*/ return _E_; + s1$0 = r1; + s2$0 = r2; } - if(0 <= c){ - /*<>*/ /*<>*/ var - _G_ = subset([0, 0, v1, r1, 0], r2); - /*<>*/ if(! _G_) /*<>*/ return _G_; - var s1$0 = l1; - continue; + else if(0 <= c){ + /*<>*/ /*<>*/ var + _F_ = subset([0, 0, v1, r1, 0], r2); + /*<>*/ if(! _F_) /*<>*/ return _F_; + s1$0 = l1; + } + else{ + /*<>*/ /*<>*/ var + _G_ = subset([0, l1, v1, 0, 0], l2); + /*<>*/ if(! _G_) /*<>*/ return _G_; + s1$0 = r1; } - /*<>*/ /*<>*/ var - _H_ = subset([0, l1, v1, 0, 0], l2); - /*<>*/ if(! _H_) /*<>*/ return _H_; - var s1$0 = r1; } - /*<>*/ } + /*<>*/ } function iter(f, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var r = param$0[3], v = param$0[2], l = param$0[1]; - /*<>*/ iter(f, l); - /*<>*/ /*<>*/ caml_call1(f, v); - var param$0 = r; + /*<>*/ iter(f, l); + /*<>*/ /*<>*/ caml_call1(f, v); + param$0 = r; } } function fold(f, s, accu){ - /*<>*/ var s$0 = s, accu$0 = accu; - /*<>*/ for(;;){ - if(! s$0) /*<>*/ return accu$0; - /*<>*/ var + /*<>*/ var s$0 = s, accu$0 = accu; + /*<>*/ for(;;){ + if(! s$0) /*<>*/ return accu$0; + /*<>*/ var r = s$0[3], v = s$0[2], l = s$0[1], - /*<>*/ accu$1 = - /*<>*/ caml_call2(f, v, fold(f, l, accu$0)), - s$0 = r, - accu$0 = accu$1; + /*<>*/ accu$1 = + /*<>*/ caml_call2(f, v, fold(f, l, accu$0)); + s$0 = r; + accu$0 = accu$1; } - /*<>*/ } + /*<>*/ } function for_all(p, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 1; - /*<>*/ var + if(! param$0) /*<>*/ return 1; + /*<>*/ var r = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ _C_ = - /*<>*/ caml_call1(p, v); - /*<>*/ if(_C_){ - /*<>*/ /*<>*/ var - _D_ = for_all(p, l); - /*<>*/ if(_D_){var param$0 = r; continue;} - var _E_ = _D_; + /*<>*/ _B_ = + /*<>*/ caml_call1(p, v); + /*<>*/ if(_B_){ + /*<>*/ /*<>*/ var + _C_ = for_all(p, l); + /*<>*/ if(_C_){param$0 = r; continue;} + var _D_ = _C_; } else - var _E_ = _C_; - /*<>*/ return _E_; + var _D_ = _B_; + /*<>*/ return _D_; } } function exists(p, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var r = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ _z_ = - /*<>*/ caml_call1(p, v); - /*<>*/ if(_z_) - var _A_ = _z_; + /*<>*/ _y_ = + /*<>*/ caml_call1(p, v); + /*<>*/ if(_y_) + var _z_ = _y_; else{ - /*<>*/ /*<>*/ var - _B_ = exists(p, l); - /*<>*/ if(! _B_){var param$0 = r; continue;} - var _A_ = _B_; + /*<>*/ /*<>*/ var + _A_ = exists(p, l); + /*<>*/ if(! _A_){param$0 = r; continue;} + var _z_ = _A_; } - /*<>*/ return _A_; + /*<>*/ return _z_; } } function filter(p, t){ - /*<>*/ if(! t) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! t) /*<>*/ return 0; + /*<>*/ var r = t[3], v = t[2], l = t[1], - /*<>*/ l$0 = filter(p, l), - /*<>*/ pv = /*<>*/ caml_call1(p, v), - /*<>*/ r$0 = filter(p, r); - /*<>*/ if(! pv) - /*<>*/ return concat(l$0, r$0); - if(l === l$0 && r === r$0) /*<>*/ return t; - /*<>*/ return join(l$0, v, r$0); + /*<>*/ l$0 = filter(p, l), + /*<>*/ pv = /*<>*/ caml_call1(p, v), + /*<>*/ r$0 = filter(p, r); + /*<>*/ if(! pv) + /*<>*/ return concat(l$0, r$0); + if(l === l$0 && r === r$0) /*<>*/ return t; + /*<>*/ return join(l$0, v, r$0); } function partition(p, param){ - /*<>*/ if(! param) /*<>*/ return _b_; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return _b_; + /*<>*/ var r = param[3], v = param[2], l = param[1], - /*<>*/ match = partition(p, l), + /*<>*/ match = partition(p, l), lf = match[2], lt = match[1], - /*<>*/ pv = /*<>*/ caml_call1(p, v), - /*<>*/ match$0 = partition(p, r), + /*<>*/ pv = /*<>*/ caml_call1(p, v), + /*<>*/ match$0 = partition(p, r), rf = match$0[2], rt = match$0[1]; - /*<>*/ if(pv){ - /*<>*/ /*<>*/ var - _x_ = concat(lf, rf); - /*<>*/ return [0, join(lt, v, rt), _x_]; + /*<>*/ if(pv){ + /*<>*/ /*<>*/ var + _w_ = concat(lf, rf); + /*<>*/ return [0, join(lt, v, rt), _w_]; } - /*<>*/ /*<>*/ var - _y_ = join(lf, v, rf); - /*<>*/ return [0, concat(lt, rt), _y_]; + /*<>*/ /*<>*/ var + _x_ = join(lf, v, rf); + /*<>*/ return [0, concat(lt, rt), _x_]; } function cardinal(param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ var r = param[3], l = param[1], - /*<>*/ _w_ = cardinal(r); - return (cardinal(l) + 1 | 0) + _w_ | 0; - /*<>*/ } + /*<>*/ _v_ = cardinal(r); + return (cardinal(l) + 1 | 0) + _v_ | 0; + /*<>*/ } function elements_aux(accu, param){ var accu$0 = accu, param$0 = param; for(;;){ - if(! param$0) /*<>*/ return accu$0; - /*<>*/ var + if(! param$0) /*<>*/ return accu$0; + /*<>*/ var r = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ accu$1 = [0, v, elements_aux(accu$0, r)], - accu$0 = accu$1, - param$0 = l; + /*<>*/ accu$1 = [0, v, elements_aux(accu$0, r)]; + accu$0 = accu$1; + param$0 = l; } } function elements(s){ - /*<>*/ return elements_aux(0, s); - /*<>*/ } + /*<>*/ return elements_aux(0, s); + /*<>*/ } function find(x, param){ var param$0 = param; for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); - /*<>*/ var + /*<>*/ var r = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) /*<>*/ return v; - var r$0 = 0 <= c ? r : l, param$0 = r$0; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) /*<>*/ return v; + var r$0 = 0 <= c ? r : l; + param$0 = r$0; } } function find_first(f, param$0){ var param$1 = param$0; for(;;){ if(! param$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var r$0 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = r$0; continue;} - var v0 = v0$1, param = l$0; - for(;;){ - if(! param) /*<>*/ return v0; - var r = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){var v0 = v0$0, param = l; continue;} - var param = r; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, param = l$0; + for(;;){ + if(! param) /*<>*/ return v0; + var r = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; param = l;} + else + param = r; + } } + else + param$1 = r$0; } } function find_first_opt(f, param$0){ var param$1 = param$0; for(;;){ - if(! param$1) /*<>*/ return 0; + if(! param$1) /*<>*/ return 0; var r$0 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = r$0; continue;} - var v0 = v0$1, param = l$0; - for(;;){ - if(! param) /*<>*/ return [0, v0]; - var r = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){var v0 = v0$0, param = l; continue;} - var param = r; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, param = l$0; + for(;;){ + if(! param) /*<>*/ return [0, v0]; + var r = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; param = l;} + else + param = r; + } } + else + param$1 = r$0; } } function find_last(f, param$0){ var param$1 = param$0; for(;;){ if(! param$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var r$0 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = l$0; continue;} - var v0 = v0$1, param = r$0; - for(;;){ - if(! param) /*<>*/ return v0; - var r = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){var v0 = v0$0, param = r; continue;} - var param = l; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, param = r$0; + for(;;){ + if(! param) /*<>*/ return v0; + var r = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; param = r;} + else + param = l; + } } + else + param$1 = l$0; } } function find_last_opt(f, param$0){ var param$1 = param$0; for(;;){ - if(! param$1) /*<>*/ return 0; + if(! param$1) /*<>*/ return 0; var r$0 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = l$0; continue;} - var v0 = v0$1, param = r$0; - for(;;){ - if(! param) /*<>*/ return [0, v0]; - var r = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){var v0 = v0$0, param = r; continue;} - var param = l; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, param = r$0; + for(;;){ + if(! param) /*<>*/ return [0, v0]; + var r = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; param = r;} + else + param = l; + } } + else + param$1 = l$0; } } function find_opt(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var r = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) - /*<>*/ return [0, v]; - var r$0 = 0 <= c ? r : l, param$0 = r$0; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) + /*<>*/ return [0, v]; + var r$0 = 0 <= c ? r : l; + param$0 = r$0; } } function try_join(l, v, r){ - /*<>*/ var switch$0 = 0; - if(0 !== l){ - /*<>*/ /*<>*/ var _v_ = max_elt(l); - /*<>*/ if - (0 <= /*<>*/ caml_call2(Ord[1], _v_, v)) - switch$0 = 1; - } - if(! switch$0){ - var switch$1 = 0; - if(0 !== r){ - /*<>*/ /*<>*/ var _u_ = min_elt(r); + /*<>*/ a: + { + if(0 !== l){ + /*<>*/ /*<>*/ var _u_ = max_elt(l); /*<>*/ if - (0 <= /*<>*/ caml_call2(Ord[1], v, _u_)) - switch$1 = 1; + (0 <= /*<>*/ caml_call2(Ord[1], _u_, v)) + break a; } - if(! switch$1) /*<>*/ return join(l, v, r); + if(0 !== r){ + /*<>*/ /*<>*/ var _t_ = min_elt(r); + /*<>*/ if + (0 <= /*<>*/ caml_call2(Ord[1], v, _t_)) + break a; + } + /*<>*/ return join(l, v, r); } - /*<>*/ return union(l, add(v, r)); - /*<>*/ } + /*<>*/ return union(l, add(v, r)); + /*<>*/ } function map(f, t){ - /*<>*/ if(! t) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! t) /*<>*/ return 0; + /*<>*/ var r = t[3], v = t[2], l = t[1], - /*<>*/ l$0 = map(f, l), - /*<>*/ v$0 = /*<>*/ caml_call1(f, v), - /*<>*/ r$0 = map(f, r); + /*<>*/ l$0 = map(f, l), + /*<>*/ v$0 = /*<>*/ caml_call1(f, v), + /*<>*/ r$0 = map(f, r); if(l === l$0 && v === v$0 && r === r$0) - /*<>*/ return t; - /*<>*/ return try_join(l$0, v$0, r$0); + /*<>*/ return t; + /*<>*/ return try_join(l$0, v$0, r$0); } function filter_map(f, t){ - /*<>*/ if(! t) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! t) /*<>*/ return 0; + /*<>*/ var r = t[3], v = t[2], l = t[1], - /*<>*/ t1 = filter_map(f, l), - /*<>*/ v$0 = /*<>*/ caml_call1(f, v), - /*<>*/ t2 = filter_map(f, r); - /*<>*/ if(v$0){ + /*<>*/ t1 = filter_map(f, l), + /*<>*/ v$0 = /*<>*/ caml_call1(f, v), + /*<>*/ t2 = filter_map(f, r); + /*<>*/ if(v$0){ var v$1 = v$0[1]; if(l === t1 && v === v$1 && r === t2) - /*<>*/ return t; - /*<>*/ return try_join(t1, v$1, t2); + /*<>*/ return t; + /*<>*/ return try_join(t1, v$1, t2); } - if(! t1) /*<>*/ return t2; - if(! t2) /*<>*/ return t1; - /*<>*/ /*<>*/ var - _t_ = remove_min_elt(t2); - /*<>*/ return try_join(t1, min_elt(t2), _t_); + if(! t1) /*<>*/ return t2; + if(! t2) /*<>*/ return t1; + /*<>*/ /*<>*/ var + _s_ = remove_min_elt(t2); + /*<>*/ return try_join(t1, min_elt(t2), _s_); } function of_list(l){ - /*<>*/ if(! l) return empty; - var _o_ = l[2], x0 = l[1]; - if(! _o_) /*<>*/ return singleton(x0); - var _p_ = _o_[2], x1 = _o_[1]; - if(! _p_) /*<>*/ return add(x1, singleton(x0)); - var _q_ = _p_[2], x2 = _p_[1]; + /*<>*/ if(! l) return empty; + var _n_ = l[2], x0 = l[1]; + if(! _n_) /*<>*/ return singleton(x0); + var _o_ = _n_[2], x1 = _n_[1]; + if(! _o_) /*<>*/ return add(x1, singleton(x0)); + var _p_ = _o_[2], x2 = _o_[1]; + if(! _p_) + /*<>*/ return add(x2, add(x1, singleton(x0))); + var _q_ = _p_[2], x3 = _p_[1]; if(! _q_) - /*<>*/ return add(x2, add(x1, singleton(x0))); - var _r_ = _q_[2], x3 = _q_[1]; - if(! _r_) - /*<>*/ return add + /*<>*/ return add (x3, add(x2, add(x1, singleton(x0)))); - if(_r_[2]){ - /*<>*/ var - /*<>*/ l$0 = - /*<>*/ caml_call2(Stdlib_List[59], Ord[1], l), + if(_q_[2]){ + /*<>*/ var + /*<>*/ l$0 = + /*<>*/ caml_call2(Stdlib_List[62], Ord[1], l), sub = function(n, l){ - /*<>*/ if(3 >= n >>> 0) + /*<>*/ if(3 >= n >>> 0) switch(n){ case 0: - /*<>*/ return [0, 0, l]; + /*<>*/ return [0, 0, l]; case 1: if(l){ var l$3 = l[2], x0 = l[1]; - /*<>*/ return [0, [0, 0, x0, 0, 1], l$3]; + /*<>*/ return [0, [0, 0, x0, 0, 1], l$3]; } break; case 2: @@ -10467,7 +11085,7 @@ var match$1 = l[2]; if(match$1){ var l$4 = match$1[2], x1 = match$1[1], x0$0 = l[1]; - /*<>*/ return [0, + /*<>*/ return [0, [0, [0, 0, x0$0, 0, 1], x1, 0, 2], l$4]; } @@ -10475,137 +11093,140 @@ break; default: if(l){ - var _s_ = l[2]; - if(_s_){ - var match$2 = _s_[2]; + var _r_ = l[2]; + if(_r_){ + var match$2 = _r_[2]; if(match$2){ var l$5 = match$2[2], x2 = match$2[1], - x1$0 = _s_[1], + x1$0 = _r_[1], x0$1 = l[1]; - /*<>*/ return [0, + /*<>*/ return [0, [0, [0, 0, x0$1, 0, 1], x1$0, [0, 0, x2, 0, 1], 2], l$5]; } } } } - /*<>*/ var + /*<>*/ var nl = n / 2 | 0, - /*<>*/ match = sub(nl, l), + /*<>*/ match = sub(nl, l), l$0 = match[2], left = match[1]; - /*<>*/ if(! l$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if(! l$0) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _c_], 1); - /*<>*/ var + /*<>*/ var l$1 = l$0[2], mid = l$0[1], - /*<>*/ match$0 = sub((n - nl | 0) - 1 | 0, l$1), + /*<>*/ match$0 = sub((n - nl | 0) - 1 | 0, l$1), l$2 = match$0[2], right = match$0[1]; - /*<>*/ return [0, create(left, mid, right), l$2]; - /*<>*/ }; - /*<>*/ return sub - ( /*<>*/ caml_call1(Stdlib_List[1], l$0), + /*<>*/ return [0, create(left, mid, right), l$2]; + /*<>*/ }; + /*<>*/ return sub + ( /*<>*/ caml_call1(Stdlib_List[1], l$0), l$0) [1]; } - var x4 = _r_[1]; - /*<>*/ return add + var x4 = _q_[1]; + /*<>*/ return add (x4, add(x3, add(x2, add(x1, singleton(x0))))); - /*<>*/ } + /*<>*/ } function add_seq(i, m){ - function _n_(s, x){ - /*<>*/ return add(x, s); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Seq[5], _n_, m, i); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_Seq[5], + function(s, x){ + /*<>*/ return add(x, s); + /*<>*/ }, + m, + i); + /*<>*/ } function of_seq(i){ - /*<>*/ return add_seq(i, empty); - /*<>*/ } + /*<>*/ return add_seq(i, empty); + /*<>*/ } function seq_of_enum(c, param){ - /*<>*/ if(! c) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! c) /*<>*/ return 0; + var rest = c[3], t = c[2], x = c[1], - /*<>*/ _l_ = cons_enum(t, rest); - /*<>*/ return [0, + /*<>*/ _l_ = cons_enum(t, rest); + /*<>*/ return [0, x, function(_m_){ /*<>*/ return seq_of_enum(_l_, _m_);}]; - /*<>*/ } + /*<>*/ } function to_seq(c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _j_ = cons_enum(c, 0); - /*<>*/ return function(_k_){ + /*<>*/ return function(_k_){ /*<>*/ return seq_of_enum(_j_, _k_);}; - /*<>*/ } + /*<>*/ } function snoc_enum(s, e){ - /*<>*/ var s$0 = s, e$0 = e; - /*<>*/ for(;;){ - if(! s$0) /*<>*/ return e$0; - /*<>*/ var + /*<>*/ var s$0 = s, e$0 = e; + /*<>*/ for(;;){ + if(! s$0) /*<>*/ return e$0; + /*<>*/ var r = s$0[3], v = s$0[2], l = s$0[1], - /*<>*/ e$1 = [0, v, l, e$0], - s$0 = r, - e$0 = e$1; + /*<>*/ e$1 = [0, v, l, e$0]; + s$0 = r; + e$0 = e$1; } - /*<>*/ } + /*<>*/ } function rev_seq_of_enum(c, param){ - /*<>*/ if(! c) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! c) /*<>*/ return 0; + var rest = c[3], t = c[2], x = c[1], - /*<>*/ _h_ = snoc_enum(t, rest); - /*<>*/ return [0, + /*<>*/ _h_ = snoc_enum(t, rest); + /*<>*/ return [0, x, function(_i_){ /*<>*/ return rev_seq_of_enum(_h_, _i_);}]; - /*<>*/ } + /*<>*/ } function to_rev_seq(c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _f_ = snoc_enum(c, 0); - /*<>*/ return function(_g_){ + /*<>*/ return function(_g_){ /*<>*/ return rev_seq_of_enum(_f_, _g_);}; - /*<>*/ } + /*<>*/ } function to_seq_from(low, s){ - /*<>*/ var s$0 = s, c = 0; - /*<>*/ for(;;){ - if(s$0){ - /*<>*/ var - r = s$0[3], - v = s$0[2], - l = s$0[1], - /*<>*/ n = - /*<>*/ caml_call2(Ord[1], v, low); - if(0 !== n){ + /*<>*/ a: + { + b: + { + var s$0 = s, c = 0; + /*<>*/ for(;;){ + if(! s$0) break; + /*<>*/ var + r = s$0[3], + v = s$0[2], + l = s$0[1], + /*<>*/ n = + /*<>*/ caml_call2(Ord[1], v, low); + if(0 === n) break b; if(0 <= n){ - /*<>*/ var - /*<>*/ c$0 = [0, v, r, c], - s$0 = l, - c = c$0; - continue; + /*<>*/ /*<>*/ var + c$0 = [0, v, r, c]; + s$0 = l; + c = c$0; } - var s$0 = r; - continue; + else + s$0 = r; } - var _d_ = [0, v, r, c]; - } - else var _d_ = c; - /*<>*/ return function(_e_){ - /*<>*/ return seq_of_enum(_d_, _e_);}; + break a; + } + var _d_ = [0, v, r, c]; } - /*<>*/ } + /*<>*/ return function(_e_){ + /*<>*/ return seq_of_enum(_d_, _e_);}; + /*<>*/ } return [0, empty, - is_empty, - mem, add, singleton, remove, @@ -10613,17 +11234,6 @@ inter, disjoint, diff, - compare, - equal, - subset, - iter, - map, - fold, - for_all, - exists, - filter, - filter_map, - partition, cardinal, elements, min_elt, @@ -10632,13 +11242,27 @@ max_elt_opt, min_elt, min_elt_opt, - split, find, find_opt, find_first, find_first_opt, find_last, find_last_opt, + iter, + fold, + map, + filter, + filter_map, + partition, + split, + is_empty, + mem, + equal, + compare, + subset, + for_all, + exists, + elements, of_list, to_seq_from, to_seq, @@ -10652,7 +11276,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Map -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Seq +//# unitInfo: Requires: Stdlib, Stdlib__List, Stdlib__Seq (function (globalThis){ "use strict"; @@ -10680,111 +11304,112 @@ Stdlib = global_data.Stdlib, Assert_failure = global_data.Assert_failure, Stdlib_Seq = global_data.Stdlib__Seq, - cst_Map_remove_min_elt = "Map.remove_min_elt", - _a_ = [0, 0, 0, 0], - _b_ = [0, "map.ml", 400, 10], - _c_ = [0, 0, 0], + Stdlib_List = global_data.Stdlib__List, cst_Map_bal = cst_Map_bal$3, cst_Map_bal$0 = cst_Map_bal$3, cst_Map_bal$1 = cst_Map_bal$3, cst_Map_bal$2 = cst_Map_bal$3, + cst_Map_remove_min_elt = "Map.remove_min_elt", + _a_ = [0, 0, 0, 0], + _b_ = [0, "map.ml", 408, 10], + _c_ = [0, 0, 0], Stdlib_Map = [0, function(Ord){ function height(param){ - /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ if(! param) /*<>*/ return 0; var h = param[5]; - /*<>*/ return h; - /*<>*/ } + /*<>*/ return h; + /*<>*/ } function create(l, x, d, r){ - /*<>*/ var - /*<>*/ hl = height(l), - /*<>*/ hr = height(r), - _L_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; - /*<>*/ return [0, l, x, d, r, _L_]; - /*<>*/ } + /*<>*/ var + /*<>*/ hl = height(l), + /*<>*/ hr = height(r), + _K_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + /*<>*/ return [0, l, x, d, r, _K_]; + /*<>*/ } function singleton(x, d){ - /*<>*/ return [0, 0, x, d, 0, 1]; - /*<>*/ } + /*<>*/ return [0, 0, x, d, 0, 1]; + /*<>*/ } function bal(l, x, d, r){ - /*<>*/ if(l) var h = l[5], hl = h; else var hl = 0; - /*<>*/ if(r) var h$0 = r[5], hr = h$0; else var hr = 0; + /*<>*/ if(l) var h = l[5], hl = h; else var hl = 0; + /*<>*/ if(r) var h$0 = r[5], hr = h$0; else var hr = 0; if((hr + 2 | 0) < hl){ if(! l) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Map_bal$0); - /*<>*/ var + /*<>*/ var lr = l[4], ld = l[3], lv = l[2], ll = l[1], - /*<>*/ _G_ = height(lr); - if(_G_ <= height(ll)) - /*<>*/ return create + /*<>*/ _F_ = height(lr); + if(_F_ <= height(ll)) + /*<>*/ return create (ll, lv, ld, create(lr, x, d, r)); if(! lr) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Map_bal); - /*<>*/ var + /*<>*/ var lrr = lr[4], lrd = lr[3], lrv = lr[2], lrl = lr[1], - /*<>*/ _H_ = create(lrr, x, d, r); - /*<>*/ return create - (create(ll, lv, ld, lrl), lrv, lrd, _H_); + /*<>*/ _G_ = create(lrr, x, d, r); + /*<>*/ return create + (create(ll, lv, ld, lrl), lrv, lrd, _G_); } if((hl + 2 | 0) >= hr){ - var _K_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; - /*<>*/ return [0, l, x, d, r, _K_]; + var _J_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + /*<>*/ return [0, l, x, d, r, _J_]; } if(! r) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Map_bal$2); - /*<>*/ var + /*<>*/ var rr = r[4], rd = r[3], rv = r[2], rl = r[1], - /*<>*/ _I_ = height(rl); - if(_I_ <= height(rr)) - /*<>*/ return create + /*<>*/ _H_ = height(rl); + if(_H_ <= height(rr)) + /*<>*/ return create (create(l, x, d, rl), rv, rd, rr); if(! rl) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Map_bal$1); - /*<>*/ var + /*<>*/ var rlr = rl[4], rld = rl[3], rlv = rl[2], rll = rl[1], - /*<>*/ _J_ = create(rlr, rv, rd, rr); - /*<>*/ return create - (create(l, x, d, rll), rlv, rld, _J_); - /*<>*/ } + /*<>*/ _I_ = create(rlr, rv, rd, rr); + /*<>*/ return create + (create(l, x, d, rll), rlv, rld, _I_); + /*<>*/ } var empty = 0; function is_empty(param){ - /*<>*/ return param ? 0 : 1; - /*<>*/ } + /*<>*/ return param ? 0 : 1; + /*<>*/ } function add(x, data, m){ /*<>*/ if(! m) - /*<>*/ return [0, 0, x, data, 0, 1]; - /*<>*/ var + /*<>*/ return [0, 0, x, data, 0, 1]; + /*<>*/ var h = m[5], r = m[4], d = m[3], v = m[2], l = m[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) return d === data ? m : [0, l, x, data, r, h]; if(0 <= c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var rr = add(x, data, r); return r === rr ? m : bal(l, v, d, rr); } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var ll = add(x, data, l); return l === ll ? m : bal(ll, v, d, r); } @@ -10792,373 +11417,399 @@ var param$0 = param; for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); - /*<>*/ var + /*<>*/ var r = param$0[4], d = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) /*<>*/ return d; - var r$0 = 0 <= c ? r : l, param$0 = r$0; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) /*<>*/ return d; + var r$0 = 0 <= c ? r : l; + param$0 = r$0; } } function find_first(f, param$0){ var param$1 = param$0; for(;;){ if(! param$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var r$0 = param$1[4], d0$1 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = r$0; continue;} - var v0 = v0$1, d0 = d0$1, param = l$0; - for(;;){ - if(! param) /*<>*/ return [0, v0, d0]; - var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){ - var v0 = v0$0, d0 = d0$0, param = l; - continue; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, d0 = d0$1, param = l$0; + for(;;){ + if(! param) /*<>*/ return [0, v0, d0]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; d0 = d0$0; param = l;} + else + param = r; } - var param = r; } + else + param$1 = r$0; } } function find_first_opt(f, param$0){ var param$1 = param$0; for(;;){ - if(! param$1) /*<>*/ return 0; + if(! param$1) /*<>*/ return 0; var r$0 = param$1[4], d0$1 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = r$0; continue;} - var v0 = v0$1, d0 = d0$1, param = l$0; - for(;;){ - if(! param) /*<>*/ return [0, [0, v0, d0]]; - var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){ - var v0 = v0$0, d0 = d0$0, param = l; - continue; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, d0 = d0$1, param = l$0; + for(;;){ + if(! param) /*<>*/ return [0, [0, v0, d0]]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; d0 = d0$0; param = l;} + else + param = r; } - var param = r; } + else + param$1 = r$0; } } function find_last(f, param$0){ var param$1 = param$0; for(;;){ if(! param$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var r$0 = param$1[4], d0$1 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = l$0; continue;} - var v0 = v0$1, d0 = d0$1, param = r$0; - for(;;){ - if(! param) /*<>*/ return [0, v0, d0]; - var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){ - var v0 = v0$0, d0 = d0$0, param = r; - continue; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, d0 = d0$1, param = r$0; + for(;;){ + if(! param) /*<>*/ return [0, v0, d0]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; d0 = d0$0; param = r;} + else + param = l; } - var param = l; } + else + param$1 = l$0; } } function find_last_opt(f, param$0){ var param$1 = param$0; for(;;){ - if(! param$1) /*<>*/ return 0; + if(! param$1) /*<>*/ return 0; var r$0 = param$1[4], d0$1 = param$1[3], v0$1 = param$1[2], l$0 = param$1[1]; - /*<>*/ if - (! /*<>*/ caml_call1(f, v0$1)){var param$1 = l$0; continue;} - var v0 = v0$1, d0 = d0$1, param = r$0; - for(;;){ - if(! param) /*<>*/ return [0, [0, v0, d0]]; - var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; - /*<>*/ if - ( /*<>*/ caml_call1(f, v0$0)){ - var v0 = v0$0, d0 = d0$0, param = r; - continue; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$1)){ + var v0 = v0$1, d0 = d0$1, param = r$0; + for(;;){ + if(! param) /*<>*/ return [0, [0, v0, d0]]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + /*<>*/ if + ( /*<>*/ caml_call1(f, v0$0)){v0 = v0$0; d0 = d0$0; param = r;} + else + param = l; } - var param = l; } + else + param$1 = l$0; } } function find_opt(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var r = param$0[4], d = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) - /*<>*/ return [0, d]; - var r$0 = 0 <= c ? r : l, param$0 = r$0; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) + /*<>*/ return [0, d]; + var r$0 = 0 <= c ? r : l; + param$0 = r$0; } } function mem(x, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var r = param$0[4], v = param$0[2], l = param$0[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v), - _F_ = 0 === c ? 1 : 0; - if(_F_) return _F_; - var r$0 = 0 <= c ? r : l, param$0 = r$0; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v), + _E_ = 0 === c ? 1 : 0; + if(_E_) return _E_; + var r$0 = 0 <= c ? r : l; + param$0 = r$0; } } function min_binding(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var l = param$0[1]; - if(l){var param$0 = l; continue;} - var d = param$0[3], v = param$0[2]; - /*<>*/ return [0, v, d]; + if(! l){ + var d = param$0[3], v = param$0[2]; + /*<>*/ return [0, v, d]; + } + param$0 = l; } - /*<>*/ } + /*<>*/ } function min_binding_opt(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ - if(! param$0) /*<>*/ return 0; + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ + if(! param$0) /*<>*/ return 0; var l = param$0[1]; - if(l){var param$0 = l; continue;} - var d = param$0[3], v = param$0[2]; - /*<>*/ return [0, [0, v, d]]; + if(! l){ + var d = param$0[3], v = param$0[2]; + /*<>*/ return [0, [0, v, d]]; + } + param$0 = l; } - /*<>*/ } + /*<>*/ } function max_binding(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ if(! param$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); - if(param$0[4]){var r = param$0[4], param$0 = r; continue;} - var d = param$0[3], v = param$0[2]; - /*<>*/ return [0, v, d]; + if(! param$0[4]){ + var d = param$0[3], v = param$0[2]; + /*<>*/ return [0, v, d]; + } + var r = param$0[4]; + param$0 = r; } - /*<>*/ } + /*<>*/ } function max_binding_opt(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ - if(! param$0) /*<>*/ return 0; - if(param$0[4]){var r = param$0[4], param$0 = r; continue;} - var d = param$0[3], v = param$0[2]; - /*<>*/ return [0, [0, v, d]]; + /*<>*/ var param$0 = param; + /*<>*/ for(;;){ + if(! param$0) /*<>*/ return 0; + if(! param$0[4]){ + var d = param$0[3], v = param$0[2]; + /*<>*/ return [0, [0, v, d]]; + } + var r = param$0[4]; + param$0 = r; } - /*<>*/ } + /*<>*/ } function remove_min_binding(param){ - /*<>*/ if(! param) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(! param) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Map_remove_min_elt); var l = param[1]; if(l){ var r = param[4], d = param[3], v = param[2]; - /*<>*/ return bal(remove_min_binding(l), v, d, r); + /*<>*/ return bal(remove_min_binding(l), v, d, r); } var r$0 = param[4]; - /*<>*/ return r$0; - /*<>*/ } + /*<>*/ return r$0; + /*<>*/ } function _d_(t1, t2){ - /*<>*/ if(! t1) /*<>*/ return t2; - if(! t2) /*<>*/ return t1; - /*<>*/ var - /*<>*/ match = min_binding(t2), + /*<>*/ if(! t1) /*<>*/ return t2; + if(! t2) /*<>*/ return t1; + /*<>*/ var + /*<>*/ match = min_binding(t2), d = match[2], x = match[1]; - /*<>*/ return bal(t1, x, d, remove_min_binding(t2)); - /*<>*/ } + /*<>*/ return bal(t1, x, d, remove_min_binding(t2)); + /*<>*/ } function remove(x, m){ - /*<>*/ if(! m) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! m) /*<>*/ return 0; + /*<>*/ var r = m[4], d = m[3], v = m[2], l = m[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) - /*<>*/ return _d_(l, r); + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) + /*<>*/ return _d_(l, r); if(0 <= c){ - /*<>*/ /*<>*/ var rr = remove(x, r); + /*<>*/ /*<>*/ var rr = remove(x, r); return r === rr ? m : bal(l, v, d, rr); } - /*<>*/ /*<>*/ var ll = remove(x, l); + /*<>*/ /*<>*/ var ll = remove(x, l); return l === ll ? m : bal(ll, v, d, r); } function update(x, f, m){ /*<>*/ if(! m){ - /*<>*/ /*<>*/ var - match$0 = /*<>*/ caml_call1(f, 0); - if(! match$0) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match$0 = /*<>*/ caml_call1(f, 0); + if(! match$0) /*<>*/ return 0; var data$0 = match$0[1]; - /*<>*/ return [0, 0, x, data$0, 0, 1]; + /*<>*/ return [0, 0, x, data$0, 0, 1]; } - /*<>*/ var + /*<>*/ var h = m[5], r = m[4], d = m[3], v = m[2], l = m[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(f, [0, d]); - if(! match) /*<>*/ return _d_(l, r); + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(f, [0, d]); + if(! match) /*<>*/ return _d_(l, r); var data = match[1]; return d === data ? m : [0, l, x, data, r, h]; } if(0 <= c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var rr = update(x, f, r); return r === rr ? m : bal(l, v, d, rr); } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var ll = update(x, f, l); return l === ll ? m : bal(ll, v, d, r); } + function add_to_list(x, data, m){ + function add(param){ + /*<>*/ if(! param) + /*<>*/ return [0, [0, data, 0]]; + var l = param[1]; + /*<>*/ return [0, [0, data, l]]; + /*<>*/ } + /*<>*/ return update(x, add, m); + /*<>*/ } function iter(f, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var r = param$0[4], d = param$0[3], v = param$0[2], l = param$0[1]; - /*<>*/ iter(f, l); - /*<>*/ /*<>*/ caml_call2(f, v, d); - var param$0 = r; + /*<>*/ iter(f, l); + /*<>*/ /*<>*/ caml_call2(f, v, d); + param$0 = r; } } function map(f, param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ var h = param[5], r = param[4], d = param[3], v = param[2], l = param[1], - /*<>*/ l$0 = map(f, l), - /*<>*/ d$0 = /*<>*/ caml_call1(f, d), - /*<>*/ r$0 = map(f, r); - /*<>*/ return [0, l$0, v, d$0, r$0, h]; + /*<>*/ l$0 = map(f, l), + /*<>*/ d$0 = /*<>*/ caml_call1(f, d), + /*<>*/ r$0 = map(f, r); + /*<>*/ return [0, l$0, v, d$0, r$0, h]; } function mapi(f, param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ var h = param[5], r = param[4], d = param[3], v = param[2], l = param[1], - /*<>*/ l$0 = mapi(f, l), - /*<>*/ d$0 = - /*<>*/ caml_call2(f, v, d), - /*<>*/ r$0 = mapi(f, r); - /*<>*/ return [0, l$0, v, d$0, r$0, h]; + /*<>*/ l$0 = mapi(f, l), + /*<>*/ d$0 = + /*<>*/ caml_call2(f, v, d), + /*<>*/ r$0 = mapi(f, r); + /*<>*/ return [0, l$0, v, d$0, r$0, h]; } function fold(f, m, accu){ - /*<>*/ var m$0 = m, accu$0 = accu; - /*<>*/ for(;;){ - if(! m$0) /*<>*/ return accu$0; - /*<>*/ var + /*<>*/ var m$0 = m, accu$0 = accu; + /*<>*/ for(;;){ + if(! m$0) /*<>*/ return accu$0; + /*<>*/ var r = m$0[4], d = m$0[3], v = m$0[2], l = m$0[1], - /*<>*/ accu$1 = - /*<>*/ caml_call3(f, v, d, fold(f, l, accu$0)), - m$0 = r, - accu$0 = accu$1; + /*<>*/ accu$1 = + /*<>*/ caml_call3(f, v, d, fold(f, l, accu$0)); + m$0 = r; + accu$0 = accu$1; } - /*<>*/ } + /*<>*/ } function for_all(p, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 1; - /*<>*/ var + if(! param$0) /*<>*/ return 1; + /*<>*/ var r = param$0[4], d = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ _C_ = - /*<>*/ caml_call2(p, v, d); - /*<>*/ if(_C_){ - /*<>*/ /*<>*/ var - _D_ = for_all(p, l); - /*<>*/ if(_D_){var param$0 = r; continue;} - var _E_ = _D_; + /*<>*/ _B_ = + /*<>*/ caml_call2(p, v, d); + /*<>*/ if(_B_){ + /*<>*/ /*<>*/ var + _C_ = for_all(p, l); + /*<>*/ if(_C_){param$0 = r; continue;} + var _D_ = _C_; } else - var _E_ = _C_; - /*<>*/ return _E_; + var _D_ = _B_; + /*<>*/ return _D_; } } function exists(p, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; - /*<>*/ var + if(! param$0) /*<>*/ return 0; + /*<>*/ var r = param$0[4], d = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ _z_ = - /*<>*/ caml_call2(p, v, d); - /*<>*/ if(_z_) - var _A_ = _z_; + /*<>*/ _y_ = + /*<>*/ caml_call2(p, v, d); + /*<>*/ if(_y_) + var _z_ = _y_; else{ - /*<>*/ /*<>*/ var - _B_ = exists(p, l); - /*<>*/ if(! _B_){var param$0 = r; continue;} - var _A_ = _B_; + /*<>*/ /*<>*/ var + _A_ = exists(p, l); + /*<>*/ if(! _A_){param$0 = r; continue;} + var _z_ = _A_; } - /*<>*/ return _A_; + /*<>*/ return _z_; } } function add_min_binding(k, x, param){ - /*<>*/ if(! param) /*<>*/ return singleton(k, x); + /*<>*/ if(! param) /*<>*/ return singleton(k, x); var r = param[4], d = param[3], v = param[2], l = param[1]; - /*<>*/ return bal(add_min_binding(k, x, l), v, d, r); + /*<>*/ return bal(add_min_binding(k, x, l), v, d, r); } function add_max_binding(k, x, param){ - /*<>*/ if(! param) /*<>*/ return singleton(k, x); + /*<>*/ if(! param) /*<>*/ return singleton(k, x); var r = param[4], d = param[3], v = param[2], l = param[1]; - /*<>*/ return bal(l, v, d, add_max_binding(k, x, r)); + /*<>*/ return bal(l, v, d, add_max_binding(k, x, r)); } function join(l, v, d, r){ - /*<>*/ if(! l) - /*<>*/ return add_min_binding(v, d, r); - if(! r) /*<>*/ return add_max_binding(v, d, l); + /*<>*/ if(! l) + /*<>*/ return add_min_binding(v, d, r); + if(! r) /*<>*/ return add_max_binding(v, d, l); var rh = r[5], rr = r[4], @@ -11178,85 +11829,85 @@ < rh ? bal(join(l, v, d, rl), rv, rd, rr) : create(l, v, d, r); - /*<>*/ } + /*<>*/ } function concat(t1, t2){ - /*<>*/ if(! t1) /*<>*/ return t2; - if(! t2) /*<>*/ return t1; - /*<>*/ var - /*<>*/ match = min_binding(t2), + /*<>*/ if(! t1) /*<>*/ return t2; + if(! t2) /*<>*/ return t1; + /*<>*/ var + /*<>*/ match = min_binding(t2), d = match[2], x = match[1]; - /*<>*/ return join(t1, x, d, remove_min_binding(t2)); - /*<>*/ } + /*<>*/ return join(t1, x, d, remove_min_binding(t2)); + /*<>*/ } function concat_or_join(t1, v, d, t2){ - /*<>*/ if(! d) - /*<>*/ return concat(t1, t2); + /*<>*/ if(! d) + /*<>*/ return concat(t1, t2); var d$0 = d[1]; - /*<>*/ return join(t1, v, d$0, t2); - /*<>*/ } + /*<>*/ return join(t1, v, d$0, t2); + /*<>*/ } function split(x, param){ - /*<>*/ if(! param) /*<>*/ return _a_; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return _a_; + /*<>*/ var r = param[4], d = param[3], v = param[2], l = param[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], x, v); - /*<>*/ if(0 === c) - /*<>*/ return [0, l, [0, d], r]; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], x, v); + /*<>*/ if(0 === c) + /*<>*/ return [0, l, [0, d], r]; if(0 <= c){ - /*<>*/ var - /*<>*/ match = split(x, r), + /*<>*/ var + /*<>*/ match = split(x, r), rr = match[3], pres = match[2], lr = match[1]; - /*<>*/ return [0, join(l, v, d, lr), pres, rr]; + /*<>*/ return [0, join(l, v, d, lr), pres, rr]; } - /*<>*/ var - /*<>*/ match$0 = split(x, l), + /*<>*/ var + /*<>*/ match$0 = split(x, l), rl = match$0[3], pres$0 = match$0[2], ll = match$0[1]; - /*<>*/ return [0, ll, pres$0, join(rl, v, d, r)]; + /*<>*/ return [0, ll, pres$0, join(rl, v, d, r)]; } function merge(f, s1, s2){ - /*<>*/ if(s1){ + /*<>*/ if(s1){ var h1 = s1[5], r1 = s1[4], d1 = s1[3], v1 = s1[2], l1 = s1[1]; if(height(s2) <= h1){ - /*<>*/ var - /*<>*/ match = split(v1, s2), + /*<>*/ var + /*<>*/ match = split(v1, s2), r2 = match[3], d2 = match[2], l2 = match[1], - /*<>*/ _v_ = merge(f, r1, r2), - /*<>*/ _w_ = - /*<>*/ caml_call3(f, v1, [0, d1], d2); - /*<>*/ return concat_or_join - (merge(f, l1, l2), v1, _w_, _v_); + /*<>*/ _u_ = merge(f, r1, r2), + /*<>*/ _v_ = + /*<>*/ caml_call3(f, v1, [0, d1], d2); + /*<>*/ return concat_or_join + (merge(f, l1, l2), v1, _v_, _u_); } } - else if(! s2) /*<>*/ return 0; + else if(! s2) /*<>*/ return 0; if(! s2) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _b_], 1); - /*<>*/ var + /*<>*/ var r2$0 = s2[4], d2$0 = s2[3], v2 = s2[2], l2$0 = s2[1], - /*<>*/ match$0 = split(v2, s1), + /*<>*/ match$0 = split(v2, s1), r1$0 = match$0[3], d1$0 = match$0[2], l1$0 = match$0[1], - /*<>*/ _x_ = merge(f, r1$0, r2$0), - /*<>*/ _y_ = - /*<>*/ caml_call3(f, v2, d1$0, [0, d2$0]); - /*<>*/ return concat_or_join - (merge(f, l1$0, l2$0), v2, _y_, _x_); - /*<>*/ } + /*<>*/ _w_ = merge(f, r1$0, r2$0), + /*<>*/ _x_ = + /*<>*/ caml_call3(f, v2, d1$0, [0, d2$0]); + /*<>*/ return concat_or_join + (merge(f, l1$0, l2$0), v2, _x_, _w_); + /*<>*/ } function union(f, s1, s2){ - /*<>*/ if(s1){ + /*<>*/ if(s1){ if(s2){ var h2 = s2[5], @@ -11270,124 +11921,124 @@ v1 = s1[2], l1 = s1[1]; if(h2 <= h1){ - /*<>*/ var - /*<>*/ match = split(v1, s2), + /*<>*/ var + /*<>*/ match = split(v1, s2), r2$0 = match[3], d2$0 = match[2], l2$0 = match[1], - /*<>*/ l = union(f, l1, l2$0), - /*<>*/ r = union(f, r1, r2$0); - /*<>*/ if(! d2$0) - /*<>*/ return join(l, v1, d1, r); + /*<>*/ l = union(f, l1, l2$0), + /*<>*/ r = union(f, r1, r2$0); + /*<>*/ if(! d2$0) + /*<>*/ return join(l, v1, d1, r); var d2$1 = d2$0[1]; - /*<>*/ return concat_or_join + /*<>*/ return concat_or_join (l, v1, - /*<>*/ caml_call3(f, v1, d1, d2$1), + /*<>*/ caml_call3(f, v1, d1, d2$1), r); } - /*<>*/ var - /*<>*/ match$0 = split(v2, s1), + /*<>*/ var + /*<>*/ match$0 = split(v2, s1), r1$0 = match$0[3], d1$0 = match$0[2], l1$0 = match$0[1], - /*<>*/ l$0 = union(f, l1$0, l2), - /*<>*/ r$0 = union(f, r1$0, r2); - /*<>*/ if(! d1$0) - /*<>*/ return join(l$0, v2, d2, r$0); + /*<>*/ l$0 = union(f, l1$0, l2), + /*<>*/ r$0 = union(f, r1$0, r2); + /*<>*/ if(! d1$0) + /*<>*/ return join(l$0, v2, d2, r$0); var d1$1 = d1$0[1]; - /*<>*/ return concat_or_join + /*<>*/ return concat_or_join (l$0, v2, - /*<>*/ caml_call3(f, v2, d1$1, d2), + /*<>*/ caml_call3(f, v2, d1$1, d2), r$0); } var s = s1; } else var s = s2; - /*<>*/ return s; - /*<>*/ } + /*<>*/ return s; + /*<>*/ } function filter(p, m){ - /*<>*/ if(! m) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! m) /*<>*/ return 0; + /*<>*/ var r = m[4], d = m[3], v = m[2], l = m[1], - /*<>*/ l$0 = filter(p, l), - /*<>*/ pvd = - /*<>*/ caml_call2(p, v, d), - /*<>*/ r$0 = filter(p, r); - /*<>*/ if(! pvd) - /*<>*/ return concat(l$0, r$0); - if(l === l$0 && r === r$0) /*<>*/ return m; - /*<>*/ return join(l$0, v, d, r$0); + /*<>*/ l$0 = filter(p, l), + /*<>*/ pvd = + /*<>*/ caml_call2(p, v, d), + /*<>*/ r$0 = filter(p, r); + /*<>*/ if(! pvd) + /*<>*/ return concat(l$0, r$0); + if(l === l$0 && r === r$0) /*<>*/ return m; + /*<>*/ return join(l$0, v, d, r$0); } function filter_map(f, param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ var r = param[4], d = param[3], v = param[2], l = param[1], - /*<>*/ l$0 = filter_map(f, l), - /*<>*/ fvd = - /*<>*/ caml_call2(f, v, d), - /*<>*/ r$0 = filter_map(f, r); - /*<>*/ if(! fvd) - /*<>*/ return concat(l$0, r$0); + /*<>*/ l$0 = filter_map(f, l), + /*<>*/ fvd = + /*<>*/ caml_call2(f, v, d), + /*<>*/ r$0 = filter_map(f, r); + /*<>*/ if(! fvd) + /*<>*/ return concat(l$0, r$0); var d$0 = fvd[1]; - /*<>*/ return join(l$0, v, d$0, r$0); + /*<>*/ return join(l$0, v, d$0, r$0); } function partition(p, param){ - /*<>*/ if(! param) /*<>*/ return _c_; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return _c_; + /*<>*/ var r = param[4], d = param[3], v = param[2], l = param[1], - /*<>*/ match = partition(p, l), + /*<>*/ match = partition(p, l), lf = match[2], lt = match[1], - /*<>*/ pvd = - /*<>*/ caml_call2(p, v, d), - /*<>*/ match$0 = partition(p, r), + /*<>*/ pvd = + /*<>*/ caml_call2(p, v, d), + /*<>*/ match$0 = partition(p, r), rf = match$0[2], rt = match$0[1]; - /*<>*/ if(pvd){ - /*<>*/ /*<>*/ var - _t_ = concat(lf, rf); - /*<>*/ return [0, join(lt, v, d, rt), _t_]; + /*<>*/ if(pvd){ + /*<>*/ /*<>*/ var + _s_ = concat(lf, rf); + /*<>*/ return [0, join(lt, v, d, rt), _s_]; } - /*<>*/ /*<>*/ var - _u_ = join(lf, v, d, rf); - /*<>*/ return [0, concat(lt, rt), _u_]; + /*<>*/ /*<>*/ var + _t_ = join(lf, v, d, rf); + /*<>*/ return [0, concat(lt, rt), _t_]; } function cons_enum(m, e){ - /*<>*/ var m$0 = m, e$0 = e; - /*<>*/ for(;;){ - if(! m$0) /*<>*/ return e$0; - /*<>*/ var + /*<>*/ var m$0 = m, e$0 = e; + /*<>*/ for(;;){ + if(! m$0) /*<>*/ return e$0; + /*<>*/ var r = m$0[4], d = m$0[3], v = m$0[2], l = m$0[1], - /*<>*/ e$1 = [0, v, d, r, e$0], - m$0 = l, - e$0 = e$1; + /*<>*/ e$1 = [0, v, d, r, e$0]; + m$0 = l; + e$0 = e$1; } - /*<>*/ } + /*<>*/ } function compare(cmp, m1, m2){ - /*<>*/ var - /*<>*/ e2$2 = cons_enum(m2, 0), - /*<>*/ e1$2 = cons_enum(m1, 0), + /*<>*/ var + /*<>*/ e2$2 = cons_enum(m2, 0), + /*<>*/ e1$2 = cons_enum(m1, 0), e1 = e1$2, e2 = e2$2; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(! e1) return e2 ? -1 : 0; - if(! e2) /*<>*/ return 1; - /*<>*/ var + if(! e2) /*<>*/ return 1; + /*<>*/ var e2$0 = e2[4], r2 = e2[3], d2 = e2[2], @@ -11396,29 +12047,29 @@ r1 = e1[3], d1 = e1[2], v1 = e1[1], - /*<>*/ c = - /*<>*/ caml_call2(Ord[1], v1, v2); - /*<>*/ if(0 !== c) /*<>*/ return c; - /*<>*/ /*<>*/ var - c$0 = /*<>*/ caml_call2(cmp, d1, d2); - /*<>*/ if(0 !== c$0) - /*<>*/ return c$0; - /*<>*/ var - /*<>*/ e2$1 = cons_enum(r2, e2$0), - /*<>*/ e1$1 = cons_enum(r1, e1$0), - e1 = e1$1, - e2 = e2$1; + /*<>*/ c = + /*<>*/ caml_call2(Ord[1], v1, v2); + /*<>*/ if(0 !== c) /*<>*/ return c; + /*<>*/ /*<>*/ var + c$0 = /*<>*/ caml_call2(cmp, d1, d2); + /*<>*/ if(0 !== c$0) + /*<>*/ return c$0; + /*<>*/ var + /*<>*/ e2$1 = cons_enum(r2, e2$0), + /*<>*/ e1$1 = cons_enum(r1, e1$0); + e1 = e1$1; + e2 = e2$1; } - /*<>*/ } + /*<>*/ } function equal(cmp, m1, m2){ - /*<>*/ var - /*<>*/ e2$2 = cons_enum(m2, 0), - /*<>*/ e1$2 = cons_enum(m1, 0), + /*<>*/ var + /*<>*/ e2$2 = cons_enum(m2, 0), + /*<>*/ e1$2 = cons_enum(m1, 0), e1 = e1$2, e2 = e2$2; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(! e1) return e2 ? 0 : 1; - if(! e2) /*<>*/ return 0; + if(! e2) /*<>*/ return 0; var e2$0 = e2[4], r2 = e2[3], @@ -11428,162 +12079,167 @@ r1 = e1[3], d1 = e1[2], v1 = e1[1], - _q_ = - 0 === /*<>*/ caml_call2(Ord[1], v1, v2) ? 1 : 0; - if(_q_){ - /*<>*/ /*<>*/ var - _r_ = /*<>*/ caml_call2(cmp, d1, d2); - /*<>*/ if(_r_){ - /*<>*/ var - /*<>*/ e2$1 = cons_enum(r2, e2$0), - /*<>*/ e1$1 = cons_enum(r1, e1$0), - e1 = e1$1, - e2 = e2$1; + _p_ = + 0 === /*<>*/ caml_call2(Ord[1], v1, v2) ? 1 : 0; + if(_p_){ + /*<>*/ /*<>*/ var + _q_ = /*<>*/ caml_call2(cmp, d1, d2); + /*<>*/ if(_q_){ + /*<>*/ var + /*<>*/ e2$1 = cons_enum(r2, e2$0), + /*<>*/ e1$1 = cons_enum(r1, e1$0); + e1 = e1$1; + e2 = e2$1; continue; } - var _s_ = _r_; + var _r_ = _q_; } else - var _s_ = _q_; - /*<>*/ return _s_; + var _r_ = _p_; + /*<>*/ return _r_; } - /*<>*/ } + /*<>*/ } function cardinal(param){ - /*<>*/ if(! param) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return 0; + /*<>*/ var r = param[4], l = param[1], - /*<>*/ _p_ = cardinal(r); - return (cardinal(l) + 1 | 0) + _p_ | 0; - /*<>*/ } + /*<>*/ _o_ = cardinal(r); + return (cardinal(l) + 1 | 0) + _o_ | 0; + /*<>*/ } function bindings_aux(accu, param){ var accu$0 = accu, param$0 = param; for(;;){ - if(! param$0) /*<>*/ return accu$0; - /*<>*/ var + if(! param$0) /*<>*/ return accu$0; + /*<>*/ var r = param$0[4], d = param$0[3], v = param$0[2], l = param$0[1], - /*<>*/ accu$1 = - [0, [0, v, d], bindings_aux(accu$0, r)], - accu$0 = accu$1, - param$0 = l; + /*<>*/ accu$1 = + [0, [0, v, d], bindings_aux(accu$0, r)]; + accu$0 = accu$1; + param$0 = l; } } function bindings(s){ - /*<>*/ return bindings_aux(0, s); - /*<>*/ } + /*<>*/ return bindings_aux(0, s); + /*<>*/ } + function of_list(bs){ + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_List[26], + function(m, param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return add(k, v, m); + /*<>*/ }, + empty, + bs); + /*<>*/ } function add_seq(i, m){ - function _o_(m, param){ - /*<>*/ var v = param[2], k = param[1]; - /*<>*/ return add(k, v, m); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Seq[5], _o_, m, i); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_Seq[5], + function(m, param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return add(k, v, m); + /*<>*/ }, + m, + i); + /*<>*/ } function of_seq(i){ - /*<>*/ return add_seq(i, empty); - /*<>*/ } + /*<>*/ return add_seq(i, empty); + /*<>*/ } function seq_of_enum(c, param){ - /*<>*/ if(! c) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! c) /*<>*/ return 0; + var rest = c[4], t = c[3], v = c[2], k = c[1], - /*<>*/ _m_ = cons_enum(t, rest); - /*<>*/ return [0, + /*<>*/ _m_ = cons_enum(t, rest); + /*<>*/ return [0, [0, k, v], function(_n_){ /*<>*/ return seq_of_enum(_m_, _n_);}]; - /*<>*/ } + /*<>*/ } function to_seq(m){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _k_ = cons_enum(m, 0); - /*<>*/ return function(_l_){ + /*<>*/ return function(_l_){ /*<>*/ return seq_of_enum(_k_, _l_);}; - /*<>*/ } + /*<>*/ } function snoc_enum(s, e){ - /*<>*/ var s$0 = s, e$0 = e; - /*<>*/ for(;;){ - if(! s$0) /*<>*/ return e$0; - /*<>*/ var + /*<>*/ var s$0 = s, e$0 = e; + /*<>*/ for(;;){ + if(! s$0) /*<>*/ return e$0; + /*<>*/ var r = s$0[4], d = s$0[3], v = s$0[2], l = s$0[1], - /*<>*/ e$1 = [0, v, d, l, e$0], - s$0 = r, - e$0 = e$1; + /*<>*/ e$1 = [0, v, d, l, e$0]; + s$0 = r; + e$0 = e$1; } - /*<>*/ } + /*<>*/ } function rev_seq_of_enum(c, param){ - /*<>*/ if(! c) /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(! c) /*<>*/ return 0; + var rest = c[4], t = c[3], v = c[2], k = c[1], - /*<>*/ _i_ = snoc_enum(t, rest); - /*<>*/ return [0, + /*<>*/ _i_ = snoc_enum(t, rest); + /*<>*/ return [0, [0, k, v], function(_j_){ /*<>*/ return rev_seq_of_enum(_i_, _j_);}]; - /*<>*/ } + /*<>*/ } function to_rev_seq(c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _g_ = snoc_enum(c, 0); - /*<>*/ return function(_h_){ + /*<>*/ return function(_h_){ /*<>*/ return rev_seq_of_enum(_g_, _h_);}; - /*<>*/ } + /*<>*/ } function to_seq_from(low, m){ - /*<>*/ var m$0 = m, c = 0; - /*<>*/ for(;;){ - if(m$0){ - /*<>*/ var - r = m$0[4], - d = m$0[3], - v = m$0[2], - l = m$0[1], - /*<>*/ n = - /*<>*/ caml_call2(Ord[1], v, low); - if(0 !== n){ + /*<>*/ a: + { + b: + { + var m$0 = m, c = 0; + /*<>*/ for(;;){ + if(! m$0) break; + /*<>*/ var + r = m$0[4], + d = m$0[3], + v = m$0[2], + l = m$0[1], + /*<>*/ n = + /*<>*/ caml_call2(Ord[1], v, low); + if(0 === n) break b; if(0 <= n){ - /*<>*/ var - /*<>*/ c$0 = [0, v, d, r, c], - m$0 = l, - c = c$0; - continue; + /*<>*/ /*<>*/ var + c$0 = [0, v, d, r, c]; + m$0 = l; + c = c$0; } - var m$0 = r; - continue; + else + m$0 = r; } - var _e_ = [0, v, d, r, c]; - } - else var _e_ = c; - /*<>*/ return function(_f_){ - /*<>*/ return seq_of_enum(_e_, _f_);}; + break a; + } + var _e_ = [0, v, d, r, c]; } - /*<>*/ } + /*<>*/ return function(_f_){ + /*<>*/ return seq_of_enum(_e_, _f_);}; + /*<>*/ } return [0, empty, - is_empty, - mem, add, + add_to_list, update, singleton, remove, merge, union, - compare, - equal, - iter, - fold, - for_all, - exists, - filter, - filter_map, - partition, cardinal, bindings, min_binding, @@ -11592,22 +12248,35 @@ max_binding_opt, min_binding, min_binding_opt, - split, find, find_opt, find_first, find_first_opt, find_last, find_last_opt, + iter, + fold, map, mapi, + filter, + filter_map, + partition, + split, + is_empty, + mem, + equal, + compare, + for_all, + exists, + bindings, + of_list, to_seq, to_rev_seq, to_seq_from, add_seq, of_seq]; }]; - runtime.caml_register_global(11, Stdlib_Map, "Stdlib__Map"); + runtime.caml_register_global(12, Stdlib_Map, "Stdlib__Map"); return; /*<>*/ } (globalThis)); @@ -11675,47 +12344,58 @@ s[2] = s[2] - 1 | 0; /*<>*/ return [0, hd]; /*<>*/ } - function top(s){ + function drop(s){ /*<>*/ var match = s[1]; if(! match) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Empty, 1); + var tl = match[2]; + s[1] = tl; + s[2] = s[2] - 1 | 0; + return 0; + /*<>*/ } + function top(s){ + /*<>*/ var match = s[1]; + if(! match) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Empty, 1); var hd = match[1]; - /*<>*/ return hd; - /*<>*/ } + /*<>*/ return hd; + /*<>*/ } function top_opt(s){ - /*<>*/ var match = s[1]; - if(! match) /*<>*/ return 0; + /*<>*/ var match = s[1]; + if(! match) /*<>*/ return 0; var hd = match[1]; - /*<>*/ return [0, hd]; - /*<>*/ } + /*<>*/ return [0, hd]; + /*<>*/ } function is_empty(s){ - /*<>*/ return 0 === s[1] ? 1 : 0; - /*<>*/ } + /*<>*/ return 0 === s[1] ? 1 : 0; + /*<>*/ } function length(s){ - /*<>*/ return s[2]; - /*<>*/ } + /*<>*/ return s[2]; + /*<>*/ } function iter(f, s){ - /*<>*/ return caml_call2(Stdlib_List[17], f, s[1]); - /*<>*/ } + /*<>*/ return caml_call2(Stdlib_List[18], f, s[1]); + /*<>*/ } function fold(f, acc, s){ - /*<>*/ return caml_call3(Stdlib_List[25], f, acc, s[1]); - /*<>*/ } + /*<>*/ return caml_call3(Stdlib_List[26], f, acc, s[1]); + /*<>*/ } function to_seq(s){ - /*<>*/ return caml_call1(Stdlib_List[61], s[1]); - /*<>*/ } + /*<>*/ return caml_call1(Stdlib_List[64], s[1]); + /*<>*/ } function add_seq(q, i){ - function _a_(x){ - /*<>*/ return push(x, q); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _a_, i); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(x){ + /*<>*/ return push(x, q); + /*<>*/ }, + i); + /*<>*/ } function of_seq(g){ - /*<>*/ /*<>*/ var s = create(0); - /*<>*/ add_seq(s, g); - /*<>*/ return s; - /*<>*/ } + /*<>*/ /*<>*/ var s = create(0); + /*<>*/ add_seq(s, g); + /*<>*/ return s; + /*<>*/ } var Stdlib_Stack = [0, @@ -11724,6 +12404,7 @@ push, pop, pop_opt, + drop, top, top_opt, clear, @@ -11795,13 +12476,13 @@ /*<>*/ return [0, content]; /*<>*/ } function take(q){ - /*<>*/ var _g_ = q[2]; - if(! _g_) + /*<>*/ var _f_ = q[2]; + if(! _f_) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Empty, 1); - var content = _g_[1]; - if(_g_[2]){ - var next = _g_[2]; + var content = _f_[1]; + if(_f_[2]){ + var next = _f_[2]; q[1] = q[1] - 1 | 0; q[2] = next; /*<>*/ return content; @@ -11810,11 +12491,11 @@ /*<>*/ return content; /*<>*/ } function take_opt(q){ - /*<>*/ var _f_ = q[2]; - if(! _f_) /*<>*/ return 0; - var content = _f_[1]; - if(_f_[2]){ - var next = _f_[2]; + /*<>*/ var _e_ = q[2]; + if(! _e_) /*<>*/ return 0; + var content = _e_[1]; + if(_e_[2]){ + var next = _e_[2]; q[1] = q[1] - 1 | 0; q[2] = next; /*<>*/ return [0, content]; @@ -11838,7 +12519,8 @@ prev[2] = prev$0; else q_res[2] = prev$0; - var prev = prev$0, cell = next; + prev = prev$0; + cell = next; } /*<>*/ } function is_empty(q){ @@ -11853,7 +12535,7 @@ if(! cell) /*<>*/ return 0; var content = cell[1], next = cell[2]; /*<>*/ /*<>*/ caml_call1(f, content); - var cell = next; + cell = next; } /*<>*/ } function fold(f, accu$1, q){ @@ -11864,14 +12546,14 @@ content = cell[1], next = cell[2], /*<>*/ accu$0 = - /*<>*/ caml_call2(f, accu, content), - accu = accu$0, - cell = next; + /*<>*/ caml_call2(f, accu, content); + accu = accu$0; + cell = next; } /*<>*/ } function transfer(q1, q2){ - /*<>*/ var _e_ = 0 < q1[1] ? 1 : 0; - if(! _e_) return _e_; + /*<>*/ var _d_ = 0 < q1[1] ? 1 : 0; + if(! _d_) return _d_; var match = q2[3]; return match ? (q2 @@ -11888,18 +12570,19 @@ var x = c[1], next = c[2]; /*<>*/ return [0, x, - function(_d_){ /*<>*/ return aux(next, _d_);}]; + function(_c_){ /*<>*/ return aux(next, _c_);}]; /*<>*/ } - var _b_ = q[2]; - /*<>*/ return function(_c_){ - /*<>*/ return aux(_b_, _c_);}; + var _a_ = q[2]; + /*<>*/ return function(_b_){ + /*<>*/ return aux(_a_, _b_);}; /*<>*/ } function add_seq(q, i){ - function _a_(x){ - /*<>*/ return add(x, q); - /*<>*/ } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _a_, i); + (Stdlib_Seq[4], + function(x){ + /*<>*/ return add(x, q); + /*<>*/ }, + i); /*<>*/ } function of_seq(g){ /*<>*/ /*<>*/ var q = create(0); @@ -11935,7 +12618,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Buffer -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Bytes, Stdlib__Seq, Stdlib__String, Stdlib__Sys +//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Seq, Stdlib__String, Stdlib__Sys (function (globalThis){ "use strict"; @@ -11955,7 +12638,8 @@ caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_bytes_length = runtime.caml_ml_bytes_length, caml_ml_string_length = runtime.caml_ml_string_length, - caml_string_get = runtime.caml_string_get; + caml_string_get = runtime.caml_string_get, + caml_wrap_exception = runtime.caml_wrap_exception; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 ? f(a0) @@ -11982,6 +12666,7 @@ : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), Stdlib_Bytes = global_data.Stdlib__Bytes, Stdlib_Sys = global_data.Stdlib__Sys, @@ -11989,14 +12674,10 @@ Stdlib = global_data.Stdlib, Stdlib_String = global_data.Stdlib__String, Assert_failure = global_data.Assert_failure, - cst_Buffer_truncate = "Buffer.truncate", - _a_ = [0, "buffer.ml", 220, 9], - cst_Buffer_add_channel = "Buffer.add_channel", - cst_Buffer_add_substring_add_s = "Buffer.add_substring/add_subbytes", - cst_Buffer_add_cannot_grow_buf = "Buffer.add: cannot grow buffer", - cst_Buffer_nth = "Buffer.nth", + cst_Buffer_sub = "Buffer.sub", cst_Buffer_blit = "Buffer.blit", - cst_Buffer_sub = "Buffer.sub"; + cst_Buffer_nth = "Buffer.nth", + cst_Buffer_add_cannot_grow_buf = "Buffer.add: cannot grow buffer"; function create(n){ /*<>*/ var n$0 = 1 <= n ? n : 1, @@ -12065,23 +12746,21 @@ old_len = b[1][2], /*<>*/ new_len = [0, old_len]; for(;;){ - if(new_len[1] < (old_pos + more | 0)){ - new_len[1] = 2 * new_len[1] | 0; - continue; - } - if(Stdlib_Sys[12] < new_len[1]) - if((old_pos + more | 0) <= Stdlib_Sys[12]) - new_len[1] = Stdlib_Sys[12]; - else - /*<>*/ /*<>*/ caml_call1 - (Stdlib[2], cst_Buffer_add_cannot_grow_buf); - /*<>*/ /*<>*/ var - new_buffer = /*<>*/ caml_create_bytes(new_len[1]); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Bytes[11], b[1][1], 0, new_buffer, 0, b[2]); - b[1] = [0, new_buffer, new_len[1]]; - return 0; + if(new_len[1] >= (old_pos + more | 0)) break; + new_len[1] = 2 * new_len[1] | 0; } + if(Stdlib_Sys[12] < new_len[1]) + if((old_pos + more | 0) <= Stdlib_Sys[12]) + new_len[1] = Stdlib_Sys[12]; + else + /*<>*/ /*<>*/ caml_call1 + (Stdlib[2], cst_Buffer_add_cannot_grow_buf); + /*<>*/ /*<>*/ var + new_buffer = /*<>*/ caml_create_bytes(new_len[1]); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Bytes[11], b[1][1], 0, new_buffer, 0, b[2]); + b[1] = [0, new_buffer, new_len[1]]; + return; /*<>*/ } function add_char(b, c){ /*<>*/ var @@ -12099,7 +12778,13 @@ b[2] = pos + 1 | 0; return 0; /*<>*/ } - var uchar_utf_8_byte_length_max = 4, uchar_utf_16_byte_length_max = 4; + var + uchar_utf_8_byte_length_max = 4, + uchar_utf_16_byte_length_max = 4, + cst_Buffer_add_substring_add_s = "Buffer.add_substring/add_subbytes", + cst_Buffer_add_channel = "Buffer.add_channel", + _a_ = [0, "buffer.ml", 220, 9], + cst_Buffer_truncate = "Buffer.truncate"; function add_utf_8_uchar(b, u){ /*<>*/ for(;;){ var pos = b[2]; @@ -12109,12 +12794,8 @@ n = /*<>*/ caml_call3 (Stdlib_Bytes[51], b[1][1], pos, u); - /*<>*/ if(0 === n){ - /*<>*/ resize(b, uchar_utf_8_byte_length_max); - continue; - } - b[2] = pos + n | 0; - return 0; + /*<>*/ if(0 !== n){b[2] = pos + n | 0; return 0;} + /*<>*/ resize(b, uchar_utf_8_byte_length_max); } /*<>*/ } function add_utf_16be_uchar(b, u){ @@ -12126,12 +12807,8 @@ n = /*<>*/ caml_call3 (Stdlib_Bytes[54], b[1][1], pos, u); - /*<>*/ if(0 === n){ - /*<>*/ resize(b, uchar_utf_16_byte_length_max); - continue; - } - b[2] = pos + n | 0; - return 0; + /*<>*/ if(0 !== n){b[2] = pos + n | 0; return 0;} + /*<>*/ resize(b, uchar_utf_16_byte_length_max); } /*<>*/ } function add_utf_16le_uchar(b, u){ @@ -12143,23 +12820,19 @@ n = /*<>*/ caml_call3 (Stdlib_Bytes[57], b[1][1], pos, u); - /*<>*/ if(0 === n){ - /*<>*/ resize(b, uchar_utf_16_byte_length_max); - continue; - } - b[2] = pos + n | 0; - return 0; + /*<>*/ if(0 !== n){b[2] = pos + n | 0; return 0;} + /*<>*/ resize(b, uchar_utf_16_byte_length_max); } /*<>*/ } function add_substring(b, s, offset, len){ - /*<>*/ var _r_ = offset < 0 ? 1 : 0; - if(_r_) - var _s_ = _r_; + /*<>*/ var _s_ = offset < 0 ? 1 : 0; + if(_s_) + var _t_ = _s_; else var - _t_ = len < 0 ? 1 : 0, - _s_ = _t_ || ((caml_ml_string_length(s) - len | 0) < offset ? 1 : 0); - if(_s_) + _u_ = len < 0 ? 1 : 0, + _t_ = _u_ || ((caml_ml_string_length(s) - len | 0) < offset ? 1 : 0); + if(_t_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_add_substring_add_s); /*<>*/ var @@ -12193,7 +12866,7 @@ /*<>*/ match = b[1], length = match[2], buffer = match[1], - new_position = b[2] + len | 0; + new_position = position + len | 0; if(length < new_position){ /*<>*/ resize(b, len); /*<>*/ /*<>*/ caml_call5 @@ -12214,9 +12887,9 @@ /*<>*/ } function add_channel(b, ic, to_read$1){ /*<>*/ var - _p_ = to_read$1 < 0 ? 1 : 0, - _q_ = _p_ || (Stdlib_Sys[12] < to_read$1 ? 1 : 0); - if(_q_) + _q_ = to_read$1 < 0 ? 1 : 0, + _r_ = _q_ || (Stdlib_Sys[12] < to_read$1 ? 1 : 0); + if(_r_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_add_channel); if(b[1][2] < (b[2] + to_read$1 | 0)) @@ -12237,10 +12910,10 @@ var already_read$0 = already_read + r | 0, ofs$0 = ofs + r | 0, - to_read$0 = to_read - r | 0, - already_read = already_read$0, - ofs = ofs$0, - to_read = to_read$0; + to_read$0 = to_read - r | 0; + already_read = already_read$0; + ofs = ofs$0; + to_read = to_read$0; continue; } } @@ -12256,284 +12929,285 @@ (Stdlib[68], oc, b[1][1], 0, b[2]); /*<>*/ } function add_substitute(b, f, s){ - /*<>*/ var + /*<>*/ var lim$1 = caml_ml_string_length(s), previous = 32, i$4 = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(i$4 >= lim$1){ var _o_ = 92 === previous ? 1 : 0; return _o_ ? add_char(b, previous) : _o_; } - /*<>*/ /*<>*/ var - previous$0 = /*<>*/ caml_string_get(s, i$4); - if(36 !== previous$0){ - /*<>*/ if(92 === previous){ - /*<>*/ add_char(b, 92); - /*<>*/ add_char(b, previous$0); - /*<>*/ var - /*<>*/ i$6 = i$4 + 1 | 0, - previous = 32, - i$4 = i$6; - continue; - } - if(92 === previous$0){ - /*<>*/ var - /*<>*/ i$7 = i$4 + 1 | 0, - previous = previous$0, - i$4 = i$7; - continue; - } - /*<>*/ add_char(b, previous$0); - /*<>*/ var - /*<>*/ i$8 = i$4 + 1 | 0, - previous = previous$0, - i$4 = i$8; - continue; - } - if(92 === previous){ - /*<>*/ add_char(b, previous$0); - /*<>*/ var - /*<>*/ i$5 = i$4 + 1 | 0, - previous = 32, + /*<>*/ /*<>*/ var + previous$0 = /*<>*/ caml_string_get(s, i$4); + if(36 === previous$0) + if(92 === previous){ + /*<>*/ add_char(b, previous$0); + /*<>*/ /*<>*/ var + i$5 = i$4 + 1 | 0; + previous = 32; i$4 = i$5; - continue; - } - /*<>*/ /*<>*/ var - start$0 = i$4 + 1 | 0; - if(lim$1 <= start$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[8], 1); - /*<>*/ var - /*<>*/ opening = - /*<>*/ caml_string_get(s, start$0), - switch$0 = 0; - if(40 !== opening && 123 !== opening){ - /*<>*/ var - /*<>*/ start = start$0 + 1 | 0, - lim$0 = caml_ml_string_length(s), - i$2 = start; - /*<>*/ for(;;){ - if(lim$0 <= i$2) - var stop$0 = lim$0; - else{ - /*<>*/ var - /*<>*/ match = - /*<>*/ caml_string_get(s, i$2), - switch$1 = 0; - if(91 <= match){ - if(97 <= match){ - if(123 > match) switch$1 = 1; - } - else if(95 === match) switch$1 = 1; - } - else - if(58 <= match){ - if(65 <= match) switch$1 = 1; - } - else if(48 <= match) switch$1 = 1; - if(switch$1){var i$3 = i$2 + 1 | 0, i$2 = i$3; continue;} - var stop$0 = i$2; - } - var - match$0 = - [0, - /*<>*/ caml_call3 - (Stdlib_String[15], s, start$0, stop$0 - start$0 | 0), - stop$0]; - switch$0 = 1; - break; } - } - if(! switch$0){ - /*<>*/ var - /*<>*/ new_start = start$0 + 1 | 0, - k$2 = 0; - if(40 === opening) - var closing = 41; else{ - if(123 !== opening) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _a_], 1); - var closing = 125; - } - var lim = caml_ml_string_length(s), k = k$2, stop = new_start; - /*<>*/ for(;;){ - if(lim <= stop) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[8], 1); - if( /*<>*/ caml_string_get(s, stop) === opening){ - var i = stop + 1 | 0, k$0 = k + 1 | 0, k = k$0, stop = i; - continue; + /*<>*/ /*<>*/ var + start = i$4 + 1 | 0; + /*<>*/ try{ + if(lim$1 <= start) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + /*<>*/ /*<>*/ var + opening = /*<>*/ caml_string_get(s, start); + a: + { + if(40 !== opening && 123 !== opening){ + var lim$0 = caml_ml_string_length(s); + b: + { + c: + { + d: + { + var i$2 = start; + /*<>*/ for(;;){ + if(lim$0 <= i$2) break c; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_string_get(s, i$2); + if(91 <= match){ + if(97 <= match){ + if(123 <= match) break d; + } + else if(95 !== match) break d; + } + else + if(58 <= match){ + if(65 > match) break; + } + else if(48 > match) break d; + var i$3 = i$2 + 1 | 0; + i$2 = i$3; + } + } + var stop$0 = i$2; + break b; + } + var stop$0 = lim$0; + } + if(stop$0 === start) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + var + val = + [0, + /*<>*/ caml_call3 + (Stdlib_String[16], s, start, stop$0 - start | 0), + stop$0]; + break a; + } + /*<>*/ var + /*<>*/ new_start = start + 1 | 0, + k$2 = 0; + if(40 === opening) + var closing = 41; + else{ + if(123 !== opening) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _a_], 1); + var closing = 125; + } + var lim = caml_ml_string_length(s), k = k$2, stop = new_start; + /*<>*/ for(;;){ + if(lim <= stop) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + if( /*<>*/ caml_string_get(s, stop) === opening){var i = stop + 1 | 0, k$0 = k + 1 | 0; k = k$0; stop = i;} + else if + ( /*<>*/ caml_string_get(s, stop) === closing){ + if(0 === k) break; + var i$0 = stop + 1 | 0, k$1 = k - 1 | 0; + k = k$1; + stop = i$0; + } + else{var i$1 = stop + 1 | 0; stop = i$1;} + } + var + val = + [0, + /*<>*/ caml_call3 + (Stdlib_String[16], s, new_start, (stop - start | 0) - 1 | 0), + stop + 1 | 0]; + } } - if( /*<>*/ caml_string_get(s, stop) !== closing){var i$1 = stop + 1 | 0, stop = i$1; continue;} - if(0 !== k){ - var i$0 = stop + 1 | 0, k$1 = k - 1 | 0, k = k$1, stop = i$0; + catch(_p_){ + var _n_ = caml_wrap_exception(_p_); + if(_n_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_n_, 0); + /*<>*/ add_char(b, 36); + previous = 32; + i$4 = start; continue; } - var - match$0 = - [0, - /*<>*/ caml_call3 - (Stdlib_String[15], s, new_start, (stop - start$0 | 0) - 1 | 0), - stop + 1 | 0]; - break; + var next_i = val[2], ident = val[1]; + /*<>*/ add_string + (b, /*<>*/ caml_call1(f, ident)); + previous = 32; + i$4 = next_i; } + else{ + if(92 === previous) /*<>*/ add_char(b, previous); + if(92 !== previous$0) /*<>*/ add_char(b, previous$0); + /*<>*/ /*<>*/ var + i$6 = i$4 + 1 | 0; + previous = previous$0; + i$4 = i$6; } - var next_i = match$0[2], ident = match$0[1]; - /*<>*/ add_string - (b, /*<>*/ caml_call1(f, ident)); - var previous = 32, i$4 = next_i; } - /*<>*/ } + /*<>*/ } function truncate(b, len){ - /*<>*/ if(0 <= len && b[2] >= len){b[2] = len; return 0;} - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 <= len && b[2] >= len){b[2] = len; return 0;} + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_truncate); - /*<>*/ } + /*<>*/ } function to_seq(b){ function aux(i, param){ - /*<>*/ if(b[2] <= i) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = - /*<>*/ caml_bytes_get(b[1][1], i), - /*<>*/ _m_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(b[2] <= i) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_bytes_get(b[1][1], i), + /*<>*/ _l_ = i + 1 | 0; + /*<>*/ return [0, x, - function(_n_){ /*<>*/ return aux(_m_, _n_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _k_ = 0; - /*<>*/ return function(_l_){ - /*<>*/ return aux(_k_, _l_);}; - /*<>*/ } + function(_m_){ /*<>*/ return aux(_l_, _m_);}]; + /*<>*/ } + /*<>*/ var _j_ = 0; + /*<>*/ return function(_k_){ + /*<>*/ return aux(_j_, _k_);}; + /*<>*/ } function to_seqi(b){ function aux(i, param){ - /*<>*/ if(b[2] <= i) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = - /*<>*/ caml_bytes_get(b[1][1], i), - /*<>*/ _i_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(b[2] <= i) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_bytes_get(b[1][1], i), + /*<>*/ _h_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], - function(_j_){ /*<>*/ return aux(_i_, _j_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _g_ = 0; - /*<>*/ return function(_h_){ - /*<>*/ return aux(_g_, _h_);}; - /*<>*/ } + function(_i_){ /*<>*/ return aux(_h_, _i_);}]; + /*<>*/ } + /*<>*/ var _f_ = 0; + /*<>*/ return function(_g_){ + /*<>*/ return aux(_f_, _g_);}; + /*<>*/ } function add_seq(b, seq){ - /*<>*/ function _e_(_f_){ - /*<>*/ return add_char(b, _f_); - } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _e_, seq); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(_e_){ /*<>*/ return add_char(b, _e_);}, + seq); + /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var b = create(32); - /*<>*/ add_seq(b, i); - /*<>*/ return b; - /*<>*/ } + /*<>*/ /*<>*/ var b = create(32); + /*<>*/ add_seq(b, i); + /*<>*/ return b; + /*<>*/ } function add_int8(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 1 | 0; + /*<>*/ new_position = position + 1 | 0; if(length < new_position){ - /*<>*/ resize(b, 1); - /*<>*/ /*<>*/ caml_bytes_set + /*<>*/ resize(b, 1); + /*<>*/ /*<>*/ caml_bytes_set (b[1][1], b[2], x); } else caml_bytes_unsafe_set(buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int16_ne(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 2 | 0; + /*<>*/ new_position = position + 2 | 0; if(length < new_position){ - /*<>*/ resize(b, 2); - /*<>*/ /*<>*/ caml_bytes_set16 + /*<>*/ resize(b, 2); + /*<>*/ /*<>*/ caml_bytes_set16 (b[1][1], b[2], x); } else - /*<>*/ /*<>*/ caml_bytes_set16 + /*<>*/ /*<>*/ caml_bytes_set16 (buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int32_ne(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 4 | 0; + /*<>*/ new_position = position + 4 | 0; if(length < new_position){ - /*<>*/ resize(b, 4); - /*<>*/ /*<>*/ caml_bytes_set32 + /*<>*/ resize(b, 4); + /*<>*/ /*<>*/ caml_bytes_set32 (b[1][1], b[2], x); } else - /*<>*/ /*<>*/ caml_bytes_set32 + /*<>*/ /*<>*/ caml_bytes_set32 (buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int64_ne(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 8 | 0; + /*<>*/ new_position = position + 8 | 0; if(length < new_position){ - /*<>*/ resize(b, 8); - /*<>*/ /*<>*/ caml_bytes_set64 + /*<>*/ resize(b, 8); + /*<>*/ /*<>*/ caml_bytes_set64 (b[1][1], b[2], x); } else - /*<>*/ /*<>*/ caml_bytes_set64 + /*<>*/ /*<>*/ caml_bytes_set64 (buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int16_le(b, x){ - /*<>*/ var _d_ = Stdlib_Sys[11] ? caml_bswap16(x) : x; + /*<>*/ var _d_ = Stdlib_Sys[11] ? caml_bswap16(x) : x; return add_int16_ne(b, _d_); - /*<>*/ } + /*<>*/ } function add_int16_be(b, x){ - /*<>*/ var x$0 = Stdlib_Sys[11] ? x : caml_bswap16(x); - /*<>*/ return add_int16_ne(b, x$0); - /*<>*/ } + /*<>*/ var x$0 = Stdlib_Sys[11] ? x : caml_bswap16(x); + /*<>*/ return add_int16_ne(b, x$0); + /*<>*/ } function add_int32_le(b, x){ - /*<>*/ var - _c_ = Stdlib_Sys[11] ? /*<>*/ caml_int32_bswap(x) : x; - /*<>*/ return add_int32_ne(b, _c_); - /*<>*/ } + /*<>*/ var + _c_ = Stdlib_Sys[11] ? /*<>*/ caml_int32_bswap(x) : x; + /*<>*/ return add_int32_ne(b, _c_); + /*<>*/ } function add_int32_be(b, x){ - /*<>*/ var - x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int32_bswap(x); - /*<>*/ return add_int32_ne(b, x$0); - /*<>*/ } + /*<>*/ var + x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int32_bswap(x); + /*<>*/ return add_int32_ne(b, x$0); + /*<>*/ } function add_int64_le(b, x){ - /*<>*/ var - _b_ = Stdlib_Sys[11] ? /*<>*/ caml_int64_bswap(x) : x; - /*<>*/ return add_int64_ne(b, _b_); - /*<>*/ } + /*<>*/ var + _b_ = Stdlib_Sys[11] ? /*<>*/ caml_int64_bswap(x) : x; + /*<>*/ return add_int64_ne(b, _b_); + /*<>*/ } function add_int64_be(b, x){ - /*<>*/ var - x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int64_bswap(x); - /*<>*/ return add_int64_ne(b, x$0); - /*<>*/ } + /*<>*/ var + x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int64_bswap(x); + /*<>*/ return add_int64_ne(b, x$0); + /*<>*/ } var Stdlib_Buffer = [0, @@ -12587,12 +13261,38 @@ "use strict"; var runtime = globalThis.jsoo_runtime, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_mutex_lock = runtime.caml_ml_mutex_lock, + caml_ml_mutex_unlock = runtime.caml_ml_mutex_unlock, + caml_wrap_exception = runtime.caml_wrap_exception; + /*<>*/ function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function protect(m, f){ + /*<>*/ /*<>*/ caml_ml_mutex_lock(m); + /*<>*/ try{ + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call1(f, 0); + } + catch(e$0){ + var e = caml_wrap_exception(e$0); + /*<>*/ /*<>*/ caml_ml_mutex_unlock(m); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (e, 0); + } + /*<>*/ /*<>*/ caml_ml_mutex_unlock(m); + /*<>*/ return x; + /*<>*/ } + var Stdlib_Mutex = [0, runtime.caml_ml_mutex_new, - runtime.caml_ml_mutex_lock, + caml_ml_mutex_lock, runtime.caml_ml_mutex_try_lock, - runtime.caml_ml_mutex_unlock]; + caml_ml_mutex_unlock, + protect]; runtime.caml_register_global(0, Stdlib_Mutex, "Stdlib__Mutex"); return; /*<>*/ } @@ -12637,9 +13337,9 @@ Stdlib_Mutex = global_data.Stdlib__Mutex, Stdlib_Condition = global_data.Stdlib__Condition, Stdlib = global_data.Stdlib, - cst_Semaphore_Counting_release = "Semaphore.Counting.release: overflow", cst_Semaphore_Counting_init_wr = - "Semaphore.Counting.init: wrong initial value"; + "Semaphore.Counting.init: wrong initial value", + cst_Semaphore_Counting_release = "Semaphore.Counting.release: overflow"; function make(v){ /*<>*/ if(v < 0) /*<>*/ /*<>*/ caml_call1 @@ -12669,13 +13369,12 @@ /*<>*/ /*<>*/ caml_call1 (Stdlib_Mutex[2], s[1]); /*<>*/ for(;;){ - if(0 === s[2]){ - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Condition[2], s[3], s[1]); - continue; + if(0 !== s[2]){ + s[2] = s[2] - 1 | 0; + return caml_call1(Stdlib_Mutex[4], s[1]); } - s[2] = s[2] - 1 | 0; - return caml_call1(Stdlib_Mutex[4], s[1]); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Condition[2], s[3], s[1]); } /*<>*/ } function try_acquire(s){ @@ -12713,13 +13412,9 @@ /*<>*/ /*<>*/ caml_call1 (Stdlib_Mutex[2], s[1]); /*<>*/ for(;;){ - if(0 === s[2]){ - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Condition[2], s[3], s[1]); - continue; - } - s[2] = 0; - return caml_call1(Stdlib_Mutex[4], s[1]); + if(0 !== s[2]){s[2] = 0; return caml_call1(Stdlib_Mutex[4], s[1]);} + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Condition[2], s[3], s[1]); } /*<>*/ } function try_acquire$0(s){ @@ -12747,7 +13442,7 @@ var runtime = globalThis.jsoo_runtime, caml_check_bound = runtime.caml_check_bound, - caml_domain_dls_set = runtime.caml_domain_dls_set, + caml_domain_dls_get = runtime.caml_domain_dls_get, caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_domain_id = runtime.caml_ml_domain_id, @@ -12773,260 +13468,250 @@ : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), - Stdlib_Mutex = global_data.Stdlib__Mutex, Stdlib_Condition = global_data.Stdlib__Condition, - Stdlib = global_data.Stdlib, + Stdlib_Mutex = global_data.Stdlib__Mutex, Stdlib_Atomic = global_data.Stdlib__Atomic, - Stdlib_List = global_data.Stdlib__List, + Stdlib = global_data.Stdlib, Stdlib_Array = global_data.Stdlib__Array, - cst_internal_error_Am_I_alread = "internal error: Am I already finished?", - cst_first_domain_already_spawn = "first domain already spawned"; + Stdlib_List = global_data.Stdlib__List, + Assert_failure = global_data.Assert_failure; function cpu_relax(param){ - /*<>*/ return /*<>*/ runtime.caml_ml_domain_cpu_relax + /*<>*/ return /*<>*/ runtime.caml_ml_domain_cpu_relax (0); - /*<>*/ } - /*<>*/ /*<>*/ var - unique_value = [0, 0]; + /*<>*/ } + /*<>*/ /*<>*/ var none = [0, 0]; function create_dls(param){ - /*<>*/ /*<>*/ var - st = /*<>*/ caml_make_vect(8, unique_value); - /*<>*/ return /*<>*/ caml_domain_dls_set - (st); - /*<>*/ } - /*<>*/ create_dls(0); - /*<>*/ var - /*<>*/ key_counter = - /*<>*/ caml_call1(Stdlib_Atomic[1], 0), - /*<>*/ parent_keys = - /*<>*/ caml_call1(Stdlib_Atomic[1], 0); + /*<>*/ /*<>*/ var + st = /*<>*/ caml_make_vect(8, none); + /*<>*/ /*<>*/ runtime.caml_domain_dls_set + (st); + /*<>*/ return; + /*<>*/ } + /*<>*/ create_dls(0); + /*<>*/ var + /*<>*/ key_counter = + /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + /*<>*/ parent_keys = + /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + _a_ = [0, "domain.ml", 184, 13]; function new_key(split_from_parent, init_orphan){ - /*<>*/ var - /*<>*/ idx = - /*<>*/ caml_call2(Stdlib_Atomic[6], key_counter, 1), - /*<>*/ k = [0, idx, init_orphan]; - /*<>*/ if(split_from_parent){ - /*<>*/ var + /*<>*/ var + /*<>*/ idx = + /*<>*/ caml_call2(Stdlib_Atomic[7], key_counter, 1), + /*<>*/ k = [0, idx, init_orphan]; + /*<>*/ if(split_from_parent){ + /*<>*/ var split = split_from_parent[1], - /*<>*/ ki = [0, k, split]; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - l = /*<>*/ caml_call1(Stdlib_Atomic[2], parent_keys); + /*<>*/ ki = [0, k, split]; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + l = /*<>*/ caml_call1(Stdlib_Atomic[3], parent_keys); if - (1 + (! + (1 - - /*<>*/ caml_call3 - (Stdlib_Atomic[5], parent_keys, l, [0, ki, l])) - continue; - break; + /*<>*/ caml_call3 + (Stdlib_Atomic[6], parent_keys, l, [0, ki, l]))) + break; } } - /*<>*/ return k; - /*<>*/ } + /*<>*/ return k; + /*<>*/ } function maybe_grow(idx){ - /*<>*/ var - st = runtime.caml_domain_dls_get(0), - /*<>*/ sz = st.length - 1; - if(idx < sz) /*<>*/ return st; - var new_sz = sz; - /*<>*/ for(;;){ - if(idx < new_sz){ - /*<>*/ /*<>*/ var - new_st = /*<>*/ caml_make_vect(new_sz, unique_value); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], st, 0, new_st, 0, sz); - /*<>*/ /*<>*/ caml_domain_dls_set - (new_st); - /*<>*/ return new_st; - } - var s = 2 * new_sz | 0, new_sz = s; - } - /*<>*/ } + /*<>*/ for(;;){ + /*<>*/ var + st = caml_domain_dls_get(0), + /*<>*/ sz = st.length - 1; + if(idx < sz) /*<>*/ return st; + var new_sz = sz; + /*<>*/ for(;;){ + if(idx < new_sz) break; + var s = 2 * new_sz | 0; + new_sz = s; + } + /*<>*/ /*<>*/ var + new_st = /*<>*/ caml_make_vect(new_sz, none); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], st, 0, new_st, 0, sz); + /*<>*/ if + ( /*<>*/ runtime.caml_domain_dls_compare_and_set + (st, new_st)) + /*<>*/ return new_st; + } + /*<>*/ } function set(param, x){ - /*<>*/ var + /*<>*/ var idx = param[1], - /*<>*/ st = maybe_grow(idx); - /*<>*/ caml_check_bound(st, idx)[1 + idx] = x; - /*<>*/ return 0; + /*<>*/ st = maybe_grow(idx); + /*<>*/ caml_check_bound(st, idx)[1 + idx] = x; + /*<>*/ return 0; } function get(param){ - /*<>*/ var + /*<>*/ var init = param[2], idx = param[1], - /*<>*/ st = maybe_grow(idx), - /*<>*/ v = caml_check_bound(st, idx)[1 + idx]; - if(v !== unique_value) /*<>*/ return v; - /*<>*/ /*<>*/ var - v$0 = /*<>*/ caml_call1(init, 0); - /*<>*/ caml_check_bound(st, idx)[1 + idx] = v$0; - /*<>*/ return v$0; + /*<>*/ st = maybe_grow(idx), + /*<>*/ oldval = caml_check_bound(st, idx)[1 + idx]; + /*<>*/ if(oldval !== none) + /*<>*/ return oldval; + /*<>*/ var + /*<>*/ new_obj = + /*<>*/ caml_call1(init, 0), + /*<>*/ st$0 = + /*<>*/ caml_domain_dls_get(0), + /*<>*/ curval = caml_check_bound(st$0, idx)[1 + idx], + _e_ = curval === oldval ? (st$0[1 + idx] = new_obj, 1) : 0; + /*<>*/ if(_e_) /*<>*/ return new_obj; + /*<>*/ /*<>*/ var + updated_obj = caml_check_bound(st$0, idx)[1 + idx]; + /*<>*/ if(updated_obj !== none) + /*<>*/ return updated_obj; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _a_], 1); } function get_id(param){ var domain = param[1]; - /*<>*/ return domain; + /*<>*/ return domain; } function self(param){ - /*<>*/ return /*<>*/ caml_ml_domain_id + /*<>*/ return /*<>*/ caml_ml_domain_id (0); - /*<>*/ } + /*<>*/ } function is_main_domain(param){ - /*<>*/ return 0 - === /*<>*/ caml_ml_domain_id(0) + /*<>*/ return 0 + === /*<>*/ caml_ml_domain_id(0) ? 1 : 0; - /*<>*/ } - /*<>*/ var - /*<>*/ first_domain_spawned = - /*<>*/ caml_call1(Stdlib_Atomic[1], 0), - /*<>*/ first_spawn_function = + /*<>*/ } + /*<>*/ var + /*<>*/ first_domain_spawned = + /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + /*<>*/ first_spawn_function = [0, function(param){ - /*<>*/ return 0; - /*<>*/ }]; + /*<>*/ return; + /*<>*/ }], + cst_first_domain_already_spawn = "first domain already spawned"; function before_first_spawn(f){ - /*<>*/ if - ( /*<>*/ caml_call1 - (Stdlib_Atomic[2], first_domain_spawned)) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if + ( /*<>*/ caml_call1 + (Stdlib_Atomic[3], first_domain_spawned)) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Stdlib[6], cst_first_domain_already_spawn], 1); var old_f = first_spawn_function[1]; function new_f(param){ - /*<>*/ /*<>*/ caml_call1(old_f, 0); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1(old_f, 0); + /*<>*/ return /*<>*/ caml_call1 (f, 0); - /*<>*/ } + /*<>*/ } first_spawn_function[1] = new_f; return 0; - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var at_exit_key = new_key (0, - function(param, _e_){ - /*<>*/ return 0; - /*<>*/ }); + function(param){ + /*<>*/ return function(param){ + /*<>*/ return 0; /*<>*/ }; + /*<>*/ }); function at_exit(f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var old_exit = get(at_exit_key); function new_exit(param){ - /*<>*/ /*<>*/ caml_call1(f, 0); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1(f, 0); + /*<>*/ return /*<>*/ caml_call1 (old_exit, 0); - /*<>*/ } - /*<>*/ return set(at_exit_key, new_exit); - /*<>*/ } + /*<>*/ } + /*<>*/ return set(at_exit_key, new_exit); + /*<>*/ } function do_at_exit(param){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var f = get(at_exit_key); - /*<>*/ return /*<>*/ caml_call1(f, 0); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call1(f, 0); + /*<>*/ } Stdlib[104][1] = do_at_exit; function spawn(f){ - /*<>*/ if + /*<>*/ if (1 - - /*<>*/ caml_call1 - (Stdlib_Atomic[2], first_domain_spawned)){ - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Atomic[3], first_domain_spawned, 1); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ caml_call1 + (Stdlib_Atomic[3], first_domain_spawned)){ + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Atomic[4], first_domain_spawned, 1); + /*<>*/ /*<>*/ caml_call1 (first_spawn_function[1], 0); first_spawn_function[1] = function(param){ - /*<>*/ return 0; - /*<>*/ }; - } - /*<>*/ /*<>*/ var - _a_ = /*<>*/ caml_call1(Stdlib_Atomic[2], parent_keys); - function _b_(param){ - /*<>*/ var split = param[2], k = param[1], idx = k[1]; - /*<>*/ return [0, - idx, - /*<>*/ caml_call1(split, get(k))]; - /*<>*/ } - /*<>*/ var - /*<>*/ pk = - /*<>*/ caml_call2(Stdlib_List[19], _b_, _a_), - /*<>*/ term_mutex = - /*<>*/ caml_call1(Stdlib_Mutex[1], 0), - /*<>*/ term_condition = - /*<>*/ caml_call1(Stdlib_Condition[1], 0), - /*<>*/ term_state = [0, 0]; - function body(param){ - /*<>*/ var switch$0 = 0; - /*<>*/ try{ - /*<>*/ create_dls(0); - var - _c_ = + /*<>*/ return 0; + /*<>*/ }; + } + /*<>*/ var + /*<>*/ _b_ = + /*<>*/ caml_call1(Stdlib_Atomic[3], parent_keys), + /*<>*/ pk = + /*<>*/ caml_call2 + (Stdlib_List[20], function(param){ - /*<>*/ var - v = param[2], - idx = param[1], - /*<>*/ st = maybe_grow(idx); - /*<>*/ caml_check_bound(st, idx)[1 + idx] = v; - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ /*<>*/ caml_call2 - (Stdlib_List[17], _c_, pk); - /*<>*/ /*<>*/ var - res = /*<>*/ caml_call1(f, 0); - } - catch(ex$0){ - var ex = caml_wrap_exception(ex$0), result = [1, ex]; - switch$0 = 1; - } - if(! switch$0) var result = [0, res]; - /*<>*/ try{ - /*<>*/ do_at_exit(0); - var result$0 = result; - } - catch(ex){ - /*<>*/ var - ex$0 = caml_wrap_exception(ex), - /*<>*/ _d_ = 0 === result[0] ? [1, ex$0] : result, - result$0 = _d_; - } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Mutex[2], term_mutex); - return term_state[1] - ? /*<>*/ caml_call1 - (Stdlib[2], cst_internal_error_Am_I_alread) - : (term_state - [1] - = [0, result$0], - /*<>*/ caml_call1 - (Stdlib_Condition[4], term_condition)); - /*<>*/ } - /*<>*/ return [0, - /*<>*/ runtime.caml_domain_spawn - (body, term_mutex), - term_mutex, - term_condition, - term_state]; - /*<>*/ } - function join(param){ - var - term_state = param[4], - term_condition = param[3], - term_mutex = param[2]; - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Mutex[2], term_mutex); - /*<>*/ for(;;){ - var match = term_state[1]; - if(! match){ - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Condition[2], term_condition, term_mutex); - continue; + /*<>*/ var split = param[2], k = param[1]; + /*<>*/ return [0, + k, + /*<>*/ caml_call1(split, get(k))]; + /*<>*/ }, + _b_), + /*<>*/ _c_ = + /*<>*/ caml_call1(Stdlib_Condition[1], 0), + /*<>*/ term_sync = + [0, 0, /*<>*/ caml_call1(Stdlib_Mutex[1], 0), _c_]; + function body(param){ + /*<>*/ try{ + /*<>*/ create_dls(0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_List[18], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return set(k, v); + /*<>*/ }, + pk); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_call1(f, 0); } - var res = match[1]; - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Mutex[4], term_mutex); - if(0 === res[0]){var x = res[1]; /*<>*/ return x;} - var ex = res[1]; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (ex, 1); - } - } + catch(exn$0){ + var exn = caml_wrap_exception(exn$0); + /*<>*/ try{ /*<>*/ do_at_exit(0);} + catch(_d_){} + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (exn, 0); + } + /*<>*/ do_at_exit(0); + /*<>*/ return res; + /*<>*/ } + /*<>*/ /*<>*/ var + domain = + /*<>*/ runtime.caml_domain_spawn(body, term_sync); + /*<>*/ return [0, domain, term_sync]; + /*<>*/ } + function join(param){ + var term_sync = param[2]; + /*<>*/ function loop(param){ + /*<>*/ for(;;){ + var match = term_sync[1]; + if(match){var res = match[1]; /*<>*/ return res;} + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Condition[2], term_sync[3], term_sync[2]); + } + /*<>*/ } + /*<>*/ /*<>*/ var + match = + /*<>*/ caml_call2 + (Stdlib_Mutex[5], term_sync[2], loop); + if(0 === match[0]){var x = match[1]; /*<>*/ return x;} + var ex = match[1]; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (ex, 1); + } var recommended_domain_count = runtime.caml_recommended_domain_count, Stdlib_Domain = @@ -13041,13 +13726,13 @@ is_main_domain, recommended_domain_count, [0, new_key, get, set]]; - runtime.caml_register_global(8, Stdlib_Domain, "Stdlib__Domain"); + runtime.caml_register_global(9, Stdlib_Domain, "Stdlib__Domain"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: CamlinternalFormat -//# unitInfo: Requires: Assert_failure, CamlinternalFormatBasics, Stdlib, Stdlib__Buffer, Stdlib__Bytes, Stdlib__Char, Stdlib__Int, Stdlib__String, Stdlib__Sys +//# unitInfo: Requires: CamlinternalFormatBasics, Stdlib, Stdlib__Buffer, Stdlib__Bytes, Stdlib__Char, Stdlib__Int, Stdlib__String, Stdlib__Sys (function (globalThis){ "use strict"; @@ -13085,7 +13770,6 @@ caml_ml_string_length = runtime.caml_ml_string_length, caml_notequal = runtime.caml_notequal, caml_string_get = runtime.caml_string_get, - caml_string_notequal = runtime.caml_string_notequal, caml_string_unsafe_get = runtime.caml_string_unsafe_get, caml_trampoline = runtime.caml_trampoline, caml_trampoline_return = runtime.caml_trampoline_return, @@ -13116,6 +13800,7 @@ : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), cst$9 = "%{", cst$10 = "%}", @@ -13143,6 +13828,7 @@ cst$33 = cst$40, cst$34 = cst$42, cst$36 = cst$40, + cst_unexpected_end_of_format = "unexpected end of format", cst$17 = ".", cst$14 = "%!", cst$15 = cst$37, @@ -13166,6 +13852,7 @@ Stdlib_Char = global_data.Stdlib__Char, Stdlib_Bytes = global_data.Stdlib__Bytes, Stdlib_Int = global_data.Stdlib__Int, + _a_ = [0, 0, 0], cst_c = "%c", cst_s = "%s", cst_i = cst_i$3, @@ -13178,262 +13865,23 @@ cst_t = "%t", cst_r = "%r", cst_r$0 = "%_r", + cst_0c = "0c", _b_ = [0, cst_camlinternalFormat_ml, 850, 23], - _m_ = [0, cst_camlinternalFormat_ml, 814, 21], + _c_ = [0, cst_camlinternalFormat_ml, 837, 26], + _d_ = [0, cst_camlinternalFormat_ml, 847, 28], _e_ = [0, cst_camlinternalFormat_ml, 815, 21], - _n_ = [0, cst_camlinternalFormat_ml, 818, 21], _f_ = [0, cst_camlinternalFormat_ml, 819, 21], - _o_ = [0, cst_camlinternalFormat_ml, 822, 19], _g_ = [0, cst_camlinternalFormat_ml, 823, 19], - _p_ = [0, cst_camlinternalFormat_ml, 826, 22], _h_ = [0, cst_camlinternalFormat_ml, 827, 22], - _q_ = [0, cst_camlinternalFormat_ml, 831, 30], _i_ = [0, cst_camlinternalFormat_ml, 832, 30], + _j_ = [0, cst_camlinternalFormat_ml, 851, 23], _k_ = [0, cst_camlinternalFormat_ml, 836, 26], - _c_ = [0, cst_camlinternalFormat_ml, 837, 26], _l_ = [0, cst_camlinternalFormat_ml, 846, 28], - _d_ = [0, cst_camlinternalFormat_ml, 847, 28], - _j_ = [0, cst_camlinternalFormat_ml, 851, 23], - _s_ = [0, cst_camlinternalFormat_ml, 1558, 4], - cst_Printf_bad_conversion = "Printf: bad conversion %[", - _t_ = [0, cst_camlinternalFormat_ml, 1626, 39], - _u_ = [0, cst_camlinternalFormat_ml, 1649, 31], - _v_ = [0, cst_camlinternalFormat_ml, 1650, 31], - cst_Printf_bad_conversion$0 = "Printf: bad conversion %_", - _w_ = [0, cst_camlinternalFormat_ml, 1830, 8], - ___ = - [0, - [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]], - cst_bad_input_format_type_mism$0], - _Z_ = - [0, - [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]], - cst_bad_input_format_type_mism$0], - _C_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - cst_at_character_number, - [4, 0, 0, 0, [11, ", duplicate flag ", [1, 0]]]]]], - "invalid format %S: at character number %d, duplicate flag %C"], - cst_0 = cst_0$3, - cst_padding = "padding", - _D_ = [0, 1, 0], - _E_ = [0, 0], - cst_precision = cst_precision$3, - _F_ = [1, 0], - _G_ = [1, 1], - cst_0$2 = "'0'", - cst_0$0 = cst_0$3, - _I_ = [1, 1], - cst_0$1 = cst_0$3, - cst_precision$0 = cst_precision$3, - _H_ = [1, 1], - cst_precision$1 = cst_precision$3, - _M_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - cst_at_character_number, - [4, - 0, - 0, - 0, - [11, - ", flag ", - [1, - [11, - " is only allowed after the '", - [12, 37, [11, "', before padding and precision", 0]]]]]]]]], - "invalid format %S: at character number %d, flag %C is only allowed after the '%%', before padding and precision"], - _J_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - cst_at_character_number, - [4, - 0, - 0, - 0, - [11, ', invalid conversion "', [12, 37, [0, [12, 34, 0]]]]]]]], - 'invalid format %S: at character number %d, invalid conversion "%%%c"'], - _K_ = [0, 0], - cst_padding$0 = "`padding'", - _L_ = [0, 0], - cst_precision$2 = "`precision'", - _N_ = [0, [12, 64, 0]], - _O_ = [0, "@ ", 1, 0], - _P_ = [0, "@,", 0, 0], - _Q_ = [2, 60], - _R_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - ": '", - [12, - 37, - [11, - "' alone is not accepted in character sets, use ", - [12, - 37, - [12, - 37, - [11, " instead at position ", [4, 0, 0, 0, [12, 46, 0]]]]]]]]]], - "invalid format %S: '%%' alone is not accepted in character sets, use %%%% instead at position %d."], - _S_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - ": integer ", - [4, 0, 0, 0, [11, " is greater than the limit ", [4, 0, 0, 0, 0]]]]]], - "invalid format %S: integer %d is greater than the limit %d"], - cst_digit = "digit", - _T_ = [0, cst_camlinternalFormat_ml, 2837, 11], - _U_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - ': unclosed sub-format, expected "', - [12, 37, [0, [11, '" at character number ', [4, 0, 0, 0, 0]]]]]]], - 'invalid format %S: unclosed sub-format, expected "%%%c" at character number %d'], - cst_character = "character ')'", - cst_character$0 = "character '}'", - _V_ = [0, cst_camlinternalFormat_ml, 2899, 34], - _W_ = [0, cst_camlinternalFormat_ml, 2935, 28], - _X_ = [0, cst_camlinternalFormat_ml, 2957, 11], - _Y_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - cst_at_character_number, - [4, - 0, - 0, - 0, - [11, - cst$44, - [2, - 0, - [11, - " is incompatible with '", - [0, [11, "' in sub-format ", [3, 0, 0]]]]]]]]]], - "invalid format %S: at character number %d, %s is incompatible with '%c' in sub-format %S"], - _B_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - cst_at_character_number, - [4, 0, 0, 0, [11, cst$44, [2, 0, [11, " expected, read ", [1, 0]]]]]]]], - "invalid format %S: at character number %d, %s expected, read %C"], - _A_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, - cst_at_character_number, - [4, 0, 0, 0, [11, ", '", [0, [11, "' without ", [2, 0, 0]]]]]]]], - "invalid format %S: at character number %d, '%c' without %s"], - cst_non_zero_widths_are_unsupp = - "non-zero widths are unsupported for %c conversions", - cst_unexpected_end_of_format = "unexpected end of format", - _z_ = - [0, - [11, - cst_invalid_format, - [3, - 0, - [11, cst_at_character_number, [4, 0, 0, 0, [11, cst$44, [2, 0, 0]]]]]], - "invalid format %S: at character number %d, %s"], - _y_ = - [0, - [11, "invalid box description ", [3, 0, 0]], - "invalid box description %S"], - _x_ = [0, 0, 4], - cst_nan = "nan", - cst_neg_infinity = "neg_infinity", - cst_infinity = "infinity", - _r_ = [0, 103], - cst_nd$0 = "%+nd", - cst_nd$1 = "% nd", - cst_ni$1 = "%+ni", - cst_ni$2 = "% ni", - cst_nx = "%nx", - cst_nx$0 = "%#nx", - cst_nX = "%nX", - cst_nX$0 = "%#nX", - cst_no = "%no", - cst_no$0 = "%#no", - cst_nd = "%nd", - cst_ni$0 = cst_ni$3, - cst_nu = "%nu", - cst_ld$0 = "%+ld", - cst_ld$1 = "% ld", - cst_li$1 = "%+li", - cst_li$2 = "% li", - cst_lx = "%lx", - cst_lx$0 = "%#lx", - cst_lX = "%lX", - cst_lX$0 = "%#lX", - cst_lo = "%lo", - cst_lo$0 = "%#lo", - cst_ld = "%ld", - cst_li$0 = cst_li$3, - cst_lu = "%lu", - cst_Ld$0 = "%+Ld", - cst_Ld$1 = "% Ld", - cst_Li$1 = "%+Li", - cst_Li$2 = "% Li", - cst_Lx = "%Lx", - cst_Lx$0 = "%#Lx", - cst_LX = "%LX", - cst_LX$0 = "%#LX", - cst_Lo = "%Lo", - cst_Lo$0 = "%#Lo", - cst_Ld = "%Ld", - cst_Li$0 = cst_Li$3, - cst_Lu = "%Lu", - cst_d$0 = "%+d", - cst_d$1 = "% d", - cst_i$1 = "%+i", - cst_i$2 = "% i", - cst_x = "%x", - cst_x$0 = "%#x", - cst_X = "%X", - cst_X$0 = "%#X", - cst_o = "%o", - cst_o$0 = "%#o", - cst_d = "%d", - cst_i$0 = cst_i$3, - cst_u = cst_u$0, - cst_0c = "0c", - _a_ = [0, 0, 0], - cst_CamlinternalFormat_Type_mi = "CamlinternalFormat.Type_mismatch"; + _m_ = [0, cst_camlinternalFormat_ml, 814, 21], + _n_ = [0, cst_camlinternalFormat_ml, 818, 21], + _o_ = [0, cst_camlinternalFormat_ml, 822, 19], + _p_ = [0, cst_camlinternalFormat_ml, 826, 22], + _q_ = [0, cst_camlinternalFormat_ml, 831, 30]; function create_char_set(param){ /*<>*/ return /*<>*/ caml_call2 (Stdlib_Bytes[1], 32, 0); @@ -13442,14 +13890,14 @@ /*<>*/ var str_ind = c >>> 3 | 0, mask = 1 << (c & 7), - /*<>*/ _dU_ = + /*<>*/ _cU_ = /*<>*/ runtime.caml_bytes_get (char_set, str_ind) | mask; /*<>*/ return /*<>*/ caml_bytes_set (char_set, str_ind, - /*<>*/ caml_call1(Stdlib[29], _dU_)); + /*<>*/ caml_call1(Stdlib[29], _cU_)); /*<>*/ } function freeze_char_set(char_set){ /*<>*/ return /*<>*/ caml_call1 @@ -13461,19 +13909,19 @@ i = 0; for(;;){ /*<>*/ /*<>*/ var - _dS_ = + _cS_ = /*<>*/ caml_string_get(char_set, i) ^ 255; /*<>*/ /*<>*/ caml_bytes_set (char_set$0, i, - /*<>*/ caml_call1(Stdlib[29], _dS_)); + /*<>*/ caml_call1(Stdlib[29], _cS_)); /*<>*/ /*<>*/ var - _dT_ = i + 1 | 0; + _cT_ = i + 1 | 0; if(31 === i) /*<>*/ return /*<>*/ caml_call1 (Stdlib_Bytes[44], char_set$0); - var i = _dT_; + i = _cT_; } /*<>*/ } function is_in_char_set(char_set, c){ @@ -13533,11 +13981,11 @@ case 6: var prec_opt = ign[2], pad_opt$5 = ign[1]; if(prec_opt) - var ndec = prec_opt[1], _dR_ = [0, ndec]; + var ndec = prec_opt[1], _cR_ = [0, ndec]; else - var _dR_ = 0; + var _cR_ = 0; /*<>*/ return [0, - [8, _a_, pad_of_pad_opt(pad_opt$5), _dR_, fmt]]; + [8, _a_, pad_of_pad_opt(pad_opt$5), _cR_, fmt]]; case 7: var pad_opt$6 = ign[1]; /*<>*/ return [0, @@ -13570,9 +14018,8 @@ function buffer_check_size(buf, overhead){ /*<>*/ var len = runtime.caml_ml_bytes_length(buf[2]), - min_len = buf[1] + overhead | 0, - _dP_ = len < min_len ? 1 : 0; - if(_dP_){ + min_len = buf[1] + overhead | 0; + if(len < min_len){ /*<>*/ var /*<>*/ new_len = /*<>*/ caml_call2 @@ -13582,27 +14029,24 @@ /*<>*/ /*<>*/ caml_call5 (Stdlib_Bytes[11], buf[2], 0, new_str, 0, len); buf[2] = new_str; - var _dQ_ = 0; } - else - var _dQ_ = _dP_; - return _dQ_; + return; /*<>*/ } function buffer_add_char(buf, c){ /*<>*/ buffer_check_size(buf, 1); /*<>*/ /*<>*/ caml_bytes_set (buf[2], buf[1], c); buf[1] = buf[1] + 1 | 0; - return 0; + return; /*<>*/ } function buffer_add_string(buf, s){ /*<>*/ var str_len = caml_ml_string_length(s); /*<>*/ buffer_check_size(buf, str_len); /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], s, 0, buf[2], buf[1], str_len); + (Stdlib_String[6], s, 0, buf[2], buf[1], str_len); buf[1] = buf[1] + str_len | 0; - return 0; + return; /*<>*/ } function buffer_contents(buf){ /*<>*/ return caml_call3 @@ -13631,10 +14075,7 @@ } /*<>*/ } function char_of_fconv(opt, fconv){ - /*<>*/ if(opt) - var sth = opt[1], cF = sth; - else - var cF = 70; + var cF = opt ? opt[1] : 70; switch(fconv[2]){ case 0: /*<>*/ return 102; @@ -13654,13 +14095,13 @@ /*<>*/ return 72; default: /*<>*/ return 70; } - /*<>*/ } + } function bprint_padty(buf, padty){ /*<>*/ switch(padty){ case 0: /*<>*/ return buffer_add_char(buf, 45); case 1: - /*<>*/ return 0; + /*<>*/ return; default: /*<>*/ return buffer_add_char(buf, 48); } @@ -13672,7 +14113,7 @@ /*<>*/ } function bprint_pad_opt(buf, pad_opt){ /*<>*/ if(! pad_opt) - /*<>*/ return 0; + /*<>*/ return; var width = pad_opt[1]; /*<>*/ return buffer_add_string (buf, @@ -13681,7 +14122,7 @@ /*<>*/ } function bprint_padding(buf, pad){ /*<>*/ if(typeof pad === "number") - /*<>*/ return 0; + /*<>*/ return; if(0 === pad[0]){ var n = pad[2], padty = pad[1]; /*<>*/ bprint_padty(buf, padty); @@ -13695,14 +14136,17 @@ /*<>*/ return buffer_add_char(buf, 42); /*<>*/ } function bprint_precision(buf, prec){ - /*<>*/ if(typeof prec === "number") - return prec ? buffer_add_string(buf, cst) : 0; - var n = prec[1]; - /*<>*/ buffer_add_char(buf, 46); - /*<>*/ return buffer_add_string - (buf, - /*<>*/ caml_call1 - (Stdlib_Int[12], n)); + /*<>*/ if(typeof prec !== "number"){ + var n = prec[1]; + /*<>*/ buffer_add_char(buf, 46); + /*<>*/ return buffer_add_string + (buf, + /*<>*/ caml_call1 + (Stdlib_Int[12], n)); + } + if(prec) + /*<>*/ return buffer_add_string(buf, cst); + /*<>*/ return; /*<>*/ } function bprint_iconv_flag(buf, iconv){ /*<>*/ switch(iconv){ @@ -13719,7 +14163,7 @@ case 14: case 15: /*<>*/ return buffer_add_char(buf, 35); - default: /*<>*/ return 0; + default: /*<>*/ return; } /*<>*/ } function bprint_altint_fmt(buf, ign_flag, iconv, pad, prec, c){ @@ -13739,7 +14183,9 @@ /*<>*/ buffer_add_char(buf, 43); break; default: /*<>*/ buffer_add_char(buf, 32); } - return 8 <= fconv[2] ? buffer_add_char(buf, 35) : 0; + if(8 <= fconv[2]) + /*<>*/ return buffer_add_char(buf, 35); + /*<>*/ return; /*<>*/ } function string_of_formatting_lit(formatting_lit){ /*<>*/ if @@ -13769,11 +14215,11 @@ default: /*<>*/ var c = formatting_lit[1], - /*<>*/ _dO_ = + /*<>*/ _cQ_ = /*<>*/ caml_call2 (Stdlib_String[1], 1, c); /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$7, _dO_); + (Stdlib[28], cst$7, _cQ_); } /*<>*/ } function bprint_char_literal(buf, chr){ @@ -13783,115 +14229,113 @@ /*<>*/ } function bprint_string_literal(buf, str){ /*<>*/ var - _dM_ = caml_ml_string_length(str) - 1 | 0, - /*<>*/ _dL_ = 0; - if(_dM_ >= 0){ - var i = _dL_; + _cO_ = caml_ml_string_length(str) - 1 | 0, + /*<>*/ _cN_ = 0; + if(_cO_ >= 0){ + var i = _cN_; for(;;){ /*<>*/ bprint_char_literal (buf, /*<>*/ caml_string_get(str, i)); /*<>*/ /*<>*/ var - _dN_ = i + 1 | 0; - if(_dM_ !== i){var i = _dN_; continue;} - break; + _cP_ = i + 1 | 0; + if(_cO_ === i) break; + i = _cP_; } } - return 0; + return; /*<>*/ } function bprint_fmtty(buf, fmtty){ /*<>*/ var fmtty$0 = fmtty; /*<>*/ for(;;){ if(typeof fmtty$0 === "number") - /*<>*/ return 0; + /*<>*/ return; switch(fmtty$0[0]){ case 0: var fmtty$1 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_c); - var fmtty$0 = fmtty$1; - continue; + fmtty$0 = fmtty$1; + break; case 1: var fmtty$2 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_s); - var fmtty$0 = fmtty$2; - continue; + fmtty$0 = fmtty$2; + break; case 2: var fmtty$3 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_i); - var fmtty$0 = fmtty$3; - continue; + fmtty$0 = fmtty$3; + break; case 3: var fmtty$4 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_li); - var fmtty$0 = fmtty$4; - continue; + fmtty$0 = fmtty$4; + break; case 4: var fmtty$5 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_ni); - var fmtty$0 = fmtty$5; - continue; + fmtty$0 = fmtty$5; + break; case 5: var fmtty$6 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_Li); - var fmtty$0 = fmtty$6; - continue; + fmtty$0 = fmtty$6; + break; case 6: var fmtty$7 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_f); - var fmtty$0 = fmtty$7; - continue; + fmtty$0 = fmtty$7; + break; case 7: var fmtty$8 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_B); - var fmtty$0 = fmtty$8; - continue; + fmtty$0 = fmtty$8; + break; case 8: var fmtty$9 = fmtty$0[2], sub_fmtty = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst$9); /*<>*/ bprint_fmtty(buf, sub_fmtty); /*<>*/ buffer_add_string(buf, cst$10); - var fmtty$0 = fmtty$9; - continue; + fmtty$0 = fmtty$9; + break; case 9: var fmtty$10 = fmtty$0[3], sub_fmtty$0 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst$11); /*<>*/ bprint_fmtty(buf, sub_fmtty$0); /*<>*/ buffer_add_string(buf, cst$12); - var fmtty$0 = fmtty$10; - continue; + fmtty$0 = fmtty$10; + break; case 10: var fmtty$11 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_a); - var fmtty$0 = fmtty$11; - continue; + fmtty$0 = fmtty$11; + break; case 11: var fmtty$12 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_t); - var fmtty$0 = fmtty$12; - continue; + fmtty$0 = fmtty$12; + break; case 12: var fmtty$13 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst$13); - var fmtty$0 = fmtty$13; - continue; + fmtty$0 = fmtty$13; + break; case 13: var fmtty$14 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_r); - var fmtty$0 = fmtty$14; - continue; + fmtty$0 = fmtty$14; + break; default: var fmtty$15 = fmtty$0[1]; /*<>*/ buffer_add_string(buf, cst_r$0); - var fmtty$0 = fmtty$15; - continue; + fmtty$0 = fmtty$15; } } /*<>*/ } function int_of_custom_arity(param){ - /*<>*/ if(! param) - /*<>*/ return 0; + /*<>*/ if(! param) /*<>*/ return 0; var x = param[1]; return 1 + int_of_custom_arity(x) | 0; - /*<>*/ } + } function string_of_fmt(fmt){ /*<>*/ /*<>*/ var buf = buffer_create(16); @@ -13899,10 +14343,9 @@ /*<>*/ var fmt$0 = fmt, ign_flag$0 = ign_flag; - a: /*<>*/ for(;;){ if(typeof fmt$0 === "number") - /*<>*/ return 0; + /*<>*/ return; switch(fmt$0[0]){ case 0: var rest = fmt$0[1]; @@ -13910,16 +14353,18 @@ /*<>*/ bprint_ignored_flag (buf, ign_flag$0); /*<>*/ buffer_add_char(buf, 99); - var fmt$0 = rest, ign_flag$0 = 0; - continue; + fmt$0 = rest; + ign_flag$0 = 0; + break; case 1: var rest$0 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); /*<>*/ bprint_ignored_flag (buf, ign_flag$0); /*<>*/ buffer_add_char(buf, 67); - var fmt$0 = rest$0, ign_flag$0 = 0; - continue; + fmt$0 = rest$0; + ign_flag$0 = 0; + break; case 2: var rest$1 = fmt$0[2], pad = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -13927,8 +14372,9 @@ (buf, ign_flag$0); /*<>*/ bprint_padding(buf, pad); /*<>*/ buffer_add_char(buf, 115); - var fmt$0 = rest$1, ign_flag$0 = 0; - continue; + fmt$0 = rest$1; + ign_flag$0 = 0; + break; case 3: var rest$2 = fmt$0[2], pad$0 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -13936,8 +14382,9 @@ (buf, ign_flag$0); /*<>*/ bprint_padding(buf, pad$0); /*<>*/ buffer_add_char(buf, 83); - var fmt$0 = rest$2, ign_flag$0 = 0; - continue; + fmt$0 = rest$2; + ign_flag$0 = 0; + break; case 4: var rest$3 = fmt$0[4], @@ -13952,8 +14399,9 @@ /*<>*/ bprint_precision(buf, prec); /*<>*/ buffer_add_char (buf, char_of_iconv(iconv)); - var fmt$0 = rest$3, ign_flag$0 = 0; - continue; + fmt$0 = rest$3; + ign_flag$0 = 0; + break; case 5: var rest$4 = fmt$0[4], @@ -13962,8 +14410,9 @@ iconv$0 = fmt$0[1]; /*<>*/ bprint_altint_fmt (buf, ign_flag$0, iconv$0, pad$2, prec$0, 108); - var fmt$0 = rest$4, ign_flag$0 = 0; - continue; + fmt$0 = rest$4; + ign_flag$0 = 0; + break; case 6: var rest$5 = fmt$0[4], @@ -13972,8 +14421,9 @@ iconv$1 = fmt$0[1]; /*<>*/ bprint_altint_fmt (buf, ign_flag$0, iconv$1, pad$3, prec$1, 110); - var fmt$0 = rest$5, ign_flag$0 = 0; - continue; + fmt$0 = rest$5; + ign_flag$0 = 0; + break; case 7: var rest$6 = fmt$0[4], @@ -13982,8 +14432,9 @@ iconv$2 = fmt$0[1]; /*<>*/ bprint_altint_fmt (buf, ign_flag$0, iconv$2, pad$4, prec$2, 76); - var fmt$0 = rest$6, ign_flag$0 = 0; - continue; + fmt$0 = rest$6; + ign_flag$0 = 0; + break; case 8: var rest$7 = fmt$0[4], @@ -13998,8 +14449,9 @@ /*<>*/ bprint_precision(buf, prec$3); /*<>*/ buffer_add_char (buf, char_of_fconv(0, fconv)); - var fmt$0 = rest$7, ign_flag$0 = 0; - continue; + fmt$0 = rest$7; + ign_flag$0 = 0; + break; case 9: var rest$8 = fmt$0[2], pad$6 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -14007,23 +14459,24 @@ (buf, ign_flag$0); /*<>*/ bprint_padding(buf, pad$6); /*<>*/ buffer_add_char(buf, 66); - var fmt$0 = rest$8, ign_flag$0 = 0; - continue; + fmt$0 = rest$8; + ign_flag$0 = 0; + break; case 10: var rest$9 = fmt$0[1]; /*<>*/ buffer_add_string(buf, cst$14); - var fmt$0 = rest$9; - continue; + fmt$0 = rest$9; + break; case 11: var rest$10 = fmt$0[2], str = fmt$0[1]; /*<>*/ bprint_string_literal(buf, str); - var fmt$0 = rest$10; - continue; + fmt$0 = rest$10; + break; case 12: var rest$11 = fmt$0[2], chr = fmt$0[1]; /*<>*/ bprint_char_literal(buf, chr); - var fmt$0 = rest$11; - continue; + fmt$0 = rest$11; + break; case 13: var rest$12 = fmt$0[3], fmtty = fmt$0[2], pad_opt = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -14034,8 +14487,9 @@ /*<>*/ bprint_fmtty(buf, fmtty); /*<>*/ buffer_add_char(buf, 37); /*<>*/ buffer_add_char(buf, 125); - var fmt$0 = rest$12, ign_flag$0 = 0; - continue; + fmt$0 = rest$12; + ign_flag$0 = 0; + break; case 14: var rest$13 = fmt$0[3], fmtty$0 = fmt$0[2], pad_opt$0 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -14046,30 +14500,33 @@ /*<>*/ bprint_fmtty(buf, fmtty$0); /*<>*/ buffer_add_char(buf, 37); /*<>*/ buffer_add_char(buf, 41); - var fmt$0 = rest$13, ign_flag$0 = 0; - continue; + fmt$0 = rest$13; + ign_flag$0 = 0; + break; case 15: var rest$14 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); /*<>*/ bprint_ignored_flag (buf, ign_flag$0); /*<>*/ buffer_add_char(buf, 97); - var fmt$0 = rest$14, ign_flag$0 = 0; - continue; + fmt$0 = rest$14; + ign_flag$0 = 0; + break; case 16: var rest$15 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); /*<>*/ bprint_ignored_flag (buf, ign_flag$0); /*<>*/ buffer_add_char(buf, 116); - var fmt$0 = rest$15, ign_flag$0 = 0; - continue; + fmt$0 = rest$15; + ign_flag$0 = 0; + break; case 17: var rest$16 = fmt$0[2], fmting_lit = fmt$0[1]; /*<>*/ bprint_string_literal (buf, string_of_formatting_lit(fmting_lit)); - var fmt$0 = rest$16; - continue; + fmt$0 = rest$16; + break; case 18: var rest$17 = fmt$0[2], fmting_gen = fmt$0[1]; /*<>*/ if(0 === fmting_gen[0]){ @@ -14082,16 +14539,17 @@ /*<>*/ buffer_add_string(buf, cst$16); /*<>*/ buffer_add_string(buf, str$1); } - var fmt$0 = rest$17; - continue; + fmt$0 = rest$17; + break; case 19: var rest$18 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); /*<>*/ bprint_ignored_flag (buf, ign_flag$0); /*<>*/ buffer_add_char(buf, 114); - var fmt$0 = rest$18, ign_flag$0 = 0; - continue; + fmt$0 = rest$18; + ign_flag$0 = 0; + break; case 20: var rest$19 = fmt$0[3], char_set = fmt$0[2], width_opt = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -14113,169 +14571,167 @@ : buffer_add_char(buf, c); /*<>*/ }; /*<>*/ buffer_add_char(buf, 91); - /*<>*/ var - /*<>*/ set = + /*<>*/ /*<>*/ var + set = is_in_char_set(char_set, 0) ? (buffer_add_char(buf, 94), rev_char_set(char_set)) - : char_set, - is_alone$0 = - function(set){ - function is_alone(c){ - /*<>*/ var - /*<>*/ after = - /*<>*/ caml_call1 - (Stdlib_Char[1], c + 1 | 0), - /*<>*/ before = - /*<>*/ caml_call1 - (Stdlib_Char[1], c - 1 | 0), - /*<>*/ _dH_ = - is_in_char_set(set, c); - /*<>*/ if(_dH_) - /*<>*/ var - /*<>*/ _dI_ = - is_in_char_set(set, before), - /*<>*/ _dJ_ = - _dI_ ? is_in_char_set(set, after) : _dI_, - _dK_ = 1 - _dJ_; - else - var _dK_ = _dH_; - /*<>*/ return _dK_; - /*<>*/ } - return is_alone; - }, - is_alone = is_alone$0(set); + : char_set; + let set$0 = set; + var + is_alone = + function(c){ + /*<>*/ var + /*<>*/ after = + /*<>*/ caml_call1 + (Stdlib_Char[1], c + 1 | 0), + /*<>*/ before = + /*<>*/ caml_call1 + (Stdlib_Char[1], c - 1 | 0), + /*<>*/ _cJ_ = + is_in_char_set(set$0, c); + /*<>*/ if(_cJ_) + /*<>*/ var + /*<>*/ _cK_ = + is_in_char_set(set$0, before), + /*<>*/ _cL_ = + _cK_ ? is_in_char_set(set$0, after) : _cK_, + _cM_ = 1 - _cL_; + else + var _cM_ = _cJ_; + /*<>*/ return _cM_; + /*<>*/ }; /*<>*/ if(is_alone(93)) /*<>*/ buffer_add_char(buf, 93); - var i = 1; + a: b: - /*<>*/ for(;;){ - if(i < 256){ - /*<>*/ if - (! - is_in_char_set - (set, - /*<>*/ caml_call1(Stdlib[29], i))){ - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - continue; - } - /*<>*/ var - /*<>*/ switcher = - /*<>*/ caml_call1(Stdlib[29], i) - - 45 - | 0, - switch$0 = 0; - if(48 < switcher >>> 0) - if(210 <= switcher) - /*<>*/ print_char(buf, 255); - else - switch$0 = 1; - else{ - if(46 < switcher - 1 >>> 0){ - /*<>*/ var - /*<>*/ i$2 = i + 1 | 0, - i = i$2; - continue; - } - switch$0 = 1; - } - if(switch$0){ - /*<>*/ /*<>*/ var - i$1 = i + 1 | 0; - /*<>*/ if - (! - is_in_char_set - (set, - /*<>*/ caml_call1 - (Stdlib[29], i$1))){ - /*<>*/ print_char(buf, i$1 - 1 | 0); - /*<>*/ var - /*<>*/ i$6 = i$1 + 1 | 0, - i = i$6; - continue; - } - /*<>*/ var - /*<>*/ switcher$0 = - /*<>*/ caml_call1 - (Stdlib[29], i$1) - - 45 - | 0, - switch$1 = 0; - if(48 < switcher$0 >>> 0){ - if(210 <= switcher$0){ - /*<>*/ print_char(buf, 254); - /*<>*/ print_char(buf, 255); - switch$1 = 1; - } - } - else if - (46 < switcher$0 - 1 >>> 0 - && - ! - is_in_char_set + { + c: + { + d: + { + var i = 1; + /*<>*/ for(;;){ + if(i >= 256) break; + /*<>*/ if + (is_in_char_set (set, - /*<>*/ caml_call1 - (Stdlib[29], i$1 + 1 | 0))){ - /*<>*/ print_char(buf, i$1 - 1 | 0); - /*<>*/ var - /*<>*/ i$5 = i$1 + 1 | 0, - i = i$5; - continue; - } - if(! switch$1){ - /*<>*/ if - (! - is_in_char_set - (set, - /*<>*/ caml_call1 - (Stdlib[29], i$1 + 1 | 0))){ - /*<>*/ print_char - (buf, i$1 - 1 | 0); - /*<>*/ print_char(buf, i$1); - /*<>*/ var - /*<>*/ i$4 = i$1 + 2 | 0, - i = i$4; - continue; - } - /*<>*/ var - /*<>*/ j = i$1 + 2 | 0, - i$3 = i$1 - 1 | 0, - j$0 = j; - /*<>*/ for(;;){ - /*<>*/ if - (256 !== j$0 - && - is_in_char_set - (set, - /*<>*/ caml_call1 - (Stdlib[29], j$0))){ - /*<>*/ var - /*<>*/ j$1 = j$0 + 1 | 0, - j$0 = j$1; + /*<>*/ caml_call1 + (Stdlib[29], i))){ + /*<>*/ /*<>*/ var + switcher = + /*<>*/ caml_call1 + (Stdlib[29], i) + - 45 + | 0; + if(48 < switcher >>> 0){ + if(210 <= switcher) break d; + } + else if(46 < switcher - 1 >>> 0){ + /*<>*/ /*<>*/ var + i$2 = i + 1 | 0; + i = i$2; continue; } - /*<>*/ print_char(buf, i$3); - /*<>*/ print_char(buf, 45); - /*<>*/ print_char - (buf, j$0 - 1 | 0); - if(j$0 < 256){ - /*<>*/ var - /*<>*/ i$7 = j$0 + 1 | 0, + /*<>*/ /*<>*/ var + i$1 = i + 1 | 0; + /*<>*/ if + (is_in_char_set + (set, + /*<>*/ caml_call1 + (Stdlib[29], i$1))){ + /*<>*/ /*<>*/ var + switcher$0 = + /*<>*/ caml_call1 + (Stdlib[29], i$1) + - 45 + | 0; + if(48 < switcher$0 >>> 0){ + if(210 <= switcher$0) break c; + } + else if + (46 < switcher$0 - 1 >>> 0 + && + ! + is_in_char_set + (set, + /*<>*/ caml_call1 + (Stdlib[29], i$1 + 1 | 0))){ + /*<>*/ print_char + (buf, i$1 - 1 | 0); + /*<>*/ /*<>*/ var + i$5 = i$1 + 1 | 0; + i = i$5; + continue; + } + /*<>*/ if + (is_in_char_set + (set, + /*<>*/ caml_call1 + (Stdlib[29], i$1 + 1 | 0))){ + /*<>*/ var + /*<>*/ j = i$1 + 2 | 0, + i$3 = i$1 - 1 | 0, + j$0 = j; + /*<>*/ for(;;){ + if(256 === j$0) break; + /*<>*/ if + (! + is_in_char_set + (set, + /*<>*/ caml_call1 + (Stdlib[29], j$0))) + break; + /*<>*/ /*<>*/ var + j$1 = j$0 + 1 | 0; + j$0 = j$1; + } + /*<>*/ print_char(buf, i$3); + /*<>*/ print_char(buf, 45); + /*<>*/ print_char + (buf, j$0 - 1 | 0); + if(j$0 >= 256) break b; + /*<>*/ /*<>*/ var + i$7 = j$0 + 1 | 0; i = i$7; - continue b; + } + else{ + /*<>*/ print_char + (buf, i$1 - 1 | 0); + /*<>*/ print_char(buf, i$1); + /*<>*/ /*<>*/ var + i$4 = i$1 + 2 | 0; + i = i$4; + } } - break; + else{ + /*<>*/ print_char + (buf, i$1 - 1 | 0); + /*<>*/ /*<>*/ var + i$6 = i$1 + 1 | 0; + i = i$6; + } + } + else{ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; } } + break a; } + /*<>*/ print_char(buf, 255); + break a; } - /*<>*/ if(is_alone(45)) - /*<>*/ buffer_add_char(buf, 45); - /*<>*/ buffer_add_char(buf, 93); - var fmt$0 = rest$19, ign_flag$0 = 0; - continue a; + /*<>*/ print_char(buf, 254); + /*<>*/ print_char(buf, 255); + break a; } + /*<>*/ if(is_alone(45)) + /*<>*/ buffer_add_char(buf, 45); + /*<>*/ buffer_add_char(buf, 93); + fmt$0 = rest$19; + ign_flag$0 = 0; + break; case 21: var rest$20 = fmt$0[2], counter = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -14283,14 +14739,15 @@ (buf, ign_flag$0); switch(counter){ case 0: - var _dD_ = 108; break; + var _cF_ = 108; break; case 1: - var _dD_ = 110; break; - default: var _dD_ = 78; + var _cF_ = 110; break; + default: var _cF_ = 78; } - /*<>*/ buffer_add_char(buf, _dD_); - var fmt$0 = rest$20, ign_flag$0 = 0; - continue; + /*<>*/ buffer_add_char(buf, _cF_); + fmt$0 = rest$20; + ign_flag$0 = 0; + break; case 22: var rest$21 = fmt$0[1]; /*<>*/ buffer_add_char(buf, 37); @@ -14298,38 +14755,39 @@ (buf, ign_flag$0); /*<>*/ bprint_string_literal (buf, cst_0c); - var fmt$0 = rest$21, ign_flag$0 = 0; - continue; + fmt$0 = rest$21; + ign_flag$0 = 0; + break; case 23: var rest$22 = fmt$0[2], ign = fmt$0[1], - fmt$1 = param_format_of_ignored_format(ign, rest$22)[1], - fmt$0 = fmt$1, - ign_flag$0 = 1; - continue; + fmt$1 = param_format_of_ignored_format(ign, rest$22)[1]; + fmt$0 = fmt$1; + ign_flag$0 = 1; + break; default: /*<>*/ var rest$23 = fmt$0[3], arity = fmt$0[1], - /*<>*/ _dF_ = + /*<>*/ _cH_ = int_of_custom_arity(arity), - _dE_ = 1; - if(_dF_ >= 1){ - var i$8 = _dE_; + _cG_ = 1; + if(_cH_ >= 1){ + var i$8 = _cG_; for(;;){ /*<>*/ buffer_add_char(buf, 37); /*<>*/ bprint_ignored_flag (buf, ign_flag$0); /*<>*/ buffer_add_char(buf, 63); /*<>*/ /*<>*/ var - _dG_ = i$8 + 1 | 0; - if(_dF_ !== i$8){var i$8 = _dG_; continue;} - break; + _cI_ = i$8 + 1 | 0; + if(_cH_ === i$8) break; + i$8 = _cI_; } } - var fmt$0 = rest$23, ign_flag$0 = 0; - continue; + fmt$0 = rest$23; + ign_flag$0 = 0; } } /*<>*/ } @@ -14337,7 +14795,7 @@ /*<>*/ return buffer_contents(buf); /*<>*/ } function symm(param){ - /*<>*/ if(typeof param === "number") + /*<>*/ if(typeof param === "number") /*<>*/ return 0; switch(param[0]){ case 0: @@ -14386,878 +14844,775 @@ var rest$13 = param[1]; /*<>*/ return [14, symm(rest$13)]; } - /*<>*/ } + } function fmtty_rel_det(param){ - /*<>*/ if(typeof param !== "number") - switch(param[0]){ + /*<>*/ if(typeof param === "number") + /*<>*/ return [0, + function(param){ + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ return; + /*<>*/ }]; + switch(param[0]){ + case 0: + /*<>*/ var + rest = param[1], + /*<>*/ match = fmtty_rel_det(rest), + de = match[4], + ed = match[3], + af = match[2], + fa = match[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af(0); + /*<>*/ return; + /*<>*/ }, + ed, + de]; + case 1: + /*<>*/ var + rest$0 = param[1], + /*<>*/ match$0 = fmtty_rel_det(rest$0), + de$0 = match$0[4], + ed$0 = match$0[3], + af$0 = match$0[2], + fa$0 = match$0[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$0(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$0(0); + /*<>*/ return; + /*<>*/ }, + ed$0, + de$0]; + case 2: + /*<>*/ var + rest$1 = param[1], + /*<>*/ match$1 = fmtty_rel_det(rest$1), + de$1 = match$1[4], + ed$1 = match$1[3], + af$1 = match$1[2], + fa$1 = match$1[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$1(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$1(0); + /*<>*/ return; + /*<>*/ }, + ed$1, + de$1]; + case 3: + /*<>*/ var + rest$2 = param[1], + /*<>*/ match$2 = fmtty_rel_det(rest$2), + de$2 = match$2[4], + ed$2 = match$2[3], + af$2 = match$2[2], + fa$2 = match$2[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$2(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$2(0); + /*<>*/ return; + /*<>*/ }, + ed$2, + de$2]; + case 4: + /*<>*/ var + rest$3 = param[1], + /*<>*/ match$3 = fmtty_rel_det(rest$3), + de$3 = match$3[4], + ed$3 = match$3[3], + af$3 = match$3[2], + fa$3 = match$3[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$3(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$3(0); + /*<>*/ return; + /*<>*/ }, + ed$3, + de$3]; + case 5: + /*<>*/ var + rest$4 = param[1], + /*<>*/ match$4 = fmtty_rel_det(rest$4), + de$4 = match$4[4], + ed$4 = match$4[3], + af$4 = match$4[2], + fa$4 = match$4[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$4(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$4(0); + /*<>*/ return; + /*<>*/ }, + ed$4, + de$4]; + case 6: + /*<>*/ var + rest$5 = param[1], + /*<>*/ match$5 = fmtty_rel_det(rest$5), + de$5 = match$5[4], + ed$5 = match$5[3], + af$5 = match$5[2], + fa$5 = match$5[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$5(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$5(0); + /*<>*/ return; + /*<>*/ }, + ed$5, + de$5]; + case 7: + /*<>*/ var + rest$6 = param[1], + /*<>*/ match$6 = fmtty_rel_det(rest$6), + de$6 = match$6[4], + ed$6 = match$6[3], + af$6 = match$6[2], + fa$6 = match$6[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$6(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$6(0); + /*<>*/ return; + /*<>*/ }, + ed$6, + de$6]; + case 8: + /*<>*/ var + rest$7 = param[2], + /*<>*/ match$7 = fmtty_rel_det(rest$7), + de$7 = match$7[4], + ed$7 = match$7[3], + af$7 = match$7[2], + fa$7 = match$7[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$7(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$7(0); + /*<>*/ return; + /*<>*/ }, + ed$7, + de$7]; + case 9: + /*<>*/ var + rest$8 = param[3], + ty2 = param[2], + ty1 = param[1], + /*<>*/ match$8 = fmtty_rel_det(rest$8), + de$8 = match$8[4], + ed$8 = match$8[3], + af$8 = match$8[2], + fa$8 = match$8[1], + /*<>*/ ty = trans(symm(ty1), ty2), + /*<>*/ match$9 = fmtty_rel_det(ty), + jd = match$9[4], + dj = match$9[3], + ga = match$9[2], + ag = match$9[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$8(0); + /*<>*/ ag(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ ga(0); + /*<>*/ af$8(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ ed$8(0); + /*<>*/ dj(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ jd(0); + /*<>*/ de$8(0); + /*<>*/ return; + /*<>*/ }]; + case 10: + /*<>*/ var + rest$9 = param[1], + /*<>*/ match$10 = fmtty_rel_det(rest$9), + de$9 = match$10[4], + ed$9 = match$10[3], + af$9 = match$10[2], + fa$9 = match$10[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$9(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$9(0); + /*<>*/ return; + /*<>*/ }, + ed$9, + de$9]; + case 11: + /*<>*/ var + rest$10 = param[1], + /*<>*/ match$11 = + fmtty_rel_det(rest$10), + de$10 = match$11[4], + ed$10 = match$11[3], + af$10 = match$11[2], + fa$10 = match$11[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$10(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$10(0); + /*<>*/ return; + /*<>*/ }, + ed$10, + de$10]; + case 12: + /*<>*/ var + rest$11 = param[1], + /*<>*/ match$12 = + fmtty_rel_det(rest$11), + de$11 = match$12[4], + ed$11 = match$12[3], + af$11 = match$12[2], + fa$11 = match$12[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$11(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$11(0); + /*<>*/ return; + /*<>*/ }, + ed$11, + de$11]; + case 13: + /*<>*/ var + rest$12 = param[1], + /*<>*/ match$13 = + fmtty_rel_det(rest$12), + de$12 = match$13[4], + ed$12 = match$13[3], + af$12 = match$13[2], + fa$12 = match$13[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$12(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$12(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ ed$12(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ de$12(0); + /*<>*/ return; + /*<>*/ }]; + default: + /*<>*/ var + rest$13 = param[1], + /*<>*/ match$14 = + fmtty_rel_det(rest$13), + de$13 = match$14[4], + ed$13 = match$14[3], + af$13 = match$14[2], + fa$13 = match$14[1]; + /*<>*/ return [0, + function(param){ + /*<>*/ fa$13(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ af$13(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ ed$13(0); + /*<>*/ return; + /*<>*/ }, + function(param){ + /*<>*/ de$13(0); + /*<>*/ return; + /*<>*/ }]; + } + } + function trans(ty1, ty2){ + /*<>*/ a: + { + b: + { + c: + { + d: + { + e: + { + f: + { + g: + { + if(typeof ty1 !== "number"){ + switch(ty1[0]){ + case 0: + var rest1 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 0: + var rest2 = ty2[1]; + /*<>*/ return [0, + trans(rest1, rest2)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 1: + var rest1$0 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 1: + var rest2$0 = ty2[1]; + /*<>*/ return [1, + trans(rest1$0, rest2$0)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 2: + var rest1$1 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 2: + var rest2$1 = ty2[1]; + /*<>*/ return [2, + trans(rest1$1, rest2$1)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 3: + var rest1$2 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 3: + var rest2$2 = ty2[1]; + /*<>*/ return [3, + trans(rest1$2, rest2$2)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 4: + var rest1$3 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 4: + var rest2$3 = ty2[1]; + /*<>*/ return [4, + trans(rest1$3, rest2$3)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 5: + var rest1$4 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 5: + var rest2$4 = ty2[1]; + /*<>*/ return [5, + trans(rest1$4, rest2$4)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 6: + var rest1$5 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 6: + var rest2$5 = ty2[1]; + /*<>*/ return [6, + trans(rest1$5, rest2$5)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 7: + var rest1$6 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 7: + var rest2$6 = ty2[1]; + /*<>*/ return [7, + trans(rest1$6, rest2$6)]; + case 8: + break f; + case 9: + break g; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + break; + case 8: + var rest1$7 = ty1[2], ty1$0 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 8: + /*<>*/ var + rest2$7 = ty2[2], + ty2$0 = ty2[1], + /*<>*/ _cE_ = + trans(rest1$7, rest2$7); + /*<>*/ return [8, + trans(ty1$0, ty2$0), + _cE_]; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _k_], 1); + case 9: + var rest1$8 = ty1[3], ty12 = ty1[2], ty11 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 8: + break f; + case 9: + /*<>*/ var + rest2$8 = ty2[3], + ty22 = ty2[2], + ty21 = ty2[1], + /*<>*/ ty = + trans(symm(ty12), ty21), + /*<>*/ match = + fmtty_rel_det(ty), + f4 = match[4], + f2 = match[2]; + /*<>*/ f2(0); + /*<>*/ f4(0); + /*<>*/ return [9, + ty11, + ty22, + trans(rest1$8, rest2$8)]; + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _l_], 1); + case 10: + var rest1$9 = ty1[1]; + if(typeof ty2 !== "number" && 10 === ty2[0]){ + var rest2$9 = ty2[1]; + /*<>*/ return [10, + trans(rest1$9, rest2$9)]; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _m_], 1); + case 11: + var rest1$10 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 10: + break a; + case 11: + var rest2$10 = ty2[1]; + /*<>*/ return [11, + trans(rest1$10, rest2$10)]; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _n_], 1); + case 12: + var rest1$11 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 10: + break a; + case 11: + break b; + case 12: + var rest2$11 = ty2[1]; + /*<>*/ return [12, + trans(rest1$11, rest2$11)]; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _o_], 1); + case 13: + var rest1$12 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + var rest2$12 = ty2[1]; + /*<>*/ return [13, + trans(rest1$12, rest2$12)]; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _p_], 1); + default: + var rest1$13 = ty1[1]; + if(typeof ty2 !== "number") + switch(ty2[0]){ + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + var rest2$13 = ty2[1]; + /*<>*/ return [14, + trans(rest1$13, rest2$13)]; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _q_], 1); + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _j_], 1); + } + if(typeof ty2 === "number") + /*<>*/ return 0; + switch(ty2[0]){ + case 10: + break a; + case 11: + break b; + case 12: + break c; + case 13: + break d; + case 14: + break e; + case 8: + break f; + case 9: break; + default: + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _b_], 1); + } + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _d_], 1); + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _c_], 1); + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _i_], 1); + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _h_], 1); + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _g_], 1); + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _f_], 1); + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _e_], 1); + /*<>*/ } + function fmtty_of_fmt(fmtty){ + /*<>*/ var fmtty$0 = fmtty; + /*<>*/ for(;;){ + if(typeof fmtty$0 === "number") + /*<>*/ return 0; + switch(fmtty$0[0]){ case 0: - /*<>*/ var - rest = param[1], - /*<>*/ match = fmtty_rel_det(rest), - de = match[4], - ed = match[3], - af = match[2], - fa = match[1], - _di_ = - function(param){ - /*<>*/ af(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa(0); - /*<>*/ return 0; - /*<>*/ }, - _di_, - ed, - de]; + var rest = fmtty$0[1]; + /*<>*/ return [0, fmtty_of_fmt(rest)]; case 1: - /*<>*/ var - rest$0 = param[1], - /*<>*/ match$0 = fmtty_rel_det(rest$0), - de$0 = match$0[4], - ed$0 = match$0[3], - af$0 = match$0[2], - fa$0 = match$0[1], - _dj_ = - function(param){ - /*<>*/ af$0(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$0(0); - /*<>*/ return 0; - /*<>*/ }, - _dj_, - ed$0, - de$0]; + var rest$0 = fmtty$0[1]; + /*<>*/ return [0, fmtty_of_fmt(rest$0)]; case 2: - /*<>*/ var - rest$1 = param[1], - /*<>*/ match$1 = fmtty_rel_det(rest$1), - de$1 = match$1[4], - ed$1 = match$1[3], - af$1 = match$1[2], - fa$1 = match$1[1], - _dk_ = - function(param){ - /*<>*/ af$1(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$1(0); - /*<>*/ return 0; - /*<>*/ }, - _dk_, - ed$1, - de$1]; + var rest$1 = fmtty$0[2], pad = fmtty$0[1]; + /*<>*/ return fmtty_of_padding_fmtty + (pad, [1, fmtty_of_fmt(rest$1)]); case 3: - /*<>*/ var - rest$2 = param[1], - /*<>*/ match$2 = fmtty_rel_det(rest$2), - de$2 = match$2[4], - ed$2 = match$2[3], - af$2 = match$2[2], - fa$2 = match$2[1], - _dl_ = - function(param){ - /*<>*/ af$2(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$2(0); - /*<>*/ return 0; - /*<>*/ }, - _dl_, - ed$2, - de$2]; + var rest$2 = fmtty$0[2], pad$0 = fmtty$0[1]; + /*<>*/ return fmtty_of_padding_fmtty + (pad$0, [1, fmtty_of_fmt(rest$2)]); case 4: - /*<>*/ var - rest$3 = param[1], - /*<>*/ match$3 = fmtty_rel_det(rest$3), - de$3 = match$3[4], - ed$3 = match$3[3], - af$3 = match$3[2], - fa$3 = match$3[1], - _dm_ = - function(param){ - /*<>*/ af$3(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$3(0); - /*<>*/ return 0; - /*<>*/ }, - _dm_, - ed$3, - de$3]; + /*<>*/ var + rest$3 = fmtty$0[4], + prec = fmtty$0[3], + pad$1 = fmtty$0[2], + /*<>*/ ty_rest = fmtty_of_fmt(rest$3), + /*<>*/ prec_ty = + fmtty_of_precision_fmtty(prec, [2, ty_rest]); + /*<>*/ return fmtty_of_padding_fmtty + (pad$1, prec_ty); case 5: - /*<>*/ var - rest$4 = param[1], - /*<>*/ match$4 = fmtty_rel_det(rest$4), - de$4 = match$4[4], - ed$4 = match$4[3], - af$4 = match$4[2], - fa$4 = match$4[1], - _dn_ = - function(param){ - /*<>*/ af$4(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$4(0); - /*<>*/ return 0; - /*<>*/ }, - _dn_, - ed$4, - de$4]; - case 6: - /*<>*/ var - rest$5 = param[1], - /*<>*/ match$5 = fmtty_rel_det(rest$5), - de$5 = match$5[4], - ed$5 = match$5[3], - af$5 = match$5[2], - fa$5 = match$5[1], - _do_ = - function(param){ - /*<>*/ af$5(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$5(0); - /*<>*/ return 0; - /*<>*/ }, - _do_, - ed$5, - de$5]; - case 7: - /*<>*/ var - rest$6 = param[1], - /*<>*/ match$6 = fmtty_rel_det(rest$6), - de$6 = match$6[4], - ed$6 = match$6[3], - af$6 = match$6[2], - fa$6 = match$6[1], - _dp_ = - function(param){ - /*<>*/ af$6(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$6(0); - /*<>*/ return 0; - /*<>*/ }, - _dp_, - ed$6, - de$6]; - case 8: - /*<>*/ var - rest$7 = param[2], - /*<>*/ match$7 = fmtty_rel_det(rest$7), - de$7 = match$7[4], - ed$7 = match$7[3], - af$7 = match$7[2], - fa$7 = match$7[1], - _dq_ = - function(param){ - /*<>*/ af$7(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$7(0); - /*<>*/ return 0; - /*<>*/ }, - _dq_, - ed$7, - de$7]; - case 9: - /*<>*/ var - rest$8 = param[3], - ty2 = param[2], - ty1 = param[1], - /*<>*/ match$8 = fmtty_rel_det(rest$8), - de$8 = match$8[4], - ed$8 = match$8[3], - af$8 = match$8[2], - fa$8 = match$8[1], - /*<>*/ ty = trans(symm(ty1), ty2), - /*<>*/ match$9 = fmtty_rel_det(ty), - jd = match$9[4], - dj = match$9[3], - ga = match$9[2], - ag = match$9[1], - _dr_ = - function(param){ - /*<>*/ jd(0); - /*<>*/ de$8(0); - /*<>*/ return 0; - /*<>*/ }, - _ds_ = - function(param){ - /*<>*/ ed$8(0); - /*<>*/ dj(0); - /*<>*/ return 0; - /*<>*/ }, - _dt_ = - function(param){ - /*<>*/ ga(0); - /*<>*/ af$8(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$8(0); - /*<>*/ ag(0); - /*<>*/ return 0; - /*<>*/ }, - _dt_, - _ds_, - _dr_]; - case 10: - /*<>*/ var - rest$9 = param[1], - /*<>*/ match$10 = - fmtty_rel_det(rest$9), - de$9 = match$10[4], - ed$9 = match$10[3], - af$9 = match$10[2], - fa$9 = match$10[1], - _du_ = - function(param){ - /*<>*/ af$9(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$9(0); - /*<>*/ return 0; - /*<>*/ }, - _du_, - ed$9, - de$9]; - case 11: - /*<>*/ var - rest$10 = param[1], - /*<>*/ match$11 = - fmtty_rel_det(rest$10), - de$10 = match$11[4], - ed$10 = match$11[3], - af$10 = match$11[2], - fa$10 = match$11[1], - _dv_ = - function(param){ - /*<>*/ af$10(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$10(0); - /*<>*/ return 0; - /*<>*/ }, - _dv_, - ed$10, - de$10]; - case 12: - /*<>*/ var - rest$11 = param[1], - /*<>*/ match$12 = - fmtty_rel_det(rest$11), - de$11 = match$12[4], - ed$11 = match$12[3], - af$11 = match$12[2], - fa$11 = match$12[1], - _dw_ = - function(param){ - /*<>*/ af$11(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$11(0); - /*<>*/ return 0; - /*<>*/ }, - _dw_, - ed$11, - de$11]; - case 13: - /*<>*/ var - rest$12 = param[1], - /*<>*/ match$13 = - fmtty_rel_det(rest$12), - de$12 = match$13[4], - ed$12 = match$13[3], - af$12 = match$13[2], - fa$12 = match$13[1], - /*<>*/ _dx_ = - function(param){ - /*<>*/ de$12(0); - /*<>*/ return 0; - /*<>*/ }, - _dy_ = - function(param){ - /*<>*/ ed$12(0); - /*<>*/ return 0; - /*<>*/ }, - _dz_ = - function(param){ - /*<>*/ af$12(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$12(0); - /*<>*/ return 0; - /*<>*/ }, - _dz_, - _dy_, - _dx_]; - default: - /*<>*/ var - rest$13 = param[1], - /*<>*/ match$14 = - fmtty_rel_det(rest$13), - de$13 = match$14[4], - ed$13 = match$14[3], - af$13 = match$14[2], - fa$13 = match$14[1], - /*<>*/ _dA_ = - function(param){ - /*<>*/ de$13(0); - /*<>*/ return 0; - /*<>*/ }, - _dB_ = - function(param){ - /*<>*/ ed$13(0); - /*<>*/ return 0; - /*<>*/ }, - _dC_ = - function(param){ - /*<>*/ af$13(0); - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ return [0, - function(param){ - /*<>*/ fa$13(0); - /*<>*/ return 0; - /*<>*/ }, - _dC_, - _dB_, - _dA_]; - } - /*<>*/ function _df_(param){ - /*<>*/ return 0; - /*<>*/ } - function _dg_(param){ - /*<>*/ return 0; - /*<>*/ } - function _dh_(param){ - /*<>*/ return 0; - /*<>*/ } - /*<>*/ return [0, - function(param){ - /*<>*/ return 0; - /*<>*/ }, - _dh_, - _dg_, - _df_]; - /*<>*/ } - function trans(ty1, ty2){ - /*<>*/ var switch$0 = 0; - if(typeof ty1 === "number"){ - if(typeof ty2 === "number") - /*<>*/ return 0; - switch(ty2[0]){ - case 10: break; - case 11: - switch$0 = 1; break; - case 12: - switch$0 = 2; break; - case 13: - switch$0 = 3; break; - case 14: - switch$0 = 4; break; - case 8: - switch$0 = 5; break; - case 9: - switch$0 = 6; break; - default: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _b_], 1); - } - } - else{ - var switch$1 = 0; - switch(ty1[0]){ - case 0: - var rest1 = ty1[1], switch$2 = 0; - if(typeof ty2 === "number") - switch$2 = 1; - else - switch(ty2[0]){ - case 0: - var rest2 = ty2[1]; - /*<>*/ return [0, - trans(rest1, rest2)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$2 = 1; - } - break; - case 1: - var rest1$0 = ty1[1], switch$3 = 0; - if(typeof ty2 === "number") - switch$3 = 1; - else - switch(ty2[0]){ - case 1: - var rest2$0 = ty2[1]; - /*<>*/ return [1, - trans(rest1$0, rest2$0)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$3 = 1; - } - break; - case 2: - var rest1$1 = ty1[1], switch$4 = 0; - if(typeof ty2 === "number") - switch$4 = 1; - else - switch(ty2[0]){ - case 2: - var rest2$1 = ty2[1]; - /*<>*/ return [2, - trans(rest1$1, rest2$1)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$4 = 1; - } - break; - case 3: - var rest1$2 = ty1[1], switch$5 = 0; - if(typeof ty2 === "number") - switch$5 = 1; - else - switch(ty2[0]){ - case 3: - var rest2$2 = ty2[1]; - /*<>*/ return [3, - trans(rest1$2, rest2$2)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$5 = 1; - } - break; - case 4: - var rest1$3 = ty1[1], switch$6 = 0; - if(typeof ty2 === "number") - switch$6 = 1; - else - switch(ty2[0]){ - case 4: - var rest2$3 = ty2[1]; - /*<>*/ return [4, - trans(rest1$3, rest2$3)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$6 = 1; - } - break; - case 5: - var rest1$4 = ty1[1], switch$7 = 0; - if(typeof ty2 === "number") - switch$7 = 1; - else - switch(ty2[0]){ - case 5: - var rest2$4 = ty2[1]; - /*<>*/ return [5, - trans(rest1$4, rest2$4)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$7 = 1; - } - break; - case 6: - var rest1$5 = ty1[1], switch$8 = 0; - if(typeof ty2 === "number") - switch$8 = 1; - else - switch(ty2[0]){ - case 6: - var rest2$5 = ty2[1]; - /*<>*/ return [6, - trans(rest1$5, rest2$5)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$8 = 1; - } - break; - case 7: - var rest1$6 = ty1[1], switch$9 = 0; - if(typeof ty2 === "number") - switch$9 = 1; - else - switch(ty2[0]){ - case 7: - var rest2$6 = ty2[1]; - /*<>*/ return [7, - trans(rest1$6, rest2$6)]; - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - switch$0 = 6; switch$1 = 1; break; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$9 = 1; - } - break; - case 8: - var rest1$7 = ty1[2], ty1$0 = ty1[1], switch$10 = 0; - if(typeof ty2 === "number") - switch$10 = 1; - else - switch(ty2[0]){ - case 8: - /*<>*/ var - rest2$7 = ty2[2], - ty2$0 = ty2[1], - /*<>*/ _de_ = - trans(rest1$7, rest2$7); - /*<>*/ return [8, - trans(ty1$0, ty2$0), - _de_]; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$10 = 1; - } - if(switch$10) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _k_], 1); - break; - case 9: - var rest1$8 = ty1[3], ty12 = ty1[2], ty11 = ty1[1], switch$11 = 0; - if(typeof ty2 === "number") - switch$11 = 1; - else - switch(ty2[0]){ - case 8: - switch$0 = 5; switch$1 = 1; break; - case 9: - /*<>*/ var - rest2$8 = ty2[3], - ty22 = ty2[2], - ty21 = ty2[1], - /*<>*/ ty = - trans(symm(ty12), ty21), - /*<>*/ match = fmtty_rel_det(ty), - f4 = match[4], - f2 = match[2]; - /*<>*/ f2(0); - /*<>*/ f4(0); - /*<>*/ return [9, - ty11, - ty22, - trans(rest1$8, rest2$8)]; - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - switch$0 = 4; switch$1 = 1; break; - default: switch$11 = 1; - } - if(switch$11) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _l_], 1); - break; - case 10: - var rest1$9 = ty1[1]; - if(typeof ty2 !== "number" && 10 === ty2[0]){ - var rest2$9 = ty2[1]; - /*<>*/ return [10, - trans(rest1$9, rest2$9)]; - } - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _m_], 1); - case 11: - var rest1$10 = ty1[1], switch$12 = 0; - if(typeof ty2 === "number") - switch$12 = 1; - else - switch(ty2[0]){ - case 10: - switch$1 = 1; break; - case 11: - var rest2$10 = ty2[1]; - /*<>*/ return [11, - trans(rest1$10, rest2$10)]; - default: switch$12 = 1; - } - if(switch$12) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _n_], 1); - break; - case 12: - var rest1$11 = ty1[1], switch$13 = 0; - if(typeof ty2 === "number") - switch$13 = 1; - else - switch(ty2[0]){ - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - var rest2$11 = ty2[1]; - /*<>*/ return [12, - trans(rest1$11, rest2$11)]; - default: switch$13 = 1; - } - if(switch$13) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _o_], 1); - break; - case 13: - var rest1$12 = ty1[1], switch$14 = 0; - if(typeof ty2 === "number") - switch$14 = 1; - else - switch(ty2[0]){ - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - var rest2$12 = ty2[1]; - /*<>*/ return [13, - trans(rest1$12, rest2$12)]; - default: switch$14 = 1; - } - if(switch$14) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _p_], 1); - break; - default: - var rest1$13 = ty1[1], switch$15 = 0; - if(typeof ty2 === "number") - switch$15 = 1; - else - switch(ty2[0]){ - case 10: - switch$1 = 1; break; - case 11: - switch$0 = 1; switch$1 = 1; break; - case 12: - switch$0 = 2; switch$1 = 1; break; - case 13: - switch$0 = 3; switch$1 = 1; break; - case 14: - var rest2$13 = ty2[1]; - /*<>*/ return [14, - trans(rest1$13, rest2$13)]; - default: switch$15 = 1; - } - if(switch$15) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _q_], 1); - } - if(! switch$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _j_], 1); - } - switch(switch$0){ - case 0: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _e_], 1); - case 1: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _f_], 1); - case 2: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _g_], 1); - case 3: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _h_], 1); - case 4: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _i_], 1); - case 5: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _c_], 1); - default: - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _d_], 1); - } - /*<>*/ } - function fmtty_of_padding_fmtty(pad, fmtty){ - /*<>*/ return typeof pad === "number" - ? fmtty - : 0 === pad[0] ? fmtty : [2, fmtty]; - /*<>*/ } - function fmtty_of_custom(arity, fmtty){ - /*<>*/ if(! arity) - /*<>*/ return fmtty; - var arity$0 = arity[1]; - /*<>*/ return [12, - fmtty_of_custom(arity$0, fmtty)]; - /*<>*/ } - function fmtty_of_fmt(fmtty){ - /*<>*/ var fmtty$0 = fmtty; - /*<>*/ for(;;){ - if(typeof fmtty$0 === "number") - /*<>*/ return 0; - switch(fmtty$0[0]){ - case 0: - var rest = fmtty$0[1]; - /*<>*/ return [0, fmtty_of_fmt(rest)]; - case 1: - var rest$0 = fmtty$0[1]; - /*<>*/ return [0, fmtty_of_fmt(rest$0)]; - case 2: - var rest$1 = fmtty$0[2], pad = fmtty$0[1]; - /*<>*/ return fmtty_of_padding_fmtty - (pad, [1, fmtty_of_fmt(rest$1)]); - case 3: - var rest$2 = fmtty$0[2], pad$0 = fmtty$0[1]; - /*<>*/ return fmtty_of_padding_fmtty - (pad$0, [1, fmtty_of_fmt(rest$2)]); - case 4: - /*<>*/ var - rest$3 = fmtty$0[4], - prec = fmtty$0[3], - pad$1 = fmtty$0[2], - /*<>*/ ty_rest = fmtty_of_fmt(rest$3), - /*<>*/ prec_ty = - fmtty_of_precision_fmtty(prec, [2, ty_rest]); - /*<>*/ return fmtty_of_padding_fmtty - (pad$1, prec_ty); - case 5: - /*<>*/ var - rest$4 = fmtty$0[4], - prec$0 = fmtty$0[3], - pad$2 = fmtty$0[2], - /*<>*/ ty_rest$0 = - fmtty_of_fmt(rest$4), - /*<>*/ prec_ty$0 = - fmtty_of_precision_fmtty(prec$0, [3, ty_rest$0]); - /*<>*/ return fmtty_of_padding_fmtty - (pad$2, prec_ty$0); + /*<>*/ var + rest$4 = fmtty$0[4], + prec$0 = fmtty$0[3], + pad$2 = fmtty$0[2], + /*<>*/ ty_rest$0 = + fmtty_of_fmt(rest$4), + /*<>*/ prec_ty$0 = + fmtty_of_precision_fmtty(prec$0, [3, ty_rest$0]); + /*<>*/ return fmtty_of_padding_fmtty + (pad$2, prec_ty$0); case 6: /*<>*/ var rest$5 = fmtty$0[4], @@ -15296,11 +15651,11 @@ /*<>*/ return fmtty_of_padding_fmtty (pad$6, [7, fmtty_of_fmt(rest$8)]); case 10: - var fmtty$1 = fmtty$0[1], fmtty$0 = fmtty$1; continue; + var fmtty$1 = fmtty$0[1]; fmtty$0 = fmtty$1; break; case 11: - var fmtty$2 = fmtty$0[2], fmtty$0 = fmtty$2; continue; + var fmtty$2 = fmtty$0[2]; fmtty$0 = fmtty$2; break; case 12: - var fmtty$3 = fmtty$0[2], fmtty$0 = fmtty$3; continue; + var fmtty$3 = fmtty$0[2]; fmtty$0 = fmtty$3; break; case 13: var rest$9 = fmtty$0[3], ty = fmtty$0[2]; /*<>*/ return [8, @@ -15321,18 +15676,18 @@ /*<>*/ return [11, fmtty_of_fmt(rest$12)]; case 17: - var fmtty$4 = fmtty$0[2], fmtty$0 = fmtty$4; continue; + var fmtty$4 = fmtty$0[2]; fmtty$0 = fmtty$4; break; case 18: /*<>*/ var rest$13 = fmtty$0[2], formatting_gen = fmtty$0[1], - /*<>*/ _db_ = fmtty_of_fmt(rest$13); + /*<>*/ _cB_ = fmtty_of_fmt(rest$13); if(0 === formatting_gen[0]) - var fmt = formatting_gen[1][1], _dc_ = fmtty_of_fmt(fmt); + var fmt = formatting_gen[1][1], _cC_ = fmtty_of_fmt(fmt); else - var fmt$0 = formatting_gen[1][1], _dc_ = fmtty_of_fmt(fmt$0); + var fmt$0 = formatting_gen[1][1], _cC_ = fmtty_of_fmt(fmt$0); /*<>*/ return /*<>*/ caml_call2 - (CamlinternalFormatBasics[1], _dc_, _db_); + (CamlinternalFormatBasics[1], _cC_, _cB_); case 19: var rest$14 = fmtty$0[1]; /*<>*/ return [13, @@ -15354,43 +15709,46 @@ if(typeof ign === "number") switch(ign){ case 0: - var fmtty$0 = fmtty$5; continue; + fmtty$0 = fmtty$5; break; case 1: - var fmtty$0 = fmtty$5; continue; + fmtty$0 = fmtty$5; break; case 2: /*<>*/ return [14, fmtty_of_fmt(fmtty$5)]; - default: var fmtty$0 = fmtty$5; continue; + default: fmtty$0 = fmtty$5; } - switch(ign[0]){ - case 0: - var fmtty$0 = fmtty$5; continue; - case 1: - var fmtty$0 = fmtty$5; continue; - case 2: - var fmtty$0 = fmtty$5; continue; - case 3: - var fmtty$0 = fmtty$5; continue; - case 4: - var fmtty$0 = fmtty$5; continue; - case 5: - var fmtty$0 = fmtty$5; continue; - case 6: - var fmtty$0 = fmtty$5; continue; - case 7: - var fmtty$0 = fmtty$5; continue; - case 8: - var fmtty$0 = fmtty$5; continue; - case 9: - /*<>*/ var - fmtty$6 = ign[2], - /*<>*/ _dd_ = fmtty_of_fmt(fmtty$5); - /*<>*/ return /*<>*/ caml_call2 - (CamlinternalFormatBasics[1], fmtty$6, _dd_); - case 10: - var fmtty$0 = fmtty$5; continue; - default: var fmtty$0 = fmtty$5; continue; - } + else + switch(ign[0]){ + case 0: + fmtty$0 = fmtty$5; break; + case 1: + fmtty$0 = fmtty$5; break; + case 2: + fmtty$0 = fmtty$5; break; + case 3: + fmtty$0 = fmtty$5; break; + case 4: + fmtty$0 = fmtty$5; break; + case 5: + fmtty$0 = fmtty$5; break; + case 6: + fmtty$0 = fmtty$5; break; + case 7: + fmtty$0 = fmtty$5; break; + case 8: + fmtty$0 = fmtty$5; break; + case 9: + /*<>*/ var + fmtty$6 = ign[2], + /*<>*/ _cD_ = + fmtty_of_fmt(fmtty$5); + /*<>*/ return /*<>*/ caml_call2 + (CamlinternalFormatBasics[1], fmtty$6, _cD_); + case 10: + fmtty$0 = fmtty$5; break; + default: fmtty$0 = fmtty$5; + } + break; default: var rest$18 = fmtty$0[3], arity = fmtty$0[1]; /*<>*/ return fmtty_of_custom @@ -15398,33 +15756,281 @@ } } /*<>*/ } + function fmtty_of_custom(arity, fmtty){ + /*<>*/ if(! arity) + /*<>*/ return fmtty; + var arity$0 = arity[1]; + /*<>*/ return [12, + fmtty_of_custom(arity$0, fmtty)]; + /*<>*/ } + function fmtty_of_padding_fmtty(pad, fmtty){ + /*<>*/ return typeof pad === "number" + ? fmtty + : 0 === pad[0] ? fmtty : [2, fmtty]; + /*<>*/ } function fmtty_of_precision_fmtty(prec, fmtty){ /*<>*/ return typeof prec === "number" ? prec ? [2, fmtty] : fmtty : fmtty; /*<>*/ } - /*<>*/ /*<>*/ var - Type_mismatch = - [248, cst_CamlinternalFormat_Type_mi, runtime.caml_fresh_oo_id(0)]; - function type_padding(pad, fmtty){ - /*<>*/ if(typeof pad === "number") - /*<>*/ return [0, 0, fmtty]; - if(0 === pad[0]){ - var w = pad[2], padty = pad[1]; - /*<>*/ return [0, [0, padty, w], fmtty]; - } - if(typeof fmtty !== "number" && 2 === fmtty[0]){ - var rest = fmtty[1], padty$0 = pad[1]; - /*<>*/ return [0, [1, padty$0], rest]; - } - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Type_mismatch, 1); - /*<>*/ } - function type_padprec(pad, prec, fmtty){ - /*<>*/ /*<>*/ var - match = type_padding(pad, fmtty); - if(typeof prec !== "number"){ - var rest$1 = match[2], pad$2 = match[1], p = prec[1]; + /*<>*/ var + /*<>*/ Type_mismatch = + [248, "CamlinternalFormat.Type_mismatch", runtime.caml_fresh_oo_id(0)], + cst_d = "%d", + cst_d$0 = "%+d", + cst_d$1 = "% d", + cst_i$0 = cst_i$3, + cst_i$1 = "%+i", + cst_i$2 = "% i", + cst_x = "%x", + cst_x$0 = "%#x", + cst_X = "%X", + cst_X$0 = "%#X", + cst_o = "%o", + cst_o$0 = "%#o", + cst_u = cst_u$0, + cst_Ld = "%Ld", + cst_Ld$0 = "%+Ld", + cst_Ld$1 = "% Ld", + cst_Li$0 = cst_Li$3, + cst_Li$1 = "%+Li", + cst_Li$2 = "% Li", + cst_Lx = "%Lx", + cst_Lx$0 = "%#Lx", + cst_LX = "%LX", + cst_LX$0 = "%#LX", + cst_Lo = "%Lo", + cst_Lo$0 = "%#Lo", + cst_Lu = "%Lu", + cst_ld = "%ld", + cst_ld$0 = "%+ld", + cst_ld$1 = "% ld", + cst_li$0 = cst_li$3, + cst_li$1 = "%+li", + cst_li$2 = "% li", + cst_lx = "%lx", + cst_lx$0 = "%#lx", + cst_lX = "%lX", + cst_lX$0 = "%#lX", + cst_lo = "%lo", + cst_lo$0 = "%#lo", + cst_lu = "%lu", + cst_nd = "%nd", + cst_nd$0 = "%+nd", + cst_nd$1 = "% nd", + cst_ni$0 = cst_ni$3, + cst_ni$1 = "%+ni", + cst_ni$2 = "% ni", + cst_nx = "%nx", + cst_nx$0 = "%#nx", + cst_nX = "%nX", + cst_nX$0 = "%#nX", + cst_no = "%no", + cst_no$0 = "%#no", + cst_nu = "%nu", + _r_ = [0, 103], + cst_neg_infinity = "neg_infinity", + cst_infinity = "infinity", + cst_nan = "nan", + _s_ = [0, cst_camlinternalFormat_ml, 1558, 4], + cst_Printf_bad_conversion = "Printf: bad conversion %[", + _t_ = [0, cst_camlinternalFormat_ml, 1626, 39], + _u_ = [0, cst_camlinternalFormat_ml, 1649, 31], + _v_ = [0, cst_camlinternalFormat_ml, 1650, 31], + cst_Printf_bad_conversion$0 = "Printf: bad conversion %_", + _w_ = [0, cst_camlinternalFormat_ml, 1830, 8], + _x_ = [0, 0, 4], + _y_ = + [0, + [11, "invalid box description ", [3, 0, 0]], + "invalid box description %S"], + _z_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, cst_at_character_number, [4, 0, 0, 0, [11, cst$44, [2, 0, 0]]]]]], + "invalid format %S: at character number %d, %s"], + cst_non_zero_widths_are_unsupp = + "non-zero widths are unsupported for %c conversions", + _A_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, 0, 0, 0, [11, ", '", [0, [11, "' without ", [2, 0, 0]]]]]]]], + "invalid format %S: at character number %d, '%c' without %s"], + _B_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, 0, 0, 0, [11, cst$44, [2, 0, [11, " expected, read ", [1, 0]]]]]]]], + "invalid format %S: at character number %d, %s expected, read %C"], + _C_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, 0, 0, 0, [11, ", duplicate flag ", [1, 0]]]]]], + "invalid format %S: at character number %d, duplicate flag %C"], + cst_padding = "padding", + _D_ = [0, 1, 0], + cst_0 = cst_0$3, + _E_ = [0, 0], + cst_precision = cst_precision$3, + _F_ = [1, 0], + _G_ = [1, 1], + cst_precision$0 = cst_precision$3, + _H_ = [1, 1], + cst_precision$1 = cst_precision$3, + cst_0$0 = cst_0$3, + _I_ = [1, 1], + cst_0$1 = cst_0$3, + cst_0$2 = "'0'", + _J_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, + 0, + 0, + 0, + [11, ', invalid conversion "', [12, 37, [0, [12, 34, 0]]]]]]]], + 'invalid format %S: at character number %d, invalid conversion "%%%c"'], + _K_ = [0, 0], + cst_padding$0 = "`padding'", + _L_ = [0, 0], + cst_precision$2 = "`precision'", + _M_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, + 0, + 0, + 0, + [11, + ", flag ", + [1, + [11, + " is only allowed after the '", + [12, 37, [11, "', before padding and precision", 0]]]]]]]]], + "invalid format %S: at character number %d, flag %C is only allowed after the '%%', before padding and precision"], + _N_ = [0, [12, 64, 0]], + _O_ = [0, "@ ", 1, 0], + _P_ = [0, "@,", 0, 0], + _Q_ = [2, 60], + _R_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + ": '", + [12, + 37, + [11, + "' alone is not accepted in character sets, use ", + [12, + 37, + [12, + 37, + [11, " instead at position ", [4, 0, 0, 0, [12, 46, 0]]]]]]]]]], + "invalid format %S: '%%' alone is not accepted in character sets, use %%%% instead at position %d."], + _S_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + ": integer ", + [4, 0, 0, 0, [11, " is greater than the limit ", [4, 0, 0, 0, 0]]]]]], + "invalid format %S: integer %d is greater than the limit %d"], + _T_ = [0, cst_camlinternalFormat_ml, 2837, 11], + cst_digit = "digit", + _U_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + ': unclosed sub-format, expected "', + [12, 37, [0, [11, '" at character number ', [4, 0, 0, 0, 0]]]]]]], + 'invalid format %S: unclosed sub-format, expected "%%%c" at character number %d'], + cst_character = "character ')'", + cst_character$0 = "character '}'", + _V_ = [0, cst_camlinternalFormat_ml, 2899, 34], + _W_ = [0, cst_camlinternalFormat_ml, 2935, 28], + _X_ = [0, cst_camlinternalFormat_ml, 2957, 11], + _Y_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, + 0, + 0, + 0, + [11, + cst$44, + [2, + 0, + [11, + " is incompatible with '", + [0, [11, "' in sub-format ", [3, 0, 0]]]]]]]]]], + "invalid format %S: at character number %d, %s is incompatible with '%c' in sub-format %S"], + _Z_ = + [0, + [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]], + cst_bad_input_format_type_mism$0], + ___ = + [0, + [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]], + cst_bad_input_format_type_mism$0]; + function type_padding(pad, fmtty){ + /*<>*/ if(typeof pad === "number") + /*<>*/ return [0, 0, fmtty]; + if(0 === pad[0]){ + var w = pad[2], padty = pad[1]; + /*<>*/ return [0, [0, padty, w], fmtty]; + } + if(typeof fmtty !== "number" && 2 === fmtty[0]){ + var rest = fmtty[1], padty$0 = pad[1]; + /*<>*/ return [0, [1, padty$0], rest]; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Type_mismatch, 1); + /*<>*/ } + function type_padprec(pad, prec, fmtty){ + /*<>*/ /*<>*/ var + match = type_padding(pad, fmtty); + if(typeof prec !== "number"){ + var rest$1 = match[2], pad$2 = match[1], p = prec[1]; /*<>*/ return [0, pad$2, [0, p], rest$1]; } if(! prec){ @@ -15441,23 +16047,13 @@ /*<>*/ } function type_format(fmt, fmtty){ /*<>*/ /*<>*/ var - _da_ = type_format_gen(fmt, fmtty); - if(typeof _da_[2] !== "number") + _cA_ = type_format_gen(fmt, fmtty); + if(typeof _cA_[2] !== "number") /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Type_mismatch, 1); - var fmt$0 = _da_[1]; + var fmt$0 = _cA_[1]; /*<>*/ return fmt$0; /*<>*/ } - function type_ignored_param_one(ign, fmt, fmtty){ - /*<>*/ var - /*<>*/ match = - type_format_gen(fmt, fmtty), - fmtty$0 = match[2], - fmt$0 = match[1]; - /*<>*/ return [0, - [23, ign, fmt$0], - fmtty$0]; - /*<>*/ } function type_format_gen(fmt, fmtty0){ /*<>*/ if(typeof fmt === "number") /*<>*/ return [0, 0, fmtty0]; @@ -15730,7 +16326,7 @@ fmt_rest$13 = fmt[3], sub_fmtty$1 = fmt[2], pad_opt$0 = fmt[1], - /*<>*/ _c__ = + /*<>*/ _cy_ = [0, /*<>*/ caml_call1 (CamlinternalFormatBasics[2], sub_fmtty1)]; @@ -15739,7 +16335,7 @@ ([0, /*<>*/ caml_call1 (CamlinternalFormatBasics[2], sub_fmtty$1)], - _c__)) + _cy_)) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Type_mismatch, 1); /*<>*/ var @@ -15909,12 +16505,12 @@ /*<>*/ var sub_fmtty$3 = ign[2], pad_opt$2 = ign[1], - /*<>*/ _c$_ = + /*<>*/ _cz_ = type_ignored_format_substituti(sub_fmtty$3, rest, fmtty0), - match$43 = _c$_[2], + match$43 = _cz_[2], fmtty$21 = match$43[2], fmt$22 = match$43[1], - sub_fmtty$4 = _c$_[1]; + sub_fmtty$4 = _cz_[1]; /*<>*/ return [0, [23, [9, pad_opt$2, sub_fmtty$4], fmt$22], fmtty$21]; @@ -15954,6 +16550,16 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Type_mismatch, 1); /*<>*/ } + function type_ignored_param_one(ign, fmt, fmtty){ + /*<>*/ var + /*<>*/ match = + type_format_gen(fmt, fmtty), + fmtty$0 = match[2], + fmt$0 = match[1]; + /*<>*/ return [0, + [23, ign, fmt$0], + fmtty$0]; + /*<>*/ } function type_ignored_format_substituti(sub_fmtty, fmt, fmtty){ /*<>*/ if(typeof sub_fmtty === "number") /*<>*/ return [0, @@ -16106,7 +16712,7 @@ sub_fmtty_rest$17 = sub_fmtty[3], sub2_fmtty$2 = sub_fmtty[2], sub1_fmtty$0 = sub_fmtty[1], - /*<>*/ _c8_ = + /*<>*/ _cw_ = [0, /*<>*/ caml_call1 (CamlinternalFormatBasics[2], sub1_fmtty)]; @@ -16115,11 +16721,11 @@ ([0, /*<>*/ caml_call1 (CamlinternalFormatBasics[2], sub1_fmtty$0)], - _c8_)) + _cw_)) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Type_mismatch, 1); /*<>*/ /*<>*/ var - _c9_ = + _cx_ = [0, /*<>*/ caml_call1 (CamlinternalFormatBasics[2], sub2_fmtty$1)]; @@ -16128,7 +16734,7 @@ ([0, /*<>*/ caml_call1 (CamlinternalFormatBasics[2], sub2_fmtty$2)], - _c9_)) + _cx_)) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Type_mismatch, 1); /*<>*/ var @@ -16220,11 +16826,11 @@ /*<>*/ } function recast(fmt, fmtty){ /*<>*/ /*<>*/ var - _c7_ = symm(fmtty); + _cv_ = symm(fmtty); /*<>*/ return type_format (fmt, /*<>*/ caml_call1 - (CamlinternalFormatBasics[2], _c7_)); + (CamlinternalFormatBasics[2], _cv_)); /*<>*/ } function fix_padding(padty, width, str){ /*<>*/ var @@ -16234,23 +16840,22 @@ /*<>*/ caml_call1(Stdlib[18], width); if(width$0 <= len) /*<>*/ return str; /*<>*/ var - _c6_ = 2 === padty$0 ? 48 : 32, + _cu_ = 2 === padty$0 ? 48 : 32, /*<>*/ res = /*<>*/ caml_call2 - (Stdlib_Bytes[1], width$0, _c6_); + (Stdlib_Bytes[1], width$0, _cu_); /*<>*/ switch(padty$0){ case 0: /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], str, 0, res, 0, len); + (Stdlib_String[6], str, 0, res, 0, len); break; case 1: /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], str, 0, res, width$0 - len | 0, len); + (Stdlib_String[6], str, 0, res, width$0 - len | 0, len); break; default: - var switch$0 = 0; + a: if(0 < len){ - var switch$1 = 0; /*<>*/ if (43 !== /*<>*/ caml_string_get(str, 0) @@ -16259,57 +16864,49 @@ !== /*<>*/ caml_string_get(str, 0) && 32 - !== /*<>*/ caml_string_get(str, 0)){switch$0 = 1; switch$1 = 1;} - if(! switch$1){ - /*<>*/ /*<>*/ caml_bytes_set - (res, - 0, - /*<>*/ caml_string_get(str, 0)); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], - str, - 1, - res, - (width$0 - len | 0) + 1 | 0, - len - 1 | 0); - } + !== /*<>*/ caml_string_get(str, 0)) + break a; + /*<>*/ /*<>*/ caml_bytes_set + (res, + 0, + /*<>*/ caml_string_get(str, 0)); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_String[6], + str, + 1, + res, + (width$0 - len | 0) + 1 | 0, + len - 1 | 0); + break; } - else - switch$0 = 1; - if(switch$0){ - var switch$2 = 0; - /*<>*/ if - (1 < len + a: + if + (1 < len + && + 48 + === /*<>*/ caml_string_get(str, 0)){ + /*<>*/ if + (120 + !== /*<>*/ caml_string_get(str, 1) && - 48 - === /*<>*/ caml_string_get(str, 0)){ - var switch$3 = 0; - /*<>*/ if - (120 - === /*<>*/ caml_string_get(str, 1) - || - 88 - === /*<>*/ caml_string_get(str, 1)) - switch$3 = 1; - if(switch$3){ - /*<>*/ /*<>*/ caml_bytes_set - (res, - 1, - /*<>*/ caml_string_get(str, 1)); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], - str, - 2, - res, - (width$0 - len | 0) + 2 | 0, - len - 2 | 0); - switch$2 = 1; - } - } - if(! switch$2) - /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], str, 0, res, width$0 - len | 0, len); + 88 + !== /*<>*/ caml_string_get(str, 1)) + break a; + /*<>*/ /*<>*/ caml_bytes_set + (res, + 1, + /*<>*/ caml_string_get(str, 1)); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_String[6], + str, + 2, + res, + (width$0 - len | 0) + 2 | 0, + len - 2 | 0); + break; } + /*<>*/ /*<>*/ caml_call5 + (Stdlib_String[6], str, 0, res, width$0 - len | 0, len); } /*<>*/ return /*<>*/ caml_call1 (Stdlib_Bytes[44], res); @@ -16321,88 +16918,84 @@ /*<>*/ len = /*<>*/ caml_ml_string_length(str), /*<>*/ c = - /*<>*/ caml_string_get(str, 0), - switch$0 = 0; - if(58 <= c){ - if(71 <= c){ - if(5 >= c - 97 >>> 0) switch$0 = 1; - } - else if(65 <= c) switch$0 = 1; - } - else{ - var switch$1 = 0; - if(32 === c) - switch$1 = 1; - else if(43 <= c) - switch(c - 43 | 0){ - case 5: - if(len < (prec$0 + 2 | 0) && 1 < len){ - var switch$2 = 0; - /*<>*/ if - (120 - !== /*<>*/ caml_string_get(str, 1) - && - 88 - !== - /*<>*/ caml_string_get(str, 1)) - switch$2 = 1; - if(! switch$2){ - /*<>*/ /*<>*/ var - res$1 = - /*<>*/ caml_call2 - (Stdlib_Bytes[1], prec$0 + 2 | 0, 48); - /*<>*/ /*<>*/ caml_bytes_set - (res$1, - 1, - /*<>*/ caml_string_get(str, 1)); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], - str, - 2, - res$1, - (prec$0 - len | 0) + 4 | 0, - len - 2 | 0); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], res$1); - } - } - switch$0 = 1; - break; - case 0: - case 2: - switch$1 = 1; break; - case 1: - case 3: - case 4: break; - default: switch$0 = 1; + /*<>*/ caml_string_get(str, 0); + a: + { + b: + { + if(58 > c){ + if(32 !== c){ + if(43 > c) break a; + switch(c - 43 | 0){ + case 5: + c: + if(len < (prec$0 + 2 | 0) && 1 < len){ + /*<>*/ if + (120 + !== + /*<>*/ caml_string_get(str, 1) + && + 88 + !== + /*<>*/ caml_string_get(str, 1)) + break c; + /*<>*/ /*<>*/ var + res$1 = + /*<>*/ caml_call2 + (Stdlib_Bytes[1], prec$0 + 2 | 0, 48); + /*<>*/ /*<>*/ caml_bytes_set + (res$1, + 1, + /*<>*/ caml_string_get(str, 1)); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_String[6], + str, + 2, + res$1, + (prec$0 - len | 0) + 4 | 0, + len - 2 | 0); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], res$1); + } + break b; + case 0: + case 2: break; + case 1: + case 3: + case 4: + break a; + default: break b; + } + } + if(len >= (prec$0 + 1 | 0)) break a; + /*<>*/ /*<>*/ var + res$0 = + /*<>*/ caml_call2 + (Stdlib_Bytes[1], prec$0 + 1 | 0, 48); + /*<>*/ /*<>*/ caml_bytes_set + (res$0, 0, c); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_String[6], + str, + 1, + res$0, + (prec$0 - len | 0) + 2 | 0, + len - 1 | 0); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], res$0); } - if(switch$1 && len < (prec$0 + 1 | 0)){ - /*<>*/ /*<>*/ var - res$0 = - /*<>*/ caml_call2 - (Stdlib_Bytes[1], prec$0 + 1 | 0, 48); - /*<>*/ /*<>*/ caml_bytes_set - (res$0, 0, c); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], - str, - 1, - res$0, - (prec$0 - len | 0) + 2 | 0, - len - 1 | 0); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], res$0); - } - } - if(switch$0 && len < prec$0){ - /*<>*/ /*<>*/ var - res = - /*<>*/ caml_call2 - (Stdlib_Bytes[1], prec$0, 48); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_String[48], str, 0, res, prec$0 - len | 0, len); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], res); + if(71 <= c){if(5 < c - 97 >>> 0) break a;} else if(65 > c) break a; + } + if(len < prec$0){ + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_call2 + (Stdlib_Bytes[1], prec$0, 48); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_String[6], str, 0, res, prec$0 - len | 0, len); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], res); + } } /*<>*/ return str; /*<>*/ } @@ -16410,7 +17003,7 @@ /*<>*/ var /*<>*/ str$0 = /*<>*/ caml_call1 - (Stdlib_String[24], str), + (Stdlib_String[25], str), /*<>*/ l = /*<>*/ caml_ml_string_length(str$0), /*<>*/ res = @@ -16442,16 +17035,16 @@ /*<>*/ return s; /*<>*/ var /*<>*/ n = [0, 0], - _c1_ = caml_ml_string_length(s) - 1 | 0, - /*<>*/ _c0_ = 0; - if(_c1_ >= 0){ - var i$0 = _c0_; + _cp_ = caml_ml_string_length(s) - 1 | 0, + /*<>*/ _co_ = 0; + if(_cp_ >= 0){ + var i$0 = _co_; for(;;){ if(9 >= caml_string_unsafe_get(s, i$0) - 48 >>> 0) n[1]++; /*<>*/ /*<>*/ var - _c5_ = i$0 + 1 | 0; - if(_c1_ !== i$0){var i$0 = _c5_; continue;} - break; + _ct_ = i$0 + 1 | 0; + if(_cp_ === i$0) break; + i$0 = _ct_; } } /*<>*/ var @@ -16464,15 +17057,15 @@ /*<>*/ /*<>*/ caml_bytes_set (buf, pos[1], c); pos[1]++; - return 0; + return; /*<>*/ } /*<>*/ var /*<>*/ left = [0, ((digits - 1 | 0) % 3 | 0) + 1 | 0], - _c3_ = caml_ml_string_length(s) - 1 | 0, - /*<>*/ _c2_ = 0; - if(_c3_ >= 0){ - var i = _c2_; + _cr_ = caml_ml_string_length(s) - 1 | 0, + /*<>*/ _cq_ = 0; + if(_cr_ >= 0){ + var i = _cq_; for(;;){ var c = caml_string_unsafe_get(s, i); if(9 < c - 48 >>> 0) @@ -16482,13 +17075,13 @@ /*<>*/ put(95); left[1] = 3; } - left[1] += -1; + left[1]--; /*<>*/ put(c); } /*<>*/ /*<>*/ var - _c4_ = i + 1 | 0; - if(_c3_ !== i){var i = _c4_; continue;} - break; + _cs_ = i + 1 | 0; + if(_cr_ === i) break; + i = _cs_; } } /*<>*/ return /*<>*/ caml_call1 @@ -16497,372 +17090,218 @@ function convert_int(iconv, n){ /*<>*/ switch(iconv){ case 1: - var _cZ_ = cst_d$0; break; + var _cn_ = cst_d$0; break; case 2: - var _cZ_ = cst_d$1; break; + var _cn_ = cst_d$1; break; case 4: - var _cZ_ = cst_i$1; break; + var _cn_ = cst_i$1; break; case 5: - var _cZ_ = cst_i$2; break; + var _cn_ = cst_i$2; break; case 6: - var _cZ_ = cst_x; break; + var _cn_ = cst_x; break; case 7: - var _cZ_ = cst_x$0; break; + var _cn_ = cst_x$0; break; case 8: - var _cZ_ = cst_X; break; + var _cn_ = cst_X; break; case 9: - var _cZ_ = cst_X$0; break; + var _cn_ = cst_X$0; break; case 10: - var _cZ_ = cst_o; break; + var _cn_ = cst_o; break; case 11: - var _cZ_ = cst_o$0; break; + var _cn_ = cst_o$0; break; case 0: case 13: - var _cZ_ = cst_d; break; + var _cn_ = cst_d; break; case 3: case 14: - var _cZ_ = cst_i$0; break; - default: var _cZ_ = cst_u; + var _cn_ = cst_i$0; break; + default: var _cn_ = cst_u; } /*<>*/ return transform_int_alt (iconv, - /*<>*/ caml_format_int(_cZ_, n)); + /*<>*/ caml_format_int(_cn_, n)); /*<>*/ } function convert_int32(iconv, n){ /*<>*/ switch(iconv){ case 1: - var _cY_ = cst_ld$0; break; - case 2: - var _cY_ = cst_ld$1; break; - case 4: - var _cY_ = cst_li$1; break; - case 5: - var _cY_ = cst_li$2; break; - case 6: - var _cY_ = cst_lx; break; - case 7: - var _cY_ = cst_lx$0; break; - case 8: - var _cY_ = cst_lX; break; - case 9: - var _cY_ = cst_lX$0; break; - case 10: - var _cY_ = cst_lo; break; - case 11: - var _cY_ = cst_lo$0; break; - case 0: - case 13: - var _cY_ = cst_ld; break; - case 3: - case 14: - var _cY_ = cst_li$0; break; - default: var _cY_ = cst_lu; - } - /*<>*/ return transform_int_alt - (iconv, - /*<>*/ caml_format_int(_cY_, n)); - /*<>*/ } - function convert_nativeint(iconv, n){ - /*<>*/ switch(iconv){ - case 1: - var _cX_ = cst_nd$0; break; - case 2: - var _cX_ = cst_nd$1; break; - case 4: - var _cX_ = cst_ni$1; break; - case 5: - var _cX_ = cst_ni$2; break; - case 6: - var _cX_ = cst_nx; break; - case 7: - var _cX_ = cst_nx$0; break; - case 8: - var _cX_ = cst_nX; break; - case 9: - var _cX_ = cst_nX$0; break; - case 10: - var _cX_ = cst_no; break; - case 11: - var _cX_ = cst_no$0; break; - case 0: - case 13: - var _cX_ = cst_nd; break; - case 3: - case 14: - var _cX_ = cst_ni$0; break; - default: var _cX_ = cst_nu; - } - /*<>*/ return transform_int_alt - (iconv, - /*<>*/ caml_format_int(_cX_, n)); - /*<>*/ } - function convert_int64(iconv, n){ - /*<>*/ switch(iconv){ - case 1: - var _cW_ = cst_Ld$0; break; + var _cm_ = cst_ld$0; break; case 2: - var _cW_ = cst_Ld$1; break; + var _cm_ = cst_ld$1; break; case 4: - var _cW_ = cst_Li$1; break; - case 5: - var _cW_ = cst_Li$2; break; - case 6: - var _cW_ = cst_Lx; break; - case 7: - var _cW_ = cst_Lx$0; break; - case 8: - var _cW_ = cst_LX; break; - case 9: - var _cW_ = cst_LX$0; break; - case 10: - var _cW_ = cst_Lo; break; - case 11: - var _cW_ = cst_Lo$0; break; - case 0: - case 13: - var _cW_ = cst_Ld; break; - case 3: - case 14: - var _cW_ = cst_Li$0; break; - default: var _cW_ = cst_Lu; - } - /*<>*/ return transform_int_alt - (iconv, - /*<>*/ runtime.caml_int64_format - (_cW_, n)); - /*<>*/ } - function convert_float(fconv, prec, x){ - function hex(param){ - /*<>*/ switch(fconv[1]){ - case 0: - var sign = 45; break; - case 1: - var sign = 43; break; - default: var sign = 32; - } - /*<>*/ return /*<>*/ runtime.caml_hexstring_of_float - (x, prec, sign); - /*<>*/ } - /*<>*/ function caml_special_val(str){ - /*<>*/ /*<>*/ var - match = - /*<>*/ runtime.caml_classify_float(x); - return 3 === match - ? x < 0. ? cst_neg_infinity : cst_infinity - : 4 <= match ? cst_nan : str; - /*<>*/ } - switch(fconv[2]){ + var _cm_ = cst_li$1; break; case 5: - /*<>*/ var - /*<>*/ str = - /*<>*/ caml_format_float - (format_of_fconv(fconv, prec), x), - len = caml_ml_string_length(str), - i = 0; - /*<>*/ for(;;){ - if(i === len) - var _cT_ = 0; - else{ - /*<>*/ var - /*<>*/ _cS_ = - /*<>*/ caml_string_get(str, i) - - 46 - | 0, - switch$0 = 0; - if(23 < _cS_ >>> 0){ - if(55 === _cS_) switch$0 = 1; - } - else if(21 < _cS_ - 1 >>> 0) switch$0 = 1; - if(! switch$0){ - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - continue; - } - var _cT_ = 1; - } - /*<>*/ /*<>*/ var - _cU_ = - _cT_ - ? str - : /*<>*/ caml_call2 - (Stdlib[28], str, cst$17); - /*<>*/ return caml_special_val(_cU_); - } + var _cm_ = cst_li$2; break; case 6: - /*<>*/ return hex(0); - case 7: - /*<>*/ /*<>*/ var - _cV_ = hex(0); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_String[25], _cV_); - case 8: - /*<>*/ return caml_special_val(hex(0)); - default: - /*<>*/ return /*<>*/ caml_format_float - (format_of_fconv(fconv, prec), x); - } - /*<>*/ } - function string_of_fmtty(fmtty){ - /*<>*/ /*<>*/ var - buf = buffer_create(16); - /*<>*/ bprint_fmtty(buf, fmtty); - /*<>*/ return buffer_contents(buf); - /*<>*/ } - function make_int_padding_precision(k, acc, fmt, pad, prec, trans, iconv){ - /*<>*/ if(typeof pad === "number"){ - if(typeof prec === "number") - return prec - ? function - (p, x){ - /*<>*/ /*<>*/ var - str = - fix_int_precision - (p, - /*<>*/ caml_call2 - (trans, iconv, x)); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); - /*<>*/ } - : function - (x){ - /*<>*/ /*<>*/ var - str = - /*<>*/ caml_call2 - (trans, iconv, x); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); - /*<>*/ }; - var p = prec[1]; - /*<>*/ return function(x){ - /*<>*/ /*<>*/ var - str = - fix_int_precision - (p, - /*<>*/ caml_call2(trans, iconv, x)); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); /*<>*/ }; - } - if(0 === pad[0]){ - var w = pad[2], padty = pad[1]; - if(typeof prec === "number") - return prec - ? function - (p, x){ - /*<>*/ /*<>*/ var - str = - fix_padding - (padty, - w, - fix_int_precision - (p, - /*<>*/ caml_call2 - (trans, iconv, x))); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); - /*<>*/ } - : function - (x){ - /*<>*/ /*<>*/ var - str = - fix_padding - (padty, - w, - /*<>*/ caml_call2 - (trans, iconv, x)); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); - /*<>*/ }; - var p$0 = prec[1]; - /*<>*/ return function(x){ - /*<>*/ /*<>*/ var - str = - fix_padding - (padty, - w, - fix_int_precision - (p$0, - /*<>*/ caml_call2 - (trans, iconv, x))); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); /*<>*/ }; - } - var padty$0 = pad[1]; - if(typeof prec === "number") - return prec - ? function - (w, p, x){ - /*<>*/ /*<>*/ var - str = - fix_padding - (padty$0, - w, - fix_int_precision - (p, - /*<>*/ caml_call2 - (trans, iconv, x))); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); - /*<>*/ } - : function - (w, x){ - /*<>*/ /*<>*/ var - str = - fix_padding - (padty$0, - w, - /*<>*/ caml_call2 - (trans, iconv, x)); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); - /*<>*/ }; - var p$1 = prec[1]; - /*<>*/ return function(w, x){ - /*<>*/ /*<>*/ var - str = - fix_padding - (padty$0, - w, - fix_int_precision - (p$1, - /*<>*/ caml_call2(trans, iconv, x))); - /*<>*/ return make_printf - (k, [4, acc, str], fmt); /*<>*/ }; - /*<>*/ } - function make_padding(k, acc, fmt, pad, trans){ - /*<>*/ if(typeof pad === "number") - /*<>*/ return function(x){ - /*<>*/ /*<>*/ var - new_acc = - [4, acc, /*<>*/ caml_call1(trans, x)]; - /*<>*/ return make_printf - (k, new_acc, fmt); /*<>*/ }; - if(0 === pad[0]){ - var width = pad[2], padty = pad[1]; - /*<>*/ return function(x){ - /*<>*/ /*<>*/ var - new_acc = - [4, - acc, - fix_padding - (padty, - width, - /*<>*/ caml_call1(trans, x))]; - /*<>*/ return make_printf - (k, new_acc, fmt); /*<>*/ }; + var _cm_ = cst_lx; break; + case 7: + var _cm_ = cst_lx$0; break; + case 8: + var _cm_ = cst_lX; break; + case 9: + var _cm_ = cst_lX$0; break; + case 10: + var _cm_ = cst_lo; break; + case 11: + var _cm_ = cst_lo$0; break; + case 0: + case 13: + var _cm_ = cst_ld; break; + case 3: + case 14: + var _cm_ = cst_li$0; break; + default: var _cm_ = cst_lu; } - var padty$0 = pad[1]; - /*<>*/ return function(w, x){ - /*<>*/ /*<>*/ var - new_acc = - [4, - acc, - fix_padding - (padty$0, - w, - /*<>*/ caml_call1(trans, x))]; - /*<>*/ return make_printf(k, new_acc, fmt); /*<>*/ }; - /*<>*/ } + /*<>*/ return transform_int_alt + (iconv, + /*<>*/ caml_format_int(_cm_, n)); + /*<>*/ } + function convert_nativeint(iconv, n){ + /*<>*/ switch(iconv){ + case 1: + var _cl_ = cst_nd$0; break; + case 2: + var _cl_ = cst_nd$1; break; + case 4: + var _cl_ = cst_ni$1; break; + case 5: + var _cl_ = cst_ni$2; break; + case 6: + var _cl_ = cst_nx; break; + case 7: + var _cl_ = cst_nx$0; break; + case 8: + var _cl_ = cst_nX; break; + case 9: + var _cl_ = cst_nX$0; break; + case 10: + var _cl_ = cst_no; break; + case 11: + var _cl_ = cst_no$0; break; + case 0: + case 13: + var _cl_ = cst_nd; break; + case 3: + case 14: + var _cl_ = cst_ni$0; break; + default: var _cl_ = cst_nu; + } + /*<>*/ return transform_int_alt + (iconv, + /*<>*/ caml_format_int(_cl_, n)); + /*<>*/ } + function convert_int64(iconv, n){ + /*<>*/ switch(iconv){ + case 1: + var _ck_ = cst_Ld$0; break; + case 2: + var _ck_ = cst_Ld$1; break; + case 4: + var _ck_ = cst_Li$1; break; + case 5: + var _ck_ = cst_Li$2; break; + case 6: + var _ck_ = cst_Lx; break; + case 7: + var _ck_ = cst_Lx$0; break; + case 8: + var _ck_ = cst_LX; break; + case 9: + var _ck_ = cst_LX$0; break; + case 10: + var _ck_ = cst_Lo; break; + case 11: + var _ck_ = cst_Lo$0; break; + case 0: + case 13: + var _ck_ = cst_Ld; break; + case 3: + case 14: + var _ck_ = cst_Li$0; break; + default: var _ck_ = cst_Lu; + } + /*<>*/ return transform_int_alt + (iconv, + /*<>*/ runtime.caml_int64_format + (_ck_, n)); + /*<>*/ } + function convert_float(fconv, prec, x){ + function hex(param){ + /*<>*/ switch(fconv[1]){ + case 0: + var sign = 45; break; + case 1: + var sign = 43; break; + default: var sign = 32; + } + /*<>*/ return /*<>*/ runtime.caml_hexstring_of_float + (x, prec, sign); + /*<>*/ } + /*<>*/ function caml_special_val(str){ + /*<>*/ /*<>*/ var + match = + /*<>*/ runtime.caml_classify_float(x); + return 3 === match + ? x < 0. ? cst_neg_infinity : cst_infinity + : 4 <= match ? cst_nan : str; + /*<>*/ } + switch(fconv[2]){ + case 5: + /*<>*/ var + /*<>*/ str = + /*<>*/ caml_format_float + (format_of_fconv(fconv, prec), x), + len = caml_ml_string_length(str), + i = 0; + /*<>*/ for(;;){ + if(i === len) + var _ch_ = 0; + else{ + /*<>*/ /*<>*/ var + _cg_ = + /*<>*/ caml_string_get(str, i) + - 46 + | 0; + a: + { + if(23 < _cg_ >>> 0){ + if(55 === _cg_) break a; + } + else if(21 < _cg_ - 1 >>> 0) break a; + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; + } + var _ch_ = 1; + } + /*<>*/ /*<>*/ var + _ci_ = + _ch_ + ? str + : /*<>*/ caml_call2 + (Stdlib[28], str, cst$17); + /*<>*/ return caml_special_val(_ci_); + } + case 6: + /*<>*/ return hex(0); + case 7: + /*<>*/ /*<>*/ var + _cj_ = hex(0); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_String[26], _cj_); + case 8: + /*<>*/ return caml_special_val(hex(0)); + default: + /*<>*/ return /*<>*/ caml_format_float + (format_of_fconv(fconv, prec), x); + } + /*<>*/ } + function string_of_fmtty(fmtty){ + /*<>*/ /*<>*/ var + buf = buffer_create(16); + /*<>*/ bprint_fmtty(buf, fmtty); + /*<>*/ return buffer_contents(buf); + /*<>*/ } function make_printf$0(counter, k, acc, fmt){ /*<>*/ var k$0 = k, @@ -17046,26 +17485,26 @@ case 10: /*<>*/ var rest$9 = fmt$0[1], - /*<>*/ acc$1 = [7, acc$0], - acc$0 = acc$1, - fmt$0 = rest$9; - continue; + /*<>*/ acc$1 = [7, acc$0]; + acc$0 = acc$1; + fmt$0 = rest$9; + break; case 11: /*<>*/ var rest$10 = fmt$0[2], str = fmt$0[1], - /*<>*/ acc$2 = [2, acc$0, str], - acc$0 = acc$2, - fmt$0 = rest$10; - continue; + /*<>*/ acc$2 = [2, acc$0, str]; + acc$0 = acc$2; + fmt$0 = rest$10; + break; case 12: /*<>*/ var rest$11 = fmt$0[2], chr = fmt$0[1], - /*<>*/ acc$3 = [3, acc$0, chr], - acc$0 = acc$3, - fmt$0 = rest$11; - continue; + /*<>*/ acc$3 = [3, acc$0, chr]; + acc$0 = acc$3; + fmt$0 = rest$11; + break; case 13: /*<>*/ var rest$12 = fmt$0[3], @@ -17080,12 +17519,12 @@ /*<>*/ return function(param){ /*<>*/ var fmt = param[1], - /*<>*/ _cR_ = recast(fmt, fmtty); + /*<>*/ _cf_ = recast(fmt, fmtty); /*<>*/ return make_printf (k$0, acc$0, /*<>*/ caml_call2 - (CamlinternalFormatBasics[3], _cR_, rest$13)); /*<>*/ }; + (CamlinternalFormatBasics[3], _cf_, rest$13)); /*<>*/ }; case 15: var rest$14 = fmt$0[1]; /*<>*/ return function(f, x){ @@ -17107,46 +17546,39 @@ /*<>*/ var rest$16 = fmt$0[2], fmting_lit = fmt$0[1], - /*<>*/ acc$4 = [0, acc$0, fmting_lit], - acc$0 = acc$4, - fmt$0 = rest$16; - continue; + /*<>*/ acc$4 = [0, acc$0, fmting_lit]; + acc$0 = acc$4; + fmt$0 = rest$16; + break; case 18: - var _cP_ = fmt$0[1]; - if(0 === _cP_[0]){ + var _cd_ = fmt$0[1]; + if(0 === _cd_[0]){ + var rest$17 = fmt$0[2], fmt$1 = _cd_[1][1]; + let acc = acc$0, k = k$0, rest = rest$17; var - rest$17 = fmt$0[2], - fmt$1 = _cP_[1][1], - k$3 = - function(acc, k, rest){ - function k$0(kacc){ - /*<>*/ return make_printf - (k, [1, acc, [0, kacc]], rest); - /*<>*/ } - return k$0; - }, - k$1 = k$3(acc$0, k$0, rest$17), - k$0 = k$1, - acc$0 = 0, - fmt$0 = fmt$1; - continue; + k$1 = + function(kacc){ + /*<>*/ return make_printf + (k, [1, acc, [0, kacc]], rest); + /*<>*/ }; + k$0 = k$1; + acc$0 = 0; + fmt$0 = fmt$1; } - var - rest$18 = fmt$0[2], - fmt$2 = _cP_[1][1], - k$4 = - function(acc, k, rest){ - function k$0(kacc){ + else{ + var rest$18 = fmt$0[2], fmt$2 = _cd_[1][1]; + let acc = acc$0, k = k$0, rest = rest$18; + var + k$2 = + function(kacc){ /*<>*/ return make_printf (k, [1, acc, [1, kacc]], rest); - /*<>*/ } - return k$0; - }, - k$2 = k$4(acc$0, k$0, rest$18), - k$0 = k$2, - acc$0 = 0, + /*<>*/ }; + k$0 = k$2; + acc$0 = 0; fmt$0 = fmt$2; - continue; + } + break; case 19: /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _s_], 1); @@ -17189,17 +17621,20 @@ rest$23 = fmt$0[3], f = fmt$0[2], arity = fmt$0[1], - /*<>*/ _cQ_ = + /*<>*/ _ce_ = /*<>*/ caml_call1(f, 0); /*<>*/ if(counter >= 50) /*<>*/ return /*<>*/ caml_trampoline_return - (make_custom$0, [0, k$0, acc$0, rest$23, arity, _cQ_]); + (make_custom$0, [0, k$0, acc$0, rest$23, arity, _ce_]); var counter$0 = counter + 1 | 0; /*<>*/ return make_custom$0 - (counter$0, k$0, acc$0, rest$23, arity, _cQ_); + (counter$0, k$0, acc$0, rest$23, arity, _ce_); } } /*<>*/ } + function make_printf(k, acc, fmt){ + /*<>*/ return caml_trampoline(make_printf$0(0, k, acc, fmt)); + } function make_ignored_param$0(counter, k, acc, ign, fmt){ /*<>*/ if(typeof ign === "number") switch(ign){ @@ -17316,6 +17751,10 @@ (counter$13, k, acc, fmt); } /*<>*/ } + function make_ignored_param(k, acc, ign, fmt){ + /*<>*/ return caml_trampoline + (make_ignored_param$0(0, k, acc, ign, fmt)); + } function make_from_fmtty$0(counter, k, acc, fmtty, fmt){ /*<>*/ if(typeof fmtty !== "number") switch(fmtty[0]){ @@ -17379,7 +17818,7 @@ fmt); /*<>*/ }; case 10: var rest$9 = fmtty[1]; - /*<>*/ return function(param, _cO_){ + /*<>*/ return function(_cc_, param){ /*<>*/ return make_from_fmtty (k, acc, rest$9, fmt); /*<>*/ }; case 11: @@ -17406,16 +17845,174 @@ /*<>*/ return make_invalid_arg (counter$0, k, acc, fmt); /*<>*/ } + function make_from_fmtty(k, acc, fmtty, fmt){ + /*<>*/ return caml_trampoline + (make_from_fmtty$0(0, k, acc, fmtty, fmt)); + } function make_invalid_arg(counter, k, acc, fmt){ /*<>*/ /*<>*/ var - _cN_ = [8, acc, cst_Printf_bad_conversion$0]; + _cb_ = [8, acc, cst_Printf_bad_conversion$0]; /*<>*/ if(counter >= 50) /*<>*/ return /*<>*/ caml_trampoline_return - (make_printf$0, [0, k, _cN_, fmt]); + (make_printf$0, [0, k, _cb_, fmt]); var counter$0 = counter + 1 | 0; /*<>*/ return make_printf$0 - (counter$0, k, _cN_, fmt); + (counter$0, k, _cb_, fmt); /*<>*/ } + function make_padding(k, acc, fmt, pad, trans){ + /*<>*/ if(typeof pad === "number") + /*<>*/ return function(x){ + /*<>*/ /*<>*/ var + new_acc = + [4, acc, /*<>*/ caml_call1(trans, x)]; + /*<>*/ return make_printf + (k, new_acc, fmt); /*<>*/ }; + if(0 === pad[0]){ + var width = pad[2], padty = pad[1]; + /*<>*/ return function(x){ + /*<>*/ /*<>*/ var + new_acc = + [4, + acc, + fix_padding + (padty, + width, + /*<>*/ caml_call1(trans, x))]; + /*<>*/ return make_printf + (k, new_acc, fmt); /*<>*/ }; + } + var padty$0 = pad[1]; + /*<>*/ return function(w, x){ + /*<>*/ /*<>*/ var + new_acc = + [4, + acc, + fix_padding + (padty$0, + w, + /*<>*/ caml_call1(trans, x))]; + /*<>*/ return make_printf(k, new_acc, fmt); /*<>*/ }; + /*<>*/ } + function make_int_padding_precision(k, acc, fmt, pad, prec, trans, iconv){ + /*<>*/ if(typeof pad === "number"){ + if(typeof prec === "number") + return prec + ? function + (p, x){ + /*<>*/ /*<>*/ var + str = + fix_int_precision + (p, + /*<>*/ caml_call2 + (trans, iconv, x)); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); + /*<>*/ } + : function + (x){ + /*<>*/ /*<>*/ var + str = + /*<>*/ caml_call2 + (trans, iconv, x); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); + /*<>*/ }; + var p = prec[1]; + /*<>*/ return function(x){ + /*<>*/ /*<>*/ var + str = + fix_int_precision + (p, + /*<>*/ caml_call2(trans, iconv, x)); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); /*<>*/ }; + } + if(0 === pad[0]){ + var w = pad[2], padty = pad[1]; + if(typeof prec === "number") + return prec + ? function + (p, x){ + /*<>*/ /*<>*/ var + str = + fix_padding + (padty, + w, + fix_int_precision + (p, + /*<>*/ caml_call2 + (trans, iconv, x))); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); + /*<>*/ } + : function + (x){ + /*<>*/ /*<>*/ var + str = + fix_padding + (padty, + w, + /*<>*/ caml_call2 + (trans, iconv, x)); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); + /*<>*/ }; + var p$0 = prec[1]; + /*<>*/ return function(x){ + /*<>*/ /*<>*/ var + str = + fix_padding + (padty, + w, + fix_int_precision + (p$0, + /*<>*/ caml_call2 + (trans, iconv, x))); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); /*<>*/ }; + } + var padty$0 = pad[1]; + if(typeof prec === "number") + return prec + ? function + (w, p, x){ + /*<>*/ /*<>*/ var + str = + fix_padding + (padty$0, + w, + fix_int_precision + (p, + /*<>*/ caml_call2 + (trans, iconv, x))); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); + /*<>*/ } + : function + (w, x){ + /*<>*/ /*<>*/ var + str = + fix_padding + (padty$0, + w, + /*<>*/ caml_call2 + (trans, iconv, x)); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); + /*<>*/ }; + var p$1 = prec[1]; + /*<>*/ return function(w, x){ + /*<>*/ /*<>*/ var + str = + fix_padding + (padty$0, + w, + fix_int_precision + (p$1, + /*<>*/ caml_call2(trans, iconv, x))); + /*<>*/ return make_printf + (k, [4, acc, str], fmt); /*<>*/ }; + /*<>*/ } function make_custom$0(counter, k, acc, rest, arity, f){ /*<>*/ if(arity){ var arity$0 = arity[1]; @@ -17428,96 +18025,18 @@ /*<>*/ caml_call1(f, x)); /*<>*/ }; } /*<>*/ /*<>*/ var - _cM_ = [4, acc, f]; + _ca_ = [4, acc, f]; /*<>*/ if(counter >= 50) /*<>*/ return /*<>*/ caml_trampoline_return - (make_printf$0, [0, k, _cM_, rest]); + (make_printf$0, [0, k, _ca_, rest]); var counter$0 = counter + 1 | 0; /*<>*/ return make_printf$0 - (counter$0, k, _cM_, rest); + (counter$0, k, _ca_, rest); /*<>*/ } - function make_printf(k, acc, fmt){ - /*<>*/ return caml_trampoline(make_printf$0(0, k, acc, fmt)); - } - function make_ignored_param(k, acc, ign, fmt){ - /*<>*/ return caml_trampoline - (make_ignored_param$0(0, k, acc, ign, fmt)); - } - function make_from_fmtty(k, acc, fmtty, fmt){ - /*<>*/ return caml_trampoline - (make_from_fmtty$0(0, k, acc, fmtty, fmt)); - } function make_custom(k, acc, rest, arity, f){ /*<>*/ return caml_trampoline (make_custom$0(0, k, acc, rest, arity, f)); } - function fn_of_padding_precision(k, o, fmt, pad, prec){ - /*<>*/ if(typeof pad === "number"){ - if(typeof prec !== "number"){ - /*<>*/ /*<>*/ var - _cl_ = make_iprintf(k, o, fmt); - /*<>*/ return function(_cL_){ - /*<>*/ return _cl_;}; - } - if(prec){ - /*<>*/ var - /*<>*/ _ci_ = make_iprintf(k, o, fmt), - /*<>*/ _cj_ = - function(_cK_){ /*<>*/ return _ci_;}; - /*<>*/ return function(_cJ_){ - /*<>*/ return _cj_;}; - } - /*<>*/ /*<>*/ var - _ck_ = make_iprintf(k, o, fmt); - /*<>*/ return function(_cI_){ - /*<>*/ return _ck_;}; - } - if(0 === pad[0]){ - if(typeof prec !== "number"){ - /*<>*/ /*<>*/ var - _cp_ = make_iprintf(k, o, fmt); - /*<>*/ return function(_cH_){ - /*<>*/ return _cp_;}; - } - if(prec){ - /*<>*/ var - /*<>*/ _cm_ = make_iprintf(k, o, fmt), - /*<>*/ _cn_ = - function(_cG_){ /*<>*/ return _cm_;}; - /*<>*/ return function(_cF_){ - /*<>*/ return _cn_;}; - } - /*<>*/ /*<>*/ var - _co_ = make_iprintf(k, o, fmt); - /*<>*/ return function(_cE_){ - /*<>*/ return _co_;}; - } - if(typeof prec !== "number"){ - /*<>*/ var - /*<>*/ _cv_ = make_iprintf(k, o, fmt), - /*<>*/ _cw_ = - function(_cD_){ /*<>*/ return _cv_;}; - /*<>*/ return function(_cC_){ - /*<>*/ return _cw_;}; - } - if(prec){ - /*<>*/ var - /*<>*/ _cq_ = make_iprintf(k, o, fmt), - /*<>*/ _cr_ = - function(_cB_){ /*<>*/ return _cq_;}, - /*<>*/ _cs_ = - function(_cA_){ /*<>*/ return _cr_;}; - /*<>*/ return function(_cz_){ - /*<>*/ return _cs_;}; - } - /*<>*/ /*<>*/ var - _ct_ = make_iprintf(k, o, fmt); - /*<>*/ function _cu_(_cy_){ - /*<>*/ return _ct_; - } - /*<>*/ return function(_cx_){ - /*<>*/ return _cu_;}; - /*<>*/ } function make_iprintf$0(counter, k, o, fmt){ /*<>*/ var k$0 = k, fmt$0 = fmt; /*<>*/ for(;;){ @@ -17528,69 +18047,68 @@ case 0: /*<>*/ var rest = fmt$0[1], - /*<>*/ _by_ = - make_iprintf(k$0, o, rest); - /*<>*/ return function(_ch_){ - /*<>*/ return _by_;}; + /*<>*/ x = make_iprintf(k$0, o, rest); + /*<>*/ return function(_b$_){ + /*<>*/ return x;}; case 1: /*<>*/ var rest$0 = fmt$0[1], - /*<>*/ _bz_ = + /*<>*/ x$0 = make_iprintf(k$0, o, rest$0); - /*<>*/ return function(_cg_){ - /*<>*/ return _bz_;}; + /*<>*/ return function(_b__){ + /*<>*/ return x$0;}; case 2: - var _bA_ = fmt$0[1]; - if(typeof _bA_ === "number"){ + var _bM_ = fmt$0[1]; + if(typeof _bM_ === "number"){ /*<>*/ var rest$1 = fmt$0[2], - /*<>*/ _bB_ = + /*<>*/ x$1 = make_iprintf(k$0, o, rest$1); - /*<>*/ return function(_cf_){ - /*<>*/ return _bB_;}; + /*<>*/ return function(_b9_){ + /*<>*/ return x$1;}; } - if(0 === _bA_[0]){ + if(0 === _bM_[0]){ /*<>*/ var rest$2 = fmt$0[2], - /*<>*/ _bC_ = + /*<>*/ x$2 = make_iprintf(k$0, o, rest$2); - /*<>*/ return function(_ce_){ - /*<>*/ return _bC_;}; + /*<>*/ return function(_b8_){ + /*<>*/ return x$2;}; } /*<>*/ var rest$3 = fmt$0[2], - /*<>*/ _bD_ = + /*<>*/ x$3 = make_iprintf(k$0, o, rest$3), - /*<>*/ _bE_ = - function(_cd_){ /*<>*/ return _bD_;}; - /*<>*/ return function(_cc_){ - /*<>*/ return _bE_;}; + /*<>*/ x$4 = + function(_b7_){ /*<>*/ return x$3;}; + /*<>*/ return function(_b6_){ + /*<>*/ return x$4;}; case 3: - var _bF_ = fmt$0[1]; - if(typeof _bF_ === "number"){ + var _bN_ = fmt$0[1]; + if(typeof _bN_ === "number"){ /*<>*/ var rest$4 = fmt$0[2], - /*<>*/ _bG_ = + /*<>*/ x$5 = make_iprintf(k$0, o, rest$4); - /*<>*/ return function(_cb_){ - /*<>*/ return _bG_;}; + /*<>*/ return function(_b5_){ + /*<>*/ return x$5;}; } - if(0 === _bF_[0]){ + if(0 === _bN_[0]){ /*<>*/ var rest$5 = fmt$0[2], - /*<>*/ _bH_ = + /*<>*/ x$6 = make_iprintf(k$0, o, rest$5); - /*<>*/ return function(_ca_){ - /*<>*/ return _bH_;}; + /*<>*/ return function(_b4_){ + /*<>*/ return x$6;}; } /*<>*/ var rest$6 = fmt$0[2], - /*<>*/ _bI_ = + /*<>*/ x$7 = make_iprintf(k$0, o, rest$6), - /*<>*/ _bJ_ = - function(_b$_){ /*<>*/ return _bI_;}; - /*<>*/ return function(_b__){ - /*<>*/ return _bJ_;}; + /*<>*/ x$8 = + function(_b3_){ /*<>*/ return x$7;}; + /*<>*/ return function(_b2_){ + /*<>*/ return x$8;}; case 4: var rest$7 = fmt$0[4], prec = fmt$0[3], pad = fmt$0[2]; /*<>*/ return fn_of_padding_precision @@ -17612,139 +18130,132 @@ /*<>*/ return fn_of_padding_precision (k$0, o, rest$11, pad$3, prec$3); case 9: - var _bK_ = fmt$0[1]; - if(typeof _bK_ === "number"){ + var _bO_ = fmt$0[1]; + if(typeof _bO_ === "number"){ /*<>*/ var rest$12 = fmt$0[2], - /*<>*/ _bL_ = + /*<>*/ x$9 = make_iprintf(k$0, o, rest$12); - /*<>*/ return function(_b9_){ - /*<>*/ return _bL_;}; + /*<>*/ return function(_b1_){ + /*<>*/ return x$9;}; } - if(0 === _bK_[0]){ + if(0 === _bO_[0]){ /*<>*/ var rest$13 = fmt$0[2], - /*<>*/ _bM_ = + /*<>*/ x$10 = make_iprintf(k$0, o, rest$13); - /*<>*/ return function(_b8_){ - /*<>*/ return _bM_;}; + /*<>*/ return function(_b0_){ + /*<>*/ return x$10;}; } /*<>*/ var rest$14 = fmt$0[2], - /*<>*/ _bN_ = + /*<>*/ x$11 = make_iprintf(k$0, o, rest$14), - /*<>*/ _bO_ = - function(_b7_){ /*<>*/ return _bN_;}; - /*<>*/ return function(_b6_){ - /*<>*/ return _bO_;}; + /*<>*/ x$12 = + function(_bZ_){ /*<>*/ return x$11;}; + /*<>*/ return function(_bY_){ + /*<>*/ return x$12;}; case 10: - var rest$15 = fmt$0[1], fmt$0 = rest$15; continue; + var rest$15 = fmt$0[1]; fmt$0 = rest$15; break; case 11: - var rest$16 = fmt$0[2], fmt$0 = rest$16; continue; + var rest$16 = fmt$0[2]; fmt$0 = rest$16; break; case 12: - var rest$17 = fmt$0[2], fmt$0 = rest$17; continue; + var rest$17 = fmt$0[2]; fmt$0 = rest$17; break; case 13: /*<>*/ var rest$18 = fmt$0[3], - /*<>*/ _bP_ = + /*<>*/ x$13 = make_iprintf(k$0, o, rest$18); - /*<>*/ return function(_b5_){ - /*<>*/ return _bP_;}; + /*<>*/ return function(_bX_){ + /*<>*/ return x$13;}; case 14: var rest$19 = fmt$0[3], fmtty = fmt$0[2]; /*<>*/ return function(param){ /*<>*/ var fmt = param[1], - /*<>*/ _b4_ = recast(fmt, fmtty); + /*<>*/ _bW_ = recast(fmt, fmtty); /*<>*/ return make_iprintf (k$0, o, /*<>*/ caml_call2 - (CamlinternalFormatBasics[3], _b4_, rest$19)); /*<>*/ }; + (CamlinternalFormatBasics[3], _bW_, rest$19)); /*<>*/ }; case 15: /*<>*/ var rest$20 = fmt$0[1], - /*<>*/ _bQ_ = + /*<>*/ x$14 = make_iprintf(k$0, o, rest$20), - /*<>*/ _bR_ = - function(_b3_){ /*<>*/ return _bQ_;}; - /*<>*/ return function(_b2_){ - /*<>*/ return _bR_;}; + /*<>*/ x$15 = + function(_bV_){ /*<>*/ return x$14;}; + /*<>*/ return function(_bU_){ + /*<>*/ return x$15;}; case 16: /*<>*/ var rest$21 = fmt$0[1], - /*<>*/ _bS_ = + /*<>*/ x$16 = make_iprintf(k$0, o, rest$21); - /*<>*/ return function(_b1_){ - /*<>*/ return _bS_;}; + /*<>*/ return function(_bT_){ + /*<>*/ return x$16;}; case 17: - var rest$22 = fmt$0[2], fmt$0 = rest$22; continue; + var rest$22 = fmt$0[2]; fmt$0 = rest$22; break; case 18: - var _bT_ = fmt$0[1]; - if(0 === _bT_[0]){ + var _bP_ = fmt$0[1]; + if(0 === _bP_[0]){ + var rest$23 = fmt$0[2], fmt$1 = _bP_[1][1]; + let k = k$0, rest = rest$23; var - rest$23 = fmt$0[2], - fmt$1 = _bT_[1][1], - k$3 = - function(k, rest){ - function k$0(koc){ - /*<>*/ return make_iprintf - (k, koc, rest); - /*<>*/ } - return k$0; - }, - k$1 = k$3(k$0, rest$23), - k$0 = k$1, - fmt$0 = fmt$1; - continue; + k$1 = + function(koc){ + /*<>*/ return make_iprintf + (k, koc, rest); + /*<>*/ }; + k$0 = k$1; + fmt$0 = fmt$1; } - var - rest$24 = fmt$0[2], - fmt$2 = _bT_[1][1], - k$4 = - function(k, rest){ - function k$0(koc){ + else{ + var rest$24 = fmt$0[2], fmt$2 = _bP_[1][1]; + let k = k$0, rest = rest$24; + var + k$2 = + function(koc){ /*<>*/ return make_iprintf (k, koc, rest); - /*<>*/ } - return k$0; - }, - k$2 = k$4(k$0, rest$24), - k$0 = k$2, + /*<>*/ }; + k$0 = k$2; fmt$0 = fmt$2; - continue; + } + break; case 19: /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _w_], 1); case 20: /*<>*/ var rest$25 = fmt$0[3], - /*<>*/ _bU_ = + /*<>*/ x$17 = make_iprintf(k$0, o, rest$25); - /*<>*/ return function(_b0_){ - /*<>*/ return _bU_;}; + /*<>*/ return function(_bS_){ + /*<>*/ return x$17;}; case 21: /*<>*/ var rest$26 = fmt$0[2], - /*<>*/ _bV_ = + /*<>*/ x$18 = make_iprintf(k$0, o, rest$26); - /*<>*/ return function(_bZ_){ - /*<>*/ return _bV_;}; + /*<>*/ return function(_bR_){ + /*<>*/ return x$18;}; case 22: /*<>*/ var rest$27 = fmt$0[1], - /*<>*/ _bW_ = + /*<>*/ x$19 = make_iprintf(k$0, o, rest$27); - /*<>*/ return function(_bY_){ - /*<>*/ return _bW_;}; + /*<>*/ return function(_bQ_){ + /*<>*/ return x$19;}; case 23: - var rest$28 = fmt$0[2], ign = fmt$0[1], _bX_ = 0; + var rest$28 = fmt$0[2], ign = fmt$0[1]; /*<>*/ return make_ignored_param (function(param){ /*<>*/ return caml_call1 (k$0, o); /*<>*/ }, - _bX_, + 0, ign, rest$28); default: @@ -17758,14 +18269,84 @@ } } /*<>*/ } + function make_iprintf(k, o, fmt){ + /*<>*/ return caml_trampoline(make_iprintf$0(0, k, o, fmt)); + } + function fn_of_padding_precision(k, o, fmt, pad, prec){ + /*<>*/ if(typeof pad === "number"){ + if(typeof prec !== "number"){ + /*<>*/ /*<>*/ var + x$2 = make_iprintf(k, o, fmt); + /*<>*/ return function(_bL_){ + /*<>*/ return x$2;}; + } + if(prec){ + /*<>*/ var + /*<>*/ x = make_iprintf(k, o, fmt), + /*<>*/ x$0 = + function(_bK_){ /*<>*/ return x;}; + /*<>*/ return function(_bJ_){ + /*<>*/ return x$0;}; + } + /*<>*/ /*<>*/ var + x$1 = make_iprintf(k, o, fmt); + /*<>*/ return function(_bI_){ + /*<>*/ return x$1;}; + } + if(0 === pad[0]){ + if(typeof prec !== "number"){ + /*<>*/ /*<>*/ var + x$6 = make_iprintf(k, o, fmt); + /*<>*/ return function(_bH_){ + /*<>*/ return x$6;}; + } + if(prec){ + /*<>*/ var + /*<>*/ x$3 = make_iprintf(k, o, fmt), + /*<>*/ x$4 = + function(_bG_){ /*<>*/ return x$3;}; + /*<>*/ return function(_bF_){ + /*<>*/ return x$4;}; + } + /*<>*/ /*<>*/ var + x$5 = make_iprintf(k, o, fmt); + /*<>*/ return function(_bE_){ + /*<>*/ return x$5;}; + } + if(typeof prec !== "number"){ + /*<>*/ var + /*<>*/ x$12 = make_iprintf(k, o, fmt), + /*<>*/ x$13 = + function(_bD_){ /*<>*/ return x$12;}; + /*<>*/ return function(_bC_){ + /*<>*/ return x$13;}; + } + if(prec){ + /*<>*/ var + /*<>*/ x$7 = make_iprintf(k, o, fmt), + /*<>*/ x$8 = + function(_bB_){ /*<>*/ return x$7;}, + /*<>*/ x$9 = + function(_bA_){ /*<>*/ return x$8;}; + /*<>*/ return function(_bz_){ + /*<>*/ return x$9;}; + } + /*<>*/ /*<>*/ var + x$10 = make_iprintf(k, o, fmt); + /*<>*/ function x$11(_by_){ + /*<>*/ return x$10; + } + /*<>*/ return function(_bx_){ + /*<>*/ return x$11;}; + /*<>*/ } function fn_of_custom_arity$0(counter, k, o, fmt, param){ - /*<>*/ if(param){ + /*<>*/ if(param){ /*<>*/ var arity = param[1], - /*<>*/ _bw_ = + /*<>*/ x = fn_of_custom_arity(k, o, fmt, arity); - /*<>*/ return function(_bx_){ - /*<>*/ return _bw_;}; + /*<>*/ return function(_bw_){ + /*<>*/ return x;}; } /*<>*/ if(counter >= 50) /*<>*/ return /*<>*/ caml_trampoline_return @@ -17773,9 +18354,6 @@ var counter$0 = counter + 1 | 0; /*<>*/ return make_iprintf$0 (counter$0, k, o, fmt); - /*<>*/ } - function make_iprintf(k, o, fmt){ - /*<>*/ return caml_trampoline(make_iprintf$0(0, k, o, fmt)); } function fn_of_custom_arity(k, o, fmt, param){ /*<>*/ return caml_trampoline @@ -17803,15 +18381,16 @@ /*<>*/ output_acc(o, p$0); /*<>*/ /*<>*/ caml_call2 (Stdlib[66], o, cst$18); - var acc$0 = acc$1; - continue; + acc$0 = acc$1; } - var acc$2 = match[1]; - /*<>*/ output_acc(o, p$0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib[66], o, cst$19); - var acc$0 = acc$2; - continue; + else{ + var acc$2 = match[1]; + /*<>*/ output_acc(o, p$0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib[66], o, cst$19); + acc$0 = acc$2; + } + break; case 6: var f = acc$0[2], p$3 = acc$0[1]; /*<>*/ output_acc(o, p$3); @@ -17863,22 +18442,23 @@ /*<>*/ bufput_acc(b, p$0); /*<>*/ /*<>*/ caml_call2 (Stdlib_Buffer[16], b, cst$20); - var acc$0 = acc$1; - continue; + acc$0 = acc$1; } - var acc$2 = match[1]; - /*<>*/ bufput_acc(b, p$0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Buffer[16], b, cst$21); - var acc$0 = acc$2; - continue; + else{ + var acc$2 = match[1]; + /*<>*/ bufput_acc(b, p$0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Buffer[16], b, cst$21); + acc$0 = acc$2; + } + break; case 6: var f = acc$0[2], p$3 = acc$0[1]; /*<>*/ bufput_acc(b, p$3); /*<>*/ return /*<>*/ caml_call1 (f, b); case 7: - var acc$3 = acc$0[1], acc$0 = acc$3; continue; + var acc$3 = acc$0[1]; acc$0 = acc$3; break; case 8: var msg = acc$0[2], p$4 = acc$0[1]; /*<>*/ bufput_acc(b, p$4); @@ -17920,15 +18500,16 @@ /*<>*/ strput_acc(b, p$0); /*<>*/ /*<>*/ caml_call2 (Stdlib_Buffer[16], b, cst$22); - var acc$0 = acc$1; - continue; + acc$0 = acc$1; } - var acc$2 = match[1]; - /*<>*/ strput_acc(b, p$0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Buffer[16], b, cst$23); - var acc$0 = acc$2; - continue; + else{ + var acc$2 = match[1]; + /*<>*/ strput_acc(b, p$0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Buffer[16], b, cst$23); + acc$0 = acc$2; + } + break; case 6: var f = acc$0[2], p$3 = acc$0[1]; /*<>*/ strput_acc(b, p$3); @@ -17937,7 +18518,7 @@ /*<>*/ return /*<>*/ caml_call2 (Stdlib_Buffer[16], b, _bv_); case 7: - var acc$3 = acc$0[1], acc$0 = acc$3; continue; + var acc$3 = acc$0[1]; acc$0 = acc$3; break; case 8: var msg = acc$0[2], p$4 = acc$0[1]; /*<>*/ strput_acc(b, p$4); @@ -17975,9 +18556,7 @@ /*<>*/ return make_printf(k, 0, fmt); } function open_box_of_string(str){ - /*<>*/ if - ( /*<>*/ runtime.caml_string_equal - (str, cst$43)) + /*<>*/ if(str == cst$43) /*<>*/ return _x_; var len = caml_ml_string_length(str); function invalid_box(param){ @@ -17993,92 +18572,85 @@ /*<>*/ caml_string_get(str, i$0); if(9 !== match && 32 !== match) /*<>*/ return i$0; - /*<>*/ var - /*<>*/ i$1 = i$0 + 1 | 0, - i$0 = i$1; + /*<>*/ /*<>*/ var + i$1 = i$0 + 1 | 0; + i$0 = i$1; } /*<>*/ } - /*<>*/ var - /*<>*/ wstart = parse_spaces(0), - wend = wstart; - /*<>*/ for(;;){ - if - (wend !== len - && - 25 - >= + /*<>*/ /*<>*/ var + wstart = parse_spaces(0); + a: + b: + { + var wend = wstart; + /*<>*/ for(;;){ + if(wend === len) break b; + if + (25 + < /*<>*/ caml_string_get(str, wend) - 97 - >>> 0){ - /*<>*/ var - /*<>*/ j = wend + 1 | 0, - wend = j; - continue; + >>> 0) + break; + /*<>*/ /*<>*/ var + j = wend + 1 | 0; + wend = j; } - /*<>*/ var - /*<>*/ box_name = - /*<>*/ caml_call3 - (Stdlib_String[15], str, wstart, wend - wstart | 0), - /*<>*/ nstart = parse_spaces(wend), - nend = nstart; + break a; + } + /*<>*/ var + /*<>*/ box_name = + /*<>*/ caml_call3 + (Stdlib_String[16], str, wstart, wend - wstart | 0), + /*<>*/ nstart = parse_spaces(wend); + a: + b: + { + var nend = nstart; /*<>*/ for(;;){ - if(nend !== len){ - /*<>*/ var - /*<>*/ match = - /*<>*/ caml_string_get(str, nend), - switch$0 = 0; - if(48 <= match){ - if(58 > match) switch$0 = 1; - } - else if(45 === match) switch$0 = 1; - if(switch$0){ - /*<>*/ var - /*<>*/ j$0 = nend + 1 | 0, - nend = j$0; - continue; - } - } - if(nstart === nend) - var indent = 0; - else - /*<>*/ try{ - /*<>*/ var - /*<>*/ _bs_ = - /*<>*/ runtime.caml_int_of_string - ( /*<>*/ caml_call3 - (Stdlib_String[15], str, nstart, nend - nstart | 0)), - indent = _bs_; - } - catch(_bt_){ - var _br_ = caml_wrap_exception(_bt_); - if(_br_[1] !== Stdlib[7]) throw caml_maybe_attach_backtrace(_br_, 0); - var indent = invalid_box(0); - } - /*<>*/ /*<>*/ var - exp_end = parse_spaces(nend); - if(exp_end !== len) - /*<>*/ invalid_box(0); - var switch$1 = 0; - if - (caml_string_notequal(box_name, cst$43) - && caml_string_notequal(box_name, "b")) - var - box_type = - caml_string_notequal(box_name, "h") - ? caml_string_notequal - (box_name, "hov") - ? caml_string_notequal - (box_name, "hv") - ? caml_string_notequal(box_name, "v") ? invalid_box(0) : 1 - : 2 - : 3 - : 0; - else - switch$1 = 1; - if(switch$1) var box_type = 4; - /*<>*/ return [0, indent, box_type]; + if(nend === len) break b; + /*<>*/ /*<>*/ var + match = + /*<>*/ caml_string_get(str, nend); + if(48 <= match){if(58 <= match) break;} else if(45 !== match) break; + /*<>*/ /*<>*/ var + j$0 = nend + 1 | 0; + nend = j$0; } + break a; } + if(nstart === nend) + var indent = 0; + else + /*<>*/ try{ + /*<>*/ var + /*<>*/ _bs_ = + /*<>*/ runtime.caml_int_of_string + ( /*<>*/ caml_call3 + (Stdlib_String[16], str, nstart, nend - nstart | 0)), + indent = _bs_; + } + catch(_bt_){ + var _br_ = caml_wrap_exception(_bt_); + if(_br_[1] !== Stdlib[7]) throw caml_maybe_attach_backtrace(_br_, 0); + var indent = invalid_box(0); + } + /*<>*/ /*<>*/ var + exp_end = parse_spaces(nend); + if(exp_end !== len) /*<>*/ invalid_box(0); + a: + { + if(box_name !== cst$43 && box_name !== "b"){ + if(box_name === "h"){var box_type = 0; break a;} + if(box_name === "hov"){var box_type = 3; break a;} + if(box_name === "hv"){var box_type = 2; break a;} + if(box_name !== "v"){var box_type = invalid_box(0); break a;} + var box_type = 1; + break a; + } + var box_type = 4; + } + /*<>*/ return [0, indent, box_type]; /*<>*/ } function make_padding_fmt_ebb(pad, fmt){ /*<>*/ if(typeof pad === "number") @@ -18092,9 +18664,9 @@ /*<>*/ } function make_padprec_fmt_ebb(pad, prec, fmt){ /*<>*/ if(typeof prec === "number") - var match = prec ? [0, 1, fmt] : [0, 0, fmt]; + var match = prec ? [0, 1] : [0, 0]; else - var p = prec[1], match = [0, [0, p], fmt]; + var p = prec[1], match = [0, [0, p]]; var prec$0 = match[1]; /*<>*/ if(typeof pad === "number") /*<>*/ return [0, 0, prec$0, fmt]; @@ -18114,11 +18686,6 @@ /*<>*/ return /*<>*/ caml_call3 (failwith_message(_z_), str, str_ind, msg); /*<>*/ } - /*<>*/ function unexpected_end_of_format - (end_ind){ - /*<>*/ return invalid_format_message - (end_ind, cst_unexpected_end_of_format); - /*<>*/ } function invalid_format_without(str_ind, c, s){ /*<>*/ return /*<>*/ caml_call4 (failwith_message(_A_), str, str_ind, c, s); @@ -18127,136 +18694,119 @@ /*<>*/ return /*<>*/ caml_call4 (failwith_message(_B_), str, str_ind, expected, read); /*<>*/ } - function add_literal(lit_start, str_ind, fmt){ - /*<>*/ var - size = str_ind - lit_start | 0; - return 0 === size - ? [0, fmt] - : 1 - === size - ? [0, - [12, - /*<>*/ caml_string_get - (str, lit_start), - fmt]] - : [0, - [11, - /*<>*/ caml_call3 - (Stdlib_String[15], str, lit_start, size), - fmt]]; - /*<>*/ } function parse(lit_start, end_ind){ - /*<>*/ var str_ind = lit_start; - /*<>*/ for(;;){ - if(str_ind === end_ind) - /*<>*/ return add_literal - (lit_start, str_ind, 0); - /*<>*/ /*<>*/ var - match = - /*<>*/ caml_string_get(str, str_ind); - if(37 === match){ - var str_ind$2 = str_ind + 1 | 0; - if(str_ind$2 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - var - match$1 = - 95 - === - /*<>*/ caml_string_get - (str, str_ind$2) - ? parse_flags(str_ind, str_ind$2 + 1 | 0, end_ind, 1) - : parse_flags(str_ind, str_ind$2, end_ind, 0), - fmt_rest = match$1[1]; - /*<>*/ return add_literal - (lit_start, str_ind, fmt_rest); - } - if(64 !== match){ - var str_ind$1 = str_ind + 1 | 0, str_ind = str_ind$1; - continue; + /*<>*/ a: + { + var str_ind = lit_start; + /*<>*/ for(;;){ + if(str_ind === end_ind) + /*<>*/ return add_literal + (lit_start, str_ind, 0); + /*<>*/ /*<>*/ var + match = + /*<>*/ caml_string_get(str, str_ind); + if(37 === match) break; + if(64 === match) break a; + var str_ind$1 = str_ind + 1 | 0; + str_ind = str_ind$1; } - var str_ind$0 = str_ind + 1 | 0; - if(str_ind$0 === end_ind) - var match$0 = _N_; - else{ - /*<>*/ var - /*<>*/ c = - /*<>*/ caml_string_get - (str, str_ind$0), - switch$0 = 0; - if(65 <= c) - if(94 <= c){ - /*<>*/ /*<>*/ var - switcher = c - 123 | 0; - if(2 < switcher >>> 0) - switch$0 = 1; - else - switch(switcher){ - case 0: - var match$0 = parse_tag(1, str_ind$0 + 1 | 0, end_ind); break; - case 1: - switch$0 = 1; break; - default: - var - fmt_rest$2 = parse(str_ind$0 + 1 | 0, end_ind)[1], - match$0 = [0, [17, 1, fmt_rest$2]]; - } - } - else if(91 <= c) - switch(c - 91 | 0){ + var str_ind$2 = str_ind + 1 | 0; + if(str_ind$2 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + var + match$1 = + 95 + === + /*<>*/ caml_string_get + (str, str_ind$2) + ? parse_flags(str_ind, str_ind$2 + 1 | 0, end_ind, 1) + : parse_flags(str_ind, str_ind$2, end_ind, 0), + fmt_rest = match$1[1]; + /*<>*/ return add_literal + (lit_start, str_ind, fmt_rest); + } + var str_ind$0 = str_ind + 1 | 0; + a: + if(str_ind$0 === end_ind) + var match$0 = _N_; + else{ + /*<>*/ /*<>*/ var + c = + /*<>*/ caml_string_get + (str, str_ind$0); + if(65 <= c){ + if(94 <= c){ + /*<>*/ /*<>*/ var + switcher = c - 123 | 0; + if(2 >= switcher >>> 0) + switch(switcher){ case 0: - var match$0 = parse_tag(0, str_ind$0 + 1 | 0, end_ind); break; - case 1: - switch$0 = 1; break; + var match$0 = parse_tag(1, str_ind$0 + 1 | 0, end_ind); break a; + case 1: break; default: var - fmt_rest$3 = parse(str_ind$0 + 1 | 0, end_ind)[1], - match$0 = [0, [17, 0, fmt_rest$3]]; + fmt_rest$2 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 1, fmt_rest$2]]; + break a; } - else - switch$0 = 1; - else if(10 === c) + } + else if(91 <= c) + switch(c - 91 | 0){ + case 0: + var match$0 = parse_tag(0, str_ind$0 + 1 | 0, end_ind); break a; + case 1: break; + default: + var + fmt_rest$3 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 0, fmt_rest$3]]; + break a; + } + } + else{ + if(10 === c){ var fmt_rest$4 = parse(str_ind$0 + 1 | 0, end_ind)[1], match$0 = [0, [17, 3, fmt_rest$4]]; - else if(32 <= c) + break a; + } + if(32 <= c) switch(c - 32 | 0){ case 0: var fmt_rest$5 = parse(str_ind$0 + 1 | 0, end_ind)[1], match$0 = [0, [17, _O_, fmt_rest$5]]; - break; + break a; case 5: - var switch$1 = 0; /*<>*/ if ((str_ind$0 + 1 | 0) < end_ind && 37 === /*<>*/ caml_string_get - (str, str_ind$0 + 1 | 0)) + (str, str_ind$0 + 1 | 0)){ var fmt_rest$6 = parse(str_ind$0 + 2 | 0, end_ind)[1], match$0 = [0, [17, 6, fmt_rest$6]]; - else - switch$1 = 1; - if(switch$1) - var - fmt_rest$7 = parse(str_ind$0, end_ind)[1], - match$0 = [0, [12, 64, fmt_rest$7]]; - break; + break a; + } + var + fmt_rest$7 = parse(str_ind$0, end_ind)[1], + match$0 = [0, [12, 64, fmt_rest$7]]; + break a; case 12: var fmt_rest$8 = parse(str_ind$0 + 1 | 0, end_ind)[1], match$0 = [0, [17, _P_, fmt_rest$8]]; - break; + break a; case 14: var fmt_rest$9 = parse(str_ind$0 + 1 | 0, end_ind)[1], match$0 = [0, [17, 4, fmt_rest$9]]; - break; + break a; case 27: var str_ind$3 = str_ind$0 + 1 | 0; + b: try{ var _bg_ = str_ind$3 === end_ind ? 1 : 0, @@ -18277,15 +18827,16 @@ parse_spaces(str_ind$3 + 1 | 0, end_ind), /*<>*/ match$2 = /*<>*/ caml_string_get - (str, str_ind_1), - switch$2 = 0; - if(48 <= match$2){ - if(58 > match$2) switch$2 = 1; - } - else if(45 === match$2) switch$2 = 1; - if(! switch$2) + (str, str_ind_1); + c: + { + if(48 <= match$2){ + if(58 > match$2) break c; + } + else if(45 === match$2) break c; /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); + } /*<>*/ var /*<>*/ match$3 = parse_integer(str_ind_1, end_ind), @@ -18297,14 +18848,13 @@ /*<>*/ caml_string_get (str, str_ind_3) - 45 - | 0, - switch$3 = 0; - if(12 < switcher$0 >>> 0) - if(17 === switcher$0) + | 0; + if(12 < switcher$0 >>> 0){ + if(17 === switcher$0){ /*<>*/ var /*<>*/ s = /*<>*/ caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], str, str_ind$3 - 2 | 0, (str_ind_3 - str_ind$3 | 0) + 3 | 0), @@ -18312,8 +18862,9 @@ /*<>*/ _bj_ = str_ind_3 + 1 | 0, formatting_lit$0 = _bi_, next_ind = _bj_; - else - switch$3 = 1; + break b; + } + } else if(1 < switcher$0 - 1 >>> 0){ /*<>*/ var /*<>*/ match$4 = @@ -18332,7 +18883,7 @@ /*<>*/ var /*<>*/ s$0 = /*<>*/ caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], str, str_ind$3 - 2 | 0, (str_ind_5 - str_ind$3 | 0) + 3 | 0), @@ -18341,12 +18892,10 @@ /*<>*/ _bl_ = str_ind_5 + 1 | 0, formatting_lit$0 = _bk_, next_ind = _bl_; + break b; } - else - switch$3 = 1; - if(switch$3) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[8], 1); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); } catch(_bq_){ var _bf_ = caml_wrap_exception(_bq_); @@ -18357,7 +18906,7 @@ var fmt_rest$12 = parse(next_ind, end_ind)[1], match$0 = [0, [17, formatting_lit$0, fmt_rest$12]]; - break; + break a; case 28: var str_ind$4 = str_ind$0 + 1 | 0; /*<>*/ try{ @@ -18366,13 +18915,18 @@ parse_spaces(str_ind$4, end_ind), /*<>*/ match$6 = /*<>*/ caml_string_get - (str, str_ind_1$0), - switch$4 = 0; - if(48 <= match$6){ - if(58 > match$6) switch$4 = 1; - } - else if(45 === match$6) switch$4 = 1; - if(switch$4){ + (str, str_ind_1$0); + b: + { + c: + { + if(48 <= match$6){ + if(58 > match$6) break c; + } + else if(45 === match$6) break c; + var _bo_ = 0; + break b; + } /*<>*/ var /*<>*/ match$7 = parse_integer(str_ind_1$0, end_ind), @@ -18390,14 +18944,12 @@ /*<>*/ var /*<>*/ s$1 = /*<>*/ caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], str, str_ind$4 - 2 | 0, (str_ind_3$0 - str_ind$4 | 0) + 3 | 0), _bo_ = [0, [0, str_ind_3$0 + 1 | 0, [1, s$1, size]]]; } - else - var _bo_ = 0; var _bn_ = _bo_; } catch(_bp_){ @@ -18418,31 +18970,314 @@ fmt_rest$14 = parse(str_ind$4, end_ind)[1], _be_ = [0, [17, _Q_, fmt_rest$14]]; var match$0 = _be_; - break; + break a; case 31: var fmt_rest$10 = parse(str_ind$0 + 1 | 0, end_ind)[1], match$0 = [0, [17, 2, fmt_rest$10]]; - break; + break a; case 32: var fmt_rest$11 = parse(str_ind$0 + 1 | 0, end_ind)[1], match$0 = [0, [17, 5, fmt_rest$11]]; - break; - default: switch$0 = 1; + break a; } - else - switch$0 = 1; - if(switch$0) - var - fmt_rest$1 = parse(str_ind$0 + 1 | 0, end_ind)[1], - match$0 = [0, [17, [2, c], fmt_rest$1]]; } - var fmt_rest$0 = match$0[1]; - /*<>*/ return add_literal - (lit_start, str_ind, fmt_rest$0); + var + fmt_rest$1 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, [2, c], fmt_rest$1]]; + } + var fmt_rest$0 = match$0[1]; + /*<>*/ return add_literal + (lit_start, str_ind, fmt_rest$0); + /*<>*/ } + function parse_flags(pct_ind, str_ind, end_ind, ign){ + /*<>*/ var + /*<>*/ zero = [0, 0], + /*<>*/ minus = [0, 0], + /*<>*/ plus = [0, 0], + /*<>*/ space = [0, 0], + /*<>*/ hash = [0, 0]; + function set_flag(str_ind, flag){ + /*<>*/ var + _bb_ = flag[1], + _bc_ = _bb_ ? 1 - legacy_behavior$0 : _bb_; + if(_bc_){ + /*<>*/ /*<>*/ var + _bd_ = + /*<>*/ caml_string_get(str, str_ind); + /*<>*/ /*<>*/ caml_call3 + (failwith_message(_C_), str, str_ind, _bd_); + } + flag[1] = 1; + return; + /*<>*/ } + a: + b: + { + var str_ind$0 = str_ind; + c: + /*<>*/ for(;;){ + if(str_ind$0 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ /*<>*/ var + switcher = + /*<>*/ caml_string_get + (str, str_ind$0) + - 32 + | 0; + if(16 < switcher >>> 0) break b; + switch(switcher){ + case 0: + /*<>*/ set_flag(str_ind$0, space); + /*<>*/ /*<>*/ var + str_ind$1 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$1; + break; + case 3: + /*<>*/ set_flag(str_ind$0, hash); + /*<>*/ /*<>*/ var + str_ind$2 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$2; + break; + case 11: + /*<>*/ set_flag(str_ind$0, plus); + /*<>*/ /*<>*/ var + str_ind$3 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$3; + break; + case 13: + /*<>*/ set_flag(str_ind$0, minus); + /*<>*/ /*<>*/ var + str_ind$4 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$4; + break; + case 16: + /*<>*/ set_flag(str_ind$0, zero); + /*<>*/ /*<>*/ var + str_ind$5 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$5; + break; + default: break c; + } + } + break a; } - /*<>*/ } + var + space$0 = space[1], + hash$0 = hash[1], + plus$0 = plus[1], + minus$0 = minus[1], + zero$0 = zero[1]; + if(str_ind$0 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ var + padty = + zero$0 + ? minus$0 + ? legacy_behavior$0 + ? 0 + : incompatible_flag(pct_ind, str_ind$0, 45, cst_0) + : 2 + : minus$0 ? 0 : 1, + /*<>*/ match = + /*<>*/ caml_string_get(str, str_ind$0); + if(48 <= match){ + if(58 > match){ + /*<>*/ var + /*<>*/ match$0 = + parse_positive(str_ind$0, end_ind, 0), + width = match$0[2], + new_ind = match$0[1]; + /*<>*/ return parse_after_padding + (pct_ind, + new_ind, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + [0, padty, width]); + } + } + else if(42 === match) + /*<>*/ return parse_after_padding + (pct_ind, + str_ind$0 + 1 | 0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + [1, padty]); + switch(padty){ + case 0: + if(1 - legacy_behavior$0) + /*<>*/ invalid_format_without + (str_ind$0 - 1 | 0, 45, cst_padding); + /*<>*/ return parse_after_padding + (pct_ind, + str_ind$0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + 0); + case 1: + /*<>*/ return parse_after_padding + (pct_ind, + str_ind$0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + 0); + default: + /*<>*/ return parse_after_padding + (pct_ind, + str_ind$0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + _D_); + } + /*<>*/ } + function parse_after_padding + (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad){ + /*<>*/ if(str_ind === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ /*<>*/ var + symb = + /*<>*/ caml_string_get(str, str_ind); + if(46 !== symb) + /*<>*/ return parse_conversion + (pct_ind, + str_ind + 1 | 0, + end_ind, + plus, + hash, + space, + ign, + pad, + 0, + pad, + symb); + var str_ind$0 = str_ind + 1 | 0; + if(str_ind$0 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + function parse_literal(minus, str_ind){ + /*<>*/ var + /*<>*/ match = + parse_positive(str_ind, end_ind, 0), + prec = match[2], + new_ind = match[1]; + /*<>*/ return parse_after_precision + (pct_ind, + new_ind, + end_ind, + minus, + plus, + hash, + space, + ign, + pad, + [0, prec]); + /*<>*/ } + /*<>*/ /*<>*/ var + symb$0 = + /*<>*/ caml_string_get(str, str_ind$0); + if(48 <= symb$0){ + if(58 > symb$0) + /*<>*/ return parse_literal + (minus, str_ind$0); + } + else if(42 <= symb$0) + switch(symb$0 - 42 | 0){ + case 0: + /*<>*/ return parse_after_precision + (pct_ind, + str_ind$0 + 1 | 0, + end_ind, + minus, + plus, + hash, + space, + ign, + pad, + 1); + case 1: + case 3: + if(legacy_behavior$0){ + /*<>*/ var + /*<>*/ _ba_ = str_ind$0 + 1 | 0, + minus$0 = minus || (45 === symb$0 ? 1 : 0); + /*<>*/ return parse_literal + (minus$0, _ba_); + } + break; + } + return legacy_behavior$0 + ? parse_after_precision + (pct_ind, + str_ind$0, + end_ind, + minus, + plus, + hash, + space, + ign, + pad, + _E_) + : invalid_format_without(str_ind$0 - 1 | 0, 46, cst_precision); + /*<>*/ } + function parse_after_precision + (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad, prec){ + /*<>*/ if(str_ind === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + function parse_conv(padprec){ + /*<>*/ return parse_conversion + (pct_ind, + str_ind + 1 | 0, + end_ind, + plus, + hash, + space, + ign, + pad, + prec, + padprec, + /*<>*/ caml_string_get + (str, str_ind)); + /*<>*/ } + if(typeof pad !== "number") + /*<>*/ return parse_conv(pad); + if(typeof prec === "number" && ! prec) + /*<>*/ return parse_conv(0); + if(minus){ + if(typeof prec === "number") + /*<>*/ return parse_conv(_F_); + var n = prec[1]; + /*<>*/ return parse_conv([0, 0, n]); + } + if(typeof prec === "number") + /*<>*/ return parse_conv(_G_); + var n$0 = prec[1]; + /*<>*/ return parse_conv([0, 1, n$0]); + /*<>*/ } function parse_conversion (pct_ind, str_ind, @@ -18555,985 +19390,698 @@ /*<>*/ return opt_of_pad (c, get_padprec(0)); /*<>*/ } - var switch$0 = 0; - /*<>*/ if(124 <= symb) - switch$0 = 1; - else - switch(symb){ - case 33: - var - fmt_rest$5 = parse(str_ind, end_ind)[1], - fmt_result = [0, [10, fmt_rest$5]]; - break; - case 40: - /*<>*/ var - /*<>*/ sub_end = - search_subformat_end(str_ind, end_ind, 41), - fmt_rest$7 = parse(sub_end + 2 | 0, end_ind)[1], - sub_fmt = parse(str_ind, sub_end)[1], - /*<>*/ sub_fmtty = - fmtty_of_fmt(sub_fmt); - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$2 = - [9, get_pad_opt(95), sub_fmtty], - _aN_ = [0, [23, ignored$2, fmt_rest$7]]; - else - var _aN_ = [0, [14, get_pad_opt(40), sub_fmtty, fmt_rest$7]]; - var fmt_result = _aN_; - break; - case 44: - var fmt_result = parse(str_ind, end_ind); break; - case 67: - /*<>*/ var - fmt_rest$10 = parse(str_ind, end_ind)[1], - /*<>*/ _aP_ = - get_ign(0) ? [0, [23, 1, fmt_rest$10]] : [0, [1, fmt_rest$10]], - fmt_result = _aP_; - break; - case 78: - var fmt_rest$14 = parse(str_ind, end_ind)[1], counter$0 = 2; - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$6 = [11, counter$0], - _aV_ = [0, [23, ignored$6, fmt_rest$14]]; - else - var _aV_ = [0, [21, counter$0, fmt_rest$14]]; - var fmt_result = _aV_; - break; - case 83: - /*<>*/ var - /*<>*/ pad$6 = - check_no_0(symb, get_padprec(0)), - fmt_rest$15 = parse(str_ind, end_ind)[1]; - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$7 = - [1, get_padprec_opt(95)], - _aW_ = [0, [23, ignored$7, fmt_rest$15]]; - else - /*<>*/ var - /*<>*/ match$5 = - make_padding_fmt_ebb(pad$6, fmt_rest$15), - fmt_rest$16 = match$5[2], - pad$7 = match$5[1], - _aW_ = [0, [3, pad$7, fmt_rest$16]]; - var fmt_result = _aW_; - break; - case 91: - if(str_ind === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ var - /*<>*/ char_set = create_char_set(0), - add_char = - function(c){ - /*<>*/ return add_in_char_set - (char_set, c); - /*<>*/ }, - add_range = - function(c$0, c){ - /*<>*/ if(c >= c$0){ - var i = c$0; - for(;;){ - /*<>*/ add_in_char_set - (char_set, - /*<>*/ caml_call1 - (Stdlib[29], i)); - /*<>*/ /*<>*/ var - _bd_ = i + 1 | 0; - if(c !== i){var i = _bd_; continue;} - break; - } - } - return 0; - /*<>*/ }, - fail_single_percent = - function(str_ind){ - /*<>*/ return /*<>*/ caml_call2 - (failwith_message(_R_), str, str_ind); - /*<>*/ }, - parse_char_set_content = - function(counter, str_ind, end_ind){ - /*<>*/ var str_ind$0 = str_ind; - /*<>*/ for(;;){ - if(str_ind$0 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ /*<>*/ var - c = - /*<>*/ caml_string_get - (str, str_ind$0); - if(45 === c){ - /*<>*/ add_char(45); - var str_ind$1 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$1; - continue; - } - if(93 === c) - /*<>*/ return str_ind$0 + 1 | 0; - var _bc_ = str_ind$0 + 1 | 0; - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (parse_char_set_after_char$0, [0, _bc_, end_ind, c]); - var counter$0 = counter + 1 | 0; - /*<>*/ return parse_char_set_after_char$0 - (counter$0, _bc_, end_ind, c); - } - /*<>*/ }, - parse_char_set_after_char$0 = - function(counter, str_ind, end_ind, c){ - /*<>*/ var - str_ind$0 = str_ind, - c$0 = c; - /*<>*/ for(;;){ - if(str_ind$0 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ var - /*<>*/ c$1 = - /*<>*/ caml_string_get - (str, str_ind$0), - switch$0 = 0; - if(46 <= c$1){ - if(64 === c$1) - switch$0 = 1; - else if(93 === c$1){ - /*<>*/ add_char(c$0); - /*<>*/ return str_ind$0 + 1 | 0; + a: + { + /*<>*/ if(124 > symb) + switch(symb){ + case 33: + var + fmt_rest$5 = parse(str_ind, end_ind)[1], + fmt_result = [0, [10, fmt_rest$5]]; + break a; + case 40: + /*<>*/ var + /*<>*/ sub_end = + search_subformat_end(str_ind, end_ind, 41), + fmt_rest$7 = parse(sub_end + 2 | 0, end_ind)[1], + sub_fmt = parse(str_ind, sub_end)[1], + /*<>*/ sub_fmtty = + fmtty_of_fmt(sub_fmt); + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$2 = + [9, get_pad_opt(95), sub_fmtty], + _aJ_ = [0, [23, ignored$2, fmt_rest$7]]; + else + var _aJ_ = [0, [14, get_pad_opt(40), sub_fmtty, fmt_rest$7]]; + var fmt_result = _aJ_; + break a; + case 44: + var fmt_result = parse(str_ind, end_ind); break a; + case 67: + /*<>*/ var + fmt_rest$10 = parse(str_ind, end_ind)[1], + /*<>*/ _aL_ = + get_ign(0) ? [0, [23, 1, fmt_rest$10]] : [0, [1, fmt_rest$10]], + fmt_result = _aL_; + break a; + case 78: + var fmt_rest$14 = parse(str_ind, end_ind)[1], counter$0 = 2; + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$6 = [11, counter$0], + _aR_ = [0, [23, ignored$6, fmt_rest$14]]; + else + var _aR_ = [0, [21, counter$0, fmt_rest$14]]; + var fmt_result = _aR_; + break a; + case 83: + /*<>*/ var + /*<>*/ pad$6 = + check_no_0(symb, get_padprec(0)), + fmt_rest$15 = parse(str_ind, end_ind)[1]; + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$7 = + [1, get_padprec_opt(95)], + _aS_ = [0, [23, ignored$7, fmt_rest$15]]; + else + /*<>*/ var + /*<>*/ match$5 = + make_padding_fmt_ebb(pad$6, fmt_rest$15), + fmt_rest$16 = match$5[2], + pad$7 = match$5[1], + _aS_ = [0, [3, pad$7, fmt_rest$16]]; + var fmt_result = _aS_; + break a; + case 91: + if(str_ind === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ var + /*<>*/ char_set = + create_char_set(0), + add_range = + function(c$0, c){ + /*<>*/ if(c >= c$0){ + var i = c$0; + for(;;){ + /*<>*/ add_in_char_set + (char_set, + /*<>*/ caml_call1 + (Stdlib[29], i)); + /*<>*/ /*<>*/ var + _a$_ = i + 1 | 0; + if(c === i) break; + i = _a$_; } } - else if(37 === c$1) - switch$0 = 1; - else if(45 <= c$1){ - var str_ind$2 = str_ind$0 + 1 | 0; - if(str_ind$2 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ /*<>*/ var - c$2 = - /*<>*/ caml_string_get - (str, str_ind$2); - if(37 === c$2){ - if((str_ind$2 + 1 | 0) === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ /*<>*/ var - c$3 = - /*<>*/ caml_string_get - (str, str_ind$2 + 1 | 0); - if(37 !== c$3 && 64 !== c$3) - /*<>*/ return fail_single_percent - (str_ind$2); - /*<>*/ add_range(c$0, c$3); - var _ba_ = str_ind$2 + 2 | 0; - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (parse_char_set_content, [0, _ba_, end_ind]); - var counter$2 = counter + 1 | 0; - /*<>*/ return parse_char_set_content - (counter$2, _ba_, end_ind); + return; + /*<>*/ }, + fail_single_percent = + function(str_ind){ + /*<>*/ return /*<>*/ caml_call2 + (failwith_message(_R_), str, str_ind); + /*<>*/ }, + parse_char_set_content = + function(counter, str_ind, end_ind){ + /*<>*/ var str_ind$0 = str_ind; + /*<>*/ for(;;){ + if(str_ind$0 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ /*<>*/ var + c = + /*<>*/ caml_string_get + (str, str_ind$0); + if(45 !== c){ + if(93 === c) + /*<>*/ return str_ind$0 + 1 + | 0; + var _a__ = str_ind$0 + 1 | 0; + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (parse_char_set_after_char$0, [0, _a__, end_ind, c]); + var counter$0 = counter + 1 | 0; + /*<>*/ return parse_char_set_after_char$0 + (counter$0, _a__, end_ind, c); } - if(93 === c$2){ - /*<>*/ add_char(c$0); - /*<>*/ add_char(45); - /*<>*/ return str_ind$2 + 1 | 0; - } - /*<>*/ add_range(c$0, c$2); - var _bb_ = str_ind$2 + 1 | 0; - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (parse_char_set_content, [0, _bb_, end_ind]); - var counter$1 = counter + 1 | 0; - /*<>*/ return parse_char_set_content - (counter$1, _bb_, end_ind); - } - if(switch$0 && 37 === c$0){ - /*<>*/ add_char(c$1); - var _a$_ = str_ind$0 + 1 | 0; - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (parse_char_set_content, [0, _a$_, end_ind]); - var counter$0 = counter + 1 | 0; - /*<>*/ return parse_char_set_content - (counter$0, _a$_, end_ind); + /*<>*/ add_in_char_set + (char_set, 45); + var str_ind$1 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$1; } - if(37 === c$0) - /*<>*/ fail_single_percent - (str_ind$0); - /*<>*/ add_char(c$0); - var - str_ind$1 = str_ind$0 + 1 | 0, - str_ind$0 = str_ind$1, + /*<>*/ }, + parse_char_set_after_char$0 = + function(counter, str_ind, end_ind, c){ + /*<>*/ var + str_ind$0 = str_ind, + c$0 = c; + /*<>*/ for(;;){ + if(str_ind$0 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ /*<>*/ var + c$1 = + /*<>*/ caml_string_get + (str, str_ind$0); + a: + { + if(46 <= c$1){ + if(64 !== c$1){ + if(93 !== c$1) break a; + /*<>*/ add_in_char_set + (char_set, c$0); + /*<>*/ return str_ind$0 + 1 + | 0; + } + } + else if(37 !== c$1){ + if(45 > c$1) break a; + var str_ind$2 = str_ind$0 + 1 | 0; + if(str_ind$2 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ /*<>*/ var + c$2 = + /*<>*/ caml_string_get + (str, str_ind$2); + if(37 === c$2){ + if((str_ind$2 + 1 | 0) === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ /*<>*/ var + c$3 = + /*<>*/ caml_string_get + (str, str_ind$2 + 1 | 0); + if(37 !== c$3 && 64 !== c$3) + /*<>*/ return fail_single_percent + (str_ind$2); + /*<>*/ add_range(c$0, c$3); + var _a8_ = str_ind$2 + 2 | 0; + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (parse_char_set_content, [0, _a8_, end_ind]); + var counter$1 = counter + 1 | 0; + /*<>*/ return parse_char_set_content + (counter$1, _a8_, end_ind); + } + if(93 === c$2){ + /*<>*/ add_in_char_set + (char_set, c$0); + /*<>*/ add_in_char_set + (char_set, 45); + /*<>*/ return str_ind$2 + 1 + | 0; + } + /*<>*/ add_range(c$0, c$2); + var _a9_ = str_ind$2 + 1 | 0; + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (parse_char_set_content, [0, _a9_, end_ind]); + var counter$0 = counter + 1 | 0; + /*<>*/ return parse_char_set_content + (counter$0, _a9_, end_ind); + } + if(37 === c$0){ + /*<>*/ add_in_char_set + (char_set, c$1); + var _a7_ = str_ind$0 + 1 | 0; + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (parse_char_set_content, [0, _a7_, end_ind]); + var counter$2 = counter + 1 | 0; + /*<>*/ return parse_char_set_content + (counter$2, _a7_, end_ind); + } + } + if(37 === c$0) + /*<>*/ fail_single_percent + (str_ind$0); + /*<>*/ add_in_char_set + (char_set, c$0); + var str_ind$1 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$1; c$0 = c$1; - } - /*<>*/ }, - parse_char_set_after_char = - function(str_ind, end_ind, c){ - /*<>*/ return caml_trampoline - (parse_char_set_after_char$0(0, str_ind, end_ind, c)); - }; - if(str_ind === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - if - (94 - === - /*<>*/ caml_string_get - (str, str_ind)) - var str_ind$0 = str_ind + 1 | 0, reverse = 1, str_ind$1 = str_ind$0; - else - var reverse = 0, str_ind$1 = str_ind; - if(str_ind$1 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ var - /*<>*/ c = - /*<>*/ caml_string_get - (str, str_ind$1), - /*<>*/ next_ind = - parse_char_set_after_char(str_ind$1 + 1 | 0, end_ind, c), - /*<>*/ char_set$0 = - freeze_char_set(char_set), - /*<>*/ char_set$1 = - reverse ? rev_char_set(char_set$0) : char_set$0, - fmt_rest$19 = parse(next_ind, end_ind)[1]; - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$9 = - [10, get_pad_opt(95), char_set$1], - _a1_ = [0, [23, ignored$9, fmt_rest$19]]; - else - var _a1_ = [0, [20, get_pad_opt(91), char_set$1, fmt_rest$19]]; - var fmt_result = _a1_; - break; - case 97: - var - fmt_rest$20 = parse(str_ind, end_ind)[1], - fmt_result = [0, [15, fmt_rest$20]]; - break; - case 99: - /*<>*/ var - char_format = - function(fmt_rest){ - /*<>*/ return get_ign(0) - ? [0, [23, 0, fmt_rest]] - : [0, [0, fmt_rest]]; - /*<>*/ }, - fmt_rest$21 = parse(str_ind, end_ind)[1], - /*<>*/ match$7 = get_pad_opt(99); - if(match$7){ - if(0 === match$7[1]) - /*<>*/ var - /*<>*/ _a2_ = - get_ign(0) ? [0, [23, 3, fmt_rest$21]] : [0, [22, fmt_rest$21]], - _a3_ = _a2_; - else + } + /*<>*/ }, + parse_char_set_after_char = + function(str_ind, end_ind, c){ + /*<>*/ return caml_trampoline + (parse_char_set_after_char$0(0, str_ind, end_ind, c)); + }; + if(str_ind === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + if + (94 + === + /*<>*/ caml_string_get + (str, str_ind)) var - _a3_ = - legacy_behavior$0 - ? char_format(fmt_rest$21) - : invalid_format_message - (str_ind, cst_non_zero_widths_are_unsupp); - var _a4_ = _a3_; - } - else - var _a4_ = char_format(fmt_rest$21); - var fmt_result = _a4_; - break; - case 114: - /*<>*/ var - fmt_rest$22 = parse(str_ind, end_ind)[1], - /*<>*/ _a5_ = - get_ign(0) ? [0, [23, 2, fmt_rest$22]] : [0, [19, fmt_rest$22]], - fmt_result = _a5_; - break; - case 115: - /*<>*/ var - /*<>*/ pad$9 = - check_no_0(symb, get_padprec(0)), - fmt_rest$23 = parse(str_ind, end_ind)[1]; - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$10 = - [0, get_padprec_opt(95)], - _a6_ = [0, [23, ignored$10, fmt_rest$23]]; - else - /*<>*/ var - /*<>*/ match$8 = - make_padding_fmt_ebb(pad$9, fmt_rest$23), - fmt_rest$24 = match$8[2], - pad$10 = match$8[1], - _a6_ = [0, [2, pad$10, fmt_rest$24]]; - var fmt_result = _a6_; - break; - case 116: - var - fmt_rest$25 = parse(str_ind, end_ind)[1], - fmt_result = [0, [16, fmt_rest$25]]; - break; - case 123: - /*<>*/ var - /*<>*/ sub_end$0 = - search_subformat_end(str_ind, end_ind, 125), - sub_fmt$0 = parse(str_ind, sub_end$0)[1], - fmt_rest$26 = parse(sub_end$0 + 2 | 0, end_ind)[1], - /*<>*/ sub_fmtty$0 = - fmtty_of_fmt(sub_fmt$0); - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$11 = - [8, get_pad_opt(95), sub_fmtty$0], - _a7_ = [0, [23, ignored$11, fmt_rest$26]]; - else - var _a7_ = [0, [13, get_pad_opt(123), sub_fmtty$0, fmt_rest$26]]; - var fmt_result = _a7_; - break; - case 66: - case 98: - /*<>*/ var - /*<>*/ pad$3 = - check_no_0(symb, get_padprec(0)), - fmt_rest$8 = parse(str_ind, end_ind)[1]; - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$3 = - [7, get_padprec_opt(95)], - _aO_ = [0, [23, ignored$3, fmt_rest$8]]; - else - /*<>*/ var - /*<>*/ match$3 = - make_padding_fmt_ebb(pad$3, fmt_rest$8), - fmt_rest$9 = match$3[2], - pad$4 = match$3[1], - _aO_ = [0, [9, pad$4, fmt_rest$9]]; - var fmt_result = _aO_; - break; - case 37: - case 64: - var - fmt_rest$6 = parse(str_ind, end_ind)[1], - fmt_result = [0, [12, symb, fmt_rest$6]]; - break; - case 76: - case 108: - case 110: - var switch$1 = 0; - if(str_ind === end_ind) - switch$1 = 1; - else{ - /*<>*/ var - /*<>*/ symb$0 = - /*<>*/ caml_string_get - (str, str_ind), - /*<>*/ _a8_ = symb$0 - 88 | 0, - switch$2 = 0; - if(32 >= _a8_ >>> 0) - switch(_a8_){ - case 0: - case 12: - case 17: - case 23: - case 29: - case 32: - var _aU_ = 1; switch$2 = 1; break; - } - if(! switch$2) var _aU_ = 0; - /*<>*/ if(_aU_) - switch$0 = 1; + str_ind$0 = str_ind + 1 | 0, + reverse = 1, + str_ind$1 = str_ind$0; + else + var reverse = 0, str_ind$1 = str_ind; + if(str_ind$1 === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ var + /*<>*/ c = + /*<>*/ caml_string_get + (str, str_ind$1), + /*<>*/ next_ind = + parse_char_set_after_char(str_ind$1 + 1 | 0, end_ind, c), + /*<>*/ char_set$0 = + freeze_char_set(char_set), + /*<>*/ char_set$1 = + reverse ? rev_char_set(char_set$0) : char_set$0, + fmt_rest$19 = parse(next_ind, end_ind)[1]; + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$9 = + [10, get_pad_opt(95), char_set$1], + _aX_ = [0, [23, ignored$9, fmt_rest$19]]; + else + var _aX_ = [0, [20, get_pad_opt(91), char_set$1, fmt_rest$19]]; + var fmt_result = _aX_; + break a; + case 97: + var + fmt_rest$20 = parse(str_ind, end_ind)[1], + fmt_result = [0, [15, fmt_rest$20]]; + break a; + case 99: + /*<>*/ var + char_format = + function(fmt_rest){ + /*<>*/ return get_ign(0) + ? [0, [23, 0, fmt_rest]] + : [0, [0, fmt_rest]]; + /*<>*/ }, + fmt_rest$21 = parse(str_ind, end_ind)[1], + /*<>*/ match$7 = get_pad_opt(99); + if(match$7){ + if(0 === match$7[1]) + /*<>*/ var + /*<>*/ _aY_ = + get_ign(0) ? [0, [23, 3, fmt_rest$21]] : [0, [22, fmt_rest$21]], + _aZ_ = _aY_; + else + var + _aZ_ = + legacy_behavior$0 + ? char_format(fmt_rest$21) + : invalid_format_message + (str_ind, cst_non_zero_widths_are_unsupp); + var _a0_ = _aZ_; + } else - switch$1 = 1; - } - if(switch$1){ - var fmt_rest$13 = parse(str_ind, end_ind)[1], switch$3 = 0; - if(108 <= symb){ - if(111 > symb) - switch(symb - 108 | 0){ - case 0: - var counter = 0; switch$3 = 1; break; - case 1: break; - default: var counter = 1; switch$3 = 1; - } + var _a0_ = char_format(fmt_rest$21); + var fmt_result = _a0_; + break a; + case 114: + /*<>*/ var + fmt_rest$22 = parse(str_ind, end_ind)[1], + /*<>*/ _a1_ = + get_ign(0) ? [0, [23, 2, fmt_rest$22]] : [0, [19, fmt_rest$22]], + fmt_result = _a1_; + break a; + case 115: + /*<>*/ var + /*<>*/ pad$9 = + check_no_0(symb, get_padprec(0)), + fmt_rest$23 = parse(str_ind, end_ind)[1]; + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$10 = + [0, get_padprec_opt(95)], + _a2_ = [0, [23, ignored$10, fmt_rest$23]]; + else + /*<>*/ var + /*<>*/ match$8 = + make_padding_fmt_ebb(pad$9, fmt_rest$23), + fmt_rest$24 = match$8[2], + pad$10 = match$8[1], + _a2_ = [0, [2, pad$10, fmt_rest$24]]; + var fmt_result = _a2_; + break a; + case 116: + var + fmt_rest$25 = parse(str_ind, end_ind)[1], + fmt_result = [0, [16, fmt_rest$25]]; + break a; + case 123: + /*<>*/ var + /*<>*/ sub_end$0 = + search_subformat_end(str_ind, end_ind, 125), + sub_fmt$0 = parse(str_ind, sub_end$0)[1], + fmt_rest$26 = parse(sub_end$0 + 2 | 0, end_ind)[1], + /*<>*/ sub_fmtty$0 = + fmtty_of_fmt(sub_fmt$0); + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$11 = + [8, get_pad_opt(95), sub_fmtty$0], + _a3_ = [0, [23, ignored$11, fmt_rest$26]]; + else + var _a3_ = [0, [13, get_pad_opt(123), sub_fmtty$0, fmt_rest$26]]; + var fmt_result = _a3_; + break a; + case 66: + case 98: + /*<>*/ var + /*<>*/ pad$3 = + check_no_0(symb, get_padprec(0)), + fmt_rest$8 = parse(str_ind, end_ind)[1]; + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$3 = + [7, get_padprec_opt(95)], + _aK_ = [0, [23, ignored$3, fmt_rest$8]]; + else + /*<>*/ var + /*<>*/ match$3 = + make_padding_fmt_ebb(pad$3, fmt_rest$8), + fmt_rest$9 = match$3[2], + pad$4 = match$3[1], + _aK_ = [0, [9, pad$4, fmt_rest$9]]; + var fmt_result = _aK_; + break a; + case 37: + case 64: + var + fmt_rest$6 = parse(str_ind, end_ind)[1], + fmt_result = [0, [12, symb, fmt_rest$6]]; + break a; + case 76: + case 108: + case 110: + if(str_ind !== end_ind){ + /*<>*/ var + /*<>*/ symb$0 = + /*<>*/ caml_string_get + (str, str_ind), + /*<>*/ _a4_ = symb$0 - 88 | 0; + b: + { + if(32 >= _a4_ >>> 0) + switch(_a4_){ + case 0: + case 12: + case 17: + case 23: + case 29: + case 32: + var _aQ_ = 1; break b; + } + var _aQ_ = 0; + } + /*<>*/ if(_aQ_) break; } - else if(76 === symb){var counter = 2; switch$3 = 1;} - if(! switch$3) + var fmt_rest$13 = parse(str_ind, end_ind)[1]; + b: + { + if(108 <= symb){ + if(111 > symb) + switch(symb - 108 | 0){ + case 0: + var counter = 0; break b; + case 1: break; + default: var counter = 1; break b; + } + } + else if(76 === symb){var counter = 2; break b;} /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _V_], 1); + } /*<>*/ if(get_ign(0)) /*<>*/ var /*<>*/ ignored$5 = [11, counter], - _aT_ = [0, [23, ignored$5, fmt_rest$13]]; + _aP_ = [0, [23, ignored$5, fmt_rest$13]]; else - var _aT_ = [0, [21, counter, fmt_rest$13]]; - var fmt_result = _aT_; - } - break; - case 32: - case 35: - case 43: - case 45: - case 95: - var - fmt_result = - /*<>*/ caml_call3 - (failwith_message(_M_), str, pct_ind, symb); - break; - case 88: - case 100: - case 105: - case 111: - case 117: - case 120: - /*<>*/ var - /*<>*/ _aX_ = get_space(0), - /*<>*/ _aY_ = get_hash(0), - /*<>*/ iconv$2 = - compute_int_conv(pct_ind, str_ind, get_plus(0), _aY_, _aX_, symb), - fmt_rest$17 = parse(str_ind, end_ind)[1]; - /*<>*/ if(get_ign(0)) - /*<>*/ var - /*<>*/ ignored$8 = - [2, iconv$2, get_pad_opt(95)], - _aZ_ = [0, [23, ignored$8, fmt_rest$17]]; - else - /*<>*/ var - /*<>*/ _a0_ = get_prec(0), - /*<>*/ match$6 = - make_padprec_fmt_ebb(get_int_pad(0), _a0_, fmt_rest$17), - fmt_rest$18 = match$6[3], - prec$4 = match$6[2], - pad$8 = match$6[1], - _aZ_ = [0, [4, iconv$2, pad$8, prec$4, fmt_rest$18]]; - var fmt_result = _aZ_; - break; - case 69: - case 70: - case 71: - case 72: - case 101: - case 102: - case 103: - case 104: - /*<>*/ var - /*<>*/ space$1 = get_space(0), - /*<>*/ hash$1 = get_hash(0), - /*<>*/ plus$2 = get_plus(0), - flag = - plus$2 - ? space$1 - ? legacy_behavior$0 - ? 1 - : incompatible_flag(pct_ind, str_ind, 32, cst$36) - : 1 - : space$1 ? 2 : 0, - switch$4 = 0; - /*<>*/ if(73 <= symb){ - var switcher = symb - 101 | 0; - if(3 < switcher >>> 0) - switch$4 = 1; - else{ - switch(switcher){ - case 0: - var _a9_ = 1; break; - case 1: - var _a9_ = 0; break; - case 2: - var _a9_ = 3; break; - default: var _a9_ = 6; + var _aP_ = [0, [21, counter, fmt_rest$13]]; + var fmt_result = _aP_; + break a; + case 32: + case 35: + case 43: + case 45: + case 95: + var + fmt_result = + /*<>*/ caml_call3 + (failwith_message(_M_), str, pct_ind, symb); + break a; + case 88: + case 100: + case 105: + case 111: + case 117: + case 120: + /*<>*/ var + /*<>*/ _aT_ = get_space(0), + /*<>*/ _aU_ = get_hash(0), + /*<>*/ iconv$2 = + compute_int_conv(pct_ind, str_ind, get_plus(0), _aU_, _aT_, symb), + fmt_rest$17 = parse(str_ind, end_ind)[1]; + /*<>*/ if(get_ign(0)) + /*<>*/ var + /*<>*/ ignored$8 = + [2, iconv$2, get_pad_opt(95)], + _aV_ = [0, [23, ignored$8, fmt_rest$17]]; + else + /*<>*/ var + /*<>*/ _aW_ = get_prec(0), + /*<>*/ match$6 = + make_padprec_fmt_ebb(get_int_pad(0), _aW_, fmt_rest$17), + fmt_rest$18 = match$6[3], + prec$4 = match$6[2], + pad$8 = match$6[1], + _aV_ = [0, [4, iconv$2, pad$8, prec$4, fmt_rest$18]]; + var fmt_result = _aV_; + break a; + case 69: + case 70: + case 71: + case 72: + case 101: + case 102: + case 103: + case 104: + /*<>*/ var + /*<>*/ space$1 = get_space(0), + /*<>*/ hash$1 = get_hash(0), + /*<>*/ plus$2 = get_plus(0), + flag = + plus$2 + ? space$1 + ? legacy_behavior$0 + ? 1 + : incompatible_flag(pct_ind, str_ind, 32, cst$36) + : 1 + : space$1 ? 2 : 0; + b: + { + c: + if(73 <= symb){ + var switcher = symb - 101 | 0; + if(3 >= switcher >>> 0){ + switch(switcher){ + case 0: + var _a5_ = 1; break; + case 1: + var _a5_ = 0; break; + case 2: + var _a5_ = 3; break; + default: var _a5_ = 6; + } + var kind = _a5_; + break b; + } } - var kind = _a9_; - } - } - else if(69 <= symb){ - var switch$5 = 0; - switch(symb - 69 | 0){ - case 0: - var _a__ = 2; break; - case 1: - switch$4 = 1; switch$5 = 1; break; - case 2: - var _a__ = 4; break; - default: var _a__ = 7; - } - if(! switch$5) var kind = _a__; - } - else - switch$4 = 1; - if(switch$4){ - var switch$6 = 0; - if(hash$1){ - if(70 === symb){var kind = 8; switch$6 = 1;} - } - else if(70 === symb){var kind = 5; switch$6 = 1;} - if(! switch$6) + else if(69 <= symb){ + switch(symb - 69 | 0){ + case 0: + var _a6_ = 2; break; + case 1: + break c; + case 2: + var _a6_ = 4; break; + default: var _a6_ = 7; + } + var kind = _a6_; + break b; + } + if(hash$1){ + if(70 === symb){var kind = 8; break b;} + } + else if(70 === symb){var kind = 5; break b;} /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _X_], 1); - } - /*<>*/ var - /*<>*/ fconv = [0, flag, kind], - fmt_rest$11 = parse(str_ind, end_ind)[1]; - /*<>*/ if(get_ign(0)){ - /*<>*/ /*<>*/ var - match = get_prec(0); - if(typeof match === "number") - var - _aQ_ = match ? incompatible_flag(pct_ind, str_ind, 95, cst$26) : 0; + } + /*<>*/ var + /*<>*/ fconv = [0, flag, kind], + fmt_rest$11 = parse(str_ind, end_ind)[1]; + /*<>*/ if(get_ign(0)){ + /*<>*/ /*<>*/ var + match = get_prec(0); + if(typeof match === "number") + var + _aM_ = + match ? incompatible_flag(pct_ind, str_ind, 95, cst$26) : 0; + else + var ndec = match[1], _aM_ = [0, ndec]; + /*<>*/ var + /*<>*/ ignored$4 = + [6, get_pad_opt(95), _aM_], + _aN_ = [0, [23, ignored$4, fmt_rest$11]]; + } else - var ndec = match[1], _aQ_ = [0, ndec]; - /*<>*/ var - /*<>*/ ignored$4 = - [6, get_pad_opt(95), _aQ_], - _aR_ = [0, [23, ignored$4, fmt_rest$11]]; - } - else - /*<>*/ var - /*<>*/ _aS_ = get_prec(0), - /*<>*/ match$4 = - make_padprec_fmt_ebb(get_pad(0), _aS_, fmt_rest$11), - fmt_rest$12 = match$4[3], - prec$3 = match$4[2], - pad$5 = match$4[1], - _aR_ = [0, [8, fconv, pad$5, prec$3, fmt_rest$12]]; - var fmt_result = _aR_; - break; - default: switch$0 = 1; - } - if(switch$0){ - var switch$7 = 0; + /*<>*/ var + /*<>*/ _aO_ = get_prec(0), + /*<>*/ match$4 = + make_padprec_fmt_ebb(get_pad(0), _aO_, fmt_rest$11), + fmt_rest$12 = match$4[3], + prec$3 = match$4[2], + pad$5 = match$4[1], + _aN_ = [0, [8, fconv, pad$5, prec$3, fmt_rest$12]]; + var fmt_result = _aN_; + break a; + } + b: if(108 <= symb){ if(111 > symb){ - var switch$8 = 0; switch(symb - 108 | 0){ case 0: /*<>*/ var - /*<>*/ _ax_ = + /*<>*/ _at_ = /*<>*/ caml_string_get (str, str_ind), - /*<>*/ _ay_ = get_space(0), - /*<>*/ _az_ = get_hash(0), + /*<>*/ _au_ = get_space(0), + /*<>*/ _av_ = get_hash(0), /*<>*/ iconv = compute_int_conv - (pct_ind, str_ind + 1 | 0, get_plus(0), _az_, _ay_, _ax_), + (pct_ind, str_ind + 1 | 0, get_plus(0), _av_, _au_, _at_), fmt_rest = parse(str_ind + 1 | 0, end_ind)[1]; /*<>*/ if(get_ign(0)) /*<>*/ var /*<>*/ ignored = [3, iconv, get_pad_opt(95)], - _aA_ = [0, [23, ignored, fmt_rest]]; + _aw_ = [0, [23, ignored, fmt_rest]]; else /*<>*/ var - /*<>*/ _aC_ = get_prec(0), + /*<>*/ _ay_ = get_prec(0), /*<>*/ match$0 = - make_padprec_fmt_ebb(get_int_pad(0), _aC_, fmt_rest), + make_padprec_fmt_ebb(get_int_pad(0), _ay_, fmt_rest), fmt_rest$0 = match$0[3], prec$0 = match$0[2], pad$0 = match$0[1], - _aA_ = [0, [5, iconv, pad$0, prec$0, fmt_rest$0]]; - var _aB_ = _aA_; - switch$8 = 1; + _aw_ = [0, [5, iconv, pad$0, prec$0, fmt_rest$0]]; + var _ax_ = _aw_; break; - case 1: break; + case 1: + break b; default: /*<>*/ var - /*<>*/ _aD_ = + /*<>*/ _az_ = /*<>*/ caml_string_get (str, str_ind), - /*<>*/ _aE_ = get_space(0), - /*<>*/ _aF_ = get_hash(0), + /*<>*/ _aA_ = get_space(0), + /*<>*/ _aB_ = get_hash(0), /*<>*/ iconv$0 = compute_int_conv - (pct_ind, str_ind + 1 | 0, get_plus(0), _aF_, _aE_, _aD_), + (pct_ind, str_ind + 1 | 0, get_plus(0), _aB_, _aA_, _az_), fmt_rest$1 = parse(str_ind + 1 | 0, end_ind)[1]; /*<>*/ if(get_ign(0)) /*<>*/ var /*<>*/ ignored$0 = [4, iconv$0, get_pad_opt(95)], - _aG_ = [0, [23, ignored$0, fmt_rest$1]]; + _aC_ = [0, [23, ignored$0, fmt_rest$1]]; else /*<>*/ var - /*<>*/ _aH_ = get_prec(0), + /*<>*/ _aD_ = get_prec(0), /*<>*/ match$1 = - make_padprec_fmt_ebb(get_int_pad(0), _aH_, fmt_rest$1), + make_padprec_fmt_ebb(get_int_pad(0), _aD_, fmt_rest$1), fmt_rest$2 = match$1[3], prec$1 = match$1[2], pad$1 = match$1[1], - _aG_ = [0, [6, iconv$0, pad$1, prec$1, fmt_rest$2]]; - var _aB_ = _aG_; - switch$8 = 1; + _aC_ = [0, [6, iconv$0, pad$1, prec$1, fmt_rest$2]]; + var _ax_ = _aC_; } - if(switch$8){var fmt_result = _aB_; switch$7 = 1;} + var fmt_result = _ax_; + break a; } } else if(76 === symb){ /*<>*/ var - /*<>*/ _aI_ = + /*<>*/ _aE_ = /*<>*/ caml_string_get(str, str_ind), - /*<>*/ _aJ_ = get_space(0), - /*<>*/ _aK_ = get_hash(0), + /*<>*/ _aF_ = get_space(0), + /*<>*/ _aG_ = get_hash(0), /*<>*/ iconv$1 = compute_int_conv - (pct_ind, str_ind + 1 | 0, get_plus(0), _aK_, _aJ_, _aI_), + (pct_ind, str_ind + 1 | 0, get_plus(0), _aG_, _aF_, _aE_), fmt_rest$3 = parse(str_ind + 1 | 0, end_ind)[1]; /*<>*/ if(get_ign(0)) /*<>*/ var /*<>*/ ignored$1 = [5, iconv$1, get_pad_opt(95)], - _aL_ = [0, [23, ignored$1, fmt_rest$3]]; + _aH_ = [0, [23, ignored$1, fmt_rest$3]]; else /*<>*/ var - /*<>*/ _aM_ = get_prec(0), + /*<>*/ _aI_ = get_prec(0), /*<>*/ match$2 = - make_padprec_fmt_ebb(get_int_pad(0), _aM_, fmt_rest$3), + make_padprec_fmt_ebb(get_int_pad(0), _aI_, fmt_rest$3), fmt_rest$4 = match$2[3], prec$2 = match$2[2], pad$2 = match$2[1], - _aL_ = [0, [7, iconv$1, pad$2, prec$2, fmt_rest$4]]; - var fmt_result = _aL_; - switch$7 = 1; + _aH_ = [0, [7, iconv$1, pad$2, prec$2, fmt_rest$4]]; + var fmt_result = _aH_; + break a; } - if(! switch$7) - var - fmt_result = - /*<>*/ caml_call3 - (failwith_message(_J_), str, str_ind - 1 | 0, symb); + var + fmt_result = + /*<>*/ caml_call3 + (failwith_message(_J_), str, str_ind - 1 | 0, symb); } if(1 - legacy_behavior$0){ - var _ao_ = 1 - plus_used[1], plus$0 = _ao_ ? plus : _ao_; + var _ak_ = 1 - plus_used[1], plus$0 = _ak_ ? plus : _ak_; if(plus$0) /*<>*/ incompatible_flag (pct_ind, str_ind, symb, cst$27); - var _ap_ = 1 - hash_used[1], hash$0 = _ap_ ? hash : _ap_; + var _al_ = 1 - hash_used[1], hash$0 = _al_ ? hash : _al_; if(hash$0) /*<>*/ incompatible_flag (pct_ind, str_ind, symb, cst$28); - var _aq_ = 1 - space_used[1], space$0 = _aq_ ? space : _aq_; + var _am_ = 1 - space_used[1], space$0 = _am_ ? space : _am_; if(space$0) /*<>*/ incompatible_flag (pct_ind, str_ind, symb, cst$29); var - _ar_ = 1 - pad_used[1], - _as_ = - _ar_ + _an_ = 1 - pad_used[1], + _ao_ = + _an_ ? /*<>*/ caml_notequal ([0, pad], _K_) - : _ar_; - /*<>*/ if(_as_) + : _an_; + /*<>*/ if(_ao_) /*<>*/ incompatible_flag (pct_ind, str_ind, symb, cst_padding$0); - var - _at_ = 1 - prec_used[1], - _au_ = - _at_ - ? /*<>*/ caml_notequal - ([0, prec], _L_) - : _at_; - /*<>*/ if(_au_){ - var _av_ = ign ? 95 : symb; - /*<>*/ incompatible_flag - (pct_ind, str_ind, _av_, cst_precision$2); - } - var plus$1 = ign ? plus : ign; - if(plus$1) - /*<>*/ incompatible_flag - (pct_ind, str_ind, 95, cst$30); - } - var _aw_ = 1 - ign_used[1], ign$0 = _aw_ ? ign : _aw_; - if(ign$0){ - var switch$9 = 0; - if(38 <= symb){ - if(44 !== symb && 64 !== symb) switch$9 = 1; - } - else if(33 !== symb && 37 > symb) switch$9 = 1; - var switch$10 = 0; - if(switch$9 || ! legacy_behavior$0) switch$10 = 1; - if(switch$10) - /*<>*/ incompatible_flag - (pct_ind, str_ind, symb, cst$31); - } - /*<>*/ return fmt_result; - } - function parse_after_precision - (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad, prec){ - /*<>*/ if(str_ind === end_ind) - /*<>*/ unexpected_end_of_format(end_ind); - function parse_conv(padprec){ - /*<>*/ return parse_conversion - (pct_ind, - str_ind + 1 | 0, - end_ind, - plus, - hash, - space, - ign, - pad, - prec, - padprec, - /*<>*/ caml_string_get - (str, str_ind)); - /*<>*/ } - if(typeof pad !== "number") - /*<>*/ return parse_conv(pad); - if(typeof prec === "number" && ! prec) - /*<>*/ return parse_conv(0); - if(minus){ - if(typeof prec === "number") - /*<>*/ return parse_conv(_F_); - var n = prec[1]; - /*<>*/ return parse_conv([0, 0, n]); - } - if(typeof prec === "number") - /*<>*/ return parse_conv(_G_); - var n$0 = prec[1]; - /*<>*/ return parse_conv([0, 1, n$0]); - /*<>*/ } - function parse_after_padding - (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad){ - /*<>*/ if(str_ind === end_ind) - /*<>*/ unexpected_end_of_format(end_ind); - /*<>*/ /*<>*/ var - symb = - /*<>*/ caml_string_get(str, str_ind); - if(46 !== symb) - /*<>*/ return parse_conversion - (pct_ind, - str_ind + 1 | 0, - end_ind, - plus, - hash, - space, - ign, - pad, - 0, - pad, - symb); - var str_ind$0 = str_ind + 1 | 0; - if(str_ind$0 === end_ind) - /*<>*/ unexpected_end_of_format(end_ind); - function parse_literal(minus, str_ind){ - /*<>*/ var - /*<>*/ match = - parse_positive(str_ind, end_ind, 0), - prec = match[2], - new_ind = match[1]; - /*<>*/ return parse_after_precision - (pct_ind, - new_ind, - end_ind, - minus, - plus, - hash, - space, - ign, - pad, - [0, prec]); - /*<>*/ } - /*<>*/ /*<>*/ var - symb$0 = - /*<>*/ caml_string_get(str, str_ind$0); - if(48 <= symb$0){ - if(58 > symb$0) - /*<>*/ return parse_literal - (minus, str_ind$0); - } - else if(42 <= symb$0) - switch(symb$0 - 42 | 0){ - case 0: - /*<>*/ return parse_after_precision - (pct_ind, - str_ind$0 + 1 | 0, - end_ind, - minus, - plus, - hash, - space, - ign, - pad, - 1); - case 1: - case 3: - if(legacy_behavior$0){ - /*<>*/ var - /*<>*/ _an_ = str_ind$0 + 1 | 0, - minus$0 = minus || (45 === symb$0 ? 1 : 0); - /*<>*/ return parse_literal - (minus$0, _an_); - } - break; - } - return legacy_behavior$0 - ? parse_after_precision - (pct_ind, - str_ind$0, - end_ind, - minus, - plus, - hash, - space, - ign, - pad, - _E_) - : invalid_format_without(str_ind$0 - 1 | 0, 46, cst_precision); - /*<>*/ } - function parse_flags(pct_ind, str_ind, end_ind, ign){ - /*<>*/ var - /*<>*/ zero = [0, 0], - /*<>*/ minus = [0, 0], - /*<>*/ plus = [0, 0], - /*<>*/ space = [0, 0], - /*<>*/ hash = [0, 0]; - function set_flag(str_ind, flag){ - /*<>*/ var - _ak_ = flag[1], - _al_ = _ak_ ? 1 - legacy_behavior$0 : _ak_; - if(_al_){ - /*<>*/ /*<>*/ var - _am_ = - /*<>*/ caml_string_get(str, str_ind); - /*<>*/ /*<>*/ caml_call3 - (failwith_message(_C_), str, str_ind, _am_); - } - flag[1] = 1; - return 0; - /*<>*/ } - var str_ind$0 = str_ind; - /*<>*/ for(;;){ - if(str_ind$0 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ /*<>*/ var - switcher = - /*<>*/ caml_string_get - (str, str_ind$0) - - 32 - | 0; - if(16 >= switcher >>> 0) - switch(switcher){ - case 0: - /*<>*/ set_flag(str_ind$0, space); - /*<>*/ var - /*<>*/ str_ind$1 = - str_ind$0 + 1 | 0, - str_ind$0 = str_ind$1; - continue; - case 3: - /*<>*/ set_flag(str_ind$0, hash); - /*<>*/ var - /*<>*/ str_ind$2 = - str_ind$0 + 1 | 0, - str_ind$0 = str_ind$2; - continue; - case 11: - /*<>*/ set_flag(str_ind$0, plus); - /*<>*/ var - /*<>*/ str_ind$3 = - str_ind$0 + 1 | 0, - str_ind$0 = str_ind$3; - continue; - case 13: - /*<>*/ set_flag(str_ind$0, minus); - /*<>*/ var - /*<>*/ str_ind$4 = - str_ind$0 + 1 | 0, - str_ind$0 = str_ind$4; - continue; - case 16: - /*<>*/ set_flag(str_ind$0, zero); - /*<>*/ var - /*<>*/ str_ind$5 = - str_ind$0 + 1 | 0, - str_ind$0 = str_ind$5; - continue; - } - var - space$0 = space[1], - hash$0 = hash[1], - plus$0 = plus[1], - minus$0 = minus[1], - zero$0 = zero[1]; - if(str_ind$0 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ var - padty = - zero$0 - ? minus$0 - ? legacy_behavior$0 - ? 0 - : incompatible_flag(pct_ind, str_ind$0, 45, cst_0) - : 2 - : minus$0 ? 0 : 1, - /*<>*/ match = - /*<>*/ caml_string_get - (str, str_ind$0); - if(48 <= match){ - if(58 > match){ - /*<>*/ var - /*<>*/ match$0 = - parse_positive(str_ind$0, end_ind, 0), - width = match$0[2], - new_ind = match$0[1]; - /*<>*/ return parse_after_padding - (pct_ind, - new_ind, - end_ind, - minus$0, - plus$0, - hash$0, - space$0, - ign, - [0, padty, width]); - } - } - else if(42 === match) - /*<>*/ return parse_after_padding - (pct_ind, - str_ind$0 + 1 | 0, - end_ind, - minus$0, - plus$0, - hash$0, - space$0, - ign, - [1, padty]); - switch(padty){ - case 0: - if(1 - legacy_behavior$0) - /*<>*/ invalid_format_without - (str_ind$0 - 1 | 0, 45, cst_padding); - /*<>*/ return parse_after_padding - (pct_ind, - str_ind$0, - end_ind, - minus$0, - plus$0, - hash$0, - space$0, - ign, - 0); - case 1: - /*<>*/ return parse_after_padding - (pct_ind, - str_ind$0, - end_ind, - minus$0, - plus$0, - hash$0, - space$0, - ign, - 0); - default: - /*<>*/ return parse_after_padding - (pct_ind, - str_ind$0, - end_ind, - minus$0, - plus$0, - hash$0, - space$0, - ign, - _D_); + var + _ap_ = 1 - prec_used[1], + _aq_ = + _ap_ + ? /*<>*/ caml_notequal + ([0, prec], _L_) + : _ap_; + /*<>*/ if(_aq_){ + var _ar_ = ign ? 95 : symb; + /*<>*/ incompatible_flag + (pct_ind, str_ind, _ar_, cst_precision$2); + } + var plus$1 = ign ? plus : ign; + if(plus$1) + /*<>*/ incompatible_flag + (pct_ind, str_ind, 95, cst$30); + } + var _as_ = 1 - ign_used[1], ign$0 = _as_ ? ign : _as_; + a: + if(ign$0){ + b: + { + if(38 <= symb){ + if(44 !== symb && 64 !== symb) break b; + } + else if(33 !== symb && 37 > symb) break b; + if(legacy_behavior$0) break a; } + /*<>*/ incompatible_flag + (pct_ind, str_ind, symb, cst$31); } - /*<>*/ } + /*<>*/ return fmt_result; + } function parse_tag(is_open_tag, str_ind, end_ind){ /*<>*/ try{ if(str_ind === end_ind) @@ -19548,14 +20096,14 @@ /*<>*/ /*<>*/ var ind = /*<>*/ caml_call3 - (Stdlib_String[31], str, str_ind + 1 | 0, 62); + (Stdlib_String[32], str, str_ind + 1 | 0, 62); if(end_ind <= ind) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); /*<>*/ var /*<>*/ sub_str = /*<>*/ caml_call3 - (Stdlib_String[15], str, str_ind, (ind - str_ind | 0) + 1 | 0), + (Stdlib_String[16], str, str_ind, (ind - str_ind | 0) + 1 | 0), fmt_rest$0 = parse(ind + 1 | 0, end_ind)[1], sub_fmt = parse(str_ind, ind + 1 | 0)[1], /*<>*/ sub_format$0 = @@ -19581,14 +20129,15 @@ /*<>*/ var str_ind$0 = str_ind; /*<>*/ for(;;){ if(str_ind$0 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); /*<>*/ if (32 !== /*<>*/ caml_string_get(str, str_ind$0)) /*<>*/ return str_ind$0; - var str_ind$1 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$1; + var str_ind$1 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$1; } /*<>*/ } function parse_positive(str_ind, end_ind, acc){ @@ -19597,8 +20146,8 @@ acc$0 = acc; /*<>*/ for(;;){ if(str_ind$0 === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); /*<>*/ /*<>*/ var c = /*<>*/ caml_string_get @@ -19612,15 +20161,15 @@ /*<>*/ return /*<>*/ caml_call3 (failwith_message(_S_), str, new_acc, _ag_); } - var - str_ind$1 = str_ind$0 + 1 | 0, - str_ind$0 = str_ind$1, - acc$0 = new_acc; + var str_ind$1 = str_ind$0 + 1 | 0; + str_ind$0 = str_ind$1; + acc$0 = new_acc; } /*<>*/ } function parse_integer(str_ind, end_ind){ /*<>*/ if(str_ind === end_ind) - /*<>*/ unexpected_end_of_format(end_ind); + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); /*<>*/ /*<>*/ var match = /*<>*/ caml_string_get(str, str_ind); @@ -19631,8 +20180,8 @@ } else if(45 === match){ if((str_ind + 1 | 0) === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); /*<>*/ /*<>*/ var c = /*<>*/ caml_string_get @@ -19650,6 +20199,24 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _T_], 1); /*<>*/ } + function add_literal(lit_start, str_ind, fmt){ + /*<>*/ var + size = str_ind - lit_start | 0; + return 0 === size + ? [0, fmt] + : 1 + === size + ? [0, + [12, + /*<>*/ caml_string_get + (str, lit_start), + fmt]] + : [0, + [11, + /*<>*/ caml_call3 + (Stdlib_String[16], str, lit_start, size), + fmt]]; + /*<>*/ } function search_subformat_end(str_ind, end_ind, c){ /*<>*/ var str_ind$0 = str_ind; /*<>*/ for(;;){ @@ -19658,156 +20225,149 @@ (failwith_message(_U_), str, c, end_ind); if (37 - !== + === /*<>*/ caml_string_get (str, str_ind$0)){ - var str_ind$7 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$7; - continue; - } - if((str_ind$0 + 1 | 0) === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - if - ( /*<>*/ caml_string_get - (str, str_ind$0 + 1 | 0) - === c) - /*<>*/ return str_ind$0; - /*<>*/ /*<>*/ var - match = - /*<>*/ caml_string_get - (str, str_ind$0 + 1 | 0); - if(95 <= match){ - if(123 <= match){ - if(126 > match) - switch(match - 123 | 0){ - case 0: - /*<>*/ var - /*<>*/ sub_end = - search_subformat_end(str_ind$0 + 2 | 0, end_ind, 125), - /*<>*/ str_ind$2 = - sub_end + 2 | 0, + if((str_ind$0 + 1 | 0) === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + if + ( /*<>*/ caml_string_get + (str, str_ind$0 + 1 | 0) + === c) + /*<>*/ return str_ind$0; + /*<>*/ /*<>*/ var + match = + /*<>*/ caml_string_get + (str, str_ind$0 + 1 | 0); + if(95 <= match){ + if(123 <= match){ + if(126 > match) + switch(match - 123 | 0){ + case 0: + /*<>*/ var + /*<>*/ sub_end = + search_subformat_end(str_ind$0 + 2 | 0, end_ind, 125), + /*<>*/ str_ind$2 = + sub_end + 2 | 0; str_ind$0 = str_ind$2; - continue; - case 1: break; - default: - /*<>*/ return expected_character - (str_ind$0 + 1 | 0, cst_character, 125); - } - } - else if(96 > match){ - if((str_ind$0 + 2 | 0) === end_ind) - /*<>*/ unexpected_end_of_format - (end_ind); - /*<>*/ /*<>*/ var - match$0 = - /*<>*/ caml_string_get - (str, str_ind$0 + 2 | 0); - if(40 === match$0){ - /*<>*/ var - /*<>*/ sub_end$0 = - search_subformat_end(str_ind$0 + 3 | 0, end_ind, 41), - /*<>*/ str_ind$3 = sub_end$0 + 2 | 0, - str_ind$0 = str_ind$3; - continue; + continue; + case 1: break; + default: + /*<>*/ return expected_character + (str_ind$0 + 1 | 0, cst_character, 125); + } } - if(123 === match$0){ - /*<>*/ var - /*<>*/ sub_end$1 = - search_subformat_end(str_ind$0 + 3 | 0, end_ind, 125), - /*<>*/ str_ind$4 = sub_end$1 + 2 | 0, + else if(96 > match){ + if((str_ind$0 + 2 | 0) === end_ind) + /*<>*/ invalid_format_message + (end_ind, cst_unexpected_end_of_format); + /*<>*/ /*<>*/ var + match$0 = + /*<>*/ caml_string_get + (str, str_ind$0 + 2 | 0); + if(40 === match$0){ + /*<>*/ var + /*<>*/ sub_end$0 = + search_subformat_end(str_ind$0 + 3 | 0, end_ind, 41), + /*<>*/ str_ind$3 = + sub_end$0 + 2 | 0; + str_ind$0 = str_ind$3; + continue; + } + if(123 === match$0){ + /*<>*/ var + /*<>*/ sub_end$1 = + search_subformat_end(str_ind$0 + 3 | 0, end_ind, 125), + /*<>*/ str_ind$4 = + sub_end$1 + 2 | 0; str_ind$0 = str_ind$4; + continue; + } + var str_ind$5 = str_ind$0 + 3 | 0; + str_ind$0 = str_ind$5; continue; } - var str_ind$5 = str_ind$0 + 3 | 0, str_ind$0 = str_ind$5; - continue; } - } - else{ - if(40 === match){ - /*<>*/ var - /*<>*/ sub_end$2 = - search_subformat_end(str_ind$0 + 2 | 0, end_ind, 41), - /*<>*/ str_ind$6 = sub_end$2 + 2 | 0, + else{ + if(40 === match){ + /*<>*/ var + /*<>*/ sub_end$2 = + search_subformat_end(str_ind$0 + 2 | 0, end_ind, 41), + /*<>*/ str_ind$6 = sub_end$2 + 2 | 0; str_ind$0 = str_ind$6; - continue; + continue; + } + if(41 === match) + /*<>*/ return expected_character + (str_ind$0 + 1 | 0, cst_character$0, 41); } - if(41 === match) - /*<>*/ return expected_character - (str_ind$0 + 1 | 0, cst_character$0, 41); + var str_ind$1 = str_ind$0 + 2 | 0; + str_ind$0 = str_ind$1; } - var str_ind$1 = str_ind$0 + 2 | 0, str_ind$0 = str_ind$1; + else{var str_ind$7 = str_ind$0 + 1 | 0; str_ind$0 = str_ind$7;} } /*<>*/ } - function incompatible_flag(pct_ind, str_ind, symb, option){ - /*<>*/ /*<>*/ var - subfmt = - /*<>*/ caml_call3 - (Stdlib_String[15], str, pct_ind, str_ind - pct_ind | 0); - /*<>*/ return /*<>*/ caml_call5 - (failwith_message(_Y_), str, pct_ind, option, symb, subfmt); - /*<>*/ } function compute_int_conv(pct_ind, str_ind, plus, hash, space, symb){ /*<>*/ var plus$0 = plus, hash$0 = hash, space$0 = space; /*<>*/ for(;;){ - var switch$0 = 0; - if(plus$0){ - if(hash$0) - switch$0 = 1; - else if(! space$0){ - if(100 === symb) /*<>*/ return 1; - if(105 === symb) /*<>*/ return 4; + a: + { + if(plus$0){ + if(! hash$0){ + if(space$0) break a; + if(100 === symb) /*<>*/ return 1; + if(105 === symb) /*<>*/ return 4; + break a; + } } - } - else if(hash$0) - if(space$0) - switch$0 = 1; else{ - var switcher$0 = symb - 88 | 0; - if(32 < switcher$0 >>> 0) - switch$0 = 1; - else - switch(switcher$0){ + if(! hash$0){ + if(space$0){ + if(100 === symb) /*<>*/ return 2; + if(105 === symb) /*<>*/ return 5; + break a; + } + var switcher$1 = symb - 88 | 0; + if(32 < switcher$1 >>> 0) break a; + switch(switcher$1){ case 0: - /*<>*/ return 9; + /*<>*/ return 8; case 12: - /*<>*/ return 13; + /*<>*/ return 0; case 17: - /*<>*/ return 14; + /*<>*/ return 3; case 23: - /*<>*/ return 11; + /*<>*/ return 10; case 29: - /*<>*/ return 15; + /*<>*/ return 12; case 32: - /*<>*/ return 7; - default: switch$0 = 1; + /*<>*/ return 6; + default: break a; } - } - else if(space$0){ - if(100 === symb) /*<>*/ return 2; - if(105 === symb) /*<>*/ return 5; - } - else{ - var switcher$1 = symb - 88 | 0; - if(32 >= switcher$1 >>> 0) - switch(switcher$1){ - case 0: - /*<>*/ return 8; - case 12: - /*<>*/ return 0; - case 17: - /*<>*/ return 3; - case 23: - /*<>*/ return 10; - case 29: - /*<>*/ return 12; - case 32: - /*<>*/ return 6; } - } - if(switch$0){ + if(! space$0){ + var switcher$0 = symb - 88 | 0; + if(32 >= switcher$0 >>> 0) + switch(switcher$0){ + case 0: + /*<>*/ return 9; + case 12: + /*<>*/ return 13; + case 17: + /*<>*/ return 14; + case 23: + /*<>*/ return 11; + case 29: + /*<>*/ return 15; + case 32: + /*<>*/ return 7; + } + } + } var switcher = symb - 88 | 0; if(32 >= switcher >>> 0) switch(switcher){ @@ -19829,33 +20389,42 @@ if(! legacy_behavior$0) /*<>*/ return incompatible_flag (pct_ind, str_ind, symb, cst$35); - var hash$0 = 0; + hash$0 = 0; continue; } } - if(! plus$0){ + if(plus$0) + if(space$0){ + if(! legacy_behavior$0) + /*<>*/ return incompatible_flag + (pct_ind, str_ind, 32, cst$32); + space$0 = 0; + } + else{ + if(! legacy_behavior$0) + /*<>*/ return incompatible_flag + (pct_ind, str_ind, symb, cst$33); + plus$0 = 0; + } + else{ if(! space$0) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _W_], 1); if(! legacy_behavior$0) /*<>*/ return incompatible_flag (pct_ind, str_ind, symb, cst$34); - var space$0 = 0; - continue; - } - if(space$0){ - if(! legacy_behavior$0) - /*<>*/ return incompatible_flag - (pct_ind, str_ind, 32, cst$32); - var space$0 = 0; - continue; + space$0 = 0; } - if(! legacy_behavior$0) - /*<>*/ return incompatible_flag - (pct_ind, str_ind, symb, cst$33); - var plus$0 = 0; } /*<>*/ } + function incompatible_flag(pct_ind, str_ind, symb, option){ + /*<>*/ /*<>*/ var + subfmt = + /*<>*/ caml_call3 + (Stdlib_String[16], str, pct_ind, str_ind - pct_ind | 0); + /*<>*/ return /*<>*/ caml_call5 + (failwith_message(_Y_), str, pct_ind, option, symb, subfmt); + /*<>*/ } return parse(0, caml_ml_string_length(str)); } function format_of_string_fmtty(str, fmtty){ @@ -19951,28 +20520,28 @@ CamlinternalFormat = global_data.CamlinternalFormat, Stdlib = global_data.Stdlib; function kfprintf(k, o, param){ - /*<>*/ var - fmt = param[1], - /*<>*/ _g_ = 0; - function _h_(acc){ - /*<>*/ /*<>*/ caml_call2 - (CamlinternalFormat[9], o, acc); - return caml_call1(k, o); - /*<>*/ } + var fmt = param[1]; /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _h_, _g_, fmt); + (CamlinternalFormat[7], + function(acc){ + /*<>*/ /*<>*/ caml_call2 + (CamlinternalFormat[9], o, acc); + return caml_call1(k, o); + /*<>*/ }, + 0, + fmt); } function kbprintf(k, b, param){ - /*<>*/ var - fmt = param[1], - /*<>*/ _e_ = 0; - function _f_(acc){ - /*<>*/ /*<>*/ caml_call2 - (CamlinternalFormat[10], b, acc); - return caml_call1(k, b); - /*<>*/ } + var fmt = param[1]; /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _f_, _e_, fmt); + (CamlinternalFormat[7], + function(acc){ + /*<>*/ /*<>*/ caml_call2 + (CamlinternalFormat[10], b, acc); + return caml_call1(k, b); + /*<>*/ }, + 0, + fmt); } function ikfprintf(k, oc, param){ var fmt = param[1]; @@ -20022,22 +20591,920 @@ fmt); /*<>*/ } var - Stdlib_Printf = + Stdlib_Printf = + [0, + fprintf, + printf, + eprintf, + sprintf, + bprintf, + ifprintf, + ibprintf, + kfprintf, + ikfprintf, + ksprintf, + kbprintf, + ikfprintf, + ksprintf]; + runtime.caml_register_global(3, Stdlib_Printf, "Stdlib__Printf"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Dynarray +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__List, Stdlib__Printf, Stdlib__Seq, Stdlib__Sys +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_requested = " requested", + cst_index = ": index ", + cst_Dynarray = "Dynarray.", + cst_append$1 = "append", + cst_dynarray_ml = "dynarray.ml", + cst_ensure_capacity$0 = "ensure_capacity", + caml_check_bound = runtime.caml_check_bound, + caml_make_vect = runtime.caml_make_vect, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_wrap_exception = runtime.caml_wrap_exception; + /*<>*/ function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + /*<>*/ function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + /*<>*/ function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + /*<>*/ function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); + } + /*<>*/ function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var + global_data = runtime.caml_get_global_data(), + f$0 = cst_ensure_capacity$0, + f = "get_last", + invalid_state_description = + "Invalid dynarray (unsynchronized concurrent length change)", + Stdlib_List = global_data.Stdlib__List, + Stdlib_Array = global_data.Stdlib__Array, + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib = global_data.Stdlib, + Stdlib_Sys = global_data.Stdlib__Sys, + Assert_failure = global_data.Assert_failure, + Stdlib_Printf = global_data.Stdlib__Printf, + _a_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + cst_index, + [4, 0, 0, 0, [11, " out of bounds (empty dynarray)", 0]]]]], + "Dynarray.%s: index %d out of bounds (empty dynarray)"], + _b_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + cst_index, + [4, 0, 0, 0, [11, " out of bounds (0..", [4, 0, 0, 0, [12, 41, 0]]]]]]], + "Dynarray.%s: index %d out of bounds (0..%d)"], + _c_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, ": negative length ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], + "Dynarray.%s: negative length %d requested"], + _d_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, ": negative capacity ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], + "Dynarray.%s: negative capacity %d requested"], + _e_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + ": cannot grow to requested length ", + [4, + 0, + 0, + 0, + [11, " (max_array_length is ", [4, 0, 0, 0, [12, 41, 0]]]]]]], + "Dynarray.%s: cannot grow to requested length %d (max_array_length is %d)"], + _f_ = + [0, + [2, + 0, + [11, + ": missing element at position ", + [4, 0, 0, 0, [11, " < length ", [4, 0, 0, 0, 0]]]]], + "%s: missing element at position %d < length %d"], + _g_ = + [0, + [2, + 0, + [11, ": length ", [4, 0, 0, 0, [11, " > capacity ", [4, 0, 0, 0, 0]]]]], + "%s: length %d > capacity %d"], + _h_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + ": a length change from ", + [4, + 0, + 0, + 0, + [11, " to ", [4, 0, 0, 0, [11, " occurred during iteration", 0]]]]]]], + "Dynarray.%s: a length change from %d to %d occurred during iteration"], + _i_ = + [0, + [11, cst_Dynarray, [2, 0, [11, ": empty array", 0]]], + "Dynarray.%s: empty array"], + cst_make = "make", + cst_init = "init", + cst_get = "get", + cst_set = "set", + cst_truncate = "truncate", + _j_ = [0, cst_dynarray_ml, 381, 4], + _k_ = [0, cst_dynarray_ml, 380, 4], + cst_ensure_capacity = cst_ensure_capacity$0, + cst_set_capacity = "set_capacity", + cst_append = cst_append$1, + cst_append$0 = cst_append$1, + cst_iter = "iter", + cst_iteri = "iteri", + cst_map = "map", + cst_mapi = "mapi", + cst_fold_left = "fold_left", + cst_fold_right = "fold_right", + cst_exists = "exists", + cst_for_all = "for_all", + cst_filter = "filter", + cst_filter_map = "filter_map", + cst_to_array = "to_array", + cst_to_list = "to_list", + cst_to_seq = "to_seq", + cst_to_seq_rev = "to_seq_rev"; + function negative_length_requested(f, n){ + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Printf[10], Stdlib[1], _c_, f, n); + /*<>*/ } + function negative_capacity_requested(f, n){ + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Printf[10], Stdlib[1], _d_, f, n); + /*<>*/ } + function missing_element(i, length){ + /*<>*/ return /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _f_, + invalid_state_description, + i, + length); + /*<>*/ } + function unexpected_empty_element(f, i, length){ + /*<>*/ return i < length + ? missing_element(i, length) + : 0 + === length + ? /*<>*/ caml_call4 + (Stdlib_Printf[10], Stdlib[1], _a_, f, i) + : /*<>*/ caml_call5 + (Stdlib_Printf[10], Stdlib[1], _b_, f, i, length - 1 | 0); + /*<>*/ } + function check_same_length(f, a, expected){ + /*<>*/ var + length_a = a[1], + _W_ = expected !== length_a ? 1 : 0; + return _W_ + ? /*<>*/ caml_call5 + (Stdlib_Printf[10], Stdlib[1], _h_, f, expected, length_a) + : _W_; + /*<>*/ } + function check_valid_length(length, arr){ + /*<>*/ var + capacity = arr.length - 1, + _V_ = capacity < length ? 1 : 0; + return _V_ + ? /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _g_, + invalid_state_description, + length, + capacity) + : _V_; + /*<>*/ } + function unsafe_get(arr, i, length){ + /*<>*/ var match = arr[1 + i]; + if(! match) /*<>*/ return missing_element(i, length); + var v = match[1]; + /*<>*/ return v; + /*<>*/ } + function create(param){ + /*<>*/ return [0, 0, [0]]; + /*<>*/ } + function make(n, x){ + /*<>*/ if(n < 0) + /*<>*/ negative_length_requested(cst_make, n); + /*<>*/ return [0, + n, + /*<>*/ caml_call2 + (Stdlib_Array[1], + n, + function(param){ + /*<>*/ return [0, x]; + /*<>*/ })]; + /*<>*/ } + function init(n, f){ + /*<>*/ if(n < 0) + /*<>*/ negative_length_requested(cst_init, n); + /*<>*/ return [0, + n, + /*<>*/ caml_call2 + (Stdlib_Array[1], + n, + function(i){ + /*<>*/ return [0, + /*<>*/ caml_call1(f, i)]; + /*<>*/ })]; + /*<>*/ } + function get(a, i){ + /*<>*/ /*<>*/ var + match = caml_check_bound(a[2], i)[1 + i]; + return match ? match[1] : unexpected_empty_element(cst_get, i, a[1]); + /*<>*/ } + function set(a, i, x){ + /*<>*/ /*<>*/ var + match = caml_check_bound(a[2], i)[1 + i]; + return match + ? (match[1] = x, 0) + : unexpected_empty_element(cst_set, i, a[1]); + /*<>*/ } + function length(a){ + /*<>*/ return a[1]; + /*<>*/ } + function is_empty(a){ + /*<>*/ return 0 === a[1] ? 1 : 0; + /*<>*/ } + function copy(param){ + var length = param[1], arr = param[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ return [0, + length, + /*<>*/ caml_call2 + (Stdlib_Array[1], + length, + function(i){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + /*<>*/ return [0, v]; + /*<>*/ })]; + } + function get_last(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + if(0 === length) + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[10], Stdlib[1], _i_, f); + /*<>*/ return unsafe_get(arr, length - 1 | 0, length); + /*<>*/ } + function find_last(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + return 0 === length ? 0 : [0, unsafe_get(arr, length - 1 | 0, length)]; + /*<>*/ } + function pop_last(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + if(0 === length) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + /*<>*/ var + /*<>*/ last = length - 1 | 0, + match = arr[1 + last]; + return match + ? (arr[1 + last] = 0, a[1] = last, match[1]) + : missing_element(last, length); + /*<>*/ } + function pop_last_opt(a){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + x = pop_last(a); + } + catch(_U_){ + var _T_ = caml_wrap_exception(_U_); + if(_T_ === Stdlib[8]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_T_, 0); + } + /*<>*/ return [0, x]; + /*<>*/ } + function remove_last(a){ + /*<>*/ var + /*<>*/ last = a[1] - 1 | 0, + _R_ = 0 <= last ? 1 : 0, + _S_ = + _R_ + ? (a[1] = last, caml_check_bound(a[2], last)[1 + last] = 0, 0) + : _R_; + /*<>*/ return _S_; + /*<>*/ } + function truncate(a, n){ + /*<>*/ if(n < 0) + /*<>*/ negative_length_requested(cst_truncate, n); + var length = a[1], arr = a[2]; + return length <= n + ? 0 + : (a + [1] + = n, + /*<>*/ caml_call4 + (Stdlib_Array[8], arr, n, length - n | 0, 0)); + /*<>*/ } + function clear(a){ + /*<>*/ return truncate(a, 0); + /*<>*/ } + function capacity(a){ + /*<>*/ return a[2].length - 1; + /*<>*/ } + function ensure_capacity(a, capacity_request){ + /*<>*/ var + arr = a[2], + /*<>*/ cur_capacity = arr.length - 1; + /*<>*/ if(0 > capacity_request) + /*<>*/ return negative_capacity_requested + (cst_ensure_capacity, capacity_request); + if(capacity_request <= cur_capacity) /*<>*/ return 0; + if(Stdlib_Sys[13] < capacity_request) + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _e_, + f$0, + capacity_request, + Stdlib_Sys[13]); + /*<>*/ var + n = + 512 < cur_capacity + ? cur_capacity + (cur_capacity / 2 | 0) | 0 + : cur_capacity * 2 | 0, + _O_ = Stdlib_Sys[13], + /*<>*/ _P_ = + /*<>*/ caml_call2(Stdlib[17], 8, n), + /*<>*/ _Q_ = + /*<>*/ caml_call2(Stdlib[16], _P_, _O_), + /*<>*/ new_capacity = + /*<>*/ caml_call2 + (Stdlib[17], _Q_, capacity_request), + /*<>*/ new_arr = + /*<>*/ caml_make_vect(new_capacity, 0); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], arr, 0, new_arr, 0, a[1]); + a[2] = new_arr; + if(0 > capacity_request) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _k_], 1); + if(capacity_request <= new_arr.length - 1) return 0; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _j_], 1); + /*<>*/ } + function ensure_extra_capacity(a, extra_capacity_request){ + /*<>*/ return ensure_capacity + (a, a[1] + extra_capacity_request | 0); + /*<>*/ } + function fit_capacity(a){ + /*<>*/ var _N_ = a[1]; + return capacity(a) === _N_ + ? 0 + : (a + [2] + = + /*<>*/ caml_call3 + (Stdlib_Array[6], a[2], 0, a[1]), + 0); + /*<>*/ } + function set_capacity(a, n){ + /*<>*/ if(n < 0) + /*<>*/ negative_capacity_requested + (cst_set_capacity, n); + /*<>*/ var + arr = a[2], + /*<>*/ cur_capacity = arr.length - 1; + if(n < cur_capacity){ + a[1] = /*<>*/ caml_call2(Stdlib[16], a[1], n); + a[2] = /*<>*/ caml_call3(Stdlib_Array[6], arr, 0, n); + return 0; + } + var _L_ = cur_capacity < n ? 1 : 0; + if(_L_){ + /*<>*/ /*<>*/ var + new_arr = /*<>*/ caml_make_vect(n, 0); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], arr, 0, new_arr, 0, a[1]); + a[2] = new_arr; + var _M_ = 0; + } + else + var _M_ = _L_; + return _M_; + /*<>*/ } + function reset(a){ + /*<>*/ a[1] = 0; + a[2] = [0]; + return 0; + /*<>*/ } + function add_last_if_room(a, elem){ + /*<>*/ var length = a[1], arr = a[2]; + return arr.length - 1 <= length + ? 0 + : (a[1] = length + 1 | 0, arr[1 + length] = elem, 1); + /*<>*/ } + function add_last(a, x){ + /*<>*/ /*<>*/ var elem = [0, x]; + /*<>*/ if(add_last_if_room(a, elem)) + /*<>*/ return 0; + /*<>*/ for(;;){ + /*<>*/ ensure_extra_capacity(a, 1); + /*<>*/ /*<>*/ var + _K_ = 1 - add_last_if_room(a, elem); + if(! _K_) /*<>*/ return _K_; + } + /*<>*/ } + function append_list(a, li){ + /*<>*/ var li$0 = li; + /*<>*/ for(;;){ + if(! li$0) /*<>*/ return 0; + var xs = li$0[2], x = li$0[1]; + /*<>*/ add_last(a, x); + li$0 = xs; + } + /*<>*/ } + function append_iter(a, iter, b){ + /*<>*/ return /*<>*/ caml_call2 + (iter, + function(x){ + /*<>*/ return add_last(a, x); + /*<>*/ }, + b); + /*<>*/ } + function append_seq(a, seq){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(x){ + /*<>*/ return add_last(a, x); + /*<>*/ }, + seq); + /*<>*/ } + function append_array_if_room(a, b){ + /*<>*/ var + length_a = a[1], + arr = a[2], + /*<>*/ length_b = b.length - 1; + if(arr.length - 1 < (length_a + length_b | 0)) + /*<>*/ return 0; + a[1] = length_a + length_b | 0; + /*<>*/ var + /*<>*/ _I_ = length_b - 1 | 0, + /*<>*/ _H_ = 0; + if(_I_ >= 0){ + var i = _H_; + for(;;){ + /*<>*/ /*<>*/ var + x = b[1 + i]; + arr[1 + (length_a + i | 0)] = [0, x]; + /*<>*/ /*<>*/ var + _J_ = i + 1 | 0; + if(_I_ === i) break; + i = _J_; + } + } + /*<>*/ return 1; + /*<>*/ } + function append_array(a, b){ + /*<>*/ if(append_array_if_room(a, b)) + /*<>*/ return 0; + /*<>*/ for(;;){ + /*<>*/ ensure_extra_capacity(a, b.length - 1); + /*<>*/ /*<>*/ var + _G_ = 1 - append_array_if_room(a, b); + if(! _G_) /*<>*/ return _G_; + } + /*<>*/ } + function append_if_room(a, b, length_b){ + /*<>*/ var length_a = a[1], arr_a = a[2]; + if(arr_a.length - 1 < (length_a + length_b | 0)) + /*<>*/ return 0; + a[1] = length_a + length_b | 0; + var arr_b = b[2]; + /*<>*/ check_valid_length(length_b, arr_b); + /*<>*/ var + _E_ = length_b - 1 | 0, + /*<>*/ _D_ = 0; + if(_E_ >= 0){ + var i = _D_; + for(;;){ + /*<>*/ /*<>*/ var + x = unsafe_get(arr_b, i, length_b); + arr_a[1 + (length_a + i | 0)] = [0, x]; + /*<>*/ /*<>*/ var + _F_ = i + 1 | 0; + if(_E_ === i) break; + i = _F_; + } + } + /*<>*/ check_same_length(cst_append, b, length_b); + /*<>*/ return 1; + /*<>*/ } + function append(a, b){ + /*<>*/ var length_b = b[1]; + /*<>*/ if(append_if_room(a, b, length_b)) + /*<>*/ return 0; + /*<>*/ for(;;){ + /*<>*/ ensure_extra_capacity(a, length_b); + /*<>*/ check_same_length(cst_append$0, b, length_b); + /*<>*/ /*<>*/ var + _C_ = 1 - append_if_room(a, b, length_b); + if(! _C_) /*<>*/ return _C_; + } + /*<>*/ } + function iter(f, k, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + _A_ = length - 1 | 0, + /*<>*/ _z_ = 0; + if(_A_ >= 0){ + var i = _z_; + for(;;){ + /*<>*/ /*<>*/ caml_call1 + (k, unsafe_get(arr, i, length)); + /*<>*/ /*<>*/ var + _B_ = i + 1 | 0; + if(_A_ === i) break; + i = _B_; + } + } + /*<>*/ return check_same_length(f, a, length); + /*<>*/ } + function iter$0(k, a){ + /*<>*/ return iter(cst_iter, k, a); + /*<>*/ } + function iteri(k, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + _x_ = length - 1 | 0, + /*<>*/ _w_ = 0; + if(_x_ >= 0){ + var i = _w_; + for(;;){ + /*<>*/ /*<>*/ caml_call2 + (k, i, unsafe_get(arr, i, length)); + /*<>*/ /*<>*/ var + _y_ = i + 1 | 0; + if(_x_ === i) break; + i = _y_; + } + } + /*<>*/ return check_same_length(cst_iteri, a, length); + /*<>*/ } + function map(f, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ /*<>*/ var + res = + [0, + length, + /*<>*/ caml_call2 + (Stdlib_Array[1], + length, + function(i){ + /*<>*/ return [0, + /*<>*/ caml_call1 + (f, unsafe_get(arr, i, length))]; + /*<>*/ })]; + /*<>*/ check_same_length(cst_map, a, length); + /*<>*/ return res; + /*<>*/ } + function mapi(f, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ /*<>*/ var + res = + [0, + length, + /*<>*/ caml_call2 + (Stdlib_Array[1], + length, + function(i){ + /*<>*/ return [0, + /*<>*/ caml_call2 + (f, i, unsafe_get(arr, i, length))]; + /*<>*/ })]; + /*<>*/ check_same_length(cst_mapi, a, length); + /*<>*/ return res; + /*<>*/ } + function fold_left(f, acc, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + /*<>*/ r = [0, acc], + /*<>*/ _u_ = length - 1 | 0, + /*<>*/ _t_ = 0; + if(_u_ >= 0){ + var i = _t_; + for(;;){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + r[1] = /*<>*/ caml_call2(f, r[1], v); + /*<>*/ /*<>*/ var + _v_ = i + 1 | 0; + if(_u_ === i) break; + i = _v_; + } + } + /*<>*/ check_same_length(cst_fold_left, a, length); + return r[1]; + /*<>*/ } + function fold_right(f, a, acc){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + /*<>*/ r = [0, acc], + /*<>*/ _r_ = length - 1 | 0; + if(_r_ >= 0){ + var i = _r_; + for(;;){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + r[1] = /*<>*/ caml_call2(f, v, r[1]); + /*<>*/ /*<>*/ var + _s_ = i - 1 | 0; + if(0 === i) break; + i = _s_; + } + } + /*<>*/ check_same_length(cst_fold_right, a, length); + return r[1]; + /*<>*/ } + function exists(p, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + /*<>*/ /*<>*/ var + _q_ = + /*<>*/ caml_call1(p, unsafe_get(arr, i, length)); + /*<>*/ if(! _q_){ + var i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = _q_; + } + /*<>*/ check_same_length(cst_exists, a, length); + /*<>*/ return res; + } + /*<>*/ } + function for_all(p, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 1; + else{ + /*<>*/ /*<>*/ var + _p_ = + /*<>*/ caml_call1(p, unsafe_get(arr, i, length)); + /*<>*/ if(_p_){ + var i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = _p_; + } + /*<>*/ check_same_length(cst_for_all, a, length); + /*<>*/ return res; + } + /*<>*/ } + function filter(f, a){ + /*<>*/ /*<>*/ var b = create(0); + /*<>*/ iter + (cst_filter, + function(x){ + /*<>*/ /*<>*/ var + _o_ = /*<>*/ caml_call1(f, x); + /*<>*/ return _o_ ? add_last(b, x) : _o_; + /*<>*/ }, + a); + /*<>*/ return b; + /*<>*/ } + function filter_map(f, a){ + /*<>*/ /*<>*/ var b = create(0); + /*<>*/ iter + (cst_filter_map, + function(x){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(f, x); + if(! match) /*<>*/ return 0; + var y = match[1]; + /*<>*/ return add_last(b, y); + /*<>*/ }, + a); + /*<>*/ return b; + /*<>*/ } + function of_array(a){ + /*<>*/ var length = a.length - 1; + /*<>*/ return [0, + length, + /*<>*/ caml_call2 + (Stdlib_Array[1], + length, + function(i){ + /*<>*/ return [0, a[1 + i]]; + /*<>*/ })]; + /*<>*/ } + function to_array(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_call2 + (Stdlib_Array[1], + length, + function(i){ + /*<>*/ return unsafe_get(arr, i, length); + /*<>*/ }); + /*<>*/ check_same_length(cst_to_array, a, length); + /*<>*/ return res; + /*<>*/ } + function of_list(li){ + /*<>*/ /*<>*/ var a = create(0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_List[18], + function(x){ + /*<>*/ return add_last(a, x); + /*<>*/ }, + li); + /*<>*/ return a; + /*<>*/ } + function to_list(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + /*<>*/ l = [0, 0], + /*<>*/ _l_ = length - 1 | 0; + if(_l_ >= 0){ + var i = _l_; + for(;;){ + var _m_ = l[1]; + l[1] = [0, unsafe_get(arr, i, length), _m_]; + /*<>*/ /*<>*/ var + _n_ = i - 1 | 0; + if(0 === i) break; + i = _n_; + } + } + /*<>*/ check_same_length(cst_to_list, a, length); + return l[1]; + /*<>*/ } + function of_seq(seq){ + /*<>*/ /*<>*/ var + init = create(0); + /*<>*/ append_seq(init, seq); + /*<>*/ return init; + /*<>*/ } + function to_seq(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ check_same_length(cst_to_seq, a, length); + if(length <= i) /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(0); + /*<>*/ } + function to_seq_reentrant(a){ + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ if(a[1] <= i) + /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = get(a, i); + /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(0); + /*<>*/ } + function to_seq_rev(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ check_same_length(cst_to_seq_rev, a, length); + if(0 > i) /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(length - 1 | 0); + /*<>*/ } + function to_seq_rev_reentrant(a){ + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ if(0 > i) + /*<>*/ return 0; + if(a[1] <= i) /*<>*/ return aux(a[1] - 1 | 0)(0); + /*<>*/ /*<>*/ var + v = get(a, i); + /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(a[1] - 1 | 0); + /*<>*/ } + var + Stdlib_Dynarray = [0, - fprintf, - printf, - eprintf, - sprintf, - bprintf, - ifprintf, - ibprintf, - kfprintf, - ikfprintf, - ksprintf, - kbprintf, - ikfprintf, - ksprintf]; - runtime.caml_register_global(3, Stdlib_Printf, "Stdlib__Printf"); + create, + make, + init, + get, + set, + length, + is_empty, + get_last, + find_last, + copy, + add_last, + append_array, + append_list, + append, + append_seq, + append_iter, + pop_last_opt, + pop_last, + remove_last, + truncate, + clear, + iter$0, + iteri, + map, + mapi, + fold_left, + fold_right, + exists, + for_all, + filter, + filter_map, + of_array, + to_array, + of_list, + to_list, + of_seq, + to_seq, + to_seq_reentrant, + to_seq_rev, + to_seq_rev_reentrant, + capacity, + ensure_capacity, + ensure_extra_capacity, + fit_capacity, + set_capacity, + reset]; + runtime.caml_register_global(44, Stdlib_Dynarray, "Stdlib__Dynarray"); return; /*<>*/ } (globalThis)); @@ -20049,13 +21516,13 @@ "use strict"; var runtime = globalThis.jsoo_runtime, - cst$7 = "", - cst$9 = " ", + cst$8 = "", + cst$10 = " ", cst_Display_this_list_of_optio$1 = " Display this list of options", cst_s = "%s", cst_help$4 = "--help", cst_help$3 = "-help", - cst$8 = ".\n", + cst$9 = ".\n", cst_a_float$1 = "a float", cst_an_integer$1 = "an integer", caml_check_bound = runtime.caml_check_bound, @@ -20064,7 +21531,6 @@ caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_string_length = runtime.caml_ml_string_length, caml_string_get = runtime.caml_string_get, - caml_string_notequal = runtime.caml_string_notequal, caml_sys_argv = runtime.caml_sys_argv, caml_wrap_exception = runtime.caml_wrap_exception; /*<>*/ function caml_call1(f, a0){ @@ -20098,12 +21564,14 @@ : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5]); } /*<>*/ var + undef = undefined, global_data = runtime.caml_get_global_data(), - cst$6 = "\n", - cst$3 = cst$7, - cst$4 = " ", - cst$5 = cst$7, + cst$7 = "\n", + cst$4 = cst$8, + cst$5 = " ", + cst$6 = cst$8, cst$2 = "(?)", + cst$3 = "-", cst = "}", cst$0 = "|", cst$1 = "{", @@ -20117,60 +21585,22 @@ /*<>*/ Bad = [248, "Stdlib.Arg.Bad", caml_fresh_oo_id(0)], /*<>*/ Help = [248, "Stdlib.Arg.Help", caml_fresh_oo_id(0)], /*<>*/ Stop = [248, "Stdlib.Arg.Stop", caml_fresh_oo_id(0)], - _v_ = [0, [2, 0, [0, 0]], "%s%c"], - _p_ = [0, [2, 0, 0], cst_s], - _q_ = [0, [2, 0, 0], cst_s], - _n_ = [0, [2, 0, 0], cst_s], - _o_ = [0, [2, 0, 0], cst_s], - _l_ = [0, [2, 0, 0], cst_s], - _m_ = [0, [2, 0, 0], cst_s], - cst_a_boolean = "a boolean", - cst_an_integer = cst_an_integer$1, - cst_an_integer$0 = cst_an_integer$1, - cst_a_float = cst_a_float$1, - cst_a_float$0 = cst_a_float$1, - cst_one_of = "one of: ", - cst_Arg_Expand_is_is_only_allo = - "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic", - cst_no_argument = "no argument", - _f_ = - [0, - [2, 0, [11, ": unknown option '", [2, 0, [11, "'.\n", 0]]]], - "%s: unknown option '%s'.\n"], - _i_ = - [0, - [2, - 0, - [11, - ": wrong argument '", - [2, - 0, - [11, - "'; option '", - [2, 0, [11, "' expects ", [2, 0, [11, cst$8, 0]]]]]]]], - "%s: wrong argument '%s'; option '%s' expects %s.\n"], - _j_ = + cst_none = "", + _a_ = + [0, [11, cst$10, [2, 0, [12, 32, [2, 0, [12, 10, 0]]]]], " %s %s\n"], + _b_ = [0, - [2, 0, [11, ": option '", [2, 0, [11, "' needs an argument.\n", 0]]]], - "%s: option '%s' needs an argument.\n"], - _k_ = [0, [2, 0, [11, ": ", [2, 0, [11, cst$8, 0]]]], "%s: %s.\n"], - _g_ = [0, cst_help$3], - _h_ = [0, cst_help$4], - _e_ = [0, [2, 0, 0], cst_s], - _d_ = [0, [2, 0, [12, 10, 0]], "%s\n"], - cst_help$2 = cst_help$3, + [11, cst$10, [2, 0, [12, 32, [2, 0, [2, 0, [12, 10, 0]]]]]], + " %s %s%s\n"], + _c_ = [0, cst_help$3], cst_Display_this_list_of_optio = cst_Display_this_list_of_optio$1, cst_help = cst_help$3, - cst_help$1 = cst_help$4, cst_Display_this_list_of_optio$0 = cst_Display_this_list_of_optio$1, cst_help$0 = cst_help$4, - _c_ = [0, cst_help$3], - _a_ = [0, [11, cst$9, [2, 0, [12, 32, [2, 0, [12, 10, 0]]]]], " %s %s\n"], - _b_ = - [0, - [11, cst$9, [2, 0, [12, 32, [2, 0, [2, 0, [12, 10, 0]]]]]], - " %s %s%s\n"], - cst_none = ""; + cst_help$1 = cst_help$4, + cst_help$2 = cst_help$3, + _d_ = [0, [2, 0, [12, 10, 0]], "%s\n"], + _e_ = [0, [2, 0, 0], cst_s]; function assoc3(x, l){ /*<>*/ var l$0 = l; /*<>*/ for(;;){ @@ -20180,7 +21610,8 @@ var match = l$0[1], y2 = match[2], y1 = match[1]; /*<>*/ if( /*<>*/ caml_equal(y1, x)) /*<>*/ return y2; - var t = l$0[2], l$0 = t; + var t = l$0[2]; + l$0 = t; } /*<>*/ } function make_symlist(prefix, sep, suffix, l){ @@ -20188,18 +21619,21 @@ /*<>*/ var t = l[2], h = l[1], - /*<>*/ _aD_ = - /*<>*/ caml_call2(Stdlib[28], prefix, h); - function _aE_(x, y){ - /*<>*/ /*<>*/ var - _aG_ = /*<>*/ caml_call2(Stdlib[28], sep, y); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], x, _aG_); - /*<>*/ } - /*<>*/ /*<>*/ var - _aF_ = /*<>*/ caml_call3(Stdlib_List[25], _aE_, _aD_, t); + /*<>*/ _az_ = + /*<>*/ caml_call2(Stdlib[28], prefix, h), + /*<>*/ _aA_ = + /*<>*/ caml_call3 + (Stdlib_List[26], + function(x, y){ + /*<>*/ /*<>*/ var + _aB_ = /*<>*/ caml_call2(Stdlib[28], sep, y); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[28], x, _aB_); + /*<>*/ }, + _az_, + t); /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], _aF_, suffix); + (Stdlib[28], _aA_, suffix); /*<>*/ } function help_action(param){ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace @@ -20208,11 +21642,11 @@ function add_help(speclist){ /*<>*/ try{ /*<>*/ assoc3(cst_help$2, speclist); - /*<>*/ var /*<>*/ _aA_ = 0, add1 = _aA_; + /*<>*/ var /*<>*/ _aw_ = 0, add1 = _aw_; } - catch(_aC_){ - var _aw_ = caml_wrap_exception(_aC_); - if(_aw_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_aw_, 0); + catch(_ay_){ + var _as_ = caml_wrap_exception(_ay_); + if(_as_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_as_, 0); var add1 = [0, @@ -20221,11 +21655,11 @@ } try{ /*<>*/ assoc3(cst_help$1, speclist); - /*<>*/ var /*<>*/ _az_ = 0, add2 = _az_; + /*<>*/ var /*<>*/ _av_ = 0, add2 = _av_; } - catch(_aB_){ - var _ax_ = caml_wrap_exception(_aB_); - if(_ax_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_ax_, 0); + catch(_ax_){ + var _at_ = caml_wrap_exception(_ax_); + if(_at_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_at_, 0); var add2 = [0, @@ -20233,33 +21667,35 @@ 0]; } /*<>*/ /*<>*/ var - _ay_ = /*<>*/ caml_call2(Stdlib[37], add1, add2); + _au_ = /*<>*/ caml_call2(Stdlib[37], add1, add2); /*<>*/ return /*<>*/ caml_call2 - (Stdlib[37], speclist, _ay_); + (Stdlib[37], speclist, _au_); /*<>*/ } function usage_b(buf, speclist, errmsg){ /*<>*/ /*<>*/ caml_call3 (Stdlib_Printf[5], buf, _d_, errmsg); /*<>*/ /*<>*/ var - _as_ = add_help(speclist); - /*<>*/ function _at_(param){ - var - doc = param[3], - spec = param[2], - key = param[1], - _au_ = 0 < /*<>*/ caml_ml_string_length(doc) ? 1 : 0; - if(! _au_) return _au_; - if(11 !== spec[0]) - /*<>*/ return /*<>*/ caml_call4 - (Stdlib_Printf[5], buf, _a_, key, doc); - /*<>*/ var - l = spec[1], - /*<>*/ _av_ = make_symlist(cst$1, cst$0, cst, l); - /*<>*/ return /*<>*/ caml_call5 - (Stdlib_Printf[5], buf, _b_, key, _av_, doc); - } + _ap_ = add_help(speclist); /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[17], _at_, _as_); + (Stdlib_List[18], + function(param){ + var + doc = param[3], + spec = param[2], + key = param[1], + _aq_ = + 0 < /*<>*/ caml_ml_string_length(doc) ? 1 : 0; + if(! _aq_) return _aq_; + if(11 !== spec[0]) + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Printf[5], buf, _a_, key, doc); + /*<>*/ var + l = spec[1], + /*<>*/ _ar_ = make_symlist(cst$1, cst$0, cst, l); + /*<>*/ return /*<>*/ caml_call5 + (Stdlib_Printf[5], buf, _b_, key, _ar_, doc); + }, + _ap_); /*<>*/ } function usage_string(speclist, errmsg){ /*<>*/ /*<>*/ var @@ -20270,33 +21706,72 @@ /*<>*/ } function usage(speclist, errmsg){ /*<>*/ /*<>*/ var - _ar_ = usage_string(speclist, errmsg); + _ao_ = usage_string(speclist, errmsg); /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Printf[3], _e_, _ar_); + (Stdlib_Printf[3], _e_, _ao_); /*<>*/ } - /*<>*/ /*<>*/ var current = [0, 0]; + /*<>*/ var + /*<>*/ current = [0, 0], + _f_ = + [0, + [2, 0, [11, ": unknown option '", [2, 0, [11, "'.\n", 0]]]], + "%s: unknown option '%s'.\n"], + _g_ = [0, cst_help$3], + _h_ = [0, cst_help$4], + _i_ = + [0, + [2, + 0, + [11, + ": wrong argument '", + [2, + 0, + [11, + "'; option '", + [2, 0, [11, "' expects ", [2, 0, [11, cst$9, 0]]]]]]]], + "%s: wrong argument '%s'; option '%s' expects %s.\n"], + _j_ = + [0, + [2, 0, [11, ": option '", [2, 0, [11, "' needs an argument.\n", 0]]]], + "%s: option '%s' needs an argument.\n"], + _k_ = [0, [2, 0, [11, ": ", [2, 0, [11, cst$9, 0]]]], "%s: %s.\n"], + cst_no_argument = "no argument", + cst_a_boolean = "a boolean", + cst_an_integer = cst_an_integer$1, + cst_an_integer$0 = cst_an_integer$1, + cst_a_float = cst_a_float$1, + cst_a_float$0 = cst_a_float$1, + cst_one_of = "one of: ", + cst_Arg_Expand_is_is_only_allo = + "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic", + _l_ = [0, [2, 0, 0], cst_s], + _m_ = [0, [2, 0, 0], cst_s], + _n_ = [0, [2, 0, 0], cst_s], + _o_ = [0, [2, 0, 0], cst_s], + _p_ = [0, [2, 0, 0], cst_s], + _q_ = [0, [2, 0, 0], cst_s]; function int_of_string_opt(x){ /*<>*/ try{ /*<>*/ /*<>*/ var - _ap_ = [0, /*<>*/ runtime.caml_int_of_string(x)]; - /*<>*/ return _ap_; + _am_ = [0, /*<>*/ runtime.caml_int_of_string(x)]; + /*<>*/ return _am_; } - catch(_aq_){ - var _ao_ = caml_wrap_exception(_aq_); - if(_ao_[1] === Stdlib[7]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_ao_, 0); + catch(_an_){ + var _al_ = caml_wrap_exception(_an_); + if(_al_[1] === Stdlib[7]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_al_, 0); } /*<>*/ } function float_of_string_opt(x){ /*<>*/ try{ /*<>*/ /*<>*/ var - _am_ = [0, /*<>*/ runtime.caml_float_of_string(x)]; - /*<>*/ return _am_; + _aj_ = [0, /*<>*/ runtime.caml_float_of_string(x)]; + /*<>*/ return _aj_; } - catch(_an_){ - var _al_ = caml_wrap_exception(_an_); - if(_al_[1] === Stdlib[7]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_al_, 0); + catch(_ak_){ + var _ai_ = caml_wrap_exception(_ak_); + if(_ai_[1] === Stdlib[7]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_ai_, 0); } /*<>*/ } function parse_and_expand_argv_dynamic_ @@ -20313,9 +21788,7 @@ /*<>*/ switch(error[0]){ case 0: var s = error[1]; - if - (caml_string_notequal(s, cst_help$4) - && caml_string_notequal(s, cst_help$3)) + if(s !== cst_help$4 && s !== cst_help$3) /*<>*/ /*<>*/ caml_call4 (Stdlib_Printf[5], b, _f_, progname, s); break; @@ -20351,267 +21824,254 @@ if(current[1] >= argv[1].length - 1) return 0; /*<>*/ try{ /*<>*/ var - _Y_ = current[1], - /*<>*/ s = caml_check_bound(argv[1], _Y_)[1 + _Y_], - switch$0 = 0; - /*<>*/ if - (1 <= /*<>*/ caml_ml_string_length(s) - && 45 === /*<>*/ caml_string_get(s, 0)){ + _V_ = current[1], + /*<>*/ s = caml_check_bound(argv[1], _V_)[1 + _V_]; + /*<>*/ if + ( /*<>*/ caml_call2(Stdlib_String[11], cst$3, s)){ try{ /*<>*/ var follow$1 = 0, - /*<>*/ _aa_ = assoc3(s, speclist[1]), + /*<>*/ _Z_ = assoc3(s, speclist[1]), follow$0 = follow$1, - action = _aa_; + action = _Z_; } - catch(_aj_){ - var _Z_ = caml_wrap_exception(_aj_); - if(_Z_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_Z_, 0); + catch(_ag_){ + var _W_ = caml_wrap_exception(_ag_); + if(_W_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_W_, 0); /*<>*/ try{ /*<>*/ var /*<>*/ i = - /*<>*/ caml_call2(Stdlib_String[35], s, 61), + /*<>*/ caml_call2(Stdlib_String[36], s, 61), /*<>*/ len = /*<>*/ caml_ml_string_length(s), /*<>*/ arg = /*<>*/ caml_call3 - (Stdlib_String[15], s, i + 1 | 0, len - (i + 1 | 0) | 0), + (Stdlib_String[16], s, i + 1 | 0, len - (i + 1 | 0) | 0), /*<>*/ keyword = - /*<>*/ caml_call3(Stdlib_String[15], s, 0, i), + /*<>*/ caml_call3(Stdlib_String[16], s, 0, i), /*<>*/ follow = [0, arg], - /*<>*/ _$_ = assoc3(keyword, speclist[1]), + /*<>*/ _Y_ = assoc3(keyword, speclist[1]), follow$0 = follow, - action = _$_; + action = _Y_; } - catch(_ak_){ - var ___ = caml_wrap_exception(_ak_); - if(___ === Stdlib[8]) + catch(_ah_){ + var _X_ = caml_wrap_exception(_ah_); + if(_X_ === Stdlib[8]) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Stop, [0, s]], 1); - throw caml_maybe_attach_backtrace(___, 0); + throw caml_maybe_attach_backtrace(_X_, 0); } } + let s$0 = s, follow$2 = follow$0; var - no_arg$0 = - function(s, follow){ - function no_arg(param){ - /*<>*/ if(! follow) - /*<>*/ return 0; - var arg = follow[1]; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, [1, s, arg, cst_no_argument]], 1); - /*<>*/ } - return no_arg; - }, - no_arg = no_arg$0(s, follow$0), - get_arg$0 = - function(s, follow){ - function get_arg(param){ - /*<>*/ if(follow){ - var arg = follow[1]; - /*<>*/ return arg; - } - if((current[1] + 1 | 0) >= argv[1].length - 1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, [2, s]], 1); - var _ai_ = current[1] + 1 | 0; - /*<>*/ return caml_check_bound(argv[1], _ai_) - [1 + _ai_]; - /*<>*/ } - return get_arg; - }, - get_arg = get_arg$0(s, follow$0), - consume_arg$0 = - function(follow){ - function consume_arg(param){ - /*<>*/ return follow ? 0 : (current[1]++, 0); - /*<>*/ } - return consume_arg; - }, - consume_arg = consume_arg$0(follow$0), - treat_action$0 = - function(s, no_arg, get_arg, consume_arg){ - function treat_action(param){ - /*<>*/ switch(param[0]){ - case 0: - var f = param[1]; - /*<>*/ no_arg(0); - /*<>*/ return /*<>*/ caml_call1 - (f, 0); - case 1: - /*<>*/ var - f$0 = param[1], - /*<>*/ arg = get_arg(0); - /*<>*/ try{ - /*<>*/ var - /*<>*/ _ac_ = - [0, /*<>*/ caml_call1(Stdlib[32], arg)], - match = _ac_; - } - catch(_ah_){ - var _ab_ = caml_wrap_exception(_ah_); - if(_ab_[1] !== Stdlib[6]) - throw caml_maybe_attach_backtrace(_ab_, 0); - var match = 0; - } - if(! match) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, [1, s, arg, cst_a_boolean]], 1); - var s$0 = match[1]; - /*<>*/ /*<>*/ caml_call1 - (f$0, s$0); - /*<>*/ return consume_arg(0); - case 2: - var r = param[1]; - /*<>*/ no_arg(0); - r[1] = 1; - return 0; - case 3: - var r$0 = param[1]; - /*<>*/ no_arg(0); - r$0[1] = 0; - return 0; - case 4: - /*<>*/ var - f$1 = param[1], - /*<>*/ arg$0 = get_arg(0); - /*<>*/ /*<>*/ caml_call1 - (f$1, arg$0); - /*<>*/ return consume_arg(0); - case 5: - var r$1 = param[1]; - r$1[1] = get_arg(0); - /*<>*/ return consume_arg(0); - case 6: - /*<>*/ var - f$2 = param[1], - /*<>*/ arg$1 = get_arg(0), - /*<>*/ match$0 = int_of_string_opt(arg$1); - if(! match$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, [1, s, arg$1, cst_an_integer]], 1); - var x = match$0[1]; - /*<>*/ /*<>*/ caml_call1 - (f$2, x); - /*<>*/ return consume_arg(0); - case 7: - /*<>*/ var - r$2 = param[1], - /*<>*/ arg$2 = get_arg(0), - /*<>*/ match$1 = int_of_string_opt(arg$2); - if(! match$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, [1, s, arg$2, cst_an_integer$0]], 1); - var x$0 = match$1[1]; - r$2[1] = x$0; - /*<>*/ return consume_arg(0); - case 8: - /*<>*/ var - f$3 = param[1], - /*<>*/ arg$3 = get_arg(0), - /*<>*/ match$2 = float_of_string_opt(arg$3); - if(! match$2) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, [1, s, arg$3, cst_a_float]], 1); - var x$1 = match$2[1]; - /*<>*/ /*<>*/ caml_call1 - (f$3, x$1); - /*<>*/ return consume_arg(0); - case 9: - /*<>*/ var - r$3 = param[1], - /*<>*/ arg$4 = get_arg(0), - /*<>*/ match$3 = float_of_string_opt(arg$4); - if(! match$3) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, [1, s, arg$4, cst_a_float$0]], 1); - var x$2 = match$3[1]; - r$3[1] = x$2; - /*<>*/ return consume_arg(0); - case 10: - var specs = param[1]; - /*<>*/ no_arg(0); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[17], treat_action, specs); - case 11: - /*<>*/ var - f$4 = param[2], - symb = param[1], - /*<>*/ arg$5 = get_arg(0); - /*<>*/ if - ( /*<>*/ caml_call2 - (Stdlib_List[36], arg$5, symb)){ - /*<>*/ /*<>*/ caml_call1 - (f$4, arg$5); - /*<>*/ return consume_arg(0); - } - /*<>*/ /*<>*/ var - _ad_ = make_symlist(cst$5, cst$4, cst$3, symb); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, - Stop, - [1, - s, - arg$5, - /*<>*/ caml_call2 - (Stdlib[28], cst_one_of, _ad_)]], - 1); - case 12: - var f$5 = param[1]; - /*<>*/ no_arg(0); - /*<>*/ for(;;){ - if(current[1] >= (argv[1].length - 1 - 1 | 0)) return 0; - var _ae_ = current[1] + 1 | 0; - /*<>*/ /*<>*/ caml_call1 - (f$5, caml_check_bound(argv[1], _ae_)[1 + _ae_]); - /*<>*/ consume_arg(0); - } - case 13: - var f$6 = param[1]; - /*<>*/ no_arg(0); - /*<>*/ /*<>*/ var acc = [0, 0]; - /*<>*/ for(;;){ - if(current[1] >= (argv[1].length - 1 - 1 | 0)) - /*<>*/ return /*<>*/ caml_call1 - (f$6, - /*<>*/ caml_call1(Stdlib_List[9], acc[1])); - var _ag_ = current[1] + 1 | 0, _af_ = acc[1]; - acc[1] = [0, caml_check_bound(argv[1], _ag_)[1 + _ag_], _af_]; - /*<>*/ consume_arg(0); - } - default: - var f$7 = param[1]; - if(1 - allow_expand) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[6], cst_Arg_Expand_is_is_only_allo], 1); - /*<>*/ var - /*<>*/ arg$6 = get_arg(0), - /*<>*/ newarg = - /*<>*/ caml_call1(f$7, arg$6); - /*<>*/ consume_arg(0); - /*<>*/ var - /*<>*/ before = - /*<>*/ caml_call3 - (Stdlib_Array[5], argv[1], 0, current[1] + 1 | 0), - /*<>*/ after = - /*<>*/ caml_call3 - (Stdlib_Array[5], - argv[1], - current[1] + 1 | 0, - (argv[1].length - 1 - current[1] | 0) - 1 | 0); - argv[1] = - /*<>*/ caml_call1 - (Stdlib_Array[4], [0, before, [0, newarg, [0, after, 0]]]); - return 0; - } - /*<>*/ } - return treat_action; - }, - treat_action = treat_action$0(s, no_arg, get_arg, consume_arg); + no_arg = + function(param){ + /*<>*/ if(! follow$2) + /*<>*/ return; + var arg = follow$2[1]; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, [1, s$0, arg, cst_no_argument]], 1); + /*<>*/ }, + get_arg = + function(param){ + /*<>*/ if(follow$2){ + var arg = follow$2[1]; + /*<>*/ return arg; + } + if((current[1] + 1 | 0) >= argv[1].length - 1) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, [2, s$0]], 1); + var _af_ = current[1] + 1 | 0; + /*<>*/ return caml_check_bound(argv[1], _af_) + [1 + _af_]; + /*<>*/ }, + consume_arg = + function(param){ + /*<>*/ return follow$2 ? 0 : (current[1]++, 0); + /*<>*/ }, + treat_action = + function(param){ + /*<>*/ switch(param[0]){ + case 0: + var f = param[1]; + /*<>*/ no_arg$0(0); + /*<>*/ return /*<>*/ caml_call1 + (f, 0); + case 1: + /*<>*/ var + f$0 = param[1], + /*<>*/ arg = get_arg$0(0); + /*<>*/ try{ + /*<>*/ var + /*<>*/ _$_ = + [0, /*<>*/ caml_call1(Stdlib[32], arg)], + match = _$_; + } + catch(_ae_){ + var ___ = caml_wrap_exception(_ae_); + if(___[1] !== Stdlib[6]) + throw caml_maybe_attach_backtrace(___, 0); + var match = 0; + } + if(! match) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, [1, s$0, arg, cst_a_boolean]], 1); + var s = match[1]; + /*<>*/ /*<>*/ caml_call1(f$0, s); + /*<>*/ return consume_arg$0(0); + case 2: + var r = param[1]; + /*<>*/ no_arg$0(0); + r[1] = 1; + return 0; + case 3: + var r$0 = param[1]; + /*<>*/ no_arg$0(0); + r$0[1] = 0; + return 0; + case 4: + /*<>*/ var + f$1 = param[1], + /*<>*/ arg$0 = get_arg$0(0); + /*<>*/ /*<>*/ caml_call1 + (f$1, arg$0); + /*<>*/ return consume_arg$0(0); + case 5: + var r$1 = param[1]; + r$1[1] = get_arg$0(0); + /*<>*/ return consume_arg$0(0); + case 6: + /*<>*/ var + f$2 = param[1], + /*<>*/ arg$1 = get_arg$0(0), + /*<>*/ match$0 = int_of_string_opt(arg$1); + if(! match$0) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, [1, s$0, arg$1, cst_an_integer]], 1); + var x = match$0[1]; + /*<>*/ /*<>*/ caml_call1(f$2, x); + /*<>*/ return consume_arg$0(0); + case 7: + /*<>*/ var + r$2 = param[1], + /*<>*/ arg$2 = get_arg$0(0), + /*<>*/ match$1 = int_of_string_opt(arg$2); + if(! match$1) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, [1, s$0, arg$2, cst_an_integer$0]], 1); + var x$0 = match$1[1]; + r$2[1] = x$0; + /*<>*/ return consume_arg$0(0); + case 8: + /*<>*/ var + f$3 = param[1], + /*<>*/ arg$3 = get_arg$0(0), + /*<>*/ match$2 = float_of_string_opt(arg$3); + if(! match$2) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, [1, s$0, arg$3, cst_a_float]], 1); + var x$1 = match$2[1]; + /*<>*/ /*<>*/ caml_call1 + (f$3, x$1); + /*<>*/ return consume_arg$0(0); + case 9: + /*<>*/ var + r$3 = param[1], + /*<>*/ arg$4 = get_arg$0(0), + /*<>*/ match$3 = float_of_string_opt(arg$4); + if(! match$3) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, [1, s$0, arg$4, cst_a_float$0]], 1); + var x$2 = match$3[1]; + r$3[1] = x$2; + /*<>*/ return consume_arg$0(0); + case 10: + var specs = param[1]; + /*<>*/ no_arg$0(0); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_List[18], treat_action$0, specs); + case 11: + /*<>*/ var + f$4 = param[2], + symb = param[1], + /*<>*/ arg$5 = get_arg$0(0); + /*<>*/ if + ( /*<>*/ caml_call2 + (Stdlib_List[37], arg$5, symb)){ + /*<>*/ /*<>*/ caml_call1 + (f$4, arg$5); + /*<>*/ return consume_arg$0(0); + } + /*<>*/ /*<>*/ var + _aa_ = make_symlist(cst$6, cst$5, cst$4, symb); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, + Stop, + [1, + s$0, + arg$5, + /*<>*/ caml_call2 + (Stdlib[28], cst_one_of, _aa_)]], + 1); + case 12: + var f$5 = param[1]; + /*<>*/ no_arg$0(0); + /*<>*/ for(;;){ + if(current[1] >= (argv[1].length - 2 | 0)) return 0; + var _ab_ = current[1] + 1 | 0; + /*<>*/ /*<>*/ caml_call1 + (f$5, caml_check_bound(argv[1], _ab_)[1 + _ab_]); + /*<>*/ consume_arg$0(0); + } + break; + case 13: + var f$6 = param[1]; + /*<>*/ no_arg$0(0); + /*<>*/ /*<>*/ var acc = [0, 0]; + /*<>*/ for(;;){ + if(current[1] >= (argv[1].length - 2 | 0)) + /*<>*/ return /*<>*/ caml_call1 + (f$6, + /*<>*/ caml_call1(Stdlib_List[10], acc[1])); + var _ad_ = current[1] + 1 | 0, _ac_ = acc[1]; + acc[1] = [0, caml_check_bound(argv[1], _ad_)[1 + _ad_], _ac_]; + /*<>*/ consume_arg$0(0); + } + break; + default: + var f$7 = param[1]; + if(1 - allow_expand) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stdlib[6], cst_Arg_Expand_is_is_only_allo], 1); + /*<>*/ var + /*<>*/ arg$6 = get_arg$0(0), + /*<>*/ newarg = + /*<>*/ caml_call1(f$7, arg$6); + /*<>*/ consume_arg$0(0); + /*<>*/ var + /*<>*/ before = + /*<>*/ caml_call3 + (Stdlib_Array[6], argv[1], 0, current[1] + 1 | 0), + /*<>*/ after = + /*<>*/ caml_call3 + (Stdlib_Array[6], + argv[1], + current[1] + 1 | 0, + (argv[1].length - 1 - current[1] | 0) - 1 | 0); + argv[1] = + /*<>*/ caml_call1 + (Stdlib_Array[5], [0, before, [0, newarg, [0, after, 0]]]); + return 0; + } + /*<>*/ }; + let + no_arg$0 = no_arg, + get_arg$0 = get_arg, + consume_arg$0 = consume_arg, + treat_action$0 = treat_action; /*<>*/ treat_action(action); - switch$0 = 1; } - if(! switch$0) + else /*<>*/ /*<>*/ caml_call1(anonfun, s); } catch(exn$0){ @@ -20635,26 +22095,20 @@ (1, current, argv, speclist, anonfun, errmsg); /*<>*/ } function parse_argv_dynamic(opt, argv, speclist, anonfun, errmsg){ - /*<>*/ if(opt) - var sth = opt[1], current$0 = sth; - else - var current$0 = current; + var current$0 = opt ? opt[1] : current; /*<>*/ return parse_and_expand_argv_dynamic_ (0, current$0, [0, argv], speclist, anonfun, errmsg); - /*<>*/ } + } function parse_argv(opt, argv, speclist, anonfun, errmsg){ - /*<>*/ if(opt) - var sth = opt[1], current$0 = sth; - else - var current$0 = current; + var current$0 = opt ? opt[1] : current; /*<>*/ return parse_argv_dynamic ([0, current$0], argv, [0, speclist], anonfun, errmsg); - /*<>*/ } + } function parse(l, f, msg){ /*<>*/ try{ /*<>*/ /*<>*/ var - _X_ = parse_argv(0, caml_sys_argv(0), l, f, msg); - /*<>*/ return _X_; + _U_ = parse_argv(0, caml_sys_argv(0), l, f, msg); + /*<>*/ return _U_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -20676,8 +22130,8 @@ function parse_dynamic(l, f, msg){ /*<>*/ try{ /*<>*/ /*<>*/ var - _W_ = parse_argv_dynamic(0, caml_sys_argv(0), l, f, msg); - /*<>*/ return _W_; + _T_ = parse_argv_dynamic(0, caml_sys_argv(0), l, f, msg); + /*<>*/ return _T_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -20702,9 +22156,9 @@ /*<>*/ argv = [0, caml_sys_argv(0)], /*<>*/ spec = [0, l], /*<>*/ current$0 = [0, current[1]], - /*<>*/ _V_ = + /*<>*/ _S_ = parse_and_expand_argv_dynamic(current$0, argv, spec, f, msg); - /*<>*/ return _V_; + /*<>*/ return _S_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -20732,26 +22186,25 @@ /*<>*/ if (32 !== /*<>*/ caml_string_get(s, n$0)) /*<>*/ return n$0; - /*<>*/ var - /*<>*/ n$1 = n$0 + 1 | 0, - n$0 = n$1; + /*<>*/ /*<>*/ var n$1 = n$0 + 1 | 0; + n$0 = n$1; } /*<>*/ } /*<>*/ try{ /*<>*/ /*<>*/ var - n$0 = /*<>*/ caml_call2(Stdlib_String[35], s, 9); + n$0 = /*<>*/ caml_call2(Stdlib_String[36], s, 9); } - catch(_T_){ - var _R_ = caml_wrap_exception(_T_); - if(_R_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_R_, 0); + catch(_Q_){ + var _O_ = caml_wrap_exception(_Q_); + if(_O_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_O_, 0); /*<>*/ try{ /*<>*/ /*<>*/ var - n = /*<>*/ caml_call2(Stdlib_String[35], s, 32); + n = /*<>*/ caml_call2(Stdlib_String[36], s, 32); } - catch(_U_){ - var _S_ = caml_wrap_exception(_U_); - if(_S_ === Stdlib[8]) /*<>*/ return len; - throw caml_maybe_attach_backtrace(_S_, 0); + catch(_R_){ + var _P_ = caml_wrap_exception(_R_); + if(_P_ === Stdlib[8]) /*<>*/ return len; + throw caml_maybe_attach_backtrace(_P_, 0); } /*<>*/ return loop(n + 1 | 0); } @@ -20761,87 +22214,89 @@ var doc = param[3], spec = param[2], kwd = param[1]; /*<>*/ if(11 === spec[0]) return caml_call2(Stdlib_Int[11], cur, caml_ml_string_length(kwd)); - var _Q_ = caml_ml_string_length(kwd) + second_word(doc) | 0; - return caml_call2(Stdlib_Int[11], cur, _Q_); + var _N_ = caml_ml_string_length(kwd) + second_word(doc) | 0; + return caml_call2(Stdlib_Int[11], cur, _N_); } function replace_leading_tab(s){ /*<>*/ /*<>*/ var seen = [0, 0]; - function _P_(c){ - /*<>*/ if(9 === c && ! seen[1]){ - seen[1] = 1; - /*<>*/ return 32; - } - /*<>*/ return c; - /*<>*/ } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_String[17], _P_, s); + (Stdlib_String[18], + function(c){ + /*<>*/ if(9 === c && ! seen[1]){ + seen[1] = 1; + /*<>*/ return 32; + } + /*<>*/ return c; + /*<>*/ }, + s); /*<>*/ } function align(opt, speclist){ - /*<>*/ if(opt) - var sth = opt[1], limit = sth; - else - var limit = Stdlib[19]; /*<>*/ var + limit = opt ? opt[1] : Stdlib[19], /*<>*/ completed = add_help(speclist), /*<>*/ len = /*<>*/ caml_call3 - (Stdlib_List[25], max_arg_len, 0, completed), + (Stdlib_List[26], max_arg_len, 0, completed), /*<>*/ len$0 = /*<>*/ caml_call2(Stdlib_Int[10], len, limit); - /*<>*/ function _J_(ksd){ - var kwd = ksd[1], spec = ksd[2]; - if(! caml_string_notequal(ksd[3], cst$7)) - /*<>*/ return ksd; - if(11 === spec[0]){ - /*<>*/ var - msg$0 = ksd[3], - /*<>*/ cutcol$0 = second_word(msg$0), - /*<>*/ _M_ = - /*<>*/ caml_call2 - (Stdlib_Int[11], 0, len$0 - cutcol$0 | 0) - + 3 - | 0, - /*<>*/ spaces$0 = - /*<>*/ caml_call2(Stdlib_String[1], _M_, 32), - /*<>*/ _N_ = replace_leading_tab(msg$0), - /*<>*/ _O_ = - /*<>*/ caml_call2(Stdlib[28], spaces$0, _N_); - /*<>*/ return [0, - kwd, - spec, - /*<>*/ caml_call2(Stdlib[28], cst$6, _O_)]; - } - /*<>*/ var - msg = ksd[3], - spec$0 = ksd[2], - /*<>*/ cutcol = second_word(msg), - /*<>*/ kwd_len = - /*<>*/ caml_ml_string_length(kwd), - diff = (len$0 - kwd_len | 0) - cutcol | 0; - /*<>*/ if(0 >= diff) - /*<>*/ return [0, kwd, spec$0, replace_leading_tab(msg)]; - /*<>*/ var - /*<>*/ spaces = - /*<>*/ caml_call2(Stdlib_String[1], diff, 32), - /*<>*/ _K_ = replace_leading_tab(msg), - /*<>*/ prefix = - /*<>*/ caml_call3(Stdlib_String[15], _K_, 0, cutcol), - /*<>*/ suffix = - /*<>*/ caml_call3 - (Stdlib_String[15], - msg, - cutcol, - caml_ml_string_length(msg) - cutcol | 0), - /*<>*/ _L_ = - /*<>*/ caml_call2(Stdlib[28], spaces, suffix); - /*<>*/ return [0, - kwd, - spec$0, - /*<>*/ caml_call2(Stdlib[28], prefix, _L_)]; - } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[19], _J_, completed); - /*<>*/ } + (Stdlib_List[20], + function(ksd){ + var kwd = ksd[1], spec = ksd[2]; + if(ksd[3] === cst$8) /*<>*/ return ksd; + if(11 === spec[0]){ + /*<>*/ var + msg$0 = ksd[3], + /*<>*/ cutcol$0 = second_word(msg$0), + /*<>*/ _K_ = + /*<>*/ caml_call2 + (Stdlib_Int[11], 0, len$0 - cutcol$0 | 0) + + 3 + | 0, + /*<>*/ spaces$0 = + /*<>*/ caml_call2(Stdlib_String[1], _K_, 32), + /*<>*/ _L_ = replace_leading_tab(msg$0), + /*<>*/ _M_ = + /*<>*/ caml_call2(Stdlib[28], spaces$0, _L_); + /*<>*/ return [0, + kwd, + spec, + /*<>*/ caml_call2(Stdlib[28], cst$7, _M_)]; + } + /*<>*/ var + msg = ksd[3], + spec$0 = ksd[2], + /*<>*/ cutcol = second_word(msg), + /*<>*/ kwd_len = + /*<>*/ caml_ml_string_length(kwd), + diff = (len$0 - kwd_len | 0) - cutcol | 0; + /*<>*/ if(0 >= diff) + /*<>*/ return [0, + kwd, + spec$0, + replace_leading_tab(msg)]; + /*<>*/ var + /*<>*/ spaces = + /*<>*/ caml_call2(Stdlib_String[1], diff, 32), + /*<>*/ _I_ = replace_leading_tab(msg), + /*<>*/ prefix = + /*<>*/ caml_call3 + (Stdlib_String[16], _I_, 0, cutcol), + /*<>*/ suffix = + /*<>*/ caml_call3 + (Stdlib_String[16], + msg, + cutcol, + caml_ml_string_length(msg) - cutcol | 0), + /*<>*/ _J_ = + /*<>*/ caml_call2(Stdlib[28], spaces, suffix); + /*<>*/ return [0, + kwd, + spec$0, + /*<>*/ caml_call2(Stdlib[28], prefix, _J_)]; + }, + completed); + } function read_aux(trim, sep, file){ /*<>*/ var /*<>*/ ic = @@ -20853,18 +22308,21 @@ /*<>*/ /*<>*/ var word = /*<>*/ caml_call1(Stdlib_Buffer[2], buf); /*<>*/ if(trim){ - var len = caml_ml_string_length(word), switch$0 = 0; - /*<>*/ if - (0 < len - && 13 === /*<>*/ caml_string_get(word, len - 1 | 0)){ - var - _I_ = - /*<>*/ caml_call3 - (Stdlib_String[15], word, 0, len - 1 | 0); - switch$0 = 1; + var len = caml_ml_string_length(word); + a: + { + /*<>*/ if + (0 < len + && 13 === /*<>*/ caml_string_get(word, len - 1 | 0)){ + var + _H_ = + /*<>*/ caml_call3 + (Stdlib_String[16], word, 0, len - 1 | 0); + break a; + } + var _H_ = word; } - if(! switch$0) var _I_ = word; - var word$0 = _I_; + var word$0 = _H_; } else var word$0 = word; @@ -20883,35 +22341,39 @@ (Stdlib_Buffer[12], buf, c); } } - catch(_H_){ - var _F_ = caml_wrap_exception(_H_); - if(_F_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_F_, 0); + catch(_G_){ + var _E_ = caml_wrap_exception(_G_); + if(_E_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_E_, 0); if(0 < /*<>*/ caml_call1(Stdlib_Buffer[7], buf)) /*<>*/ stash(0); /*<>*/ /*<>*/ caml_call1(Stdlib[93], ic); /*<>*/ /*<>*/ var - _G_ = /*<>*/ caml_call1(Stdlib_List[9], words[1]); + _F_ = /*<>*/ caml_call1(Stdlib_List[10], words[1]); /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Array[10], _G_); + (Stdlib_Array[11], _F_); } /*<>*/ } var _r_ = 10, _s_ = 1; - /*<>*/ function read_arg(_E_){ - /*<>*/ return read_aux(_s_, _r_, _E_); + /*<>*/ function read_arg(_D_){ + /*<>*/ return read_aux(_s_, _r_, _D_); } - /*<>*/ var /*<>*/ _t_ = 0, _u_ = 0; - /*<>*/ function read_arg0(_D_){ - /*<>*/ return read_aux(_u_, _t_, _D_); + var + /*<>*/ _t_ = 0, + _u_ = 0, + _v_ = [0, [2, 0, [0, 0]], "%s%c"]; + /*<>*/ function read_arg0(_C_){ + /*<>*/ return read_aux(_u_, _t_, _C_); } function write_aux(sep, file, args){ /*<>*/ /*<>*/ var oc = /*<>*/ caml_call1(Stdlib[61], file); - function _C_(s){ - /*<>*/ return caml_call4 - (Stdlib_Printf[1], oc, _v_, s, sep); - /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _C_, args); + (Stdlib_Array[12], + function(s){ + /*<>*/ return caml_call4 + (Stdlib_Printf[1], oc, _v_, s, sep); + /*<>*/ }, + args); /*<>*/ return /*<>*/ caml_call1 (Stdlib[76], oc); /*<>*/ } @@ -20919,7 +22381,7 @@ /*<>*/ function write_arg(_A_, _B_){ /*<>*/ return write_aux(_w_, _A_, _B_); } - /*<>*/ /*<>*/ var _x_ = 0; + /*<>*/ var _x_ = 0; /*<>*/ function write_arg0(_y_, _z_){ /*<>*/ return write_aux(_x_, _y_, _z_); } @@ -20942,7 +22404,7 @@ read_arg0, write_arg, write_arg0]; - runtime.caml_register_global(54, Stdlib_Arg, "Stdlib__Arg"); + runtime.caml_register_global(55, Stdlib_Arg, "Stdlib__Arg"); return; /*<>*/ } (globalThis)); @@ -21024,36 +22486,31 @@ Stdlib_Obj = global_data.Stdlib__Obj, /*<>*/ printers = /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + _a_ = [0, [3, 0, 0], "%S"], + _b_ = [0, [4, 0, 0, 0, 0], "%d"], _c_ = [0, [11, ", ", [2, 0, [2, 0, 0]]], ", %s%s"], - _o_ = - [0, - [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], - cst_Fatal_error_exception_s], - _p_ = - [0, - [11, - "Fatal error in uncaught exception handler: exception ", - [2, 0, [12, 10, 0]]], - "Fatal error in uncaught exception handler: exception %s\n"], - cst_Fatal_error_out_of_memory_ = - "Fatal error: out of memory in uncaught exception handler", - _n_ = - [0, - [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], - cst_Fatal_error_exception_s], - _l_ = [0, [2, 0, [12, 10, 0]], cst_s], - cst_Program_not_linked_with_g_ = cst_Program_not_linked_with_g_$0, - _j_ = [0, [2, 0, [12, 10, 0]], cst_s], - _k_ = + _d_ = [0, [12, 40, [2, 0, [2, 0, [12, 41, 0]]]], "(%s%s)"], + _e_ = [0, [12, 40, [2, 0, [12, 41, 0]]], "(%s)"], + cst_Out_of_memory = "Out of memory", + cst_Stack_overflow = "Stack overflow", + cst_Pattern_matching_failed = "Pattern matching failed", + cst_Assertion_failed = "Assertion failed", + cst_Undefined_recursive_module = "Undefined recursive module", + _f_ = [0, - [11, cst_Program_not_linked_with_g_$0, 0], - cst_Program_not_linked_with_g_$0], + [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]], + cst_Uncaught_exception_s], + _g_ = + [0, + [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]], + cst_Uncaught_exception_s], cst_Raised_at = "Raised at", cst_Re_raised_at = "Re-raised at", cst_Raised_by_primitive_operat = "Raised by primitive operation at", cst_Called_from = "Called from", + _h_ = [0, [12, 32, [4, 0, 0, 0, 0]], " %d"], cst_inlined = " (inlined)", - _h_ = + _i_ = [0, [2, 0, @@ -21067,35 +22524,17 @@ 0, [12, 34, - [2, - 0, - [11, ", line ", [4, 0, 0, 0, [11, cst_characters, partial]]]]]]]]]], - '%s %s in file "%s"%s, line %d, characters %d-%d'], - _i_ = [0, [2, 0, [11, " unknown location", 0]], "%s unknown location"], - _g_ = - [0, - [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]], - cst_Uncaught_exception_s], - _f_ = - [0, - [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]], - cst_Uncaught_exception_s], - cst_Out_of_memory = "Out of memory", - cst_Stack_overflow = "Stack overflow", - cst_Pattern_matching_failed = "Pattern matching failed", - cst_Assertion_failed = "Assertion failed", - cst_Undefined_recursive_module = "Undefined recursive module", - _d_ = [0, [12, 40, [2, 0, [2, 0, [12, 41, 0]]]], "(%s%s)"], - _e_ = [0, [12, 40, [2, 0, [12, 41, 0]]], "(%s)"], - _b_ = [0, [4, 0, 0, 0, 0], "%d"], - _a_ = [0, [3, 0, 0], "%S"], + [2, 0, [11, ", line", [2, 0, [11, cst_characters, partial]]]]]]]]]], + '%s %s in file "%s"%s, line%s, characters %d-%d'], + _j_ = [0, [11, "s ", [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, 0]]]], "s %d-%d"], + _k_ = [0, [2, 0, [11, " unknown location", 0]], "%s unknown location"], + _l_ = [0, [2, 0, [12, 10, 0]], cst_s], _m_ = [0, - cst$4, - "(Cannot print locations:\n bytecode executable program file not found)", - "(Cannot print locations:\n bytecode executable program file appears to be corrupt)", - "(Cannot print locations:\n bytecode executable program file has wrong magic number)", - "(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"]; + [11, cst_Program_not_linked_with_g_$0, 0], + cst_Program_not_linked_with_g_$0], + _n_ = [0, [2, 0, [12, 10, 0]], cst_s], + cst_Program_not_linked_with_g_ = cst_Program_not_linked_with_g_$0; function field(x, i){ /*<>*/ /*<>*/ var f = x[1 + i]; /*<>*/ if @@ -21103,13 +22542,13 @@ /*<>*/ return /*<>*/ caml_call2 (Stdlib_Printf[4], _b_, f); /*<>*/ /*<>*/ var - _al_ = Stdlib_Obj[15]; - if( /*<>*/ caml_obj_tag(f) === _al_) + _ah_ = Stdlib_Obj[15]; + if( /*<>*/ caml_obj_tag(f) === _ah_) /*<>*/ return /*<>*/ caml_call2 (Stdlib_Printf[4], _a_, f); /*<>*/ /*<>*/ var - _am_ = Stdlib_Obj[16]; - return /*<>*/ caml_obj_tag(f) === _am_ + _ai_ = Stdlib_Obj[16]; + return /*<>*/ caml_obj_tag(f) === _ai_ ? /*<>*/ caml_call1(Stdlib[35], f) : cst; /*<>*/ } @@ -21117,27 +22556,27 @@ /*<>*/ if(x.length - 1 <= i) /*<>*/ return cst$0; /*<>*/ var - /*<>*/ _aj_ = other_fields(x, i + 1 | 0), - /*<>*/ _ak_ = field(x, i); + /*<>*/ _af_ = other_fields(x, i + 1 | 0), + /*<>*/ _ag_ = field(x, i); /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Printf[4], _c_, _ak_, _aj_); + (Stdlib_Printf[4], _c_, _ag_, _af_); /*<>*/ } function use_printers(x){ /*<>*/ var - param = /*<>*/ caml_call1(Stdlib_Atomic[2], printers); + param = /*<>*/ caml_call1(Stdlib_Atomic[3], printers); /*<>*/ for(;;){ if(! param) /*<>*/ return 0; - var tl = param[2], hd = param[1], switch$0 = 0; - /*<>*/ try{ - /*<>*/ /*<>*/ var - val = /*<>*/ caml_call1(hd, x); - } - catch(_ai_){switch$0 = 1;} - if(! switch$0 && val){ - var s = val[1]; - /*<>*/ return [0, s]; + var tl = param[2], hd = param[1]; + a: + { + /*<>*/ try{ + /*<>*/ /*<>*/ var + val = /*<>*/ caml_call1(hd, x); + } + catch(_ae_){break a;} + if(val){var s = val[1]; /*<>*/ return [0, s];} } - var param = tl; + param = tl; } /*<>*/ } function string_of_extension_constructo(t){ @@ -21148,24 +22587,24 @@ match = t.length - 1; if(2 < match >>> 0) /*<>*/ var - /*<>*/ _ae_ = other_fields(t, 2), - /*<>*/ _af_ = field(t, 1), - _ah_ = + /*<>*/ _aa_ = other_fields(t, 2), + /*<>*/ _ab_ = field(t, 1), + _ad_ = /*<>*/ caml_call3 - (Stdlib_Printf[4], _d_, _af_, _ae_); + (Stdlib_Printf[4], _d_, _ab_, _aa_); else switch(match){ case 0: - var _ah_ = cst$1; break; + var _ad_ = cst$1; break; case 1: - var _ah_ = cst$2; break; + var _ad_ = cst$2; break; default: /*<>*/ var - /*<>*/ _ag_ = field(t, 1), - _ah_ = - /*<>*/ caml_call2(Stdlib_Printf[4], _e_, _ag_); + /*<>*/ _ac_ = field(t, 1), + _ad_ = + /*<>*/ caml_call2(Stdlib_Printf[4], _e_, _ac_); } - var match$0 = [0, constructor, [0, _ah_]]; + var match$0 = [0, constructor, [0, _ad_]]; } else var match$0 = [0, t[1], 0]; @@ -21232,15 +22671,15 @@ function print(fct, arg){ /*<>*/ try{ /*<>*/ /*<>*/ var - _ad_ = /*<>*/ caml_call1(fct, arg); - /*<>*/ return _ad_; + _$_ = /*<>*/ caml_call1(fct, arg); + /*<>*/ return _$_; } catch(x$0){ /*<>*/ var x = caml_wrap_exception(x$0), - /*<>*/ _ac_ = to_string(x); + /*<>*/ ___ = to_string(x); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _f_, _ac_); + (Stdlib_Printf[3], _f_, ___); /*<>*/ /*<>*/ caml_call1 (Stdlib[63], Stdlib[40]); /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace @@ -21250,17 +22689,17 @@ function catch$0(fct, arg){ /*<>*/ try{ /*<>*/ /*<>*/ var - _ab_ = /*<>*/ caml_call1(fct, arg); - /*<>*/ return _ab_; + _Z_ = /*<>*/ caml_call1(fct, arg); + /*<>*/ return _Z_; } catch(x$0){ var x = caml_wrap_exception(x$0); /*<>*/ /*<>*/ caml_call1 (Stdlib[63], Stdlib[39]); /*<>*/ /*<>*/ var - _aa_ = to_string(x); + _Y_ = to_string(x); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _g_, _aa_); + (Stdlib_Printf[3], _g_, _Y_); /*<>*/ return /*<>*/ caml_call1 (Stdlib[99], 2); } @@ -21269,268 +22708,282 @@ /*<>*/ return bt; /*<>*/ } function convert_raw_backtrace(bt){ - /*<>*/ return [0, - /*<>*/ runtime.caml_convert_raw_backtrace(bt)]; - /*<>*/ } + /*<>*/ return [0, + /*<>*/ runtime.caml_convert_raw_backtrace(bt)]; + /*<>*/ } function format_backtrace_slot(pos, slot){ function info(is_raise){ - /*<>*/ return is_raise + /*<>*/ return is_raise ? 0 === pos ? cst_Raised_at : cst_Re_raised_at : 0 === pos ? cst_Raised_by_primitive_operat : cst_Called_from; - /*<>*/ } - /*<>*/ if(0 === slot[0]){ - /*<>*/ var - _U_ = slot[5], - _V_ = slot[4], - _W_ = slot[3], - _X_ = slot[6] ? cst_inlined : cst$3, - _Y_ = slot[2], - _Z_ = slot[7], - /*<>*/ ___ = info(slot[1]); - /*<>*/ return [0, - /*<>*/ caml_call8 - (Stdlib_Printf[4], _h_, ___, _Z_, _Y_, _X_, _W_, _V_, _U_)]; - } - if(slot[1]) /*<>*/ return 0; - /*<>*/ /*<>*/ var _$_ = info(0); - /*<>*/ return [0, - /*<>*/ caml_call2(Stdlib_Printf[4], _i_, _$_)]; - /*<>*/ } + /*<>*/ } + /*<>*/ if(0 === slot[0]){ + /*<>*/ var + lines = + slot[3] === slot[6] + ? /*<>*/ caml_call2 + (Stdlib_Printf[4], _h_, slot[3]) + : /*<>*/ caml_call3 + (Stdlib_Printf[4], _j_, slot[3], slot[6]), + _R_ = slot[7], + _S_ = slot[4], + _T_ = slot[8] ? cst_inlined : cst$3, + _U_ = slot[2], + _V_ = slot[9], + /*<>*/ _W_ = info(slot[1]); + /*<>*/ return [0, + /*<>*/ caml_call8 + (Stdlib_Printf[4], _i_, _W_, _V_, _U_, _T_, lines, _S_, _R_)]; + } + if(slot[1]) /*<>*/ return 0; + /*<>*/ /*<>*/ var _X_ = info(0); + /*<>*/ return [0, + /*<>*/ caml_call2(Stdlib_Printf[4], _k_, _X_)]; + /*<>*/ } function print_raw_backtrace(outchan, raw_backtrace){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var backtrace = convert_raw_backtrace(raw_backtrace); if(! backtrace) - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Printf[1], outchan, _k_); - var a = backtrace[1], _S_ = a.length - 1 - 1 | 0, _R_ = 0; - if(_S_ >= 0){ - var i = _R_; + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Printf[1], outchan, _m_); + var a = backtrace[1], _P_ = a.length - 2 | 0, _O_ = 0; + if(_P_ >= 0){ + var i = _O_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = format_backtrace_slot(i, caml_check_bound(a, i)[1 + i]); if(match){ var str = match[1]; - /*<>*/ /*<>*/ caml_call3 - (Stdlib_Printf[1], outchan, _j_, str); + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[1], outchan, _l_, str); } - /*<>*/ /*<>*/ var - _T_ = i + 1 | 0; - if(_S_ !== i){var i = _T_; continue;} - break; + /*<>*/ /*<>*/ var + _Q_ = i + 1 | 0; + if(_P_ === i) break; + i = _Q_; } } return 0; - /*<>*/ } + /*<>*/ } function print_backtrace(outchan){ - /*<>*/ return print_raw_backtrace + /*<>*/ return print_raw_backtrace (outchan, - /*<>*/ caml_get_exception_raw_backtra(0)); - /*<>*/ } + /*<>*/ caml_get_exception_raw_backtra(0)); + /*<>*/ } function raw_backtrace_to_string(raw_backtrace){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var backtrace = convert_raw_backtrace(raw_backtrace); if(! backtrace) - /*<>*/ return cst_Program_not_linked_with_g_; - /*<>*/ var + /*<>*/ return cst_Program_not_linked_with_g_; + /*<>*/ var a = backtrace[1], - /*<>*/ b = - /*<>*/ caml_call1(Stdlib_Buffer[1], 1024), - _P_ = a.length - 1 - 1 | 0, - /*<>*/ _O_ = 0; - if(_P_ >= 0){ - var i = _O_; + /*<>*/ b = + /*<>*/ caml_call1(Stdlib_Buffer[1], 1024), + _M_ = a.length - 2 | 0, + /*<>*/ _L_ = 0; + if(_M_ >= 0){ + var i = _L_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = format_backtrace_slot(i, caml_check_bound(a, i)[1 + i]); if(match){ var str = match[1]; - /*<>*/ /*<>*/ caml_call3 - (Stdlib_Printf[5], b, _l_, str); + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[5], b, _n_, str); } - /*<>*/ /*<>*/ var - _Q_ = i + 1 | 0; - if(_P_ !== i){var i = _Q_; continue;} - break; + /*<>*/ /*<>*/ var + _N_ = i + 1 | 0; + if(_M_ === i) break; + i = _N_; } } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[2], b); - /*<>*/ } + /*<>*/ } function backtrace_slot_is_raise(param){ - /*<>*/ return 0 === param[0] ? param[1] : param[1]; - /*<>*/ } + /*<>*/ return 0 === param[0] ? param[1] : param[1]; + /*<>*/ } function backtrace_slot_is_inline(param){ - /*<>*/ return 0 === param[0] ? param[6] : 0; - /*<>*/ } + /*<>*/ return 0 === param[0] ? param[8] : 0; + /*<>*/ } function backtrace_slot_location(param){ - /*<>*/ return 0 === param[0] - ? [0, [0, param[2], param[3], param[4], param[5]]] + /*<>*/ return 0 === param[0] + ? [0, + [0, param[2], param[3], param[4], param[5], param[6], param[7]]] : 0; - /*<>*/ } + /*<>*/ } function backtrace_slot_defname(param){ - /*<>*/ if - (0 === param[0] && runtime.caml_string_notequal(param[7], cst$4)) - /*<>*/ return [0, param[7]]; - /*<>*/ return 0; - /*<>*/ } + /*<>*/ if(0 === param[0] && param[9] !== cst$4) + /*<>*/ return [0, param[9]]; + /*<>*/ return 0; + /*<>*/ } function backtrace_slots(raw_backtrace){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = convert_raw_backtrace(raw_backtrace); - if(! match) /*<>*/ return 0; - var backtrace = match[1], i$1 = backtrace.length - 1 - 1 | 0, i = i$1; - /*<>*/ for(;;){ + if(! match) /*<>*/ return 0; + var backtrace = match[1], i$1 = backtrace.length - 2 | 0, i = i$1; + /*<>*/ for(;;){ if(-1 === i) - var _N_ = 0; + var _K_ = 0; else{ - var _M_ = 0 === caml_check_bound(backtrace, i)[1 + i][0] ? 1 : 0; - /*<>*/ if(! _M_){ - var i$0 = i - 1 | 0, i = i$0; + var _J_ = 0 === caml_check_bound(backtrace, i)[1 + i][0] ? 1 : 0; + /*<>*/ if(! _J_){ + var i$0 = i - 1 | 0; + i = i$0; continue; } - var _N_ = _M_; + var _K_ = _J_; } - /*<>*/ return _N_ ? [0, backtrace] : 0; + /*<>*/ return _K_ ? [0, backtrace] : 0; } - /*<>*/ } + /*<>*/ } function backtrace_slots_of_raw_entry(entry){ - /*<>*/ return backtrace_slots([0, entry]); - /*<>*/ } + /*<>*/ return backtrace_slots([0, entry]); + /*<>*/ } function raw_backtrace_length(bt){ - /*<>*/ return bt.length - 1; - /*<>*/ } + /*<>*/ return bt.length - 1; + /*<>*/ } function get_backtrace(param){ - /*<>*/ return raw_backtrace_to_string - ( /*<>*/ caml_get_exception_raw_backtra(0)); - /*<>*/ } + /*<>*/ return raw_backtrace_to_string + ( /*<>*/ caml_get_exception_raw_backtra(0)); + /*<>*/ } function register_printer(fn){ - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ old_printers = - /*<>*/ caml_call1(Stdlib_Atomic[2], printers), - /*<>*/ new_printers = [0, fn, old_printers], - /*<>*/ success = - /*<>*/ caml_call3 - (Stdlib_Atomic[5], printers, old_printers, new_printers), - /*<>*/ _L_ = 1 - success; - if(_L_) continue; - /*<>*/ return _L_; - } - /*<>*/ } + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ old_printers = + /*<>*/ caml_call1(Stdlib_Atomic[3], printers), + /*<>*/ new_printers = [0, fn, old_printers], + /*<>*/ success = + /*<>*/ caml_call3 + (Stdlib_Atomic[6], printers, old_printers, new_printers), + /*<>*/ _I_ = 1 - success; + if(! _I_) /*<>*/ return _I_; + } + /*<>*/ } function exn_slot(x){ - /*<>*/ return 0 - === /*<>*/ caml_obj_tag(x) + /*<>*/ return 0 + === /*<>*/ caml_obj_tag(x) ? x[1] : x; - /*<>*/ } + /*<>*/ } function exn_slot_id(x){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var slot = exn_slot(x); - /*<>*/ return slot[2]; - /*<>*/ } + /*<>*/ return slot[2]; + /*<>*/ } function exn_slot_name(x){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var slot = exn_slot(x); - /*<>*/ return slot[1]; - /*<>*/ } - var errors = _m_.slice(); + /*<>*/ return slot[1]; + /*<>*/ } + var + errors = + [0, + cst$4, + "(Cannot print locations:\n bytecode executable program file not found)", + "(Cannot print locations:\n bytecode executable program file appears to be corrupt)", + "(Cannot print locations:\n bytecode executable program file has wrong magic number)", + "(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"].slice + (), + _o_ = + [0, + [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], + cst_Fatal_error_exception_s]; function default_uncaught_exception_han(exn, raw_backtrace){ - /*<>*/ /*<>*/ var - _I_ = to_string(exn); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _n_, _I_); - /*<>*/ print_raw_backtrace(Stdlib[40], raw_backtrace); - /*<>*/ /*<>*/ var - status = /*<>*/ runtime.caml_ml_debug_info_status(0); + /*<>*/ /*<>*/ var + _F_ = to_string(exn); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _o_, _F_); + /*<>*/ print_raw_backtrace(Stdlib[40], raw_backtrace); + /*<>*/ /*<>*/ var + status = /*<>*/ runtime.caml_ml_debug_info_status(0); if(status < 0){ - /*<>*/ var - /*<>*/ _J_ = - /*<>*/ caml_call1(Stdlib[18], status), - /*<>*/ _K_ = caml_check_bound(errors, _J_)[1 + _J_]; - /*<>*/ /*<>*/ caml_call1 - (Stdlib[53], _K_); - } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ var + /*<>*/ _G_ = + /*<>*/ caml_call1(Stdlib[18], status), + /*<>*/ _H_ = caml_check_bound(errors, _G_)[1 + _G_]; + /*<>*/ /*<>*/ caml_call1 + (Stdlib[53], _H_); + } + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], Stdlib[40]); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var uncaught_exception_handler = [0, default_uncaught_exception_han]; function set_uncaught_exception_handler(fn){ - /*<>*/ uncaught_exception_handler[1] = fn; + /*<>*/ uncaught_exception_handler[1] = fn; return 0; - /*<>*/ } - var empty_backtrace = [0]; + /*<>*/ } + var + empty_backtrace = [0], + cst_Fatal_error_out_of_memory_ = + "Fatal error: out of memory in uncaught exception handler", + _p_ = + [0, + [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], + cst_Fatal_error_exception_s], + _q_ = + [0, + [11, + "Fatal error in uncaught exception handler: exception ", + [2, 0, [12, 10, 0]]], + "Fatal error in uncaught exception handler: exception %s\n"]; function handle_uncaught_exception(exn$0, debugger_in_use){ - /*<>*/ try{ - /*<>*/ try{ + /*<>*/ try{ + /*<>*/ try{ var raw_backtrace = debugger_in_use ? empty_backtrace - : /*<>*/ caml_get_exception_raw_backtra(0); - /*<>*/ try{ - /*<>*/ /*<>*/ caml_call1 + : /*<>*/ caml_get_exception_raw_backtra(0); + /*<>*/ try{ + /*<>*/ /*<>*/ caml_call1 (Stdlib[103], 0); } - catch(_H_){} - /*<>*/ try{ - /*<>*/ var - /*<>*/ _D_ = - /*<>*/ caml_call2 + catch(_E_){} + /*<>*/ try{ + /*<>*/ var + /*<>*/ _A_ = + /*<>*/ caml_call2 (uncaught_exception_handler[1], exn$0, raw_backtrace), - _C_ = _D_; + _z_ = _A_; } catch(exn$1){ - /*<>*/ var + /*<>*/ var exn = caml_wrap_exception(exn$1), - /*<>*/ raw_backtrace$0 = - /*<>*/ caml_get_exception_raw_backtra(0), - /*<>*/ _A_ = to_string(exn$0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _o_, _A_); - /*<>*/ print_raw_backtrace + /*<>*/ raw_backtrace$0 = + /*<>*/ caml_get_exception_raw_backtra(0), + /*<>*/ _x_ = to_string(exn$0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _p_, _x_); + /*<>*/ print_raw_backtrace (Stdlib[40], raw_backtrace); - /*<>*/ /*<>*/ var - _B_ = to_string(exn); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _p_, _B_); - /*<>*/ print_raw_backtrace + /*<>*/ /*<>*/ var + _y_ = to_string(exn); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _q_, _y_); + /*<>*/ print_raw_backtrace (Stdlib[40], raw_backtrace$0); var - _C_ = /*<>*/ caml_call1(Stdlib[63], Stdlib[40]); + _z_ = /*<>*/ caml_call1(Stdlib[63], Stdlib[40]); } - var _E_ = _C_; + var _B_ = _z_; } - catch(_G_){ - var _z_ = caml_wrap_exception(_G_); - if(_z_ !== Stdlib[9]) throw caml_maybe_attach_backtrace(_z_, 0); + catch(_D_){ + var _w_ = caml_wrap_exception(_D_); + if(_w_ !== Stdlib[9]) throw caml_maybe_attach_backtrace(_w_, 0); var - _E_ = - /*<>*/ caml_call1 + _B_ = + /*<>*/ caml_call1 (Stdlib[53], cst_Fatal_error_out_of_memory_); } - /*<>*/ return _E_; + /*<>*/ return _B_; } - catch(_F_){ /*<>*/ return 0;} - /*<>*/ } - /*<>*/ /*<>*/ runtime.caml_register_named_value + catch(_C_){ /*<>*/ return 0;} + /*<>*/ } + /*<>*/ /*<>*/ runtime.caml_register_named_value ("Printexc.handle_uncaught_exception", handle_uncaught_exception); - function _q_(_y_){ - /*<>*/ return runtime.caml_raw_backtrace_next_slot(_y_); - } - function _r_(_x_){ - /*<>*/ return runtime.caml_convert_raw_backtrace_slot(_x_); - } - function _s_(_w_, _v_){ - /*<>*/ return runtime.caml_raw_backtrace_slot(_w_, _v_); - } var - _t_ = - [0, - backtrace_slot_is_raise, - backtrace_slot_is_inline, - backtrace_slot_location, - backtrace_slot_defname, - format_backtrace_slot], Stdlib_Printexc = [0, to_string, @@ -21544,22 +22997,33 @@ register_printer, use_printers, raw_backtrace_entries, - function(_u_){ /*<>*/ return caml_get_exception_raw_backtra(_u_);}, + function(_v_){ /*<>*/ return caml_get_exception_raw_backtra(_v_);}, print_raw_backtrace, raw_backtrace_to_string, default_uncaught_exception_han, set_uncaught_exception_handler, backtrace_slots, backtrace_slots_of_raw_entry, - _t_, + [0, + backtrace_slot_is_raise, + backtrace_slot_is_inline, + backtrace_slot_location, + backtrace_slot_defname, + format_backtrace_slot], raw_backtrace_length, - _s_, - _r_, - _q_, + function(_u_, _t_){ + /*<>*/ return runtime.caml_raw_backtrace_slot(_u_, _t_); + }, + function(_s_){ + /*<>*/ return runtime.caml_convert_raw_backtrace_slot(_s_); + }, + function(_r_){ + /*<>*/ return runtime.caml_raw_backtrace_next_slot(_r_); + }, exn_slot_id, exn_slot_name, string_of_extension_constructo]; - runtime.caml_register_global(42, Stdlib_Printexc, "Stdlib__Printexc"); + runtime.caml_register_global(43, Stdlib_Printexc, "Stdlib__Printexc"); return; /*<>*/ } (globalThis)); @@ -21585,79 +23049,83 @@ : runtime.caml_call_gen(f, [a0, a1]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), Stdlib_Printexc = global_data.Stdlib__Printexc, - Stdlib = global_data.Stdlib, - cst_Fun_Finally_raised = "Fun.Finally_raised: ", - cst_Stdlib_Fun_Finally_raised = "Stdlib.Fun.Finally_raised"; + Stdlib = global_data.Stdlib; function const$0(c, param){ /*<>*/ return c; /*<>*/ } + function compose(f, g, x){ + /*<>*/ return /*<>*/ caml_call1 + (f, /*<>*/ caml_call1(g, x)); + /*<>*/ } function flip(f, x, y){ - /*<>*/ return /*<>*/ caml_call2(f, y, x); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2(f, y, x); + /*<>*/ } function negate(p, v){ - /*<>*/ return 1 - /*<>*/ caml_call1(p, v); - /*<>*/ } - /*<>*/ /*<>*/ var - Finally_raised = - [248, cst_Stdlib_Fun_Finally_raised, runtime.caml_fresh_oo_id(0)]; - function _a_(param){ - /*<>*/ if(param[1] !== Finally_raised) - /*<>*/ return 0; - /*<>*/ var - exn = param[2], - /*<>*/ _c_ = - /*<>*/ caml_call1(Stdlib_Printexc[1], exn); - /*<>*/ return [0, - /*<>*/ caml_call2 - (Stdlib[28], cst_Fun_Finally_raised, _c_)]; - /*<>*/ } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Printexc[9], _a_); + /*<>*/ return 1 - /*<>*/ caml_call1(p, v); + /*<>*/ } + /*<>*/ var + /*<>*/ Finally_raised = + [248, "Stdlib.Fun.Finally_raised", runtime.caml_fresh_oo_id(0)], + cst_Fun_Finally_raised = "Fun.Finally_raised: "; + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Printexc[9], + function(param){ + /*<>*/ if(param[1] !== Finally_raised) + /*<>*/ return 0; + /*<>*/ var + exn = param[2], + /*<>*/ _a_ = + /*<>*/ caml_call1(Stdlib_Printexc[1], exn); + /*<>*/ return [0, + /*<>*/ caml_call2 + (Stdlib[28], cst_Fun_Finally_raised, _a_)]; + /*<>*/ }); function protect(finally$0, work){ function finally_no_exn(param){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _b_ = /*<>*/ caml_call1(finally$0, 0); - /*<>*/ return _b_; + /*<>*/ try{ + /*<>*/ /*<>*/ caml_call1(finally$0, 0); + /*<>*/ return; } catch(e$0){ - /*<>*/ var + /*<>*/ var e = caml_wrap_exception(e$0), - /*<>*/ bt = - /*<>*/ caml_call1(Stdlib_Printexc[12], 0), - /*<>*/ exn = [0, Finally_raised, e]; + /*<>*/ bt = + /*<>*/ caml_call1(Stdlib_Printexc[12], 0), + /*<>*/ exn = [0, Finally_raised, e]; caml_restore_raw_backtrace(exn, bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (exn, 0); } - /*<>*/ } - /*<>*/ try{ - /*<>*/ /*<>*/ var - result = /*<>*/ caml_call1(work, 0); + /*<>*/ } + /*<>*/ try{ + /*<>*/ /*<>*/ var + result = /*<>*/ caml_call1(work, 0); } catch(work_exn$0){ - /*<>*/ var + /*<>*/ var work_exn = caml_wrap_exception(work_exn$0), - /*<>*/ work_bt = - /*<>*/ caml_call1(Stdlib_Printexc[12], 0); - /*<>*/ finally_no_exn(0); + /*<>*/ work_bt = + /*<>*/ caml_call1(Stdlib_Printexc[12], 0); + /*<>*/ finally_no_exn(0); caml_restore_raw_backtrace(work_exn, work_bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (work_exn, 0); } - /*<>*/ finally_no_exn(0); - /*<>*/ return result; - /*<>*/ } - var Stdlib_Fun = [0, const$0, flip, negate, protect, Finally_raised]; + /*<>*/ finally_no_exn(0); + /*<>*/ return result; + /*<>*/ } + var + Stdlib_Fun = [0, const$0, compose, flip, negate, protect, Finally_raised]; runtime.caml_register_global(4, Stdlib_Fun, "Stdlib__Fun"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Gc -//# unitInfo: Requires: Stdlib, Stdlib__Atomic, Stdlib__Printf, Stdlib__Sys +//# unitInfo: Requires: Stdlib, Stdlib__Atomic, Stdlib__Domain, Stdlib__Fun, Stdlib__Printf, Stdlib__Sys (function (globalThis){ "use strict"; @@ -21687,8 +23155,11 @@ } var global_data = runtime.caml_get_global_data(), - Stdlib_Atomic = global_data.Stdlib__Atomic, + Stdlib_Atomic = global_data.Stdlib__Atomic; + global_data.Stdlib__Fun; + var Stdlib = global_data.Stdlib, + Stdlib_Domain = global_data.Stdlib__Domain, Stdlib_Sys = global_data.Stdlib__Sys, Stdlib_Printf = global_data.Stdlib__Printf, _a_ = @@ -21823,72 +23294,563 @@ mi = match[1]; /*<>*/ return (mi + ma - pro) * (Stdlib_Sys[9] / 8 | 0); /*<>*/ } - function create_alarm(f){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Atomic[1], 1); - /*<>*/ } function delete_alarm(a){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Atomic[3], a, 0); - /*<>*/ } - function _v_(param){ /*<>*/ return 0; /*<>*/ } - function _w_(param){ /*<>*/ return 0; /*<>*/ } - function _x_(param){ /*<>*/ return 0; /*<>*/ } - function _y_(param){ /*<>*/ return 0; /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Atomic[4], a, 0); + /*<>*/ } + function create_alarm(f){ + /*<>*/ /*<>*/ var + _y_ = /*<>*/ caml_call1(Stdlib_Atomic[1], 1); + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[6], + function(param){ + /*<>*/ return delete_alarm(_y_); + /*<>*/ }); + return _y_; + /*<>*/ } + /*<>*/ /*<>*/ var null_tracker = [0, - function(param){ /*<>*/ return 0; /*<>*/ }, - _y_, - _x_, - _w_, - _v_]; + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }]; function start(sampling_rate, opt, tracker){ - /*<>*/ if(opt) - var sth = opt[1], callstack_size = sth; - else - var callstack_size = Stdlib[19]; - /*<>*/ return /*<>*/ runtime.caml_memprof_start + var callstack_size = opt ? opt[1] : Stdlib[19]; + /*<>*/ return /*<>*/ runtime.caml_memprof_start (sampling_rate, callstack_size, tracker); - /*<>*/ } - var _z_ = [0, null_tracker, start, runtime.caml_memprof_stop]; - function _A_(_E_){ /*<>*/ return runtime.caml_final_release(_E_);} + } + var + Stdlib_Gc = + [0, + print_stat, + allocated_bytes, + function(_x_, _w_){ + /*<>*/ return runtime.caml_final_register(_x_, _w_); + }, + runtime.caml_final_register_called_without_value, + function(_v_){ /*<>*/ return runtime.caml_final_release(_v_);}, + create_alarm, + delete_alarm, + eventlog_pause, + eventlog_resume, + [0, + null_tracker, + start, + runtime.caml_memprof_stop, + runtime.caml_memprof_discard]]; + runtime.caml_register_global(27, Stdlib_Gc, "Stdlib__Gc"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__In_channel +//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Fun, Stdlib__Sys +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_ba_dim_1 = runtime.caml_ba_dim_1, + caml_create_bytes = runtime.caml_create_bytes, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_bytes_length = runtime.caml_ml_bytes_length, + caml_ml_input_bigarray = runtime.caml_ml_input_bigarray, + caml_wrap_exception = runtime.caml_wrap_exception; + /*<>*/ function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + /*<>*/ function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + /*<>*/ function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + /*<>*/ function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); + } + /*<>*/ function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Bytes = global_data.Stdlib__Bytes, + Stdlib_Sys = global_data.Stdlib__Sys, + Stdlib_Fun = global_data.Stdlib__Fun, + stdin = Stdlib[38], + open_bin = Stdlib[80], + open_text = Stdlib[79], + open_gen = Stdlib[81]; + function with_open(openfun, s, f){ + /*<>*/ /*<>*/ var + ic = /*<>*/ caml_call1(openfun, s); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Fun[5], + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[94], ic); + /*<>*/ }, + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (f, ic); + /*<>*/ }); + /*<>*/ } + function with_open_bin(s, f){ + /*<>*/ return with_open(Stdlib[80], s, f); + /*<>*/ } + function with_open_text(s, f){ + /*<>*/ return with_open(Stdlib[79], s, f); + /*<>*/ } + function with_open_gen(flags, perm, s, f){ + /*<>*/ return with_open + ( /*<>*/ caml_call2(Stdlib[81], flags, perm), + s, + f); + /*<>*/ } + var + seek = Stdlib[96][4], + pos = Stdlib[96][5], + length = Stdlib[96][6], + close = Stdlib[93], + close_noerr = Stdlib[94]; + function input_char(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + c = /*<>*/ caml_call1(Stdlib[82], ic); + } + catch(_x_){ + var _w_ = caml_wrap_exception(_x_); + if(_w_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_w_, 0); + } + /*<>*/ return [0, c]; + /*<>*/ } + function input_byte(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + n = /*<>*/ caml_call1(Stdlib[87], ic); + } + catch(_v_){ + var _u_ = caml_wrap_exception(_v_); + if(_u_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_u_, 0); + } + /*<>*/ return [0, n]; + /*<>*/ } + function input_line(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_t_){ + var _s_ = caml_wrap_exception(_t_); + if(_s_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_s_, 0); + } + /*<>*/ return [0, s]; + /*<>*/ } + var + input = Stdlib[84], + cst_input_bigarray = "input_bigarray", + _a_ = [0, 0], + _b_ = [0, 0], + cst_really_input_bigarray = "really_input_bigarray", + cst_In_channel_input_all_chann = + "In_channel.input_all: channel content is larger than maximum string length"; + function input_bigarray(ic, buf, ofs, len){ + /*<>*/ if + (0 <= ofs + && + 0 <= len + && ( /*<>*/ caml_ba_dim_1(buf) - len | 0) >= ofs) + /*<>*/ return /*<>*/ caml_ml_input_bigarray + (ic, buf, ofs, len); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_input_bigarray); + /*<>*/ } + function really_input(ic, buf, pos, len){ + /*<>*/ try{ + /*<>*/ /*<>*/ caml_call4 + (Stdlib[85], ic, buf, pos, len); + /*<>*/ return _a_; + } + catch(_r_){ + var _q_ = caml_wrap_exception(_r_); + if(_q_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_q_, 0); + } + /*<>*/ } + function really_input_bigarray(ic, buf, ofs$1, len$1){ + /*<>*/ if + (0 <= ofs$1 + && + 0 <= len$1 + && + ( /*<>*/ caml_ba_dim_1(buf) - len$1 | 0) >= ofs$1){ + var ofs = ofs$1, len = len$1; + /*<>*/ for(;;){ + if(0 >= len) /*<>*/ return _b_; + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_ml_input_bigarray + (ic, buf, ofs, len); + /*<>*/ if(0 === r) + /*<>*/ return 0; + var len$0 = len - r | 0, ofs$0 = ofs + r | 0; + ofs = ofs$0; + len = len$0; + } + } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_really_input_bigarray); + /*<>*/ } + function really_input_string(ic, len){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call2(Stdlib[86], ic, len); + } + catch(_p_){ + var _o_ = caml_wrap_exception(_p_); + if(_o_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_o_, 0); + } + /*<>*/ return [0, s]; + /*<>*/ } + function read_upto(ic, buf, ofs, len){ + /*<>*/ var ofs$0 = ofs, len$0 = len; + /*<>*/ for(;;){ + if(0 !== len$0){ + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_call4 + (Stdlib[84], ic, buf, ofs$0, len$0); + /*<>*/ if(0 !== r){ + var len$1 = len$0 - r | 0, ofs$1 = ofs$0 + r | 0; + ofs$0 = ofs$1; + len$0 = len$1; + continue; + } + } + /*<>*/ return ofs$0 - ofs | 0; + } + /*<>*/ } + function ensure(buf, ofs, n){ + /*<>*/ var len = caml_ml_bytes_length(buf); + if((ofs + n | 0) <= len) /*<>*/ return buf; + /*<>*/ /*<>*/ var + new_len = [0, len]; + for(;;){ + if(new_len[1] >= (ofs + n | 0)) break; + new_len[1] = (2 * new_len[1] | 0) + 1 | 0; + } + /*<>*/ var + new_len$0 = new_len[1], + new_len$1 = + new_len$0 <= Stdlib_Sys[12] + ? new_len$0 + : ofs + < Stdlib_Sys[12] + ? Stdlib_Sys[12] + : /*<>*/ caml_call1 + (Stdlib[2], cst_In_channel_input_all_chann), + /*<>*/ new_buf = + /*<>*/ caml_create_bytes(new_len$1); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Bytes[11], buf, 0, new_buf, 0, ofs); + /*<>*/ return new_buf; + /*<>*/ } + function input_all(ic){ + /*<>*/ /*<>*/ var + chunk_size = 65536; + /*<>*/ try{ + /*<>*/ var + /*<>*/ _k_ = + /*<>*/ caml_call1(Stdlib[91], ic), + /*<>*/ _l_ = + /*<>*/ caml_call1(Stdlib[92], ic) - _k_ | 0, + initial_size = _l_; + } + catch(_n_){ + var _i_ = caml_wrap_exception(_n_); + if(_i_[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(_i_, 0); + var initial_size = -1; + } + /*<>*/ var + /*<>*/ initial_size$0 = + 0 <= initial_size ? initial_size : chunk_size, + initial_size$1 = + initial_size$0 <= Stdlib_Sys[12] ? initial_size$0 : Stdlib_Sys[12], + /*<>*/ buf = + /*<>*/ caml_create_bytes(initial_size$1), + /*<>*/ nread = + read_upto(ic, buf, 0, initial_size$1); + if(nread < initial_size$1) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_Bytes[8], buf, 0, nread); + /*<>*/ try{ + /*<>*/ /*<>*/ var + c = /*<>*/ caml_call1(Stdlib[82], ic); + } + catch(_m_){ + var _j_ = caml_wrap_exception(_m_); + if(_j_ === Stdlib[12]) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], buf); + throw caml_maybe_attach_backtrace(_j_, 0); + } + /*<>*/ /*<>*/ var + buf$2 = ensure(buf, nread, 65537); + /*<>*/ /*<>*/ runtime.caml_bytes_set + (buf$2, nread, c); + /*<>*/ var + /*<>*/ ofs$1 = nread + 1 | 0, + buf$0 = buf$2, + ofs = ofs$1; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ buf$1 = ensure(buf$0, ofs, chunk_size), + rem = caml_ml_bytes_length(buf$1) - ofs | 0, + /*<>*/ r = read_upto(ic, buf$1, ofs, rem); + if(r < rem) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_Bytes[8], buf$1, 0, ofs + r | 0); + var ofs$0 = ofs + rem | 0; + buf$0 = buf$1; + ofs = ofs$0; + } + /*<>*/ } + function input_lines(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + line = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_h_){ + var _e_ = caml_wrap_exception(_h_); + if(_e_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_e_, 0); + } + /*<>*/ var + /*<>*/ block = [0, line, 24029], + dst = block, + offset = 1; + /*<>*/ for(;;){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + line$0 = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_g_){ + var _f_ = caml_wrap_exception(_g_); + if(_f_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_f_, 0); + dst[1 + offset] = 0; + /*<>*/ return block; + } + /*<>*/ /*<>*/ var + dst$0 = [0, line$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + } + /*<>*/ } + function fold_lines(f, accu, ic){ + /*<>*/ var accu$0 = accu; + /*<>*/ for(;;){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + line = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_d_){ + var _c_ = caml_wrap_exception(_d_); + if(_c_ === Stdlib[12]) /*<>*/ return accu$0; + throw caml_maybe_attach_backtrace(_c_, 0); + } + /*<>*/ /*<>*/ var + accu$1 = /*<>*/ caml_call2(f, accu$0, line); + accu$0 = accu$1; + } + /*<>*/ } + var + set_binary_mode = Stdlib[95], + Stdlib_In_channel = + [0, + stdin, + open_bin, + open_text, + open_gen, + with_open_bin, + with_open_text, + with_open_gen, + close, + close_noerr, + input_char, + input_byte, + input_line, + really_input_string, + input_all, + input_lines, + input, + input_bigarray, + really_input, + really_input_bigarray, + fold_lines, + seek, + pos, + length, + set_binary_mode, + runtime.caml_ml_is_binary_mode, + runtime.caml_sys_isatty]; + runtime.caml_register_global(9, Stdlib_In_channel, "Stdlib__In_channel"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Out_channel +//# unitInfo: Requires: Stdlib, Stdlib__Fun +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + /*<>*/ function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + /*<>*/ function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } var - _B_ = runtime.caml_final_register_called_without_value, - Stdlib_Gc = + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Fun = global_data.Stdlib__Fun, + stdout = Stdlib[39], + stderr = Stdlib[40], + open_bin = Stdlib[61], + open_text = Stdlib[60], + open_gen = Stdlib[62]; + function with_open(openfun, s, f){ + /*<>*/ /*<>*/ var + oc = /*<>*/ caml_call1(openfun, s); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Fun[5], + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[77], oc); + /*<>*/ }, + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (f, oc); + /*<>*/ }); + /*<>*/ } + function with_open_bin(s, f){ + /*<>*/ return with_open(Stdlib[61], s, f); + /*<>*/ } + function with_open_text(s, f){ + /*<>*/ return with_open(Stdlib[60], s, f); + /*<>*/ } + function with_open_gen(flags, perm, s, f){ + /*<>*/ return with_open + ( /*<>*/ caml_call2(Stdlib[62], flags, perm), + s, + f); + /*<>*/ } + var + seek = Stdlib[96][1], + pos = Stdlib[96][2], + length = Stdlib[96][3], + close = Stdlib[76], + close_noerr = Stdlib[77], + flush = Stdlib[63], + flush_all = Stdlib[64], + output_char = Stdlib[65], + output_byte = Stdlib[70], + output_string = Stdlib[66], + output_bytes = Stdlib[67], + output = Stdlib[68], + output_substring = Stdlib[69], + cst_output_bigarray = "output_bigarray"; + function output_bigarray(oc, buf, ofs, len){ + /*<>*/ if + (0 <= ofs + && + 0 <= len + && + ( /*<>*/ runtime.caml_ba_dim_1(buf) - len | 0) + >= ofs) + /*<>*/ return /*<>*/ runtime.caml_ml_output_bigarray + (oc, buf, ofs, len); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_output_bigarray); + /*<>*/ } + var + set_binary_mode = Stdlib[78], + Stdlib_Out_channel = [0, - print_stat, - allocated_bytes, - function(_D_, _C_){ - /*<>*/ return runtime.caml_final_register(_D_, _C_); - }, - _B_, - _A_, - create_alarm, - delete_alarm, - eventlog_pause, - eventlog_resume, - _z_]; - runtime.caml_register_global(25, Stdlib_Gc, "Stdlib__Gc"); + stdout, + stderr, + open_bin, + open_text, + open_gen, + with_open_bin, + with_open_text, + with_open_gen, + close, + close_noerr, + output_char, + output_byte, + output_string, + output_bytes, + output, + output_substring, + output_bigarray, + flush, + flush_all, + seek, + pos, + length, + set_binary_mode, + runtime.caml_ml_is_binary_mode, + runtime.caml_ml_set_buffered, + runtime.caml_ml_is_buffered, + runtime.caml_sys_isatty]; + runtime.caml_register_global(3, Stdlib_Out_channel, "Stdlib__Out_channel"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Digest -//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Char, Stdlib__String +//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Char, Stdlib__In_channel, Stdlib__Int, Stdlib__String (function (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, - cst_Digest_from_hex$1 = "Digest.from_hex", + cst = "", + cst_Digest_of_hex$1 = "Digest.of_hex", + cst_Digest_substring$1 = "Digest.substring", + cst_Digest_to_hex$1 = "Digest.to_hex", + caml_blake2_final = runtime.caml_blake2_final, + caml_blake2_string = runtime.caml_blake2_string, + caml_blake2_update = runtime.caml_blake2_update, caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, caml_create_bytes = runtime.caml_create_bytes, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_md5_chan = runtime.caml_md5_chan, caml_md5_string = runtime.caml_md5_string, caml_ml_string_length = runtime.caml_ml_string_length, - caml_string_get = runtime.caml_string_get, - caml_wrap_exception = runtime.caml_wrap_exception; + caml_string_get = runtime.caml_string_get; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 ? f(a0) @@ -21898,127 +23860,272 @@ return (f.l >= 0 ? f.l : f.l = f.length) == 2 ? f(a0, a1) : runtime.caml_call_gen(f, [a0, a1]); + } + /*<>*/ function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); } var global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, - Stdlib_Char = global_data.Stdlib__Char, + Stdlib_In_channel = global_data.Stdlib__In_channel, Stdlib_Bytes = global_data.Stdlib__Bytes, + Stdlib_Int = global_data.Stdlib__Int, Stdlib_String = global_data.Stdlib__String, - compare = Stdlib_String[9], - equal = Stdlib_String[8], - cst_Digest_from_hex$0 = cst_Digest_from_hex$1, - cst_Digest_from_hex = cst_Digest_from_hex$1, - cst_Digest_to_hex = "Digest.to_hex", - cst_Digest_substring = "Digest.substring"; + Stdlib_Char = global_data.Stdlib__Char, + cst_Digest_of_hex = cst_Digest_of_hex$1, + cst_Digest_BLAKE2_wrong_hash_s = "Digest.BLAKE2: wrong hash size", + cst_Digest_substring = cst_Digest_substring$1, + cst_Digest_to_hex = cst_Digest_to_hex$1, + cst_Digest_of_hex$0 = cst_Digest_of_hex$1; + function hex_of_string(d){ + /*<>*/ function char_hex(n){ + /*<>*/ var + _l_ = 10 <= n ? (97 + n | 0) - 10 | 0 : 48 + n | 0; + return caml_call1(Stdlib_Char[1], _l_); + /*<>*/ } + /*<>*/ var + /*<>*/ len = + /*<>*/ caml_ml_string_length(d), + /*<>*/ result = + /*<>*/ caml_create_bytes(len * 2 | 0), + /*<>*/ _j_ = len - 1 | 0, + /*<>*/ _i_ = 0; + if(_j_ >= 0){ + var i = _i_; + for(;;){ + /*<>*/ /*<>*/ var + x = /*<>*/ caml_string_get(d, i); + caml_bytes_unsafe_set(result, i * 2 | 0, char_hex(x >>> 4 | 0)); + caml_bytes_unsafe_set(result, (i * 2 | 0) + 1 | 0, char_hex(x & 15)); + /*<>*/ /*<>*/ var _k_ = i + 1 | 0; + if(_j_ === i) break; + i = _k_; + } + } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], result); + /*<>*/ } + function string_of_hex(s){ + /*<>*/ function digit(c){ + /*<>*/ if(65 <= c){ + if(97 <= c){ + if(103 > c) return (c - 97 | 0) + 10 | 0; + } + else if(71 > c) return (c - 65 | 0) + 10 | 0; + } + else if(9 >= c - 48 >>> 0) return c - 48 | 0; + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_of_hex); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_String[2], + caml_ml_string_length(s) / 2 | 0, + function(i){ + /*<>*/ var + i$0 = 2 * i | 0, + /*<>*/ _g_ = + digit + ( /*<>*/ caml_string_get(s, i$0 + 1 | 0)), + _h_ = + (digit( /*<>*/ caml_string_get(s, i$0)) + << 4) + + _g_ + | 0; + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Char[1], _h_); + /*<>*/ }); + /*<>*/ } + function BLAKE2(X){ + var _a_ = X[1] < 1 ? 1 : 0, _b_ = _a_ || (64 < X[1] ? 1 : 0); + if(_b_) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_BLAKE2_wrong_hash_s); + var + hash_length = X[1], + compare = Stdlib_String[10], + equal = Stdlib_String[9]; + function string(str){ + /*<>*/ return /*<>*/ caml_blake2_string + (hash_length, cst, str, 0, caml_ml_string_length(str)); + /*<>*/ } + function bytes(b){ + /*<>*/ return string + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b)); + /*<>*/ } + function substring(str, ofs, len){ + /*<>*/ var _d_ = ofs < 0 ? 1 : 0; + if(_d_) + var _e_ = _d_; + else + var + _f_ = len < 0 ? 1 : 0, + _e_ = _f_ || ((caml_ml_string_length(str) - len | 0) < ofs ? 1 : 0); + if(_e_) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_substring); + /*<>*/ return /*<>*/ caml_blake2_string + (hash_length, cst, str, ofs, len); + /*<>*/ } + function subbytes(b, ofs, len){ + /*<>*/ return substring + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b), + ofs, + len); + /*<>*/ } + function channel(ic, toread){ + /*<>*/ var + /*<>*/ buf_size = 4096, + /*<>*/ buf = + /*<>*/ caml_create_bytes(4096), + /*<>*/ ctx = + /*<>*/ runtime.caml_blake2_create(hash_length, cst); + /*<>*/ if(0 <= toread){ + var toread$0 = toread; + /*<>*/ for(;;){ + if(0 === toread$0) + /*<>*/ return /*<>*/ caml_blake2_final + (ctx, hash_length); + /*<>*/ var + /*<>*/ _c_ = + /*<>*/ caml_call2 + (Stdlib_Int[10], buf_size, toread$0), + /*<>*/ n = + /*<>*/ caml_call4 + (Stdlib_In_channel[16], ic, buf, 0, _c_); + /*<>*/ if(0 === n) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[12], 1); + /*<>*/ /*<>*/ caml_blake2_update + (ctx, + /*<>*/ caml_call1(Stdlib_Bytes[44], buf), + 0, + n); + var toread$1 = toread$0 - n | 0; + toread$0 = toread$1; + } + } + else + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + n$0 = + /*<>*/ caml_call4 + (Stdlib_In_channel[16], ic, buf, 0, buf_size); + /*<>*/ if(0 === n$0) + /*<>*/ return /*<>*/ caml_blake2_final + (ctx, hash_length); + /*<>*/ /*<>*/ caml_blake2_update + (ctx, + /*<>*/ caml_call1(Stdlib_Bytes[44], buf), + 0, + n$0); + } + /*<>*/ } + function file(filename){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_In_channel[5], + filename, + function(ic){ + /*<>*/ return channel(ic, -1); + /*<>*/ }); + /*<>*/ } + function output(chan, digest){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[66], chan, digest); + /*<>*/ } + function input(chan){ + /*<>*/ return caml_call2 + (Stdlib[86], chan, hash_length); + /*<>*/ } + function to_hex(d){ + /*<>*/ if(caml_ml_string_length(d) !== hash_length) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_to_hex); + /*<>*/ return hex_of_string(d); + /*<>*/ } + function of_hex(s){ + /*<>*/ if + (caml_ml_string_length(s) !== (hash_length * 2 | 0)) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_of_hex$0); + /*<>*/ return string_of_hex(s); + /*<>*/ } + /*<>*/ return [0, + hash_length, + compare, + equal, + string, + bytes, + substring, + subbytes, + channel, + file, + output, + input, + to_hex, + of_hex]; + } + var + BLAKE128 = BLAKE2([0, 16]), + BLAKE256 = BLAKE2([0, 32]), + BLAKE512 = BLAKE2([0, 64]), + compare = Stdlib_String[10], + equal = Stdlib_String[9], + cst_Digest_substring$0 = cst_Digest_substring$1, + cst_Digest_to_hex$0 = cst_Digest_to_hex$1, + cst_Digest_from_hex = "Digest.from_hex"; function string(str){ - /*<>*/ return /*<>*/ caml_md5_string + /*<>*/ return /*<>*/ caml_md5_string (str, 0, caml_ml_string_length(str)); - /*<>*/ } + /*<>*/ } function bytes(b){ - /*<>*/ return string - ( /*<>*/ caml_call1(Stdlib_Bytes[44], b)); - /*<>*/ } + /*<>*/ return string + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b)); + /*<>*/ } function substring(str, ofs, len){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (caml_ml_string_length(str) - len | 0) >= ofs) - /*<>*/ return /*<>*/ caml_md5_string + /*<>*/ return /*<>*/ caml_md5_string (str, ofs, len); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_Digest_substring); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_substring$0); + /*<>*/ } function subbytes(b, ofs, len){ - /*<>*/ return substring - ( /*<>*/ caml_call1(Stdlib_Bytes[44], b), + /*<>*/ return substring + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b), ofs, len); - /*<>*/ } + /*<>*/ } function file(filename){ - /*<>*/ /*<>*/ var - ic = /*<>*/ caml_call1(Stdlib[80], filename); - /*<>*/ try{ - /*<>*/ /*<>*/ var - d = /*<>*/ runtime.caml_md5_chan(ic, -1); - } - catch(e$0){ - var e = caml_wrap_exception(e$0); - /*<>*/ /*<>*/ caml_call1 - (Stdlib[93], ic); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (e, 0); - } - /*<>*/ /*<>*/ caml_call1 - (Stdlib[93], ic); - /*<>*/ return d; - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_In_channel[5], + filename, + function(ic){ + /*<>*/ return /*<>*/ caml_md5_chan + (ic, -1); + /*<>*/ }); + /*<>*/ } function output(chan, digest){ - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib[66], chan, digest); - /*<>*/ } + /*<>*/ } function input(chan){ - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib[86], chan, 16); - /*<>*/ } - function char_hex(n){ - /*<>*/ var _e_ = 10 <= n ? 87 : 48; - return n + _e_ | 0; - /*<>*/ } + /*<>*/ } function to_hex(d){ - /*<>*/ if(16 !== caml_ml_string_length(d)) - /*<>*/ /*<>*/ caml_call1 - (Stdlib[1], cst_Digest_to_hex); - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_create_bytes(32), - i = 0; - for(;;){ - /*<>*/ /*<>*/ var - x = /*<>*/ caml_string_get(d, i); - caml_bytes_unsafe_set(result, i * 2 | 0, char_hex(x >>> 4 | 0)); - caml_bytes_unsafe_set(result, (i * 2 | 0) + 1 | 0, char_hex(x & 15)); - /*<>*/ /*<>*/ var _d_ = i + 1 | 0; - if(15 === i) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], result); - var i = _d_; - } - /*<>*/ } - function from_hex(s){ - /*<>*/ if(32 !== caml_ml_string_length(s)) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ if(16 !== caml_ml_string_length(d)) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_to_hex$0); + /*<>*/ return hex_of_string(d); + /*<>*/ } + function of_hex(s){ + /*<>*/ if(32 !== caml_ml_string_length(s)) + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Digest_from_hex); - /*<>*/ function digit(c){ - /*<>*/ if(65 <= c){ - if(97 <= c){ - if(103 > c) return (c - 97 | 0) + 10 | 0; - } - else if(71 > c) return (c - 65 | 0) + 10 | 0; - } - else if(9 >= c - 48 >>> 0) return c - 48 | 0; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[6], cst_Digest_from_hex$0], 1); - /*<>*/ } - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_create_bytes(16), - i = 0; - for(;;){ - /*<>*/ var - i$0 = 2 * i | 0, - /*<>*/ _a_ = - digit( /*<>*/ caml_string_get(s, i$0 + 1 | 0)), - _b_ = - (digit( /*<>*/ caml_string_get(s, i$0)) << 4) + _a_ - | 0; - /*<>*/ /*<>*/ runtime.caml_bytes_set - (result, i, /*<>*/ caml_call1(Stdlib_Char[1], _b_)); - /*<>*/ /*<>*/ var _c_ = i + 1 | 0; - if(15 === i) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], result); - var i = _c_; - } - /*<>*/ } + /*<>*/ return string_of_hex(s); + /*<>*/ } var Stdlib_Digest = [0, @@ -22028,12 +24135,31 @@ bytes, substring, subbytes, + caml_md5_chan, file, output, input, to_hex, - from_hex]; - runtime.caml_register_global(8, Stdlib_Digest, "Stdlib__Digest"); + of_hex, + of_hex, + BLAKE128, + BLAKE256, + BLAKE512, + [0, + 16, + compare, + equal, + string, + bytes, + substring, + subbytes, + caml_md5_chan, + file, + output, + input, + to_hex, + of_hex]]; + runtime.caml_register_global(17, Stdlib_Digest, "Stdlib__Digest"); return; /*<>*/ } (globalThis)); @@ -22078,616 +24204,609 @@ : runtime.caml_call_gen(f, [a0, a1, a2]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, Stdlib_Array = global_data.Stdlib__Array, - Stdlib_Sys = global_data.Stdlib__Sys, - cst_Bigarray_array3_of_genarra = "Bigarray.array3_of_genarray", - cst_Bigarray_array2_of_genarra = "Bigarray.array2_of_genarray", - cst_Bigarray_array1_of_genarra = "Bigarray.array1_of_genarray", - cst_Bigarray_array0_of_genarra = "Bigarray.array0_of_genarray", - cst_Bigarray_Array3_of_array_n = cst_Bigarray_Array3_of_array_n$1, - cst_Bigarray_Array3_of_array_n$0 = cst_Bigarray_Array3_of_array_n$1, - cst_Bigarray_Array2_of_array_n = - "Bigarray.Array2.of_array: non-rectangular data", - float32 = 0, - float64 = 1, - int8_signed = 2, - int8_unsigned = 3, - int16_signed = 4, - int16_unsigned = 5, - int32 = 6, - int64 = 7, - int$0 = 8, - nativeint = 9, - complex32 = 10, - complex64 = 11, - char$0 = 12; + Stdlib_Sys = global_data.Stdlib__Sys; function kind_size_in_bytes(param){ - /*<>*/ switch(param){ + /*<>*/ switch(param){ case 0: - /*<>*/ return 4; + /*<>*/ return 4; case 1: - /*<>*/ return 8; + /*<>*/ return 8; case 2: - /*<>*/ return 1; + /*<>*/ return 1; case 3: - /*<>*/ return 1; + /*<>*/ return 1; case 4: - /*<>*/ return 2; + /*<>*/ return 2; case 5: - /*<>*/ return 2; + /*<>*/ return 2; case 6: - /*<>*/ return 4; + /*<>*/ return 4; case 7: - /*<>*/ return 8; + /*<>*/ return 8; case 8: return Stdlib_Sys[9] / 8 | 0; case 9: return Stdlib_Sys[9] / 8 | 0; case 10: - /*<>*/ return 8; + /*<>*/ return 8; case 11: - /*<>*/ return 16; - default: /*<>*/ return 1; + /*<>*/ return 16; + case 12: + /*<>*/ return 1; + default: /*<>*/ return 2; } - /*<>*/ } - /*<>*/ var - /*<>*/ c_layout = 0, - fortran_layout = 1; + } + var + cst_Bigarray_Array2_of_array_n = + "Bigarray.Array2.of_array: non-rectangular data", + cst_Bigarray_Array3_of_array_n = cst_Bigarray_Array3_of_array_n$1, + cst_Bigarray_Array3_of_array_n$0 = cst_Bigarray_Array3_of_array_n$1, + cst_Bigarray_array0_of_genarra = "Bigarray.array0_of_genarray", + cst_Bigarray_array1_of_genarra = "Bigarray.array1_of_genarray", + cst_Bigarray_array2_of_genarra = "Bigarray.array2_of_genarray", + cst_Bigarray_array3_of_genarra = "Bigarray.array3_of_genarray"; function cloop(arr, idx, f, col, max){ - /*<>*/ if(col === idx.length - 1) - /*<>*/ return /*<>*/ caml_ba_set_generic - (arr, idx, /*<>*/ caml_call1(f, idx)); - /*<>*/ var - /*<>*/ _am_ = + /*<>*/ if(col === idx.length - 1){ + /*<>*/ /*<>*/ caml_ba_set_generic + (arr, idx, /*<>*/ caml_call1(f, idx)); + /*<>*/ return; + } + /*<>*/ var + /*<>*/ _am_ = caml_check_bound(max, col)[1 + col] - 1 | 0, - /*<>*/ _al_ = 0; + /*<>*/ _al_ = 0; if(_am_ >= 0){ var j = _al_; for(;;){ - /*<>*/ caml_check_bound(idx, col)[1 + col] = j; - /*<>*/ cloop(arr, idx, f, col + 1 | 0, max); - /*<>*/ /*<>*/ var + /*<>*/ caml_check_bound(idx, col)[1 + col] = j; + /*<>*/ cloop(arr, idx, f, col + 1 | 0, max); + /*<>*/ /*<>*/ var _an_ = j + 1 | 0; - if(_am_ !== j){var j = _an_; continue;} - break; + if(_am_ === j) break; + j = _an_; } } - return 0; - /*<>*/ } + return; + /*<>*/ } function floop(arr, idx, f, col, max){ - /*<>*/ if(0 > col) - /*<>*/ return /*<>*/ caml_ba_set_generic - (arr, idx, /*<>*/ caml_call1(f, idx)); - /*<>*/ var - /*<>*/ _aj_ = caml_check_bound(max, col)[1 + col], - /*<>*/ _ai_ = 1; + /*<>*/ if(0 > col){ + /*<>*/ /*<>*/ caml_ba_set_generic + (arr, idx, /*<>*/ caml_call1(f, idx)); + /*<>*/ return; + } + /*<>*/ var + /*<>*/ _aj_ = caml_check_bound(max, col)[1 + col], + /*<>*/ _ai_ = 1; if(_aj_ >= 1){ var j = _ai_; for(;;){ - /*<>*/ caml_check_bound(idx, col)[1 + col] = j; - /*<>*/ floop(arr, idx, f, col - 1 | 0, max); - /*<>*/ /*<>*/ var + /*<>*/ caml_check_bound(idx, col)[1 + col] = j; + /*<>*/ floop(arr, idx, f, col - 1 | 0, max); + /*<>*/ /*<>*/ var _ak_ = j + 1 | 0; - if(_aj_ !== j){var j = _ak_; continue;} - break; + if(_aj_ === j) break; + j = _ak_; } } - return 0; - /*<>*/ } + return; + /*<>*/ } function init(kind, layout, dims, f){ - /*<>*/ var - /*<>*/ arr = - /*<>*/ caml_ba_create(kind, layout, dims), - /*<>*/ dlen = dims.length - 1; - /*<>*/ return layout + /*<>*/ var + /*<>*/ arr = + /*<>*/ caml_ba_create(kind, layout, dims), + /*<>*/ dlen = dims.length - 1; + /*<>*/ return layout ? (floop (arr, - /*<>*/ caml_make_vect(dlen, 1), + /*<>*/ caml_make_vect(dlen, 1), f, dlen - 1 | 0, dims), arr) : (cloop (arr, - /*<>*/ caml_make_vect(dlen, 0), + /*<>*/ caml_make_vect(dlen, 0), f, 0, dims), arr); - /*<>*/ } + /*<>*/ } function dims(a){ - /*<>*/ var - /*<>*/ n = - /*<>*/ caml_ba_num_dims(a), - /*<>*/ d = - /*<>*/ caml_make_vect(n, 0), - /*<>*/ _af_ = n - 1 | 0, - /*<>*/ _ae_ = 0; + /*<>*/ var + /*<>*/ n = + /*<>*/ caml_ba_num_dims(a), + /*<>*/ d = + /*<>*/ caml_make_vect(n, 0), + /*<>*/ _af_ = n - 1 | 0, + /*<>*/ _ae_ = 0; if(_af_ >= 0){ var i = _ae_; for(;;){ - /*<>*/ /*<>*/ var - _ag_ = /*<>*/ runtime.caml_ba_dim(a, i); - /*<>*/ caml_check_bound(d, i)[1 + i] = _ag_; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var + _ag_ = /*<>*/ runtime.caml_ba_dim(a, i); + /*<>*/ caml_check_bound(d, i)[1 + i] = _ag_; + /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; - if(_af_ !== i){var i = _ah_; continue;} - break; + if(_af_ === i) break; + i = _ah_; } } - /*<>*/ return d; - /*<>*/ } + /*<>*/ return d; + /*<>*/ } function size_in_bytes(arr){ - /*<>*/ var - /*<>*/ _ac_ = dims(arr), - /*<>*/ _ad_ = - /*<>*/ caml_call3 - (Stdlib_Array[15], caml_mul, 1, _ac_); - /*<>*/ return /*<>*/ caml_mul - (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), + /*<>*/ var + /*<>*/ _ac_ = dims(arr), + /*<>*/ _ad_ = + /*<>*/ caml_call3 + (Stdlib_Array[18], caml_mul, 1, _ac_); + /*<>*/ return /*<>*/ caml_mul + (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), _ad_); - /*<>*/ } + /*<>*/ } function create(kind, layout){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0]); - /*<>*/ } + /*<>*/ } function get(arr){ - /*<>*/ return /*<>*/ runtime.caml_ba_get_generic + /*<>*/ return /*<>*/ runtime.caml_ba_get_generic (arr, [0]); - /*<>*/ } + /*<>*/ } function set(arr){ - /*<>*/ /*<>*/ var _aa_ = [0]; - /*<>*/ return function(_ab_){ + /*<>*/ /*<>*/ var _aa_ = [0]; + /*<>*/ return function(_ab_){ /*<>*/ return caml_ba_set_generic(arr, _aa_, _ab_);}; - /*<>*/ } + /*<>*/ } function size_in_bytes$0(arr){ - /*<>*/ return kind_size_in_bytes - ( /*<>*/ caml_ba_kind(arr)); - /*<>*/ } + /*<>*/ return kind_size_in_bytes + ( /*<>*/ caml_ba_kind(arr)); + /*<>*/ } function of_value(kind, layout, v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var a = create(kind, layout); - /*<>*/ set(a)(v); - /*<>*/ return a; - /*<>*/ } + /*<>*/ set(a)(v); + /*<>*/ return a; + /*<>*/ } function create$0(kind, layout, dim){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0, dim]); - /*<>*/ } + /*<>*/ } function size_in_bytes$1(arr){ - /*<>*/ /*<>*/ var - _$_ = /*<>*/ caml_ba_dim_1(arr); - /*<>*/ return /*<>*/ caml_mul - (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), + /*<>*/ /*<>*/ var + _$_ = /*<>*/ caml_ba_dim_1(arr); + /*<>*/ return /*<>*/ caml_mul + (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), _$_); - /*<>*/ } + /*<>*/ } function slice(a, n){ - /*<>*/ return /*<>*/ runtime.caml_ba_layout + /*<>*/ return /*<>*/ runtime.caml_ba_layout (a) - ? /*<>*/ caml_ba_slice(a, [0, n]) - : /*<>*/ caml_ba_slice(a, [0, n]); - /*<>*/ } + ? /*<>*/ caml_ba_slice(a, [0, n]) + : /*<>*/ caml_ba_slice(a, [0, n]); + /*<>*/ } function init$0(kind, layout, dim, f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var arr = create$0(kind, layout, dim); - /*<>*/ if(layout){ - /*<>*/ /*<>*/ var _Z_ = 1; + /*<>*/ if(layout){ + /*<>*/ /*<>*/ var _Z_ = 1; if(dim >= 1){ var i$0 = _Z_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_1 - (arr, i$0, /*<>*/ caml_call1(f, i$0)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_1 + (arr, i$0, /*<>*/ caml_call1(f, i$0)); + /*<>*/ /*<>*/ var ___ = i$0 + 1 | 0; - if(dim !== i$0){var i$0 = ___; continue;} - break; + if(dim === i$0) break; + i$0 = ___; } } - /*<>*/ return arr; + /*<>*/ return arr; } - /*<>*/ var + /*<>*/ var _X_ = dim - 1 | 0, - /*<>*/ _W_ = 0; + /*<>*/ _W_ = 0; if(_X_ >= 0){ var i = _W_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_1 - (arr, i, /*<>*/ caml_call1(f, i)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_1 + (arr, i, /*<>*/ caml_call1(f, i)); + /*<>*/ /*<>*/ var _Y_ = i + 1 | 0; - if(_X_ !== i){var i = _Y_; continue;} - break; + if(_X_ === i) break; + i = _Y_; } } - /*<>*/ return arr; - /*<>*/ } + /*<>*/ return arr; + /*<>*/ } function of_array(kind, layout, data){ - /*<>*/ var - /*<>*/ ba = create$0(kind, layout, data.length - 1), - /*<>*/ ofs = layout ? 1 : 0, - _U_ = data.length - 1 - 1 | 0, + /*<>*/ var + /*<>*/ ba = create$0(kind, layout, data.length - 1), + /*<>*/ ofs = layout ? 1 : 0, + _U_ = data.length - 2 | 0, _T_ = 0; if(_U_ >= 0){ var i = _T_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_1 + /*<>*/ /*<>*/ caml_ba_set_1 (ba, i + ofs | 0, caml_check_bound(data, i)[1 + i]); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _V_ = i + 1 | 0; - if(_U_ !== i){var i = _V_; continue;} - break; + if(_U_ === i) break; + i = _V_; } } - /*<>*/ return ba; - /*<>*/ } + /*<>*/ return ba; + /*<>*/ } function create$1(kind, layout, dim1, dim2){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0, dim1, dim2]); - /*<>*/ } + /*<>*/ } function size_in_bytes$2(arr){ - /*<>*/ var - /*<>*/ _R_ = - /*<>*/ caml_ba_dim_2(arr), - /*<>*/ _S_ = - /*<>*/ caml_ba_dim_1(arr); + /*<>*/ var + /*<>*/ _R_ = + /*<>*/ caml_ba_dim_2(arr), + /*<>*/ _S_ = + /*<>*/ caml_ba_dim_1(arr); return caml_mul - ( /*<>*/ caml_mul + ( /*<>*/ caml_mul (kind_size_in_bytes - ( /*<>*/ caml_ba_kind(arr)), + ( /*<>*/ caml_ba_kind(arr)), _S_), _R_); - /*<>*/ } + /*<>*/ } function slice_left(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function slice_right(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function init$1(kind, layout, dim1, dim2, f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var arr = create$1(kind, layout, dim1, dim2); - /*<>*/ if(layout){ - /*<>*/ /*<>*/ var _N_ = 1; + /*<>*/ if(layout){ + /*<>*/ /*<>*/ var _N_ = 1; if(dim2 >= 1){ var j$0 = _N_; for(;;){ - /*<>*/ /*<>*/ var _O_ = 1; + /*<>*/ /*<>*/ var _O_ = 1; if(dim1 >= 1){ var i$0 = _O_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_2 - (arr, i$0, j$0, /*<>*/ caml_call2(f, i$0, j$0)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_2 + (arr, i$0, j$0, /*<>*/ caml_call2(f, i$0, j$0)); + /*<>*/ /*<>*/ var _Q_ = i$0 + 1 | 0; - if(dim1 !== i$0){var i$0 = _Q_; continue;} - break; + if(dim1 === i$0) break; + i$0 = _Q_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _P_ = j$0 + 1 | 0; - if(dim2 !== j$0){var j$0 = _P_; continue;} - break; + if(dim2 === j$0) break; + j$0 = _P_; } } - /*<>*/ return arr; + /*<>*/ return arr; } - /*<>*/ var + /*<>*/ var _I_ = dim1 - 1 | 0, - /*<>*/ _H_ = 0; + /*<>*/ _H_ = 0; if(_I_ >= 0){ var i = _H_; for(;;){ - /*<>*/ var + /*<>*/ var _K_ = dim2 - 1 | 0, - /*<>*/ _J_ = 0; + /*<>*/ _J_ = 0; if(_K_ >= 0){ var j = _J_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_2 - (arr, i, j, /*<>*/ caml_call2(f, i, j)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_2 + (arr, i, j, /*<>*/ caml_call2(f, i, j)); + /*<>*/ /*<>*/ var _M_ = j + 1 | 0; - if(_K_ !== j){var j = _M_; continue;} - break; + if(_K_ === j) break; + j = _M_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _L_ = i + 1 | 0; - if(_I_ !== i){var i = _L_; continue;} - break; + if(_I_ === i) break; + i = _L_; } } - /*<>*/ return arr; - /*<>*/ } + /*<>*/ return arr; + /*<>*/ } function of_array$0(kind, layout, data){ - /*<>*/ var + /*<>*/ var dim1 = data.length - 1, - /*<>*/ dim2 = + /*<>*/ dim2 = 0 === dim1 ? 0 : caml_check_bound(data, 0)[1].length - 1, - /*<>*/ ba = create$1(kind, layout, dim1, dim2), - /*<>*/ ofs = layout ? 1 : 0, - /*<>*/ _C_ = dim1 - 1 | 0, + /*<>*/ ba = create$1(kind, layout, dim1, dim2), + /*<>*/ ofs = layout ? 1 : 0, + /*<>*/ _C_ = dim1 - 1 | 0, _B_ = 0; if(_C_ >= 0){ var i = _B_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var row = caml_check_bound(data, i)[1 + i]; if(row.length - 1 !== dim2) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_Array2_of_array_n); - /*<>*/ var - /*<>*/ _E_ = dim2 - 1 | 0, - /*<>*/ _D_ = 0; + /*<>*/ var + /*<>*/ _E_ = dim2 - 1 | 0, + /*<>*/ _D_ = 0; if(_E_ >= 0){ var j = _D_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_2 + /*<>*/ /*<>*/ caml_ba_set_2 (ba, i + ofs | 0, j + ofs | 0, caml_check_bound(row, j)[1 + j]); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _G_ = j + 1 | 0; - if(_E_ !== j){var j = _G_; continue;} - break; + if(_E_ === j) break; + j = _G_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _F_ = i + 1 | 0; - if(_C_ !== i){var i = _F_; continue;} - break; + if(_C_ === i) break; + i = _F_; } } - /*<>*/ return ba; - /*<>*/ } + /*<>*/ return ba; + /*<>*/ } function create$2(kind, layout, dim1, dim2, dim3){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0, dim1, dim2, dim3]); - /*<>*/ } + /*<>*/ } function size_in_bytes$3(arr){ - /*<>*/ var - /*<>*/ _y_ = - /*<>*/ runtime.caml_ba_dim_3(arr), - /*<>*/ _z_ = - /*<>*/ caml_ba_dim_2(arr), - /*<>*/ _A_ = - /*<>*/ caml_ba_dim_1(arr); + /*<>*/ var + /*<>*/ _y_ = + /*<>*/ runtime.caml_ba_dim_3(arr), + /*<>*/ _z_ = + /*<>*/ caml_ba_dim_2(arr), + /*<>*/ _A_ = + /*<>*/ caml_ba_dim_1(arr); return caml_mul (caml_mul - ( /*<>*/ caml_mul + ( /*<>*/ caml_mul (kind_size_in_bytes - ( /*<>*/ caml_ba_kind(arr)), + ( /*<>*/ caml_ba_kind(arr)), _A_), _z_), _y_); - /*<>*/ } + /*<>*/ } function slice_left_1(a, n, m){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n, m]); - /*<>*/ } + /*<>*/ } function slice_right_1(a, n, m){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n, m]); - /*<>*/ } + /*<>*/ } function slice_left_2(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function slice_right_2(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function init$2(kind, layout, dim1, dim2, dim3, f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var arr = create$2(kind, layout, dim1, dim2, dim3); - /*<>*/ if(layout){ - /*<>*/ /*<>*/ var _s_ = 1; + /*<>*/ if(layout){ + /*<>*/ /*<>*/ var _s_ = 1; if(dim3 >= 1){ var k$0 = _s_; for(;;){ - /*<>*/ /*<>*/ var _t_ = 1; + /*<>*/ /*<>*/ var _t_ = 1; if(dim2 >= 1){ var j$0 = _t_; for(;;){ - /*<>*/ /*<>*/ var _v_ = 1; + /*<>*/ /*<>*/ var _v_ = 1; if(dim1 >= 1){ var i$0 = _v_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_3 + /*<>*/ /*<>*/ caml_ba_set_3 (arr, i$0, j$0, k$0, - /*<>*/ caml_call3(f, i$0, j$0, k$0)); - /*<>*/ /*<>*/ var + /*<>*/ caml_call3(f, i$0, j$0, k$0)); + /*<>*/ /*<>*/ var _x_ = i$0 + 1 | 0; - if(dim1 !== i$0){var i$0 = _x_; continue;} - break; + if(dim1 === i$0) break; + i$0 = _x_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _w_ = j$0 + 1 | 0; - if(dim2 !== j$0){var j$0 = _w_; continue;} - break; + if(dim2 === j$0) break; + j$0 = _w_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _u_ = k$0 + 1 | 0; - if(dim3 !== k$0){var k$0 = _u_; continue;} - break; + if(dim3 === k$0) break; + k$0 = _u_; } } - /*<>*/ return arr; + /*<>*/ return arr; } - /*<>*/ var + /*<>*/ var _k_ = dim1 - 1 | 0, - /*<>*/ _j_ = 0; + /*<>*/ _j_ = 0; if(_k_ >= 0){ var i = _j_; for(;;){ - /*<>*/ var + /*<>*/ var _m_ = dim2 - 1 | 0, - /*<>*/ _l_ = 0; + /*<>*/ _l_ = 0; if(_m_ >= 0){ var j = _l_; for(;;){ - /*<>*/ var + /*<>*/ var _p_ = dim3 - 1 | 0, - /*<>*/ _o_ = 0; + /*<>*/ _o_ = 0; if(_p_ >= 0){ var k = _o_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_3 - (arr, i, j, k, /*<>*/ caml_call3(f, i, j, k)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_3 + (arr, i, j, k, /*<>*/ caml_call3(f, i, j, k)); + /*<>*/ /*<>*/ var _r_ = k + 1 | 0; - if(_p_ !== k){var k = _r_; continue;} - break; + if(_p_ === k) break; + k = _r_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _q_ = j + 1 | 0; - if(_m_ !== j){var j = _q_; continue;} - break; + if(_m_ === j) break; + j = _q_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _n_ = i + 1 | 0; - if(_k_ !== i){var i = _n_; continue;} - break; + if(_k_ === i) break; + i = _n_; } } - /*<>*/ return arr; - /*<>*/ } + /*<>*/ return arr; + /*<>*/ } function of_array$1(kind, layout, data){ - /*<>*/ var + /*<>*/ var dim1 = data.length - 1, - /*<>*/ dim2 = + /*<>*/ dim2 = 0 === dim1 ? 0 : caml_check_bound(data, 0)[1].length - 1, - /*<>*/ dim3 = + /*<>*/ dim3 = 0 === dim2 ? 0 : caml_check_bound(caml_check_bound(data, 0)[1], 0)[1].length - 1, - /*<>*/ ba = create$2(kind, layout, dim1, dim2, dim3), - /*<>*/ ofs = layout ? 1 : 0, - /*<>*/ _b_ = dim1 - 1 | 0, + /*<>*/ ba = create$2(kind, layout, dim1, dim2, dim3), + /*<>*/ ofs = layout ? 1 : 0, + /*<>*/ _b_ = dim1 - 1 | 0, _a_ = 0; if(_b_ >= 0){ var i = _a_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var row = caml_check_bound(data, i)[1 + i]; if(row.length - 1 !== dim2) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_Array3_of_array_n); - /*<>*/ var - /*<>*/ _d_ = dim2 - 1 | 0, - /*<>*/ _c_ = 0; + /*<>*/ var + /*<>*/ _d_ = dim2 - 1 | 0, + /*<>*/ _c_ = 0; if(_d_ >= 0){ var j = _c_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var col = caml_check_bound(row, j)[1 + j]; if(col.length - 1 !== dim3) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_Array3_of_array_n$0); - /*<>*/ var - /*<>*/ _g_ = dim3 - 1 | 0, - /*<>*/ _f_ = 0; + /*<>*/ var + /*<>*/ _g_ = dim3 - 1 | 0, + /*<>*/ _f_ = 0; if(_g_ >= 0){ var k = _f_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_3 + /*<>*/ /*<>*/ caml_ba_set_3 (ba, i + ofs | 0, j + ofs | 0, k + ofs | 0, caml_check_bound(col, k)[1 + k]); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _i_ = k + 1 | 0; - if(_g_ !== k){var k = _i_; continue;} - break; + if(_g_ === k) break; + k = _i_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _h_ = j + 1 | 0; - if(_d_ !== j){var j = _h_; continue;} - break; + if(_d_ === j) break; + j = _h_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _e_ = i + 1 | 0; - if(_b_ !== i){var i = _e_; continue;} - break; + if(_b_ === i) break; + i = _e_; } } - /*<>*/ return ba; - /*<>*/ } + /*<>*/ return ba; + /*<>*/ } function array0_of_genarray(a){ - /*<>*/ return 0 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 0 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array0_of_genarra); - /*<>*/ } + /*<>*/ } function array1_of_genarray(a){ - /*<>*/ return 1 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 1 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array1_of_genarra); - /*<>*/ } + /*<>*/ } function array2_of_genarray(a){ - /*<>*/ return 2 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 2 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array2_of_genarra); - /*<>*/ } + /*<>*/ } function array3_of_genarray(a){ - /*<>*/ return 3 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 3 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array3_of_genarra); - /*<>*/ } + /*<>*/ } function reshape_0(a){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0]); - /*<>*/ } + /*<>*/ } function reshape_1(a, dim1){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0, dim1]); - /*<>*/ } + /*<>*/ } function reshape_2(a, dim1, dim2){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0, dim1, dim2]); - /*<>*/ } + /*<>*/ } function reshape_3(a, dim1, dim2, dim3){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0, dim1, dim2, dim3]); - /*<>*/ } + /*<>*/ } var Stdlib_Bigarray = [0, - float32, - float64, - complex32, - complex64, - int8_signed, - int8_unsigned, - int16_signed, - int16_unsigned, - int$0, - int32, - int64, - nativeint, - char$0, + 13, + 0, + 1, + 10, + 11, + 2, + 3, + 4, + 5, + 8, + 6, + 7, + 9, + 12, kind_size_in_bytes, - c_layout, - fortran_layout, + 0, + 1, [0, init, dims, size_in_bytes], [0, create, @@ -22737,7 +24856,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Random -//# unitInfo: Requires: Stdlib, Stdlib__Bigarray, Stdlib__Bytes, Stdlib__Digest, Stdlib__Domain, Stdlib__Int32, Stdlib__Int64, Stdlib__Nativeint, Stdlib__String +//# unitInfo: Requires: Stdlib, Stdlib__Bigarray, Stdlib__Bytes, Stdlib__Digest, Stdlib__Domain, Stdlib__Int32, Stdlib__Int64, Stdlib__Nativeint, Stdlib__String, Stdlib__Sys (function (globalThis){ "use strict"; @@ -22746,12 +24865,15 @@ caml_ba_blit = runtime.caml_ba_blit, caml_ba_set_1 = runtime.caml_ba_set_1, caml_bytes_set = runtime.caml_bytes_set, + caml_create_bytes = runtime.caml_create_bytes, caml_greaterthan = runtime.caml_greaterthan, + caml_int64_add = runtime.caml_int64_add, caml_int64_of_int32 = runtime.caml_int64_of_int32, caml_int64_shift_right_unsigne = runtime.caml_int64_shift_right_unsigned, caml_int64_sub = runtime.caml_int64_sub, caml_int64_to_int32 = runtime.caml_int64_to_int32, caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_lxm_next = runtime.caml_lxm_next, caml_mod = runtime.caml_mod, caml_notequal = runtime.caml_notequal, @@ -22770,38 +24892,33 @@ return (f.l >= 0 ? f.l : f.l = f.length) == 3 ? f(a0, a1, a2) : runtime.caml_call_gen(f, [a0, a1, a2]); + } + /*<>*/ function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); } var global_data = runtime.caml_get_global_data(), + serialization_prefix = "lxm1:", Stdlib_Domain = global_data.Stdlib__Domain, - Stdlib = global_data.Stdlib, + Stdlib_Sys = global_data.Stdlib__Sys, Stdlib_Int32 = global_data.Stdlib__Int32, Stdlib_Int64 = global_data.Stdlib__Int64, + Stdlib = global_data.Stdlib, Stdlib_Bytes = global_data.Stdlib__Bytes, Stdlib_Digest = global_data.Stdlib__Digest, Stdlib_String = global_data.Stdlib__String, Stdlib_Bigarray = global_data.Stdlib__Bigarray, Stdlib_Nativeint = global_data.Stdlib__Nativeint, - _j_ = runtime.caml_int64_create_lo_mi_hi(14371852, 15349651, 22696), - _k_ = runtime.caml_int64_create_lo_mi_hi(12230193, 11438743, 35013), - _l_ = runtime.caml_int64_create_lo_mi_hi(1424933, 15549263, 2083), - _m_ = runtime.caml_int64_create_lo_mi_hi(9492471, 4696708, 43520), - _f_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), - _h_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), - _i_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), - _g_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), - cst_Random_int64 = "Random.int64", - cst_Random_int32 = "Random.int32", - cst_Random_full_int = "Random.full_int", - cst_Random_int = "Random.int", _a_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), _b_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), - _e_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), _c_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), - _d_ = runtime.caml_int64_create_lo_mi_hi(2, 0, 0); + _d_ = runtime.caml_int64_create_lo_mi_hi(2, 0, 0), + _e_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0); function create(param){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Bigarray[19][1], 7, 0, 4); + (Stdlib_Bigarray[20][1], 7, 0, 4); /*<>*/ } function set(s, i1, i2, i3, i4){ /*<>*/ /*<>*/ caml_ba_set_1 @@ -22820,291 +24937,482 @@ /*<>*/ set(s, i1, i2, i3, i4); /*<>*/ return s; /*<>*/ } - function copy(s){ - /*<>*/ /*<>*/ var s$0 = create(0); - /*<>*/ /*<>*/ caml_ba_blit(s, s$0); - /*<>*/ return s$0; - /*<>*/ } + var + serialization_prefix_len = 5, + cst_Random_State_of_binary_str = + "Random.State.of_binary_string: expected a format compatible with OCaml "; + function to_binary_string(s){ + /*<>*/ /*<>*/ var + buf = /*<>*/ caml_create_bytes(37); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Bytes[12], + serialization_prefix, + 0, + buf, + 0, + serialization_prefix_len); + var i = 0; + for(;;){ + /*<>*/ /*<>*/ var + _y_ = /*<>*/ runtime.caml_ba_get_1(s, i); + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Bytes[86], buf, 5 + (i * 8 | 0) | 0, _y_); + /*<>*/ /*<>*/ var _z_ = i + 1 | 0; + if(3 === i) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], buf); + i = _z_; + } + /*<>*/ } + function of_binary_string(buf){ + /*<>*/ var + _v_ = runtime.caml_ml_string_length(buf) !== 37 ? 1 : 0, + _w_ = + _v_ + || + 1 + - + /*<>*/ caml_call2 + (Stdlib_String[11], serialization_prefix, buf); + if(_w_){ + /*<>*/ /*<>*/ var + _x_ = + /*<>*/ caml_call2 + (Stdlib[28], cst_Random_State_of_binary_str, Stdlib_Sys[46]); + /*<>*/ /*<>*/ caml_call1 + (Stdlib[2], _x_); + } + /*<>*/ var + /*<>*/ i1 = + /*<>*/ caml_call2(Stdlib_String[64], buf, 5), + /*<>*/ i2 = + /*<>*/ caml_call2(Stdlib_String[64], buf, 13), + /*<>*/ i3 = + /*<>*/ caml_call2(Stdlib_String[64], buf, 21), + /*<>*/ i4 = + /*<>*/ caml_call2(Stdlib_String[64], buf, 29); + /*<>*/ return mk(i1, i2, i3, i4); + /*<>*/ } + function copy(src){ + /*<>*/ /*<>*/ var dst = create(0); + /*<>*/ /*<>*/ caml_ba_blit(src, dst); + /*<>*/ return dst; + /*<>*/ } function reinit(s, seed){ - /*<>*/ var + /*<>*/ var n = seed.length - 1, - /*<>*/ b = - /*<>*/ runtime.caml_create_bytes((n * 8 | 0) + 1 | 0), - /*<>*/ _p_ = n - 1 | 0, - /*<>*/ _o_ = 0; + /*<>*/ b = + /*<>*/ caml_create_bytes((n * 8 | 0) + 1 | 0), + /*<>*/ _p_ = n - 1 | 0, + /*<>*/ _o_ = 0; if(_p_ >= 0){ var i = _o_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _t_ = - /*<>*/ caml_int64_of_int32 + /*<>*/ caml_int64_of_int32 (runtime.caml_check_bound(seed, i)[1 + i]); - /*<>*/ /*<>*/ caml_call3 + /*<>*/ /*<>*/ caml_call3 (Stdlib_Bytes[86], b, i * 8 | 0, _t_); - /*<>*/ /*<>*/ var _u_ = i + 1 | 0; - if(_p_ !== i){var i = _u_; continue;} - break; + /*<>*/ /*<>*/ var _u_ = i + 1 | 0; + if(_p_ === i) break; + i = _u_; } } - /*<>*/ /*<>*/ caml_bytes_set + /*<>*/ /*<>*/ caml_bytes_set (b, n * 8 | 0, 1); - /*<>*/ /*<>*/ var - d1 = /*<>*/ caml_call1(Stdlib_Digest[4], b); - /*<>*/ /*<>*/ caml_bytes_set + /*<>*/ /*<>*/ var + d1 = /*<>*/ caml_call1(Stdlib_Digest[4], b); + /*<>*/ /*<>*/ caml_bytes_set (b, n * 8 | 0, 2); - /*<>*/ var - /*<>*/ d2 = - /*<>*/ caml_call1(Stdlib_Digest[4], b), - /*<>*/ _q_ = - /*<>*/ caml_call2(Stdlib_String[64], d2, 8), - /*<>*/ _r_ = - /*<>*/ caml_call2(Stdlib_String[64], d2, 0), - /*<>*/ _s_ = - /*<>*/ caml_call2(Stdlib_String[64], d1, 8); - /*<>*/ return set + /*<>*/ var + /*<>*/ d2 = + /*<>*/ caml_call1(Stdlib_Digest[4], b), + /*<>*/ _q_ = + /*<>*/ caml_call2(Stdlib_String[64], d2, 8), + /*<>*/ _r_ = + /*<>*/ caml_call2(Stdlib_String[64], d2, 0), + /*<>*/ _s_ = + /*<>*/ caml_call2(Stdlib_String[64], d1, 8); + /*<>*/ return set (s, - /*<>*/ caml_call2(Stdlib_String[64], d1, 0), + /*<>*/ caml_call2(Stdlib_String[64], d1, 0), _s_, _r_, _q_); - /*<>*/ } + /*<>*/ } function make(seed){ - /*<>*/ /*<>*/ var s = create(0); - /*<>*/ reinit(s, seed); - /*<>*/ return s; - /*<>*/ } + /*<>*/ /*<>*/ var s = create(0); + /*<>*/ reinit(s, seed); + /*<>*/ return s; + /*<>*/ } function make_self_init(param){ - /*<>*/ return make - ( /*<>*/ caml_sys_random_seed(0)); - /*<>*/ } + /*<>*/ return make + ( /*<>*/ caml_sys_random_seed(0)); + /*<>*/ } + var + max_int31 = 1073741823, + max_int32 = 2147483647, + cst_Random_int = "Random.int", + cst_Random_full_int = "Random.full_int", + cst_Random_int_in_range = "Random.int_in_range", + cst_Random_int32 = "Random.int32", + cst_Random_int32_in_range = "Random.int32_in_range"; function bits(s){ - /*<>*/ return /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)) + /*<>*/ return /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)) & 1073741823; - /*<>*/ } - function intaux(s, n){ - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ r = bits(s), + /*<>*/ } + function int_aux(s, n, mask){ + /*<>*/ for(;;){ + var + r = + /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)) + & mask, v = caml_mod(r, n); - if(((1073741823 - n | 0) + 1 | 0) < (r - v | 0)) continue; - /*<>*/ return v; + if(((mask - n | 0) + 1 | 0) >= (r - v | 0)) + /*<>*/ return v; } - /*<>*/ } + /*<>*/ } function int$0(s, bound){ - /*<>*/ if(1073741823 >= bound && 0 < bound) - /*<>*/ return intaux(s, bound); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(1073741823 >= bound && 0 < bound) + return int_aux(s, bound, max_int31); + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Random_int); - /*<>*/ } + /*<>*/ } function full_int(s, bound){ - /*<>*/ if(0 >= bound) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 >= bound) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Random_full_int); - if(1073741823 >= bound) /*<>*/ return intaux(s, bound); - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ _n_ = Stdlib[19], + var + _n_ = + bound <= 1073741823 + ? max_int31 + : bound <= 2147483647 ? max_int32 : Stdlib[19]; + return int_aux(s, bound, _n_); + /*<>*/ } + function int_in_range_aux(s, min, max, mask, nbits){ + /*<>*/ var span = (max - min | 0) + 1 | 0; + if(span <= mask && 0 < span) return min + int_aux(s, span, mask) | 0; + /*<>*/ for(;;){ + var + drop = Stdlib_Sys[10] - nbits | 0, r = - /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)) - & _n_, - v = caml_mod(r, bound); - if(((Stdlib[19] - bound | 0) + 1 | 0) < (r - v | 0)) continue; - /*<>*/ return v; - } - /*<>*/ } + /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)) + << drop + >> drop; + if(r >= min && max >= r) /*<>*/ return r; + } + /*<>*/ } + function int_in_range(s, min, max){ + /*<>*/ if(max < min) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Random_int_in_range); + if(-1073741824 <= min && max <= 1073741823) + /*<>*/ return int_in_range_aux + (s, min, max, max_int31, 31); + if(-2147483648 <= min && max <= 2147483647) + /*<>*/ return int_in_range_aux + (s, min, max, max_int32, 32); + /*<>*/ return int_in_range_aux + (s, min, max, Stdlib[19], Stdlib_Sys[10]); + /*<>*/ } function bits32(s){ - /*<>*/ return /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)); - /*<>*/ } + /*<>*/ return /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)); + /*<>*/ } + function int32aux(s, n){ + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ r = bits32(s) >>> 1 | 0, + /*<>*/ v = /*<>*/ caml_mod(r, n); + /*<>*/ if + (! + /*<>*/ caml_greaterthan + (r - v | 0, (Stdlib_Int32[9] - n | 0) + 1 | 0)) + /*<>*/ return v; + } + /*<>*/ } function int32(s, bound){ - /*<>*/ if - ( /*<>*/ caml_lessequal(bound, 0)) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_Random_int32); - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ r = bits32(s) >>> 1 | 0, - /*<>*/ v = - /*<>*/ caml_mod(r, bound); - /*<>*/ if - ( /*<>*/ caml_greaterthan - (r - v | 0, (Stdlib_Int32[9] - bound | 0) + 1 | 0)) - continue; - /*<>*/ return v; + /*<>*/ return /*<>*/ caml_lessequal + (bound, 0) + ? /*<>*/ caml_call1(Stdlib[1], cst_Random_int32) + : int32aux(s, bound); + /*<>*/ } + function int32_in_range(s, min, max){ + /*<>*/ if + ( /*<>*/ caml_greaterthan(min, max)) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Random_int32_in_range); + /*<>*/ /*<>*/ var + span = + /*<>*/ caml_call1(Stdlib_Int32[6], max - min | 0); + /*<>*/ if + (! /*<>*/ caml_lessequal(span, Stdlib_Int32[1])) + /*<>*/ return min + int32aux(s, span) | 0; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)); + /*<>*/ if + (! + /*<>*/ caml_lessthan(r, min) + && ! /*<>*/ caml_greaterthan(r, max)) + /*<>*/ return r; + } + /*<>*/ } + var + bits64 = caml_lxm_next, + _f_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), + _g_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), + cst_Random_int64 = "Random.int64", + cst_Random_int64_in_range = "Random.int64_in_range"; + function int64aux(s, n){ + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_int64_shift_right_unsigne + ( /*<>*/ caml_lxm_next(s), 1), + /*<>*/ v = + /*<>*/ runtime.caml_int64_mod(r, n); + /*<>*/ if + (! + /*<>*/ caml_greaterthan + ( /*<>*/ caml_int64_sub(r, v), + /*<>*/ caml_int64_add + ( /*<>*/ caml_int64_sub(Stdlib_Int64[9], n), _f_))) + /*<>*/ return v; } - /*<>*/ } - var bits64 = caml_lxm_next; + /*<>*/ } function int64(s, bound){ - /*<>*/ if - ( /*<>*/ caml_lessequal(bound, _g_)) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_Random_int64); - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_int64_shift_right_unsigne - ( /*<>*/ caml_lxm_next(s), 1), - /*<>*/ v = - /*<>*/ runtime.caml_int64_mod(r, bound); - /*<>*/ if - ( /*<>*/ caml_greaterthan - ( /*<>*/ caml_int64_sub(r, v), - /*<>*/ runtime.caml_int64_add - ( /*<>*/ caml_int64_sub(Stdlib_Int64[9], bound), - _f_))) - continue; - /*<>*/ return v; + /*<>*/ return /*<>*/ caml_lessequal + (bound, _g_) + ? /*<>*/ caml_call1(Stdlib[1], cst_Random_int64) + : int64aux(s, bound); + /*<>*/ } + function int64_in_range(s, min, max){ + /*<>*/ if + ( /*<>*/ caml_greaterthan(min, max)) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Random_int64_in_range); + /*<>*/ /*<>*/ var + span = + /*<>*/ caml_call1 + (Stdlib_Int64[6], /*<>*/ caml_int64_sub(max, min)); + /*<>*/ if + (! /*<>*/ caml_lessequal(span, Stdlib_Int64[1])) + /*<>*/ return /*<>*/ caml_int64_add + (min, int64aux(s, span)); + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + r = /*<>*/ caml_lxm_next(s); + /*<>*/ if + (! + /*<>*/ caml_lessthan(r, min) + && ! /*<>*/ caml_greaterthan(r, max)) + /*<>*/ return r; } - /*<>*/ } + /*<>*/ } var + _j_ = runtime.caml_int64_create_lo_mi_hi(14371852, 15349651, 22696), + _k_ = runtime.caml_int64_create_lo_mi_hi(12230193, 11438743, 35013), + _l_ = runtime.caml_int64_create_lo_mi_hi(1424933, 15549263, 2083), + _m_ = runtime.caml_int64_create_lo_mi_hi(9492471, 4696708, 43520), + _h_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), + _i_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), nativebits = 32 === Stdlib_Nativeint[9] ? function (s){ - /*<>*/ return bits32(s); - /*<>*/ } + /*<>*/ return bits32(s); + /*<>*/ } : function (s){ - /*<>*/ return /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)); - /*<>*/ }, + /*<>*/ return /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)); + /*<>*/ }, nativeint = 32 === Stdlib_Nativeint[9] ? function (s, bound){ - /*<>*/ return int32(s, bound); - /*<>*/ } + /*<>*/ return int32(s, bound); + /*<>*/ } : function (s, bound){ - /*<>*/ return /*<>*/ caml_int64_to_int32 + /*<>*/ return /*<>*/ caml_int64_to_int32 (int64 - (s, /*<>*/ caml_int64_of_int32(bound))); - /*<>*/ }; + (s, /*<>*/ caml_int64_of_int32(bound))); + /*<>*/ }, + nativeint_in_range = + 32 === Stdlib_Nativeint[9] + ? function + (s, min, max){ + /*<>*/ return int32_in_range(s, min, max); + /*<>*/ } + : function + (s, min, max){ + /*<>*/ return /*<>*/ caml_int64_to_int32 + (int64_in_range + (s, + /*<>*/ caml_int64_of_int32(min), + /*<>*/ caml_int64_of_int32(max))); + /*<>*/ }; function float$0(s, bound){ - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ b = /*<>*/ caml_lxm_next(s), - /*<>*/ n = - /*<>*/ caml_int64_shift_right_unsigne(b, 11); - /*<>*/ if - ( /*<>*/ caml_notequal(n, _h_)) - /*<>*/ return /*<>*/ runtime.caml_int64_to_float + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ b = /*<>*/ caml_lxm_next(s), + /*<>*/ n = + /*<>*/ caml_int64_shift_right_unsigne(b, 11); + /*<>*/ if + ( /*<>*/ caml_notequal(n, _h_)) + /*<>*/ return /*<>*/ runtime.caml_int64_to_float (n) * 1.1102230246251565e-16 * bound; } - /*<>*/ } + /*<>*/ } function bool(s){ - /*<>*/ return /*<>*/ runtime.caml_lessthan - ( /*<>*/ caml_lxm_next(s), _i_); - /*<>*/ } + /*<>*/ return /*<>*/ caml_lessthan + ( /*<>*/ caml_lxm_next(s), _i_); + /*<>*/ } function split(s){ - /*<>*/ var - /*<>*/ i1 = /*<>*/ caml_lxm_next(s), - /*<>*/ i2 = /*<>*/ caml_lxm_next(s), - /*<>*/ i3 = /*<>*/ caml_lxm_next(s), - /*<>*/ i4 = /*<>*/ caml_lxm_next(s); - /*<>*/ return mk(i1, i2, i3, i4); - /*<>*/ } + /*<>*/ var + /*<>*/ i1 = /*<>*/ caml_lxm_next(s), + /*<>*/ i2 = /*<>*/ caml_lxm_next(s), + /*<>*/ i3 = /*<>*/ caml_lxm_next(s), + /*<>*/ i4 = /*<>*/ caml_lxm_next(s); + /*<>*/ return mk(i1, i2, i3, i4); + /*<>*/ } function mk_default(param){ - /*<>*/ return mk(_m_, _l_, _k_, _j_); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return mk(_m_, _l_, _k_, _j_); + /*<>*/ } + /*<>*/ /*<>*/ var random_key = - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_Domain[10][1], [0, split], mk_default); function bits$0(param){ - /*<>*/ return bits - ( /*<>*/ caml_call1 + /*<>*/ return bits + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function int$1(bound){ - /*<>*/ return int$0 - ( /*<>*/ caml_call1 + /*<>*/ return int$0 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } function full_int$0(bound){ - /*<>*/ return full_int - ( /*<>*/ caml_call1 + /*<>*/ return full_int + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function int_in_range$0(min, max){ + /*<>*/ return int_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function int32$0(bound){ - /*<>*/ return int32 - ( /*<>*/ caml_call1 + /*<>*/ return int32 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function int32_in_range$0(min, max){ + /*<>*/ return int32_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function nativeint$0(bound){ - /*<>*/ return nativeint - ( /*<>*/ caml_call1 + /*<>*/ return nativeint + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function nativeint_in_range$0(min, max){ + /*<>*/ return nativeint_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function int64$0(bound){ - /*<>*/ return int64 - ( /*<>*/ caml_call1 + /*<>*/ return int64 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function int64_in_range$0(min, max){ + /*<>*/ return int64_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function float$1(scale){ - /*<>*/ return float$0 - ( /*<>*/ caml_call1 + /*<>*/ return float$0 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), scale); - /*<>*/ } + /*<>*/ } function bool$0(param){ - /*<>*/ return bool - ( /*<>*/ caml_call1 + /*<>*/ return bool + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function bits32$0(param){ - /*<>*/ return bits32 - ( /*<>*/ caml_call1 + /*<>*/ return bits32 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function bits64$0(param){ - /*<>*/ return /*<>*/ caml_lxm_next - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ /*<>*/ var + s = + /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); + /*<>*/ return /*<>*/ caml_lxm_next(s); + /*<>*/ } function nativebits$0(param){ - /*<>*/ return nativebits - ( /*<>*/ caml_call1 + /*<>*/ return nativebits + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function full_init(seed){ - /*<>*/ return reinit - ( /*<>*/ caml_call1 + /*<>*/ return reinit + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), seed); - /*<>*/ } + /*<>*/ } function init(seed){ - /*<>*/ return full_init([0, seed]); - /*<>*/ } + /*<>*/ return full_init([0, seed]); + /*<>*/ } function self_init(param){ - /*<>*/ return full_init - ( /*<>*/ caml_sys_random_seed(0)); - /*<>*/ } + /*<>*/ return full_init + ( /*<>*/ caml_sys_random_seed(0)); + /*<>*/ } function split$0(param){ - /*<>*/ return split - ( /*<>*/ caml_call1 + /*<>*/ return split + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function get_state(param){ - /*<>*/ return copy - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); - /*<>*/ } - function set_state(s){ - /*<>*/ return /*<>*/ caml_ba_blit - (s, - /*<>*/ caml_call1 + /*<>*/ return copy + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } + function set_state(src){ + /*<>*/ /*<>*/ var + dst = + /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); + /*<>*/ return /*<>*/ caml_ba_blit + (src, dst); + /*<>*/ } var Stdlib_Random = [0, @@ -23114,9 +25422,13 @@ bits$0, int$1, full_int$0, + int_in_range$0, int32$0, + int32_in_range$0, nativeint$0, + nativeint_in_range$0, int64$0, + int64_in_range$0, float$1, bool$0, bits32$0, @@ -23129,25 +25441,31 @@ bits, int$0, full_int, + int_in_range, int32, + int32_in_range, nativeint, + nativeint_in_range, int64, + int64_in_range, float$0, bool, bits32, bits64, nativebits, - split], + split, + to_binary_string, + of_binary_string], get_state, set_state, split$0]; - runtime.caml_register_global(29, Stdlib_Random, "Stdlib__Random"); + runtime.caml_register_global(35, Stdlib_Random, "Stdlib__Random"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Hashtbl -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Array, Stdlib__Atomic, Stdlib__Domain, Stdlib__Int, Stdlib__Random, Stdlib__Seq, Stdlib__String, Stdlib__Sys +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__Atomic, Stdlib__Domain, Stdlib__Int, Stdlib__Random, Stdlib__Seq, Stdlib__String, Stdlib__Sys (function (globalThis){ "use strict"; @@ -23182,6 +25500,7 @@ } var global_data = runtime.caml_get_global_data(), + _d_ = [0, 0], cst = "", Stdlib_Sys = global_data.Stdlib__Sys, Stdlib = global_data.Stdlib, @@ -23192,28 +25511,27 @@ Stdlib_Int = global_data.Stdlib__Int, Stdlib_Array = global_data.Stdlib__Array; global_data.Assert_failure; - var - Stdlib_String = global_data.Stdlib__String, - cst_Hashtbl_unsupported_hash_t = "Hashtbl: unsupported hash table format", - _d_ = [0, 0]; + var Stdlib_String = global_data.Stdlib__String; function ongoing_traversal(h){ /*<>*/ var - _aB_ = h.length - 1 < 4 ? 1 : 0, - _aC_ = _aB_ || (h[4] < 0 ? 1 : 0); - return _aC_; + _an_ = h.length - 1 < 4 ? 1 : 0, + _ao_ = _an_ || (h[4] < 0 ? 1 : 0); + return _ao_; /*<>*/ } function flip_ongoing_traversal(h){ /*<>*/ h[4] = - h[4] | 0; return 0; /*<>*/ } + var + cst_Hashtbl_unsupported_hash_t = "Hashtbl: unsupported hash table format"; try{ /*<>*/ var /*<>*/ _f_ = /*<>*/ caml_sys_getenv("OCAMLRUNPARAM"), params = _f_; } - catch(_az_){ - var _a_ = caml_wrap_exception(_az_); + catch(_al_){ + var _a_ = caml_wrap_exception(_al_); if(_a_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_a_, 0); /*<>*/ try{ /*<>*/ var @@ -23221,8 +25539,8 @@ /*<>*/ caml_sys_getenv("CAMLRUNPARAM"), _c_ = _e_; } - catch(_aA_){ - var _b_ = caml_wrap_exception(_aA_); + catch(_am_){ + var _b_ = caml_wrap_exception(_am_); if(_b_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_b_, 0); var _c_ = cst; } @@ -23230,43 +25548,42 @@ } /*<>*/ var /*<>*/ randomized_default = - /*<>*/ caml_call2(Stdlib_String[14], params, 82), + /*<>*/ caml_call2(Stdlib_String[15], params, 82), /*<>*/ randomized = /*<>*/ caml_call1 (Stdlib_Atomic[1], randomized_default); function randomize(param){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Atomic[3], randomized, 1); + (Stdlib_Atomic[4], randomized, 1); /*<>*/ } function is_randomized(param){ - /*<>*/ return caml_call1(Stdlib_Atomic[2], randomized); + /*<>*/ return caml_call1(Stdlib_Atomic[3], randomized); /*<>*/ } /*<>*/ /*<>*/ var prng_key = /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, Stdlib_Random[15][2]); + (Stdlib_Domain[10][1], 0, Stdlib_Random[19][2]); function power_2_above(x, n){ /*<>*/ var x$0 = x; /*<>*/ for(;;){ if(n <= x$0) /*<>*/ return x$0; if(Stdlib_Sys[13] < (x$0 * 2 | 0)) /*<>*/ return x$0; - var x$1 = x$0 * 2 | 0, x$0 = x$1; + var x$1 = x$0 * 2 | 0; + x$0 = x$1; } /*<>*/ } function create(opt, initial_size){ - /*<>*/ if(opt) - var sth = opt[1], random = sth; - else - var - random = - /*<>*/ caml_call1(Stdlib_Atomic[2], randomized); - /*<>*/ /*<>*/ var - s = power_2_above(16, initial_size); + /*<>*/ var + random = + opt + ? opt[1] + : /*<>*/ caml_call1(Stdlib_Atomic[3], randomized), + /*<>*/ s = power_2_above(16, initial_size); /*<>*/ if(random) /*<>*/ var - /*<>*/ _ay_ = + /*<>*/ _ak_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), - seed = /*<>*/ caml_call1(Stdlib_Random[15][4], _ay_); + seed = /*<>*/ caml_call1(Stdlib_Random[19][4], _ak_); else var seed = 0; /*<>*/ return [0, @@ -23274,16 +25591,16 @@ /*<>*/ caml_make_vect(s, 0), seed, s]; - /*<>*/ } + } function clear(h){ - /*<>*/ var _ax_ = 0 < h[1] ? 1 : 0; - return _ax_ + /*<>*/ var _aj_ = 0 < h[1] ? 1 : 0; + return _aj_ ? (h [1] = 0, /*<>*/ caml_call4 - (Stdlib_Array[7], h[2], 0, h[2].length - 1, 0)) - : _ax_; + (Stdlib_Array[8], h[2], 0, h[2].length - 1, 0)) + : _aj_; /*<>*/ } function reset(h){ /*<>*/ var len = h[2].length - 1; @@ -23315,17 +25632,18 @@ next$0 = param$0[3], /*<>*/ prec$0 = [0, key$0, data$0, next$0]; prec[3] = prec$0; - var prec = prec$0, param$0 = next$0; + prec = prec$0; + param$0 = next$0; } /*<>*/ } function copy(h){ /*<>*/ var - _au_ = h[4], - _av_ = h[3], - /*<>*/ _aw_ = + _ag_ = h[4], + _ah_ = h[3], + /*<>*/ _ai_ = /*<>*/ caml_call2 - (Stdlib_Array[13], copy_bucketlist, h[2]); - /*<>*/ return [0, h[1], _aw_, _av_, _au_]; + (Stdlib_Array[14], copy_bucketlist, h[2]); + /*<>*/ return [0, h[1], _ai_, _ah_, _ag_]; /*<>*/ } function length(h){ /*<>*/ return h[1]; @@ -23335,73 +25653,69 @@ nsize = ndata.length - 1, /*<>*/ ndata_tail = /*<>*/ caml_make_vect(nsize, 0), - _ao_ = odata.length - 1 - 1 | 0, - /*<>*/ _an_ = 0; - if(_ao_ >= 0){ - var i$0 = _an_; - a: + _aa_ = odata.length - 2 | 0, + /*<>*/ _$_ = 0; + if(_aa_ >= 0){ + var i$0 = _$_; for(;;){ /*<>*/ var /*<>*/ cell$1 = caml_check_bound(odata, i$0)[1 + i$0], cell = cell$1; /*<>*/ for(;;){ - if(cell){ - /*<>*/ var - key = cell[1], - data = cell[2], - next = cell[3], - /*<>*/ cell$0 = inplace ? cell : [0, key, data, 0], - /*<>*/ nidx = - /*<>*/ caml_call1(indexfun, key), - /*<>*/ match = - caml_check_bound(ndata_tail, nidx)[1 + nidx]; - if(match) - match[3] = cell$0; - else - /*<>*/ caml_check_bound(ndata, nidx)[1 + nidx] = cell$0; - /*<>*/ caml_check_bound(ndata_tail, nidx)[1 + nidx] - = cell$0; - var cell = next; - continue; - } - /*<>*/ /*<>*/ var - _at_ = i$0 + 1 | 0; - if(_ao_ !== i$0){var i$0 = _at_; continue a;} - break; + if(! cell) break; + /*<>*/ var + key = cell[1], + data = cell[2], + next = cell[3], + /*<>*/ cell$0 = inplace ? cell : [0, key, data, 0], + /*<>*/ nidx = + /*<>*/ caml_call1(indexfun, key), + /*<>*/ match = + caml_check_bound(ndata_tail, nidx)[1 + nidx]; + if(match) + match[3] = cell$0; + else + /*<>*/ caml_check_bound(ndata, nidx)[1 + nidx] = cell$0; + /*<>*/ caml_check_bound(ndata_tail, nidx)[1 + nidx] + = cell$0; + cell = next; } - break; + /*<>*/ /*<>*/ var + _af_ = i$0 + 1 | 0; + if(_aa_ === i$0) break; + i$0 = _af_; } } if(inplace){ /*<>*/ var - _aq_ = nsize - 1 | 0, - /*<>*/ _ap_ = 0; - if(_aq_ >= 0){ - var i = _ap_; + _ac_ = nsize - 1 | 0, + /*<>*/ _ab_ = 0; + if(_ac_ >= 0){ + var i = _ab_; for(;;){ /*<>*/ /*<>*/ var match$0 = caml_check_bound(ndata_tail, i)[1 + i]; if(match$0) match$0[3] = 0; /*<>*/ /*<>*/ var - _as_ = i + 1 | 0; - if(_aq_ !== i){var i = _as_; continue;} - break; + _ae_ = i + 1 | 0; + if(_ac_ === i) break; + i = _ae_; } } - var _ar_ = 0; + var _ad_ = 0; } else - var _ar_ = inplace; - return _ar_; + var _ad_ = inplace; + return _ad_; /*<>*/ } function resize(indexfun, h){ /*<>*/ var odata = h[2], /*<>*/ osize = odata.length - 1, nsize = osize * 2 | 0, - _am_ = nsize < Stdlib_Sys[13] ? 1 : 0; - if(! _am_) return _am_; + ___ = nsize < Stdlib_Sys[13] ? 1 : 0; + if(! ___) return ___; /*<>*/ var /*<>*/ ndata = /*<>*/ caml_make_vect(nsize, 0), @@ -23418,30 +25732,26 @@ old_trav = ongoing_traversal(h); if(1 - old_trav) /*<>*/ flip_ongoing_traversal(h); /*<>*/ try{ - var d = h[2], _ai_ = d.length - 1 - 1 | 0, _ah_ = 0; - if(_ai_ >= 0){ - var i = _ah_; - a: + var d = h[2], _W_ = d.length - 2 | 0, _V_ = 0; + if(_W_ >= 0){ + var i = _V_; for(;;){ var param = caml_check_bound(d, i)[1 + i]; /*<>*/ for(;;){ - if(param){ - var key = param[1], data = param[2], next = param[3]; - /*<>*/ /*<>*/ caml_call2 - (f, key, data); - var param = next; - continue; - } - /*<>*/ /*<>*/ var - _al_ = i + 1 | 0; - if(_ai_ !== i){var i = _al_; continue a;} - break; + if(! param) break; + var key = param[1], data = param[2], next = param[3]; + /*<>*/ /*<>*/ caml_call2 + (f, key, data); + param = next; } - break; + /*<>*/ /*<>*/ var + _Z_ = i + 1 | 0; + if(_W_ === i) break; + i = _Z_; } } - var _aj_ = 1 - old_trav, _ak_ = _aj_ ? flip_ongoing_traversal(h) : _aj_; - /*<>*/ return _ak_; + var _X_ = 1 - old_trav, _Y_ = _X_ ? flip_ongoing_traversal(h) : _X_; + /*<>*/ return _Y_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -23458,47 +25768,46 @@ /*<>*/ old_trav = ongoing_traversal(h); if(1 - old_trav) /*<>*/ flip_ongoing_traversal(h); /*<>*/ try{ - var _ad_ = d.length - 1 - 1 | 0, _ac_ = 0; - if(_ad_ >= 0){ - var i = _ac_; - a: + var _R_ = d.length - 2 | 0, _Q_ = 0; + if(_R_ >= 0){ + var i = _Q_; for(;;){ /*<>*/ var /*<>*/ slot$0 = caml_check_bound(h[2], i)[1 + i], prec = 0, slot = slot$0; for(;;){ - if(slot){ - /*<>*/ var - key = slot[1], - data = slot[2], - next = slot[3], - /*<>*/ match = - /*<>*/ caml_call2(f, key, data); - if(! match){h[1] = h[1] - 1 | 0; var slot = next; continue;} + if(! slot) break; + /*<>*/ var + key = slot[1], + data = slot[2], + next = slot[3], + /*<>*/ match = + /*<>*/ caml_call2(f, key, data); + if(match){ var data$0 = match[1]; /*<>*/ if(prec) prec[3] = slot; else /*<>*/ caml_check_bound(h[2], i)[1 + i] = slot; slot[2] = data$0; - var prec = slot, slot = next; - continue; + prec = slot; + slot = next; } - if(prec) - prec[3] = 0; - else - /*<>*/ caml_check_bound(h[2], i)[1 + i] = 0; - /*<>*/ /*<>*/ var - _ag_ = i + 1 | 0; - if(_ad_ !== i){var i = _ag_; continue a;} - break; + else{h[1] = h[1] - 1 | 0; slot = next;} } - break; + if(prec) + prec[3] = 0; + else + /*<>*/ caml_check_bound(h[2], i)[1 + i] = 0; + /*<>*/ /*<>*/ var + _U_ = i + 1 | 0; + if(_R_ === i) break; + i = _U_; } } - var _ae_ = 1 - old_trav, _af_ = _ae_ ? flip_ongoing_traversal(h) : _ae_; - /*<>*/ return _af_; + var _S_ = 1 - old_trav, _T_ = _S_ ? flip_ongoing_traversal(h) : _S_; + /*<>*/ return _T_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -23517,11 +25826,10 @@ /*<>*/ var d = h[2], /*<>*/ accu$1 = [0, init], - _$_ = d.length - 1 - 1 | 0, - /*<>*/ ___ = 0; - if(_$_ >= 0){ - var i = ___; - a: + _N_ = d.length - 2 | 0, + /*<>*/ _M_ = 0; + if(_N_ >= 0){ + var i = _M_; for(;;){ /*<>*/ var accu$2 = accu$1[1], @@ -23529,29 +25837,26 @@ b = b$0, accu = accu$2; /*<>*/ for(;;){ - if(b){ - /*<>*/ var - key = b[1], - data = b[2], - next = b[3], - /*<>*/ accu$0 = - /*<>*/ caml_call3(f, key, data, accu), - b = next, - accu = accu$0; - continue; - } - accu$1[1] = accu; - /*<>*/ /*<>*/ var - _ab_ = i + 1 | 0; - if(_$_ !== i){var i = _ab_; continue a;} - break; + if(! b) break; + /*<>*/ var + key = b[1], + data = b[2], + next = b[3], + /*<>*/ accu$0 = + /*<>*/ caml_call3(f, key, data, accu); + b = next; + accu = accu$0; } - break; + accu$1[1] = accu; + /*<>*/ /*<>*/ var + _P_ = i + 1 | 0; + if(_N_ === i) break; + i = _P_; } } if(1 - old_trav) /*<>*/ flip_ongoing_traversal(h); - var _aa_ = accu$1[1]; - return _aa_; + var _O_ = accu$1[1]; + return _O_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -23568,34 +25873,36 @@ if(! param$0) /*<>*/ return accu$0; /*<>*/ var next = param$0[3], - /*<>*/ accu$1 = accu$0 + 1 | 0, - accu$0 = accu$1, - param$0 = next; + /*<>*/ accu$1 = accu$0 + 1 | 0; + accu$0 = accu$1; + param$0 = next; } } function stats(h){ - /*<>*/ var _U_ = h[2], _V_ = 0; - function _W_(m, b){ - /*<>*/ /*<>*/ var - _Z_ = bucket_length(0, b); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Int[11], m, _Z_); - /*<>*/ } - /*<>*/ var + /*<>*/ var /*<>*/ mbl = - /*<>*/ caml_call3(Stdlib_Array[15], _W_, _V_, _U_), + /*<>*/ caml_call3 + (Stdlib_Array[18], + function(m, b){ + /*<>*/ /*<>*/ var + _L_ = bucket_length(0, b); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Int[11], m, _L_); + /*<>*/ }, + 0, + h[2]), /*<>*/ histo = - /*<>*/ caml_make_vect(mbl + 1 | 0, 0), - /*<>*/ _X_ = h[2]; - function _Y_(b){ - /*<>*/ /*<>*/ var - l = bucket_length(0, b); - /*<>*/ histo[1 + l] = - caml_check_bound(histo, l)[1 + l] + 1 | 0; - /*<>*/ return 0; - /*<>*/ } + /*<>*/ caml_make_vect(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _Y_, _X_); + (Stdlib_Array[12], + function(b){ + /*<>*/ /*<>*/ var + l = bucket_length(0, b); + /*<>*/ histo[1 + l] = + caml_check_bound(histo, l)[1 + l] + 1 | 0; + /*<>*/ return 0; + /*<>*/ }, + h[2]); /*<>*/ return [0, h[1], h[2].length - 1, mbl, histo]; /*<>*/ } function to_seq(tbl){ @@ -23607,39 +25914,37 @@ var key = buck$0[1], data = buck$0[2], next = buck$0[3]; /*<>*/ return [0, [0, key, data], - function(_T_){ /*<>*/ return aux(i$0, next, _T_);}]; + function(_K_){ /*<>*/ return aux(i$0, next, _K_);}]; } if(i$0 === tbl_data.length - 1) /*<>*/ return 0; /*<>*/ var /*<>*/ buck$1 = caml_check_bound(tbl_data, i$0)[1 + i$0], - /*<>*/ i$1 = i$0 + 1 | 0, - i$0 = i$1, - buck$0 = buck$1; + /*<>*/ i$1 = i$0 + 1 | 0; + i$0 = i$1; + buck$0 = buck$1; } /*<>*/ } - /*<>*/ var /*<>*/ _Q_ = 0, _R_ = 0; - /*<>*/ return function(_S_){ - /*<>*/ return aux(_R_, _Q_, _S_);}; + var /*<>*/ _H_ = 0, _I_ = 0; + /*<>*/ return function(_J_){ + /*<>*/ return aux(_I_, _H_, _J_);}; /*<>*/ } function to_seq_keys(m){ - /*<>*/ /*<>*/ var _N_ = to_seq(m); - function _O_(_P_){ /*<>*/ return _P_[1];} + /*<>*/ /*<>*/ var _F_ = to_seq(m); /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[27], _O_, _N_); + (Stdlib_Seq[29], function(_G_){ /*<>*/ return _G_[1];}, _F_); /*<>*/ } function to_seq_values(m){ - /*<>*/ /*<>*/ var _K_ = to_seq(m); - function _L_(_M_){ /*<>*/ return _M_[2];} + /*<>*/ /*<>*/ var _D_ = to_seq(m); /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[27], _L_, _K_); + (Stdlib_Seq[29], function(_E_){ /*<>*/ return _E_[2];}, _D_); /*<>*/ } function MakeSeeded(H){ function key_index(h, key){ - /*<>*/ var _J_ = h[2].length - 1 - 1 | 0; + /*<>*/ var _C_ = h[2].length - 2 | 0; /*<>*/ return /*<>*/ caml_call2 (H[2], h[3], key) - & _J_; + & _C_; /*<>*/ } function add(h, key, data){ /*<>*/ var @@ -23648,8 +25953,8 @@ [0, key, data, caml_check_bound(h[2], i)[1 + i]]; /*<>*/ caml_check_bound(h[2], i)[1 + i] = bucket; h[1] = h[1] + 1 | 0; - var _I_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; - return _I_ ? resize(key_index, h) : _I_; + var _B_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + return _B_ ? resize(key_index, h) : _B_; /*<>*/ } function remove(h, key){ /*<>*/ var @@ -23667,13 +25972,14 @@ ? (prec$0[3] = next, 0) : (caml_check_bound(h[2], i)[1 + i] = next, 0); } - var prec$0 = prec, prec = next; + prec$0 = prec; + prec = next; } /*<>*/ } function find(h, key){ /*<>*/ var - /*<>*/ _H_ = key_index(h, key), - /*<>*/ match = caml_check_bound(h[2], _H_)[1 + _H_]; + /*<>*/ _A_ = key_index(h, key), + /*<>*/ match = caml_check_bound(h[2], _A_)[1 + _A_]; if(! match) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); @@ -23704,13 +26010,13 @@ /*<>*/ if ( /*<>*/ caml_call2(H[1], key, k)) /*<>*/ return data; - var param = next; + param = next; } /*<>*/ } function find_opt(h, key){ /*<>*/ var - /*<>*/ _G_ = key_index(h, key), - /*<>*/ match = caml_check_bound(h[2], _G_)[1 + _G_]; + /*<>*/ _z_ = key_index(h, key), + /*<>*/ match = caml_check_bound(h[2], _z_)[1 + _z_]; if(! match) /*<>*/ return 0; var k1 = match[1], d1 = match[2], next1 = match[3]; /*<>*/ if @@ -23733,25 +26039,44 @@ /*<>*/ if ( /*<>*/ caml_call2(H[1], key, k)) /*<>*/ return [0, data]; - var param = next; + param = next; } /*<>*/ } function find_all(h, key){ - function find_in_bucket(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ - if(! param$0) /*<>*/ return 0; - var k = param$0[1], d = param$0[2], next = param$0[3]; - /*<>*/ if - ( /*<>*/ caml_call2(H[1], k, key)) - /*<>*/ return [0, d, find_in_bucket(next)]; - var param$0 = next; + /*<>*/ var + /*<>*/ _y_ = key_index(h, key), + param = caml_check_bound(h[2], _y_)[1 + _y_]; + /*<>*/ for(;;){ + if(! param) /*<>*/ return 0; + var k = param[1], d = param[2], next = param[3]; + /*<>*/ if + ( /*<>*/ caml_call2(H[1], k, key)) + break; + param = next; + } + /*<>*/ var + /*<>*/ block = [0, d, 24029], + dst = block, + offset = 1, + param$0 = next; + /*<>*/ for(;;){ + if(! param$0){ + dst[1 + offset] = 0; + /*<>*/ return block; } - /*<>*/ } - /*<>*/ /*<>*/ var - _F_ = key_index(h, key); - /*<>*/ return find_in_bucket - (caml_check_bound(h[2], _F_)[1 + _F_]); + var k$0 = param$0[1], d$0 = param$0[2], next$0 = param$0[3]; + /*<>*/ if + ( /*<>*/ caml_call2(H[1], k$0, key)){ + /*<>*/ /*<>*/ var + dst$0 = [0, d$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + param$0 = next$0; + } + else + param$0 = next$0; + } /*<>*/ } function replace(h, key, data){ /*<>*/ var @@ -23762,63 +26087,65 @@ if(slot){ var k = slot[1], next = slot[3]; /*<>*/ if - (! /*<>*/ caml_call2(H[1], k, key)){var slot = next; continue;} + (! /*<>*/ caml_call2(H[1], k, key)){slot = next; continue;} slot[1] = key; slot[2] = data; - var _C_ = 0; + var _v_ = 0; } else - var _C_ = 1; - /*<>*/ if(_C_){ + var _v_ = 1; + /*<>*/ if(_v_){ /*<>*/ caml_check_bound(h[2], i)[1 + i] = [0, key, data, l]; h[1] = h[1] + 1 | 0; - var _D_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; - if(_D_) /*<>*/ return resize(key_index, h); - var _E_ = _D_; + var _w_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + if(_w_) /*<>*/ return resize(key_index, h); + var _x_ = _w_; } else - var _E_ = _C_; - return _E_; + var _x_ = _v_; + return _x_; } /*<>*/ } function mem(h, key){ - /*<>*/ var - /*<>*/ _B_ = key_index(h, key), - param = caml_check_bound(h[2], _B_)[1 + _B_]; - /*<>*/ for(;;){ - if(! param) /*<>*/ return 0; - /*<>*/ var + /*<>*/ var + /*<>*/ _u_ = key_index(h, key), + param = caml_check_bound(h[2], _u_)[1 + _u_]; + for(;;){ + if(! param) /*<>*/ return 0; + /*<>*/ var k = param[1], next = param[3], - /*<>*/ _A_ = - /*<>*/ caml_call2(H[1], k, key); - /*<>*/ if(_A_) - /*<>*/ return _A_; - var param = next; + /*<>*/ _t_ = + /*<>*/ caml_call2(H[1], k, key); + /*<>*/ if(_t_) + /*<>*/ return _t_; + param = next; } - /*<>*/ } + /*<>*/ } function add_seq(tbl, i){ - function _z_(param){ - /*<>*/ var v = param[2], k = param[1]; - /*<>*/ return add(tbl, k, v); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _z_, i); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return add(tbl, k, v); + /*<>*/ }, + i); + /*<>*/ } function replace_seq(tbl, i){ - function _y_(param){ - /*<>*/ var v = param[2], k = param[1]; - /*<>*/ return replace(tbl, k, v); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _y_, i); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return replace(tbl, k, v); + /*<>*/ }, + i); + /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var tbl = create(0, 16); - /*<>*/ replace_seq(tbl, i); - /*<>*/ return tbl; - /*<>*/ } + /*<>*/ replace_seq(tbl, i); + /*<>*/ return tbl; + /*<>*/ } /*<>*/ return [0, create, clear, @@ -23846,11 +26173,12 @@ function Make(H){ var equal = H[1]; function seeded_hash(seed, x){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (H[2], x); - /*<>*/ } + /*<>*/ } var include = MakeSeeded([0, equal, seeded_hash]), + _s_ = include[1], clear = include[2], reset = include[3], copy = include[4], @@ -23870,20 +26198,19 @@ to_seq_keys = include[18], to_seq_values = include[19], add_seq = include[20], - replace_seq = include[21], - _x_ = include[1]; + replace_seq = include[21]; function create(sz){ - /*<>*/ return /*<>*/ caml_call2 - (_x_, _d_, sz); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (_s_, _d_, sz); + /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var - tbl = create(16); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ var + tbl = /*<>*/ caml_call2(_s_, _d_, 16); + /*<>*/ /*<>*/ caml_call2 (replace_seq, tbl, i); - /*<>*/ return tbl; - /*<>*/ } - /*<>*/ return [0, + /*<>*/ return tbl; + /*<>*/ } + /*<>*/ return [0, create, clear, reset, @@ -23908,228 +26235,245 @@ of_seq]; } function hash(x){ - /*<>*/ return /*<>*/ caml_hash + /*<>*/ return /*<>*/ caml_hash (10, 100, 0, x); - /*<>*/ } + /*<>*/ } function hash_param(n1, n2, x){ - /*<>*/ return /*<>*/ caml_hash + /*<>*/ return /*<>*/ caml_hash (n1, n2, 0, x); - /*<>*/ } + /*<>*/ } function seeded_hash(seed, x){ - /*<>*/ return /*<>*/ caml_hash + /*<>*/ return /*<>*/ caml_hash (10, 100, seed, x); - /*<>*/ } + /*<>*/ } function key_index(h, key){ - /*<>*/ return 4 <= h.length - 1 - ? /*<>*/ caml_hash + /*<>*/ return 4 <= h.length - 1 + ? /*<>*/ caml_hash (10, 100, h[3], key) - & (h[2].length - 1 - 1 | 0) - : /*<>*/ caml_call1 + & (h[2].length - 2 | 0) + : /*<>*/ caml_call1 (Stdlib[1], cst_Hashtbl_unsupported_hash_t); - /*<>*/ } + /*<>*/ } function add(h, key, data){ - /*<>*/ var - /*<>*/ i = key_index(h, key), - /*<>*/ bucket = + /*<>*/ var + /*<>*/ i = key_index(h, key), + /*<>*/ bucket = [0, key, data, caml_check_bound(h[2], i)[1 + i]]; - /*<>*/ caml_check_bound(h[2], i)[1 + i] = bucket; + /*<>*/ caml_check_bound(h[2], i)[1 + i] = bucket; h[1] = h[1] + 1 | 0; - var _w_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; - return _w_ ? resize(key_index, h) : _w_; - /*<>*/ } + var _r_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + return _r_ ? resize(key_index, h) : _r_; + /*<>*/ } function remove(h, key){ - /*<>*/ var - /*<>*/ i = key_index(h, key), - /*<>*/ c = caml_check_bound(h[2], i)[1 + i], + /*<>*/ var + /*<>*/ i = key_index(h, key), + /*<>*/ c = caml_check_bound(h[2], i)[1 + i], prec$0 = 0, prec = c; for(;;){ - if(! prec) /*<>*/ return 0; + if(! prec) /*<>*/ return 0; var k = prec[1], next = prec[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(k, key)){ + /*<>*/ if + (0 === /*<>*/ caml_compare(k, key)){ h[1] = h[1] - 1 | 0; return prec$0 ? (prec$0[3] = next, 0) : (caml_check_bound(h[2], i)[1 + i] = next, 0); } - var prec$0 = prec, prec = next; + prec$0 = prec; + prec = next; } - /*<>*/ } + /*<>*/ } function find(h, key){ - /*<>*/ var - /*<>*/ _v_ = key_index(h, key), - /*<>*/ match = caml_check_bound(h[2], _v_)[1 + _v_]; + /*<>*/ var + /*<>*/ _q_ = key_index(h, key), + /*<>*/ match = caml_check_bound(h[2], _q_)[1 + _q_]; if(! match) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var k1 = match[1], d1 = match[2], next1 = match[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k1)) - /*<>*/ return d1; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k1)) + /*<>*/ return d1; if(! next1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var k2 = next1[1], d2 = next1[2], next2 = next1[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k2)) - /*<>*/ return d2; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k2)) + /*<>*/ return d2; if(! next2) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var k3 = next2[1], d3 = next2[2], next3 = next2[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k3)) - /*<>*/ return d3; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k3)) + /*<>*/ return d3; var param = next3; for(;;){ if(! param) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var k = param[1], data = param[2], next = param[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k)) - /*<>*/ return data; - var param = next; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k)) + /*<>*/ return data; + param = next; } - /*<>*/ } + /*<>*/ } function find_opt(h, key){ - /*<>*/ var - /*<>*/ _u_ = key_index(h, key), - /*<>*/ match = caml_check_bound(h[2], _u_)[1 + _u_]; - if(! match) /*<>*/ return 0; + /*<>*/ var + /*<>*/ _p_ = key_index(h, key), + /*<>*/ match = caml_check_bound(h[2], _p_)[1 + _p_]; + if(! match) /*<>*/ return 0; var k1 = match[1], d1 = match[2], next1 = match[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k1)) - /*<>*/ return [0, d1]; - if(! next1) /*<>*/ return 0; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k1)) + /*<>*/ return [0, d1]; + if(! next1) /*<>*/ return 0; var k2 = next1[1], d2 = next1[2], next2 = next1[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k2)) - /*<>*/ return [0, d2]; - if(! next2) /*<>*/ return 0; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k2)) + /*<>*/ return [0, d2]; + if(! next2) /*<>*/ return 0; var k3 = next2[1], d3 = next2[2], next3 = next2[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k3)) - /*<>*/ return [0, d3]; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k3)) + /*<>*/ return [0, d3]; var param = next3; for(;;){ - if(! param) /*<>*/ return 0; + if(! param) /*<>*/ return 0; var k = param[1], data = param[2], next = param[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(key, k)) - /*<>*/ return [0, data]; - var param = next; + /*<>*/ if + (0 === /*<>*/ caml_compare(key, k)) + /*<>*/ return [0, data]; + param = next; } - /*<>*/ } + /*<>*/ } function find_all(h, key){ - function find_in_bucket(param){ - /*<>*/ var param$0 = param; - /*<>*/ for(;;){ - if(! param$0) /*<>*/ return 0; - var k = param$0[1], data = param$0[2], next = param$0[3]; - /*<>*/ if - (0 === /*<>*/ caml_compare(k, key)) - /*<>*/ return [0, data, find_in_bucket(next)]; - var param$0 = next; - } - /*<>*/ } - /*<>*/ /*<>*/ var - _t_ = key_index(h, key); - /*<>*/ return find_in_bucket - (caml_check_bound(h[2], _t_)[1 + _t_]); - /*<>*/ } + /*<>*/ var + /*<>*/ _o_ = key_index(h, key), + param = caml_check_bound(h[2], _o_)[1 + _o_]; + /*<>*/ for(;;){ + if(! param) /*<>*/ return 0; + var k = param[1], data = param[2], next = param[3]; + /*<>*/ if + (0 === /*<>*/ caml_compare(k, key)) + break; + param = next; + } + /*<>*/ var + /*<>*/ block = [0, data, 24029], + dst = block, + offset = 1, + param$0 = next; + /*<>*/ for(;;){ + if(! param$0){ + dst[1 + offset] = 0; + /*<>*/ return block; + } + var k$0 = param$0[1], data$0 = param$0[2], next$0 = param$0[3]; + /*<>*/ if + (0 === /*<>*/ caml_compare(k$0, key)){ + /*<>*/ /*<>*/ var + dst$0 = [0, data$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + param$0 = next$0; + } + else + param$0 = next$0; + } + /*<>*/ } function replace(h, key, data){ - /*<>*/ var - /*<>*/ i = key_index(h, key), - /*<>*/ l = caml_check_bound(h[2], i)[1 + i], + /*<>*/ var + /*<>*/ i = key_index(h, key), + /*<>*/ l = caml_check_bound(h[2], i)[1 + i], slot = l; for(;;){ if(slot){ var k = slot[1], next = slot[3]; - /*<>*/ if - (0 !== /*<>*/ caml_compare(k, key)){var slot = next; continue;} + /*<>*/ if + (0 !== /*<>*/ caml_compare(k, key)){slot = next; continue;} slot[1] = key; slot[2] = data; - var _q_ = 0; + var _l_ = 0; } else - var _q_ = 1; - /*<>*/ if(_q_){ - /*<>*/ caml_check_bound(h[2], i)[1 + i] = [0, key, data, l]; + var _l_ = 1; + /*<>*/ if(_l_){ + /*<>*/ caml_check_bound(h[2], i)[1 + i] = [0, key, data, l]; h[1] = h[1] + 1 | 0; - var _r_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; - if(_r_) /*<>*/ return resize(key_index, h); - var _s_ = _r_; + var _m_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + if(_m_) /*<>*/ return resize(key_index, h); + var _n_ = _m_; } else - var _s_ = _q_; - return _s_; + var _n_ = _l_; + return _n_; } - /*<>*/ } + /*<>*/ } function mem(h, key){ - /*<>*/ var - /*<>*/ _p_ = key_index(h, key), - param = caml_check_bound(h[2], _p_)[1 + _p_]; - /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ _k_ = key_index(h, key), + param = caml_check_bound(h[2], _k_)[1 + _k_]; + for(;;){ if(! param) /*<>*/ return 0; var k = param[1], next = param[3], - _o_ = 0 === /*<>*/ caml_compare(k, key) ? 1 : 0; - if(_o_) return _o_; - var param = next; + _j_ = 0 === /*<>*/ caml_compare(k, key) ? 1 : 0; + if(_j_) return _j_; + param = next; } - /*<>*/ } + /*<>*/ } function add_seq(tbl, i){ - function _n_(param){ - /*<>*/ var v = param[2], k = param[1]; - /*<>*/ return add(tbl, k, v); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _n_, i); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return add(tbl, k, v); + /*<>*/ }, + i); + /*<>*/ } function replace_seq(tbl, i){ - function _m_(param){ - /*<>*/ var v = param[2], k = param[1]; - /*<>*/ return replace(tbl, k, v); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _m_, i); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return replace(tbl, k, v); + /*<>*/ }, + i); + /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var tbl = create(0, 16); - /*<>*/ replace_seq(tbl, i); - /*<>*/ return tbl; - /*<>*/ } + /*<>*/ replace_seq(tbl, i); + /*<>*/ return tbl; + /*<>*/ } function rebuild(opt, h){ - /*<>*/ if(opt) - var sth = opt[1], random = sth; - else - var - random = - /*<>*/ caml_call1(Stdlib_Atomic[2], randomized); - /*<>*/ /*<>*/ var - s = power_2_above(16, h[2].length - 1); - /*<>*/ if(random) - /*<>*/ var - /*<>*/ _g_ = - /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), - seed = /*<>*/ caml_call1(Stdlib_Random[15][4], _g_); + /*<>*/ var + random = + opt + ? opt[1] + : /*<>*/ caml_call1(Stdlib_Atomic[3], randomized), + /*<>*/ s = power_2_above(16, h[2].length - 1); + /*<>*/ if(random) + /*<>*/ var + /*<>*/ _g_ = + /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), + seed = /*<>*/ caml_call1(Stdlib_Random[19][4], _g_); else var seed = 4 <= h.length - 1 ? h[3] : 0; - /*<>*/ var + /*<>*/ var _h_ = 4 <= h.length - 1 ? h[4] : s, - /*<>*/ h$0 = - [0, h[1], /*<>*/ caml_make_vect(s, 0), seed, _h_], - _i_ = h$0[2], - _j_ = h[2], - _k_ = 0; - /*<>*/ insert_all_buckets - (function(_l_){ /*<>*/ return key_index(h$0, _l_);}, _k_, _j_, _i_); - /*<>*/ return h$0; - /*<>*/ } + /*<>*/ h$0 = + [0, h[1], /*<>*/ caml_make_vect(s, 0), seed, _h_]; + /*<>*/ insert_all_buckets + (function(_i_){ /*<>*/ return key_index(h$0, _i_);}, 0, h[2], h$0[2]); + /*<>*/ return h$0; + } var Stdlib_Hashtbl = [0, @@ -24194,6 +26538,11 @@ return (f.l >= 0 ? f.l : f.l = f.length) == 3 ? f(a0, a1, a2) : runtime.caml_call_gen(f, [a0, a1, a2]); + } + /*<>*/ function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); } /*<>*/ function caml_call5(f, a0, a1, a2, a3, a4){ return (f.l >= 0 ? f.l : f.l = f.length) == 5 @@ -24207,33 +26556,33 @@ Stdlib_Int = global_data.Stdlib__Int, Stdlib_Array = global_data.Stdlib__Array, Stdlib_Obj = global_data.Stdlib__Obj, - cst_Weak_Make_hash_bucket_cann = "Weak.Make: hash bucket cannot grow more", - cst_Weak_fill = "Weak.fill", - cst_Weak_blit = "Weak.blit", - cst_Weak_check = "Weak.check", - cst_Weak_get_copy = "Weak.get_copy", - cst_Weak_get = "Weak.get", + cst_Weak_create = "Weak.create", cst_Weak_set = "Weak.set", - cst_Weak_create = "Weak.create"; + cst_Weak_get = "Weak.get", + cst_Weak_get_copy = "Weak.get_copy", + cst_Weak_check = "Weak.check", + cst_Weak_blit = "Weak.blit", + cst_Weak_fill = "Weak.fill", + cst_Weak_Make_hash_bucket_cann = "Weak.Make: hash bucket cannot grow more"; function create(l){ /*<>*/ var - _W_ = 0 <= l ? 1 : 0, - _X_ = _W_ ? l <= Stdlib_Obj[24][15] ? 1 : 0 : _W_; - if(1 - _X_) + _J_ = 0 <= l ? 1 : 0, + _K_ = _J_ ? l <= Stdlib_Obj[23][15] ? 1 : 0 : _J_; + if(1 - _K_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Weak_create); /*<>*/ return /*<>*/ runtime.caml_weak_create (l); /*<>*/ } function length(x){ - /*<>*/ return x.length - 1 - 2 | 0; + /*<>*/ return x.length - 3 | 0; /*<>*/ } function raise_if_invalid_offset(e, o, msg){ /*<>*/ var - _T_ = 0 <= o ? 1 : 0, - _U_ = _T_ ? o < length(e) ? 1 : 0 : _T_, - _V_ = 1 - _U_; - return _V_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _V_; + _G_ = 0 <= o ? 1 : 0, + _H_ = _G_ ? o < length(e) ? 1 : 0 : _G_, + _I_ = 1 - _H_; + return _I_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _I_; /*<>*/ } function set(e, o, x){ /*<>*/ raise_if_invalid_offset(e, o, cst_Weak_set); @@ -24266,13 +26615,13 @@ 0 <= o1 && (length(e1) - l | 0) >= o1 && 0 <= o2 && (length(e2) - l | 0) >= o2){ var - _R_ = 0 !== l ? 1 : 0, - _S_ = - _R_ + _E_ = 0 !== l ? 1 : 0, + _F_ = + _E_ ? /*<>*/ runtime.caml_ephe_blit_key (e1, o1, e2, o2, l) - : _R_; - /*<>*/ return _S_; + : _E_; + /*<>*/ return _F_; } /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Weak_blit); @@ -24280,14 +26629,14 @@ function fill(ar, ofs, len, x){ /*<>*/ if (0 <= ofs && 0 <= len && (length(ar) - len | 0) >= ofs){ - var _P_ = (ofs + len | 0) - 1 | 0; - if(_P_ >= ofs){ + var _C_ = (ofs + len | 0) - 1 | 0; + if(_C_ >= ofs){ var i = ofs; for(;;){ /*<>*/ set(ar, i, x); - /*<>*/ /*<>*/ var _Q_ = i + 1 | 0; - if(_P_ !== i){var i = _Q_; continue;} - break; + /*<>*/ /*<>*/ var _D_ = i + 1 | 0; + if(_C_ === i) break; + i = _D_; } } return 0; @@ -24315,16 +26664,16 @@ /*<>*/ } function clear(t){ /*<>*/ var - _N_ = t[1].length - 1 - 1 | 0, - /*<>*/ _M_ = 0; - if(_N_ >= 0){ - var i = _M_; + _A_ = t[1].length - 2 | 0, + /*<>*/ _z_ = 0; + if(_A_ >= 0){ + var i = _z_; for(;;){ /*<>*/ caml_check_bound(t[1], i)[1 + i] = emptybucket; /*<>*/ caml_check_bound(t[2], i)[1 + i] = [0]; - /*<>*/ /*<>*/ var _O_ = i + 1 | 0; - if(_N_ !== i){var i = _O_; continue;} - break; + /*<>*/ /*<>*/ var _B_ = i + 1 | 0; + if(_A_ === i) break; + i = _B_; } } t[3] = limit; @@ -24332,71 +26681,73 @@ return 0; /*<>*/ } function fold(f, t, init){ - /*<>*/ var _K_ = t[1], i = 0; - /*<>*/ function _L_(b, accu$1){ - var i$0 = i, accu = accu$1; - /*<>*/ for(;;){ - if(length(b) <= i$0) /*<>*/ return accu; - /*<>*/ /*<>*/ var - match = get(b, i$0); - if(match){ - /*<>*/ var - v = match[1], - /*<>*/ accu$0 = - /*<>*/ caml_call2(f, v, accu), - i$1 = i$0 + 1 | 0, - i$0 = i$1, - accu = accu$0; - continue; - } - var i$2 = i$0 + 1 | 0, i$0 = i$2; - } - } + /*<>*/ var i = 0; /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Array[17], _L_, _K_, init); + (Stdlib_Array[20], + function(b, accu$1){ + var i$0 = i, accu = accu$1; + /*<>*/ for(;;){ + if(length(b) <= i$0) /*<>*/ return accu; + /*<>*/ /*<>*/ var + match = get(b, i$0); + if(match){ + /*<>*/ var + v = match[1], + /*<>*/ accu$0 = + /*<>*/ caml_call2(f, v, accu), + i$1 = i$0 + 1 | 0; + i$0 = i$1; + accu = accu$0; + } + else{var i$2 = i$0 + 1 | 0; i$0 = i$2;} + } + }, + t[1], + init); /*<>*/ } function iter(f, t){ - /*<>*/ var _I_ = t[1], i = 0; - /*<>*/ function _J_(b){ - var i$0 = i; - /*<>*/ for(;;){ - if(length(b) <= i$0) /*<>*/ return 0; - /*<>*/ /*<>*/ var - match = get(b, i$0); - if(match){ - var v = match[1]; - /*<>*/ /*<>*/ caml_call1(f, v); - var i$1 = i$0 + 1 | 0, i$0 = i$1; - continue; - } - var i$2 = i$0 + 1 | 0, i$0 = i$2; - } - } + /*<>*/ var i = 0; /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[11], _J_, _I_); + (Stdlib_Array[12], + function(b){ + var i$0 = i; + /*<>*/ for(;;){ + if(length(b) <= i$0) /*<>*/ return 0; + /*<>*/ /*<>*/ var + match = get(b, i$0); + if(match){ + var v = match[1]; + /*<>*/ /*<>*/ caml_call1 + (f, v); + var i$1 = i$0 + 1 | 0; + i$0 = i$1; + } + else{var i$2 = i$0 + 1 | 0; i$0 = i$2;} + } + }, + t[1]); /*<>*/ } function count_bucket(i, b, accu){ /*<>*/ var i$0 = i, accu$0 = accu; /*<>*/ for(;;){ if(length(b) <= i$0) /*<>*/ return accu$0; /*<>*/ var - /*<>*/ _H_ = check(b, i$0) ? 1 : 0, - accu$1 = accu$0 + _H_ | 0, - i$1 = i$0 + 1 | 0, - i$0 = i$1, - accu$0 = accu$1; + /*<>*/ _y_ = check(b, i$0) ? 1 : 0, + accu$1 = accu$0 + _y_ | 0, + i$1 = i$0 + 1 | 0; + i$0 = i$1; + accu$0 = accu$1; } /*<>*/ } function count(t){ - /*<>*/ var - /*<>*/ _B_ = 0, - _C_ = t[1], - _D_ = 0; - /*<>*/ function _E_(_F_, _G_){ - /*<>*/ return count_bucket(_D_, _F_, _G_); - } + /*<>*/ var _v_ = 0; /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Array[17], _E_, _C_, _B_); + (Stdlib_Array[20], + function(_w_, _x_){ + /*<>*/ return count_bucket(_v_, _w_, _x_); + }, + t[1], + 0); /*<>*/ } function add_aux(t, setter, d, h, index){ /*<>*/ var @@ -24407,163 +26758,153 @@ /*<>*/ sz = length(bucket$0), i$3 = 0; /*<>*/ for(;;){ - if(sz > i$3){ - /*<>*/ if(check(bucket$0, i$3)){ - /*<>*/ var - /*<>*/ i$5 = i$3 + 1 | 0, - i$3 = i$5; - continue; - } + if(sz <= i$3) break; + /*<>*/ if(! check(bucket$0, i$3)){ /*<>*/ /*<>*/ caml_call3 (setter, bucket$0, i$3, d); /*<>*/ caml_check_bound(hashes, i$3)[1 + i$3] = h; /*<>*/ return 0; } - /*<>*/ /*<>*/ var - newsz = - /*<>*/ caml_call2 - (Stdlib_Int[10], - ((3 * sz | 0) / 2 | 0) + 3 | 0, - Stdlib_Sys[13] - 2 | 0); - if(newsz <= sz) - /*<>*/ /*<>*/ caml_call1 - (Stdlib[2], cst_Weak_Make_hash_bucket_cann); - /*<>*/ var - /*<>*/ newbucket$0 = create(newsz), - /*<>*/ newhashes = - /*<>*/ caml_make_vect(newsz, 0); - /*<>*/ blit(bucket$0, 0, newbucket$0, 0, sz); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], hashes, 0, newhashes, 0, sz); - /*<>*/ /*<>*/ caml_call3 - (setter, newbucket$0, sz, d); - /*<>*/ caml_check_bound(newhashes, sz)[1 + sz] = h; - /*<>*/ caml_check_bound(t[1], index)[1 + index] = newbucket$0; - /*<>*/ caml_check_bound(t[2], index)[1 + index] = newhashes; - var _x_ = sz <= t[3] ? 1 : 0, _y_ = _x_ ? t[3] < newsz ? 1 : 0 : _x_; - if(_y_){ - t[4] = t[4] + 1 | 0; - var i$4 = 0; - for(;;){ - /*<>*/ var - _n_ = t[5], - /*<>*/ bucket = caml_check_bound(t[1], _n_)[1 + _n_], - /*<>*/ _o_ = t[5], - /*<>*/ hbucket = - caml_check_bound(t[2], _o_)[1 + _o_], - /*<>*/ len = length(bucket), - prev_len = (((len - 3 | 0) * 2 | 0) + 2 | 0) / 3 | 0, - /*<>*/ live = count_bucket(0, bucket, 0); - if(live <= prev_len){ - /*<>*/ var - /*<>*/ j$2 = length(bucket) - 1 | 0, - i$0 = 0, - j = j$2; - /*<>*/ for(;;){ - if(prev_len <= j){ - /*<>*/ if(check(bucket, i$0)){ - var i$1 = i$0 + 1 | 0, i$0 = i$1; - continue; - } - /*<>*/ if(check(bucket, j)){ - /*<>*/ blit(bucket, j, bucket, i$0, 1); - /*<>*/ /*<>*/ var - _p_ = caml_check_bound(hbucket, j)[1 + j]; - /*<>*/ caml_check_bound(hbucket, i$0)[1 + i$0] = _p_; - /*<>*/ var - /*<>*/ j$0 = j - 1 | 0, - i$2 = i$0 + 1 | 0, - i$0 = i$2, - j = j$0; - continue; - } - /*<>*/ var - /*<>*/ j$1 = j - 1 | 0, - j = j$1; - continue; - } - if(0 === prev_len){ - var _q_ = t[5]; - /*<>*/ caml_check_bound(t[1], _q_)[1 + _q_] = emptybucket; - var _r_ = t[5]; - /*<>*/ caml_check_bound(t[2], _r_)[1 + _r_] = [0]; - } - else{ - /*<>*/ /*<>*/ var - newbucket = create(prev_len); - /*<>*/ blit(bucket, 0, newbucket, 0, prev_len); - var _u_ = t[5]; - /*<>*/ caml_check_bound(t[1], _u_)[1 + _u_] = newbucket; - /*<>*/ var - /*<>*/ _v_ = - /*<>*/ caml_call3 - (Stdlib_Array[5], hbucket, 0, prev_len), - _w_ = t[5]; - /*<>*/ caml_check_bound(t[2], _w_)[1 + _w_] = _v_; - } - var - _s_ = t[3] < len ? 1 : 0, - _t_ = _s_ ? prev_len <= t[3] ? 1 : 0 : _s_; - if(_t_) t[4] = t[4] - 1 | 0; - break; + /*<>*/ /*<>*/ var i$5 = i$3 + 1 | 0; + i$3 = i$5; + } + /*<>*/ /*<>*/ var + newsz = + /*<>*/ caml_call2 + (Stdlib_Int[10], + ((3 * sz | 0) / 2 | 0) + 3 | 0, + Stdlib_Sys[13] - 2 | 0); + if(newsz <= sz) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[2], cst_Weak_Make_hash_bucket_cann); + /*<>*/ var + /*<>*/ newbucket$0 = create(newsz), + /*<>*/ newhashes = + /*<>*/ caml_make_vect(newsz, 0); + /*<>*/ blit(bucket$0, 0, newbucket$0, 0, sz); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], hashes, 0, newhashes, 0, sz); + /*<>*/ /*<>*/ caml_call3 + (setter, newbucket$0, sz, d); + /*<>*/ caml_check_bound(newhashes, sz)[1 + sz] = h; + /*<>*/ caml_check_bound(t[1], index)[1 + index] = newbucket$0; + /*<>*/ caml_check_bound(t[2], index)[1 + index] = newhashes; + var _r_ = sz <= t[3] ? 1 : 0, _s_ = _r_ ? t[3] < newsz ? 1 : 0 : _r_; + if(_s_){ + t[4] = t[4] + 1 | 0; + var i$4 = 0; + for(;;){ + /*<>*/ var + _h_ = t[5], + /*<>*/ bucket = caml_check_bound(t[1], _h_)[1 + _h_], + /*<>*/ _i_ = t[5], + /*<>*/ hbucket = caml_check_bound(t[2], _i_)[1 + _i_], + /*<>*/ len = length(bucket), + prev_len = (((len - 3 | 0) * 2 | 0) + 2 | 0) / 3 | 0, + /*<>*/ live = count_bucket(0, bucket, 0); + if(live <= prev_len){ + /*<>*/ var + /*<>*/ j$2 = length(bucket) - 1 | 0, + i$0 = 0, + j = j$2; + /*<>*/ for(;;){ + if(prev_len > j) break; + /*<>*/ if(check(bucket, i$0)){ + var i$1 = i$0 + 1 | 0; + i$0 = i$1; + } + else if(check(bucket, j)){ + /*<>*/ blit(bucket, j, bucket, i$0, 1); + /*<>*/ /*<>*/ var + _j_ = caml_check_bound(hbucket, j)[1 + j]; + /*<>*/ caml_check_bound(hbucket, i$0)[1 + i$0] = _j_; + /*<>*/ var + /*<>*/ j$0 = j - 1 | 0, + i$2 = i$0 + 1 | 0; + i$0 = i$2; + j = j$0; + } + else{ + /*<>*/ /*<>*/ var j$1 = j - 1 | 0; + j = j$1; } } - t[5] = caml_mod(t[5] + 1 | 0, t[1].length - 1); - /*<>*/ /*<>*/ var _A_ = i$4 + 1 | 0; - if(2 !== i$4){var i$4 = _A_; continue;} - break; + if(0 === prev_len){ + var _k_ = t[5]; + /*<>*/ caml_check_bound(t[1], _k_)[1 + _k_] = emptybucket; + var _l_ = t[5]; + /*<>*/ caml_check_bound(t[2], _l_)[1 + _l_] = [0]; + } + else{ + /*<>*/ /*<>*/ var + newbucket = create(prev_len); + /*<>*/ blit(bucket, 0, newbucket, 0, prev_len); + var _o_ = t[5]; + /*<>*/ caml_check_bound(t[1], _o_)[1 + _o_] = newbucket; + /*<>*/ var + /*<>*/ _p_ = + /*<>*/ caml_call3 + (Stdlib_Array[6], hbucket, 0, prev_len), + _q_ = t[5]; + /*<>*/ caml_check_bound(t[2], _q_)[1 + _q_] = _p_; + } + var + _m_ = t[3] < len ? 1 : 0, + _n_ = _m_ ? prev_len <= t[3] ? 1 : 0 : _m_; + if(_n_) t[4] = t[4] - 1 | 0; } + t[5] = caml_mod(t[5] + 1 | 0, t[1].length - 1); + /*<>*/ /*<>*/ var _u_ = i$4 + 1 | 0; + if(2 === i$4) break; + i$4 = _u_; } - var _z_ = ((t[1].length - 1) / 2 | 0) < t[4] ? 1 : 0; - if(! _z_) return _z_; - /*<>*/ var - oldlen = t[1].length - 1, - /*<>*/ newlen = - /*<>*/ caml_call2 - (Stdlib_Int[10], ((3 * oldlen | 0) / 2 | 0) + 3 | 0, Stdlib_Sys[13]); - if(oldlen < newlen){ - /*<>*/ var - /*<>*/ newt = create$0(newlen), - _l_ = t[1], - i = 0, - /*<>*/ _m_ = - function(j, ob){ - var oi = i; - /*<>*/ for(;;){ - if(length(ob) <= oi) /*<>*/ return 0; - if(check(ob, oi)){ - /*<>*/ var - /*<>*/ oh = caml_check_bound(t[2], j)[1 + j], - setter$0 = - function(oi){ - function setter(nb, ni, param){ - /*<>*/ return blit(ob, oi, nb, ni, 1); - /*<>*/ } - return setter; - }, - setter = setter$0(oi), - /*<>*/ h = caml_check_bound(oh, oi)[1 + oi]; - /*<>*/ add_aux - (newt, setter, 0, h, get_index(newt, h)); - var i$0 = oi + 1 | 0, oi = i$0; - continue; - } - var i$1 = oi + 1 | 0, oi = i$1; - } - }; - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[12], _m_, _l_); - t[1] = newt[1]; - t[2] = newt[2]; - t[3] = newt[3]; - t[4] = newt[4]; - t[5] = caml_mod(t[5], newt[1].length - 1); - return 0; - } - t[3] = Stdlib[19]; - t[4] = 0; + } + var _t_ = ((t[1].length - 1) / 2 | 0) < t[4] ? 1 : 0; + if(! _t_) return _t_; + /*<>*/ var + oldlen = t[1].length - 1, + /*<>*/ newlen = + /*<>*/ caml_call2 + (Stdlib_Int[10], ((3 * oldlen | 0) / 2 | 0) + 3 | 0, Stdlib_Sys[13]); + if(oldlen < newlen){ + /*<>*/ var + /*<>*/ newt = create$0(newlen), + i = 0; + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Array[13], + function(j, ob){ + var oi = i; + /*<>*/ for(;;){ + if(length(ob) <= oi) /*<>*/ return 0; + if(check(ob, oi)){ + /*<>*/ /*<>*/ var + oh = caml_check_bound(t[2], j)[1 + j]; + let oi$0 = oi; + /*<>*/ var + setter = + function(nb, ni, param){ + /*<>*/ return blit(ob, oi$0, nb, ni, 1); + /*<>*/ }, + /*<>*/ h = caml_check_bound(oh, oi)[1 + oi]; + /*<>*/ add_aux + (newt, setter, 0, h, get_index(newt, h)); + var i$0 = oi + 1 | 0; + oi = i$0; + } + else{var i$1 = oi + 1 | 0; oi = i$1;} + } + }, + t[1]); + t[1] = newt[1]; + t[2] = newt[2]; + t[3] = newt[3]; + t[4] = newt[4]; + t[5] = caml_mod(t[5], newt[1].length - 1); return 0; } + t[3] = Stdlib[19]; + t[4] = 0; + return 0; /*<>*/ } function add(t, d){ /*<>*/ /*<>*/ var @@ -24571,211 +26912,151 @@ /*<>*/ return add_aux (t, set, [0, d], h, get_index(t, h)); /*<>*/ } - function find_or(t, d, ifnotfound){ - /*<>*/ var - /*<>*/ h = /*<>*/ caml_call1(H[2], d), - /*<>*/ index = get_index(t, h), - /*<>*/ bucket = + function find_aux(t, d, found, notfound){ + /*<>*/ var + /*<>*/ h = /*<>*/ caml_call1(H[2], d), + /*<>*/ index = get_index(t, h), + /*<>*/ bucket = caml_check_bound(t[1], index)[1 + index], - /*<>*/ hashes = + /*<>*/ hashes = caml_check_bound(t[2], index)[1 + index], - /*<>*/ sz = length(bucket), + /*<>*/ sz = length(bucket), i = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(sz <= i) - /*<>*/ return /*<>*/ caml_call2 - (ifnotfound, h, index); - if(h !== caml_check_bound(hashes, i)[1 + i]){ - /*<>*/ var - /*<>*/ i$2 = i + 1 | 0, - i = i$2; - continue; - } - /*<>*/ /*<>*/ var - match = get_copy(bucket, i); - if(match){ - var v = match[1]; - /*<>*/ if - ( /*<>*/ caml_call2(H[1], v, d)){ - /*<>*/ /*<>*/ var - match$0 = get(bucket, i); - if(match$0){var v$0 = match$0[1]; /*<>*/ return v$0;} - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - continue; + /*<>*/ return /*<>*/ caml_call2 + (notfound, h, index); + if(h === caml_check_bound(hashes, i)[1 + i]){ + /*<>*/ /*<>*/ var + opt = get(bucket, i); + if(opt){ + var v = opt[1]; + /*<>*/ if + ( /*<>*/ caml_call2(H[1], v, d)) + /*<>*/ return /*<>*/ caml_call4 + (found, bucket, i, opt, v); } + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + i = i$0; } - /*<>*/ var - /*<>*/ i$1 = i + 1 | 0, + else{ + /*<>*/ /*<>*/ var i$1 = i + 1 | 0; i = i$1; + } } - /*<>*/ } + /*<>*/ } + function find_opt(t, d){ + /*<>*/ return find_aux + (t, + d, + function(b, i, o, v){ + /*<>*/ return o; + /*<>*/ }, + function(h, i){ + /*<>*/ return 0; + /*<>*/ }); + /*<>*/ } function merge(t, d){ - /*<>*/ return find_or + /*<>*/ return find_aux (t, d, - function(h, index){ - /*<>*/ add_aux(t, set, [0, d], h, index); - /*<>*/ return d; - /*<>*/ }); - /*<>*/ } + function(b, i, o, v){ + /*<>*/ return v; + /*<>*/ }, + function(h, i){ + /*<>*/ add_aux(t, set, [0, d], h, i); + /*<>*/ return d; + /*<>*/ }); + /*<>*/ } function find(t, d){ - /*<>*/ return find_or + /*<>*/ return find_aux (t, d, - function(h, index){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + function(b, i, o, v){ + /*<>*/ return v; + /*<>*/ }, + function(h, i){ + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); - /*<>*/ }); - /*<>*/ } - function find_opt(t, d){ - /*<>*/ var - /*<>*/ h = /*<>*/ caml_call1(H[2], d), - /*<>*/ index = get_index(t, h), - /*<>*/ bucket = - caml_check_bound(t[1], index)[1 + index], - /*<>*/ hashes = - caml_check_bound(t[2], index)[1 + index], - /*<>*/ sz = length(bucket), - i = 0; - /*<>*/ for(;;){ - if(sz <= i) /*<>*/ return 0; - if(h !== caml_check_bound(hashes, i)[1 + i]){ - /*<>*/ var - /*<>*/ i$2 = i + 1 | 0, - i = i$2; - continue; - } - /*<>*/ /*<>*/ var - match = get_copy(bucket, i); - if(match){ - var v = match[1]; - /*<>*/ if - ( /*<>*/ caml_call2(H[1], v, d)){ - /*<>*/ /*<>*/ var - v$0 = get(bucket, i); - if(v$0) /*<>*/ return v$0; - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - continue; - } - } - /*<>*/ var - /*<>*/ i$1 = i + 1 | 0, - i = i$1; - } - /*<>*/ } - function find_shadow(t, d, iffound, ifnotfound){ - /*<>*/ var - /*<>*/ h = /*<>*/ caml_call1(H[2], d), - /*<>*/ index = get_index(t, h), - /*<>*/ bucket = - caml_check_bound(t[1], index)[1 + index], - /*<>*/ hashes = - caml_check_bound(t[2], index)[1 + index], - /*<>*/ sz = length(bucket), - i = 0; - /*<>*/ for(;;){ - if(sz <= i) return ifnotfound; - if(h !== caml_check_bound(hashes, i)[1 + i]){ - /*<>*/ var - /*<>*/ i$1 = i + 1 | 0, - i = i$1; - continue; - } - /*<>*/ /*<>*/ var - match = get_copy(bucket, i); - if(match){ - var v = match[1]; - /*<>*/ if - ( /*<>*/ caml_call2(H[1], v, d)) - /*<>*/ return /*<>*/ caml_call2 - (iffound, bucket, i); - } - /*<>*/ var - /*<>*/ i$0 = i + 1 | 0, - i = i$0; - } - /*<>*/ } + /*<>*/ }); + /*<>*/ } function remove(t, d){ - /*<>*/ /*<>*/ var _k_ = 0; - /*<>*/ return find_shadow + /*<>*/ return find_aux (t, d, - function(w, i){ - /*<>*/ return set(w, i, 0); - /*<>*/ }, - _k_); - /*<>*/ } + function(b, i, o, v){ + /*<>*/ return set(b, i, 0); + /*<>*/ }, + function(h, i){ + /*<>*/ return 0; + /*<>*/ }); + /*<>*/ } function mem(t, d){ - /*<>*/ /*<>*/ var _j_ = 0; - /*<>*/ return find_shadow + /*<>*/ return find_aux (t, d, - function(w, i){ - /*<>*/ return 1; - /*<>*/ }, - _j_); - /*<>*/ } + function(b, i, o, v){ + /*<>*/ return 1; + /*<>*/ }, + function(h, i){ + /*<>*/ return 0; + /*<>*/ }); + /*<>*/ } function find_all(t, d){ - /*<>*/ var - /*<>*/ h = /*<>*/ caml_call1(H[2], d), - /*<>*/ index = get_index(t, h), - /*<>*/ bucket = + /*<>*/ var + /*<>*/ h = /*<>*/ caml_call1(H[2], d), + /*<>*/ index = get_index(t, h), + /*<>*/ bucket = caml_check_bound(t[1], index)[1 + index], - /*<>*/ hashes = + /*<>*/ hashes = caml_check_bound(t[2], index)[1 + index], - /*<>*/ sz = length(bucket), + /*<>*/ sz = length(bucket), i = 0, accu = 0; - /*<>*/ for(;;){ - if(sz <= i) /*<>*/ return accu; - if(h !== caml_check_bound(hashes, i)[1 + i]){var i$3 = i + 1 | 0, i = i$3; continue;} - /*<>*/ /*<>*/ var - match = get_copy(bucket, i); - if(match){ - var v = match[1]; - /*<>*/ if - ( /*<>*/ caml_call2(H[1], v, d)){ - /*<>*/ /*<>*/ var - match$0 = get(bucket, i); - if(match$0){ - /*<>*/ var - v$0 = match$0[1], - /*<>*/ accu$0 = [0, v$0, accu], - /*<>*/ i$0 = i + 1 | 0, - i = i$0, - accu = accu$0; + /*<>*/ for(;;){ + if(sz <= i) /*<>*/ return accu; + if(h === caml_check_bound(hashes, i)[1 + i]){ + /*<>*/ /*<>*/ var + match = get(bucket, i); + if(match){ + var v = match[1]; + /*<>*/ if + ( /*<>*/ caml_call2(H[1], v, d)){ + /*<>*/ var + /*<>*/ accu$0 = [0, v, accu], + /*<>*/ i$0 = i + 1 | 0; + i = i$0; + accu = accu$0; continue; } - var i$1 = i + 1 | 0, i = i$1; - continue; } + var i$1 = i + 1 | 0; + i = i$1; } - var i$2 = i + 1 | 0, i = i$2; + else{var i$2 = i + 1 | 0; i = i$2;} } - /*<>*/ } + /*<>*/ } function stats(t){ - /*<>*/ var + /*<>*/ var len = t[1].length - 1, - /*<>*/ lens = - /*<>*/ caml_call2(Stdlib_Array[13], length, t[1]); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[30], runtime.caml_int_compare, lens); - var _a_ = 0; - function _b_(_i_, _h_){ /*<>*/ return _i_ + _h_ | 0;} - /*<>*/ var - /*<>*/ totlen = - /*<>*/ caml_call3(Stdlib_Array[15], _b_, _a_, lens), - /*<>*/ _c_ = len - 1 | 0, - _e_ = len / 2 | 0, - /*<>*/ _d_ = caml_check_bound(lens, _c_)[1 + _c_], - /*<>*/ _f_ = caml_check_bound(lens, _e_)[1 + _e_], - /*<>*/ _g_ = caml_check_bound(lens, 0)[1]; - /*<>*/ return [0, len, count(t), totlen, _g_, _f_, _d_]; - /*<>*/ } + /*<>*/ lens = + /*<>*/ caml_call2(Stdlib_Array[14], length, t[1]); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Array[35], runtime.caml_int_compare, lens); + /*<>*/ var + /*<>*/ totlen = + /*<>*/ caml_call3 + (Stdlib_Array[18], + function(_g_, _f_){ /*<>*/ return _g_ + _f_ | 0;}, + 0, + lens), + /*<>*/ _a_ = len - 1 | 0, + _c_ = len / 2 | 0, + /*<>*/ _b_ = caml_check_bound(lens, _a_)[1 + _a_], + /*<>*/ _d_ = caml_check_bound(lens, _c_)[1 + _c_], + /*<>*/ _e_ = caml_check_bound(lens, 0)[1]; + /*<>*/ return [0, len, count(t), totlen, _e_, _d_, _b_]; + /*<>*/ } /*<>*/ return [0, create$0, clear, @@ -24800,7 +27081,7 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Format -//# unitInfo: Requires: CamlinternalFormat, Stdlib, Stdlib__Buffer, Stdlib__Bytes, Stdlib__Domain, Stdlib__Int, Stdlib__List, Stdlib__Queue, Stdlib__Stack, Stdlib__String +//# unitInfo: Requires: CamlinternalFormat, Stdlib, Stdlib__Array, Stdlib__Buffer, Stdlib__Bytes, Stdlib__Domain, Stdlib__Int, Stdlib__List, Stdlib__Queue, Stdlib__Seq, Stdlib__Stack, Stdlib__String (function (globalThis){ "use strict"; @@ -24831,6 +27112,7 @@ : runtime.caml_call_gen(f, [a0, a1, a2, a3]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), cst$14 = ".", cst$11 = cst$15, @@ -24848,35 +27130,37 @@ cst$0 = cst$16, cst$1 = cst$16, cst$2 = cst$16, + _a_ = [0, cst$16, 0, cst$16], Stdlib_Queue = global_data.Stdlib__Queue, CamlinternalFormat = global_data.CamlinternalFormat, Stdlib = global_data.Stdlib, Stdlib_String = global_data.Stdlib__String, Stdlib_Domain = global_data.Stdlib__Domain, Stdlib_Buffer = global_data.Stdlib__Buffer, + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib_Array = global_data.Stdlib__Array, Stdlib_List = global_data.Stdlib__List, Stdlib_Stack = global_data.Stdlib__Stack, Stdlib_Int = global_data.Stdlib__Int, - Stdlib_Bytes = global_data.Stdlib__Bytes, - _f_ = [3, 0, 3], - cst_Format_pp_set_geometry = "Format.pp_set_geometry: ", - _e_ = [1, "max_indent < 2"], - _c_ = [1, "margin <= max_indent"], - _d_ = [0, 0], - _b_ = [0, cst$16], - _a_ = [0, cst$16, 0, cst$16], - cst_Stdlib_Format_String_tag = "Stdlib.Format.String_tag"; + Stdlib_Bytes = global_data.Stdlib__Bytes; function id(x){ /*<>*/ return x; /*<>*/ } /*<>*/ var - /*<>*/ String_tag = - [248, cst_Stdlib_Format_String_tag, runtime.caml_fresh_oo_id(0)], zero = 0, - unknown = -1; + unknown = -1, + /*<>*/ String_tag = + [248, "Stdlib.Format.String_tag", runtime.caml_fresh_oo_id(0)]; function pp_enqueue(state, token){ /*<>*/ state[13] = state[13] + token[3] | 0; return caml_call2(Stdlib_Queue[3], token, state[28]); /*<>*/ } - var pp_infinity = 1000000010; + var + pp_infinity = 1000000010, + _b_ = [0, cst$16], + _c_ = [1, "margin <= max_indent"], + _d_ = [1, "margin >= pp_infinity"], + _e_ = [0, 0], + _f_ = [1, "max_indent < 2"], + cst_Format_pp_set_geometry = "Format.pp_set_geometry: "; function pp_output_string(state, s){ /*<>*/ return caml_call3 (state[17], s, 0, caml_ml_string_length(s)); @@ -24889,14 +27173,14 @@ /*<>*/ state[9] = state[9] - size | 0; /*<>*/ pp_output_string(state, text); state[11] = 0; - return 0; + return; /*<>*/ } function format_string(state, s){ /*<>*/ /*<>*/ var - _bQ_ = /*<>*/ runtime.caml_string_notequal(s, cst$16); - /*<>*/ return _bQ_ + _a__ = s !== cst$16 ? 1 : 0; + /*<>*/ return _a__ ? format_pp_text(state, caml_ml_string_length(s), s) - : _bQ_; + : _a__; /*<>*/ } function break_new_line(state, param, width){ var after = param[3], offset = param[2], before = param[1]; @@ -24914,9 +27198,6 @@ (state[21], n); /*<>*/ return format_string(state, after); } - function break_line(state, width){ - /*<>*/ return break_new_line(state, _a_, width); - /*<>*/ } function break_same_line(state, param){ var after = param[3], width = param[2], before = param[1]; /*<>*/ format_string(state, before); @@ -24931,8 +27212,8 @@ case 0: /*<>*/ /*<>*/ var match$3 = - /*<>*/ caml_call1(Stdlib_Stack[7], state[3]); - if(! match$3) /*<>*/ return 0; + /*<>*/ caml_call1(Stdlib_Stack[8], state[3]); + if(! match$3) /*<>*/ return; /*<>*/ var tabs = match$3[1][1], /*<>*/ add_tab = @@ -24945,39 +27226,39 @@ : [0, x, add_tab(n, l)]; }; tabs[1] = add_tab(state[6] - state[9] | 0, tabs[1]); - return 0; + return; case 1: /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[5], state[2]); - /*<>*/ return 0; + /*<>*/ return; case 2: /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[5], state[3]); - /*<>*/ return 0; + /*<>*/ return; case 3: /*<>*/ /*<>*/ var match$4 = - /*<>*/ caml_call1(Stdlib_Stack[7], state[2]); + /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); if(! match$4) /*<>*/ return pp_output_newline(state); var width$0 = match$4[1][2]; - /*<>*/ return break_line(state, width$0); + /*<>*/ return break_new_line(state, _a_, width$0); case 4: - var _bO_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; - if(! _bO_) return _bO_; + var _a8_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; + if(! _a8_) return _a8_; /*<>*/ /*<>*/ var match$1 = /*<>*/ caml_call1(Stdlib_Queue[6], state[28]); - if(! match$1) /*<>*/ return 0; + if(! match$1) /*<>*/ return; var match$2 = match$1[1], size = match$2[1], length = match$2[3]; state[12] = state[12] - length | 0; state[9] = state[9] + size | 0; - return 0; + return; default: /*<>*/ /*<>*/ var match$5 = /*<>*/ caml_call1(Stdlib_Stack[5], state[5]); - if(! match$5) /*<>*/ return 0; + if(! match$5) /*<>*/ return; /*<>*/ var tag_name = match$5[1], /*<>*/ marker = @@ -24995,8 +27276,8 @@ /*<>*/ off = breaks[2], before = breaks[1], /*<>*/ match$6 = - /*<>*/ caml_call1(Stdlib_Stack[7], state[2]); - if(! match$6) /*<>*/ return 0; + /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); + if(! match$6) /*<>*/ return; var match$7 = match$6[1], width$1 = match$7[2], @@ -25039,8 +27320,8 @@ n = param[1], insertion_point = state[6] - state[9] | 0, /*<>*/ match$8 = - /*<>*/ caml_call1(Stdlib_Stack[7], state[3]); - if(! match$8) /*<>*/ return 0; + /*<>*/ caml_call1(Stdlib_Stack[8], state[3]); + if(! match$8) /*<>*/ return; /*<>*/ var tabs$0 = match$8[1][1], /*<>*/ match$9 = tabs$0[1]; @@ -25049,12 +27330,12 @@ /*<>*/ for(;;){ if(param$0){ var tail = param$0[2], head = param$0[1]; - if(insertion_point > head){var param$0 = tail; continue;} - var _bP_ = head; + if(insertion_point > head){param$0 = tail; continue;} + var _a9_ = head; } else - var _bP_ = first; - var tab = _bP_; + var _a9_ = first; + var tab = _a9_; break; } } @@ -25073,11 +27354,11 @@ if(state[8] < insertion_point$0){ /*<>*/ /*<>*/ var match = - /*<>*/ caml_call1(Stdlib_Stack[7], state[2]); + /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); if(match){ var match$0 = match[1], width = match$0[2], box_type = match$0[1]; if(state[9] < width && 3 >= box_type - 1 >>> 0) - /*<>*/ break_line(state, width); + /*<>*/ break_new_line(state, _a_, width); } else /*<>*/ pp_output_newline(state); @@ -25112,10 +27393,10 @@ length = match$0[3], token = match$0[2], pending_count = state[13] - state[12] | 0, - /*<>*/ _bM_ = 0 <= size ? 1 : 0, - /*<>*/ _bN_ = - _bM_ || (state[9] <= pending_count ? 1 : 0); - if(! _bN_) /*<>*/ return _bN_; + _a6_ = 0 <= size ? 1 : 0, + /*<>*/ _a7_ = + _a6_ || (state[9] <= pending_count ? 1 : 0); + if(! _a7_) /*<>*/ return _a7_; /*<>*/ /*<>*/ caml_call1 (Stdlib_Queue[5], state[28]); /*<>*/ /*<>*/ var @@ -25134,7 +27415,7 @@ /*<>*/ } function initialize_scan_stack(stack){ /*<>*/ /*<>*/ caml_call1 - (Stdlib_Stack[8], stack); + (Stdlib_Stack[9], stack); /*<>*/ /*<>*/ var queue_elem = [0, unknown, _b_, 0]; /*<>*/ return /*<>*/ caml_call2 @@ -25142,43 +27423,36 @@ /*<>*/ } function set_size(state, ty){ /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(Stdlib_Stack[7], state[1]); - if(! match) /*<>*/ return 0; + match = /*<>*/ caml_call1(Stdlib_Stack[8], state[1]); + if(! match) /*<>*/ return; /*<>*/ var match$0 = match[1], queue_elem = match$0[2], left_total = match$0[1], /*<>*/ size = queue_elem[1]; if(left_total < state[12]) return initialize_scan_stack(state[1]); - var _bI_ = queue_elem[2]; - if(typeof _bI_ !== "number") - switch(_bI_[0]){ + var _a5_ = queue_elem[2]; + if(typeof _a5_ !== "number") + switch(_a5_[0]){ case 3: - var - _bK_ = 1 - ty, - _bL_ = - _bK_ - ? (queue_elem - [1] - = state[13] + size | 0, - /*<>*/ caml_call1(Stdlib_Stack[5], state[1]), - 0) - : _bK_; - /*<>*/ return _bL_; + if(1 - ty){ + var x$0 = state[13] + size | 0; + queue_elem[1] = x$0; + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Stack[5], state[1]); + } + /*<>*/ return; case 1: case 2: - var - _bJ_ = - ty - ? (queue_elem - [1] - = state[13] + size | 0, - /*<>*/ caml_call1(Stdlib_Stack[5], state[1]), - 0) - : ty; - /*<>*/ return _bJ_; + if(ty){ + var x = state[13] + size | 0; + queue_elem[1] = x; + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Stack[5], state[1]); + } + /*<>*/ return; } - /*<>*/ return 0; + /*<>*/ return; /*<>*/ } function scan_push(state, b, token){ /*<>*/ pp_enqueue(state, token); @@ -25196,26 +27470,25 @@ /*<>*/ elem = [0, size, [3, indent, br_ty], 0]; /*<>*/ return scan_push(state, 0, elem); } - var _bH_ = state[14] === state[15] ? 1 : 0; - if(! _bH_) return _bH_; - var s = state[16]; - /*<>*/ return enqueue_string_as - (state, caml_ml_string_length(s), s); + var _a4_ = state[14] === state[15] ? 1 : 0; + if(! _a4_) return _a4_; + var s = state[16], x = caml_ml_string_length(s); + /*<>*/ return enqueue_string_as(state, x, s); /*<>*/ } function pp_close_box(state, param){ - /*<>*/ var _bF_ = 1 < state[14] ? 1 : 0; - if(_bF_){ + /*<>*/ var _a2_ = 1 < state[14] ? 1 : 0; + if(_a2_){ if(state[14] < state[15]){ /*<>*/ pp_enqueue(state, [0, zero, 1, 0]); /*<>*/ set_size(state, 1); /*<>*/ set_size(state, 0); } state[14] = state[14] - 1 | 0; - var _bG_ = 0; + var _a3_ = 0; } else - var _bG_ = _bF_; - return _bG_; + var _a3_ = _a2_; + return _a3_; /*<>*/ } function pp_open_stag(state, tag_name){ /*<>*/ if(state[22]){ @@ -25224,8 +27497,8 @@ /*<>*/ /*<>*/ caml_call1 (state[26], tag_name); } - var _bE_ = state[23]; - if(! _bE_) return _bE_; + var _a1_ = state[23]; + if(! _a1_) return _a1_; /*<>*/ /*<>*/ var token = [5, tag_name]; /*<>*/ return pp_enqueue(state, [0, zero, token, 0]); @@ -25233,8 +27506,8 @@ function pp_close_stag(state, param){ /*<>*/ if(state[23]) /*<>*/ pp_enqueue(state, [0, zero, 5, 0]); - var _bC_ = state[22]; - if(_bC_){ + var _aZ_ = state[22]; + if(_aZ_){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(Stdlib_Stack[5], state[4]); if(match){ @@ -25242,11 +27515,11 @@ /*<>*/ return /*<>*/ caml_call1 (state[27], tag_name); } - var _bD_ = 0; + var _a0_ = 0; } else - var _bD_ = _bC_; - /*<>*/ return _bD_; + var _a0_ = _aZ_; + /*<>*/ return _a0_; /*<>*/ } function pp_set_print_tags(state, b){ /*<>*/ state[22] = b; @@ -25287,52 +27560,52 @@ caml_call1(Stdlib_Queue[11], state[28]); /*<>*/ initialize_scan_stack(state[1]); /*<>*/ /*<>*/ caml_call1 - (Stdlib_Stack[8], state[2]); + (Stdlib_Stack[9], state[2]); /*<>*/ /*<>*/ caml_call1 - (Stdlib_Stack[8], state[3]); + (Stdlib_Stack[9], state[3]); /*<>*/ /*<>*/ caml_call1 - (Stdlib_Stack[8], state[4]); + (Stdlib_Stack[9], state[4]); /*<>*/ /*<>*/ caml_call1 - (Stdlib_Stack[8], state[5]); + (Stdlib_Stack[9], state[5]); state[10] = 0; state[14] = 0; state[9] = state[6]; /*<>*/ return pp_open_box_gen(state, 0, 3); /*<>*/ } - function pp_flush_queue(state, b){ - /*<>*/ var _bA_ = state[4]; - function _bB_(param){ - /*<>*/ return pp_close_stag(state, 0); - /*<>*/ } - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Stack[12], _bB_, _bA_); + function pp_flush_queue(state, end_with_newline){ + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Stack[13], + function(param){ + /*<>*/ return pp_close_stag(state, 0); + /*<>*/ }, + state[4]); /*<>*/ for(;;){ - if(1 < state[14]){ - /*<>*/ pp_close_box(state, 0); - continue; + if(1 >= state[14]){ + state[13] = pp_infinity; + /*<>*/ advance_left(state); + if(end_with_newline) /*<>*/ pp_output_newline(state); + /*<>*/ return pp_rinit(state); } - state[13] = pp_infinity; - /*<>*/ advance_left(state); - if(b) /*<>*/ pp_output_newline(state); - /*<>*/ return pp_rinit(state); + /*<>*/ pp_close_box(state, 0); } /*<>*/ } function pp_print_as_size(state, size, s){ - /*<>*/ var _bz_ = state[14] < state[15] ? 1 : 0; - return _bz_ ? enqueue_string_as(state, size, s) : _bz_; + /*<>*/ var _aY_ = state[14] < state[15] ? 1 : 0; + return _aY_ ? enqueue_string_as(state, size, s) : _aY_; /*<>*/ } function pp_print_as(state, isize, s){ /*<>*/ return pp_print_as_size(state, isize, s); /*<>*/ } function pp_print_string(state, s){ - /*<>*/ return pp_print_as - (state, caml_ml_string_length(s), s); + /*<>*/ var isize = caml_ml_string_length(s); + /*<>*/ return pp_print_as_size(state, isize, s); /*<>*/ } function pp_print_bytes(state, s){ - /*<>*/ return pp_print_as - (state, - runtime.caml_ml_bytes_length(s), - /*<>*/ caml_call1(Stdlib_Bytes[6], s)); + /*<>*/ var + /*<>*/ s$0 = + /*<>*/ caml_call1(Stdlib_Bytes[6], s), + isize = runtime.caml_ml_bytes_length(s); + /*<>*/ return pp_print_as_size(state, isize, s$0); /*<>*/ } function pp_print_int(state, i){ /*<>*/ return pp_print_string @@ -25347,216 +27620,217 @@ (state, /*<>*/ caml_call1(Stdlib[30], b)); /*<>*/ } function pp_print_char(state, c){ - /*<>*/ return pp_print_as - (state, - 1, - /*<>*/ caml_call2(Stdlib_String[1], 1, c)); + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call2(Stdlib_String[1], 1, c); + /*<>*/ return pp_print_as_size(state, 1, s); /*<>*/ } + function pp_print_nothing(state, param){ /*<>*/ return 0; + /*<>*/ } function pp_open_hbox(state, param){ - /*<>*/ return pp_open_box_gen(state, 0, 0); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, 0, 0); + /*<>*/ } function pp_open_vbox(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 1); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 1); + /*<>*/ } function pp_open_hvbox(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 2); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 2); + /*<>*/ } function pp_open_hovbox(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 3); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 3); + /*<>*/ } function pp_open_box(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 4); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 4); + /*<>*/ } function pp_print_newline(state, param){ - /*<>*/ pp_flush_queue(state, 1); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ pp_flush_queue(state, 1); + /*<>*/ return /*<>*/ caml_call1 (state[18], 0); - /*<>*/ } + /*<>*/ } function pp_print_flush(state, param){ - /*<>*/ pp_flush_queue(state, 0); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ pp_flush_queue(state, 0); + /*<>*/ return /*<>*/ caml_call1 (state[18], 0); - /*<>*/ } + /*<>*/ } function pp_force_newline(state, param){ - /*<>*/ var _by_ = state[14] < state[15] ? 1 : 0; - return _by_ ? enqueue_advance(state, [0, zero, 3, 0]) : _by_; - /*<>*/ } + /*<>*/ var _aX_ = state[14] < state[15] ? 1 : 0; + return _aX_ ? enqueue_advance(state, [0, zero, 3, 0]) : _aX_; + /*<>*/ } function pp_print_if_newline(state, param){ - /*<>*/ var _bx_ = state[14] < state[15] ? 1 : 0; - return _bx_ ? enqueue_advance(state, [0, zero, 4, 0]) : _bx_; - /*<>*/ } + /*<>*/ var _aW_ = state[14] < state[15] ? 1 : 0; + return _aW_ ? enqueue_advance(state, [0, zero, 4, 0]) : _aW_; + /*<>*/ } function pp_print_custom_break(state, fits, breaks){ - /*<>*/ var + /*<>*/ var after = fits[3], width = fits[2], before = fits[1], - _bw_ = state[14] < state[15] ? 1 : 0; - if(! _bw_) return _bw_; - /*<>*/ var + _aV_ = state[14] < state[15] ? 1 : 0; + if(! _aV_) return _aV_; + /*<>*/ var size = - state[13] | 0, - /*<>*/ token = [1, fits, breaks], + /*<>*/ token = [1, fits, breaks], length = (caml_ml_string_length(before) + width | 0) - + /*<>*/ caml_ml_string_length(after) + + /*<>*/ caml_ml_string_length(after) | 0, - /*<>*/ elem = [0, size, token, length]; - /*<>*/ return scan_push(state, 1, elem); - /*<>*/ } + /*<>*/ elem = [0, size, token, length]; + /*<>*/ return scan_push(state, 1, elem); + /*<>*/ } function pp_print_break(state, width, offset){ - /*<>*/ return pp_print_custom_break + /*<>*/ return pp_print_custom_break (state, [0, cst$6, width, cst$5], [0, cst$4, offset, cst$3]); - /*<>*/ } + /*<>*/ } function pp_print_space(state, param){ - /*<>*/ return pp_print_break(state, 1, 0); - /*<>*/ } + /*<>*/ return pp_print_break(state, 1, 0); + /*<>*/ } function pp_print_cut(state, param){ - /*<>*/ return pp_print_break(state, 0, 0); - /*<>*/ } + /*<>*/ return pp_print_break(state, 0, 0); + /*<>*/ } function pp_open_tbox(state, param){ - /*<>*/ state[14] = state[14] + 1 | 0; - var _bv_ = state[14] < state[15] ? 1 : 0; - if(! _bv_) return _bv_; - /*<>*/ /*<>*/ var + /*<>*/ state[14] = state[14] + 1 | 0; + var _aU_ = state[14] < state[15] ? 1 : 0; + if(! _aU_) return _aU_; + /*<>*/ /*<>*/ var elem = [0, zero, [4, [0, [0, 0]]], 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_close_tbox(state, param){ - /*<>*/ var _bs_ = 1 < state[14] ? 1 : 0; - if(_bs_){ - var _bt_ = state[14] < state[15] ? 1 : 0; - if(_bt_){ - /*<>*/ /*<>*/ var + /*<>*/ var _aR_ = 1 < state[14] ? 1 : 0; + if(_aR_){ + var _aS_ = state[14] < state[15] ? 1 : 0; + if(_aS_){ + /*<>*/ /*<>*/ var elem = [0, zero, 2, 0]; - /*<>*/ enqueue_advance(state, elem); + /*<>*/ enqueue_advance(state, elem); state[14] = state[14] - 1 | 0; - var _bu_ = 0; + var _aT_ = 0; } else - var _bu_ = _bt_; + var _aT_ = _aS_; } else - var _bu_ = _bs_; - return _bu_; - /*<>*/ } + var _aT_ = _aR_; + return _aT_; + /*<>*/ } function pp_print_tbreak(state, width, offset){ - /*<>*/ var _br_ = state[14] < state[15] ? 1 : 0; - if(! _br_) return _br_; - /*<>*/ var + /*<>*/ var _aQ_ = state[14] < state[15] ? 1 : 0; + if(! _aQ_) return _aQ_; + /*<>*/ var size = - state[13] | 0, - /*<>*/ elem = [0, size, [2, width, offset], width]; - /*<>*/ return scan_push(state, 1, elem); - /*<>*/ } + /*<>*/ elem = [0, size, [2, width, offset], width]; + /*<>*/ return scan_push(state, 1, elem); + /*<>*/ } function pp_print_tab(state, param){ - /*<>*/ return pp_print_tbreak(state, 0, 0); - /*<>*/ } + /*<>*/ return pp_print_tbreak(state, 0, 0); + /*<>*/ } function pp_set_tab(state, param){ - /*<>*/ var _bq_ = state[14] < state[15] ? 1 : 0; - if(! _bq_) return _bq_; - /*<>*/ /*<>*/ var + /*<>*/ var _aP_ = state[14] < state[15] ? 1 : 0; + if(! _aP_) return _aP_; + /*<>*/ /*<>*/ var elem = [0, zero, 0, 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_set_max_boxes(state, n){ - /*<>*/ var - _bo_ = 1 < n ? 1 : 0, - _bp_ = _bo_ ? (state[15] = n, 0) : _bo_; - return _bp_; - /*<>*/ } + /*<>*/ var + _aN_ = 1 < n ? 1 : 0, + _aO_ = _aN_ ? (state[15] = n, 0) : _aN_; + return _aO_; + /*<>*/ } function pp_get_max_boxes(state, param){ - /*<>*/ return state[15]; - /*<>*/ } + /*<>*/ return state[15]; + /*<>*/ } function pp_over_max_boxes(state, param){ - /*<>*/ return state[14] === state[15] ? 1 : 0; - /*<>*/ } + /*<>*/ return state[14] === state[15] ? 1 : 0; + /*<>*/ } function pp_set_ellipsis_text(state, s){ - /*<>*/ state[16] = s; + /*<>*/ state[16] = s; return 0; - /*<>*/ } + /*<>*/ } function pp_get_ellipsis_text(state, param){ - /*<>*/ return state[16]; - /*<>*/ } + /*<>*/ return state[16]; + /*<>*/ } function pp_limit(n){ - /*<>*/ return n < 1000000010 ? n : 1000000009; - /*<>*/ } + /*<>*/ return n < 1000000010 ? n : 1000000009; + /*<>*/ } function pp_set_max_indent(state, n$0){ - /*<>*/ var _bn_ = 1 < n$0 ? 1 : 0; - if(! _bn_) return _bn_; - var n$1 = state[6] - n$0 | 0, _bm_ = 1 <= n$1 ? 1 : 0; - if(! _bm_) return _bm_; - /*<>*/ /*<>*/ var n = pp_limit(n$1); + /*<>*/ var _aM_ = 1 < n$0 ? 1 : 0; + if(! _aM_) return _aM_; + var n$1 = state[6] - n$0 | 0, _aL_ = 1 <= n$1 ? 1 : 0; + if(! _aL_) return _aL_; + /*<>*/ /*<>*/ var n = pp_limit(n$1); state[7] = n; state[8] = state[6] - state[7] | 0; - /*<>*/ return pp_rinit(state); - /*<>*/ } + /*<>*/ return pp_rinit(state); + /*<>*/ } function pp_get_max_indent(state, param){ - /*<>*/ return state[8]; - /*<>*/ } + /*<>*/ return state[8]; + /*<>*/ } function pp_set_margin(state, n){ - /*<>*/ var _bk_ = 1 <= n ? 1 : 0; - if(! _bk_) return _bk_; - /*<>*/ /*<>*/ var n$0 = pp_limit(n); + /*<>*/ var _aJ_ = 1 <= n ? 1 : 0; + if(! _aJ_) return _aJ_; + /*<>*/ /*<>*/ var n$0 = pp_limit(n); state[6] = n$0; if(state[8] <= state[6]) var new_max_indent = state[8]; else - /*<>*/ var - /*<>*/ _bl_ = - /*<>*/ caml_call2 + /*<>*/ var + /*<>*/ _aK_ = + /*<>*/ caml_call2 (Stdlib_Int[11], state[6] - state[7] | 0, state[6] / 2 | 0), new_max_indent = - /*<>*/ caml_call2(Stdlib_Int[11], _bl_, 1); - /*<>*/ return pp_set_max_indent(state, new_max_indent); - /*<>*/ } + /*<>*/ caml_call2(Stdlib_Int[11], _aK_, 1); + /*<>*/ return pp_set_max_indent(state, new_max_indent); + /*<>*/ } function validate_geometry(param){ var margin = param[2], max_indent = param[1]; - /*<>*/ return 2 <= max_indent - ? margin <= max_indent ? _c_ : _d_ - : _e_; + /*<>*/ return 2 <= max_indent + ? margin <= max_indent ? _c_ : 1000000010 <= margin ? _d_ : _e_ + : _f_; } function check_geometry(geometry){ - /*<>*/ return 0 === validate_geometry(geometry)[0] + /*<>*/ return 0 === validate_geometry(geometry)[0] ? 1 : 0; - /*<>*/ } + /*<>*/ } function pp_get_margin(state, param){ - /*<>*/ return state[6]; - /*<>*/ } + /*<>*/ return state[6]; + /*<>*/ } function pp_set_full_geometry(state, param){ var margin = param[2], max_indent = param[1]; - /*<>*/ pp_set_margin(state, margin); - /*<>*/ pp_set_max_indent(state, max_indent); - /*<>*/ return 0; + /*<>*/ pp_set_margin(state, margin); + /*<>*/ pp_set_max_indent(state, max_indent); + /*<>*/ return 0; } function pp_set_geometry(state, max_indent, margin){ - /*<>*/ var - /*<>*/ geometry = [0, max_indent, margin], - /*<>*/ match = validate_geometry(geometry); + /*<>*/ var + /*<>*/ geometry = [0, max_indent, margin], + /*<>*/ match = validate_geometry(geometry); if(0 === match[0]) - /*<>*/ return pp_set_full_geometry(state, geometry); - /*<>*/ var + /*<>*/ return pp_set_full_geometry(state, geometry); + /*<>*/ var msg = match[1], - /*<>*/ _bj_ = - /*<>*/ caml_call2 + /*<>*/ _aI_ = + /*<>*/ caml_call2 (Stdlib[28], cst_Format_pp_set_geometry, msg); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[6], _bj_], 1); - /*<>*/ } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stdlib[6], _aI_], 1); + /*<>*/ } function pp_safe_set_geometry(state, max_indent, margin){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var geometry = [0, max_indent, margin]; return 0 === validate_geometry(geometry)[0] ? pp_set_full_geometry(state, geometry) : 0; - /*<>*/ } + /*<>*/ } function pp_get_geometry(state, param){ - /*<>*/ return [0, state[8], state[6]]; - /*<>*/ } + /*<>*/ return [0, state[8], state[6]]; + /*<>*/ } function pp_update_geometry(state, update){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var geometry = pp_get_geometry(state, 0); - /*<>*/ return pp_set_full_geometry - (state, /*<>*/ caml_call1(update, geometry)); - /*<>*/ } + /*<>*/ return pp_set_full_geometry + (state, /*<>*/ caml_call1(update, geometry)); + /*<>*/ } function pp_set_formatter_out_functions(state, param){ var j = param[5], i = param[4], h = param[3], g = param[2], f = param[1]; state[17] = f; @@ -25567,115 +27841,116 @@ return 0; } function pp_get_formatter_out_functions(state, param){ - /*<>*/ return [0, + /*<>*/ return [0, state[17], state[18], state[19], state[20], state[21]]; - /*<>*/ } + /*<>*/ } function pp_set_formatter_output_functi(state, f, g){ - /*<>*/ state[17] = f; + /*<>*/ state[17] = f; state[18] = g; return 0; - /*<>*/ } + /*<>*/ } function pp_get_formatter_output_functi(state, param){ - /*<>*/ return [0, state[17], state[18]]; - /*<>*/ } + /*<>*/ return [0, state[17], state[18]]; + /*<>*/ } function display_newline(state, param){ - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (state[17], cst$7, 0, 1); - /*<>*/ } - /*<>*/ /*<>*/ var - blank_line = - /*<>*/ caml_call2(Stdlib_String[1], 80, 32); + /*<>*/ } + /*<>*/ var + /*<>*/ blank_line = + /*<>*/ caml_call2(Stdlib_String[1], 80, 32), + _g_ = [3, 0, 3]; function display_blanks(state, n){ - /*<>*/ var n$0 = n; - /*<>*/ for(;;){ - var _bi_ = 0 < n$0 ? 1 : 0; - if(! _bi_) return _bi_; + /*<>*/ var n$0 = n; + /*<>*/ for(;;){ + var _aH_ = 0 < n$0 ? 1 : 0; + if(! _aH_) return _aH_; if(80 >= n$0) - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (state[17], blank_line, 0, n$0); - /*<>*/ /*<>*/ caml_call3 + /*<>*/ /*<>*/ caml_call3 (state[17], blank_line, 0, 80); - /*<>*/ var - /*<>*/ n$1 = n$0 - 80 | 0, - n$0 = n$1; + /*<>*/ /*<>*/ var n$1 = n$0 - 80 | 0; + n$0 = n$1; } - /*<>*/ } + /*<>*/ } function pp_set_formatter_out_channel(state, oc){ - /*<>*/ state[17] = - /*<>*/ caml_call1(Stdlib[69], oc); + /*<>*/ state[17] = + /*<>*/ caml_call1(Stdlib[69], oc); state[18] = function(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ }; + /*<>*/ }; state[19] = - function(_bh_){ /*<>*/ return display_newline(state, _bh_);}; - state[20] = function(_bg_){ /*<>*/ return display_blanks(state, _bg_);}; - state[21] = function(_bf_){ /*<>*/ return display_blanks(state, _bf_);}; + function(_aG_){ /*<>*/ return display_newline(state, _aG_);}; + state[20] = function(_aF_){ /*<>*/ return display_blanks(state, _aF_);}; + state[21] = function(_aE_){ /*<>*/ return display_blanks(state, _aE_);}; return 0; - /*<>*/ } + /*<>*/ } function default_pp_mark_open_tag(param){ - /*<>*/ if(param[1] !== String_tag) - /*<>*/ return cst$10; - /*<>*/ var + /*<>*/ if(param[1] !== String_tag) + /*<>*/ return cst$10; + /*<>*/ var s = param[2], - /*<>*/ _be_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$8); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$9, _be_); - /*<>*/ } + /*<>*/ _aD_ = + /*<>*/ caml_call2(Stdlib[28], s, cst$8); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[28], cst$9, _aD_); + /*<>*/ } function default_pp_mark_close_tag(param){ - /*<>*/ if(param[1] !== String_tag) - /*<>*/ return cst$13; - /*<>*/ var + /*<>*/ if(param[1] !== String_tag) + /*<>*/ return cst$13; + /*<>*/ var s = param[2], - /*<>*/ _bd_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$11); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$12, _bd_); - /*<>*/ } - function default_pp_print_open_tag(_bc_){ /*<>*/ return 0;} - function default_pp_print_close_tag(_bb_){ /*<>*/ return 0;} + /*<>*/ _aC_ = + /*<>*/ caml_call2(Stdlib[28], s, cst$11); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[28], cst$12, _aC_); + /*<>*/ } + function default_pp_print_open_tag(_aB_){ /*<>*/ return 0;} + function default_pp_print_close_tag(_aA_){ /*<>*/ return 0;} function pp_make_formatter(f, g, h, i, j){ - /*<>*/ var - /*<>*/ pp_queue = - /*<>*/ caml_call1(Stdlib_Queue[2], 0), - /*<>*/ sys_tok = [0, unknown, _f_, 0]; - /*<>*/ /*<>*/ caml_call2 + /*<>*/ var + /*<>*/ pp_queue = + /*<>*/ caml_call1(Stdlib_Queue[2], 0), + /*<>*/ sys_tok = [0, unknown, _g_, 0]; + /*<>*/ /*<>*/ caml_call2 (Stdlib_Queue[3], sys_tok, pp_queue); - /*<>*/ /*<>*/ var - scan_stack = /*<>*/ caml_call1(Stdlib_Stack[2], 0); - /*<>*/ initialize_scan_stack(scan_stack); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ var + scan_stack = /*<>*/ caml_call1(Stdlib_Stack[2], 0); + /*<>*/ initialize_scan_stack(scan_stack); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Stack[3], [0, 1, sys_tok], scan_stack); - /*<>*/ var - _a9_ = Stdlib[19], - /*<>*/ _a__ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _a$_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _ba_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0); - /*<>*/ return [0, + /*<>*/ var + /*<>*/ pp_margin = 78, + _aw_ = Stdlib[19], + /*<>*/ _ax_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ _ay_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ _az_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0); + /*<>*/ return [0, scan_stack, - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - _ba_, - _a$_, - _a__, - 78, + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + _az_, + _ay_, + _ax_, + pp_margin, 10, 68, - 78, + pp_margin, 0, 1, 1, 1, 1, - _a9_, + _aw_, cst$14, f, g, @@ -25691,1149 +27966,1127 @@ pp_queue]; } function formatter_of_out_functions(out_funs){ - /*<>*/ return pp_make_formatter + /*<>*/ return pp_make_formatter (out_funs[1], out_funs[2], out_funs[3], out_funs[4], out_funs[5]); - /*<>*/ } + /*<>*/ } function make_formatter(output, flush){ - function _a1_(_a8_){ /*<>*/ return 0;} - function _a2_(_a7_){ /*<>*/ return 0;} - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var ppf = pp_make_formatter - (output, flush, function(_a6_){ /*<>*/ return 0;}, _a2_, _a1_); - ppf[19] = function(_a5_){ /*<>*/ return display_newline(ppf, _a5_);}; - ppf[20] = function(_a4_){ /*<>*/ return display_blanks(ppf, _a4_);}; - ppf[21] = function(_a3_){ /*<>*/ return display_blanks(ppf, _a3_);}; - /*<>*/ return ppf; - /*<>*/ } + (output, + flush, + function(_av_){ /*<>*/ return 0;}, + function(_au_){ /*<>*/ return 0;}, + function(_at_){ /*<>*/ return 0;}); + ppf[19] = function(_as_){ /*<>*/ return display_newline(ppf, _as_);}; + ppf[20] = function(_ar_){ /*<>*/ return display_blanks(ppf, _ar_);}; + ppf[21] = function(_aq_){ /*<>*/ return display_blanks(ppf, _aq_);}; + /*<>*/ return ppf; + /*<>*/ } function formatter_of_out_channel(oc){ - function _a0_(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[63], oc); - /*<>*/ } - /*<>*/ return make_formatter - ( /*<>*/ caml_call1(Stdlib[69], oc), _a0_); - /*<>*/ } + /*<>*/ return make_formatter + ( /*<>*/ caml_call1(Stdlib[69], oc), + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[63], oc); + /*<>*/ }); + /*<>*/ } function formatter_of_buffer(b){ - /*<>*/ function _aY_(_aZ_){ /*<>*/ return 0;} - /*<>*/ return make_formatter - ( /*<>*/ caml_call1(Stdlib_Buffer[18], b), - _aY_); - /*<>*/ } + /*<>*/ return make_formatter + ( /*<>*/ caml_call1(Stdlib_Buffer[18], b), + function(_ap_){ /*<>*/ return 0;}); + /*<>*/ } var pp_buffer_size = 512; function pp_make_buffer(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ } - /*<>*/ var - /*<>*/ stdbuf = pp_make_buffer(0), - /*<>*/ std_formatter = + /*<>*/ } + /*<>*/ var + /*<>*/ stdbuf = pp_make_buffer(0), + /*<>*/ std_formatter = formatter_of_out_channel(Stdlib[39]), - /*<>*/ err_formatter = + /*<>*/ err_formatter = formatter_of_out_channel(Stdlib[40]), - /*<>*/ str_formatter = formatter_of_buffer(stdbuf), - /*<>*/ stdbuf_key = - /*<>*/ caml_call2 + /*<>*/ str_formatter = formatter_of_buffer(stdbuf), + /*<>*/ stdbuf_key = + /*<>*/ caml_call2 (Stdlib_Domain[10][1], 0, pp_make_buffer); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], stdbuf_key, stdbuf); - function _g_(param){ - /*<>*/ return formatter_of_buffer - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], stdbuf_key)); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var str_formatter_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _g_); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ caml_call2 + (Stdlib_Domain[10][1], + 0, + function(param){ + /*<>*/ return formatter_of_buffer + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], stdbuf_key)); + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], str_formatter_key, str_formatter); - /*<>*/ function buffered_out_string(key, str, ofs, len){ - /*<>*/ /*<>*/ var - _aX_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], key); - /*<>*/ return /*<>*/ caml_call4 - (Stdlib_Buffer[18], _aX_, str, ofs, len); - /*<>*/ } + /*<>*/ function buffered_out_string(key, str, ofs, len){ + /*<>*/ /*<>*/ var + _ao_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], key); + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Buffer[18], _ao_, str, ofs, len); + /*<>*/ } function buffered_out_flush(oc, key, param){ - /*<>*/ var - /*<>*/ buf = - /*<>*/ caml_call1(Stdlib_Domain[10][2], key), - /*<>*/ len = - /*<>*/ caml_call1(Stdlib_Buffer[7], buf), - /*<>*/ str = - /*<>*/ caml_call1(Stdlib_Buffer[2], buf); - /*<>*/ /*<>*/ caml_call4 + /*<>*/ var + /*<>*/ buf = + /*<>*/ caml_call1(Stdlib_Domain[10][2], key), + /*<>*/ len = + /*<>*/ caml_call1(Stdlib_Buffer[7], buf), + /*<>*/ str = + /*<>*/ caml_call1(Stdlib_Buffer[2], buf); + /*<>*/ /*<>*/ caml_call4 (Stdlib[69], oc, str, 0, len); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[8], buf); - /*<>*/ } - function _h_(param){ - /*<>*/ return caml_call1 - (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ } - /*<>*/ /*<>*/ var - std_buf_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _h_); - function _i_(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ } - /*<>*/ /*<>*/ var - err_buf_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _i_); - function _j_(param){ - function _aG_(_aW_){ /*<>*/ return 0;} - function _aH_(_aV_){ /*<>*/ return 0;} - function _aI_(_aU_){ /*<>*/ return 0;} - var _aJ_ = Stdlib[39]; - /*<>*/ function _aK_(_aT_){ - /*<>*/ return buffered_out_flush(_aJ_, std_buf_key, _aT_); - } - /*<>*/ /*<>*/ var - ppf = - pp_make_formatter - (function(_aQ_, _aR_, _aS_){ - /*<>*/ return buffered_out_string(std_buf_key, _aQ_, _aR_, _aS_); - }, - _aK_, - _aI_, - _aH_, - _aG_); - ppf[19] = function(_aP_){ /*<>*/ return display_newline(ppf, _aP_);}; - ppf[20] = function(_aO_){ /*<>*/ return display_blanks(ppf, _aO_);}; - ppf[21] = function(_aN_){ /*<>*/ return display_blanks(ppf, _aN_);}; - /*<>*/ function _aL_(_aM_){ - /*<>*/ return pp_print_flush(ppf, _aM_); - } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Domain[6], _aL_); - /*<>*/ return ppf; - /*<>*/ } - /*<>*/ /*<>*/ var - std_formatter_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _j_); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ } + /*<>*/ var + /*<>*/ std_buf_key = + /*<>*/ caml_call2 + (Stdlib_Domain[10][1], + 0, + function(param){ + /*<>*/ return caml_call1 + (Stdlib_Buffer[1], pp_buffer_size); + /*<>*/ }), + /*<>*/ err_buf_key = + /*<>*/ caml_call2 + (Stdlib_Domain[10][1], + 0, + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Buffer[1], pp_buffer_size); + /*<>*/ }), + /*<>*/ std_formatter_key = + /*<>*/ caml_call2 + (Stdlib_Domain[10][1], + 0, + function(param){ + /*<>*/ var + _ac_ = Stdlib[39], + /*<>*/ ppf = + pp_make_formatter + (function(_al_, _am_, _an_){ + /*<>*/ return buffered_out_string + (std_buf_key, _al_, _am_, _an_); + }, + function(_ak_){ + /*<>*/ return buffered_out_flush(_ac_, std_buf_key, _ak_); + }, + function(_aj_){ /*<>*/ return 0;}, + function(_ai_){ /*<>*/ return 0;}, + function(_ah_){ /*<>*/ return 0;}); + ppf[19] = + function(_ag_){ /*<>*/ return display_newline(ppf, _ag_);}; + ppf[20] = + function(_af_){ /*<>*/ return display_blanks(ppf, _af_);}; + ppf[21] = + function(_ae_){ /*<>*/ return display_blanks(ppf, _ae_);}; + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[6], + function(_ad_){ /*<>*/ return pp_print_flush(ppf, _ad_);}); + /*<>*/ return ppf; + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], std_formatter_key, std_formatter); - function _k_(param){ - function _ap_(_aF_){ /*<>*/ return 0;} - function _aq_(_aE_){ /*<>*/ return 0;} - function _ar_(_aD_){ /*<>*/ return 0;} - var _as_ = Stdlib[40]; - /*<>*/ function _at_(_aC_){ - /*<>*/ return buffered_out_flush(_as_, err_buf_key, _aC_); - } - /*<>*/ /*<>*/ var - ppf = - pp_make_formatter - (function(_az_, _aA_, _aB_){ - /*<>*/ return buffered_out_string(err_buf_key, _az_, _aA_, _aB_); - }, - _at_, - _ar_, - _aq_, - _ap_); - ppf[19] = function(_ay_){ /*<>*/ return display_newline(ppf, _ay_);}; - ppf[20] = function(_ax_){ /*<>*/ return display_blanks(ppf, _ax_);}; - ppf[21] = function(_aw_){ /*<>*/ return display_blanks(ppf, _aw_);}; - /*<>*/ function _au_(_av_){ - /*<>*/ return pp_print_flush(ppf, _av_); - } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Domain[6], _au_); - /*<>*/ return ppf; - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var err_formatter_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _k_); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ caml_call2 + (Stdlib_Domain[10][1], + 0, + function(param){ + /*<>*/ var + _S_ = Stdlib[40], + /*<>*/ ppf = + pp_make_formatter + (function(_$_, _aa_, _ab_){ + /*<>*/ return buffered_out_string + (err_buf_key, _$_, _aa_, _ab_); + }, + function(___){ + /*<>*/ return buffered_out_flush(_S_, err_buf_key, ___); + }, + function(_Z_){ /*<>*/ return 0;}, + function(_Y_){ /*<>*/ return 0;}, + function(_X_){ /*<>*/ return 0;}); + ppf[19] = function(_W_){ /*<>*/ return display_newline(ppf, _W_);}; + ppf[20] = function(_V_){ /*<>*/ return display_blanks(ppf, _V_);}; + ppf[21] = function(_U_){ /*<>*/ return display_blanks(ppf, _U_);}; + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[6], + function(_T_){ /*<>*/ return pp_print_flush(ppf, _T_);}); + /*<>*/ return ppf; + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], err_formatter_key, err_formatter); function get_std_formatter(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); - /*<>*/ } + /*<>*/ } function get_err_formatter(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Domain[10][2], err_formatter_key); - /*<>*/ } + /*<>*/ } function get_str_formatter(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Domain[10][2], str_formatter_key); - /*<>*/ } + /*<>*/ } function get_stdbuf(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Domain[10][2], stdbuf_key); - /*<>*/ } + /*<>*/ } function flush_buffer_formatter(buf, ppf){ - /*<>*/ pp_flush_queue(ppf, 0); - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call1(Stdlib_Buffer[2], buf); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ pp_flush_queue(ppf, 0); + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call1(Stdlib_Buffer[2], buf); + /*<>*/ /*<>*/ caml_call1 (Stdlib_Buffer[9], buf); - /*<>*/ return s; - /*<>*/ } + /*<>*/ return s; + /*<>*/ } function flush_str_formatter(param){ - /*<>*/ var - /*<>*/ stdbuf = - /*<>*/ caml_call1(Stdlib_Domain[10][2], stdbuf_key), - /*<>*/ str_formatter = - /*<>*/ caml_call1 + /*<>*/ var + /*<>*/ stdbuf = + /*<>*/ caml_call1(Stdlib_Domain[10][2], stdbuf_key), + /*<>*/ str_formatter = + /*<>*/ caml_call1 (Stdlib_Domain[10][2], str_formatter_key); - /*<>*/ return flush_buffer_formatter + /*<>*/ return flush_buffer_formatter (stdbuf, str_formatter); - /*<>*/ } + /*<>*/ } function make_synchronized_formatter(output, flush){ - function _an_(param){ - /*<>*/ var - /*<>*/ buf = - /*<>*/ caml_call1 - (Stdlib_Buffer[1], pp_buffer_size), - /*<>*/ output$0 = - /*<>*/ caml_call1(Stdlib_Buffer[18], buf); - function flush$0(param){ - /*<>*/ /*<>*/ var - _ao_ = /*<>*/ caml_call1(Stdlib_Buffer[7], buf); - /*<>*/ /*<>*/ caml_call3 - (output, - /*<>*/ caml_call1(Stdlib_Buffer[2], buf), - 0, - _ao_); - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Buffer[8], buf); - /*<>*/ return /*<>*/ caml_call1 - (flush, 0); - /*<>*/ } - /*<>*/ return make_formatter(output$0, flush$0); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, _an_); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Domain[10][1], + 0, + function(param){ + /*<>*/ var + /*<>*/ buf = + /*<>*/ caml_call1 + (Stdlib_Buffer[1], pp_buffer_size), + /*<>*/ output$0 = + /*<>*/ caml_call1(Stdlib_Buffer[18], buf); + function flush$0(param){ + /*<>*/ /*<>*/ var + _R_ = + /*<>*/ caml_call1(Stdlib_Buffer[7], buf); + /*<>*/ /*<>*/ caml_call3 + (output, + /*<>*/ caml_call1(Stdlib_Buffer[2], buf), + 0, + _R_); + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Buffer[8], buf); + /*<>*/ return /*<>*/ caml_call1 + (flush, 0); + /*<>*/ } + /*<>*/ return make_formatter + (output$0, flush$0); + /*<>*/ }); + /*<>*/ } function synchronized_formatter_of_out_(oc){ - function _am_(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[63], oc); - /*<>*/ } - /*<>*/ return make_synchronized_formatter - ( /*<>*/ caml_call1(Stdlib[69], oc), _am_); - /*<>*/ } - function make_symbolic_output_buffer(param){ /*<>*/ return [0, 0]; - /*<>*/ } + /*<>*/ return make_synchronized_formatter + ( /*<>*/ caml_call1(Stdlib[69], oc), + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[63], oc); + /*<>*/ }); + /*<>*/ } + function make_symbolic_output_buffer(param){ /*<>*/ return [0, 0]; + /*<>*/ } function clear_symbolic_output_buffer(sob){ - /*<>*/ sob[1] = 0; + /*<>*/ sob[1] = 0; return 0; - /*<>*/ } + /*<>*/ } function get_symbolic_output_buffer(sob){ - /*<>*/ return caml_call1(Stdlib_List[9], sob[1]); - /*<>*/ } + /*<>*/ return caml_call1(Stdlib_List[10], sob[1]); + /*<>*/ } function flush_symbolic_output_buffer(sob){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var items = get_symbolic_output_buffer(sob); - /*<>*/ clear_symbolic_output_buffer(sob); - /*<>*/ return items; - /*<>*/ } + /*<>*/ clear_symbolic_output_buffer(sob); + /*<>*/ return items; + /*<>*/ } function add_symbolic_output_item(sob, item){ - /*<>*/ sob[1] = [0, item, sob[1]]; + /*<>*/ sob[1] = [0, item, sob[1]]; return 0; - /*<>*/ } + /*<>*/ } function formatter_of_symbolic_output_b(sob){ - /*<>*/ function f(s, i, n){ - /*<>*/ return add_symbolic_output_item + /*<>*/ function f(s, i, n){ + /*<>*/ return add_symbolic_output_item (sob, [0, - /*<>*/ caml_call3 - (Stdlib_String[15], s, i, n)]); + /*<>*/ caml_call3 + (Stdlib_String[16], s, i, n)]); } - /*<>*/ function g(_al_){ - /*<>*/ return add_symbolic_output_item(sob, 0); + /*<>*/ function g(_Q_){ + /*<>*/ return add_symbolic_output_item(sob, 0); } - /*<>*/ function h(_ak_){ - /*<>*/ return add_symbolic_output_item(sob, 1); + /*<>*/ function h(_P_){ + /*<>*/ return add_symbolic_output_item(sob, 1); } - /*<>*/ function i(n){ - /*<>*/ return add_symbolic_output_item(sob, [1, n]); + /*<>*/ function i(n){ + /*<>*/ return add_symbolic_output_item(sob, [1, n]); } - /*<>*/ function j(n){ - /*<>*/ return add_symbolic_output_item(sob, [2, n]); + /*<>*/ function j(n){ + /*<>*/ return add_symbolic_output_item(sob, [2, n]); } - /*<>*/ return pp_make_formatter(f, g, h, i, j); - /*<>*/ } + /*<>*/ return pp_make_formatter(f, g, h, i, j); + /*<>*/ } function open_hbox(v){ - /*<>*/ return pp_open_hbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_hbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_vbox(v){ - /*<>*/ return pp_open_vbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_vbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_hvbox(v){ - /*<>*/ return pp_open_hvbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_hvbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_hovbox(v){ - /*<>*/ return pp_open_hovbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_hovbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_box(v){ - /*<>*/ return pp_open_box - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_box + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_box(v){ - /*<>*/ return pp_close_box - ( /*<>*/ caml_call1 + /*<>*/ return pp_close_box + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_stag(v){ - /*<>*/ return pp_open_stag - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_stag + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_stag(v){ - /*<>*/ return pp_close_stag - ( /*<>*/ caml_call1 + /*<>*/ return pp_close_stag + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } - function print_as(v, w){ - /*<>*/ return pp_print_as - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), - v, - w); - /*<>*/ } + /*<>*/ } + function print_as(isize, w){ + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key); + /*<>*/ return pp_print_as_size(state, isize, w); + /*<>*/ } function print_string(v){ - /*<>*/ return pp_print_string - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_string + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_bytes(v){ - /*<>*/ return pp_print_bytes - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_bytes + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_int(v){ - /*<>*/ return pp_print_int - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_int + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_float(v){ - /*<>*/ return pp_print_float - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_float + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_char(v){ - /*<>*/ return pp_print_char - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_char + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_bool(v){ - /*<>*/ return pp_print_bool - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_bool + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_break(v, w){ - /*<>*/ return pp_print_break - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_break + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function print_cut(v){ - /*<>*/ return pp_print_cut - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_cut + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_space(v){ - /*<>*/ return pp_print_space - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_space + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function force_newline(v){ - /*<>*/ return pp_force_newline - ( /*<>*/ caml_call1 + /*<>*/ return pp_force_newline + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_flush(v){ - /*<>*/ return pp_print_flush - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_flush + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_newline(v){ - /*<>*/ return pp_print_newline - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_newline + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_if_newline(v){ - /*<>*/ return pp_print_if_newline - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_if_newline + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_tbox(v){ - /*<>*/ return pp_open_tbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_tbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_tbox(v){ - /*<>*/ return pp_close_tbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_close_tbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_tbreak(v, w){ - /*<>*/ return pp_print_tbreak - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_tbreak + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function set_tab(v){ - /*<>*/ return pp_set_tab - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_tab + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_tab(v){ - /*<>*/ return pp_print_tab - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_tab + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_margin(v){ - /*<>*/ return pp_set_margin - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_margin + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_margin(v){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key) - [6]; - /*<>*/ } + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key); + return state[6]; + /*<>*/ } function set_max_indent(v){ - /*<>*/ return pp_set_max_indent - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_max_indent + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_max_indent(v){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key) - [8]; - /*<>*/ } + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key); + return state[8]; + /*<>*/ } function set_geometry(max_indent, margin){ - /*<>*/ return pp_set_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), max_indent, margin); - /*<>*/ } + /*<>*/ } function safe_set_geometry(max_indent, margin){ - /*<>*/ return pp_safe_set_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_safe_set_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), max_indent, margin); - /*<>*/ } + /*<>*/ } function get_geometry(v){ - /*<>*/ return pp_get_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function update_geometry(v){ - /*<>*/ return pp_update_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_update_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_max_boxes(v){ - /*<>*/ return pp_set_max_boxes - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_max_boxes + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_max_boxes(v){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key) - [15]; - /*<>*/ } + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key); + return state[15]; + /*<>*/ } function over_max_boxes(v){ - /*<>*/ return pp_over_max_boxes - ( /*<>*/ caml_call1 + /*<>*/ return pp_over_max_boxes + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_ellipsis_text(v){ - /*<>*/ return pp_set_ellipsis_text - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_ellipsis_text + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_ellipsis_text(v){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key) - [16]; - /*<>*/ } + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key); + return state[16]; + /*<>*/ } function set_formatter_out_channel(v){ - /*<>*/ return pp_set_formatter_out_channel - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_out_channel + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_out_functions(v){ - /*<>*/ return pp_set_formatter_out_functions - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_out_functions + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_formatter_out_functions(v){ - /*<>*/ return pp_get_formatter_out_functions - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_formatter_out_functions + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_output_functions(v, w){ - /*<>*/ return pp_set_formatter_output_functi - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_output_functi + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function get_formatter_output_functions(v){ - /*<>*/ return pp_get_formatter_output_functi - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_formatter_output_functi + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_stag_functions(v){ - /*<>*/ return pp_set_formatter_stag_function - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_stag_function + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_formatter_stag_functions(v){ - /*<>*/ return pp_get_formatter_stag_function - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_formatter_stag_function + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_print_tags(v){ - /*<>*/ return pp_set_print_tags - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_print_tags + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_print_tags(v){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key) - [22]; - /*<>*/ } + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key); + return state[22]; + /*<>*/ } function set_mark_tags(v){ - /*<>*/ return pp_set_mark_tags - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_mark_tags + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_mark_tags(v){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key) - [23]; - /*<>*/ } + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key); + return state[23]; + /*<>*/ } function set_tags(v){ - /*<>*/ return pp_set_tags - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_tags + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } - function pp_print_list(opt, pp_v, ppf, param){ - var opt$0 = opt, param$0 = param; - for(;;){ - /*<>*/ if(opt$0) - var sth = opt$0[1], pp_sep = sth; + /*<>*/ } + function pp_print_iter(opt, iter, pp_v, ppf, v){ + /*<>*/ var + pp_sep = opt ? opt[1] : pp_print_cut, + /*<>*/ is_first = [0, 1]; + function pp_v$0(v){ + /*<>*/ if(is_first[1]) + is_first[1] = 0; else - var pp_sep = pp_print_cut; - /*<>*/ if(! param$0) - /*<>*/ return 0; - var v = param$0[1]; - if(! param$0[2]) - /*<>*/ return /*<>*/ caml_call2 - (pp_v, ppf, v); - var vs = param$0[2]; - /*<>*/ /*<>*/ caml_call2 - (pp_v, ppf, v); - /*<>*/ /*<>*/ caml_call2 - (pp_sep, ppf, 0); - /*<>*/ var - /*<>*/ opt$1 = [0, pp_sep], - opt$0 = opt$1, - param$0 = vs; - } - } - function pp_print_seq(opt, pp_v, ppf, seq$1){ - /*<>*/ if(opt) - var sth = opt[1], pp_sep = sth; - else - var pp_sep = pp_print_cut; - /*<>*/ /*<>*/ var - match$0 = /*<>*/ caml_call1(seq$1, 0); - if(! match$0) /*<>*/ return 0; - var seq$2 = match$0[2], v$0 = match$0[1]; - /*<>*/ /*<>*/ caml_call2 - (pp_v, ppf, v$0); - var seq = seq$2; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(seq, 0); - if(! match) /*<>*/ return 0; - var seq$0 = match[2], v = match[1]; - /*<>*/ /*<>*/ caml_call2 - (pp_sep, ppf, 0); - /*<>*/ /*<>*/ caml_call2 - (pp_v, ppf, v); - var seq = seq$0; - } - /*<>*/ } + /*<>*/ /*<>*/ caml_call2 + (pp_sep, ppf, 0); + /*<>*/ return /*<>*/ caml_call2 + (pp_v, ppf, v); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (iter, pp_v$0, v); + } + function pp_print_list(opt, pp_v, ppf, v){ + var pp_sep = opt ? opt[1] : pp_print_cut; + /*<>*/ return pp_print_iter + ([0, pp_sep], Stdlib_List[18], pp_v, ppf, v); + } + function pp_print_array(opt, pp_v, ppf, v){ + var pp_sep = opt ? opt[1] : pp_print_cut; + /*<>*/ return pp_print_iter + ([0, pp_sep], Stdlib_Array[12], pp_v, ppf, v); + } + function pp_print_seq(opt, pp_v, ppf, seq){ + var pp_sep = opt ? opt[1] : pp_print_cut; + /*<>*/ return pp_print_iter + ([0, pp_sep], Stdlib_Seq[4], pp_v, ppf, seq); + } function pp_print_text(ppf, s){ - /*<>*/ var + /*<>*/ var len = caml_ml_string_length(s), - /*<>*/ left = [0, 0], - /*<>*/ right = [0, 0]; + /*<>*/ left = [0, 0], + /*<>*/ right = [0, 0]; function flush(param){ - /*<>*/ pp_print_string + /*<>*/ pp_print_string (ppf, - /*<>*/ caml_call3 - (Stdlib_String[15], s, left[1], right[1] - left[1] | 0)); + /*<>*/ caml_call3 + (Stdlib_String[16], s, left[1], right[1] - left[1] | 0)); right[1]++; left[1] = right[1]; return 0; - /*<>*/ } + /*<>*/ } for(;;){ if(right[1] === len){ - var _aj_ = left[1] !== len ? 1 : 0; - return _aj_ ? flush(0) : _aj_; + var _O_ = left[1] !== len ? 1 : 0; + return _O_ ? flush(0) : _O_; } - /*<>*/ /*<>*/ var - match = /*<>*/ runtime.caml_string_get(s, right[1]); + /*<>*/ /*<>*/ var + match = /*<>*/ runtime.caml_string_get(s, right[1]); if(10 === match){ - /*<>*/ flush(0); - /*<>*/ pp_force_newline(ppf, 0); + /*<>*/ flush(0); + /*<>*/ pp_force_newline(ppf, 0); } else if(32 === match){ - /*<>*/ flush(0); - /*<>*/ pp_print_space(ppf, 0); + /*<>*/ flush(0); + /*<>*/ pp_print_space(ppf, 0); } else right[1]++; } - /*<>*/ } + /*<>*/ } function pp_print_option(opt, pp_v, ppf, param){ - /*<>*/ if(opt) - var sth = opt[1], none = sth; - else - var - none = - function(param, _ai_){ - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ if(! param) - /*<>*/ return /*<>*/ caml_call2 + var + none = + opt + ? opt[1] + : function + (_N_, param){ + /*<>*/ return 0; + /*<>*/ }; + if(! param) + /*<>*/ return /*<>*/ caml_call2 (none, ppf, 0); var v = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (pp_v, ppf, v); } function pp_print_result(ok, error, ppf, param){ /*<>*/ if(0 === param[0]){ var v = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (ok, ppf, v); } var e = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (error, ppf, e); } function pp_print_either(left, right, ppf, param){ /*<>*/ if(0 === param[0]){ var l = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (left, ppf, l); } var r = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (right, ppf, r); } function compute_tag(output, tag_acc){ - /*<>*/ var - /*<>*/ buf = - /*<>*/ caml_call1(Stdlib_Buffer[1], 16), - /*<>*/ ppf = formatter_of_buffer(buf); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ var + /*<>*/ buf = + /*<>*/ caml_call1(Stdlib_Buffer[1], 16), + /*<>*/ ppf = formatter_of_buffer(buf); + /*<>*/ /*<>*/ caml_call2 (output, ppf, tag_acc); - /*<>*/ pp_print_flush(ppf, 0); - /*<>*/ /*<>*/ var - len = /*<>*/ caml_call1(Stdlib_Buffer[7], buf); - /*<>*/ return 2 <= len - ? /*<>*/ caml_call3 + /*<>*/ pp_print_flush(ppf, 0); + /*<>*/ /*<>*/ var + len = /*<>*/ caml_call1(Stdlib_Buffer[7], buf); + /*<>*/ return 2 <= len + ? /*<>*/ caml_call3 (Stdlib_Buffer[4], buf, 1, len - 2 | 0) - : /*<>*/ caml_call1(Stdlib_Buffer[2], buf); - /*<>*/ } + : /*<>*/ caml_call1(Stdlib_Buffer[2], buf); + /*<>*/ } function output_formatting_lit(ppf, fmting_lit){ - /*<>*/ if(typeof fmting_lit === "number") + /*<>*/ if(typeof fmting_lit === "number") switch(fmting_lit){ case 0: - /*<>*/ return pp_close_box(ppf, 0); + /*<>*/ return pp_close_box(ppf, 0); case 1: - /*<>*/ return pp_close_stag(ppf, 0); + /*<>*/ return pp_close_stag(ppf, 0); case 2: - /*<>*/ return pp_print_flush(ppf, 0); + /*<>*/ return pp_print_flush(ppf, 0); case 3: - /*<>*/ return pp_force_newline(ppf, 0); + /*<>*/ return pp_force_newline(ppf, 0); case 4: - /*<>*/ return pp_print_newline(ppf, 0); + /*<>*/ return pp_print_newline(ppf, 0); case 5: - /*<>*/ return pp_print_char(ppf, 64); - default: /*<>*/ return pp_print_char(ppf, 37); + /*<>*/ return pp_print_char(ppf, 64); + default: /*<>*/ return pp_print_char(ppf, 37); } switch(fmting_lit[0]){ case 0: var offset = fmting_lit[3], width = fmting_lit[2]; - /*<>*/ return pp_print_break(ppf, width, offset); + /*<>*/ return pp_print_break(ppf, width, offset); case 1: - /*<>*/ return 0; + /*<>*/ return 0; default: var c = fmting_lit[1]; - /*<>*/ pp_print_char(ppf, 64); - /*<>*/ return pp_print_char(ppf, c); + /*<>*/ pp_print_char(ppf, 64); + /*<>*/ return pp_print_char(ppf, c); } - /*<>*/ } + /*<>*/ } function output_acc(ppf, acc){ - /*<>*/ if(typeof acc === "number") - /*<>*/ return 0; - var switch$0 = 0; - switch(acc[0]){ - case 0: - var f = acc[2], p = acc[1]; - /*<>*/ output_acc(ppf, p); - /*<>*/ return output_formatting_lit(ppf, f); - case 1: - var match = acc[2], p$0 = acc[1]; - if(0 === match[0]){ - var acc$0 = match[1]; - /*<>*/ output_acc(ppf, p$0); - /*<>*/ return pp_open_stag - (ppf, [0, String_tag, compute_tag(output_acc, acc$0)]); - } - var acc$1 = match[1]; - /*<>*/ output_acc(ppf, p$0); - /*<>*/ var - /*<>*/ _$_ = compute_tag(output_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1(CamlinternalFormat[20], _$_), - bty = match$0[2], - indent = match$0[1]; - /*<>*/ return pp_open_box_gen(ppf, indent, bty); - case 2: - var _aa_ = acc[1], switch$1 = 0; - if(typeof _aa_ === "number" || ! (0 === _aa_[0])) - switch$1 = 1; - else{ - var _ab_ = _aa_[2], switch$2 = 0; - if(typeof _ab_ === "number" || ! (1 === _ab_[0])) - switch$2 = 1; - else - var s$0 = acc[2], size = _ab_[2], p$2 = _aa_[1]; - if(switch$2) switch$1 = 1; - } - if(switch$1){var s = acc[2], p$1 = _aa_; switch$0 = 2;} - break; - case 3: - var _ac_ = acc[1], switch$3 = 0; - if(typeof _ac_ === "number" || ! (0 === _ac_[0])) - switch$3 = 1; - else{ - var _ad_ = _ac_[2], switch$4 = 0; - if(typeof _ad_ === "number" || ! (1 === _ad_[0])) - switch$4 = 1; - else{var c$0 = acc[2], size$0 = _ad_[2], p$4 = _ac_[1]; switch$0 = 1;} - if(switch$4) switch$3 = 1; - } - if(switch$3){var c = acc[2], p$3 = _ac_; switch$0 = 3;} - break; - case 4: - var _ae_ = acc[1], switch$5 = 0; - if(typeof _ae_ === "number" || ! (0 === _ae_[0])) - switch$5 = 1; - else{ - var _af_ = _ae_[2], switch$6 = 0; - if(typeof _af_ === "number" || ! (1 === _af_[0])) - switch$6 = 1; - else - var s$0 = acc[2], size = _af_[2], p$2 = _ae_[1]; - if(switch$6) switch$5 = 1; - } - if(switch$5){var s = acc[2], p$1 = _ae_; switch$0 = 2;} - break; - case 5: - var _ag_ = acc[1], switch$7 = 0; - if(typeof _ag_ === "number" || ! (0 === _ag_[0])) - switch$7 = 1; - else{ - var _ah_ = _ag_[2], switch$8 = 0; - if(typeof _ah_ === "number" || ! (1 === _ah_[0])) - switch$8 = 1; - else{var c$0 = acc[2], size$0 = _ah_[2], p$4 = _ag_[1]; switch$0 = 1;} - if(switch$8) switch$7 = 1; + /*<>*/ if(typeof acc === "number") + /*<>*/ return 0; + a: + { + b: + { + c: + { + switch(acc[0]){ + case 0: + var f = acc[2], p = acc[1]; + /*<>*/ output_acc(ppf, p); + /*<>*/ return output_formatting_lit(ppf, f); + case 1: + var match = acc[2], p$0 = acc[1]; + if(0 === match[0]){ + var acc$0 = match[1]; + /*<>*/ output_acc(ppf, p$0); + /*<>*/ return pp_open_stag + (ppf, [0, String_tag, compute_tag(output_acc, acc$0)]); + } + var acc$1 = match[1]; + /*<>*/ output_acc(ppf, p$0); + /*<>*/ var + /*<>*/ _E_ = compute_tag(output_acc, acc$1), + /*<>*/ match$0 = + /*<>*/ caml_call1 + (CamlinternalFormat[20], _E_), + bty = match$0[2], + indent = match$0[1]; + /*<>*/ return pp_open_box_gen(ppf, indent, bty); + case 2: + var _F_ = acc[1]; + if(typeof _F_ !== "number" && 0 === _F_[0]){ + var _G_ = _F_[2]; + if(typeof _G_ !== "number" && 1 === _G_[0]){ + var s$0 = acc[2], size = _G_[2], p$2 = _F_[1]; + break b; + } + } + var s = acc[2], p$1 = _F_; + break a; + case 3: + var _H_ = acc[1]; + if(typeof _H_ !== "number" && 0 === _H_[0]){ + var _I_ = _H_[2]; + if(typeof _I_ !== "number" && 1 === _I_[0]){ + var c$0 = acc[2], size$0 = _I_[2], p$4 = _H_[1]; + break; + } + } + var c = acc[2], p$3 = _H_; + break c; + case 4: + var _J_ = acc[1]; + if(typeof _J_ !== "number" && 0 === _J_[0]){ + var _K_ = _J_[2]; + if(typeof _K_ !== "number" && 1 === _K_[0]){ + var s$0 = acc[2], size = _K_[2], p$2 = _J_[1]; + break b; + } + } + var s = acc[2], p$1 = _J_; + break a; + case 5: + var _L_ = acc[1]; + if(typeof _L_ !== "number" && 0 === _L_[0]){ + var _M_ = _L_[2]; + if(typeof _M_ !== "number" && 1 === _M_[0]){ + var c$0 = acc[2], size$0 = _M_[2], p$4 = _L_[1]; + break; + } + } + var c = acc[2], p$3 = _L_; + break c; + case 6: + var f$0 = acc[2], p$5 = acc[1]; + /*<>*/ output_acc(ppf, p$5); + /*<>*/ return /*<>*/ caml_call1 + (f$0, ppf); + case 7: + var p$6 = acc[1]; + /*<>*/ output_acc(ppf, p$6); + /*<>*/ return pp_print_flush(ppf, 0); + default: + var msg = acc[2], p$7 = acc[1]; + /*<>*/ output_acc(ppf, p$7); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], msg); } - if(switch$7){var c = acc[2], p$3 = _ag_; switch$0 = 3;} - break; - case 6: - var f$0 = acc[2], p$5 = acc[1]; - /*<>*/ output_acc(ppf, p$5); - /*<>*/ return /*<>*/ caml_call1 - (f$0, ppf); - case 7: - var p$6 = acc[1]; - /*<>*/ output_acc(ppf, p$6); - /*<>*/ return pp_print_flush(ppf, 0); - default: - var msg = acc[2], p$7 = acc[1]; - /*<>*/ output_acc(ppf, p$7); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], msg); - } - switch(switch$0){ - case 0: - /*<>*/ output_acc(ppf, p$2); - /*<>*/ return pp_print_as_size(ppf, size, s$0); - case 1: - /*<>*/ output_acc(ppf, p$4); - /*<>*/ return pp_print_as_size + /*<>*/ output_acc(ppf, p$4); + /*<>*/ return pp_print_as_size (ppf, size$0, - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_String[1], 1, c$0)); - case 2: - /*<>*/ output_acc(ppf, p$1); - /*<>*/ return pp_print_string(ppf, s); - default: - /*<>*/ output_acc(ppf, p$3); - /*<>*/ return pp_print_char(ppf, c); + } + /*<>*/ output_acc(ppf, p$3); + /*<>*/ return pp_print_char(ppf, c); + } + /*<>*/ output_acc(ppf, p$2); + /*<>*/ return pp_print_as_size(ppf, size, s$0); } - /*<>*/ } + /*<>*/ output_acc(ppf, p$1); + /*<>*/ return pp_print_string(ppf, s); + /*<>*/ } function strput_acc(ppf, acc){ - /*<>*/ if(typeof acc === "number") - /*<>*/ return 0; - var switch$0 = 0; - switch(acc[0]){ - case 0: - var f = acc[2], p = acc[1]; - /*<>*/ strput_acc(ppf, p); - /*<>*/ return output_formatting_lit(ppf, f); - case 1: - var match = acc[2], p$0 = acc[1]; - if(0 === match[0]){ - var acc$0 = match[1]; - /*<>*/ strput_acc(ppf, p$0); - /*<>*/ return pp_open_stag - (ppf, [0, String_tag, compute_tag(strput_acc, acc$0)]); - } - var acc$1 = match[1]; - /*<>*/ strput_acc(ppf, p$0); - /*<>*/ var - /*<>*/ _S_ = compute_tag(strput_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1(CamlinternalFormat[20], _S_), - bty = match$0[2], - indent = match$0[1]; - /*<>*/ return pp_open_box_gen(ppf, indent, bty); - case 2: - var _T_ = acc[1], switch$1 = 0; - if(typeof _T_ === "number" || ! (0 === _T_[0])) - switch$1 = 1; - else{ - var _U_ = _T_[2], switch$2 = 0; - if(typeof _U_ === "number" || ! (1 === _U_[0])) - switch$2 = 1; - else - var s$0 = acc[2], size = _U_[2], p$2 = _T_[1]; - if(switch$2) switch$1 = 1; - } - if(switch$1){var s = acc[2], p$1 = _T_; switch$0 = 2;} - break; - case 3: - var _V_ = acc[1], switch$3 = 0; - if(typeof _V_ === "number" || ! (0 === _V_[0])) - switch$3 = 1; - else{ - var _W_ = _V_[2], switch$4 = 0; - if(typeof _W_ === "number" || ! (1 === _W_[0])) - switch$4 = 1; - else{var c$0 = acc[2], size$0 = _W_[2], p$4 = _V_[1]; switch$0 = 1;} - if(switch$4) switch$3 = 1; - } - if(switch$3){var c = acc[2], p$3 = _V_; switch$0 = 3;} - break; - case 4: - var _X_ = acc[1], switch$5 = 0; - if(typeof _X_ === "number" || ! (0 === _X_[0])) - switch$5 = 1; - else{ - var _Y_ = _X_[2], switch$6 = 0; - if(typeof _Y_ === "number" || ! (1 === _Y_[0])) - switch$6 = 1; - else - var s$0 = acc[2], size = _Y_[2], p$2 = _X_[1]; - if(switch$6) switch$5 = 1; - } - if(switch$5){var s = acc[2], p$1 = _X_; switch$0 = 2;} - break; - case 5: - var _Z_ = acc[1], switch$7 = 0; - if(typeof _Z_ === "number" || ! (0 === _Z_[0])) - switch$7 = 1; - else{ - var ___ = _Z_[2], switch$8 = 0; - if(typeof ___ === "number" || ! (1 === ___[0])) - switch$8 = 1; - else{var c$0 = acc[2], size$0 = ___[2], p$4 = _Z_[1]; switch$0 = 1;} - if(switch$8) switch$7 = 1; - } - if(switch$7){var c = acc[2], p$3 = _Z_; switch$0 = 3;} - break; - case 6: - var p$5 = acc[1]; - if(typeof p$5 !== "number" && 0 === p$5[0]){ - var match$1 = p$5[2]; - if(typeof match$1 !== "number" && 1 === match$1[0]){ - var f$1 = acc[2], size$1 = match$1[2], p$6 = p$5[1]; - /*<>*/ strput_acc(ppf, p$6); - /*<>*/ return pp_print_as_size - (ppf, size$1, /*<>*/ caml_call1(f$1, 0)); - } + /*<>*/ if(typeof acc === "number") + /*<>*/ return 0; + a: + { + b: + { + c: + { + switch(acc[0]){ + case 0: + var f = acc[2], p = acc[1]; + /*<>*/ strput_acc(ppf, p); + /*<>*/ return output_formatting_lit(ppf, f); + case 1: + var match = acc[2], p$0 = acc[1]; + if(0 === match[0]){ + var acc$0 = match[1]; + /*<>*/ strput_acc(ppf, p$0); + /*<>*/ return pp_open_stag + (ppf, [0, String_tag, compute_tag(strput_acc, acc$0)]); + } + var acc$1 = match[1]; + /*<>*/ strput_acc(ppf, p$0); + /*<>*/ var + /*<>*/ _v_ = compute_tag(strput_acc, acc$1), + /*<>*/ match$0 = + /*<>*/ caml_call1 + (CamlinternalFormat[20], _v_), + bty = match$0[2], + indent = match$0[1]; + /*<>*/ return pp_open_box_gen(ppf, indent, bty); + case 2: + var _w_ = acc[1]; + if(typeof _w_ !== "number" && 0 === _w_[0]){ + var _x_ = _w_[2]; + if(typeof _x_ !== "number" && 1 === _x_[0]){ + var s$0 = acc[2], size = _x_[2], p$2 = _w_[1]; + break b; + } + } + var s = acc[2], p$1 = _w_; + break a; + case 3: + var _y_ = acc[1]; + if(typeof _y_ !== "number" && 0 === _y_[0]){ + var _z_ = _y_[2]; + if(typeof _z_ !== "number" && 1 === _z_[0]){ + var c$0 = acc[2], size$0 = _z_[2], p$4 = _y_[1]; + break; + } + } + var c = acc[2], p$3 = _y_; + break c; + case 4: + var _A_ = acc[1]; + if(typeof _A_ !== "number" && 0 === _A_[0]){ + var _B_ = _A_[2]; + if(typeof _B_ !== "number" && 1 === _B_[0]){ + var s$0 = acc[2], size = _B_[2], p$2 = _A_[1]; + break b; + } + } + var s = acc[2], p$1 = _A_; + break a; + case 5: + var _C_ = acc[1]; + if(typeof _C_ !== "number" && 0 === _C_[0]){ + var _D_ = _C_[2]; + if(typeof _D_ !== "number" && 1 === _D_[0]){ + var c$0 = acc[2], size$0 = _D_[2], p$4 = _C_[1]; + break; + } + } + var c = acc[2], p$3 = _C_; + break c; + case 6: + var p$5 = acc[1]; + if(typeof p$5 !== "number" && 0 === p$5[0]){ + var match$1 = p$5[2]; + if(typeof match$1 !== "number" && 1 === match$1[0]){ + var f$1 = acc[2], size$1 = match$1[2], p$6 = p$5[1]; + /*<>*/ strput_acc(ppf, p$6); + /*<>*/ return pp_print_as_size + (ppf, size$1, /*<>*/ caml_call1(f$1, 0)); + } + } + var f$0 = acc[2]; + /*<>*/ strput_acc(ppf, p$5); + /*<>*/ return pp_print_string + (ppf, /*<>*/ caml_call1(f$0, 0)); + case 7: + var p$7 = acc[1]; + /*<>*/ strput_acc(ppf, p$7); + /*<>*/ return pp_print_flush(ppf, 0); + default: + var msg = acc[2], p$8 = acc[1]; + /*<>*/ strput_acc(ppf, p$8); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], msg); } - var f$0 = acc[2]; - /*<>*/ strput_acc(ppf, p$5); - /*<>*/ return pp_print_string - (ppf, /*<>*/ caml_call1(f$0, 0)); - case 7: - var p$7 = acc[1]; - /*<>*/ strput_acc(ppf, p$7); - /*<>*/ return pp_print_flush(ppf, 0); - default: - var msg = acc[2], p$8 = acc[1]; - /*<>*/ strput_acc(ppf, p$8); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], msg); - } - switch(switch$0){ - case 0: - /*<>*/ strput_acc(ppf, p$2); - /*<>*/ return pp_print_as_size(ppf, size, s$0); - case 1: - /*<>*/ strput_acc(ppf, p$4); - /*<>*/ return pp_print_as_size + /*<>*/ strput_acc(ppf, p$4); + /*<>*/ return pp_print_as_size (ppf, size$0, - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_String[1], 1, c$0)); - case 2: - /*<>*/ strput_acc(ppf, p$1); - /*<>*/ return pp_print_string(ppf, s); - default: - /*<>*/ strput_acc(ppf, p$3); - /*<>*/ return pp_print_char(ppf, c); + } + /*<>*/ strput_acc(ppf, p$3); + /*<>*/ return pp_print_char(ppf, c); + } + /*<>*/ strput_acc(ppf, p$2); + /*<>*/ return pp_print_as_size(ppf, size, s$0); } - /*<>*/ } + /*<>*/ strput_acc(ppf, p$1); + /*<>*/ return pp_print_string(ppf, s); + /*<>*/ } function kfprintf(k, ppf, param){ - /*<>*/ var - fmt = param[1], - /*<>*/ _Q_ = 0; - function _R_(acc){ - /*<>*/ output_acc(ppf, acc); - return caml_call1(k, ppf); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _R_, _Q_, fmt); + var fmt = param[1]; + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], + function(acc){ + /*<>*/ output_acc(ppf, acc); + return caml_call1(k, ppf); + /*<>*/ }, + 0, + fmt); } function ikfprintf(k, ppf, param){ var fmt = param[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[8], k, ppf, fmt); } function ifprintf(ppf, param){ - /*<>*/ var - fmt = param[1], - /*<>*/ _N_ = 0; - function _O_(_P_){ /*<>*/ return 0;} - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[8], _O_, _N_, fmt); + var fmt = param[1]; + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[8], + function(_u_){ /*<>*/ return 0;}, + 0, + fmt); } function fprintf(ppf){ - function _K_(_M_){ /*<>*/ return 0;} - /*<>*/ return function(_L_){ - /*<>*/ return kfprintf(_K_, ppf, _L_);}; - /*<>*/ } + function _r_(_t_){ /*<>*/ return 0;} + /*<>*/ return function(_s_){ + /*<>*/ return kfprintf(_r_, ppf, _s_);}; + /*<>*/ } function printf(param){ - /*<>*/ var - fmt = param[1], - /*<>*/ _I_ = 0; - function _J_(acc){ - /*<>*/ return output_acc - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), - acc); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _J_, _I_, fmt); + var fmt = param[1]; + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], + function(acc){ + /*<>*/ return output_acc + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key), + acc); + /*<>*/ }, + 0, + fmt); } function eprintf(param){ - /*<>*/ var - fmt = param[1], - /*<>*/ _G_ = 0; - function _H_(acc){ - /*<>*/ return output_acc - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], err_formatter_key), - acc); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _H_, _G_, fmt); + var fmt = param[1]; + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], + function(acc){ + /*<>*/ return output_acc + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], err_formatter_key), + acc); + /*<>*/ }, + 0, + fmt); } function kdprintf(k, param){ - /*<>*/ var - fmt = param[1], - /*<>*/ _E_ = 0; - function _F_(acc){ - /*<>*/ return /*<>*/ caml_call1 - (k, - function(ppf){ - /*<>*/ return output_acc(ppf, acc); - /*<>*/ }); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _F_, _E_, fmt); + var fmt = param[1]; + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], + function(acc){ + /*<>*/ return /*<>*/ caml_call1 + (k, + function(ppf){ + /*<>*/ return output_acc(ppf, acc); + /*<>*/ }); + /*<>*/ }, + 0, + fmt); } function dprintf(fmt){ - /*<>*/ return kdprintf + /*<>*/ return kdprintf (function(i){ - /*<>*/ return i; - /*<>*/ }, + /*<>*/ return i; + /*<>*/ }, fmt); - /*<>*/ } + /*<>*/ } function ksprintf(k, param){ - /*<>*/ var + /*<>*/ var fmt = param[1], - /*<>*/ b = pp_make_buffer(0), - /*<>*/ ppf = formatter_of_buffer(b); + /*<>*/ b = pp_make_buffer(0), + /*<>*/ ppf = formatter_of_buffer(b); function k$0(acc){ - /*<>*/ strput_acc(ppf, acc); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ strput_acc(ppf, acc); + /*<>*/ return /*<>*/ caml_call1 (k, flush_buffer_formatter(b, ppf)); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], k$0, 0, fmt); } function sprintf(fmt){ - /*<>*/ return ksprintf(id, fmt); - /*<>*/ } + /*<>*/ return ksprintf(id, fmt); + /*<>*/ } function kasprintf(k, param){ - /*<>*/ var + /*<>*/ var fmt = param[1], - /*<>*/ b = pp_make_buffer(0), - /*<>*/ ppf = formatter_of_buffer(b); + /*<>*/ b = pp_make_buffer(0), + /*<>*/ ppf = formatter_of_buffer(b); function k$0(acc){ - /*<>*/ output_acc(ppf, acc); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ output_acc(ppf, acc); + /*<>*/ return /*<>*/ caml_call1 (k, flush_buffer_formatter(b, ppf)); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], k$0, 0, fmt); } function asprintf(fmt){ - /*<>*/ return kasprintf(id, fmt); - /*<>*/ } + /*<>*/ return kasprintf(id, fmt); + /*<>*/ } function flush_standard_formatters(param){ - /*<>*/ pp_print_flush - ( /*<>*/ caml_call1 + /*<>*/ pp_print_flush + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), 0); - /*<>*/ return pp_print_flush - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_flush + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], err_formatter_key), 0); - /*<>*/ } - /*<>*/ /*<>*/ caml_call1 + /*<>*/ } + /*<>*/ /*<>*/ caml_call1 (Stdlib[100], flush_standard_formatters); - function _l_(param){ - /*<>*/ flush_standard_formatters(0); - /*<>*/ var - /*<>*/ fs = - pp_get_formatter_out_functions(std_formatter, 0), - _m_ = fs[5], - _n_ = fs[4], - _o_ = fs[3], - _p_ = Stdlib[39]; - /*<>*/ function _q_(_D_){ - /*<>*/ return buffered_out_flush(_p_, std_buf_key, _D_); - } - /*<>*/ pp_set_formatter_out_functions - (std_formatter, - [0, - function(_A_, _B_, _C_){ - /*<>*/ return buffered_out_string(std_buf_key, _A_, _B_, _C_); - }, - _q_, - _o_, - _n_, - _m_]); - /*<>*/ var - /*<>*/ fs$0 = - pp_get_formatter_out_functions(err_formatter, 0), - _r_ = fs$0[5], - _s_ = fs$0[4], - _t_ = fs$0[3], - _u_ = Stdlib[40]; - /*<>*/ function _v_(_z_){ - /*<>*/ return buffered_out_flush(_u_, err_buf_key, _z_); - } - /*<>*/ return pp_set_formatter_out_functions - (err_formatter, - [0, - function(_w_, _x_, _y_){ - /*<>*/ return buffered_out_string - (err_buf_key, _w_, _x_, _y_); - }, - _v_, - _t_, - _s_, - _r_]); - /*<>*/ } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Domain[5], _l_); + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[5], + function(param){ + /*<>*/ flush_standard_formatters(0); + /*<>*/ var + /*<>*/ fs = + pp_get_formatter_out_functions(std_formatter, 0), + _h_ = Stdlib[39]; + /*<>*/ pp_set_formatter_out_functions + (std_formatter, + [0, + function(_o_, _p_, _q_){ + /*<>*/ return buffered_out_string(std_buf_key, _o_, _p_, _q_); + }, + function(_n_){ + /*<>*/ return buffered_out_flush(_h_, std_buf_key, _n_); + }, + fs[3], + fs[4], + fs[5]]); + /*<>*/ var + /*<>*/ fs$0 = + pp_get_formatter_out_functions(err_formatter, 0), + _i_ = Stdlib[40]; + /*<>*/ return pp_set_formatter_out_functions + (err_formatter, + [0, + function(_k_, _l_, _m_){ + /*<>*/ return buffered_out_string + (err_buf_key, _k_, _l_, _m_); + }, + function(_j_){ + /*<>*/ return buffered_out_flush(_i_, err_buf_key, _j_); + }, + fs$0[3], + fs$0[4], + fs$0[5]]); + /*<>*/ }); var Stdlib_Format = [0, @@ -26863,6 +29116,7 @@ print_char, pp_print_bool, print_bool, + pp_print_nothing, pp_print_space, print_space, pp_print_cut, @@ -26878,6 +29132,7 @@ print_flush, pp_print_newline, print_newline, + pp_infinity, pp_set_margin, set_margin, pp_get_margin, @@ -26965,7 +29220,9 @@ flush_symbolic_output_buffer, add_symbolic_output_item, formatter_of_symbolic_output_b, + pp_print_iter, pp_print_list, + pp_print_array, pp_print_seq, pp_print_text, pp_print_option, @@ -26983,13 +29240,13 @@ ikfprintf, ksprintf, kasprintf]; - runtime.caml_register_global(35, Stdlib_Format, "Stdlib__Format"); + runtime.caml_register_global(38, Stdlib_Format, "Stdlib__Format"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Scanf -//# unitInfo: Requires: Assert_failure, CamlinternalFormat, CamlinternalFormatBasics, Stdlib, Stdlib__Buffer, Stdlib__Bytes, Stdlib__Int, Stdlib__Printf, Stdlib__String +//# unitInfo: Requires: CamlinternalFormat, CamlinternalFormatBasics, Stdlib, Stdlib__Buffer, Stdlib__Bytes, Stdlib__Int, Stdlib__Printf, Stdlib__String (function (globalThis){ "use strict"; @@ -27006,7 +29263,6 @@ caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_string_length = runtime.caml_ml_string_length, caml_string_get = runtime.caml_string_get, - caml_string_notequal = runtime.caml_string_notequal, caml_trampoline = runtime.caml_trampoline, caml_trampoline_return = runtime.caml_trampoline_return, caml_wrap_exception = runtime.caml_wrap_exception; @@ -27037,7 +29293,16 @@ cst$1 = cst$5, cst$2 = cst$5, cst$0 = cst$5, + cst_not_a_valid_float_in_hexad = + "not a valid float in hexadecimal notation", + cst_no_dot_or_exponent_part_fo = + "no dot or exponent part found in float token", cst = cst$6, + cst_binary = "binary", + cst_octal = "octal", + cst_hexadecimal = "hexadecimal", + cst_a_Char = "a Char", + cst_a_String = "a String", CamlinternalFormat = global_data.CamlinternalFormat, CamlinternalFormatBasics = global_data.CamlinternalFormatBasics, Stdlib_String = global_data.Stdlib__String, @@ -27046,104 +29311,10 @@ Stdlib_Printf = global_data.Stdlib__Printf, Stdlib_Int = global_data.Stdlib__Int, Stdlib_Buffer = global_data.Stdlib__Buffer, - _r_ = [0, 91], - _q_ = [0, 123], - cst_end_of_input_not_found = "end of input not found", - cst_scanf_bad_conversion_a = 'scanf: bad conversion "%a"', - cst_scanf_bad_conversion_t = 'scanf: bad conversion "%t"', - cst_scanf_missing_reader = "scanf: missing reader", - _s_ = [0, cst_scanf_ml, 1414, 13], - cst_scanf_bad_conversion_custo = - 'scanf: bad conversion "%?" (custom converter)', - cst_scanf_bad_conversion = cst_scanf_bad_conversion$3, - cst_scanf_bad_conversion$0 = cst_scanf_bad_conversion$3, - cst_scanf_bad_conversion$1 = 'scanf: bad conversion "%-"', - cst_scanf_bad_conversion$2 = cst_scanf_bad_conversion$3, - _t_ = [0, [3, 0, [10, 0]], "%S%!"], - cst_in_format = ' in format "', - _p_ = [0, 37, ""], - _o_ = - [0, - [11, - "scanf: bad input at char number ", - [4, 3, 0, 0, [11, ": ", [2, 0, 0]]]], - "scanf: bad input at char number %i: %s"], - _n_ = - [0, - [11, "the character ", [1, [11, " cannot start a boolean", 0]]], - "the character %C cannot start a boolean"], - _m_ = - [0, - [11, "bad character hexadecimal encoding \\", [0, [0, 0]]], - "bad character hexadecimal encoding \\%c%c"], - _l_ = - [0, - [11, "bad character decimal encoding \\", [0, [0, [0, 0]]]], - "bad character decimal encoding \\%c%c%c"], - cst_an = "an", - cst_x = "x", - cst_nfinity = "nfinity", - cst_digits = "digits", - _k_ = - [0, - [11, - cst_character, - [1, [11, " is not a valid ", [2, 0, [11, " digit", 0]]]]], - "character %C is not a valid %s digit"], - cst_decimal_digits = "decimal digits", - _j_ = - [0, - [11, cst_character, [1, [11, " is not a decimal digit", 0]]], - "character %C is not a decimal digit"], - cst_0b = "0b", - cst_0o = "0o", - cst_0u = "0u", - cst_0x = "0x", - _i_ = [0, cst_scanf_ml, 516, 9], - _h_ = - [0, - [11, "invalid boolean '", [2, 0, [12, 39, 0]]], - "invalid boolean '%s'"], - _g_ = - [0, - [11, "looking for ", [1, [11, ", found ", [1, 0]]]], - "looking for %C, found %C"], - cst_not_a_valid_float_in_hexad = - "not a valid float in hexadecimal notation", - cst_no_dot_or_exponent_part_fo = - "no dot or exponent part found in float token", - _f_ = - [0, - [11, - cst_scanning_of, - [2, - 0, - [11, - " failed: premature end of file occurred before end of token", - 0]]], - "scanning of %s failed: premature end of file occurred before end of token"], - _e_ = - [0, - [11, - cst_scanning_of, - [2, - 0, - [11, " failed: the specified length was too short for token", 0]]], - "scanning of %s failed: the specified length was too short for token"], - _d_ = - [0, - [11, "illegal escape character ", [1, 0]], - "illegal escape character %C"], + null_char = 0, cst_unnamed_function = "unnamed function", cst_unnamed_character_string = "unnamed character string", - cst_unnamed_Stdlib_input_chann = "unnamed Stdlib input channel", - cst_Stdlib_Scanf_Scan_failure = "Stdlib.Scanf.Scan_failure", - cst_binary = "binary", - cst_octal = "octal", - cst_hexadecimal = "hexadecimal", - cst_a_Char = "a Char", - cst_a_String = "a String", - null_char = 0; + cst_unnamed_Stdlib_input_chann = "unnamed Stdlib input channel"; function next_char(ib){ /*<>*/ try{ /*<>*/ /*<>*/ var @@ -27154,9 +29325,9 @@ if(10 === c) ib[5] = ib[5] + 1 | 0; /*<>*/ return c; } - catch(_bb_){ - var _ba_ = caml_wrap_exception(_bb_); - if(_ba_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_ba_, 0); + catch(_aY_){ + var _aX_ = caml_wrap_exception(_aY_); + if(_aX_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_aX_, 0); ib[2] = null_char; ib[3] = 0; ib[1] = 1; @@ -27206,12 +29377,10 @@ ib[6] = ib[6] + 1 | 0; /*<>*/ return tok; /*<>*/ } - function skip_char(width, ib){ - /*<>*/ invalidate_current_char(ib); - /*<>*/ return width; - /*<>*/ } function ignore_char(width, ib){ - /*<>*/ return skip_char(width - 1 | 0, ib); + /*<>*/ var width$0 = width - 1 | 0; + /*<>*/ invalidate_current_char(ib); + /*<>*/ return width$0; /*<>*/ } function store_char(width, ib, c){ /*<>*/ /*<>*/ caml_call2 @@ -27249,10 +29418,10 @@ /*<>*/ return create(1, next); /*<>*/ } var _a_ = 0; - /*<>*/ function from_function(_a$_){ - /*<>*/ return create(_a_, _a$_); + /*<>*/ function from_function(_aW_){ + /*<>*/ return create(_a_, _aW_); } - /*<>*/ /*<>*/ var len = 1024; + /*<>*/ var len = 1024; function scan_close_at_end(ic){ /*<>*/ /*<>*/ caml_call1 (Stdlib[93], ic); @@ -27290,19 +29459,19 @@ /*<>*/ /*<>*/ var stdin = from_ic(scan_raise_at_end, [1, cst, Stdlib[38]], Stdlib[38]); function open_in_file(open_in, fname){ - /*<>*/ if(! caml_string_notequal(fname, cst$6)) + /*<>*/ if(fname === cst$6) /*<>*/ return stdin; /*<>*/ /*<>*/ var ic = /*<>*/ caml_call1(open_in, fname); return from_ic(scan_close_at_end, [1, fname, ic], ic); /*<>*/ } var _b_ = Stdlib[79]; - /*<>*/ function open_in(_a__){ - /*<>*/ return open_in_file(_b_, _a__); + /*<>*/ function open_in(_aV_){ + /*<>*/ return open_in_file(_b_, _aV_); } - /*<>*/ /*<>*/ var _c_ = Stdlib[80]; - /*<>*/ function open_in_bin(_a9_){ - /*<>*/ return open_in_file(_c_, _a9_); + /*<>*/ var _c_ = Stdlib[80]; + /*<>*/ function open_in_bin(_aU_){ + /*<>*/ return open_in_file(_c_, _aU_); } function from_channel(ic){ /*<>*/ return from_ic(scan_raise_at_end, [0, ic], ic); @@ -27319,9 +29488,93 @@ /*<>*/ return /*<>*/ caml_call1 (Stdlib[93], ic$0); /*<>*/ } - /*<>*/ /*<>*/ var - Scan_failure = - [248, cst_Stdlib_Scanf_Scan_failure, runtime.caml_fresh_oo_id(0)]; + /*<>*/ var + /*<>*/ Scan_failure = + [248, "Stdlib.Scanf.Scan_failure", runtime.caml_fresh_oo_id(0)], + _d_ = + [0, + [11, "illegal escape character ", [1, 0]], + "illegal escape character %C"], + _e_ = + [0, + [11, + cst_scanning_of, + [2, + 0, + [11, " failed: the specified length was too short for token", 0]]], + "scanning of %s failed: the specified length was too short for token"], + _f_ = + [0, + [11, + cst_scanning_of, + [2, + 0, + [11, + " failed: premature end of file occurred before end of token", + 0]]], + "scanning of %s failed: premature end of file occurred before end of token"], + _g_ = + [0, + [11, "looking for ", [1, [11, ", found ", [1, 0]]]], + "looking for %C, found %C"], + _h_ = + [0, + [11, "invalid boolean '", [2, 0, [12, 39, 0]]], + "invalid boolean '%s'"], + _i_ = [0, cst_scanf_ml, 516, 9], + cst_0b = "0b", + cst_0o = "0o", + cst_0u = "0u", + cst_0x = "0x", + cst_decimal_digits = "decimal digits", + _j_ = + [0, + [11, cst_character, [1, [11, " is not a decimal digit", 0]]], + "character %C is not a decimal digit"], + cst_digits = "digits", + _k_ = + [0, + [11, + cst_character, + [1, [11, " is not a valid ", [2, 0, [11, " digit", 0]]]]], + "character %C is not a valid %s digit"], + cst_an = "an", + cst_nfinity = "nfinity", + cst_x = "x", + _l_ = + [0, + [11, "bad character decimal encoding \\", [0, [0, [0, 0]]]], + "bad character decimal encoding \\%c%c%c"], + _m_ = + [0, + [11, "bad character hexadecimal encoding \\", [0, [0, 0]]], + "bad character hexadecimal encoding \\%c%c"], + _n_ = + [0, + [11, "the character ", [1, [11, " cannot start a boolean", 0]]], + "the character %C cannot start a boolean"], + _o_ = + [0, + [11, + "scanf: bad input at char number ", + [4, 3, 0, 0, [11, ": ", [2, 0, 0]]]], + "scanf: bad input at char number %i: %s"], + _p_ = [0, 37, ""], + _q_ = [0, 123], + _r_ = [0, 91], + cst_end_of_input_not_found = "end of input not found", + cst_scanf_bad_conversion_a = 'scanf: bad conversion "%a"', + cst_scanf_bad_conversion_t = 'scanf: bad conversion "%t"', + cst_scanf_missing_reader = "scanf: missing reader", + _s_ = [0, cst_scanf_ml, 1414, 13], + cst_scanf_bad_conversion_custo = + 'scanf: bad conversion "%?" (custom converter)', + cst_scanf_bad_conversion = cst_scanf_bad_conversion$3, + cst_scanf_bad_conversion$0 = cst_scanf_bad_conversion$3, + cst_scanf_bad_conversion$1 = 'scanf: bad conversion "%-"', + cst_scanf_bad_conversion$2 = cst_scanf_bad_conversion$3, + cst_in_format = ' in format "', + _t_ = [0, [3, 0, [10, 0]], "%S%!"]; function bad_input(s){ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Scan_failure, s], 1); @@ -27335,9 +29588,6 @@ ( /*<>*/ caml_call2 (Stdlib_Printf[4], _e_, message)); /*<>*/ } - function bad_float(param){ - /*<>*/ return bad_input(cst_no_dot_or_exponent_part_fo); - /*<>*/ } function bad_hex_float(param){ /*<>*/ return bad_input(cst_not_a_valid_float_in_hexad); /*<>*/ } @@ -27345,11 +29595,6 @@ /*<>*/ return bad_input ( /*<>*/ caml_call3(Stdlib_Printf[4], _g_, c, ci)); /*<>*/ } - function check_this_char(ib, c){ - /*<>*/ /*<>*/ var - ci = checked_peek_char(ib); - return ci === c ? invalidate_current_char(ib) : character_mismatch(c, ci); - /*<>*/ } function check_char(ib, c$0){ /*<>*/ if(10 === c$0){ /*<>*/ /*<>*/ var @@ -27365,28 +29610,34 @@ /*<>*/ for(;;){ /*<>*/ var /*<>*/ c = peek_char(ib), - /*<>*/ _a7_ = 1 - ib[1]; - if(! _a7_) /*<>*/ return _a7_; - /*<>*/ var - /*<>*/ _a8_ = c - 9 | 0, - switch$0 = 0; - if(4 < _a8_ >>> 0){ - if(23 === _a8_) switch$0 = 1; - } - else if(1 < _a8_ - 2 >>> 0) switch$0 = 1; - if(! switch$0) /*<>*/ return 0; + /*<>*/ _aS_ = 1 - ib[1]; + if(! _aS_) /*<>*/ return _aS_; + /*<>*/ /*<>*/ var _aT_ = c - 9 | 0; + a: + { + if(4 < _aT_ >>> 0){ + if(23 === _aT_) break a; + } + else if(1 < _aT_ - 2 >>> 0) break a; + /*<>*/ return 0; + } /*<>*/ invalidate_current_char(ib); } /*<>*/ } + function check_this_char(ib, c){ + /*<>*/ /*<>*/ var + ci = checked_peek_char(ib); + return ci === c ? invalidate_current_char(ib) : character_mismatch(c, ci); + /*<>*/ } function token_char(ib){ /*<>*/ return /*<>*/ caml_string_get (token_string(ib), 0); /*<>*/ } function token_bool(ib){ /*<>*/ /*<>*/ var s = token_string(ib); - return caml_string_notequal(s, "false") - ? caml_string_notequal - (s, "true") + return s !== "false" + ? s + !== "true" ? bad_input ( /*<>*/ caml_call2(Stdlib_Printf[4], _h_, s)) : 1 @@ -27418,23 +29669,23 @@ /*<>*/ switch(conv){ case 0: /*<>*/ var - /*<>*/ _a3_ = token_string(ib), - tok = /*<>*/ caml_call2(Stdlib[28], cst_0b, _a3_); + /*<>*/ _aO_ = token_string(ib), + tok = /*<>*/ caml_call2(Stdlib[28], cst_0b, _aO_); break; case 3: /*<>*/ var - /*<>*/ _a4_ = token_string(ib), - tok = /*<>*/ caml_call2(Stdlib[28], cst_0o, _a4_); + /*<>*/ _aP_ = token_string(ib), + tok = /*<>*/ caml_call2(Stdlib[28], cst_0o, _aP_); break; case 4: /*<>*/ var - /*<>*/ _a5_ = token_string(ib), - tok = /*<>*/ caml_call2(Stdlib[28], cst_0u, _a5_); + /*<>*/ _aQ_ = token_string(ib), + tok = /*<>*/ caml_call2(Stdlib[28], cst_0u, _aQ_); break; case 5: /*<>*/ var - /*<>*/ _a6_ = token_string(ib), - tok = /*<>*/ caml_call2(Stdlib[28], cst_0x, _a6_); + /*<>*/ _aR_ = token_string(ib), + tok = /*<>*/ caml_call2(Stdlib[28], cst_0x, _aR_); break; default: var tok = token_string(ib); } @@ -27443,7 +29694,7 @@ /*<>*/ if (0 !== l && 43 === /*<>*/ caml_string_get(tok, 0)) /*<>*/ return /*<>*/ caml_call3 - (Stdlib_String[15], tok, 1, l - 1 | 0); + (Stdlib_String[16], tok, 1, l - 1 | 0); /*<>*/ return tok; /*<>*/ } function token_float(ib){ @@ -27459,16 +29710,16 @@ /*<>*/ return width$0; if(58 <= c){ if(95 === c){ - /*<>*/ var - /*<>*/ width$1 = ignore_char(width$0, ib), - width$0 = width$1; + /*<>*/ /*<>*/ var + width$1 = ignore_char(width$0, ib); + width$0 = width$1; continue; } } else if(48 <= c){ - /*<>*/ var - /*<>*/ width$2 = store_char(width$0, ib, c), - width$0 = width$2; + /*<>*/ /*<>*/ var + width$2 = store_char(width$0, ib, c); + width$0 = width$2; continue; } /*<>*/ return width$0; @@ -27505,43 +29756,37 @@ /*<>*/ if(ib[1]) /*<>*/ return width; /*<>*/ if ( /*<>*/ caml_call1(digitp, c)){ - /*<>*/ var - /*<>*/ width$0 = store_char(width, ib, c), - width = width$0; - continue; + /*<>*/ /*<>*/ var + width$0 = store_char(width, ib, c); + width = width$0; } - if(95 !== c) /*<>*/ return width; - /*<>*/ var - /*<>*/ width$1 = ignore_char(width, ib), + else{ + if(95 !== c) /*<>*/ return width; + /*<>*/ /*<>*/ var + width$1 = ignore_char(width, ib); width = width$1; + } } /*<>*/ } function is_binary_digit(param){ /*<>*/ return 1 < param - 48 >>> 0 ? 0 : 1; /*<>*/ } - /*<>*/ function scan_binary_int(_a1_, _a2_){ - /*<>*/ return scan_digit_plus(cst_binary, is_binary_digit, _a1_, _a2_); - } function is_octal_digit(param){ /*<>*/ return 7 < param - 48 >>> 0 ? 0 : 1; /*<>*/ } - /*<>*/ function scan_octal_int(_aZ_, _a0_){ - /*<>*/ return scan_digit_plus(cst_octal, is_octal_digit, _aZ_, _a0_); - } function is_hexa_digit(param){ - /*<>*/ var - /*<>*/ _aY_ = param - 48 | 0, - switch$0 = 0; - if(22 < _aY_ >>> 0){ - if(5 >= _aY_ - 49 >>> 0) switch$0 = 1; - } - else if(6 < _aY_ - 10 >>> 0) switch$0 = 1; - return switch$0 ? 1 : 0; + /*<>*/ /*<>*/ var + _aN_ = param - 48 | 0; + a: + { + if(22 < _aN_ >>> 0){ + if(5 < _aN_ - 49 >>> 0) break a; + } + else if(6 >= _aN_ - 10 >>> 0) break a; + /*<>*/ return 1; + } + /*<>*/ return 0; /*<>*/ } - /*<>*/ function scan_hexadecimal_int(_aW_, _aX_){ - /*<>*/ return scan_digit_plus - (cst_hexadecimal, is_hexa_digit, _aW_, _aX_); - } function scan_sign(width, ib){ /*<>*/ var /*<>*/ c = checked_peek_char(ib), @@ -27563,7 +29808,7 @@ function scan_int_conversion(conv, width$1, ib){ /*<>*/ switch(conv){ case 0: - /*<>*/ return scan_binary_int(width$1, ib); + return scan_digit_plus(cst_binary, is_binary_digit, width$1, ib); case 1: /*<>*/ return scan_optionally_signed_decimal (width$1, ib); @@ -27581,27 +29826,36 @@ c$0 = peek_char(ib); /*<>*/ if(ib[1]) /*<>*/ return width; - var switch$0 = 0; - if(99 <= c$0){ - if(111 === c$0) - /*<>*/ return scan_octal_int - (store_char(width, ib, c$0), ib); - if(120 === c$0) switch$0 = 1; + a: + { + if(99 <= c$0){ + if(111 === c$0) + return scan_digit_plus + (cst_octal, is_octal_digit, store_char(width, ib, c$0), ib); + if(120 === c$0) break a; + } + else{ + if(88 === c$0) break a; + if(98 <= c$0) + return scan_digit_plus + (cst_binary, + is_binary_digit, + store_char(width, ib, c$0), + ib); + } + /*<>*/ return scan_decimal_digit_star(width, ib); } - else if(88 === c$0) - switch$0 = 1; - else if(98 <= c$0) - /*<>*/ return scan_binary_int - (store_char(width, ib, c$0), ib); - return switch$0 - ? scan_hexadecimal_int(store_char(width, ib, c$0), ib) - : scan_decimal_digit_star(width, ib); + return scan_digit_plus + (cst_hexadecimal, + is_hexa_digit, + store_char(width, ib, c$0), + ib); case 3: - /*<>*/ return scan_octal_int(width$1, ib); + return scan_digit_plus(cst_octal, is_octal_digit, width$1, ib); case 4: /*<>*/ return scan_decimal_digit_plus(width$1, ib); default: - /*<>*/ return scan_hexadecimal_int(width$1, ib); + return scan_digit_plus(cst_hexadecimal, is_hexa_digit, width$1, ib); } /*<>*/ } function scan_fractional_part(width, ib){ @@ -27657,152 +29911,172 @@ /*<>*/ len = /*<>*/ caml_ml_string_length(str), /*<>*/ width$0 = [0, width], - /*<>*/ _aT_ = len - 1 | 0, - /*<>*/ _aS_ = 0; - if(_aT_ >= 0){ - var i = _aS_; + /*<>*/ _aK_ = len - 1 | 0, + /*<>*/ _aJ_ = 0; + if(_aK_ >= 0){ + var i = _aJ_; for(;;){ /*<>*/ var /*<>*/ c = peek_char(ib), - /*<>*/ _aU_ = + /*<>*/ _aL_ = lowercase( /*<>*/ caml_string_get(str, i)); - if(lowercase(c) !== _aU_) + if(lowercase(c) !== _aL_) /*<>*/ /*<>*/ caml_call1(error, 0); if(0 === width$0[1]) /*<>*/ /*<>*/ caml_call1(error, 0); width$0[1] = store_char(width$0[1], ib, c); - /*<>*/ /*<>*/ var _aV_ = i + 1 | 0; - if(_aT_ !== i){var i = _aV_; continue;} - break; + /*<>*/ /*<>*/ var _aM_ = i + 1 | 0; + if(_aK_ === i) break; + i = _aM_; } } return width$0[1]; /*<>*/ } function scan_hex_float(width, precision, ib){ /*<>*/ var - _aF_ = 0 === width ? 1 : 0, - _aG_ = _aF_ || end_of_input(ib); - /*<>*/ if(_aG_) - /*<>*/ bad_hex_float(0); + _aw_ = 0 === width ? 1 : 0, + _ax_ = _aw_ || end_of_input(ib); + /*<>*/ if(_ax_) + /*<>*/ bad_input(cst_not_a_valid_float_in_hexad); /*<>*/ var /*<>*/ width$0 = scan_sign(width, ib), - _aH_ = 0 === width$0 ? 1 : 0, - _aI_ = _aH_ || end_of_input(ib); - /*<>*/ if(_aI_) - /*<>*/ bad_hex_float(0); - /*<>*/ var - /*<>*/ c = peek_char(ib), - switch$0 = 0; - if(78 <= c){ - /*<>*/ /*<>*/ var - switcher = c - 79 | 0; - if(30 < switcher >>> 0){ - if(32 > switcher){ + _ay_ = 0 === width$0 ? 1 : 0, + _az_ = _ay_ || end_of_input(ib); + /*<>*/ if(_az_) + /*<>*/ bad_input(cst_not_a_valid_float_in_hexad); + /*<>*/ /*<>*/ var c = peek_char(ib); + a: + { + if(78 <= c){ + /*<>*/ /*<>*/ var + switcher = c - 79 | 0; + if(30 < switcher >>> 0){ + if(32 <= switcher) break a; /*<>*/ var /*<>*/ width$1 = store_char(width$0, ib, c), - _aJ_ = 0 === width$1 ? 1 : 0, - _aK_ = _aJ_ || end_of_input(ib); - /*<>*/ if(_aK_) - /*<>*/ bad_hex_float(0); + _aA_ = 0 === width$1 ? 1 : 0, + _aB_ = _aA_ || end_of_input(ib); + /*<>*/ if(_aB_) + /*<>*/ bad_input(cst_not_a_valid_float_in_hexad); /*<>*/ return check_case_insensitive_string (width$1, ib, bad_hex_float, cst_an); } + if(26 !== switcher) break a; } - else if(26 === switcher) switch$0 = 1; - } - else{ - if(48 === c){ - /*<>*/ var - /*<>*/ width$3 = store_char(width$0, ib, c), - _aN_ = 0 === width$3 ? 1 : 0, - _aO_ = _aN_ || end_of_input(ib); - /*<>*/ if(_aO_) - /*<>*/ bad_hex_float(0); - /*<>*/ /*<>*/ var - width$4 = - check_case_insensitive_string(width$3, ib, bad_hex_float, cst_x); - /*<>*/ if(0 !== width$4 && ! end_of_input(ib)){ - /*<>*/ var - /*<>*/ _aP_ = peek_char(ib) - 46 | 0, - switch$1 = 0; - if(34 < _aP_ >>> 0){ - if(66 === _aP_) switch$1 = 1; - } - else if(32 < _aP_ - 1 >>> 0) switch$1 = 1; - var width$5 = switch$1 ? width$4 : scan_hexadecimal_int(width$4, ib); - /*<>*/ if(0 !== width$5 && ! end_of_input(ib)){ - /*<>*/ /*<>*/ var - c$0 = peek_char(ib); - if(46 === c$0){ - /*<>*/ var - /*<>*/ width$6 = store_char(width$5, ib, c$0), - switch$2 = 0; - /*<>*/ if(0 !== width$6 && ! end_of_input(ib)){ - /*<>*/ var - /*<>*/ match = peek_char(ib), - switch$3 = 0; - if(80 !== match && 112 !== match){ - /*<>*/ var - /*<>*/ precision$0 = - /*<>*/ caml_call2 - (Stdlib_Int[10], width$6, precision), - width$10 = - width$6 - - (precision$0 - scan_hexadecimal_int(precision$0, ib) | 0) - | 0; - switch$3 = 1; + else{ + if(48 === c){ + /*<>*/ var + /*<>*/ width$3 = store_char(width$0, ib, c), + _aE_ = 0 === width$3 ? 1 : 0, + _aF_ = _aE_ || end_of_input(ib); + /*<>*/ if(_aF_) + /*<>*/ bad_input(cst_not_a_valid_float_in_hexad); + /*<>*/ /*<>*/ var + width$4 = + check_case_insensitive_string(width$3, ib, bad_hex_float, cst_x); + /*<>*/ if(0 !== width$4 && ! end_of_input(ib)){ + /*<>*/ /*<>*/ var + _aG_ = peek_char(ib) - 46 | 0; + b: + { + c: + { + if(34 < _aG_ >>> 0){ + if(66 === _aG_) break c; } - if(! switch$3) var width$10 = width$6; - var width$7 = width$10; - switch$2 = 1; + else if(32 < _aG_ - 1 >>> 0) break c; + var + width$5 = + scan_digit_plus(cst_hexadecimal, is_hexa_digit, width$4, ib); + break b; } - if(! switch$2) var width$7 = width$6; - var width$8 = width$7; + var width$5 = width$4; } - else - var width$8 = width$5; - /*<>*/ if(0 !== width$8 && ! end_of_input(ib)){ - /*<>*/ /*<>*/ var - c$1 = peek_char(ib); - if(80 !== c$1 && 112 !== c$1) - /*<>*/ return width$8; - /*<>*/ var - /*<>*/ width$9 = store_char(width$8, ib, c$1), - _aQ_ = 0 === width$9 ? 1 : 0, - _aR_ = _aQ_ || end_of_input(ib); - /*<>*/ if(_aR_) - /*<>*/ bad_hex_float(0); - /*<>*/ return scan_optionally_signed_decimal - (width$9, ib); + /*<>*/ if(0 !== width$5 && ! end_of_input(ib)){ + /*<>*/ /*<>*/ var + c$0 = peek_char(ib); + if(46 === c$0){ + /*<>*/ /*<>*/ var + width$6 = store_char(width$5, ib, c$0); + b: + { + /*<>*/ if(0 !== width$6 && ! end_of_input(ib)){ + /*<>*/ /*<>*/ var + match = peek_char(ib); + c: + { + if(80 !== match && 112 !== match){ + /*<>*/ var + /*<>*/ precision$0 = + /*<>*/ caml_call2 + (Stdlib_Int[10], width$6, precision), + width$10 = + width$6 + - + (precision$0 + - + scan_digit_plus + (cst_hexadecimal, is_hexa_digit, precision$0, ib) + | 0) + | 0; + break c; + } + var width$10 = width$6; + } + var width$7 = width$10; + break b; + } + var width$7 = width$6; + } + var width$8 = width$7; + } + else + var width$8 = width$5; + /*<>*/ if(0 !== width$8 && ! end_of_input(ib)){ + /*<>*/ /*<>*/ var + c$1 = peek_char(ib); + if(80 !== c$1 && 112 !== c$1) + /*<>*/ return width$8; + /*<>*/ var + /*<>*/ width$9 = store_char(width$8, ib, c$1), + _aH_ = 0 === width$9 ? 1 : 0, + _aI_ = _aH_ || end_of_input(ib); + /*<>*/ if(_aI_) + /*<>*/ bad_input(cst_not_a_valid_float_in_hexad); + /*<>*/ return scan_optionally_signed_decimal + (width$9, ib); + } + /*<>*/ return width$8; } - /*<>*/ return width$8; + /*<>*/ return width$5; } - /*<>*/ return width$5; + /*<>*/ return width$4; } - /*<>*/ return width$4; - } - if(73 === c) switch$0 = 1; - } - if(! switch$0) /*<>*/ return bad_hex_float(0); - /*<>*/ var - /*<>*/ width$2 = store_char(width$0, ib, c), - _aL_ = 0 === width$2 ? 1 : 0, - _aM_ = _aL_ || end_of_input(ib); - /*<>*/ if(_aM_) - /*<>*/ bad_hex_float(0); - /*<>*/ return check_case_insensitive_string - (width$2, ib, bad_hex_float, cst_nfinity); + if(73 !== c) break a; + } + /*<>*/ var + /*<>*/ width$2 = store_char(width$0, ib, c), + _aC_ = 0 === width$2 ? 1 : 0, + _aD_ = _aC_ || end_of_input(ib); + /*<>*/ if(_aD_) + /*<>*/ bad_input(cst_not_a_valid_float_in_hexad); + /*<>*/ return check_case_insensitive_string + (width$2, ib, bad_hex_float, cst_nfinity); + } + /*<>*/ return bad_input(cst_not_a_valid_float_in_hexad); /*<>*/ } function scan_caml_float_rest(width, precision, ib){ /*<>*/ var - _aB_ = 0 === width ? 1 : 0, - _aC_ = _aB_ || end_of_input(ib); - /*<>*/ if(_aC_) /*<>*/ bad_float(0); + _as_ = 0 === width ? 1 : 0, + _at_ = _as_ || end_of_input(ib); + /*<>*/ if(_at_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ var /*<>*/ width$0 = scan_decimal_digit_star(width, ib), - _aD_ = 0 === width$0 ? 1 : 0, - _aE_ = _aD_ || end_of_input(ib); - /*<>*/ if(_aE_) /*<>*/ bad_float(0); + _au_ = 0 === width$0 ? 1 : 0, + _av_ = _au_ || end_of_input(ib); + /*<>*/ if(_av_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ var /*<>*/ c = peek_char(ib), /*<>*/ switcher = c - 69 | 0; @@ -27822,26 +30096,29 @@ } else if(30 < switcher - 1 >>> 0) /*<>*/ return scan_exponent_part(width$0, ib); - /*<>*/ return bad_float(0); + /*<>*/ return bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ } function scan_caml_float(width, precision, ib){ /*<>*/ var - _an_ = 0 === width ? 1 : 0, - _ao_ = _an_ || end_of_input(ib); - /*<>*/ if(_ao_) /*<>*/ bad_float(0); + _ae_ = 0 === width ? 1 : 0, + _af_ = _ae_ || end_of_input(ib); + /*<>*/ if(_af_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ var /*<>*/ width$0 = scan_sign(width, ib), - _ap_ = 0 === width$0 ? 1 : 0, - _aq_ = _ap_ || end_of_input(ib); - /*<>*/ if(_aq_) /*<>*/ bad_float(0); + _ag_ = 0 === width$0 ? 1 : 0, + _ah_ = _ag_ || end_of_input(ib); + /*<>*/ if(_ah_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ /*<>*/ var c = peek_char(ib); if(49 <= c){ if(58 > c){ /*<>*/ var /*<>*/ width$1 = store_char(width$0, ib, c), - _ar_ = 0 === width$1 ? 1 : 0, - _as_ = _ar_ || end_of_input(ib); - /*<>*/ if(_as_) /*<>*/ bad_float(0); + _ai_ = 0 === width$1 ? 1 : 0, + _aj_ = _ai_ || end_of_input(ib); + /*<>*/ if(_aj_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ return scan_caml_float_rest (width$1, precision, ib); } @@ -27849,9 +30126,10 @@ else if(48 <= c){ /*<>*/ var /*<>*/ width$2 = store_char(width$0, ib, c), - _at_ = 0 === width$2 ? 1 : 0, - _au_ = _at_ || end_of_input(ib); - /*<>*/ if(_au_) /*<>*/ bad_float(0); + _ak_ = 0 === width$2 ? 1 : 0, + _al_ = _ak_ || end_of_input(ib); + /*<>*/ if(_al_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ /*<>*/ var c$0 = peek_char(ib); if(88 !== c$0 && 120 !== c$0) @@ -27859,68 +30137,83 @@ (width$2, precision, ib); /*<>*/ var /*<>*/ width$3 = store_char(width$2, ib, c$0), - _av_ = 0 === width$3 ? 1 : 0, - _aw_ = _av_ || end_of_input(ib); - /*<>*/ if(_aw_) /*<>*/ bad_float(0); - /*<>*/ var - /*<>*/ width$4 = scan_hexadecimal_int(width$3, ib), - _ax_ = 0 === width$4 ? 1 : 0, - _ay_ = _ax_ || end_of_input(ib); - /*<>*/ if(_ay_) /*<>*/ bad_float(0); + _am_ = 0 === width$3 ? 1 : 0, + _an_ = _am_ || end_of_input(ib); + /*<>*/ if(_an_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); + var + width$10 = scan_digit_plus(cst_hexadecimal, is_hexa_digit, width$3, ib), + _ao_ = 0 === width$10 ? 1 : 0, + _ap_ = _ao_ || end_of_input(ib); + /*<>*/ if(_ap_) + /*<>*/ bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ var /*<>*/ c$1 = peek_char(ib), - /*<>*/ switcher = c$1 - 80 | 0, - switch$0 = 0; - if(32 < switcher >>> 0) - if(-34 === switcher){ - /*<>*/ var - /*<>*/ width$5 = store_char(width$4, ib, c$1), - switch$1 = 0; - /*<>*/ if(0 !== width$5 && ! end_of_input(ib)){ - /*<>*/ var - /*<>*/ match = peek_char(ib), - switch$2 = 0; - if(80 !== match && 112 !== match){ - /*<>*/ var - /*<>*/ precision$0 = - /*<>*/ caml_call2 - (Stdlib_Int[10], width$5, precision), - width$10 = - width$5 - - (precision$0 - scan_hexadecimal_int(precision$0, ib) | 0) - | 0; - switch$2 = 1; + /*<>*/ switcher = c$1 - 80 | 0; + a: + { + b: + { + if(32 < switcher >>> 0){ + if(-34 === switcher){ + /*<>*/ /*<>*/ var + width$4 = store_char(width$10, ib, c$1); + c: + { + /*<>*/ if(0 !== width$4 && ! end_of_input(ib)){ + /*<>*/ /*<>*/ var + match = peek_char(ib); + d: + { + if(80 !== match && 112 !== match){ + /*<>*/ var + /*<>*/ precision$0 = + /*<>*/ caml_call2 + (Stdlib_Int[10], width$4, precision), + width$9 = + width$4 + - + (precision$0 + - + scan_digit_plus + (cst_hexadecimal, is_hexa_digit, precision$0, ib) + | 0) + | 0; + break d; + } + var width$9 = width$4; + } + var width$5 = width$9; + break c; + } + var width$5 = width$4; + } + var width$6 = width$5; + break b; } - if(! switch$2) var width$10 = width$5; - var width$6 = width$10; - switch$1 = 1; } - if(! switch$1) var width$6 = width$5; - var width$7 = width$6; + else if(30 < switcher - 1 >>> 0){var width$6 = width$10; break b;} + var width$7 = bad_input(cst_no_dot_or_exponent_part_fo); + break a; } - else - switch$0 = 1; - else if(30 < switcher - 1 >>> 0) - var width$7 = width$4; - else - switch$0 = 1; - var width$8 = switch$0 ? bad_float(0) : width$7; - /*<>*/ if(0 !== width$8 && ! end_of_input(ib)){ + var width$7 = width$6; + } + /*<>*/ if(0 !== width$7 && ! end_of_input(ib)){ /*<>*/ /*<>*/ var c$2 = peek_char(ib); - if(80 !== c$2 && 112 !== c$2) /*<>*/ return width$8; + if(80 !== c$2 && 112 !== c$2) /*<>*/ return width$7; /*<>*/ var - /*<>*/ width$9 = store_char(width$8, ib, c$2), - _az_ = 0 === width$9 ? 1 : 0, - _aA_ = _az_ || end_of_input(ib); - /*<>*/ if(_aA_) - /*<>*/ bad_hex_float(0); + /*<>*/ width$8 = store_char(width$7, ib, c$2), + _aq_ = 0 === width$8 ? 1 : 0, + _ar_ = _aq_ || end_of_input(ib); + /*<>*/ if(_ar_) + /*<>*/ bad_input(cst_not_a_valid_float_in_hexad); /*<>*/ return scan_optionally_signed_decimal - (width$9, ib); + (width$8, ib); } - /*<>*/ return width$8; + /*<>*/ return width$7; } - /*<>*/ return bad_float(0); + /*<>*/ return bad_input(cst_no_dot_or_exponent_part_fo); /*<>*/ } function scan_string(stp, width, ib){ /*<>*/ var width$0 = width; @@ -27929,25 +30222,29 @@ /*<>*/ /*<>*/ var c = peek_char(ib); /*<>*/ if(ib[1]) /*<>*/ return width$0; - if(stp){ - var c$0 = stp[1]; - if(c === c$0) /*<>*/ return skip_char(width$0, ib); - /*<>*/ var - /*<>*/ width$1 = store_char(width$0, ib, c), - width$0 = width$1; - continue; + if(! stp){ + /*<>*/ /*<>*/ var _ad_ = c - 9 | 0; + a: + { + if(4 < _ad_ >>> 0){ + if(23 === _ad_) break a; + } + else if(1 < _ad_ - 2 >>> 0) break a; + /*<>*/ /*<>*/ var + width$2 = store_char(width$0, ib, c); + width$0 = width$2; + continue; + } + /*<>*/ return width$0; } - /*<>*/ var - /*<>*/ _am_ = c - 9 | 0, - switch$0 = 0; - if(4 < _am_ >>> 0){ - if(23 === _am_) switch$0 = 1; + var c$0 = stp[1]; + if(c === c$0){ + /*<>*/ invalidate_current_char(ib); + /*<>*/ return width$0; } - else if(1 < _am_ - 2 >>> 0) switch$0 = 1; - if(switch$0) /*<>*/ return width$0; - /*<>*/ var - /*<>*/ width$2 = store_char(width$0, ib, c), - width$0 = width$2; + /*<>*/ /*<>*/ var + width$1 = store_char(width$0, ib, c); + width$0 = width$1; } /*<>*/ } function hexadecimal_value_of_char(c){ @@ -27965,176 +30262,173 @@ (Stdlib_Printf[4], _f_, message)) : c; /*<>*/ } - /*<>*/ function check_next_char_for_char(_ak_, _al_){ - /*<>*/ return check_next_char(cst_a_Char, _ak_, _al_); - } - /*<>*/ function check_next_char_for_string(_ai_, _aj_){ - /*<>*/ return check_next_char(cst_a_String, _ai_, _aj_); - } function scan_backslash_char(width, ib){ - /*<>*/ var - /*<>*/ c0 = check_next_char_for_char(width, ib), - switch$0 = 0; - if(40 <= c0){ - if(58 <= c0){ + /*<>*/ var c0 = check_next_char(cst_a_Char, width, ib); + a: + { + if(40 <= c0){ + if(58 > c0){ + if(48 > c0) break a; + /*<>*/ var + get_digit$0 = + function(param){ + /*<>*/ /*<>*/ var + c = next_char(ib); + return 9 < c - 48 >>> 0 ? bad_input_escape(c) : c; + /*<>*/ }, + /*<>*/ c1$0 = get_digit$0(0), + /*<>*/ c2$0 = get_digit$0(0), + c = + ((100 * (c0 - 48 | 0) | 0) + (10 * (c1$0 - 48 | 0) | 0) | 0) + + (c2$0 - 48 | 0) + | 0; + b: + { + if(0 <= c && 255 >= c){ + var _ab_ = /*<>*/ caml_call1(Stdlib[29], c); + break b; + } + var + _ab_ = + bad_input + ( /*<>*/ caml_call4 + (Stdlib_Printf[4], _l_, c0, c1$0, c2$0)); + } + /*<>*/ return store_char(width - 2 | 0, ib, _ab_); + } /*<>*/ /*<>*/ var switcher = c0 - 92 | 0; - if(28 >= switcher >>> 0) - switch(switcher){ - case 28: - /*<>*/ var - get_digit = - function(param){ - /*<>*/ var - /*<>*/ c = next_char(ib), - /*<>*/ _ah_ = c - 48 | 0, - switch$0 = 0; - if(22 < _ah_ >>> 0){ - if(5 >= _ah_ - 49 >>> 0) switch$0 = 1; + if(28 < switcher >>> 0) break a; + switch(switcher){ + case 28: + /*<>*/ var + get_digit = + function(param){ + /*<>*/ var + /*<>*/ c = next_char(ib), + /*<>*/ _ac_ = c - 48 | 0; + a: + { + if(22 < _ac_ >>> 0){ + if(5 < _ac_ - 49 >>> 0) break a; } - else if(6 < _ah_ - 10 >>> 0) switch$0 = 1; - return switch$0 ? c : bad_input_escape(c); - /*<>*/ }, - /*<>*/ c1 = get_digit(0), - /*<>*/ c2 = get_digit(0), - /*<>*/ _ad_ = hexadecimal_value_of_char(c2), - c$0 = (16 * hexadecimal_value_of_char(c1) | 0) + _ad_ | 0, - switch$1 = 0; + else if(6 >= _ac_ - 10 >>> 0) break a; + /*<>*/ return c; + } + /*<>*/ return bad_input_escape(c); + /*<>*/ }, + /*<>*/ c1 = get_digit(0), + /*<>*/ c2 = get_digit(0), + /*<>*/ ___ = hexadecimal_value_of_char(c2), + c$0 = (16 * hexadecimal_value_of_char(c1) | 0) + ___ | 0; + b: + { if(0 <= c$0 && 255 >= c$0){ - var _af_ = /*<>*/ caml_call1(Stdlib[29], c$0); - switch$1 = 1; + var _aa_ = /*<>*/ caml_call1(Stdlib[29], c$0); + break b; } - if(! switch$1) - var - _af_ = - bad_input - ( /*<>*/ caml_call3 - (Stdlib_Printf[4], _m_, c1, c2)); - /*<>*/ return store_char(width - 2 | 0, ib, _af_); - case 0: - case 6: - case 18: - case 22: - case 24: - switch$0 = 1; break; - } - } - else if(48 <= c0){ - /*<>*/ var - get_digit$0 = - function(param){ - /*<>*/ /*<>*/ var - c = next_char(ib); - return 9 < c - 48 >>> 0 ? bad_input_escape(c) : c; - /*<>*/ }, - /*<>*/ c1$0 = get_digit$0(0), - /*<>*/ c2$0 = get_digit$0(0), - c = - ((100 * (c0 - 48 | 0) | 0) + (10 * (c1$0 - 48 | 0) | 0) | 0) - + (c2$0 - 48 | 0) - | 0, - switch$2 = 0; - if(0 <= c && 255 >= c){ - var _ag_ = /*<>*/ caml_call1(Stdlib[29], c); - switch$2 = 1; - } - if(! switch$2) - var - _ag_ = - bad_input - ( /*<>*/ caml_call4 - (Stdlib_Printf[4], _l_, c0, c1$0, c2$0)); - /*<>*/ return store_char(width - 2 | 0, ib, _ag_); - } - } - else if(34 === c0 || 39 <= c0) switch$0 = 1; - if(! switch$0) /*<>*/ return bad_input_escape(c0); - var switch$3 = 0; - if(110 <= c0) - if(117 <= c0) - switch$3 = 1; - else - switch(c0 - 110 | 0){ + var + _aa_ = + bad_input + ( /*<>*/ caml_call3 + (Stdlib_Printf[4], _m_, c1, c2)); + } + /*<>*/ return store_char(width - 2 | 0, ib, _aa_); case 0: - var _ae_ = 10; break; - case 4: - var _ae_ = 13; break; case 6: - var _ae_ = 9; break; - default: switch$3 = 1; + case 18: + case 22: + case 24: break; + default: break a; + } + } + else if(34 !== c0 && 39 > c0) break a; + b: + { + if(110 <= c0){ + if(117 > c0) + switch(c0 - 110 | 0){ + case 0: + var _$_ = 10; break b; + case 4: + var _$_ = 13; break b; + case 6: + var _$_ = 9; break b; + } } - else if(98 === c0) var _ae_ = 8; else switch$3 = 1; - if(switch$3) var _ae_ = c0; - /*<>*/ return store_char(width, ib, _ae_); + else if(98 === c0){var _$_ = 8; break b;} + var _$_ = c0; + } + /*<>*/ return store_char(width, ib, _$_); + } + /*<>*/ return bad_input_escape(c0); /*<>*/ } function scan_caml_string(width, ib){ function find_stop$0(counter, width){ /*<>*/ var width$0 = width; /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - c = check_next_char_for_string(width$0, ib); + var c = check_next_char(cst_a_String, width$0, ib); if(34 === c) /*<>*/ return ignore_char(width$0, ib); - if(92 !== c){ - /*<>*/ var - /*<>*/ width$2 = store_char(width$0, ib, c), - width$0 = width$2; - continue; - } - /*<>*/ var - /*<>*/ width$1 = ignore_char(width$0, ib), - /*<>*/ match = - check_next_char_for_string(width$1, ib); - if(10 === match){ - /*<>*/ /*<>*/ var - _ab_ = ignore_char(width$1, ib); - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (skip_spaces, [0, _ab_]); - var counter$0 = counter + 1 | 0; - /*<>*/ return skip_spaces(counter$0, _ab_); - } - if(13 !== match){ - /*<>*/ var - /*<>*/ width$4 = scan_backslash_char(width$1, ib), + if(92 === c){ + /*<>*/ var + /*<>*/ width$1 = ignore_char(width$0, ib), + match = check_next_char(cst_a_String, width$1, ib); + if(10 === match){ + /*<>*/ /*<>*/ var + _Y_ = ignore_char(width$1, ib); + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (skip_spaces, [0, _Y_]); + var counter$0 = counter + 1 | 0; + /*<>*/ return skip_spaces(counter$0, _Y_); + } + if(13 === match){ + /*<>*/ /*<>*/ var + width$3 = ignore_char(width$1, ib); + if(10 === check_next_char(cst_a_String, width$3, ib)){ + /*<>*/ /*<>*/ var + _Z_ = ignore_char(width$3, ib); + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (skip_spaces, [0, _Z_]); + var counter$1 = counter + 1 | 0; + /*<>*/ return skip_spaces(counter$1, _Z_); + } + /*<>*/ /*<>*/ var + width$5 = store_char(width$3, ib, 13); + width$0 = width$5; + } + else{ + /*<>*/ /*<>*/ var + width$4 = scan_backslash_char(width$1, ib); width$0 = width$4; - continue; + } } - /*<>*/ /*<>*/ var - width$3 = ignore_char(width$1, ib); - if(10 !== check_next_char_for_string(width$3, ib)){ - /*<>*/ var - /*<>*/ width$5 = store_char(width$3, ib, 13), - width$0 = width$5; - continue; + else{ + /*<>*/ /*<>*/ var + width$2 = store_char(width$0, ib, c); + width$0 = width$2; } - /*<>*/ /*<>*/ var - _ac_ = ignore_char(width$3, ib); - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (skip_spaces, [0, _ac_]); - var counter$1 = counter + 1 | 0; - /*<>*/ return skip_spaces(counter$1, _ac_); } /*<>*/ } + function find_stop(width){ + /*<>*/ return caml_trampoline(find_stop$0(0, width)); + } function skip_spaces(counter, width){ /*<>*/ var width$0 = width; /*<>*/ for(;;){ - if(32 === check_next_char_for_string(width$0, ib)){ - /*<>*/ var - /*<>*/ width$1 = ignore_char(width$0, ib), - width$0 = width$1; - continue; + if(32 !== check_next_char(cst_a_String, width$0, ib)){ + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (find_stop$0, [0, width$0]); + var counter$0 = counter + 1 | 0; + /*<>*/ return find_stop$0(counter$0, width$0); } - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (find_stop$0, [0, width$0]); - var counter$0 = counter + 1 | 0; - /*<>*/ return find_stop$0(counter$0, width$0); + /*<>*/ /*<>*/ var + width$1 = ignore_char(width$0, ib); + width$0 = width$1; } /*<>*/ } - function find_stop(width){ - /*<>*/ return caml_trampoline(find_stop$0(0, width)); - } /*<>*/ /*<>*/ var c = checked_peek_char(ib); return 34 === c @@ -28147,31 +30441,32 @@ /*<>*/ for(;;){ /*<>*/ var /*<>*/ c = peek_char(ib), - _Z_ = 0 < i$0 ? 1 : 0; - if(_Z_){ + _U_ = 0 < i$0 ? 1 : 0; + if(_U_){ /*<>*/ /*<>*/ var - ___ = 1 - ib[1]; - if(___) + _V_ = 1 - ib[1]; + if(_V_) /*<>*/ var - /*<>*/ _$_ = + /*<>*/ _W_ = /*<>*/ caml_call2 (CamlinternalFormat[1], char_set, c), - /*<>*/ _aa_ = _$_ ? c !== stp ? 1 : 0 : _$_; + /*<>*/ _X_ = _W_ ? c !== stp ? 1 : 0 : _W_; else - var _aa_ = ___; + var _X_ = _V_; } else - var _aa_ = _Z_; - if(! _aa_) return _aa_; + var _X_ = _U_; + if(! _X_) return _X_; /*<>*/ store_char(Stdlib[19], ib, c); - var i$1 = i$0 - 1 | 0, i$0 = i$1; + var i$1 = i$0 - 1 | 0; + i$0 = i$1; } /*<>*/ } if(! scan_indic) /*<>*/ return scan_chars(width, -1); var c = scan_indic[1]; /*<>*/ scan_chars(width, c); - /*<>*/ /*<>*/ var _Y_ = 1 - ib[1]; - if(! _Y_) /*<>*/ return _Y_; + /*<>*/ /*<>*/ var _T_ = 1 - ib[1]; + if(! _T_) /*<>*/ return _T_; /*<>*/ /*<>*/ var ci = peek_char(ib); return c === ci ? invalidate_current_char(ib) : character_mismatch(c, ci); @@ -28206,7 +30501,7 @@ /*<>*/ caml_string_get(str, 1), /*<>*/ sub_str = /*<>*/ caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], str, 2, /*<>*/ caml_ml_string_length(str) - 2 | 0); @@ -28220,74 +30515,75 @@ (k, 0); switch(fmt$0[0]){ case 0: - var rest = fmt$0[1], fmt$0 = rest; continue; + var rest = fmt$0[1]; fmt$0 = rest; break; case 1: - var rest$0 = fmt$0[1], fmt$0 = rest$0; continue; + var rest$0 = fmt$0[1]; fmt$0 = rest$0; break; case 2: - var rest$1 = fmt$0[2], fmt$0 = rest$1; continue; + var rest$1 = fmt$0[2]; fmt$0 = rest$1; break; case 3: - var rest$2 = fmt$0[2], fmt$0 = rest$2; continue; + var rest$2 = fmt$0[2]; fmt$0 = rest$2; break; case 4: - var rest$3 = fmt$0[4], fmt$0 = rest$3; continue; + var rest$3 = fmt$0[4]; fmt$0 = rest$3; break; case 5: - var rest$4 = fmt$0[4], fmt$0 = rest$4; continue; + var rest$4 = fmt$0[4]; fmt$0 = rest$4; break; case 6: - var rest$5 = fmt$0[4], fmt$0 = rest$5; continue; + var rest$5 = fmt$0[4]; fmt$0 = rest$5; break; case 7: - var rest$6 = fmt$0[4], fmt$0 = rest$6; continue; + var rest$6 = fmt$0[4]; fmt$0 = rest$6; break; case 8: - var rest$7 = fmt$0[4], fmt$0 = rest$7; continue; + var rest$7 = fmt$0[4]; fmt$0 = rest$7; break; case 9: - var rest$8 = fmt$0[2], fmt$0 = rest$8; continue; + var rest$8 = fmt$0[2]; fmt$0 = rest$8; break; case 10: - var rest$9 = fmt$0[1], fmt$0 = rest$9; continue; + var rest$9 = fmt$0[1]; fmt$0 = rest$9; break; case 11: - var rest$10 = fmt$0[2], fmt$0 = rest$10; continue; + var rest$10 = fmt$0[2]; fmt$0 = rest$10; break; case 12: - var rest$11 = fmt$0[2], fmt$0 = rest$11; continue; + var rest$11 = fmt$0[2]; fmt$0 = rest$11; break; case 13: - var rest$12 = fmt$0[3], fmt$0 = rest$12; continue; + var rest$12 = fmt$0[3]; fmt$0 = rest$12; break; case 14: /*<>*/ var rest$13 = fmt$0[3], fmtty = fmt$0[2], - /*<>*/ _V_ = + /*<>*/ _Q_ = /*<>*/ caml_call1(CamlinternalFormat[21], fmtty), - /*<>*/ _W_ = + /*<>*/ _R_ = /*<>*/ caml_call1 - (CamlinternalFormatBasics[2], _V_); + (CamlinternalFormatBasics[2], _Q_); /*<>*/ if(counter >= 50) /*<>*/ return /*<>*/ caml_trampoline_return - (take_fmtty_format_readers$0, [0, k, _W_, rest$13]); + (take_fmtty_format_readers$0, [0, k, _R_, rest$13]); var counter$0 = counter + 1 | 0; /*<>*/ return take_fmtty_format_readers$0 - (counter$0, k, _W_, rest$13); + (counter$0, k, _R_, rest$13); case 15: - var rest$14 = fmt$0[1], fmt$0 = rest$14; continue; + var rest$14 = fmt$0[1]; fmt$0 = rest$14; break; case 16: - var rest$15 = fmt$0[1], fmt$0 = rest$15; continue; + var rest$15 = fmt$0[1]; fmt$0 = rest$15; break; case 17: - var rest$16 = fmt$0[2], fmt$0 = rest$16; continue; + var rest$16 = fmt$0[2]; fmt$0 = rest$16; break; case 18: - var _X_ = fmt$0[1]; - if(0 === _X_[0]){ + var _S_ = fmt$0[1]; + if(0 === _S_[0]){ /*<>*/ var rest$17 = fmt$0[2], - fmt$1 = _X_[1][1], + fmt$1 = _S_[1][1], /*<>*/ fmt$2 = /*<>*/ caml_call2 - (CamlinternalFormatBasics[3], fmt$1, rest$17), - fmt$0 = fmt$2; - continue; + (CamlinternalFormatBasics[3], fmt$1, rest$17); + fmt$0 = fmt$2; } - /*<>*/ var - rest$18 = fmt$0[2], - fmt$3 = _X_[1][1], - /*<>*/ fmt$4 = - /*<>*/ caml_call2 - (CamlinternalFormatBasics[3], fmt$3, rest$18), + else{ + /*<>*/ var + rest$18 = fmt$0[2], + fmt$3 = _S_[1][1], + /*<>*/ fmt$4 = + /*<>*/ caml_call2 + (CamlinternalFormatBasics[3], fmt$3, rest$18); fmt$0 = fmt$4; - continue; + } + break; case 19: var fmt_rest = fmt$0[1]; /*<>*/ return function(reader){ @@ -28297,19 +30593,19 @@ /*<>*/ } /*<>*/ return take_format_readers(new_k, fmt_rest); /*<>*/ }; case 20: - var rest$19 = fmt$0[3], fmt$0 = rest$19; continue; + var rest$19 = fmt$0[3]; fmt$0 = rest$19; break; case 21: - var rest$20 = fmt$0[2], fmt$0 = rest$20; continue; + var rest$20 = fmt$0[2]; fmt$0 = rest$20; break; case 22: - var rest$21 = fmt$0[1], fmt$0 = rest$21; continue; + var rest$21 = fmt$0[1]; fmt$0 = rest$21; break; case 23: var rest$22 = fmt$0[2], ign = fmt$0[1]; if(typeof ign === "number") switch(ign){ case 0: - var fmt$0 = rest$22; continue; + fmt$0 = rest$22; break; case 1: - var fmt$0 = rest$22; continue; + fmt$0 = rest$22; break; case 2: /*<>*/ return function(reader){ function new_k(readers_rest){ @@ -28318,163 +30614,124 @@ /*<>*/ } /*<>*/ return take_format_readers (new_k, rest$22); /*<>*/ }; - default: var fmt$0 = rest$22; continue; + default: fmt$0 = rest$22; } - switch(ign[0]){ - case 0: - var fmt$0 = rest$22; continue; - case 1: - var fmt$0 = rest$22; continue; - case 2: - var fmt$0 = rest$22; continue; - case 3: - var fmt$0 = rest$22; continue; - case 4: - var fmt$0 = rest$22; continue; - case 5: - var fmt$0 = rest$22; continue; - case 6: - var fmt$0 = rest$22; continue; - case 7: - var fmt$0 = rest$22; continue; - case 8: - var fmt$0 = rest$22; continue; - case 9: - var fmtty$0 = ign[2]; - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (take_fmtty_format_readers$0, [0, k, fmtty$0, rest$22]); - var counter$1 = counter + 1 | 0; - /*<>*/ return take_fmtty_format_readers$0 - (counter$1, k, fmtty$0, rest$22); - case 10: - var fmt$0 = rest$22; continue; - default: var fmt$0 = rest$22; continue; - } - default: var rest$23 = fmt$0[3], fmt$0 = rest$23; continue; - } - } - /*<>*/ } - function take_fmtty_format_readers$0(counter, k, fmtty, fmt){ - /*<>*/ var fmtty$0 = fmtty; - /*<>*/ for(;;){ - if(typeof fmtty$0 !== "number") - switch(fmtty$0[0]){ - case 0: - var fmtty$1 = fmtty$0[1], fmtty$0 = fmtty$1; continue; - case 1: - var fmtty$2 = fmtty$0[1], fmtty$0 = fmtty$2; continue; - case 2: - var fmtty$3 = fmtty$0[1], fmtty$0 = fmtty$3; continue; - case 3: - var fmtty$4 = fmtty$0[1], fmtty$0 = fmtty$4; continue; - case 4: - var fmtty$5 = fmtty$0[1], fmtty$0 = fmtty$5; continue; - case 5: - var fmtty$6 = fmtty$0[1], fmtty$0 = fmtty$6; continue; - case 6: - var fmtty$7 = fmtty$0[1], fmtty$0 = fmtty$7; continue; - case 7: - var fmtty$8 = fmtty$0[1], fmtty$0 = fmtty$8; continue; - case 8: - var fmtty$9 = fmtty$0[2], fmtty$0 = fmtty$9; continue; - case 9: - /*<>*/ var - rest = fmtty$0[3], - ty2 = fmtty$0[2], - ty1 = fmtty$0[1], - /*<>*/ _U_ = - /*<>*/ caml_call1(CamlinternalFormat[21], ty1), - /*<>*/ ty = - /*<>*/ caml_call2 - (CamlinternalFormat[22], _U_, ty2), - /*<>*/ fmtty$10 = - /*<>*/ caml_call2 - (CamlinternalFormatBasics[1], ty, rest), - fmtty$0 = fmtty$10; - continue; - case 10: - var fmtty$11 = fmtty$0[1], fmtty$0 = fmtty$11; continue; - case 11: - var fmtty$12 = fmtty$0[1], fmtty$0 = fmtty$12; continue; - case 12: - var fmtty$13 = fmtty$0[1], fmtty$0 = fmtty$13; continue; - case 13: - var fmt_rest = fmtty$0[1]; - /*<>*/ return function(reader){ - function new_k(readers_rest){ - /*<>*/ return /*<>*/ caml_call1 - (k, [0, reader, readers_rest]); - /*<>*/ } - /*<>*/ return take_fmtty_format_readers - (new_k, fmt_rest, fmt); /*<>*/ }; - default: - var fmt_rest$0 = fmtty$0[1]; - /*<>*/ return function(reader){ - function new_k(readers_rest){ - /*<>*/ return /*<>*/ caml_call1 - (k, [0, reader, readers_rest]); - /*<>*/ } - /*<>*/ return take_fmtty_format_readers - (new_k, fmt_rest$0, fmt); /*<>*/ }; - } - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (take_format_readers$0, [0, k, fmt]); - var counter$0 = counter + 1 | 0; - /*<>*/ return take_format_readers$0(counter$0, k, fmt); + else + switch(ign[0]){ + case 0: + fmt$0 = rest$22; break; + case 1: + fmt$0 = rest$22; break; + case 2: + fmt$0 = rest$22; break; + case 3: + fmt$0 = rest$22; break; + case 4: + fmt$0 = rest$22; break; + case 5: + fmt$0 = rest$22; break; + case 6: + fmt$0 = rest$22; break; + case 7: + fmt$0 = rest$22; break; + case 8: + fmt$0 = rest$22; break; + case 9: + var fmtty$0 = ign[2]; + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (take_fmtty_format_readers$0, [0, k, fmtty$0, rest$22]); + var counter$1 = counter + 1 | 0; + /*<>*/ return take_fmtty_format_readers$0 + (counter$1, k, fmtty$0, rest$22); + case 10: + fmt$0 = rest$22; break; + default: fmt$0 = rest$22; + } + break; + default: var rest$23 = fmt$0[3]; fmt$0 = rest$23; + } } - /*<>*/ } + /*<>*/ } function take_format_readers(k, fmt){ /*<>*/ return caml_trampoline(take_format_readers$0(0, k, fmt)); } + function take_fmtty_format_readers$0(counter, k, fmtty, fmt){ + /*<>*/ var fmtty$0 = fmtty; + /*<>*/ for(;;){ + if(typeof fmtty$0 === "number"){ + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (take_format_readers$0, [0, k, fmt]); + var counter$0 = counter + 1 | 0; + /*<>*/ return take_format_readers$0 + (counter$0, k, fmt); + } + switch(fmtty$0[0]){ + case 0: + var fmtty$1 = fmtty$0[1]; fmtty$0 = fmtty$1; break; + case 1: + var fmtty$2 = fmtty$0[1]; fmtty$0 = fmtty$2; break; + case 2: + var fmtty$3 = fmtty$0[1]; fmtty$0 = fmtty$3; break; + case 3: + var fmtty$4 = fmtty$0[1]; fmtty$0 = fmtty$4; break; + case 4: + var fmtty$5 = fmtty$0[1]; fmtty$0 = fmtty$5; break; + case 5: + var fmtty$6 = fmtty$0[1]; fmtty$0 = fmtty$6; break; + case 6: + var fmtty$7 = fmtty$0[1]; fmtty$0 = fmtty$7; break; + case 7: + var fmtty$8 = fmtty$0[1]; fmtty$0 = fmtty$8; break; + case 8: + var fmtty$9 = fmtty$0[2]; fmtty$0 = fmtty$9; break; + case 9: + /*<>*/ var + rest = fmtty$0[3], + ty2 = fmtty$0[2], + ty1 = fmtty$0[1], + /*<>*/ _P_ = + /*<>*/ caml_call1(CamlinternalFormat[21], ty1), + /*<>*/ ty = + /*<>*/ caml_call2 + (CamlinternalFormat[22], _P_, ty2), + /*<>*/ fmtty$10 = + /*<>*/ caml_call2 + (CamlinternalFormatBasics[1], ty, rest); + fmtty$0 = fmtty$10; + break; + case 10: + var fmtty$11 = fmtty$0[1]; fmtty$0 = fmtty$11; break; + case 11: + var fmtty$12 = fmtty$0[1]; fmtty$0 = fmtty$12; break; + case 12: + var fmtty$13 = fmtty$0[1]; fmtty$0 = fmtty$13; break; + case 13: + var fmt_rest = fmtty$0[1]; + /*<>*/ return function(reader){ + function new_k(readers_rest){ + /*<>*/ return /*<>*/ caml_call1 + (k, [0, reader, readers_rest]); + /*<>*/ } + /*<>*/ return take_fmtty_format_readers + (new_k, fmt_rest, fmt); /*<>*/ }; + default: + var fmt_rest$0 = fmtty$0[1]; + /*<>*/ return function(reader){ + function new_k(readers_rest){ + /*<>*/ return /*<>*/ caml_call1 + (k, [0, reader, readers_rest]); + /*<>*/ } + /*<>*/ return take_fmtty_format_readers + (new_k, fmt_rest$0, fmt); /*<>*/ }; + } + } + /*<>*/ } function take_fmtty_format_readers(k, fmtty, fmt){ /*<>*/ return caml_trampoline (take_fmtty_format_readers$0(0, k, fmtty, fmt)); } - function pad_prec_scanf(ib, fmt, readers, pad, prec, scan, token){ - /*<>*/ if(typeof pad === "number"){ - if(typeof prec !== "number"){ - var p = prec[1]; - /*<>*/ /*<>*/ caml_call3 - (scan, Stdlib[19], p, ib); - /*<>*/ /*<>*/ var - x$0 = /*<>*/ caml_call1(token, ib); - /*<>*/ return [0, x$0, make_scanf(ib, fmt, readers)]; - } - if(prec) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_scanf_bad_conversion); - /*<>*/ /*<>*/ caml_call3 - (scan, Stdlib[19], Stdlib[19], ib); - /*<>*/ /*<>*/ var - x = /*<>*/ caml_call1(token, ib); - /*<>*/ return [0, x, make_scanf(ib, fmt, readers)]; - } - if(0 !== pad[0]) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_scanf_bad_conversion$2); - if(! pad[1]) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_scanf_bad_conversion$1); - var w = pad[2]; - if(typeof prec !== "number"){ - var p$0 = prec[1]; - /*<>*/ /*<>*/ caml_call3 - (scan, w, p$0, ib); - /*<>*/ /*<>*/ var - x$2 = /*<>*/ caml_call1(token, ib); - /*<>*/ return [0, x$2, make_scanf(ib, fmt, readers)]; - } - if(prec) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_scanf_bad_conversion$0); - /*<>*/ /*<>*/ caml_call3 - (scan, w, Stdlib[19], ib); - /*<>*/ /*<>*/ var - x$1 = /*<>*/ caml_call1(token, ib); - /*<>*/ return [0, x$1, make_scanf(ib, fmt, readers)]; - /*<>*/ } function make_scanf(ib, fmt, readers){ /*<>*/ var fmt$0 = fmt; /*<>*/ for(;;){ @@ -28484,39 +30741,39 @@ var rest = fmt$0[1]; /*<>*/ store_char(0, ib, checked_peek_char(ib)); /*<>*/ /*<>*/ var - c$1 = token_char(ib); + c$0 = token_char(ib); /*<>*/ return [0, - c$1, + c$0, make_scanf(ib, rest, readers)]; case 1: - /*<>*/ var + /*<>*/ var rest$0 = fmt$0[1], - /*<>*/ width$0 = 0, find_stop = function(width){ - /*<>*/ /*<>*/ var - c = check_next_char_for_char(width, ib); + /*<>*/ var + c = check_next_char(cst_a_Char, width, ib); return 39 === c ? ignore_char(width, ib) : character_mismatch(39, c); /*<>*/ }, - /*<>*/ c = checked_peek_char(ib); + /*<>*/ c = checked_peek_char(ib), + /*<>*/ width$0 = 0; if(39 === c){ /*<>*/ var /*<>*/ width = ignore_char(width$0, ib), - /*<>*/ c$0 = check_next_char_for_char(width, ib); - if(92 === c$0) + c$3 = check_next_char(cst_a_Char, width, ib); + if(92 === c$3) /*<>*/ find_stop (scan_backslash_char(ignore_char(width, ib), ib)); else - /*<>*/ find_stop(store_char(width, ib, c$0)); + /*<>*/ find_stop(store_char(width, ib, c$3)); } else /*<>*/ character_mismatch(39, c); /*<>*/ /*<>*/ var - c$2 = token_char(ib); + c$1 = token_char(ib); /*<>*/ return [0, - c$2, + c$1, make_scanf(ib, rest$0, readers)]; case 2: var pad = fmt$0[1], match = fmt$0[2]; @@ -28539,11 +30796,11 @@ /*<>*/ return pad_prec_scanf (ib, str_rest, readers, pad, 0, scan$0, token_string); case 18: - var _G_ = match[1]; - if(0 === _G_[0]){ + var _D_ = match[1]; + if(0 === _D_[0]){ /*<>*/ var rest$3 = match[2], - fmt$1 = _G_[1][1], + fmt$1 = _D_[1][1], /*<>*/ scan$1 = function(width, param, ib){ /*<>*/ return scan_string(_q_, width, ib); @@ -28560,7 +30817,7 @@ } /*<>*/ var rest$4 = match[2], - fmt$2 = _G_[1][1], + fmt$2 = _D_[1][1], /*<>*/ scan$2 = function(width, param, ib){ /*<>*/ return scan_string(_r_, width, ib); @@ -28737,7 +30994,7 @@ rest$13 = fmt$0[2], pad$8 = fmt$0[1], /*<>*/ scan$8 = - function(param, _T_, ib){ + function(_O_, param, ib){ /*<>*/ var /*<>*/ c = checked_peek_char(ib), /*<>*/ m = @@ -28757,23 +31014,21 @@ var rest$14 = fmt$0[1]; /*<>*/ if(! end_of_input(ib)) /*<>*/ return bad_input(cst_end_of_input_not_found); - var fmt$0 = rest$14; - continue; + fmt$0 = rest$14; + break; case 11: - /*<>*/ var - rest$15 = fmt$0[2], - str$0 = fmt$0[1], - /*<>*/ _H_ = - function(_S_){ /*<>*/ return check_char(ib, _S_);}; + var rest$15 = fmt$0[2], str$0 = fmt$0[1]; /*<>*/ /*<>*/ caml_call2 - (Stdlib_String[29], _H_, str$0); - var fmt$0 = rest$15; - continue; + (Stdlib_String[30], + function(_N_){ /*<>*/ return check_char(ib, _N_);}, + str$0); + fmt$0 = rest$15; + break; case 12: var rest$16 = fmt$0[2], chr = fmt$0[1]; /*<>*/ check_char(ib, chr); - var fmt$0 = rest$16; - continue; + fmt$0 = rest$16; + break; case 13: var rest$17 = fmt$0[3], fmtty = fmt$0[2], pad_opt = fmt$0[1]; /*<>*/ scan_caml_string @@ -28782,10 +31037,10 @@ s = token_string(ib); /*<>*/ try{ /*<>*/ var - /*<>*/ _I_ = + /*<>*/ _E_ = /*<>*/ caml_call2 (CamlinternalFormat[14], s, fmtty), - fmt$3 = _I_; + fmt$3 = _E_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -28811,23 +31066,23 @@ /*<>*/ caml_call2 (CamlinternalFormat[13], 0, s$0) [1], - /*<>*/ _K_ = + /*<>*/ _G_ = /*<>*/ caml_call1 (CamlinternalFormat[21], fmtty$0), - /*<>*/ _L_ = + /*<>*/ _H_ = /*<>*/ caml_call1 - (CamlinternalFormatBasics[2], _K_), + (CamlinternalFormatBasics[2], _G_), /*<>*/ fmt$8 = /*<>*/ caml_call2 - (CamlinternalFormat[12], fmt$7, _L_), - /*<>*/ _M_ = + (CamlinternalFormat[12], fmt$7, _H_), + /*<>*/ _I_ = /*<>*/ caml_call1 (CamlinternalFormatBasics[2], fmtty$0), - /*<>*/ _N_ = + /*<>*/ _J_ = /*<>*/ caml_call2 - (CamlinternalFormat[12], fmt$6, _M_), + (CamlinternalFormat[12], fmt$6, _I_), fmt$5 = fmt$8, - fmt$4 = _N_; + fmt$4 = _J_; } catch(exn){ var exn$0 = caml_wrap_exception(exn); @@ -28835,9 +31090,9 @@ throw caml_maybe_attach_backtrace(exn$0, 0); var msg$0 = exn$0[2], - _J_ = bad_input(msg$0), - fmt$5 = _J_[2], - fmt$4 = _J_[1]; + _F_ = bad_input(msg$0), + fmt$5 = _F_[2], + fmt$4 = _F_[1]; } /*<>*/ return [0, [0, fmt$4, s$0], @@ -28856,37 +31111,38 @@ /*<>*/ var rest$19 = fmt$0[2], formatting_lit = fmt$0[1], - /*<>*/ _O_ = + /*<>*/ _K_ = /*<>*/ caml_call1 - (CamlinternalFormat[17], formatting_lit), - /*<>*/ _P_ = - function(_R_){ /*<>*/ return check_char(ib, _R_);}; + (CamlinternalFormat[17], formatting_lit); /*<>*/ /*<>*/ caml_call2 - (Stdlib_String[29], _P_, _O_); - var fmt$0 = rest$19; - continue; + (Stdlib_String[30], + function(_M_){ /*<>*/ return check_char(ib, _M_);}, + _K_); + fmt$0 = rest$19; + break; case 18: - var _Q_ = fmt$0[1]; - if(0 === _Q_[0]){ - var rest$20 = fmt$0[2], fmt$9 = _Q_[1][1]; + var _L_ = fmt$0[1]; + if(0 === _L_[0]){ + var rest$20 = fmt$0[2], fmt$9 = _L_[1][1]; /*<>*/ check_char(ib, 64); /*<>*/ check_char(ib, 123); - /*<>*/ var - /*<>*/ fmt$10 = + /*<>*/ /*<>*/ var + fmt$10 = /*<>*/ caml_call2 - (CamlinternalFormatBasics[3], fmt$9, rest$20), - fmt$0 = fmt$10; - continue; + (CamlinternalFormatBasics[3], fmt$9, rest$20); + fmt$0 = fmt$10; } - var rest$21 = fmt$0[2], fmt$11 = _Q_[1][1]; - /*<>*/ check_char(ib, 64); - /*<>*/ check_char(ib, 91); - /*<>*/ var - /*<>*/ fmt$12 = - /*<>*/ caml_call2 - (CamlinternalFormatBasics[3], fmt$11, rest$21), + else{ + var rest$21 = fmt$0[2], fmt$11 = _L_[1][1]; + /*<>*/ check_char(ib, 64); + /*<>*/ check_char(ib, 91); + /*<>*/ /*<>*/ var + fmt$12 = + /*<>*/ caml_call2 + (CamlinternalFormatBasics[3], fmt$11, rest$21); fmt$0 = fmt$12; - continue; + } + break; case 19: var fmt_rest = fmt$0[1]; /*<>*/ if(! readers) @@ -28947,9 +31203,9 @@ case 22: /*<>*/ var rest$25 = fmt$0[1], - /*<>*/ c$3 = checked_peek_char(ib); + /*<>*/ c$2 = checked_peek_char(ib); /*<>*/ return [0, - c$3, + c$2, make_scanf(ib, rest$25, readers)]; case 23: /*<>*/ var @@ -28971,6 +31227,49 @@ } } /*<>*/ } + function pad_prec_scanf(ib, fmt, readers, pad, prec, scan, token){ + /*<>*/ if(typeof pad === "number"){ + if(typeof prec !== "number"){ + var p = prec[1]; + /*<>*/ /*<>*/ caml_call3 + (scan, Stdlib[19], p, ib); + /*<>*/ /*<>*/ var + x$0 = /*<>*/ caml_call1(token, ib); + /*<>*/ return [0, x$0, make_scanf(ib, fmt, readers)]; + } + if(prec) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_scanf_bad_conversion); + /*<>*/ /*<>*/ caml_call3 + (scan, Stdlib[19], Stdlib[19], ib); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call1(token, ib); + /*<>*/ return [0, x, make_scanf(ib, fmt, readers)]; + } + if(0 !== pad[0]) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_scanf_bad_conversion$2); + if(! pad[1]) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_scanf_bad_conversion$1); + var w = pad[2]; + if(typeof prec !== "number"){ + var p$0 = prec[1]; + /*<>*/ /*<>*/ caml_call3 + (scan, w, p$0, ib); + /*<>*/ /*<>*/ var + x$2 = /*<>*/ caml_call1(token, ib); + /*<>*/ return [0, x$2, make_scanf(ib, fmt, readers)]; + } + if(prec) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_scanf_bad_conversion$0); + /*<>*/ /*<>*/ caml_call3 + (scan, w, Stdlib[19], ib); + /*<>*/ /*<>*/ var + x$1 = /*<>*/ caml_call1(token, ib); + /*<>*/ return [0, x$1, make_scanf(ib, fmt, readers)]; + /*<>*/ } function kscanf_gen(ib, ef, af, param){ var str = param[2], fmt = param[1]; function k(readers, f$1){ @@ -28986,16 +31285,16 @@ if(exc[1] !== Stdlib[6]) throw caml_maybe_attach_backtrace(exc, 0); /*<>*/ var msg = exc[2], - /*<>*/ _C_ = - /*<>*/ caml_call1(Stdlib_String[24], str), - /*<>*/ _D_ = - /*<>*/ caml_call2(Stdlib[28], _C_, cst$0), - /*<>*/ _E_ = - /*<>*/ caml_call2(Stdlib[28], cst_in_format, _D_), - /*<>*/ _F_ = - /*<>*/ caml_call2(Stdlib[28], msg, _E_); + /*<>*/ _z_ = + /*<>*/ caml_call1(Stdlib_String[25], str), + /*<>*/ _A_ = + /*<>*/ caml_call2(Stdlib[28], _z_, cst$0), + /*<>*/ _B_ = + /*<>*/ caml_call2(Stdlib[28], cst_in_format, _A_), + /*<>*/ _C_ = + /*<>*/ caml_call2(Stdlib[28], msg, _B_); /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], _F_); + (Stdlib[1], _C_); } /*<>*/ return /*<>*/ caml_call2 (ef, ib, exc); @@ -29009,9 +31308,9 @@ args$0 = args[2], x = args[1], /*<>*/ f$0 = - /*<>*/ caml_call1(f, x), - f = f$0, - args = args$0; + /*<>*/ caml_call1(f, x); + f = f$0; + args = args$0; } /*<>*/ } /*<>*/ return take_format_readers(k, fmt); @@ -29026,15 +31325,14 @@ fmt); /*<>*/ } function kscanf_opt(ib, fmt){ - function _A_(x){ - /*<>*/ return [0, x]; - /*<>*/ } /*<>*/ return kscanf_gen (ib, - function(param, _B_){ + function(_y_, param){ /*<>*/ return 0; /*<>*/ }, - _A_, + function(x){ + /*<>*/ return [0, x]; + /*<>*/ }, fmt); /*<>*/ } function bscanf(ib, fmt){ @@ -29065,10 +31363,10 @@ str = token_string(ib); /*<>*/ try{ /*<>*/ var - /*<>*/ _z_ = + /*<>*/ _x_ = /*<>*/ caml_call2 (CamlinternalFormat[15], str, format), - fmt = _z_; + fmt = _x_; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); @@ -29082,30 +31380,28 @@ /*<>*/ return bscanf_format(from_string(s), format, f); /*<>*/ } function format_from_string(s, fmt){ - /*<>*/ function _w_(x){ - /*<>*/ return x; - /*<>*/ } - /*<>*/ var - /*<>*/ _x_ = - /*<>*/ caml_call1(Stdlib_String[24], s), - /*<>*/ _y_ = - /*<>*/ caml_call2(Stdlib[28], _x_, cst$1); + /*<>*/ var + /*<>*/ _v_ = + /*<>*/ caml_call1(Stdlib_String[25], s), + /*<>*/ _w_ = + /*<>*/ caml_call2(Stdlib[28], _v_, cst$1); /*<>*/ return sscanf_format - ( /*<>*/ caml_call2(Stdlib[28], cst$2, _y_), + ( /*<>*/ caml_call2(Stdlib[28], cst$2, _w_), fmt, - _w_); + function(x){ + /*<>*/ return x; + /*<>*/ }); /*<>*/ } function unescaped(s){ - /*<>*/ function _u_(x){ - /*<>*/ return x; - /*<>*/ } - /*<>*/ /*<>*/ var - _v_ = /*<>*/ caml_call2(Stdlib[28], s, cst$3); + /*<>*/ /*<>*/ var + _u_ = /*<>*/ caml_call2(Stdlib[28], s, cst$3); /*<>*/ return /*<>*/ caml_call1 (sscanf - ( /*<>*/ caml_call2(Stdlib[28], cst$4, _v_), + ( /*<>*/ caml_call2(Stdlib[28], cst$4, _u_), _t_), - _u_); + function(x){ + /*<>*/ return x; + /*<>*/ }); /*<>*/ } var Stdlib_Scanf = @@ -29169,7 +31465,7 @@ (globalThis)); //# unitInfo: Provides: CamlinternalOO -//# unitInfo: Requires: Assert_failure, Stdlib, Stdlib__Array, Stdlib__List, Stdlib__Map, Stdlib__Obj, Stdlib__Sys +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__List, Stdlib__Map, Stdlib__Obj, Stdlib__Sys (function (globalThis){ "use strict"; @@ -29213,100 +31509,92 @@ Stdlib = global_data.Stdlib, Stdlib_Array = global_data.Stdlib__Array, Stdlib_List = global_data.Stdlib__List, - Stdlib_Map = global_data.Stdlib__Map, - _g_ = [0, cst_camlinternalOO_ml, 439, 17], - _f_ = [0, cst_camlinternalOO_ml, 421, 13], - _e_ = [0, cst_camlinternalOO_ml, 418, 13], - _d_ = [0, cst_camlinternalOO_ml, 415, 13], - _c_ = [0, cst_camlinternalOO_ml, 412, 13], - _b_ = [0, cst_camlinternalOO_ml, 409, 13], - _a_ = [0, cst_camlinternalOO_ml, 281, 50]; + Stdlib_Map = global_data.Stdlib__Map; function copy(o){ - /*<>*/ /*<>*/ var - o$0 = /*<>*/ o.slice(); - /*<>*/ return /*<>*/ caml_set_oo_id + /*<>*/ /*<>*/ var + o$0 = /*<>*/ o.slice(); + /*<>*/ return /*<>*/ caml_set_oo_id (o$0); - /*<>*/ } - /*<>*/ var - /*<>*/ params = [0, 1, 1, 1, 3, 16], - /*<>*/ initial_object_size = 2, - dummy_item = 0; + /*<>*/ } + /*<>*/ /*<>*/ var + params = [0, 1, 1, 1, 3, 16]; function public_method_label(s){ - /*<>*/ var - /*<>*/ accu = [0, 0], - _aE_ = runtime.caml_ml_string_length(s) - 1 | 0, - /*<>*/ _aD_ = 0; - if(_aE_ >= 0){ - var i = _aD_; + /*<>*/ var + /*<>*/ accu = [0, 0], + _al_ = runtime.caml_ml_string_length(s) - 1 | 0, + /*<>*/ _ak_ = 0; + if(_al_ >= 0){ + var i = _ak_; for(;;){ - /*<>*/ /*<>*/ var - _aF_ = /*<>*/ runtime.caml_string_get(s, i); - accu[1] = (223 * accu[1] | 0) + _aF_ | 0; - /*<>*/ /*<>*/ var - _aG_ = i + 1 | 0; - if(_aE_ !== i){var i = _aG_; continue;} - break; + /*<>*/ /*<>*/ var + _am_ = /*<>*/ runtime.caml_string_get(s, i); + accu[1] = (223 * accu[1] | 0) + _am_ | 0; + /*<>*/ /*<>*/ var + _an_ = i + 1 | 0; + if(_al_ === i) break; + i = _an_; } } accu[1] = accu[1] & 2147483647; var tag = 1073741823 < accu[1] ? accu[1] + 2147483648 | 0 : accu[1]; - /*<>*/ return tag; - /*<>*/ } - /*<>*/ var + /*<>*/ return tag; + /*<>*/ } + /*<>*/ var compare = caml_string_compare, Vars = caml_call1(Stdlib_Map[1], [0, compare]), compare$0 = caml_string_compare, Meths = caml_call1(Stdlib_Map[1], [0, compare$0]), compare$1 = runtime.caml_int_compare, Labs = caml_call1(Stdlib_Map[1], [0, compare$1]), - /*<>*/ dummy_table = - [0, 0, [0, dummy_item], Meths[1], Labs[1], 0, 0, Vars[1], 0], - /*<>*/ table_count = [0, 0], - /*<>*/ dummy_met = - /*<>*/ caml_obj_block(0, 0); + /*<>*/ dummy_table = + [0, 0, [0, 0], Meths[1], Labs[1], 0, 0, Vars[1], 0], + /*<>*/ table_count = [0, 0], + /*<>*/ dummy_met = + /*<>*/ caml_obj_block(0, 0), + /*<>*/ initial_object_size = 2; function fit_size(n){ - /*<>*/ return 2 < n + /*<>*/ return 2 < n ? fit_size((n + 1 | 0) / 2 | 0) * 2 | 0 : n; - /*<>*/ } + /*<>*/ } function new_table(pub_labels){ - /*<>*/ table_count[1]++; - /*<>*/ var + /*<>*/ table_count[1]++; + /*<>*/ var len = pub_labels.length - 1, - /*<>*/ methods = - /*<>*/ caml_make_vect + /*<>*/ methods = + /*<>*/ caml_make_vect ((len * 2 | 0) + 2 | 0, dummy_met); - /*<>*/ caml_check_bound(methods, 0)[1] = len; + /*<>*/ caml_check_bound(methods, 0)[1] = len; var - _aw_ = Stdlib_Sys[9], - _ax_ = - ( /*<>*/ runtime.caml_mul - (fit_size(len), _aw_) + _ad_ = Stdlib_Sys[9], + _ae_ = + ( /*<>*/ runtime.caml_mul + (fit_size(len), _ad_) / 8 | 0) - 1 | 0; - /*<>*/ caml_check_bound(methods, 1)[2] = _ax_; - /*<>*/ var - _az_ = len - 1 | 0, - /*<>*/ _ay_ = 0; - if(_az_ >= 0){ - var i = _ay_; + /*<>*/ caml_check_bound(methods, 1)[2] = _ae_; + /*<>*/ var + _ag_ = len - 1 | 0, + /*<>*/ _af_ = 0; + if(_ag_ >= 0){ + var i = _af_; for(;;){ - /*<>*/ var - _aB_ = (i * 2 | 0) + 3 | 0, - /*<>*/ _aA_ = + /*<>*/ var + _ai_ = (i * 2 | 0) + 3 | 0, + /*<>*/ _ah_ = caml_check_bound(pub_labels, i)[1 + i]; - /*<>*/ caml_check_bound(methods, _aB_) - [1 + _aB_] - = _aA_; - /*<>*/ /*<>*/ var - _aC_ = i + 1 | 0; - if(_az_ !== i){var i = _aC_; continue;} - break; + /*<>*/ caml_check_bound(methods, _ai_) + [1 + _ai_] + = _ah_; + /*<>*/ /*<>*/ var + _aj_ = i + 1 | 0; + if(_ag_ === i) break; + i = _aj_; } } - /*<>*/ return [0, + /*<>*/ return [0, initial_object_size, methods, Meths[1], @@ -29315,184 +31603,191 @@ 0, Vars[1], 0]; - /*<>*/ } + /*<>*/ } function resize(array, new_size){ - /*<>*/ var + /*<>*/ var old_size = array[2].length - 1, - _au_ = old_size < new_size ? 1 : 0; - if(_au_){ - /*<>*/ /*<>*/ var + _ab_ = old_size < new_size ? 1 : 0; + if(_ab_){ + /*<>*/ /*<>*/ var new_buck = - /*<>*/ caml_make_vect(new_size, dummy_met); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], array[2], 0, new_buck, 0, old_size); + /*<>*/ caml_make_vect(new_size, dummy_met); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], array[2], 0, new_buck, 0, old_size); array[2] = new_buck; - var _av_ = 0; + var _ac_ = 0; } else - var _av_ = _au_; - return _av_; - /*<>*/ } - /*<>*/ var - /*<>*/ method_count = [0, 0], - /*<>*/ inst_var_count = [0, 0]; + var _ac_ = _ab_; + return _ac_; + /*<>*/ } + /*<>*/ var + /*<>*/ method_count = [0, 0], + /*<>*/ inst_var_count = [0, 0], + _a_ = [0, cst_camlinternalOO_ml, 279, 50], + _b_ = [0, cst_camlinternalOO_ml, 407, 13], + _c_ = [0, cst_camlinternalOO_ml, 410, 13], + _d_ = [0, cst_camlinternalOO_ml, 413, 13], + _e_ = [0, cst_camlinternalOO_ml, 416, 13], + _f_ = [0, cst_camlinternalOO_ml, 419, 13], + _g_ = [0, cst_camlinternalOO_ml, 437, 17]; function new_method(table){ - /*<>*/ var index = table[2].length - 1; - /*<>*/ resize(table, index + 1 | 0); - /*<>*/ return index; - /*<>*/ } + /*<>*/ var index = table[2].length - 1; + /*<>*/ resize(table, index + 1 | 0); + /*<>*/ return index; + /*<>*/ } function get_method_label(table, name){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _as_ = - /*<>*/ caml_call2(Meths[28], name, table[3]); - /*<>*/ return _as_; - } - catch(_at_){ - var _ar_ = caml_wrap_exception(_at_); - if(_ar_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_ar_, 0); - /*<>*/ /*<>*/ var + /*<>*/ try{ + /*<>*/ /*<>*/ var + _$_ = + /*<>*/ caml_call2(Meths[17], name, table[3]); + /*<>*/ return _$_; + } + catch(_aa_){ + var ___ = caml_wrap_exception(_aa_); + if(___ !== Stdlib[8]) throw caml_maybe_attach_backtrace(___, 0); + /*<>*/ /*<>*/ var label = new_method(table); table[3] = - /*<>*/ caml_call3 - (Meths[4], name, label, table[3]); + /*<>*/ caml_call3 + (Meths[2], name, label, table[3]); table[4] = - /*<>*/ caml_call3 - (Labs[4], label, 1, table[4]); - /*<>*/ return label; + /*<>*/ caml_call3 + (Labs[2], label, 1, table[4]); + /*<>*/ return label; } - /*<>*/ } + /*<>*/ } function get_method_labels(table, names){ - /*<>*/ function _ap_(_aq_){ - /*<>*/ return get_method_label(table, _aq_); - } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[13], _ap_, names); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Array[14], + function(_Z_){ /*<>*/ return get_method_label(table, _Z_);}, + names); + /*<>*/ } function set_method(table, label, element){ - /*<>*/ method_count[1]++; - /*<>*/ return /*<>*/ caml_call2 - (Labs[28], label, table[4]) + /*<>*/ method_count[1]++; + /*<>*/ return /*<>*/ caml_call2 + (Labs[17], label, table[4]) ? (resize (table, label + 1 | 0), caml_check_bound(table[2], label)[1 + label] = element, 0) : (table[6] = [0, [0, label, element], table[6]], 0); - /*<>*/ } + /*<>*/ } function get_method(table, label){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _an_ = - /*<>*/ caml_call2 - (Stdlib_List[46], label, table[6]); - /*<>*/ return _an_; - } - catch(_ao_){ - var _am_ = caml_wrap_exception(_ao_); - if(_am_ === Stdlib[8]) - /*<>*/ return caml_check_bound + /*<>*/ try{ + /*<>*/ /*<>*/ var + _X_ = + /*<>*/ caml_call2 + (Stdlib_List[49], label, table[6]); + /*<>*/ return _X_; + } + catch(_Y_){ + var _W_ = caml_wrap_exception(_Y_); + if(_W_ === Stdlib[8]) + /*<>*/ return caml_check_bound (table[2], label) [1 + label]; - throw caml_maybe_attach_backtrace(_am_, 0); + throw caml_maybe_attach_backtrace(_W_, 0); } - /*<>*/ } + /*<>*/ } function to_list(arr){ - /*<>*/ return 0 === arr + /*<>*/ return 0 === arr ? 0 - : /*<>*/ caml_call1 - (Stdlib_Array[9], arr); - /*<>*/ } + : /*<>*/ caml_call1 + (Stdlib_Array[10], arr); + /*<>*/ } function narrow(table, vars, virt_meths, concr_meths){ - /*<>*/ var - /*<>*/ vars$0 = to_list(vars), - /*<>*/ virt_meths$0 = to_list(virt_meths), - /*<>*/ concr_meths$0 = to_list(concr_meths); - /*<>*/ function _X_(_al_){ - /*<>*/ return get_method_label(table, _al_); - } - /*<>*/ /*<>*/ var - virt_meth_labs = - /*<>*/ caml_call2 - (Stdlib_List[19], _X_, virt_meths$0); - /*<>*/ function _Y_(_ak_){ - /*<>*/ return get_method_label(table, _ak_); - } - /*<>*/ /*<>*/ var - concr_meth_labs = - /*<>*/ caml_call2 - (Stdlib_List[19], _Y_, concr_meths$0); + /*<>*/ var + /*<>*/ vars$0 = to_list(vars), + /*<>*/ virt_meths$0 = to_list(virt_meths), + /*<>*/ concr_meths$0 = to_list(concr_meths), + /*<>*/ virt_meth_labs = + /*<>*/ caml_call2 + (Stdlib_List[20], + function(_V_){ /*<>*/ return get_method_label(table, _V_);}, + virt_meths$0), + /*<>*/ concr_meth_labs = + /*<>*/ caml_call2 + (Stdlib_List[20], + function(_U_){ /*<>*/ return get_method_label(table, _U_);}, + concr_meths$0); table[5] = [0, [0, table[3], table[4], table[6], table[7], virt_meth_labs, vars$0], table[5]]; - var _Z_ = Vars[1], ___ = table[7]; - function _$_(lab, info, tvars){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[36], lab, vars$0) - ? /*<>*/ caml_call3 - (Vars[4], lab, info, tvars) - : tvars; - /*<>*/ } table[7] = - /*<>*/ caml_call3(Vars[13], _$_, ___, _Z_); - /*<>*/ var - /*<>*/ by_name = [0, Meths[1]], - /*<>*/ by_label = [0, Labs[1]]; - function _aa_(met, label){ - /*<>*/ by_name[1] = - /*<>*/ caml_call3 - (Meths[4], met, label, by_name[1]); - var _af_ = by_label[1]; - try{ - /*<>*/ var - /*<>*/ _ai_ = - /*<>*/ caml_call2 - (Labs[28], label, table[4]), - _ah_ = _ai_; - } - catch(_aj_){ - var _ag_ = caml_wrap_exception(_aj_); - if(_ag_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_ag_, 0); - var _ah_ = 1; - } - by_label[1] = - /*<>*/ caml_call3(Labs[4], label, _ah_, _af_); - return 0; - /*<>*/ } - /*<>*/ /*<>*/ caml_call3 - (Stdlib_List[27], _aa_, concr_meths$0, concr_meth_labs); - function _ab_(met, label){ - /*<>*/ by_name[1] = - /*<>*/ caml_call3 - (Meths[4], met, label, by_name[1]); - by_label[1] = - /*<>*/ caml_call3 - (Labs[4], label, 0, by_label[1]); - return 0; - /*<>*/ } - /*<>*/ /*<>*/ caml_call3 - (Stdlib_List[27], _ab_, virt_meths$0, virt_meth_labs); + /*<>*/ caml_call3 + (Vars[24], + function(lab, info, tvars){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_List[37], lab, vars$0) + ? /*<>*/ caml_call3 + (Vars[2], lab, info, tvars) + : tvars; + /*<>*/ }, + table[7], + Vars[1]); + /*<>*/ var + /*<>*/ by_name = [0, Meths[1]], + /*<>*/ by_label = [0, Labs[1]]; + /*<>*/ /*<>*/ caml_call3 + (Stdlib_List[28], + function(met, label){ + /*<>*/ by_name[1] = + /*<>*/ caml_call3 + (Meths[2], met, label, by_name[1]); + var _P_ = by_label[1]; + try{ + /*<>*/ var + /*<>*/ _S_ = + /*<>*/ caml_call2 + (Labs[17], label, table[4]), + _R_ = _S_; + } + catch(_T_){ + var _Q_ = caml_wrap_exception(_T_); + if(_Q_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_Q_, 0); + var _R_ = 1; + } + by_label[1] = + /*<>*/ caml_call3(Labs[2], label, _R_, _P_); + return 0; + /*<>*/ }, + concr_meths$0, + concr_meth_labs); + /*<>*/ /*<>*/ caml_call3 + (Stdlib_List[28], + function(met, label){ + /*<>*/ by_name[1] = + /*<>*/ caml_call3 + (Meths[2], met, label, by_name[1]); + by_label[1] = + /*<>*/ caml_call3 + (Labs[2], label, 0, by_label[1]); + return 0; + /*<>*/ }, + virt_meths$0, + virt_meth_labs); table[3] = by_name[1]; table[4] = by_label[1]; - /*<>*/ var - /*<>*/ _ac_ = 0, - _ad_ = table[6]; - function _ae_(met, hm){ - /*<>*/ var lab = met[1]; - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[36], lab, virt_meth_labs) - ? hm - : [0, met, hm]; - /*<>*/ } table[6] = - /*<>*/ caml_call3 - (Stdlib_List[26], _ae_, _ad_, _ac_); + /*<>*/ caml_call3 + (Stdlib_List[27], + function(met, hm){ + /*<>*/ var lab = met[1]; + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_List[37], lab, virt_meth_labs) + ? hm + : [0, met, hm]; + /*<>*/ }, + table[6], + 0); return 0; - /*<>*/ } + /*<>*/ } function widen(table){ - /*<>*/ var - /*<>*/ match = - /*<>*/ caml_call1(Stdlib_List[5], table[5]), + /*<>*/ var + /*<>*/ match = + /*<>*/ caml_call1(Stdlib_List[6], table[5]), vars = match[6], virt_meths = match[5], saved_vars = match[4], @@ -29500,710 +31795,714 @@ by_label = match[2], by_name = match[1]; table[5] = - /*<>*/ caml_call1(Stdlib_List[6], table[5]); - function _T_(s, v){ - /*<>*/ /*<>*/ var - _W_ = - /*<>*/ caml_call2(Vars[28], v, table[7]); - /*<>*/ return /*<>*/ caml_call3 - (Vars[4], v, _W_, s); - /*<>*/ } + /*<>*/ caml_call1(Stdlib_List[7], table[5]); table[7] = - /*<>*/ caml_call3 - (Stdlib_List[25], _T_, saved_vars, vars); + /*<>*/ caml_call3 + (Stdlib_List[26], + function(s, v){ + /*<>*/ /*<>*/ var + _O_ = + /*<>*/ caml_call2(Vars[17], v, table[7]); + /*<>*/ return /*<>*/ caml_call3 + (Vars[2], v, _O_, s); + /*<>*/ }, + saved_vars, + vars); table[3] = by_name; table[4] = by_label; - var _U_ = table[6]; - function _V_(met, hm){ - /*<>*/ var lab = met[1]; - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[36], lab, virt_meths) - ? hm - : [0, met, hm]; - /*<>*/ } table[6] = - /*<>*/ caml_call3 - (Stdlib_List[26], _V_, _U_, saved_hidden_meths); + /*<>*/ caml_call3 + (Stdlib_List[27], + function(met, hm){ + /*<>*/ var lab = met[1]; + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_List[37], lab, virt_meths) + ? hm + : [0, met, hm]; + /*<>*/ }, + table[6], + saved_hidden_meths); return 0; - /*<>*/ } + /*<>*/ } function new_variable(table, name){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _R_ = - /*<>*/ caml_call2(Vars[28], name, table[7]); - /*<>*/ return _R_; - } - catch(_S_){ - var _Q_ = caml_wrap_exception(_S_); - if(_Q_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_Q_, 0); + /*<>*/ try{ + /*<>*/ /*<>*/ var + _M_ = + /*<>*/ caml_call2(Vars[17], name, table[7]); + /*<>*/ return _M_; + } + catch(_N_){ + var _L_ = caml_wrap_exception(_N_); + if(_L_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_L_, 0); var index = table[1]; table[1] = index + 1 | 0; - /*<>*/ if - ( /*<>*/ runtime.caml_string_notequal(name, "")) + /*<>*/ if(name !== "") table[7] = - /*<>*/ caml_call3 - (Vars[4], name, index, table[7]); - /*<>*/ return index; + /*<>*/ caml_call3 + (Vars[2], name, index, table[7]); + /*<>*/ return index; } - /*<>*/ } + /*<>*/ } function to_array(arr){ - /*<>*/ return /*<>*/ runtime.caml_equal + /*<>*/ return /*<>*/ runtime.caml_equal (arr, 0) ? [0] : arr; - /*<>*/ } + /*<>*/ } function new_methods_variables(table, meths, vals){ - /*<>*/ var - /*<>*/ meths$0 = to_array(meths), - /*<>*/ nmeths = meths$0.length - 1, + /*<>*/ var + /*<>*/ meths$0 = to_array(meths), + /*<>*/ nmeths = meths$0.length - 1, nvals = vals.length - 1, - /*<>*/ res = - /*<>*/ caml_make_vect(nmeths + nvals | 0, 0), - /*<>*/ _I_ = nmeths - 1 | 0, - /*<>*/ _H_ = 0; - if(_I_ >= 0){ - var i$0 = _H_; + /*<>*/ res = + /*<>*/ caml_make_vect(nmeths + nvals | 0, 0), + /*<>*/ _D_ = nmeths - 1 | 0, + /*<>*/ _C_ = 0; + if(_D_ >= 0){ + var i$0 = _C_; for(;;){ - /*<>*/ /*<>*/ var - _O_ = get_method_label(table, caml_check_bound(meths$0, i$0)[1 + i$0]); - /*<>*/ caml_check_bound(res, i$0)[1 + i$0] = _O_; - /*<>*/ /*<>*/ var - _P_ = i$0 + 1 | 0; - if(_I_ !== i$0){var i$0 = _P_; continue;} - break; - } - } - /*<>*/ var - _K_ = nvals - 1 | 0, - /*<>*/ _J_ = 0; - if(_K_ >= 0){ - var i = _J_; + /*<>*/ /*<>*/ var + _J_ = get_method_label(table, caml_check_bound(meths$0, i$0)[1 + i$0]); + /*<>*/ caml_check_bound(res, i$0)[1 + i$0] = _J_; + /*<>*/ /*<>*/ var + _K_ = i$0 + 1 | 0; + if(_D_ === i$0) break; + i$0 = _K_; + } + } + /*<>*/ var + _F_ = nvals - 1 | 0, + /*<>*/ _E_ = 0; + if(_F_ >= 0){ + var i = _E_; for(;;){ - /*<>*/ var - _M_ = i + nmeths | 0, - /*<>*/ _L_ = + /*<>*/ var + _H_ = i + nmeths | 0, + /*<>*/ _G_ = new_variable(table, caml_check_bound(vals, i)[1 + i]); - /*<>*/ caml_check_bound(res, _M_)[1 + _M_] = _L_; - /*<>*/ /*<>*/ var - _N_ = i + 1 | 0; - if(_K_ !== i){var i = _N_; continue;} - break; + /*<>*/ caml_check_bound(res, _H_)[1 + _H_] = _G_; + /*<>*/ /*<>*/ var + _I_ = i + 1 | 0; + if(_F_ === i) break; + i = _I_; } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function get_variable(table, name){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _F_ = - /*<>*/ caml_call2(Vars[28], name, table[7]); - /*<>*/ return _F_; - } - catch(_G_){ - var _E_ = caml_wrap_exception(_G_); - if(_E_ === Stdlib[8]) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ try{ + /*<>*/ /*<>*/ var + _A_ = + /*<>*/ caml_call2(Vars[17], name, table[7]); + /*<>*/ return _A_; + } + catch(_B_){ + var _z_ = caml_wrap_exception(_B_); + if(_z_ === Stdlib[8]) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _a_], 1); - throw caml_maybe_attach_backtrace(_E_, 0); + throw caml_maybe_attach_backtrace(_z_, 0); } - /*<>*/ } + /*<>*/ } function get_variables(table, names){ - /*<>*/ function _C_(_D_){ - /*<>*/ return get_variable(table, _D_); - } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[13], _C_, names); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Array[14], + function(_y_){ /*<>*/ return get_variable(table, _y_);}, + names); + /*<>*/ } function add_initializer(table, f){ - /*<>*/ table[8] = [0, f, table[8]]; + /*<>*/ table[8] = [0, f, table[8]]; return 0; - /*<>*/ } + /*<>*/ } function create_table(public_methods){ - /*<>*/ if(0 === public_methods) - /*<>*/ return new_table([0]); - /*<>*/ var - /*<>*/ tags = - /*<>*/ caml_call2 - (Stdlib_Array[13], public_method_label, public_methods), - /*<>*/ table = new_table(tags); - function _B_(i, met){ - /*<>*/ var lab = (i * 2 | 0) + 2 | 0; - table[3] = - /*<>*/ caml_call3 - (Meths[4], met, lab, table[3]); - table[4] = - /*<>*/ caml_call3(Labs[4], lab, 1, table[4]); - return 0; - /*<>*/ } - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[12], _B_, public_methods); - /*<>*/ return table; - /*<>*/ } + /*<>*/ if(0 === public_methods) + /*<>*/ return new_table([0]); + /*<>*/ var + /*<>*/ tags = + /*<>*/ caml_call2 + (Stdlib_Array[14], public_method_label, public_methods), + /*<>*/ table = new_table(tags); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Array[13], + function(i, met){ + /*<>*/ var lab = (i * 2 | 0) + 2 | 0; + table[3] = + /*<>*/ caml_call3 + (Meths[2], met, lab, table[3]); + table[4] = + /*<>*/ caml_call3 + (Labs[2], lab, 1, table[4]); + return 0; + /*<>*/ }, + public_methods); + /*<>*/ return table; + /*<>*/ } function init_class(table){ - /*<>*/ inst_var_count[1] = + /*<>*/ inst_var_count[1] = (inst_var_count[1] + table[1] | 0) - 1 | 0; table[8] = - /*<>*/ caml_call1(Stdlib_List[9], table[8]); - /*<>*/ /*<>*/ var - _A_ = Stdlib_Sys[9]; + /*<>*/ caml_call1(Stdlib_List[10], table[8]); + /*<>*/ /*<>*/ var + _x_ = Stdlib_Sys[9]; return resize (table, - 3 + caml_div(caml_check_bound(table[2], 1)[2] * 16 | 0, _A_) | 0); - /*<>*/ } + 3 + caml_div(caml_check_bound(table[2], 1)[2] * 16 | 0, _x_) | 0); + /*<>*/ } function inherits(cla, vals, virt_meths, concr_meths, param, top){ var env = param[4], super$0 = param[2]; - /*<>*/ narrow + /*<>*/ narrow (cla, vals, virt_meths, concr_meths); var init = top - ? /*<>*/ caml_call2(super$0, cla, env) - : /*<>*/ caml_call1(super$0, cla); - /*<>*/ widen(cla); - /*<>*/ var - /*<>*/ _s_ = 0, - /*<>*/ _t_ = to_array(concr_meths); - function _u_(nm){ - /*<>*/ return get_method - (cla, get_method_label(cla, nm)); - /*<>*/ } - /*<>*/ var - _v_ = + ? /*<>*/ caml_call2(super$0, cla, env) + : /*<>*/ caml_call1(super$0, cla); + /*<>*/ widen(cla); + /*<>*/ var + /*<>*/ _s_ = to_array(concr_meths), + _t_ = [0, - /*<>*/ caml_call2 - (Stdlib_Array[13], _u_, _t_), - _s_], - /*<>*/ _w_ = to_array(vals); - /*<>*/ function _x_(_z_){ - /*<>*/ return get_variable(cla, _z_); - } - /*<>*/ /*<>*/ var - _y_ = + /*<>*/ caml_call2 + (Stdlib_Array[14], + function(nm){ + /*<>*/ return get_method + (cla, get_method_label(cla, nm)); + /*<>*/ }, + _s_), + 0], + /*<>*/ _u_ = to_array(vals), + /*<>*/ _v_ = [0, [0, init], [0, - /*<>*/ caml_call2 - (Stdlib_Array[13], _x_, _w_), - _v_]]; - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Array[4], _y_); + /*<>*/ caml_call2 + (Stdlib_Array[14], + function(_w_){ /*<>*/ return get_variable(cla, _w_);}, + _u_), + _t_]]; + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Array[5], _v_); } function make_class(pub_meths, class_init){ - /*<>*/ var - /*<>*/ table = create_table(pub_meths), - /*<>*/ env_init = - /*<>*/ caml_call1(class_init, table); - /*<>*/ init_class(table); - /*<>*/ return [0, - /*<>*/ caml_call1(env_init, 0), + /*<>*/ var + /*<>*/ table = create_table(pub_meths), + /*<>*/ env_init = + /*<>*/ caml_call1(class_init, table); + /*<>*/ init_class(table); + /*<>*/ return [0, + /*<>*/ caml_call1(env_init, 0), class_init, env_init, 0]; - /*<>*/ } + /*<>*/ } function make_class_store(pub_meths, class_init, init_table){ - /*<>*/ var - /*<>*/ table = create_table(pub_meths), - /*<>*/ env_init = - /*<>*/ caml_call1(class_init, table); - /*<>*/ init_class(table); + /*<>*/ var + /*<>*/ table = create_table(pub_meths), + /*<>*/ env_init = + /*<>*/ caml_call1(class_init, table); + /*<>*/ init_class(table); init_table[2] = class_init; init_table[1] = env_init; return 0; - /*<>*/ } + /*<>*/ } function dummy_class(loc){ function undef(param){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Stdlib[15], loc], 1); - /*<>*/ } - /*<>*/ return [0, undef, undef, undef, 0]; - /*<>*/ } + /*<>*/ } + /*<>*/ return [0, undef, undef, undef, 0]; + /*<>*/ } function create_object(table){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var obj = - /*<>*/ caml_obj_block + /*<>*/ caml_obj_block (Stdlib_Obj[10], table[1]); - /*<>*/ obj[1] = table[2]; - /*<>*/ return /*<>*/ caml_set_oo_id + /*<>*/ obj[1] = table[2]; + /*<>*/ return /*<>*/ caml_set_oo_id (obj); - /*<>*/ } + /*<>*/ } function create_object_opt(obj_0, table){ - /*<>*/ if(obj_0) - /*<>*/ return obj_0; - /*<>*/ /*<>*/ var + /*<>*/ if(obj_0) + /*<>*/ return obj_0; + /*<>*/ /*<>*/ var obj = - /*<>*/ caml_obj_block + /*<>*/ caml_obj_block (Stdlib_Obj[10], table[1]); - /*<>*/ obj[1] = table[2]; - /*<>*/ return /*<>*/ caml_set_oo_id + /*<>*/ obj[1] = table[2]; + /*<>*/ return /*<>*/ caml_set_oo_id (obj); - /*<>*/ } + /*<>*/ } function iter_f(obj, param){ var param$0 = param; for(;;){ - if(! param$0) /*<>*/ return 0; + if(! param$0) /*<>*/ return 0; var l = param$0[2], f = param$0[1]; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (f, obj); - var param$0 = l; + param$0 = l; } } function run_initializers(obj, table){ - /*<>*/ var + /*<>*/ var inits = table[8], _r_ = 0 !== inits ? 1 : 0; return _r_ ? iter_f(obj, inits) : _r_; - /*<>*/ } + /*<>*/ } function run_initializers_opt(obj_0, obj, table){ - /*<>*/ if(obj_0) - /*<>*/ return obj; + /*<>*/ if(obj_0) + /*<>*/ return obj; var inits = table[8]; - if(0 !== inits) /*<>*/ iter_f(obj, inits); - /*<>*/ return obj; - /*<>*/ } + if(0 !== inits) /*<>*/ iter_f(obj, inits); + /*<>*/ return obj; + /*<>*/ } function create_object_and_run_initiali(obj_0, table){ - /*<>*/ if(obj_0) - /*<>*/ return obj_0; - /*<>*/ /*<>*/ var + /*<>*/ if(obj_0) + /*<>*/ return obj_0; + /*<>*/ /*<>*/ var obj = create_object(table); - /*<>*/ run_initializers(obj, table); - /*<>*/ return obj; - /*<>*/ } + /*<>*/ run_initializers(obj, table); + /*<>*/ return obj; + /*<>*/ } function get_data(param){ - /*<>*/ if(param) - /*<>*/ return param[2]; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if(param) + /*<>*/ return param[2]; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _e_], 1); - /*<>*/ } + /*<>*/ } function build_path(n, keys, tables){ - /*<>*/ var - /*<>*/ res = [0, 0, 0, 0], - /*<>*/ r = [0, res], - /*<>*/ _o_ = 0; + /*<>*/ var + /*<>*/ res = [0, 0, 0, 0], + /*<>*/ r = [0, res], + /*<>*/ _o_ = 0; if(n >= 0){ var i = _o_; for(;;){ var _p_ = r[1]; r[1] = [0, caml_check_bound(keys, i)[1 + i], _p_, 0]; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _q_ = i + 1 | 0; - if(n !== i){var i = _q_; continue;} - break; + if(n === i) break; + i = _q_; } } var v = r[1]; if(! tables) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _b_], 1); tables[2] = v; - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function lookup_tables(root, keys){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var root_data = get_data(root); if(! root_data) - /*<>*/ return build_path - (keys.length - 1 - 1 | 0, keys, root); - var i$1 = keys.length - 1 - 1 | 0, i = i$1, tables$0 = root_data; - a: - /*<>*/ for(;;){ - if(0 > i) /*<>*/ return tables$0; - /*<>*/ var - /*<>*/ key = caml_check_bound(keys, i)[1 + i], + /*<>*/ return build_path + (keys.length - 2 | 0, keys, root); + var i$1 = keys.length - 2 | 0, i = i$1, tables$0 = root_data; + /*<>*/ for(;;){ + if(0 > i) /*<>*/ return tables$0; + /*<>*/ var + /*<>*/ key = caml_check_bound(keys, i)[1 + i], tables$1 = tables$0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(! tables$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _d_], 1); - if(tables$1[1] === key){ - /*<>*/ /*<>*/ var - tables_data = get_data(tables$1); - if(! tables_data) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _g_], 1); - var i$0 = i - 1 | 0, i = i$0, tables$0 = tables_data; - continue a; - } + if(tables$1[1] === key) break; if(! tables$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _f_], 1); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var tables = tables$1[3]; - if(tables){var tables$1 = tables; continue;} - /*<>*/ /*<>*/ var - next = [0, key, 0, 0]; - if(! tables$1) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _c_], 1); - tables$1[3] = next; - /*<>*/ return build_path - (i - 1 | 0, keys, next); - } - } - /*<>*/ } + if(! tables){ + /*<>*/ /*<>*/ var + next = [0, key, 0, 0]; + if(! tables$1) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _c_], 1); + tables$1[3] = next; + /*<>*/ return build_path + (i - 1 | 0, keys, next); + } + tables$1 = tables; + } + /*<>*/ /*<>*/ var + tables_data = get_data(tables$1); + if(! tables_data) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _g_], 1); + var i$0 = i - 1 | 0; + i = i$0; + tables$0 = tables_data; + } + /*<>*/ } function new_cache(table){ - /*<>*/ var - /*<>*/ n = new_method(table), - switch$0 = 0; - if(0 !== (n % 2 | 0)){ - var _n_ = Stdlib_Sys[9]; - if - ((2 + caml_div(caml_check_bound(table[2], 1)[2] * 16 | 0, _n_) | 0) >= n){var n$0 = new_method(table); switch$0 = 1;} + /*<>*/ /*<>*/ var + n = new_method(table); + a: + { + if(0 !== (n % 2 | 0)){ + var _n_ = Stdlib_Sys[9]; + if + ((2 + caml_div(caml_check_bound(table[2], 1)[2] * 16 | 0, _n_) | 0) + >= n){ + var n$0 = new_method(table); + break a; + } + } + var n$0 = n; } - if(! switch$0) var n$0 = n; - /*<>*/ caml_check_bound(table[2], n$0)[1 + n$0] + /*<>*/ caml_check_bound(table[2], n$0)[1 + n$0] = 0; - /*<>*/ return n$0; - /*<>*/ } + /*<>*/ return n$0; + /*<>*/ } function set_methods(table, methods){ - /*<>*/ var + /*<>*/ var len = methods.length - 1, - /*<>*/ i = [0, 0]; + /*<>*/ i = [0, 0]; for(;;){ if(i[1] >= len) return 0; - /*<>*/ var + /*<>*/ var _h_ = i[1], - /*<>*/ label = + /*<>*/ label = caml_check_bound(methods, _h_)[1 + _h_], next = function(param){ - /*<>*/ i[1]++; + /*<>*/ i[1]++; var _m_ = i[1]; - /*<>*/ return caml_check_bound + /*<>*/ return caml_check_bound (methods, _m_) [1 + _m_]; - /*<>*/ }, - /*<>*/ clo = next(0); + /*<>*/ }, + /*<>*/ clo = next(0); if(typeof clo === "number") switch(clo){ case 0: - /*<>*/ var - /*<>*/ x = next(0), + /*<>*/ /*<>*/ var + x = next(0); + let x$20 = x; + var clo$0 = - function(x){ - /*<>*/ return function(obj){ - /*<>*/ return x; /*<>*/ }; - } - (x); + function(obj){ + /*<>*/ return x$20; + /*<>*/ }; break; case 1: - /*<>*/ var - /*<>*/ n = next(0), + /*<>*/ /*<>*/ var + n = next(0); + let n$38 = n; + var clo$0 = - function(n){ - /*<>*/ return function(obj){ - /*<>*/ return obj[1 + n]; /*<>*/ }; - } - (n); + function(obj){ + /*<>*/ return obj[1 + n$38]; + /*<>*/ }; break; case 2: - /*<>*/ var - /*<>*/ e = next(0), - /*<>*/ n$0 = next(0), + /*<>*/ var + /*<>*/ e = next(0), + /*<>*/ n$0 = next(0); + let e$10 = e, n$37 = n$0; + var clo$0 = - function(e, n){ - /*<>*/ return function(obj){ - /*<>*/ return obj[1 + e][1 + n]; /*<>*/ }; - } - (e, n$0); + function(obj){ + /*<>*/ return obj[1 + e$10][1 + n$37]; + /*<>*/ }; break; case 3: - /*<>*/ var - /*<>*/ n$1 = next(0), + /*<>*/ /*<>*/ var + n$1 = next(0); + let n$36 = n$1; + var clo$0 = - function(n){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call1 - (obj[1][1 + n], obj); /*<>*/ }; - } - (n$1); + function(obj){ + /*<>*/ return /*<>*/ caml_call1 + (obj[1][1 + n$36], obj); + /*<>*/ }; break; case 4: - /*<>*/ var - /*<>*/ n$2 = next(0), + /*<>*/ /*<>*/ var + n$2 = next(0); + let n$35 = n$2; + var clo$0 = - function(n){ - /*<>*/ return function(obj, x){ - /*<>*/ obj[1 + n] = x; - return 0; /*<>*/ }; - } - (n$2); + function(obj, x){ + /*<>*/ obj[1 + n$35] = x; + return 0; + /*<>*/ }; break; case 5: - /*<>*/ var - /*<>*/ f = next(0), - /*<>*/ x$0 = next(0), + /*<>*/ var + /*<>*/ f = next(0), + /*<>*/ x$0 = next(0); + let f$20 = f, x$19 = x$0; + var clo$0 = - function(f, x){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call1 - (f, x); /*<>*/ }; - } - (f, x$0); + function(obj){ + /*<>*/ return /*<>*/ caml_call1 + (f$20, x$19); + /*<>*/ }; break; case 6: - /*<>*/ var - /*<>*/ f$0 = next(0), - /*<>*/ n$3 = next(0), + /*<>*/ var + /*<>*/ f$0 = next(0), + /*<>*/ n$3 = next(0); + let f$19 = f$0, n$34 = n$3; + var clo$0 = - function(f, n){ - /*<>*/ return function(obj){ - /*<>*/ return caml_call1 - (f, obj[1 + n]); /*<>*/ }; - } - (f$0, n$3); + function(obj){ + /*<>*/ return caml_call1 + (f$19, obj[1 + n$34]); + /*<>*/ }; break; case 7: - /*<>*/ var - /*<>*/ f$1 = next(0), - /*<>*/ e$0 = next(0), - /*<>*/ n$4 = next(0), + /*<>*/ var + /*<>*/ f$1 = next(0), + /*<>*/ e$0 = next(0), + /*<>*/ n$4 = next(0); + let f$18 = f$1, e$9 = e$0, n$33 = n$4; + var clo$0 = - function(f, e, n){ - /*<>*/ return function(obj){ - /*<>*/ return caml_call1 - (f, obj[1 + e][1 + n]); /*<>*/ }; - } - (f$1, e$0, n$4); + function(obj){ + /*<>*/ return caml_call1 + (f$18, obj[1 + e$9][1 + n$33]); + /*<>*/ }; break; case 8: - /*<>*/ var - /*<>*/ f$2 = next(0), - /*<>*/ n$5 = next(0), + /*<>*/ var + /*<>*/ f$2 = next(0), + /*<>*/ n$5 = next(0); + let f$17 = f$2, n$32 = n$5; + var clo$0 = - function(f, n){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call1 - (f, - /*<>*/ caml_call1 - (obj[1][1 + n], obj)); /*<>*/ }; - } - (f$2, n$5); + function(obj){ + /*<>*/ return /*<>*/ caml_call1 + (f$17, + /*<>*/ caml_call1 + (obj[1][1 + n$32], obj)); + /*<>*/ }; break; case 9: - /*<>*/ var - /*<>*/ f$3 = next(0), - /*<>*/ x$1 = next(0), - /*<>*/ y = next(0), + /*<>*/ var + /*<>*/ f$3 = next(0), + /*<>*/ x$1 = next(0), + /*<>*/ y = next(0); + let f$16 = f$3, x$18 = x$1, y$0 = y; + var clo$0 = - function(f, x, y){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call2 - (f, x, y); /*<>*/ }; - } - (f$3, x$1, y); + function(obj){ + /*<>*/ return /*<>*/ caml_call2 + (f$16, x$18, y$0); + /*<>*/ }; break; case 10: - /*<>*/ var - /*<>*/ f$4 = next(0), - /*<>*/ x$2 = next(0), - /*<>*/ n$6 = next(0), + /*<>*/ var + /*<>*/ f$4 = next(0), + /*<>*/ x$2 = next(0), + /*<>*/ n$6 = next(0); + let f$15 = f$4, x$17 = x$2, n$31 = n$6; + var clo$0 = - function(f, x, n){ - /*<>*/ return function(obj){ - /*<>*/ return caml_call2 - (f, x, obj[1 + n]); /*<>*/ }; - } - (f$4, x$2, n$6); + function(obj){ + /*<>*/ return caml_call2 + (f$15, x$17, obj[1 + n$31]); + /*<>*/ }; break; case 11: - /*<>*/ var - /*<>*/ f$5 = next(0), - /*<>*/ x$3 = next(0), - /*<>*/ e$1 = next(0), - /*<>*/ n$7 = next(0), + /*<>*/ var + /*<>*/ f$5 = next(0), + /*<>*/ x$3 = next(0), + /*<>*/ e$1 = next(0), + /*<>*/ n$7 = next(0); + let f$14 = f$5, x$16 = x$3, e$8 = e$1, n$30 = n$7; + var clo$0 = - function(f, x, e, n){ - /*<>*/ return function(obj){ - /*<>*/ return caml_call2 - (f, x, obj[1 + e][1 + n]); /*<>*/ }; - } - (f$5, x$3, e$1, n$7); + function(obj){ + /*<>*/ return caml_call2 + (f$14, x$16, obj[1 + e$8][1 + n$30]); + /*<>*/ }; break; case 12: - /*<>*/ var - /*<>*/ f$6 = next(0), - /*<>*/ x$4 = next(0), - /*<>*/ n$8 = next(0), + /*<>*/ var + /*<>*/ f$6 = next(0), + /*<>*/ x$4 = next(0), + /*<>*/ n$8 = next(0); + let f$13 = f$6, x$15 = x$4, n$29 = n$8; + var clo$0 = - function(f, x, n){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call2 - (f, - x, - /*<>*/ caml_call1 - (obj[1][1 + n], obj)); /*<>*/ }; - } - (f$6, x$4, n$8); + function(obj){ + /*<>*/ return /*<>*/ caml_call2 + (f$13, + x$15, + /*<>*/ caml_call1 + (obj[1][1 + n$29], obj)); + /*<>*/ }; break; case 13: - /*<>*/ var - /*<>*/ f$7 = next(0), - /*<>*/ n$9 = next(0), - /*<>*/ x$5 = next(0), + /*<>*/ var + /*<>*/ f$7 = next(0), + /*<>*/ n$9 = next(0), + /*<>*/ x$5 = next(0); + let f$12 = f$7, n$28 = n$9, x$14 = x$5; + var clo$0 = - function(f, n, x){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call2 - (f, obj[1 + n], x); /*<>*/ }; - } - (f$7, n$9, x$5); + function(obj){ + /*<>*/ return /*<>*/ caml_call2 + (f$12, obj[1 + n$28], x$14); + /*<>*/ }; break; case 14: - /*<>*/ var - /*<>*/ f$8 = next(0), - /*<>*/ e$2 = next(0), - /*<>*/ n$10 = next(0), - /*<>*/ x$6 = next(0), + /*<>*/ var + /*<>*/ f$8 = next(0), + /*<>*/ e$2 = next(0), + /*<>*/ n$10 = next(0), + /*<>*/ x$6 = next(0); + let f$11 = f$8, e$7 = e$2, n$27 = n$10, x$13 = x$6; + var clo$0 = - function(f, e, n, x){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call2 - (f, obj[1 + e][1 + n], x); /*<>*/ }; - } - (f$8, e$2, n$10, x$6); + function(obj){ + /*<>*/ return /*<>*/ caml_call2 + (f$11, obj[1 + e$7][1 + n$27], x$13); + /*<>*/ }; break; case 15: - /*<>*/ var - /*<>*/ f$9 = next(0), - /*<>*/ n$11 = next(0), - /*<>*/ x$7 = next(0), + /*<>*/ var + /*<>*/ f$9 = next(0), + /*<>*/ n$11 = next(0), + /*<>*/ x$7 = next(0); + let f$10 = f$9, n$26 = n$11, x$12 = x$7; + var clo$0 = - function(f, n, x){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call2 - (f, - /*<>*/ caml_call1 - (obj[1][1 + n], obj), - x); /*<>*/ }; - } - (f$9, n$11, x$7); + function(obj){ + /*<>*/ return /*<>*/ caml_call2 + (f$10, + /*<>*/ caml_call1 + (obj[1][1 + n$26], obj), + x$12); + /*<>*/ }; break; case 16: - /*<>*/ var - /*<>*/ n$12 = next(0), - /*<>*/ x$8 = next(0), + /*<>*/ var + /*<>*/ n$12 = next(0), + /*<>*/ x$8 = next(0); + let n$25 = n$12, x$11 = x$8; + var clo$0 = - function(n, x){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call2 - (obj[1][1 + n], obj, x); /*<>*/ }; - } - (n$12, x$8); + function(obj){ + /*<>*/ return /*<>*/ caml_call2 + (obj[1][1 + n$25], obj, x$11); + /*<>*/ }; break; case 17: - /*<>*/ var - /*<>*/ n$13 = next(0), - /*<>*/ m = next(0), + /*<>*/ var + /*<>*/ n$13 = next(0), + /*<>*/ m = next(0); + let n$24 = n$13, m$12 = m; + var clo$0 = - function(n, m){ - /*<>*/ return function(obj){ - /*<>*/ return caml_call2 - (obj[1][1 + n], obj, obj[1 + m]); /*<>*/ }; - } - (n$13, m); + function(obj){ + /*<>*/ return caml_call2 + (obj[1][1 + n$24], obj, obj[1 + m$12]); + /*<>*/ }; break; case 18: - /*<>*/ var - /*<>*/ n$14 = next(0), - /*<>*/ e$3 = next(0), - /*<>*/ m$0 = next(0), + /*<>*/ var + /*<>*/ n$14 = next(0), + /*<>*/ e$3 = next(0), + /*<>*/ m$0 = next(0); + let n$23 = n$14, e$6 = e$3, m$11 = m$0; + var clo$0 = - function(n, e, m){ - /*<>*/ return function(obj){ - /*<>*/ return caml_call2 - (obj[1][1 + n], obj, obj[1 + e][1 + m]); /*<>*/ }; - } - (n$14, e$3, m$0); + function(obj){ + /*<>*/ return caml_call2 + (obj[1][1 + n$23], obj, obj[1 + e$6][1 + m$11]); + /*<>*/ }; break; case 19: - /*<>*/ var - /*<>*/ n$15 = next(0), - /*<>*/ m$1 = next(0), + /*<>*/ var + /*<>*/ n$15 = next(0), + /*<>*/ m$1 = next(0); + let n$22 = n$15, m$10 = m$1; + var clo$0 = - function(n, m){ - /*<>*/ return function(obj){ - /*<>*/ /*<>*/ var - _l_ = - /*<>*/ caml_call1 - (obj[1][1 + m], obj); - /*<>*/ return /*<>*/ caml_call2 - (obj[1][1 + n], obj, _l_); /*<>*/ }; - } - (n$15, m$1); + function(obj){ + /*<>*/ /*<>*/ var + _l_ = + /*<>*/ caml_call1 + (obj[1][1 + m$10], obj); + /*<>*/ return /*<>*/ caml_call2 + (obj[1][1 + n$22], obj, _l_); + /*<>*/ }; break; case 20: - /*<>*/ var - /*<>*/ m$2 = next(0), - /*<>*/ x$9 = next(0); - /*<>*/ new_cache(table); + /*<>*/ var + /*<>*/ m$2 = next(0), + /*<>*/ x$9 = next(0); + /*<>*/ new_cache(table); + let m$9 = m$2, x$10 = x$9; var clo$0 = - function(m, x){ - /*<>*/ return function(obj){ - /*<>*/ return /*<>*/ caml_call1 - (caml_get_public_method(x, m, 0), x); /*<>*/ }; - } - (m$2, x$9); + function(obj){ + /*<>*/ return /*<>*/ caml_call1 + (caml_get_public_method(x$10, m$9, 0), x$10); + /*<>*/ }; break; case 21: - /*<>*/ var - /*<>*/ m$3 = next(0), - /*<>*/ n$16 = next(0); - /*<>*/ new_cache(table); + /*<>*/ var + /*<>*/ m$3 = next(0), + /*<>*/ n$16 = next(0); + /*<>*/ new_cache(table); + let m$8 = m$3, n$21 = n$16; var clo$0 = - function(m, n){ - /*<>*/ return function(obj){ - /*<>*/ var _k_ = obj[1 + n]; - return caml_call1(caml_get_public_method(_k_, m, 0), _k_); /*<>*/ }; - } - (m$3, n$16); + function(obj){ + /*<>*/ var _k_ = obj[1 + n$21]; + return caml_call1(caml_get_public_method(_k_, m$8, 0), _k_); + /*<>*/ }; break; case 22: - /*<>*/ var - /*<>*/ m$4 = next(0), - /*<>*/ e$4 = next(0), - /*<>*/ n$17 = next(0); - /*<>*/ new_cache(table); + /*<>*/ var + /*<>*/ m$4 = next(0), + /*<>*/ e$4 = next(0), + /*<>*/ n$17 = next(0); + /*<>*/ new_cache(table); + let m$7 = m$4, e$5 = e$4, n$20 = n$17; var clo$0 = - function(m, e, n){ - /*<>*/ return function(obj){ - /*<>*/ var _j_ = obj[1 + e][1 + n]; - return caml_call1(caml_get_public_method(_j_, m, 0), _j_); /*<>*/ }; - } - (m$4, e$4, n$17); + function(obj){ + /*<>*/ var + _j_ = obj[1 + e$5][1 + n$20]; + return caml_call1(caml_get_public_method(_j_, m$7, 0), _j_); + /*<>*/ }; break; default: - /*<>*/ var - /*<>*/ m$5 = next(0), - /*<>*/ n$18 = next(0); - /*<>*/ new_cache(table); + /*<>*/ var + /*<>*/ m$5 = next(0), + /*<>*/ n$18 = next(0); + /*<>*/ new_cache(table); + let m$6 = m$5, n$19 = n$18; var clo$0 = - function(m, n){ - /*<>*/ return function(obj){ - /*<>*/ /*<>*/ var - _i_ = - /*<>*/ caml_call1 - (obj[1][1 + n], obj); - /*<>*/ return /*<>*/ caml_call1 - (caml_get_public_method(_i_, m, 0), _i_); /*<>*/ }; - } - (m$5, n$18); + function(obj){ + /*<>*/ /*<>*/ var + _i_ = + /*<>*/ caml_call1 + (obj[1][1 + n$19], obj); + /*<>*/ return /*<>*/ caml_call1 + (caml_get_public_method(_i_, m$6, 0), _i_); + /*<>*/ }; } else var clo$0 = clo; - /*<>*/ set_method(table, label, clo$0); + /*<>*/ set_method(table, label, clo$0); i[1]++; } - /*<>*/ } + /*<>*/ } function stats(param){ - /*<>*/ return [0, + /*<>*/ return [0, table_count[1], method_count[1], inst_var_count[1]]; - /*<>*/ } + /*<>*/ } var CamlinternalOO = [0, @@ -30261,7 +32560,7 @@ (globalThis)); //# unitInfo: Provides: CamlinternalMod -//# unitInfo: Requires: Assert_failure, CamlinternalLazy, CamlinternalOO, Stdlib, Stdlib__Obj +//# unitInfo: Requires: CamlinternalLazy, CamlinternalOO, Stdlib, Stdlib__Obj (function (globalThis){ "use strict"; @@ -30282,11 +32581,11 @@ CamlinternalLazy = global_data.CamlinternalLazy, CamlinternalOO = global_data.CamlinternalOO, Assert_failure = global_data.Assert_failure, + cst_CamlinternalMod_init_mod_n = "CamlinternalMod.init_mod: not a module", _a_ = [0, cst_camlinternalMod_ml, 72, 5], _b_ = [0, cst_camlinternalMod_ml, 81, 2], cst_CamlinternalMod_update_mod = - "CamlinternalMod.update_mod: not a module", - cst_CamlinternalMod_init_mod_n = "CamlinternalMod.init_mod: not a module"; + "CamlinternalMod.update_mod: not a module"; function init_mod_block(loc, comps$0){ /*<>*/ var length = comps$0.length - 1, @@ -30302,43 +32601,40 @@ if(typeof shape === "number") switch(shape){ case 0: + let i$1 = i; var - fn$0 = - function(i){ - function fn(x){ - /*<>*/ /*<>*/ var - fn$0 = modu[1 + i]; - if(fn === fn$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[15], loc], 1); - /*<>*/ return /*<>*/ caml_call1 - (fn$0, x); - /*<>*/ } - return fn; - }, - fn = fn$0(i), - init = fn; + fn = + function(x){ + /*<>*/ /*<>*/ var + fn = modu[1 + i$1]; + if(fn$0 === fn) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stdlib[15], loc], 1); + /*<>*/ return /*<>*/ caml_call1 + (fn, x); + /*<>*/ }; + let fn$0 = fn; + var init = fn; break; case 1: var l = []; + let l$0 = l, i$0 = i; runtime.caml_update_dummy (l, [246, - function(l, i){ - /*<>*/ return function(param){ - /*<>*/ /*<>*/ var - l$0 = modu[1 + i]; - if(l === l$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[15], loc], 1); - var _j_ = caml_obj_tag(l$0); - if(250 === _j_) return l$0[1]; - if(246 !== _j_ && 244 !== _j_) - /*<>*/ return l$0; - /*<>*/ return /*<>*/ caml_call1 - (CamlinternalLazy[2], l$0);}; - } - (l, i)]); + function(param){ + /*<>*/ /*<>*/ var + l = modu[1 + i$0]; + if(l$0 === l) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stdlib[15], loc], 1); + var _j_ = caml_obj_tag(l); + if(250 === _j_) return l[1]; + if(246 !== _j_ && 244 !== _j_) + /*<>*/ return l; + /*<>*/ return /*<>*/ caml_call1 + (CamlinternalLazy[2], l); + }]); var init = l; break; default: @@ -30354,8 +32650,8 @@ /*<>*/ modu[1 + i] = init; /*<>*/ /*<>*/ var _i_ = i + 1 | 0; - if(_h_ !== i){var i = _i_; continue;} - break; + if(_h_ === i) break; + i = _i_; } } /*<>*/ return modu; @@ -30374,7 +32670,7 @@ (0 === /*<>*/ caml_obj_tag(n) && comps$0.length - 1 <= n.length - 1){ /*<>*/ var - _e_ = comps$0.length - 1 - 1 | 0, + _e_ = comps$0.length - 2 | 0, /*<>*/ _d_ = 0; if(_e_ >= 0){ var i = _d_; @@ -30383,9 +32679,9 @@ /*<>*/ n$0 = n[1 + i], /*<>*/ shape = caml_check_bound(comps$0, i)[1 + i]; - if(typeof shape === "number") + a: + if(typeof shape === "number"){ if(2 === shape){ - var switch$0 = 0; if (0 === /*<>*/ caml_obj_tag(n$0) && 4 === n$0.length - 1){ @@ -30396,18 +32692,16 @@ /*<>*/ cl[1 + j] = n$0[1 + j]; /*<>*/ /*<>*/ var _c_ = j + 1 | 0; - if(3 !== j){var j = _c_; continue;} - break; + if(3 === j) break; + j = _c_; } + break a; } - else - switch$0 = 1; - if(switch$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _a_], 1); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _a_], 1); } - else - /*<>*/ modu[1 + i] = n$0; + /*<>*/ modu[1 + i] = n$0; + } else if(0 === shape[0]){ var comps = shape[1]; /*<>*/ update_mod_block @@ -30415,8 +32709,8 @@ } /*<>*/ /*<>*/ var _f_ = i + 1 | 0; - if(_e_ !== i){var i = _f_; continue;} - break; + if(_e_ === i) break; + i = _f_; } } return 0; @@ -30466,7 +32760,11 @@ : runtime.caml_call_gen(f, [a0, a1, a2]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), + _c_ = [0, 0], + _b_ = [0, 0], + _a_ = [0, 0], Stdlib_List = global_data.Stdlib__List, Stdlib = global_data.Stdlib, Stdlib_Obj = global_data.Stdlib__Obj, @@ -30476,60 +32774,65 @@ Stdlib_Array = global_data.Stdlib__Array, Stdlib_Hashtbl = global_data.Stdlib__Hashtbl, CamlinternalLazy = global_data.CamlinternalLazy, - Stdlib_Random = global_data.Stdlib__Random, - _c_ = [0, 0], - _b_ = [0, 0], - _a_ = [0, 0]; + Stdlib_Random = global_data.Stdlib__Random; function MakeSeeded(H){ /*<>*/ /*<>*/ var prng = [246, - function(_aM_){ /*<>*/ return caml_call1(Stdlib_Random[15][2], 0);}]; + function(_at_){ /*<>*/ return caml_call1(Stdlib_Random[19][2], 0);}]; function create(opt, initial_size){ - /*<>*/ if(opt) - var sth = opt[1], random = sth; - else - var - random = /*<>*/ caml_call1(Stdlib_Hashtbl[17], 0); - var x = 16; - /*<>*/ for(;;){ - if(initial_size > x && Stdlib_Sys[13] >= (x * 2 | 0)){var x$0 = x * 2 | 0, x = x$0; continue;} - /*<>*/ if(random){ - var _aK_ = runtime.caml_obj_tag(prng); - if(250 === _aK_) - var _aL_ = prng[1]; - else{ - var switch$0 = 0; - if(246 !== _aK_ && 244 !== _aK_){var _aL_ = prng; switch$0 = 1;} - if(! switch$0) var _aL_ = caml_call1(CamlinternalLazy[2], prng); - } - var - seed = - /*<>*/ caml_call1(Stdlib_Random[15][4], _aL_); + var + random = + opt + ? opt[1] + : /*<>*/ caml_call1(Stdlib_Hashtbl[17], 0); + a: + b: + { + var x = 16; + /*<>*/ for(;;){ + if(initial_size <= x) break b; + if(Stdlib_Sys[13] < (x * 2 | 0)) break; + var x$0 = x * 2 | 0; + x = x$0; } - else - var seed = 0; - /*<>*/ return [0, - 0, - /*<>*/ caml_make_vect(x, 0), - seed, - x]; - } - /*<>*/ } + break a; + } + /*<>*/ if(random){ + var _ar_ = runtime.caml_obj_tag(prng); + a: + if(250 === _ar_) + var _as_ = prng[1]; + else{ + if(246 !== _ar_ && 244 !== _ar_){var _as_ = prng; break a;} + var _as_ = caml_call1(CamlinternalLazy[2], prng); + } + var + seed = + /*<>*/ caml_call1(Stdlib_Random[19][4], _as_); + } + else + var seed = 0; + /*<>*/ return [0, + 0, + /*<>*/ caml_make_vect(x, 0), + seed, + x]; + } function clear(h){ /*<>*/ h[1] = 0; /*<>*/ var len = h[2].length - 1, - /*<>*/ _aI_ = len - 1 | 0, - _aH_ = 0; - if(_aI_ >= 0){ - var i = _aH_; + /*<>*/ _ap_ = len - 1 | 0, + _ao_ = 0; + if(_ap_ >= 0){ + var i = _ao_; for(;;){ /*<>*/ caml_check_bound(h[2], i)[1 + i] = 0; /*<>*/ /*<>*/ var - _aJ_ = i + 1 | 0; - if(_aI_ !== i){var i = _aJ_; continue;} - break; + _aq_ = i + 1 | 0; + if(_ap_ === i) break; + i = _aq_; } } return 0; @@ -30546,14 +32849,14 @@ /*<>*/ } function copy(h){ /*<>*/ var - _aE_ = h[4], - _aF_ = h[3], - /*<>*/ _aG_ = - /*<>*/ caml_call1(Stdlib_Array[6], h[2]); - /*<>*/ return [0, h[1], _aG_, _aF_, _aE_]; + _al_ = h[4], + _am_ = h[3], + /*<>*/ _an_ = + /*<>*/ caml_call1(Stdlib_Array[7], h[2]); + /*<>*/ return [0, h[1], _an_, _am_, _al_]; /*<>*/ } function key_index(h, hkey){ - /*<>*/ return hkey & (h[2].length - 1 - 1 | 0); + /*<>*/ return hkey & (h[2].length - 2 | 0); /*<>*/ } function clean(h){ function do_bucket(param){ @@ -30567,19 +32870,19 @@ /*<>*/ return [0, hkey, c$0, do_bucket(rest$0)]; } h[1] = h[1] - 1 | 0; - var param$0 = rest; + param$0 = rest; } /*<>*/ } - var d = h[2], _aC_ = d.length - 1 - 1 | 0, _aB_ = 0; - if(_aC_ >= 0){ - var i = _aB_; + var d = h[2], _aj_ = d.length - 2 | 0, _ai_ = 0; + if(_aj_ >= 0){ + var i = _ai_; for(;;){ /*<>*/ d[1 + i] = do_bucket(caml_check_bound(d, i)[1 + i]); /*<>*/ /*<>*/ var - _aD_ = i + 1 | 0; - if(_aC_ !== i){var i = _aD_; continue;} - break; + _ak_ = i + 1 | 0; + if(_aj_ === i) break; + i = _ak_; } } return 0; @@ -30591,9 +32894,9 @@ nsize = osize * 2 | 0; /*<>*/ clean(h); var - _av_ = nsize < Stdlib_Sys[13] ? 1 : 0, - _aw_ = _av_ ? (osize >>> 1 | 0) <= h[1] ? 1 : 0 : _av_; - if(_aw_){ + _ac_ = nsize < Stdlib_Sys[13] ? 1 : 0, + _ad_ = _ac_ ? (osize >>> 1 | 0) <= h[1] ? 1 : 0 : _ac_; + if(_ad_){ /*<>*/ /*<>*/ var ndata = /*<>*/ caml_make_vect(nsize, 0); h[2] = ndata; @@ -30601,33 +32904,33 @@ insert_bucket = function(param){ /*<>*/ if(! param) - /*<>*/ return 0; + /*<>*/ return; var rest = param[3], data = param[2], hkey = param[1]; /*<>*/ insert_bucket(rest); /*<>*/ /*<>*/ var nidx = key_index(h, hkey); /*<>*/ ndata[1 + nidx] = [0, hkey, data, caml_check_bound(ndata, nidx)[1 + nidx]]; - /*<>*/ return 0; + /*<>*/ return; /*<>*/ }, - /*<>*/ _ay_ = osize - 1 | 0, - /*<>*/ _ax_ = 0; - if(_ay_ >= 0){ - var i = _ax_; + /*<>*/ _af_ = osize - 1 | 0, + /*<>*/ _ae_ = 0; + if(_af_ >= 0){ + var i = _ae_; for(;;){ /*<>*/ insert_bucket (caml_check_bound(odata, i)[1 + i]); /*<>*/ /*<>*/ var - _aA_ = i + 1 | 0; - if(_ay_ !== i){var i = _aA_; continue;} - break; + _ah_ = i + 1 | 0; + if(_af_ === i) break; + i = _ah_; } } - var _az_ = 0; + var _ag_ = 0; } else - var _az_ = _aw_; - return _az_; + var _ag_ = _ad_; + return _ag_; /*<>*/ } function add(h, key, info){ /*<>*/ var @@ -30640,8 +32943,8 @@ [0, hkey, container, caml_check_bound(h[2], i)[1 + i]]; /*<>*/ caml_check_bound(h[2], i)[1 + i] = bucket; h[1] = h[1] + 1 | 0; - var _au_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; - return _au_ ? resize(h) : _au_; + var _ab_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + return _ab_ ? resize(h) : _ab_; /*<>*/ } function remove(h, key){ /*<>*/ /*<>*/ var @@ -30651,56 +32954,61 @@ /*<>*/ for(;;){ if(! param$0) /*<>*/ return 0; var hk = param$0[1], next = param$0[3], c = param$0[2]; - if(hkey === hk) - switch( /*<>*/ caml_call2(H[3], c, key)){ - case 0: - h[1] = h[1] - 1 | 0; /*<>*/ return next; - case 1: - /*<>*/ return [0, hk, c, remove_bucket(next)]; - default: h[1] = h[1] - 1 | 0; var param$0 = next; continue; - } - var next$0 = param$0[3], c$0 = param$0[2]; - /*<>*/ return [0, hk, c$0, remove_bucket(next$0)]; + if(hkey !== hk){ + var next$0 = param$0[3], c$0 = param$0[2]; + /*<>*/ return [0, + hk, + c$0, + remove_bucket(next$0)]; + } + switch( /*<>*/ caml_call2(H[3], c, key)){ + case 0: + h[1] = h[1] - 1 | 0; /*<>*/ return next; + case 1: + /*<>*/ return [0, hk, c, remove_bucket(next)]; + default: h[1] = h[1] - 1 | 0; param$0 = next; + } } /*<>*/ } /*<>*/ var /*<>*/ i = key_index(h, hkey), - /*<>*/ _at_ = + /*<>*/ _aa_ = remove_bucket(caml_check_bound(h[2], i)[1 + i]); - /*<>*/ caml_check_bound(h[2], i)[1 + i] = _at_; + /*<>*/ caml_check_bound(h[2], i)[1 + i] = _aa_; /*<>*/ return 0; /*<>*/ } function find(h, key){ /*<>*/ var /*<>*/ hkey = /*<>*/ caml_call2(H[2], h[3], key), - /*<>*/ _as_ = key_index(h, hkey), - param = caml_check_bound(h[2], _as_)[1 + _as_]; + /*<>*/ _$_ = key_index(h, hkey), + param = caml_check_bound(h[2], _$_)[1 + _$_]; for(;;){ if(! param) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var hk = param[1], rest = param[3], c = param[2]; - if(hkey !== hk){var rest$0 = param[3], param = rest$0; continue;} - switch( /*<>*/ caml_call2(H[3], c, key)){ - case 0: - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(H[4], c); - if(match){var d = match[1]; /*<>*/ return d;} - var param = rest; - continue; - case 1: - var param = rest; continue; - default: var param = rest; continue; - } + if(hkey === hk) + switch( /*<>*/ caml_call2(H[3], c, key)){ + case 0: + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(H[4], c); + if(match){var d = match[1]; /*<>*/ return d;} + param = rest; + break; + case 1: + param = rest; break; + default: param = rest; + } + else{var rest$0 = param[3]; param = rest$0;} } /*<>*/ } function find_opt(h, key){ /*<>*/ var /*<>*/ hkey = /*<>*/ caml_call2(H[2], h[3], key), - /*<>*/ _ar_ = key_index(h, hkey), - param = caml_check_bound(h[2], _ar_)[1 + _ar_]; + /*<>*/ ___ = key_index(h, hkey), + param = caml_check_bound(h[2], ___)[1 + ___]; for(;;){ if(! param) /*<>*/ return 0; var hk = param[1], rest = param[3], c = param[2]; @@ -30710,13 +33018,13 @@ /*<>*/ /*<>*/ var d = /*<>*/ caml_call1(H[4], c); if(d) /*<>*/ return d; - var param = rest; - continue; + param = rest; + break; case 1: - var param = rest; continue; - default: var param = rest; continue; + param = rest; break; + default: param = rest; } - var rest$0 = param[3], param = rest$0; + else{var rest$0 = param[3]; param = rest$0;} } /*<>*/ } function find_all(h, key){ @@ -30727,27 +33035,28 @@ /*<>*/ for(;;){ if(! param$0) /*<>*/ return 0; var hk = param$0[1], rest = param$0[3], c = param$0[2]; - if(hkey !== hk){var rest$0 = param$0[3], param$0 = rest$0; continue;} - switch( /*<>*/ caml_call2(H[3], c, key)){ - case 0: - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(H[4], c); - if(match){ - var d = match[1]; - /*<>*/ return [0, d, find_in_bucket(rest)]; - } - var param$0 = rest; - continue; - case 1: - var param$0 = rest; continue; - default: var param$0 = rest; continue; - } + if(hkey === hk) + switch( /*<>*/ caml_call2(H[3], c, key)){ + case 0: + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(H[4], c); + if(match){ + var d = match[1]; + /*<>*/ return [0, d, find_in_bucket(rest)]; + } + param$0 = rest; + break; + case 1: + param$0 = rest; break; + default: param$0 = rest; + } + else{var rest$0 = param$0[3]; param$0 = rest$0;} } /*<>*/ } /*<>*/ /*<>*/ var - _aq_ = key_index(h, hkey); + _Z_ = key_index(h, hkey); /*<>*/ return find_in_bucket - (caml_check_bound(h[2], _aq_)[1 + _aq_]); + (caml_check_bound(h[2], _Z_)[1 + _Z_]); /*<>*/ } function replace(h, key, info){ /*<>*/ var @@ -30762,37 +33071,43 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[8], 1); var hk = param[1], next = param[3], c = param[2]; - if(hkey !== hk){var next$0 = param[3], param = next$0; continue;} - if( /*<>*/ caml_call2(H[3], c, key)){var param = next; continue;} - /*<>*/ /*<>*/ var - _am_ = /*<>*/ caml_call3(H[5], c, key, info); - /*<>*/ return _am_; + if(hkey === hk){ + if(! /*<>*/ caml_call2(H[3], c, key)){ + /*<>*/ /*<>*/ var + _V_ = /*<>*/ caml_call3(H[5], c, key, info); + /*<>*/ return _V_; + } + param = next; + } + else{var next$0 = param[3]; param = next$0;} } } - catch(_ap_){ - var _an_ = caml_wrap_exception(_ap_); - if(_an_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_an_, 0); + catch(_Y_){ + var _W_ = caml_wrap_exception(_Y_); + if(_W_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_W_, 0); /*<>*/ /*<>*/ var container = /*<>*/ caml_call2(H[1], key, info); /*<>*/ caml_check_bound(h[2], i)[1 + i] = [0, hkey, container, l]; h[1] = h[1] + 1 | 0; - var _ao_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; - return _ao_ ? resize(h) : _ao_; + var _X_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + return _X_ ? resize(h) : _X_; } /*<>*/ } function mem(h, key){ /*<>*/ var /*<>*/ hkey = /*<>*/ caml_call2(H[2], h[3], key), - /*<>*/ _al_ = key_index(h, hkey), - param = caml_check_bound(h[2], _al_)[1 + _al_]; + /*<>*/ _U_ = key_index(h, hkey), + param = caml_check_bound(h[2], _U_)[1 + _U_]; /*<>*/ for(;;){ if(! param) /*<>*/ return 0; var hk = param[1], rest = param[3], c = param[2]; - if(hk !== hkey){var rest$0 = param[3], param = rest$0; continue;} - if(! /*<>*/ caml_call2(H[3], c, key)) - /*<>*/ return 1; - var param = rest; + if(hk === hkey){ + if(! /*<>*/ caml_call2(H[3], c, key)) + /*<>*/ return 1; + param = rest; + } + else{var rest$0 = param[3]; param = rest$0;} } /*<>*/ } function length(h){ @@ -30804,35 +33119,36 @@ if(! param$0) /*<>*/ return accu$0; /*<>*/ var rest = param$0[3], - /*<>*/ accu$1 = accu$0 + 1 | 0, - accu$0 = accu$1, - param$0 = rest; + /*<>*/ accu$1 = accu$0 + 1 | 0; + accu$0 = accu$1; + param$0 = rest; } } function stats(h){ - /*<>*/ var _af_ = h[2], _ag_ = 0; - function _ah_(m, b){ - /*<>*/ /*<>*/ var - _ak_ = bucket_length(0, b); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Int[11], m, _ak_); - /*<>*/ } - /*<>*/ var + /*<>*/ var /*<>*/ mbl = /*<>*/ caml_call3 - (Stdlib_Array[15], _ah_, _ag_, _af_), + (Stdlib_Array[18], + function(m, b){ + /*<>*/ /*<>*/ var + _T_ = bucket_length(0, b); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Int[11], m, _T_); + /*<>*/ }, + 0, + h[2]), /*<>*/ histo = - /*<>*/ caml_make_vect(mbl + 1 | 0, 0), - /*<>*/ _ai_ = h[2]; - function _aj_(b){ - /*<>*/ /*<>*/ var - l = bucket_length(0, b); - /*<>*/ histo[1 + l] = - caml_check_bound(histo, l)[1 + l] + 1 | 0; - /*<>*/ return 0; - /*<>*/ } + /*<>*/ caml_make_vect(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _aj_, _ai_); + (Stdlib_Array[12], + function(b){ + /*<>*/ /*<>*/ var + l = bucket_length(0, b); + /*<>*/ histo[1 + l] = + caml_check_bound(histo, l)[1 + l] + 1 | 0; + /*<>*/ return 0; + /*<>*/ }, + h[2]); /*<>*/ return [0, h[1], h[2].length - 1, mbl, histo]; /*<>*/ } function bucket_length_alive(accu, param){ @@ -30842,40 +33158,40 @@ var rest = param$0[3], c = param$0[2]; /*<>*/ if ( /*<>*/ caml_call1(H[6], c)){ - var accu$1 = accu$0 + 1 | 0, accu$0 = accu$1, param$0 = rest; - continue; + var accu$1 = accu$0 + 1 | 0; + accu$0 = accu$1; + param$0 = rest; } - var rest$0 = param$0[3], param$0 = rest$0; + else{var rest$0 = param$0[3]; param$0 = rest$0;} } } function stats_alive(h){ /*<>*/ var /*<>*/ size = [0, 0], - /*<>*/ _$_ = h[2], - _aa_ = 0; - function _ab_(m, b){ - /*<>*/ /*<>*/ var - _ae_ = bucket_length_alive(0, b); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Int[11], m, _ae_); - /*<>*/ } - /*<>*/ var /*<>*/ mbl = /*<>*/ caml_call3 - (Stdlib_Array[15], _ab_, _aa_, _$_), + (Stdlib_Array[18], + function(m, b){ + /*<>*/ /*<>*/ var + _S_ = bucket_length_alive(0, b); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Int[11], m, _S_); + /*<>*/ }, + 0, + h[2]), /*<>*/ histo = - /*<>*/ caml_make_vect(mbl + 1 | 0, 0), - /*<>*/ _ac_ = h[2]; - function _ad_(b){ - /*<>*/ /*<>*/ var - l = bucket_length_alive(0, b); - size[1] = size[1] + l | 0; - /*<>*/ histo[1 + l] = - caml_check_bound(histo, l)[1 + l] + 1 | 0; - /*<>*/ return 0; - /*<>*/ } + /*<>*/ caml_make_vect(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _ad_, _ac_); + (Stdlib_Array[12], + function(b){ + /*<>*/ /*<>*/ var + l = bucket_length_alive(0, b); + size[1] = size[1] + l | 0; + /*<>*/ histo[1 + l] = + caml_check_bound(histo, l)[1 + l] + 1 | 0; + /*<>*/ return 0; + /*<>*/ }, + h[2]); /*<>*/ return [0, size[1], h[2].length - 1, @@ -30883,20 +33199,22 @@ histo]; /*<>*/ } function add_seq(tbl, i){ - function ___(param){ - /*<>*/ var v = param[2], k = param[1]; - /*<>*/ return add(tbl, k, v); - /*<>*/ } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], ___, i); + (Stdlib_Seq[4], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return add(tbl, k, v); + /*<>*/ }, + i); /*<>*/ } function replace_seq(tbl, i){ - function _Z_(param){ - /*<>*/ var v = param[2], k = param[1]; - /*<>*/ return replace(tbl, k, v); - /*<>*/ } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], _Z_, i); + (Stdlib_Seq[4], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return replace(tbl, k, v); + /*<>*/ }, + i); /*<>*/ } function of_seq(i){ /*<>*/ /*<>*/ var @@ -30926,27 +33244,29 @@ } function create(param){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], 1); + (Stdlib_Obj[23][1], 1); /*<>*/ } function get_key(t){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, 0); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, 0); + /*<>*/ return x; /*<>*/ } function set_key(t, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, 0, k); + (Stdlib_Obj[23][5], t, 0, k); /*<>*/ } function check_key(t){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][7], t, 0); + (Stdlib_Obj[23][7], t, 0); /*<>*/ } function get_data(t){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][9], t); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call1(Stdlib_Obj[23][9], t); + /*<>*/ return x; /*<>*/ } function set_data(t, d){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][11], t, d); + (Stdlib_Obj[23][11], t, d); /*<>*/ } function make(key, data){ /*<>*/ /*<>*/ var @@ -30983,7 +33303,7 @@ /*<>*/ } function set_key_data(c, k, d){ /*<>*/ /*<>*/ caml_call1 - (Stdlib_Obj[24][12], c); + (Stdlib_Obj[23][12], c); /*<>*/ set_key(c, k); /*<>*/ return set_data(c, d); /*<>*/ } @@ -31004,6 +33324,7 @@ /*<>*/ } var include = MakeSeeded$0([0, equal, seeded_hash]), + _R_ = include[1], clear = include[2], reset = include[3], copy = include[4], @@ -31019,15 +33340,14 @@ add_seq = include[14], replace_seq = include[15], clean = include[17], - stats_alive = include[18], - _Y_ = include[1]; + stats_alive = include[18]; function create(sz){ /*<>*/ return /*<>*/ caml_call2 - (_Y_, _a_, sz); + (_R_, _a_, sz); /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var - tbl = create(16); + /*<>*/ /*<>*/ var + tbl = /*<>*/ caml_call2(_R_, _a_, 16); /*<>*/ /*<>*/ caml_call2 (replace_seq, tbl, i); /*<>*/ return tbl; @@ -31056,8 +33376,8 @@ /*<>*/ return [0, 0]; /*<>*/ } function add(b, k, d){ - /*<>*/ var _X_ = b[1]; - b[1] = [0, make(k, d), _X_]; + /*<>*/ var _Q_ = b[1]; + b[1] = [0, make(k, d), _Q_]; return 0; /*<>*/ } function test_key(k, e){ @@ -31075,24 +33395,23 @@ if(! l) /*<>*/ return 0; var h = l[1], t = l[2]; /*<>*/ if(test_key(k, h)){ - b[1] = /*<>*/ caml_call2(Stdlib_List[12], acc, t); + b[1] = /*<>*/ caml_call2(Stdlib_List[13], acc, t); return 0; } /*<>*/ var t$0 = l[2], - /*<>*/ acc$0 = [0, h, acc], - l = t$0, - acc = acc$0; + /*<>*/ acc$0 = [0, h, acc]; + l = t$0; + acc = acc$0; } /*<>*/ } function find(b, k){ - /*<>*/ var _U_ = b[1]; - /*<>*/ function _V_(_W_){ - /*<>*/ return test_key(k, _W_); - } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = - /*<>*/ caml_call2(Stdlib_List[39], _V_, _U_); + /*<>*/ caml_call2 + (Stdlib_List[40], + function(_P_){ /*<>*/ return test_key(k, _P_);}, + b[1]); if(! match) /*<>*/ return 0; var e = match[1]; /*<>*/ return get_data(e); @@ -31106,31 +33425,34 @@ /*<>*/ } function create$0(param){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], 2); + (Stdlib_Obj[23][1], 2); /*<>*/ } function get_key1(t){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, 0); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, 0); + /*<>*/ return x; /*<>*/ } function set_key1(t, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, 0, k); + (Stdlib_Obj[23][5], t, 0, k); /*<>*/ } function get_key2(t){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, 1); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, 1); + /*<>*/ return x; /*<>*/ } function set_key2(t, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, 1, k); + (Stdlib_Obj[23][5], t, 1, k); /*<>*/ } function get_data$0(t){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][9], t); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call1(Stdlib_Obj[23][9], t); + /*<>*/ return x; /*<>*/ } function set_data$0(t, d){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][11], t, d); + (Stdlib_Obj[23][11], t, d); /*<>*/ } function make$1(key1, key2, data){ /*<>*/ /*<>*/ var @@ -31167,11 +33489,11 @@ /*<>*/ var k2 = param[2], k1 = param[1], - /*<>*/ _T_ = + /*<>*/ _O_ = /*<>*/ caml_call2(H2[2], seed, k2) * 65599 | 0; /*<>*/ return /*<>*/ caml_call2 (H1[2], seed, k1) - + _T_ + + _O_ | 0; } function equal(c, param){ @@ -31193,18 +33515,18 @@ function set_key_data(c, param, d){ var k2 = param[2], k1 = param[1]; /*<>*/ /*<>*/ caml_call1 - (Stdlib_Obj[24][12], c); + (Stdlib_Obj[23][12], c); /*<>*/ set_key1(c, k1); /*<>*/ set_key2(c, k2); /*<>*/ return set_data$0(c, d); } function check_key(c){ /*<>*/ /*<>*/ var - _S_ = /*<>*/ caml_call2(Stdlib_Obj[24][7], c, 0); - /*<>*/ return _S_ + _N_ = /*<>*/ caml_call2(Stdlib_Obj[23][7], c, 0); + /*<>*/ return _N_ ? /*<>*/ caml_call2 - (Stdlib_Obj[24][7], c, 1) - : _S_; + (Stdlib_Obj[23][7], c, 1) + : _N_; /*<>*/ } /*<>*/ return MakeSeeded ([0, @@ -31221,15 +33543,15 @@ /*<>*/ return /*<>*/ caml_call1 (H2[2], x); /*<>*/ } - /*<>*/ var - equal$0 = H1[1], - /*<>*/ _Q_ = [0, equal, seeded_hash]; + var equal$0 = H1[1]; function seeded_hash$0(seed, x){ /*<>*/ return /*<>*/ caml_call1 (H1[2], x); /*<>*/ } var - include = MakeSeeded$1([0, equal$0, seeded_hash$0], _Q_), + include = + MakeSeeded$1([0, equal$0, seeded_hash$0], [0, equal, seeded_hash]), + _M_ = include[1], clear = include[2], reset = include[3], copy = include[4], @@ -31245,15 +33567,14 @@ add_seq = include[14], replace_seq = include[15], clean = include[17], - stats_alive = include[18], - _R_ = include[1]; + stats_alive = include[18]; function create(sz){ /*<>*/ return /*<>*/ caml_call2 - (_R_, _b_, sz); + (_M_, _b_, sz); /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var - tbl = create(16); + /*<>*/ /*<>*/ var + tbl = /*<>*/ caml_call2(_M_, _b_, 16); /*<>*/ /*<>*/ caml_call2 (replace_seq, tbl, i); /*<>*/ return tbl; @@ -31282,8 +33603,8 @@ /*<>*/ return [0, 0]; /*<>*/ } function add$0(b, k1, k2, d){ - /*<>*/ var _P_ = b[1]; - b[1] = [0, make$1(k1, k2, d), _P_]; + /*<>*/ var _L_ = b[1]; + b[1] = [0, make$1(k1, k2, d), _L_]; return 0; /*<>*/ } function test_keys(k1, k2, e){ @@ -31302,24 +33623,23 @@ if(! l) /*<>*/ return 0; var h = l[1], t = l[2]; /*<>*/ if(test_keys(k1, k2, h)){ - b[1] = /*<>*/ caml_call2(Stdlib_List[12], acc, t); + b[1] = /*<>*/ caml_call2(Stdlib_List[13], acc, t); return 0; } /*<>*/ var t$0 = l[2], - /*<>*/ acc$0 = [0, h, acc], - l = t$0, - acc = acc$0; + /*<>*/ acc$0 = [0, h, acc]; + l = t$0; + acc = acc$0; } /*<>*/ } function find$0(b, k1, k2){ - /*<>*/ var _M_ = b[1]; - /*<>*/ function _N_(_O_){ - /*<>*/ return test_keys(k1, k2, _O_); - } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = - /*<>*/ caml_call2(Stdlib_List[39], _N_, _M_); + /*<>*/ caml_call2 + (Stdlib_List[40], + function(_K_){ /*<>*/ return test_keys(k1, k2, _K_);}, + b[1]); if(! match) /*<>*/ return 0; var e = match[1]; /*<>*/ return get_data$0(e); @@ -31333,27 +33653,29 @@ /*<>*/ } function create$1(n){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], n); + (Stdlib_Obj[23][1], n); /*<>*/ } function length$1(k){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][2], k); + (Stdlib_Obj[23][2], k); /*<>*/ } function get_key$0(t, n){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, n); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, n); + /*<>*/ return x; /*<>*/ } function set_key$0(t, n, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, n, k); + (Stdlib_Obj[23][5], t, n, k); /*<>*/ } function get_data$1(t){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][9], t); + /*<>*/ /*<>*/ var + x = /*<>*/ caml_call1(Stdlib_Obj[23][9], t); + /*<>*/ return x; /*<>*/ } function set_data$1(t, d){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][11], t, d); + (Stdlib_Obj[23][11], t, d); /*<>*/ } function make$3(keys, data){ /*<>*/ var @@ -31361,17 +33683,17 @@ /*<>*/ eph = create$1(l); /*<>*/ set_data$1(eph, data); /*<>*/ var - _K_ = l - 1 | 0, - /*<>*/ _J_ = 0; - if(_K_ >= 0){ - var i = _J_; + _I_ = l - 1 | 0, + /*<>*/ _H_ = 0; + if(_I_ >= 0){ + var i = _H_; for(;;){ /*<>*/ set_key$0 (eph, i, caml_check_bound(keys, i)[1 + i]); /*<>*/ /*<>*/ var - _L_ = i + 1 | 0; - if(_K_ !== i){var i = _L_; continue;} - break; + _J_ = i + 1 | 0; + if(_I_ === i) break; + i = _J_; } } /*<>*/ return eph; @@ -31384,10 +33706,10 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[3], 1); /*<>*/ var - /*<>*/ _F_ = l - 1 | 0, - /*<>*/ _E_ = 0; - if(_F_ >= 0){ - var i = _E_; + /*<>*/ _D_ = l - 1 | 0, + /*<>*/ _C_ = 0; + if(_D_ >= 0){ + var i = _C_; for(;;){ /*<>*/ /*<>*/ var match = get_key$0(eph, i); @@ -31399,19 +33721,19 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[3], 1); /*<>*/ /*<>*/ var - _H_ = i + 1 | 0; - if(_F_ !== i){var i = _H_; continue;} - break; + _F_ = i + 1 | 0; + if(_D_ === i) break; + i = _F_; } } /*<>*/ /*<>*/ var - _G_ = get_data$1(eph); - /*<>*/ return _G_; + _E_ = get_data$1(eph); + /*<>*/ return _E_; } - catch(_I_){ - var _D_ = caml_wrap_exception(_I_); - if(_D_ === Stdlib[3]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_D_, 0); + catch(_G_){ + var _B_ = caml_wrap_exception(_G_); + if(_B_ === Stdlib[3]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_B_, 0); } /*<>*/ } function MakeSeeded$2(H){ @@ -31420,17 +33742,17 @@ c = create$1(k.length - 1); /*<>*/ set_data$1(c, d); /*<>*/ var - _B_ = k.length - 1 - 1 | 0, - /*<>*/ _A_ = 0; - if(_B_ >= 0){ - var i = _A_; + _z_ = k.length - 2 | 0, + /*<>*/ _y_ = 0; + if(_z_ >= 0){ + var i = _y_; for(;;){ /*<>*/ set_key$0 (c, i, caml_check_bound(k, i)[1 + i]); /*<>*/ /*<>*/ var - _C_ = i + 1 | 0; - if(_B_ !== i){var i = _C_; continue;} - break; + _A_ = i + 1 | 0; + if(_z_ === i) break; + i = _A_; } } /*<>*/ return c; @@ -31438,22 +33760,22 @@ function seeded_hash(seed, k){ /*<>*/ var /*<>*/ h = [0, 0], - _w_ = k.length - 1 - 1 | 0, - /*<>*/ _v_ = 0; - if(_w_ >= 0){ - var i = _v_; + _u_ = k.length - 2 | 0, + /*<>*/ _t_ = 0; + if(_u_ >= 0){ + var i = _t_; for(;;){ /*<>*/ var - _x_ = h[1], - /*<>*/ _y_ = caml_check_bound(k, i)[1 + i]; + _v_ = h[1], + /*<>*/ _w_ = caml_check_bound(k, i)[1 + i]; h[1] = - ( /*<>*/ caml_call2(H[2], seed, _y_) * 65599 | 0) - + _x_ + ( /*<>*/ caml_call2(H[2], seed, _w_) * 65599 | 0) + + _v_ | 0; /*<>*/ /*<>*/ var - _z_ = i + 1 | 0; - if(_w_ !== i){var i = _z_; continue;} - break; + _x_ = i + 1 | 0; + if(_u_ === i) break; + i = _x_; } } return h[1]; @@ -31473,30 +33795,30 @@ if(! match) /*<>*/ return 2; /*<>*/ var ki = match[1], - /*<>*/ _u_ = caml_check_bound(k, i)[1 + i]; + /*<>*/ _s_ = caml_check_bound(k, i)[1 + i]; /*<>*/ if - (! /*<>*/ caml_call2(H[1], _u_, ki)) + (! /*<>*/ caml_call2(H[1], _s_, ki)) /*<>*/ return 1; - /*<>*/ var - /*<>*/ i$0 = i - 1 | 0, - i = i$0; + /*<>*/ /*<>*/ var + i$0 = i - 1 | 0; + i = i$0; } /*<>*/ } function set_key_data(c, k, d){ /*<>*/ /*<>*/ caml_call1 - (Stdlib_Obj[24][12], c); + (Stdlib_Obj[23][12], c); /*<>*/ var - _s_ = k.length - 1 - 1 | 0, - /*<>*/ _r_ = 0; - if(_s_ >= 0){ - var i = _r_; + _q_ = k.length - 2 | 0, + /*<>*/ _p_ = 0; + if(_q_ >= 0){ + var i = _p_; for(;;){ /*<>*/ set_key$0 (c, i, caml_check_bound(k, i)[1 + i]); /*<>*/ /*<>*/ var - _t_ = i + 1 | 0; - if(_s_ !== i){var i = _t_; continue;} - break; + _r_ = i + 1 | 0; + if(_q_ === i) break; + i = _r_; } } /*<>*/ return set_data$1(c, d); @@ -31506,19 +33828,20 @@ /*<>*/ i$1 = length$1(c) - 1 | 0, i = i$1; /*<>*/ for(;;){ - var _p_ = i < 0 ? 1 : 0; - if(_p_) - var _q_ = _p_; + var _n_ = i < 0 ? 1 : 0; + if(_n_) + var _o_ = _n_; else{ /*<>*/ /*<>*/ var - _o_ = /*<>*/ caml_call2(Stdlib_Obj[24][7], c, i); - /*<>*/ if(_o_){ - var i$0 = i - 1 | 0, i = i$0; + _m_ = /*<>*/ caml_call2(Stdlib_Obj[23][7], c, i); + /*<>*/ if(_m_){ + var i$0 = i - 1 | 0; + i = i$0; continue; } - var _q_ = _o_; + var _o_ = _m_; } - return _q_; + return _o_; } /*<>*/ } /*<>*/ return MakeSeeded @@ -31538,6 +33861,7 @@ /*<>*/ } var include = MakeSeeded$2([0, equal, seeded_hash]), + _l_ = include[1], clear = include[2], reset = include[3], copy = include[4], @@ -31553,15 +33877,14 @@ add_seq = include[14], replace_seq = include[15], clean = include[17], - stats_alive = include[18], - _n_ = include[1]; + stats_alive = include[18]; function create(sz){ /*<>*/ return /*<>*/ caml_call2 - (_n_, _c_, sz); + (_l_, _c_, sz); /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var - tbl = create(16); + /*<>*/ /*<>*/ var + tbl = /*<>*/ caml_call2(_l_, _c_, 16); /*<>*/ /*<>*/ caml_call2 (replace_seq, tbl, i); /*<>*/ return tbl; @@ -31590,8 +33913,8 @@ /*<>*/ return [0, 0]; /*<>*/ } function add$1(b, k, d){ - /*<>*/ var _m_ = b[1]; - b[1] = [0, make$3(k, d), _m_]; + /*<>*/ var _k_ = b[1]; + b[1] = [0, make$3(k, d), _k_]; return 0; /*<>*/ } function test_keys$0(k, e){ @@ -31600,36 +33923,34 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Stdlib[3], 1); /*<>*/ var - _i_ = k.length - 1 - 1 | 0, - /*<>*/ _h_ = 0; - if(_i_ >= 0){ - var i = _h_; + _g_ = k.length - 2 | 0, + /*<>*/ _f_ = 0; + if(_g_ >= 0){ + var i = _f_; for(;;){ - /*<>*/ var - /*<>*/ match = get_key$0(e, i), - switch$0 = 0; + /*<>*/ /*<>*/ var + match = get_key$0(e, i); if(match){ var x = match[1]; if(x === caml_check_bound(k, i)[1 + i]){ /*<>*/ /*<>*/ var - _k_ = i + 1 | 0; - if(_i_ !== i){var i = _k_; continue;} - switch$0 = 1; + _i_ = i + 1 | 0; + if(_g_ === i) break; + i = _i_; + continue; } } - if(! switch$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[3], 1); - break; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[3], 1); } } - /*<>*/ /*<>*/ var _j_ = 1; - /*<>*/ return _j_; + /*<>*/ /*<>*/ var _h_ = 1; + /*<>*/ return _h_; } - catch(_l_){ - var _g_ = caml_wrap_exception(_l_); - if(_g_ === Stdlib[3]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_g_, 0); + catch(_j_){ + var _e_ = caml_wrap_exception(_j_); + if(_e_ === Stdlib[3]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_e_, 0); } /*<>*/ } function remove$1(b, k){ @@ -31638,24 +33959,23 @@ if(! l) /*<>*/ return 0; var h = l[1], t = l[2]; /*<>*/ if(test_keys$0(k, h)){ - b[1] = /*<>*/ caml_call2(Stdlib_List[12], acc, t); + b[1] = /*<>*/ caml_call2(Stdlib_List[13], acc, t); return 0; } /*<>*/ var t$0 = l[2], - /*<>*/ acc$0 = [0, h, acc], - l = t$0, - acc = acc$0; + /*<>*/ acc$0 = [0, h, acc]; + l = t$0; + acc = acc$0; } /*<>*/ } function find$1(b, k){ - /*<>*/ var _d_ = b[1]; - /*<>*/ function _e_(_f_){ - /*<>*/ return test_keys$0(k, _f_); - } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = - /*<>*/ caml_call2(Stdlib_List[39], _e_, _d_); + /*<>*/ caml_call2 + (Stdlib_List[40], + function(_d_){ /*<>*/ return test_keys$0(k, _d_);}, + b[1]); if(! match) /*<>*/ return 0; var e = match[1]; /*<>*/ return get_data$1(e); @@ -31716,9 +34036,7 @@ caml_equal = runtime.caml_equal, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_string_length = runtime.caml_ml_string_length, - caml_string_equal = runtime.caml_string_equal, caml_string_get = runtime.caml_string_get, - caml_string_notequal = runtime.caml_string_notequal, caml_sys_getenv = runtime.caml_sys_getenv, caml_trampoline = runtime.caml_trampoline, caml_trampoline_return = runtime.caml_trampoline_return, @@ -31744,6 +34062,7 @@ : runtime.caml_call_gen(f, [a0, a1, a2, a3]); } var + undef = undefined, global_data = runtime.caml_get_global_data(), cst$18 = cst$19, cst$17 = cst$19, @@ -31757,7 +34076,7 @@ cst$12 = cst$20, cst$13 = cst$19, cst$6 = cst$20, - cst$7 = cst$20, + cst$7 = cst$19, cst$4 = cst$19, cst = cst$21, cst$3 = cst$19, @@ -31785,90 +34104,74 @@ Stdlib_String = global_data.Stdlib__String, Stdlib_List = global_data.Stdlib__List, Stdlib_Buffer = global_data.Stdlib__Buffer, - Stdlib_Sys = global_data.Stdlib__Sys, - _i_ = [0, 7, 0], - _h_ = [0, 1, [0, 3, [0, 5, 0]]], - _e_ = [0, [2, 0, [4, 6, [0, 2, 6], 0, [2, 0, 0]]], "%s%06x%s"], - cst_Filename_chop_extension = "Filename.chop_extension", - cst_Filename_chop_suffix = "Filename.chop_suffix", - _c_ = [0, cst$20, 0], - cst_2_1$0 = cst_2_1$1, - cst_2$0 = cst_2$1, - cst_Filename_quote_command_bad = "Filename.quote_command: bad file name ", - cst_2_1 = cst_2_1$1, - cst_2 = cst_2$1, - cst_tmp = "/tmp"; + Stdlib_Sys = global_data.Stdlib__Sys; function generic_basename(is_dir_sep, current_dir_name, name){ - /*<>*/ if - ( /*<>*/ caml_string_equal(name, cst$19)) + /*<>*/ if(name == cst$19) /*<>*/ return current_dir_name; var n$3 = caml_ml_string_length(name) - 1 | 0, n = n$3; /*<>*/ for(;;){ if(0 > n) /*<>*/ return /*<>*/ caml_call3 - (Stdlib_String[15], name, 0, 1); + (Stdlib_String[16], name, 0, 1); /*<>*/ if - ( /*<>*/ caml_call2(is_dir_sep, name, n)){ - /*<>*/ var - /*<>*/ n$0 = n - 1 | 0, - n = n$0; - continue; - } - /*<>*/ var - /*<>*/ p = n + 1 | 0, - n$1 = n; - /*<>*/ for(;;){ - if(0 > n$1) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_String[15], name, 0, p); - /*<>*/ if - ( /*<>*/ caml_call2(is_dir_sep, name, n$1)) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_String[15], name, n$1 + 1 | 0, (p - n$1 | 0) - 1 | 0); - var n$2 = n$1 - 1 | 0, n$1 = n$2; - } + (! /*<>*/ caml_call2(is_dir_sep, name, n)) + break; + /*<>*/ /*<>*/ var + n$0 = n - 1 | 0; + n = n$0; + } + /*<>*/ var + /*<>*/ p = n + 1 | 0, + n$1 = n; + /*<>*/ for(;;){ + if(0 > n$1) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_String[16], name, 0, p); + /*<>*/ if + ( /*<>*/ caml_call2(is_dir_sep, name, n$1)) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_String[16], name, n$1 + 1 | 0, (p - n$1 | 0) - 1 | 0); + var n$2 = n$1 - 1 | 0; + n$1 = n$2; } /*<>*/ } function generic_dirname(is_dir_sep, current_dir_name, name){ - /*<>*/ if - ( /*<>*/ caml_string_equal(name, cst$19)) + /*<>*/ if(name == cst$19) /*<>*/ return current_dir_name; var n$5 = caml_ml_string_length(name) - 1 | 0, n = n$5; /*<>*/ for(;;){ if(0 > n) /*<>*/ return /*<>*/ caml_call3 - (Stdlib_String[15], name, 0, 1); + (Stdlib_String[16], name, 0, 1); /*<>*/ if - ( /*<>*/ caml_call2(is_dir_sep, name, n)){ - /*<>*/ var - /*<>*/ n$0 = n - 1 | 0, - n = n$0; - continue; - } - var n$1 = n; - /*<>*/ for(;;){ - if(0 > n$1) return current_dir_name; - /*<>*/ if - (! /*<>*/ caml_call2(is_dir_sep, name, n$1)){ - /*<>*/ var - /*<>*/ n$2 = n$1 - 1 | 0, - n$1 = n$2; - continue; - } - var n$3 = n$1; - /*<>*/ for(;;){ - if(0 > n$3) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_String[15], name, 0, 1); - /*<>*/ if - (! /*<>*/ caml_call2(is_dir_sep, name, n$3)) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_String[15], name, 0, n$3 + 1 | 0); - /*<>*/ var - /*<>*/ n$4 = n$3 - 1 | 0, - n$3 = n$4; - } - } + (! /*<>*/ caml_call2(is_dir_sep, name, n)) + break; + /*<>*/ /*<>*/ var + n$0 = n - 1 | 0; + n = n$0; + } + var n$1 = n; + /*<>*/ for(;;){ + if(0 > n$1) return current_dir_name; + /*<>*/ if + ( /*<>*/ caml_call2(is_dir_sep, name, n$1)) + break; + /*<>*/ /*<>*/ var + n$2 = n$1 - 1 | 0; + n$1 = n$2; + } + var n$3 = n$1; + /*<>*/ for(;;){ + if(0 > n$3) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_String[16], name, 0, 1); + /*<>*/ if + (! /*<>*/ caml_call2(is_dir_sep, name, n$3)) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_String[16], name, 0, n$3 + 1 | 0); + /*<>*/ /*<>*/ var + n$4 = n$3 - 1 | 0; + n$3 = n$4; } /*<>*/ } function is_dir_sep(s, i){ @@ -31879,43 +34182,45 @@ /*<>*/ } function is_relative(n){ /*<>*/ var - _aK_ = caml_ml_string_length(n) < 1 ? 1 : 0, - _aL_ = - _aK_ + _aH_ = caml_ml_string_length(n) < 1 ? 1 : 0, + _aI_ = + _aH_ || (47 !== /*<>*/ caml_string_get(n, 0) ? 1 : 0); - return _aL_; + return _aI_; /*<>*/ } function is_implicit(n){ /*<>*/ /*<>*/ var - _aF_ = is_relative(n); - /*<>*/ if(_aF_){ + _aC_ = is_relative(n); + /*<>*/ if(_aC_){ var - _aG_ = caml_ml_string_length(n) < 2 ? 1 : 0, - _aH_ = - _aG_ + _aD_ = caml_ml_string_length(n) < 2 ? 1 : 0, + _aE_ = + _aD_ || - /*<>*/ caml_string_notequal - ( /*<>*/ caml_call3(Stdlib_String[15], n, 0, 2), - cst$27); - /*<>*/ if(_aH_) + ( /*<>*/ caml_call3(Stdlib_String[16], n, 0, 2) + !== cst$27 + ? 1 + : 0); + /*<>*/ if(_aE_) var - _aI_ = caml_ml_string_length(n) < 3 ? 1 : 0, - _aJ_ = - _aI_ + _aF_ = caml_ml_string_length(n) < 3 ? 1 : 0, + _aG_ = + _aF_ || - /*<>*/ caml_string_notequal - ( /*<>*/ caml_call3(Stdlib_String[15], n, 0, 3), - cst$28); + ( /*<>*/ caml_call3(Stdlib_String[16], n, 0, 3) + !== cst$28 + ? 1 + : 0); else - var _aJ_ = _aH_; + var _aG_ = _aE_; } else - var _aJ_ = _aF_; - /*<>*/ return _aJ_; + var _aG_ = _aC_; + /*<>*/ return _aG_; /*<>*/ } function check_suffix(name, suff){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_String[11], suff, name); + (Stdlib_String[12], suff, name); /*<>*/ } function chop_suffix_opt(suffix, filename){ /*<>*/ var @@ -31925,22 +34230,35 @@ /*<>*/ /*<>*/ var r = /*<>*/ caml_call3 - (Stdlib_String[15], filename, len_f - len_s | 0, len_s); - /*<>*/ return /*<>*/ caml_string_equal - (r, suffix) + (Stdlib_String[16], filename, len_f - len_s | 0, len_s); + /*<>*/ return r == suffix ? [0, /*<>*/ caml_call3 - (Stdlib_String[15], filename, 0, len_f - len_s | 0)] + (Stdlib_String[16], filename, 0, len_f - len_s | 0)] : 0; /*<>*/ } + var + _h_ = [0, 7, 0], + _g_ = [0, 1, [0, 3, [0, 5, 0]]], + _f_ = [0, [2, 0, [4, 6, [0, 2, 6], 0, [2, 0, 0]]], "%s%06x%s"], + cst_Filename_chop_extension = "Filename.chop_extension", + cst_Filename_chop_suffix = "Filename.chop_suffix", + _d_ = [0, cst$20, 0], + cst_2_1$0 = cst_2_1$1, + cst_2$0 = cst_2$1, + cst_Filename_quote_command_bad = "Filename.quote_command: bad file name ", + _c_ = [0, cst$20, 0], + cst_2_1 = cst_2_1$1, + cst_2 = cst_2$1, + cst_tmp = "/tmp"; try{ /*<>*/ var - /*<>*/ _k_ = + /*<>*/ _j_ = /*<>*/ caml_sys_getenv("TMPDIR"), - temp_dir_name = _k_; + temp_dir_name = _j_; } - catch(_aE_){ - var _a_ = caml_wrap_exception(_aE_); + catch(_aB_){ + var _a_ = caml_wrap_exception(_aB_); if(_a_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_a_, 0); var temp_dir_name = cst_tmp; } @@ -31952,10 +34270,10 @@ /*<>*/ /*<>*/ caml_call2 (Stdlib_Buffer[12], b, 39); /*<>*/ var - _aB_ = l - 1 | 0, - /*<>*/ _aA_ = 0; - if(_aB_ >= 0){ - var i = _aA_; + _ay_ = l - 1 | 0, + /*<>*/ _ax_ = 0; + if(_ay_ >= 0){ + var i = _ax_; for(;;){ /*<>*/ if (39 === /*<>*/ caml_string_get(s, i)) @@ -31963,14 +34281,14 @@ (Stdlib_Buffer[16], b, quotequote); else{ /*<>*/ /*<>*/ var - _aD_ = /*<>*/ caml_string_get(s, i); + _aA_ = /*<>*/ caml_string_get(s, i); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Buffer[12], b, _aD_); + (Stdlib_Buffer[12], b, _aA_); } /*<>*/ /*<>*/ var - _aC_ = i + 1 | 0; - if(_aB_ !== i){var i = _aC_; continue;} - break; + _az_ = i + 1 | 0; + if(_ay_ === i) break; + i = _az_; } } /*<>*/ /*<>*/ caml_call2 @@ -31983,47 +34301,47 @@ var f = stderr[1]; /*<>*/ if ( /*<>*/ caml_equal(stderr, stdout)) - var _ap_ = cst_2_1; + var _am_ = cst_2_1; else /*<>*/ var - /*<>*/ _az_ = quote(f), - _ap_ = /*<>*/ caml_call2(Stdlib[28], cst_2, _az_); - var _aq_ = _ap_; + /*<>*/ _aw_ = quote(f), + _am_ = /*<>*/ caml_call2(Stdlib[28], cst_2, _aw_); + var _an_ = _am_; } else - var _aq_ = cst$4; + var _an_ = cst$4; if(stdout) /*<>*/ var f$0 = stdout[1], - /*<>*/ _ar_ = quote(f$0), - _as_ = /*<>*/ caml_call2(Stdlib[28], cst, _ar_); + /*<>*/ _ao_ = quote(f$0), + _ap_ = /*<>*/ caml_call2(Stdlib[28], cst, _ao_); else - var _as_ = cst$3; + var _ap_ = cst$3; /*<>*/ /*<>*/ var - _at_ = /*<>*/ caml_call2(Stdlib[28], _as_, _aq_); + _aq_ = /*<>*/ caml_call2(Stdlib[28], _ap_, _an_); if(stdin) /*<>*/ var f$1 = stdin[1], - /*<>*/ _au_ = quote(f$1), - _av_ = /*<>*/ caml_call2(Stdlib[28], cst$0, _au_); + /*<>*/ _ar_ = quote(f$1), + _as_ = /*<>*/ caml_call2(Stdlib[28], cst$0, _ar_); else - var _av_ = cst$2; + var _as_ = cst$2; /*<>*/ var - /*<>*/ _aw_ = - /*<>*/ caml_call2(Stdlib[28], _av_, _at_), - /*<>*/ _ax_ = + /*<>*/ _at_ = + /*<>*/ caml_call2(Stdlib[28], _as_, _aq_), + /*<>*/ _au_ = /*<>*/ caml_call2 - (Stdlib_List[19], quote, [0, cmd, args]), - /*<>*/ _ay_ = - /*<>*/ caml_call2(Stdlib_String[6], cst$1, _ax_); + (Stdlib_List[20], quote, [0, cmd, args]), + /*<>*/ _av_ = + /*<>*/ caml_call2(Stdlib_String[7], cst$1, _au_); /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], _ay_, _aw_); + (Stdlib[28], _av_, _at_); /*<>*/ } - /*<>*/ function basename(_ao_){ - /*<>*/ return generic_basename(is_dir_sep, current_dir_name, _ao_); + /*<>*/ function basename(_al_){ + /*<>*/ return generic_basename(is_dir_sep, current_dir_name, _al_); } - /*<>*/ function dirname(_an_){ - /*<>*/ return generic_dirname(is_dir_sep, current_dir_name, _an_); + /*<>*/ function dirname(_ak_){ + /*<>*/ return generic_dirname(is_dir_sep, current_dir_name, _ak_); } /*<>*/ /*<>*/ var Unix = @@ -32046,111 +34364,115 @@ /*<>*/ var /*<>*/ c = /*<>*/ caml_string_get(s, i), - _ak_ = 47 === c ? 1 : 0; - if(_ak_) - var _al_ = _ak_; + _ah_ = 47 === c ? 1 : 0; + if(_ah_) + var _ai_ = _ah_; else - var _am_ = 92 === c ? 1 : 0, _al_ = _am_ || (58 === c ? 1 : 0); - return _al_; + var _aj_ = 92 === c ? 1 : 0, _ai_ = _aj_ || (58 === c ? 1 : 0); + return _ai_; /*<>*/ } function is_relative$0(n){ /*<>*/ var - _ae_ = caml_ml_string_length(n) < 1 ? 1 : 0, - _af_ = - _ae_ + _ab_ = caml_ml_string_length(n) < 1 ? 1 : 0, + _ac_ = + _ab_ || (47 !== /*<>*/ caml_string_get(n, 0) ? 1 : 0); - if(_af_){ + if(_ac_){ var - _ag_ = caml_ml_string_length(n) < 1 ? 1 : 0, - _ah_ = - _ag_ + _ad_ = caml_ml_string_length(n) < 1 ? 1 : 0, + _ae_ = + _ad_ || (92 !== /*<>*/ caml_string_get(n, 0) ? 1 : 0); - if(_ah_) + if(_ae_) var - _ai_ = caml_ml_string_length(n) < 2 ? 1 : 0, - _aj_ = - _ai_ + _af_ = caml_ml_string_length(n) < 2 ? 1 : 0, + _ag_ = + _af_ || (58 !== /*<>*/ caml_string_get(n, 1) ? 1 : 0); else - var _aj_ = _ah_; + var _ag_ = _ae_; } else - var _aj_ = _af_; - return _aj_; + var _ag_ = _ac_; + return _ag_; /*<>*/ } function is_implicit$0(n){ /*<>*/ /*<>*/ var - _X_ = is_relative$0(n); - /*<>*/ if(_X_){ + _U_ = is_relative$0(n); + /*<>*/ if(_U_){ var - _Y_ = caml_ml_string_length(n) < 2 ? 1 : 0, - _Z_ = - _Y_ + _V_ = caml_ml_string_length(n) < 2 ? 1 : 0, + _W_ = + _V_ || - /*<>*/ caml_string_notequal - ( /*<>*/ caml_call3(Stdlib_String[15], n, 0, 2), - cst$27); - /*<>*/ if(_Z_){ + ( /*<>*/ caml_call3(Stdlib_String[16], n, 0, 2) + !== cst$27 + ? 1 + : 0); + /*<>*/ if(_W_){ var - ___ = caml_ml_string_length(n) < 2 ? 1 : 0, - _$_ = - ___ + _X_ = caml_ml_string_length(n) < 2 ? 1 : 0, + _Y_ = + _X_ || - /*<>*/ caml_string_notequal - ( /*<>*/ caml_call3(Stdlib_String[15], n, 0, 2), - ".\\"); - /*<>*/ if(_$_){ + ( /*<>*/ caml_call3(Stdlib_String[16], n, 0, 2) + !== ".\\" + ? 1 + : 0); + /*<>*/ if(_Y_){ var - _aa_ = caml_ml_string_length(n) < 3 ? 1 : 0, - _ab_ = - _aa_ + _Z_ = caml_ml_string_length(n) < 3 ? 1 : 0, + ___ = + _Z_ || - /*<>*/ caml_string_notequal - ( /*<>*/ caml_call3 - (Stdlib_String[15], n, 0, 3), - cst$28); - /*<>*/ if(_ab_) + ( /*<>*/ caml_call3(Stdlib_String[16], n, 0, 3) + !== cst$28 + ? 1 + : 0); + /*<>*/ if(___) var - _ac_ = caml_ml_string_length(n) < 3 ? 1 : 0, - _ad_ = - _ac_ + _$_ = caml_ml_string_length(n) < 3 ? 1 : 0, + _aa_ = + _$_ || - /*<>*/ caml_string_notequal - ( /*<>*/ caml_call3 - (Stdlib_String[15], n, 0, 3), - "..\\"); + ( /*<>*/ caml_call3 + (Stdlib_String[16], n, 0, 3) + !== "..\\" + ? 1 + : 0); else - var _ad_ = _ab_; + var _aa_ = ___; } else - var _ad_ = _$_; + var _aa_ = _Y_; } else - var _ad_ = _Z_; + var _aa_ = _W_; } else - var _ad_ = _X_; - /*<>*/ return _ad_; + var _aa_ = _U_; + /*<>*/ return _aa_; /*<>*/ } function check_suffix$0(name, suff){ /*<>*/ var - _U_ = caml_ml_string_length(suff) <= caml_ml_string_length(name) ? 1 : 0; - if(_U_) + _R_ = caml_ml_string_length(suff) <= caml_ml_string_length(name) ? 1 : 0; + if(_R_) /*<>*/ var /*<>*/ s = /*<>*/ caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], name, caml_ml_string_length(name) - caml_ml_string_length(suff) | 0, caml_ml_string_length(suff)), - /*<>*/ _V_ = - /*<>*/ caml_call1(Stdlib_String[26], suff), - _W_ = - /*<>*/ caml_string_equal - ( /*<>*/ caml_call1(Stdlib_String[26], s), _V_); + /*<>*/ _S_ = + /*<>*/ caml_call1(Stdlib_String[27], suff), + _T_ = + /*<>*/ caml_call1(Stdlib_String[27], s) == _S_ + ? 1 + : 0; else - var _W_ = _U_; - /*<>*/ return _W_; + var _T_ = _R_; + /*<>*/ return _T_; /*<>*/ } function chop_suffix_opt$0(suffix, filename){ /*<>*/ var @@ -32160,25 +34482,25 @@ /*<>*/ var /*<>*/ r = /*<>*/ caml_call3 - (Stdlib_String[15], filename, len_f - len_s | 0, len_s), - /*<>*/ _T_ = - /*<>*/ caml_call1(Stdlib_String[26], suffix); - /*<>*/ return /*<>*/ caml_string_equal - ( /*<>*/ caml_call1(Stdlib_String[26], r), - _T_) + (Stdlib_String[16], filename, len_f - len_s | 0, len_s), + /*<>*/ _Q_ = + /*<>*/ caml_call1(Stdlib_String[27], suffix); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_String[27], r) + == _Q_ ? [0, /*<>*/ caml_call3 - (Stdlib_String[15], filename, 0, len_f - len_s | 0)] + (Stdlib_String[16], filename, 0, len_f - len_s | 0)] : 0; /*<>*/ } try{ /*<>*/ var - /*<>*/ _j_ = + /*<>*/ _i_ = /*<>*/ caml_sys_getenv("TEMP"), - temp_dir_name$0 = _j_; + temp_dir_name$0 = _i_; } - catch(_S_){ - var _b_ = caml_wrap_exception(_S_); + catch(_P_){ + var _b_ = caml_wrap_exception(_P_); if(_b_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_b_, 0); var temp_dir_name$0 = cst$5; } @@ -32189,21 +34511,6 @@ /*<>*/ caml_call1(Stdlib_Buffer[1], l + 20 | 0); /*<>*/ /*<>*/ caml_call2 (Stdlib_Buffer[12], b, 34); - function add_bs(n){ - /*<>*/ /*<>*/ var _Q_ = 1; - if(n >= 1){ - var j = _Q_; - for(;;){ - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Buffer[12], b, 92); - /*<>*/ /*<>*/ var - _R_ = j + 1 | 0; - if(n !== j){var j = _R_; continue;} - break; - } - } - return 0; - /*<>*/ } function loop$0(counter, i){ /*<>*/ var i$0 = i; /*<>*/ for(;;){ @@ -32213,29 +34520,29 @@ /*<>*/ /*<>*/ var c = /*<>*/ caml_string_get(s, i$0); if(34 === c){ - var _O_ = 0; + var _N_ = 0; /*<>*/ if(counter >= 50) /*<>*/ return /*<>*/ caml_trampoline_return - (loop_bs, [0, _O_, i$0]); + (loop_bs, [0, _N_, i$0]); var counter$1 = counter + 1 | 0; - /*<>*/ return loop_bs(counter$1, _O_, i$0); + /*<>*/ return loop_bs(counter$1, _N_, i$0); } - if(92 !== c){ - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Buffer[12], b, c); - /*<>*/ var - /*<>*/ i$1 = i$0 + 1 | 0, - i$0 = i$1; - continue; + if(92 === c){ + var _O_ = 0; + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (loop_bs, [0, _O_, i$0]); + var counter$0 = counter + 1 | 0; + /*<>*/ return loop_bs(counter$0, _O_, i$0); } - var _P_ = 0; - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (loop_bs, [0, _P_, i$0]); - var counter$0 = counter + 1 | 0; - /*<>*/ return loop_bs(counter$0, _P_, i$0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Buffer[12], b, c); + /*<>*/ /*<>*/ var + i$1 = i$0 + 1 | 0; + i$0 = i$1; } /*<>*/ } + function loop(i){ /*<>*/ return caml_trampoline(loop$0(0, i));} function loop_bs(counter, n, i){ /*<>*/ var n$0 = n, i$0 = i; /*<>*/ for(;;){ @@ -32251,30 +34558,43 @@ /*<>*/ /*<>*/ caml_call2 (Stdlib_Buffer[12], b, 34); /*<>*/ /*<>*/ var - _N_ = i$0 + 1 | 0; + _M_ = i$0 + 1 | 0; /*<>*/ if(counter >= 50) /*<>*/ return /*<>*/ caml_trampoline_return - (loop$0, [0, _N_]); + (loop$0, [0, _M_]); var counter$1 = counter + 1 | 0; - /*<>*/ return loop$0(counter$1, _N_); + /*<>*/ return loop$0(counter$1, _M_); } - if(92 === match){ - /*<>*/ var - /*<>*/ i$1 = i$0 + 1 | 0, - n$1 = n$0 + 1 | 0, - n$0 = n$1, - i$0 = i$1; - continue; + if(92 !== match){ + /*<>*/ add_bs(n$0); + /*<>*/ if(counter >= 50) + /*<>*/ return /*<>*/ caml_trampoline_return + (loop$0, [0, i$0]); + var counter$0 = counter + 1 | 0; + /*<>*/ return loop$0(counter$0, i$0); } - /*<>*/ add_bs(n$0); - /*<>*/ if(counter >= 50) - /*<>*/ return /*<>*/ caml_trampoline_return - (loop$0, [0, i$0]); - var counter$0 = counter + 1 | 0; - /*<>*/ return loop$0(counter$0, i$0); + /*<>*/ var + /*<>*/ i$1 = i$0 + 1 | 0, + n$1 = n$0 + 1 | 0; + n$0 = n$1; + i$0 = i$1; } /*<>*/ } - function loop(i){ /*<>*/ return caml_trampoline(loop$0(0, i));} + function add_bs(n){ + /*<>*/ /*<>*/ var _K_ = 1; + if(n >= 1){ + var j = _K_; + for(;;){ + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Buffer[12], b, 92); + /*<>*/ /*<>*/ var + _L_ = j + 1 | 0; + if(n === j) break; + j = _L_; + } + } + return; + /*<>*/ } /*<>*/ loop(0); /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[2], b); @@ -32282,110 +34602,127 @@ function quote_cmd_filename(f){ /*<>*/ if (! - /*<>*/ caml_call2(Stdlib_String[14], f, 34) - && ! /*<>*/ caml_call2(Stdlib_String[14], f, 37)){ - /*<>*/ if - (! /*<>*/ caml_call2(Stdlib_String[14], f, 32)) - /*<>*/ return f; - /*<>*/ /*<>*/ var - _M_ = /*<>*/ caml_call2(Stdlib[28], f, cst$6); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$7, _M_); - } + /*<>*/ caml_call2 + (Stdlib_String[23], + function(param){ + /*<>*/ if(34 !== param && 37 !== param) + /*<>*/ return 0; + /*<>*/ return 1; + /*<>*/ }, + f)) + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_String[15], f, 32) + ? /*<>*/ caml_call2 + (Stdlib_String[7], cst$7, [0, cst$6, [0, f, _c_]]) + : f; /*<>*/ /*<>*/ var - _L_ = + _J_ = /*<>*/ caml_call2 (Stdlib[28], cst_Filename_quote_command_bad, f); /*<>*/ return /*<>*/ caml_call1 - (Stdlib[2], _L_); + (Stdlib[2], _J_); /*<>*/ } function quote_command$0(cmd, stdin, stdout, stderr, args){ /*<>*/ if(stderr){ var f = stderr[1]; /*<>*/ if ( /*<>*/ caml_equal(stderr, stdout)) - var _x_ = cst_2_1$0; + var _w_ = cst_2_1$0; else /*<>*/ var - /*<>*/ _J_ = quote_cmd_filename(f), - _x_ = /*<>*/ caml_call2(Stdlib[28], cst_2$0, _J_); - var _y_ = _x_; + /*<>*/ _H_ = quote_cmd_filename(f), + _w_ = /*<>*/ caml_call2(Stdlib[28], cst_2$0, _H_); + var _x_ = _w_; } else - var _y_ = cst$16; - var _z_ = [0, _y_, _c_]; + var _x_ = cst$16; + var _y_ = [0, _x_, _d_]; if(stdout) /*<>*/ var f$0 = stdout[1], - /*<>*/ _A_ = quote_cmd_filename(f$0), - _B_ = /*<>*/ caml_call2(Stdlib[28], cst$8, _A_); + /*<>*/ _z_ = quote_cmd_filename(f$0), + _A_ = /*<>*/ caml_call2(Stdlib[28], cst$8, _z_); else - var _B_ = cst$15; - var _C_ = [0, _B_, _z_]; + var _A_ = cst$15; + var _B_ = [0, _A_, _y_]; if(stdin) /*<>*/ var f$1 = stdin[1], - /*<>*/ _D_ = quote_cmd_filename(f$1), - _E_ = /*<>*/ caml_call2(Stdlib[28], cst$9, _D_); + /*<>*/ _C_ = quote_cmd_filename(f$1), + _D_ = /*<>*/ caml_call2(Stdlib[28], cst$9, _C_); else - var _E_ = cst$14; + var _D_ = cst$14; /*<>*/ var - /*<>*/ _G_ = - /*<>*/ caml_call2(Stdlib_List[19], quote$0, args), + /*<>*/ _E_ = + /*<>*/ caml_call2(Stdlib_List[20], quote$0, args), /*<>*/ s = - /*<>*/ caml_call2(Stdlib_String[6], cst$10, _G_), + /*<>*/ caml_call2(Stdlib_String[7], cst$10, _E_), /*<>*/ b = /*<>*/ caml_call1 - (Stdlib_Buffer[1], caml_ml_string_length(s) + 20 | 0), - _F_ = [0, _E_, _C_]; - function _w_(c){ - /*<>*/ var switch$0 = 0; - if(62 <= c){ - var _K_ = c - 63 | 0; - if(60 < _K_ >>> 0){ - if(62 > _K_) switch$0 = 1; - } - else if(31 === _K_) switch$0 = 1; - } - else - if(42 <= c){ - if(60 === c) switch$0 = 1; - } - else if(33 <= c) - switch(c - 33 | 0){case 2:case 3:case 6: break;default: switch$0 = 1;} - return switch$0 - ? ( /*<>*/ caml_call2 - (Stdlib_Buffer[12], b, 94), - /*<>*/ caml_call2(Stdlib_Buffer[12], b, c)) - : /*<>*/ caml_call2(Stdlib_Buffer[12], b, c); - /*<>*/ } + (Stdlib_Buffer[1], caml_ml_string_length(s) + 20 | 0); /*<>*/ /*<>*/ caml_call2 - (Stdlib_String[29], _w_, s); + (Stdlib_String[30], + function(c){ + /*<>*/ a: + { + if(62 <= c){ + var _I_ = c - 63 | 0; + if(60 < _I_ >>> 0){ + if(62 <= _I_) break a; + } + else if(31 !== _I_) break a; + } + else + if(42 <= c){ + if(60 !== c) break a; + } + else{ + if(33 > c) break a; + switch(c - 33 | 0){case 2:case 3:case 6: break a; + } + } + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Buffer[12], b, 94); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Buffer[12], b, c); + } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Buffer[12], b, c); + /*<>*/ }, + s); /*<>*/ var - _H_ = + _F_ = [0, cst$11, - [0, /*<>*/ caml_call1(Stdlib_Buffer[2], b), _F_]], - /*<>*/ _I_ = - [0, cst$12, [0, quote_cmd_filename(cmd), _H_]]; + [0, + /*<>*/ caml_call1(Stdlib_Buffer[2], b), + [0, _D_, _B_]]], + /*<>*/ _G_ = + [0, cst$12, [0, quote_cmd_filename(cmd), _F_]]; /*<>*/ return /*<>*/ caml_call2 - (Stdlib_String[6], cst$13, _I_); + (Stdlib_String[7], cst$13, _G_); /*<>*/ } function drive_and_path(s){ /*<>*/ var _s_ = 2 <= /*<>*/ caml_ml_string_length(s) ? 1 : 0; if(_s_){ - /*<>*/ var - /*<>*/ param = - /*<>*/ caml_string_get(s, 0), - switch$0 = 0; - if(91 <= param){ - if(25 >= param - 97 >>> 0) switch$0 = 1; - } - else if(65 <= param) switch$0 = 1; - /*<>*/ var - _t_ = switch$0 ? 1 : 0, - /*<>*/ _u_ = + /*<>*/ /*<>*/ var + param = /*<>*/ caml_string_get(s, 0); + a: + { + b: + { + if(91 <= param){ + if(25 < param - 97 >>> 0) break b; + } + else if(65 > param) break b; + var _t_ = 1; + break a; + } + var _t_ = 0; + } + /*<>*/ /*<>*/ var + _u_ = _t_ ? 58 === /*<>*/ caml_string_get(s, 1) ? 1 : 0 : _t_; @@ -32397,9 +34734,9 @@ /*<>*/ /*<>*/ var _v_ = /*<>*/ caml_call3 - (Stdlib_String[15], s, 2, caml_ml_string_length(s) - 2 | 0); + (Stdlib_String[16], s, 2, caml_ml_string_length(s) - 2 | 0); /*<>*/ return [0, - /*<>*/ caml_call3(Stdlib_String[15], s, 0, 2), + /*<>*/ caml_call3(Stdlib_String[16], s, 0, 2), _v_]; /*<>*/ } function dirname$0(s){ @@ -32457,11 +34794,8 @@ quote_command, basename$1, dirname$1], - _d_ = Stdlib_Sys[4], - Sysdeps = - caml_string_notequal(_d_, "Cygwin") - ? caml_string_notequal(_d_, "Win32") ? Unix : Win32 - : Cygwin, + _e_ = Stdlib_Sys[4], + Sysdeps = _e_ !== "Cygwin" ? _e_ !== "Win32" ? Unix : Win32 : Cygwin, null$3 = Sysdeps[1], current_dir_name$2 = Sysdeps[2], parent_dir_name$2 = Sysdeps[3], @@ -32493,7 +34827,7 @@ function chop_suffix(name, suff){ /*<>*/ return check_suffix$1(name, suff) ? caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], name, 0, caml_ml_string_length(name) - caml_ml_string_length(suff) | 0) @@ -32507,29 +34841,29 @@ /*<>*/ for(;;){ /*<>*/ if(0 <= i0 && ! is_dir_sep$1(name, i0)){ /*<>*/ if - (46 !== /*<>*/ caml_string_get(name, i0)){ - /*<>*/ var - /*<>*/ i$2 = i0 - 1 | 0, - i0 = i$2; - continue; - } - /*<>*/ var - /*<>*/ i$1 = i0 - 1 | 0, - i = i$1; - /*<>*/ for(;;){ - /*<>*/ if(0 <= i && ! is_dir_sep$1(name, i)){ - /*<>*/ if - (46 !== /*<>*/ caml_string_get(name, i)) - return caml_ml_string_length(name) - i0 | 0; - /*<>*/ var - /*<>*/ i$0 = i - 1 | 0, - i = i$0; - continue; - } - /*<>*/ return 0; - } + (46 === /*<>*/ caml_string_get(name, i0)) + break; + /*<>*/ /*<>*/ var + i$2 = i0 - 1 | 0; + i0 = i$2; + continue; } /*<>*/ return 0; + } + /*<>*/ var + /*<>*/ i$1 = i0 - 1 | 0, + i = i$1; + /*<>*/ for(;;){ + /*<>*/ if(0 <= i && ! is_dir_sep$1(name, i)){ + /*<>*/ if + (46 !== /*<>*/ caml_string_get(name, i)) + return caml_ml_string_length(name) - i0 | 0; + /*<>*/ /*<>*/ var + i$0 = i - 1 | 0; + i = i$0; + continue; + } + /*<>*/ return 0; } /*<>*/ } function extension(name){ @@ -32538,7 +34872,7 @@ /*<>*/ return 0 === l ? cst$18 : /*<>*/ caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], name, caml_ml_string_length(name) - l | 0, l); @@ -32550,7 +34884,7 @@ ? /*<>*/ caml_call1 (Stdlib[1], cst_Filename_chop_extension) : caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], name, 0, caml_ml_string_length(name) - l | 0); @@ -32561,7 +34895,7 @@ /*<>*/ return 0 === l ? name : caml_call3 - (Stdlib_String[15], + (Stdlib_String[16], name, 0, caml_ml_string_length(name) - l | 0); @@ -32569,28 +34903,28 @@ /*<>*/ /*<>*/ var prng_key = /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, Stdlib_Random[15][2]); + (Stdlib_Domain[10][1], 0, Stdlib_Random[19][2]); function temp_file_name(temp_dir, prefix, suffix){ /*<>*/ var /*<>*/ random_state = /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), /*<>*/ rnd = /*<>*/ caml_call1 - (Stdlib_Random[15][4], random_state) + (Stdlib_Random[19][4], random_state) & 16777215; /*<>*/ return concat (temp_dir, /*<>*/ caml_call4 - (Stdlib_Printf[4], _e_, prefix, rnd, suffix)); + (Stdlib_Printf[4], _f_, prefix, rnd, suffix)); /*<>*/ } - function _f_(param){ - /*<>*/ return temp_dir_name$1; - /*<>*/ } - /*<>*/ var - /*<>*/ _g_ = - [0, function(_o_){ /*<>*/ return _o_;}], - /*<>*/ current_temp_dir_name = - /*<>*/ caml_call2(Stdlib_Domain[10][1], _g_, _f_); + /*<>*/ /*<>*/ var + current_temp_dir_name = + /*<>*/ caml_call2 + (Stdlib_Domain[10][1], + [0, function(_o_){ /*<>*/ return _o_;}], + function(param){ + /*<>*/ return temp_dir_name$1; + /*<>*/ }); function set_temp_dir_name(s){ /*<>*/ return /*<>*/ caml_call2 (Stdlib_Domain[10][3], current_temp_dir_name, s); @@ -32600,52 +34934,43 @@ (Stdlib_Domain[10][2], current_temp_dir_name); /*<>*/ } function temp_file(opt, prefix, suffix){ - /*<>*/ if(opt) - var sth = opt[1], temp_dir = sth; - else - var - temp_dir = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name); - var counter = 0; + var + temp_dir = + opt + ? opt[1] + : /*<>*/ caml_call1 + (Stdlib_Domain[10][2], current_temp_dir_name), + counter = 0; /*<>*/ for(;;){ /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); /*<>*/ try{ /*<>*/ /*<>*/ runtime.caml_sys_close - ( /*<>*/ runtime.caml_sys_open(name, _h_, 384)); + ( /*<>*/ runtime.caml_sys_open(name, _g_, 384)); /*<>*/ return name; } catch(e$0){ var e = caml_wrap_exception(e$0); if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0); - if(1000 <= counter) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(20 <= counter) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ var - /*<>*/ counter$0 = counter + 1 | 0, - counter = counter$0; - continue; + /*<>*/ /*<>*/ var + counter$0 = counter + 1 | 0; + counter = counter$0; } } - /*<>*/ } - function open_temp_file(opt, _m_, _l_, prefix, suffix){ - /*<>*/ if(opt) - var sth = opt[1], mode = sth; - else - var mode = _i_; - /*<>*/ if(_m_) - var sth$0 = _m_[1], perms = sth$0; - else - var perms = 384; - /*<>*/ if(_l_) - var sth$1 = _l_[1], temp_dir = sth$1; - else - var - temp_dir = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name); - var counter = 0; + } + function open_temp_file(_m_, _l_, opt, prefix, suffix){ + var + mode = _m_ ? _m_[1] : _h_, + perms = _l_ ? _l_[1] : 384, + temp_dir = + opt + ? opt[1] + : /*<>*/ caml_call1 + (Stdlib_Domain[10][2], current_temp_dir_name), + counter = 0; /*<>*/ for(;;){ /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); @@ -32661,16 +34986,44 @@ catch(e$0){ var e = caml_wrap_exception(e$0); if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0); - if(1000 <= counter) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(20 <= counter) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ var - /*<>*/ counter$0 = counter + 1 | 0, - counter = counter$0; - continue; + /*<>*/ /*<>*/ var + counter$0 = counter + 1 | 0; + counter = counter$0; + } + } + } + function temp_dir(_k_, opt, prefix, suffix){ + var + temp_dir = + _k_ + ? _k_[1] + : /*<>*/ caml_call1 + (Stdlib_Domain[10][2], current_temp_dir_name), + perms = opt ? opt[1] : 448, + counter = 0; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + name = temp_file_name(temp_dir, prefix, suffix); + /*<>*/ try{ + /*<>*/ /*<>*/ runtime.caml_sys_mkdir + (name, perms); + /*<>*/ return name; + } + catch(e$0){ + var e = caml_wrap_exception(e$0); + if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0); + if(20 <= counter) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (e, 0); + /*<>*/ /*<>*/ var + counter$0 = counter + 1 | 0; + counter = counter$0; } } - /*<>*/ } + } var Stdlib_Filename = [0, @@ -32691,11 +35044,12 @@ null$3, temp_file, open_temp_file, + temp_dir, get_temp_dir_name, set_temp_dir_name, quote$1, quote_command$1]; - runtime.caml_register_global(65, Stdlib_Filename, "Stdlib__Filename"); + runtime.caml_register_global(66, Stdlib_Filename, "Stdlib__Filename"); return; /*<>*/ } (globalThis)); @@ -32845,44 +35199,51 @@ Stdlib_Array = global_data.Stdlib__Array, init = Stdlib_Array[1], make_matrix = Stdlib_Array[2], - append = Stdlib_Array[3], - concat = Stdlib_Array[4], - sub = Stdlib_Array[5], - copy = Stdlib_Array[6], - fill = Stdlib_Array[7], - blit = Stdlib_Array[8], - to_list = Stdlib_Array[9], - of_list = Stdlib_Array[10], - iter = Stdlib_Array[11], - iteri = Stdlib_Array[12], - map = Stdlib_Array[13], - mapi = Stdlib_Array[14], - fold_left = Stdlib_Array[15], - fold_left_map = Stdlib_Array[16], - fold_right = Stdlib_Array[17], - iter2 = Stdlib_Array[18], - map2 = Stdlib_Array[19], - for_all = Stdlib_Array[20], - exists = Stdlib_Array[21], - for_all2 = Stdlib_Array[22], - exists2 = Stdlib_Array[23], - mem = Stdlib_Array[24], - memq = Stdlib_Array[25], - find_opt = Stdlib_Array[26], - find_map = Stdlib_Array[27], - split = Stdlib_Array[28], - combine = Stdlib_Array[29], - sort = Stdlib_Array[30], - stable_sort = Stdlib_Array[31], - fast_sort = Stdlib_Array[32], - to_seq = Stdlib_Array[33], - to_seqi = Stdlib_Array[34], - of_seq = Stdlib_Array[35], - Floatarray = Stdlib_Array[36], + init_matrix = Stdlib_Array[3], + append = Stdlib_Array[4], + concat = Stdlib_Array[5], + sub = Stdlib_Array[6], + copy = Stdlib_Array[7], + fill = Stdlib_Array[8], + blit = Stdlib_Array[9], + to_list = Stdlib_Array[10], + of_list = Stdlib_Array[11], + iter = Stdlib_Array[12], + iteri = Stdlib_Array[13], + map = Stdlib_Array[14], + map_inplace = Stdlib_Array[15], + mapi = Stdlib_Array[16], + mapi_inplace = Stdlib_Array[17], + fold_left = Stdlib_Array[18], + fold_left_map = Stdlib_Array[19], + fold_right = Stdlib_Array[20], + iter2 = Stdlib_Array[21], + map2 = Stdlib_Array[22], + for_all = Stdlib_Array[23], + exists = Stdlib_Array[24], + for_all2 = Stdlib_Array[25], + exists2 = Stdlib_Array[26], + mem = Stdlib_Array[27], + memq = Stdlib_Array[28], + find_opt = Stdlib_Array[29], + find_index = Stdlib_Array[30], + find_map = Stdlib_Array[31], + find_mapi = Stdlib_Array[32], + split = Stdlib_Array[33], + combine = Stdlib_Array[34], + sort = Stdlib_Array[35], + stable_sort = Stdlib_Array[36], + fast_sort = Stdlib_Array[37], + shuffle = Stdlib_Array[38], + to_seq = Stdlib_Array[39], + to_seqi = Stdlib_Array[40], + of_seq = Stdlib_Array[41], + Floatarray = Stdlib_Array[42], Stdlib_ArrayLabels = [0, init, make_matrix, + init_matrix, append, concat, sub, @@ -32894,7 +35255,9 @@ iter, iteri, map, + map_inplace, mapi, + mapi_inplace, fold_left, fold_left_map, fold_right, @@ -32907,12 +35270,15 @@ mem, memq, find_opt, + find_index, find_map, + find_mapi, split, combine, sort, stable_sort, fast_sort, + shuffle, to_seq, to_seqi, of_seq, @@ -32934,70 +35300,74 @@ length = Stdlib_List[1], compare_lengths = Stdlib_List[2], compare_length_with = Stdlib_List[3], - cons = Stdlib_List[4], - hd = Stdlib_List[5], - tl = Stdlib_List[6], - nth = Stdlib_List[7], - nth_opt = Stdlib_List[8], - rev = Stdlib_List[9], - init = Stdlib_List[10], - append = Stdlib_List[11], - rev_append = Stdlib_List[12], - concat = Stdlib_List[13], - flatten = Stdlib_List[14], - equal = Stdlib_List[15], - compare = Stdlib_List[16], - iter = Stdlib_List[17], - iteri = Stdlib_List[18], - map = Stdlib_List[19], - mapi = Stdlib_List[20], - rev_map = Stdlib_List[21], - filter_map = Stdlib_List[22], - concat_map = Stdlib_List[23], - fold_left_map = Stdlib_List[24], - fold_left = Stdlib_List[25], - fold_right = Stdlib_List[26], - iter2 = Stdlib_List[27], - map2 = Stdlib_List[28], - rev_map2 = Stdlib_List[29], - fold_left2 = Stdlib_List[30], - fold_right2 = Stdlib_List[31], - for_all = Stdlib_List[32], - exists = Stdlib_List[33], - for_all2 = Stdlib_List[34], - exists2 = Stdlib_List[35], - mem = Stdlib_List[36], - memq = Stdlib_List[37], - find = Stdlib_List[38], - find_opt = Stdlib_List[39], - find_map = Stdlib_List[40], - filter = Stdlib_List[41], - find_all = Stdlib_List[42], - filteri = Stdlib_List[43], - partition = Stdlib_List[44], - partition_map = Stdlib_List[45], - assoc = Stdlib_List[46], - assoc_opt = Stdlib_List[47], - assq = Stdlib_List[48], - assq_opt = Stdlib_List[49], - mem_assoc = Stdlib_List[50], - mem_assq = Stdlib_List[51], - remove_assoc = Stdlib_List[52], - remove_assq = Stdlib_List[53], - split = Stdlib_List[54], - combine = Stdlib_List[55], - sort = Stdlib_List[56], - stable_sort = Stdlib_List[57], - fast_sort = Stdlib_List[58], - sort_uniq = Stdlib_List[59], - merge = Stdlib_List[60], - to_seq = Stdlib_List[61], - of_seq = Stdlib_List[62], + is_empty = Stdlib_List[4], + cons = Stdlib_List[5], + hd = Stdlib_List[6], + tl = Stdlib_List[7], + nth = Stdlib_List[8], + nth_opt = Stdlib_List[9], + rev = Stdlib_List[10], + init = Stdlib_List[11], + append = Stdlib_List[12], + rev_append = Stdlib_List[13], + concat = Stdlib_List[14], + flatten = Stdlib_List[15], + equal = Stdlib_List[16], + compare = Stdlib_List[17], + iter = Stdlib_List[18], + iteri = Stdlib_List[19], + map = Stdlib_List[20], + mapi = Stdlib_List[21], + rev_map = Stdlib_List[22], + filter_map = Stdlib_List[23], + concat_map = Stdlib_List[24], + fold_left_map = Stdlib_List[25], + fold_left = Stdlib_List[26], + fold_right = Stdlib_List[27], + iter2 = Stdlib_List[28], + map2 = Stdlib_List[29], + rev_map2 = Stdlib_List[30], + fold_left2 = Stdlib_List[31], + fold_right2 = Stdlib_List[32], + for_all = Stdlib_List[33], + exists = Stdlib_List[34], + for_all2 = Stdlib_List[35], + exists2 = Stdlib_List[36], + mem = Stdlib_List[37], + memq = Stdlib_List[38], + find = Stdlib_List[39], + find_opt = Stdlib_List[40], + find_index = Stdlib_List[41], + find_map = Stdlib_List[42], + find_mapi = Stdlib_List[43], + filter = Stdlib_List[44], + find_all = Stdlib_List[45], + filteri = Stdlib_List[46], + partition = Stdlib_List[47], + partition_map = Stdlib_List[48], + assoc = Stdlib_List[49], + assoc_opt = Stdlib_List[50], + assq = Stdlib_List[51], + assq_opt = Stdlib_List[52], + mem_assoc = Stdlib_List[53], + mem_assq = Stdlib_List[54], + remove_assoc = Stdlib_List[55], + remove_assq = Stdlib_List[56], + split = Stdlib_List[57], + combine = Stdlib_List[58], + sort = Stdlib_List[59], + stable_sort = Stdlib_List[60], + fast_sort = Stdlib_List[61], + sort_uniq = Stdlib_List[62], + merge = Stdlib_List[63], + to_seq = Stdlib_List[64], + of_seq = Stdlib_List[65], Stdlib_ListLabels = [0, length, compare_lengths, compare_length_with, + is_empty, cons, hd, tl, @@ -33034,7 +35404,9 @@ memq, find, find_opt, + find_index, find_map, + find_mapi, filter, find_all, filteri, @@ -33266,49 +35638,49 @@ empty = Stdlib_String[3], of_bytes = Stdlib_String[4], to_bytes = Stdlib_String[5], - concat = Stdlib_String[6], - cat = Stdlib_String[7], - equal = Stdlib_String[8], - compare = Stdlib_String[9], - starts_with = Stdlib_String[10], - ends_with = Stdlib_String[11], - contains_from = Stdlib_String[12], - rcontains_from = Stdlib_String[13], - contains = Stdlib_String[14], - sub = Stdlib_String[15], - split_on_char = Stdlib_String[16], - map = Stdlib_String[17], - mapi = Stdlib_String[18], - fold_left = Stdlib_String[19], - fold_right = Stdlib_String[20], - for_all = Stdlib_String[21], - exists = Stdlib_String[22], - trim = Stdlib_String[23], - escaped = Stdlib_String[24], - uppercase_ascii = Stdlib_String[25], - lowercase_ascii = Stdlib_String[26], - capitalize_ascii = Stdlib_String[27], - uncapitalize_ascii = Stdlib_String[28], - iter = Stdlib_String[29], - iteri = Stdlib_String[30], - index_from = Stdlib_String[31], - index_from_opt = Stdlib_String[32], - rindex_from = Stdlib_String[33], - rindex_from_opt = Stdlib_String[34], - index = Stdlib_String[35], - index_opt = Stdlib_String[36], - rindex = Stdlib_String[37], - rindex_opt = Stdlib_String[38], - to_seq = Stdlib_String[39], - to_seqi = Stdlib_String[40], - of_seq = Stdlib_String[41], - get_utf_8_uchar = Stdlib_String[42], - is_valid_utf_8 = Stdlib_String[43], - get_utf_16be_uchar = Stdlib_String[44], - is_valid_utf_16be = Stdlib_String[45], - get_utf_16le_uchar = Stdlib_String[46], - is_valid_utf_16le = Stdlib_String[47], - blit = Stdlib_String[48], + blit = Stdlib_String[6], + concat = Stdlib_String[7], + cat = Stdlib_String[8], + equal = Stdlib_String[9], + compare = Stdlib_String[10], + starts_with = Stdlib_String[11], + ends_with = Stdlib_String[12], + contains_from = Stdlib_String[13], + rcontains_from = Stdlib_String[14], + contains = Stdlib_String[15], + sub = Stdlib_String[16], + split_on_char = Stdlib_String[17], + map = Stdlib_String[18], + mapi = Stdlib_String[19], + fold_left = Stdlib_String[20], + fold_right = Stdlib_String[21], + for_all = Stdlib_String[22], + exists = Stdlib_String[23], + trim = Stdlib_String[24], + escaped = Stdlib_String[25], + uppercase_ascii = Stdlib_String[26], + lowercase_ascii = Stdlib_String[27], + capitalize_ascii = Stdlib_String[28], + uncapitalize_ascii = Stdlib_String[29], + iter = Stdlib_String[30], + iteri = Stdlib_String[31], + index_from = Stdlib_String[32], + index_from_opt = Stdlib_String[33], + rindex_from = Stdlib_String[34], + rindex_from_opt = Stdlib_String[35], + index = Stdlib_String[36], + index_opt = Stdlib_String[37], + rindex = Stdlib_String[38], + rindex_opt = Stdlib_String[39], + to_seq = Stdlib_String[40], + to_seqi = Stdlib_String[41], + of_seq = Stdlib_String[42], + get_utf_8_uchar = Stdlib_String[43], + is_valid_utf_8 = Stdlib_String[44], + get_utf_16be_uchar = Stdlib_String[45], + is_valid_utf_16be = Stdlib_String[46], + get_utf_16le_uchar = Stdlib_String[47], + is_valid_utf_16le = Stdlib_String[48], get_uint8 = Stdlib_String[49], get_int8 = Stdlib_String[50], get_uint16_ne = Stdlib_String[51], @@ -33332,6 +35704,7 @@ empty, of_bytes, to_bytes, + blit, concat, cat, equal, @@ -33374,7 +35747,6 @@ is_valid_utf_16be, get_utf_16le_uchar, is_valid_utf_16le, - blit, get_uint8, get_int8, get_uint16_ne, @@ -33391,407 +35763,34 @@ get_int64_ne, get_int64_be, get_int64_le]; - runtime.caml_register_global - (1, Stdlib_StringLabels, "Stdlib__StringLabels"); - return; - /*<>*/ } - (globalThis)); - -//# unitInfo: Provides: Stdlib__MoreLabels -//# unitInfo: Requires: Stdlib__Hashtbl, Stdlib__Map, Stdlib__Set -(function - (globalThis){ - "use strict"; - var - runtime = globalThis.jsoo_runtime, - global_data = runtime.caml_get_global_data(), - Stdlib_Set = global_data.Stdlib__Set, - Stdlib_Map = global_data.Stdlib__Map, - Stdlib_Hashtbl = global_data.Stdlib__Hashtbl, - Stdlib_MoreLabels = [0, Stdlib_Hashtbl, Stdlib_Map, Stdlib_Set]; - runtime.caml_register_global(3, Stdlib_MoreLabels, "Stdlib__MoreLabels"); - return; - /*<>*/ } - (globalThis)); - -//# unitInfo: Provides: Stdlib__StdLabels -(function(globalThis){ - "use strict"; - var runtime = globalThis.jsoo_runtime, Stdlib_StdLabels = [0]; - runtime.caml_register_global(0, Stdlib_StdLabels, "Stdlib__StdLabels"); + runtime.caml_register_global + (1, Stdlib_StringLabels, "Stdlib__StringLabels"); return; /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__In_channel -//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Fun, Stdlib__Sys +//# unitInfo: Provides: Stdlib__MoreLabels +//# unitInfo: Requires: Stdlib__Hashtbl, Stdlib__Map, Stdlib__Set (function (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, - caml_create_bytes = runtime.caml_create_bytes, - caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, - caml_ml_bytes_length = runtime.caml_ml_bytes_length, - caml_wrap_exception = runtime.caml_wrap_exception; - /*<>*/ function caml_call1(f, a0){ - return (f.l >= 0 ? f.l : f.l = f.length) == 1 - ? f(a0) - : runtime.caml_call_gen(f, [a0]); - } - /*<>*/ function caml_call2(f, a0, a1){ - return (f.l >= 0 ? f.l : f.l = f.length) == 2 - ? f(a0, a1) - : runtime.caml_call_gen(f, [a0, a1]); - } - /*<>*/ function caml_call3(f, a0, a1, a2){ - return (f.l >= 0 ? f.l : f.l = f.length) == 3 - ? f(a0, a1, a2) - : runtime.caml_call_gen(f, [a0, a1, a2]); - } - /*<>*/ function caml_call4(f, a0, a1, a2, a3){ - return (f.l >= 0 ? f.l : f.l = f.length) == 4 - ? f(a0, a1, a2, a3) - : runtime.caml_call_gen(f, [a0, a1, a2, a3]); - } - /*<>*/ function caml_call5(f, a0, a1, a2, a3, a4){ - return (f.l >= 0 ? f.l : f.l = f.length) == 5 - ? f(a0, a1, a2, a3, a4) - : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); - } - var global_data = runtime.caml_get_global_data(), - Stdlib_Bytes = global_data.Stdlib__Bytes, - Stdlib = global_data.Stdlib, - Stdlib_Sys = global_data.Stdlib__Sys, - Stdlib_Fun = global_data.Stdlib__Fun, - stdin = Stdlib[38], - open_bin = Stdlib[80], - open_text = Stdlib[79], - open_gen = Stdlib[81], - cst_In_channel_input_all_chann = - "In_channel.input_all: channel content is larger than maximum string length", - _a_ = [0, 0]; - function with_open(openfun, s, f){ - /*<>*/ /*<>*/ var - ic = /*<>*/ caml_call1(openfun, s); - function _r_(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, ic); - /*<>*/ } - function _s_(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[94], ic); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Fun[4], _s_, _r_); - /*<>*/ } - function with_open_bin(s, f){ - /*<>*/ return with_open(Stdlib[80], s, f); - /*<>*/ } - function with_open_text(s, f){ - /*<>*/ return with_open(Stdlib[79], s, f); - /*<>*/ } - function with_open_gen(flags, perm, s, f){ - /*<>*/ return with_open - ( /*<>*/ caml_call2(Stdlib[81], flags, perm), - s, - f); - /*<>*/ } - var - seek = Stdlib[96][4], - pos = Stdlib[96][5], - length = Stdlib[96][6], - close = Stdlib[93], - close_noerr = Stdlib[94]; - function input_char(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - c = /*<>*/ caml_call1(Stdlib[82], ic); - } - catch(_q_){ - var _p_ = caml_wrap_exception(_q_); - if(_p_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_p_, 0); - } - /*<>*/ return [0, c]; - /*<>*/ } - function input_byte(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - n = /*<>*/ caml_call1(Stdlib[87], ic); - } - catch(_o_){ - var _n_ = caml_wrap_exception(_o_); - if(_n_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_n_, 0); - } - /*<>*/ return [0, n]; - /*<>*/ } - function input_line(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call1(Stdlib[83], ic); - } - catch(_m_){ - var _l_ = caml_wrap_exception(_m_); - if(_l_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_l_, 0); - } - /*<>*/ return [0, s]; - /*<>*/ } - var input = Stdlib[84]; - function really_input(ic, buf, pos, len){ - /*<>*/ try{ - /*<>*/ /*<>*/ caml_call4 - (Stdlib[85], ic, buf, pos, len); - /*<>*/ return _a_; - } - catch(_k_){ - var _j_ = caml_wrap_exception(_k_); - if(_j_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_j_, 0); - } - /*<>*/ } - function really_input_string(ic, len){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call2(Stdlib[86], ic, len); - } - catch(_i_){ - var _h_ = caml_wrap_exception(_i_); - if(_h_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_h_, 0); - } - /*<>*/ return [0, s]; - /*<>*/ } - function read_upto(ic, buf, ofs, len){ - /*<>*/ var ofs$0 = ofs, len$0 = len; - /*<>*/ for(;;){ - if(0 !== len$0){ - /*<>*/ /*<>*/ var - r = - /*<>*/ caml_call4 - (Stdlib[84], ic, buf, ofs$0, len$0); - /*<>*/ if(0 !== r){ - var - len$1 = len$0 - r | 0, - ofs$1 = ofs$0 + r | 0, - ofs$0 = ofs$1, - len$0 = len$1; - continue; - } - } - /*<>*/ return ofs$0 - ofs | 0; - } - /*<>*/ } - function ensure(buf, ofs, n){ - /*<>*/ var len = caml_ml_bytes_length(buf); - if((ofs + n | 0) <= len) /*<>*/ return buf; - /*<>*/ /*<>*/ var - new_len = [0, len]; - for(;;){ - if(new_len[1] < (ofs + n | 0)){ - new_len[1] = (2 * new_len[1] | 0) + 1 | 0; - continue; - } - /*<>*/ var - new_len$0 = new_len[1], - new_len$1 = - new_len$0 <= Stdlib_Sys[12] - ? new_len$0 - : ofs - < Stdlib_Sys[12] - ? Stdlib_Sys[12] - : /*<>*/ caml_call1 - (Stdlib[2], cst_In_channel_input_all_chann), - /*<>*/ new_buf = - /*<>*/ caml_create_bytes(new_len$1); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Bytes[11], buf, 0, new_buf, 0, ofs); - /*<>*/ return new_buf; - } - /*<>*/ } - function input_all(ic){ - /*<>*/ /*<>*/ var - chunk_size = 65536; - /*<>*/ try{ - /*<>*/ var - /*<>*/ _d_ = - /*<>*/ caml_call1(Stdlib[91], ic), - /*<>*/ _e_ = - /*<>*/ caml_call1(Stdlib[92], ic) - _d_ | 0, - initial_size = _e_; - } - catch(_g_){ - var _b_ = caml_wrap_exception(_g_); - if(_b_[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(_b_, 0); - var initial_size = -1; - } - /*<>*/ var - /*<>*/ initial_size$0 = - 0 <= initial_size ? initial_size : chunk_size, - initial_size$1 = - initial_size$0 <= Stdlib_Sys[12] ? initial_size$0 : Stdlib_Sys[12], - /*<>*/ buf = - /*<>*/ caml_create_bytes(initial_size$1), - /*<>*/ nread = - read_upto(ic, buf, 0, initial_size$1); - if(nread < initial_size$1) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Bytes[8], buf, 0, nread); - /*<>*/ try{ - /*<>*/ /*<>*/ var - c = /*<>*/ caml_call1(Stdlib[82], ic); - } - catch(_f_){ - var _c_ = caml_wrap_exception(_f_); - if(_c_ === Stdlib[12]) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], buf); - throw caml_maybe_attach_backtrace(_c_, 0); - } - /*<>*/ /*<>*/ var - buf$2 = ensure(buf, nread, 65537); - /*<>*/ /*<>*/ runtime.caml_bytes_set - (buf$2, nread, c); - /*<>*/ var - /*<>*/ ofs$1 = nread + 1 | 0, - buf$0 = buf$2, - ofs = ofs$1; - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ buf$1 = ensure(buf$0, ofs, chunk_size), - rem = caml_ml_bytes_length(buf$1) - ofs | 0, - /*<>*/ r = read_upto(ic, buf$1, ofs, rem); - if(r < rem) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Bytes[8], buf$1, 0, ofs + r | 0); - var ofs$0 = ofs + rem | 0, buf$0 = buf$1, ofs = ofs$0; - } - /*<>*/ } - var - set_binary_mode = Stdlib[95], - Stdlib_In_channel = - [0, - stdin, - open_bin, - open_text, - open_gen, - with_open_bin, - with_open_text, - with_open_gen, - seek, - pos, - length, - close, - close_noerr, - input_char, - input_byte, - input_line, - input, - really_input, - really_input_string, - input_all, - set_binary_mode]; - runtime.caml_register_global(6, Stdlib_In_channel, "Stdlib__In_channel"); + Stdlib_Set = global_data.Stdlib__Set, + Stdlib_Map = global_data.Stdlib__Map, + Stdlib_Hashtbl = global_data.Stdlib__Hashtbl, + Stdlib_MoreLabels = [0, Stdlib_Hashtbl, Stdlib_Map, Stdlib_Set]; + runtime.caml_register_global(3, Stdlib_MoreLabels, "Stdlib__MoreLabels"); return; /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__Out_channel -//# unitInfo: Requires: Stdlib, Stdlib__Fun -(function - (globalThis){ +//# unitInfo: Provides: Stdlib__StdLabels +(function(globalThis){ "use strict"; - var runtime = globalThis.jsoo_runtime; - /*<>*/ function caml_call1(f, a0){ - return (f.l >= 0 ? f.l : f.l = f.length) == 1 - ? f(a0) - : runtime.caml_call_gen(f, [a0]); - } - /*<>*/ function caml_call2(f, a0, a1){ - return (f.l >= 0 ? f.l : f.l = f.length) == 2 - ? f(a0, a1) - : runtime.caml_call_gen(f, [a0, a1]); - } - var - global_data = runtime.caml_get_global_data(), - Stdlib = global_data.Stdlib, - Stdlib_Fun = global_data.Stdlib__Fun, - stdout = Stdlib[39], - stderr = Stdlib[40], - open_bin = Stdlib[61], - open_text = Stdlib[60], - open_gen = Stdlib[62]; - function with_open(openfun, s, f){ - /*<>*/ /*<>*/ var - oc = /*<>*/ caml_call1(openfun, s); - function _a_(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, oc); - /*<>*/ } - function _b_(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[77], oc); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Fun[4], _b_, _a_); - /*<>*/ } - function with_open_bin(s, f){ - /*<>*/ return with_open(Stdlib[61], s, f); - /*<>*/ } - function with_open_text(s, f){ - /*<>*/ return with_open(Stdlib[60], s, f); - /*<>*/ } - function with_open_gen(flags, perm, s, f){ - /*<>*/ return with_open - ( /*<>*/ caml_call2(Stdlib[62], flags, perm), - s, - f); - /*<>*/ } - var - seek = Stdlib[96][1], - pos = Stdlib[96][2], - length = Stdlib[96][3], - close = Stdlib[76], - close_noerr = Stdlib[77], - flush = Stdlib[63], - flush_all = Stdlib[64], - output_char = Stdlib[65], - output_byte = Stdlib[70], - output_string = Stdlib[66], - output_bytes = Stdlib[67], - output = Stdlib[68], - output_substring = Stdlib[69], - set_binary_mode = Stdlib[78], - Stdlib_Out_channel = - [0, - stdout, - stderr, - open_bin, - open_text, - open_gen, - with_open_bin, - with_open_text, - with_open_gen, - seek, - pos, - length, - close, - close_noerr, - flush, - flush_all, - output_char, - output_byte, - output_string, - output_bytes, - output, - output_substring, - set_binary_mode, - runtime.caml_ml_set_buffered, - runtime.caml_ml_is_buffered]; - runtime.caml_register_global(2, Stdlib_Out_channel, "Stdlib__Out_channel"); + var runtime = globalThis.jsoo_runtime, Stdlib_StdLabels = [0]; + runtime.caml_register_global(0, Stdlib_StdLabels, "Stdlib__StdLabels"); return; /*<>*/ } (globalThis)); @@ -33831,141 +35830,140 @@ [248, "Stdlib.Effect.Unhandled", caml_fresh_oo_id(0)], /*<>*/ Continuation_already_resumed = [248, "Stdlib.Effect.Continuation_already_resumed", caml_fresh_oo_id(0)], - cst_impossible = "impossible", - cst_Initial_setup = "Initial_setup__", - cst_E = "E", _a_ = [0, [11, "Stdlib.Effect.Unhandled(", [2, 0, [12, 41, 0]]], - "Stdlib.Effect.Unhandled(%s)"], - cst_Stdlib_Effect_Should_not_s = "Stdlib.Effect.Should_not_see_this__", - cst_Effect_Unhandled = "Effect.Unhandled", - cst_Effect_Continuation_alread = "Effect.Continuation_already_resumed"; + "Stdlib.Effect.Unhandled(%s)"]; function printer(param){ /*<>*/ if(param[1] !== Unhandled) /*<>*/ return 0; /*<>*/ var x = param[2], - /*<>*/ _j_ = + /*<>*/ _i_ = /*<>*/ caml_call1(Stdlib_Printexc[26], x), /*<>*/ msg = - /*<>*/ caml_call2(Stdlib_Printf[4], _a_, _j_); + /*<>*/ caml_call2(Stdlib_Printf[4], _a_, _i_); /*<>*/ return [0, msg]; /*<>*/ } /*<>*/ /*<>*/ caml_call1 (Stdlib_Printexc[9], printer); /*<>*/ /*<>*/ var Should_not_see_this = - [248, cst_Stdlib_Effect_Should_not_s, caml_fresh_oo_id(0)]; + [248, "Stdlib.Effect.Should_not_see_this__", caml_fresh_oo_id(0)]; /*<>*/ /*<>*/ caml_call2 (Stdlib_Callback[2], - cst_Effect_Unhandled, + "Effect.Unhandled", [0, Unhandled, Should_not_see_this]); /*<>*/ /*<>*/ caml_call2 (Stdlib_Callback[2], - cst_Effect_Continuation_alread, + "Effect.Continuation_already_resumed", Continuation_already_resumed); /*<>*/ function continue$0(k, v){ - function _h_(x){ - /*<>*/ return x; - /*<>*/ } - /*<>*/ /*<>*/ var - _i_ = /*<>*/ caml_continuation_use_noexc(k); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ /*<>*/ var + _h_ = /*<>*/ caml_continuation_use_noexc(k); + function _g_(x){ + /*<>*/ return x; + /*<>*/ } + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function discontinue(k, e){ - function _f_(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ /*<>*/ var + _f_ = /*<>*/ caml_continuation_use_noexc(k); + function _e_(e){ + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 1); - /*<>*/ } - /*<>*/ /*<>*/ var - _g_ = /*<>*/ caml_continuation_use_noexc(k); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ } + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function discontinue_with_backtrace(k, e, bt){ - function _d_(e){ - /*<>*/ caml_restore_raw_backtrace(e, bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ /*<>*/ var + _d_ = /*<>*/ caml_continuation_use_noexc(k); + function _c_(e){ + /*<>*/ caml_restore_raw_backtrace(e, bt); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ } - /*<>*/ /*<>*/ var - _e_ = /*<>*/ caml_continuation_use_noexc(k); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ } + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function match_with(comp, arg, handler){ function effc(eff, k, last_fiber){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(handler[3], eff); + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(handler[3], eff); if(! match) - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); var f = match[1]; - /*<>*/ return /*<>*/ caml_call1(f, k); - /*<>*/ } - /*<>*/ /*<>*/ var + k[2] = last_fiber; + /*<>*/ return /*<>*/ caml_call1(f, k); + /*<>*/ } + /*<>*/ /*<>*/ var s = - /*<>*/ caml_alloc_stack(handler[1], handler[2], effc); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ caml_alloc_stack(handler[1], handler[2], effc); + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function try_with(comp, arg, handler){ function effc(eff, k, last_fiber){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(handler[1], eff); + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(handler[1], eff); if(! match) - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); var f = match[1]; - /*<>*/ return /*<>*/ caml_call1(f, k); - /*<>*/ } - function _c_(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (e, 1); - /*<>*/ } - /*<>*/ /*<>*/ var + k[2] = last_fiber; + /*<>*/ return /*<>*/ caml_call1(f, k); + /*<>*/ } + /*<>*/ /*<>*/ var s = - /*<>*/ caml_alloc_stack + /*<>*/ caml_alloc_stack (function(x){ - /*<>*/ return x; - /*<>*/ }, - _c_, + /*<>*/ return x; + /*<>*/ }, + function(e){ + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (e, 1); + /*<>*/ }, effc); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } - /*<>*/ /*<>*/ var - Deep = + /*<>*/ } + /*<>*/ var + /*<>*/ Deep = [0, continue$0, discontinue, discontinue_with_backtrace, match_with, - try_with]; + try_with], + cst_Initial_setup = "Initial_setup__", + cst_E = "E", + cst_impossible = "impossible"; function fiber(f){ - /*<>*/ var - /*<>*/ Initial_setup = + /*<>*/ var + /*<>*/ Initial_setup = [248, cst_Initial_setup, caml_fresh_oo_id(0)], - /*<>*/ E = [248, cst_E, caml_fresh_oo_id(0)]; + /*<>*/ E = [248, cst_E, caml_fresh_oo_id(0)]; function f$0(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, /*<>*/ jsoo_effect_not_supported()); - /*<>*/ } - /*<>*/ function error(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 + (f, /*<>*/ jsoo_effect_not_supported()); + /*<>*/ } + /*<>*/ function error(param){ + /*<>*/ return /*<>*/ caml_call1 (Stdlib[2], cst_impossible); - /*<>*/ } + /*<>*/ } function effc(eff, k, last_fiber){ - /*<>*/ if(eff === Initial_setup) - /*<>*/ throw [0, E, k]; - /*<>*/ return error(0); - /*<>*/ } - /*<>*/ /*<>*/ var - s = /*<>*/ caml_alloc_stack(error, error, effc); - /*<>*/ try{ - /*<>*/ /*<>*/ jsoo_effect_not_supported + /*<>*/ if(eff !== Initial_setup) + /*<>*/ return error(0); + k[2] = last_fiber; + /*<>*/ throw [0, E, k]; + /*<>*/ } + /*<>*/ /*<>*/ var + s = /*<>*/ caml_alloc_stack(error, error, effc); + /*<>*/ try{ + /*<>*/ /*<>*/ jsoo_effect_not_supported (); var _b_ = 0; } @@ -33973,58 +35971,59 @@ var exn = caml_wrap_exception(exn$0); if(exn[1] !== E) throw caml_maybe_attach_backtrace(exn, 0); var k = exn[2]; - /*<>*/ return k; + /*<>*/ return k; } - /*<>*/ return error(0); - /*<>*/ } + /*<>*/ return error(0); + /*<>*/ } function continue_gen(k, resume_fun, v, handler){ function effc(eff, k, last_fiber){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(handler[3], eff); + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(handler[3], eff); if(! match) - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); var f = match[1]; - /*<>*/ return /*<>*/ caml_call1 + k[2] = last_fiber; + /*<>*/ return /*<>*/ caml_call1 (f, k); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var stack = - /*<>*/ runtime.caml_continuation_use_and_update_handler_noexc + /*<>*/ runtime.caml_continuation_use_and_update_handler_noexc (k, handler[1], handler[2], effc); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function continue_with(k, v, handler){ - /*<>*/ return continue_gen + /*<>*/ return continue_gen (k, function(x){ - /*<>*/ return x; - /*<>*/ }, + /*<>*/ return x; + /*<>*/ }, v, handler); - /*<>*/ } + /*<>*/ } function discontinue_with(k, v, handler){ - /*<>*/ return continue_gen + /*<>*/ return continue_gen (k, function(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 1); - /*<>*/ }, + /*<>*/ }, v, handler); - /*<>*/ } + /*<>*/ } function discontinue_with_backtrace$0(k, v, bt, handler){ - /*<>*/ return continue_gen + /*<>*/ return continue_gen (k, function(e){ - /*<>*/ caml_restore_raw_backtrace(e, bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ caml_restore_raw_backtrace(e, bt); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ }, + /*<>*/ }, v, handler); - /*<>*/ } + /*<>*/ } var Stdlib_Effect = [0, diff --git a/compiler/tests-io/dune b/compiler/tests-io/dune index 7fa844c5b..a2dcef1a3 100644 --- a/compiler/tests-io/dune +++ b/compiler/tests-io/dune @@ -10,7 +10,7 @@ (with-stdout-to %{target} (pipe-stdout - (run printf "echo \226\152\160") + (run printf "echo ☠") (run %{dep:./cat.exe}))))) (rule @@ -19,7 +19,7 @@ (with-stdout-to %{target} (pipe-stdout - (run printf "echo \226\152\160") + (run printf "echo ☠") (run node %{dep:./cat.bc.js}))))) (rule diff --git a/compiler/tests-js-parser/README.md b/compiler/tests-js-parser/README.md new file mode 100644 index 000000000..516d56979 --- /dev/null +++ b/compiler/tests-js-parser/README.md @@ -0,0 +1,5 @@ +# Testing + +Tests were imported from https://github.com/tc39/test262-parser-tests. + +We currently only check that we can parse at least as much as Node in strict mode. \ No newline at end of file diff --git a/compiler/tests-js-parser/dune b/compiler/tests-js-parser/dune index 0af185152..a3a8259a5 100644 --- a/compiler/tests-js-parser/dune +++ b/compiler/tests-js-parser/dune @@ -2,5 +2,21 @@ (name run) (libraries js_of_ocaml_compiler unix str)) -;; $ git clone git@github.com:tc39/test262-parser-tests.git -;; $ dune exe compiler/tests-js-parser/run.exe test262-parser-tests/pass/* +(rule + (alias runtest-parser) + (deps + (glob_files_rec pass/*.js) + package.json) + (action + (run ./run.exe pass))) + +;; git submodule add test262 https://github.com/tc39/test262.git +;; git checkout 6cbb6da9473c56d95358d8e679c5a6d2b4574efb + +(rule + (alias runtest-parser) + (deps + (glob_files_rec test262/test/language/*.js) + package.json) + (action + (run ./run.exe test262/test/language))) diff --git a/compiler/tests-js-parser/early/0049fa147d7edac0.js b/compiler/tests-js-parser/early/0049fa147d7edac0.js new file mode 100644 index 000000000..06b4fc15e --- /dev/null +++ b/compiler/tests-js-parser/early/0049fa147d7edac0.js @@ -0,0 +1 @@ +!{ *a(b, b){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/00acbf0c12170b0c.module.js b/compiler/tests-js-parser/early/00acbf0c12170b0c.module.js new file mode 100644 index 000000000..a4887055c --- /dev/null +++ b/compiler/tests-js-parser/early/00acbf0c12170b0c.module.js @@ -0,0 +1 @@ +export default function(a){ let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/00b5935e92cb70cf.js b/compiler/tests-js-parser/early/00b5935e92cb70cf.js new file mode 100644 index 000000000..0edca5bd0 --- /dev/null +++ b/compiler/tests-js-parser/early/00b5935e92cb70cf.js @@ -0,0 +1 @@ +({ a(eval) { "use strict"; } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/00b86c72dd55da4c.js b/compiler/tests-js-parser/early/00b86c72dd55da4c.js new file mode 100644 index 000000000..3234c3183 --- /dev/null +++ b/compiler/tests-js-parser/early/00b86c72dd55da4c.js @@ -0,0 +1 @@ +for (let let of a); diff --git a/compiler/tests-js-parser/early/0215ca9c41a5e2f0.js b/compiler/tests-js-parser/early/0215ca9c41a5e2f0.js new file mode 100644 index 000000000..88f5a14e6 --- /dev/null +++ b/compiler/tests-js-parser/early/0215ca9c41a5e2f0.js @@ -0,0 +1 @@ +function* a(){ function* b({[yield]: c}){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/024073814ce2cace.js b/compiler/tests-js-parser/early/024073814ce2cace.js new file mode 100644 index 000000000..dab692ae4 --- /dev/null +++ b/compiler/tests-js-parser/early/024073814ce2cace.js @@ -0,0 +1 @@ +for(([0]) in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/02ea8b2ade05bd70.js b/compiler/tests-js-parser/early/02ea8b2ade05bd70.js new file mode 100644 index 000000000..7431810ae --- /dev/null +++ b/compiler/tests-js-parser/early/02ea8b2ade05bd70.js @@ -0,0 +1 @@ +for(const {a, a} of 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/02f524d89378b9c0.js b/compiler/tests-js-parser/early/02f524d89378b9c0.js new file mode 100644 index 000000000..7cdd07862 --- /dev/null +++ b/compiler/tests-js-parser/early/02f524d89378b9c0.js @@ -0,0 +1 @@ +!function a(b){ super[1] } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/033064204b44b686.js b/compiler/tests-js-parser/early/033064204b44b686.js new file mode 100644 index 000000000..fc719365f --- /dev/null +++ b/compiler/tests-js-parser/early/033064204b44b686.js @@ -0,0 +1 @@ +({set a(b){}} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/035deac78364fadd.js b/compiler/tests-js-parser/early/035deac78364fadd.js new file mode 100644 index 000000000..52faff9d9 --- /dev/null +++ b/compiler/tests-js-parser/early/035deac78364fadd.js @@ -0,0 +1 @@ +for (let let in a); diff --git a/compiler/tests-js-parser/early/0448fa12dcf82187.js b/compiler/tests-js-parser/early/0448fa12dcf82187.js new file mode 100644 index 000000000..dc3ed02fa --- /dev/null +++ b/compiler/tests-js-parser/early/0448fa12dcf82187.js @@ -0,0 +1 @@ +"use strict"; function static() { } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/046e854bdadf03a2.js b/compiler/tests-js-parser/early/046e854bdadf03a2.js new file mode 100644 index 000000000..bbeb4e8f0 --- /dev/null +++ b/compiler/tests-js-parser/early/046e854bdadf03a2.js @@ -0,0 +1 @@ +(a) => { const a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/049070f015f6ee59.js b/compiler/tests-js-parser/early/049070f015f6ee59.js new file mode 100644 index 000000000..c8e41dfe9 --- /dev/null +++ b/compiler/tests-js-parser/early/049070f015f6ee59.js @@ -0,0 +1 @@ +!function* (a){ super.b } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/04b670143768ed81.js b/compiler/tests-js-parser/early/04b670143768ed81.js new file mode 100644 index 000000000..4c82381a8 --- /dev/null +++ b/compiler/tests-js-parser/early/04b670143768ed81.js @@ -0,0 +1 @@ +class a extends b { c() { !function* (c = super.d()){} } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/050a006ae573e260.js b/compiler/tests-js-parser/early/050a006ae573e260.js new file mode 100644 index 000000000..4b756749a --- /dev/null +++ b/compiler/tests-js-parser/early/050a006ae573e260.js @@ -0,0 +1 @@ +function eval() {'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0525ca9f66f3a790.js b/compiler/tests-js-parser/early/0525ca9f66f3a790.js new file mode 100644 index 000000000..3d89127fc --- /dev/null +++ b/compiler/tests-js-parser/early/0525ca9f66f3a790.js @@ -0,0 +1 @@ +function a() { "use strict"; var private; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/05e304566bded41b.js b/compiler/tests-js-parser/early/05e304566bded41b.js new file mode 100644 index 000000000..6053fe93f --- /dev/null +++ b/compiler/tests-js-parser/early/05e304566bded41b.js @@ -0,0 +1 @@ +'use strict'; yield:; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/06593c3474233eca.js b/compiler/tests-js-parser/early/06593c3474233eca.js new file mode 100644 index 000000000..bdc2f1060 --- /dev/null +++ b/compiler/tests-js-parser/early/06593c3474233eca.js @@ -0,0 +1 @@ +package => {'use strict'} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0679a0f5ce52cbed.js b/compiler/tests-js-parser/early/0679a0f5ce52cbed.js new file mode 100644 index 000000000..455ea8aa0 --- /dev/null +++ b/compiler/tests-js-parser/early/0679a0f5ce52cbed.js @@ -0,0 +1 @@ +"use strict"; var yield; diff --git a/compiler/tests-js-parser/early/067ca95c844d37ab.js b/compiler/tests-js-parser/early/067ca95c844d37ab.js new file mode 100644 index 000000000..e8de267b7 --- /dev/null +++ b/compiler/tests-js-parser/early/067ca95c844d37ab.js @@ -0,0 +1 @@ +class a { constructor() { {{ (( super() )); }} } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0787a7e2c0cca664.js b/compiler/tests-js-parser/early/0787a7e2c0cca664.js new file mode 100644 index 000000000..b1aaca4d5 --- /dev/null +++ b/compiler/tests-js-parser/early/0787a7e2c0cca664.js @@ -0,0 +1 @@ +class a extends b { static get prototype(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/08a0ad1012bf251f.js b/compiler/tests-js-parser/early/08a0ad1012bf251f.js new file mode 100644 index 000000000..d6729e7ca --- /dev/null +++ b/compiler/tests-js-parser/early/08a0ad1012bf251f.js @@ -0,0 +1 @@ +class a extends b { c() { !function* (){ super.d(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/08b527a4146318e1.js b/compiler/tests-js-parser/early/08b527a4146318e1.js new file mode 100644 index 000000000..225382ca0 --- /dev/null +++ b/compiler/tests-js-parser/early/08b527a4146318e1.js @@ -0,0 +1 @@ +function a() {'use strict'; ++arguments; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/093af6de41ad1f9a.js b/compiler/tests-js-parser/early/093af6de41ad1f9a.js new file mode 100644 index 000000000..d23fa6b00 --- /dev/null +++ b/compiler/tests-js-parser/early/093af6de41ad1f9a.js @@ -0,0 +1 @@ +!{ a(){ let b; var b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/09c54f71bedaba09.js b/compiler/tests-js-parser/early/09c54f71bedaba09.js new file mode 100644 index 000000000..6b4daf53a --- /dev/null +++ b/compiler/tests-js-parser/early/09c54f71bedaba09.js @@ -0,0 +1 @@ +function* a(b = super.c){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/09f5d5136799f4d0.js b/compiler/tests-js-parser/early/09f5d5136799f4d0.js new file mode 100644 index 000000000..451429e6b --- /dev/null +++ b/compiler/tests-js-parser/early/09f5d5136799f4d0.js @@ -0,0 +1 @@ +!{ a() { !function* (a = super.b()){} } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0adf49f99fd9179b.js b/compiler/tests-js-parser/early/0adf49f99fd9179b.js new file mode 100644 index 000000000..2cbe85692 --- /dev/null +++ b/compiler/tests-js-parser/early/0adf49f99fd9179b.js @@ -0,0 +1 @@ +for(const a = 1;;) c: function b(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0ae7f7a5e6daf6bf.js b/compiler/tests-js-parser/early/0ae7f7a5e6daf6bf.js new file mode 100644 index 000000000..b69451fa5 --- /dev/null +++ b/compiler/tests-js-parser/early/0ae7f7a5e6daf6bf.js @@ -0,0 +1 @@ +!{ a(b) { let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0b04a856febd800f.js b/compiler/tests-js-parser/early/0b04a856febd800f.js new file mode 100644 index 000000000..216451de2 --- /dev/null +++ b/compiler/tests-js-parser/early/0b04a856febd800f.js @@ -0,0 +1 @@ +a: continue a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0b83079b62219d30.js b/compiler/tests-js-parser/early/0b83079b62219d30.js new file mode 100644 index 000000000..613f36fa7 --- /dev/null +++ b/compiler/tests-js-parser/early/0b83079b62219d30.js @@ -0,0 +1 @@ +switch (a) { default: continue; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0b92961b828d597c.js b/compiler/tests-js-parser/early/0b92961b828d597c.js new file mode 100644 index 000000000..894c0153b --- /dev/null +++ b/compiler/tests-js-parser/early/0b92961b828d597c.js @@ -0,0 +1 @@ +var a = super(); diff --git a/compiler/tests-js-parser/early/0bb4bba01d959d27.js b/compiler/tests-js-parser/early/0bb4bba01d959d27.js new file mode 100644 index 000000000..f78508609 --- /dev/null +++ b/compiler/tests-js-parser/early/0bb4bba01d959d27.js @@ -0,0 +1 @@ +class a { static b(c, c){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0bf37874b7af9907.js b/compiler/tests-js-parser/early/0bf37874b7af9907.js new file mode 100644 index 000000000..45127c0ad --- /dev/null +++ b/compiler/tests-js-parser/early/0bf37874b7af9907.js @@ -0,0 +1 @@ +continue; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0c05753a91d04a39.js b/compiler/tests-js-parser/early/0c05753a91d04a39.js new file mode 100644 index 000000000..79796c2bd --- /dev/null +++ b/compiler/tests-js-parser/early/0c05753a91d04a39.js @@ -0,0 +1 @@ +switch(1) { default: !function(){ break; }; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0c81e22716fd4098.js b/compiler/tests-js-parser/early/0c81e22716fd4098.js new file mode 100644 index 000000000..ecba7efc9 --- /dev/null +++ b/compiler/tests-js-parser/early/0c81e22716fd4098.js @@ -0,0 +1 @@ +!{ a(){ let b; let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0cda0bd08ee5f32a.js b/compiler/tests-js-parser/early/0cda0bd08ee5f32a.js new file mode 100644 index 000000000..b8fb01f58 --- /dev/null +++ b/compiler/tests-js-parser/early/0cda0bd08ee5f32a.js @@ -0,0 +1 @@ +for(const a = 1;;) { var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0ced4b330c31d29a.js b/compiler/tests-js-parser/early/0ced4b330c31d29a.js new file mode 100644 index 000000000..1080fe52e --- /dev/null +++ b/compiler/tests-js-parser/early/0ced4b330c31d29a.js @@ -0,0 +1 @@ +'use strict'; +protected; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0e431f0ebb564049.js b/compiler/tests-js-parser/early/0e431f0ebb564049.js new file mode 100644 index 000000000..40915d2c6 --- /dev/null +++ b/compiler/tests-js-parser/early/0e431f0ebb564049.js @@ -0,0 +1 @@ +function a() { 'use strict'; function b(arguments) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0e631216f7271fce.js b/compiler/tests-js-parser/early/0e631216f7271fce.js new file mode 100644 index 000000000..95c61cf5b --- /dev/null +++ b/compiler/tests-js-parser/early/0e631216f7271fce.js @@ -0,0 +1 @@ +/[a-z]/z diff --git a/compiler/tests-js-parser/early/0e74198f1a7ae211.js b/compiler/tests-js-parser/early/0e74198f1a7ae211.js new file mode 100644 index 000000000..c0c2d247a --- /dev/null +++ b/compiler/tests-js-parser/early/0e74198f1a7ae211.js @@ -0,0 +1 @@ +'use strict'; delete (a); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0ed820b1748fb826.js b/compiler/tests-js-parser/early/0ed820b1748fb826.js new file mode 100644 index 000000000..f6c97b6f6 --- /dev/null +++ b/compiler/tests-js-parser/early/0ed820b1748fb826.js @@ -0,0 +1 @@ +(((...a))) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0f1556f02253c856.js b/compiler/tests-js-parser/early/0f1556f02253c856.js new file mode 100644 index 000000000..38fb3b3bb --- /dev/null +++ b/compiler/tests-js-parser/early/0f1556f02253c856.js @@ -0,0 +1 @@ +'use strict'; arguments *= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0f1c90f57df0f783.js b/compiler/tests-js-parser/early/0f1c90f57df0f783.js new file mode 100644 index 000000000..1c446e814 --- /dev/null +++ b/compiler/tests-js-parser/early/0f1c90f57df0f783.js @@ -0,0 +1 @@ +(function () { 'use strict'; delete a; }()) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0f1e3ddb76ab3884.js b/compiler/tests-js-parser/early/0f1e3ddb76ab3884.js new file mode 100644 index 000000000..474499f54 --- /dev/null +++ b/compiler/tests-js-parser/early/0f1e3ddb76ab3884.js @@ -0,0 +1 @@ +'use strict'; var arguments; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0f3652dea9e0ae65.js b/compiler/tests-js-parser/early/0f3652dea9e0ae65.js new file mode 100644 index 000000000..b0ee538ef --- /dev/null +++ b/compiler/tests-js-parser/early/0f3652dea9e0ae65.js @@ -0,0 +1 @@ +class a extends b { c() { function* d(){ super.e(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/0f5f47108da5c34e.js b/compiler/tests-js-parser/early/0f5f47108da5c34e.js new file mode 100644 index 000000000..48d986e1b --- /dev/null +++ b/compiler/tests-js-parser/early/0f5f47108da5c34e.js @@ -0,0 +1 @@ +try {} catch(a) { for(var a of 1); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/105ffb01ec9f8aad.js b/compiler/tests-js-parser/early/105ffb01ec9f8aad.js new file mode 100644 index 000000000..748e9bece --- /dev/null +++ b/compiler/tests-js-parser/early/105ffb01ec9f8aad.js @@ -0,0 +1 @@ +!class a { constructor(){} "constructor"(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1075eb3e880c16b0.js b/compiler/tests-js-parser/early/1075eb3e880c16b0.js new file mode 100644 index 000000000..7998b4512 --- /dev/null +++ b/compiler/tests-js-parser/early/1075eb3e880c16b0.js @@ -0,0 +1 @@ +{ const a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/11413d1203575930.js b/compiler/tests-js-parser/early/11413d1203575930.js new file mode 100644 index 000000000..515e770f1 --- /dev/null +++ b/compiler/tests-js-parser/early/11413d1203575930.js @@ -0,0 +1 @@ +switch(1) { default: const a = 2; case 3: var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1179d3b7dbc0c804.module.js b/compiler/tests-js-parser/early/1179d3b7dbc0c804.module.js new file mode 100644 index 000000000..b2641b0a9 --- /dev/null +++ b/compiler/tests-js-parser/early/1179d3b7dbc0c804.module.js @@ -0,0 +1 @@ +import {b as a, c as a} from "module"; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/120c78cff8ff65dc.js b/compiler/tests-js-parser/early/120c78cff8ff65dc.js new file mode 100644 index 000000000..9579724cc --- /dev/null +++ b/compiler/tests-js-parser/early/120c78cff8ff65dc.js @@ -0,0 +1 @@ +'use strict'; if (1); else function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/126221967461dba0.module.js b/compiler/tests-js-parser/early/126221967461dba0.module.js new file mode 100644 index 000000000..5058210d7 --- /dev/null +++ b/compiler/tests-js-parser/early/126221967461dba0.module.js @@ -0,0 +1 @@ +export {a}; export const a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/12956d61ed0275e7.js b/compiler/tests-js-parser/early/12956d61ed0275e7.js new file mode 100644 index 000000000..1f807a953 --- /dev/null +++ b/compiler/tests-js-parser/early/12956d61ed0275e7.js @@ -0,0 +1 @@ +function* a(){ ({b = yield}) => 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/12a74c60f52a60de.js b/compiler/tests-js-parser/early/12a74c60f52a60de.js new file mode 100644 index 000000000..49add14fe --- /dev/null +++ b/compiler/tests-js-parser/early/12a74c60f52a60de.js @@ -0,0 +1 @@ +{ function a(){} function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/12ca91086414d5bf.js b/compiler/tests-js-parser/early/12ca91086414d5bf.js new file mode 100644 index 000000000..64137fd1e --- /dev/null +++ b/compiler/tests-js-parser/early/12ca91086414d5bf.js @@ -0,0 +1 @@ +function* a(){ (b = yield c) => 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/13305aa767840771.js b/compiler/tests-js-parser/early/13305aa767840771.js new file mode 100644 index 000000000..e587432d4 --- /dev/null +++ b/compiler/tests-js-parser/early/13305aa767840771.js @@ -0,0 +1 @@ +class a {static [static](){};} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/13881ca6f5020c23.js b/compiler/tests-js-parser/early/13881ca6f5020c23.js new file mode 100644 index 000000000..62b7489db --- /dev/null +++ b/compiler/tests-js-parser/early/13881ca6f5020c23.js @@ -0,0 +1 @@ +for(const a = 1, a = 2;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/13ba492bf43672ce.js b/compiler/tests-js-parser/early/13ba492bf43672ce.js new file mode 100644 index 000000000..472362a2a --- /dev/null +++ b/compiler/tests-js-parser/early/13ba492bf43672ce.js @@ -0,0 +1 @@ +function* a(){ function* b(c = yield){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/13d24ad99ac46c21.module.js b/compiler/tests-js-parser/early/13d24ad99ac46c21.module.js new file mode 100644 index 000000000..5df53adef --- /dev/null +++ b/compiler/tests-js-parser/early/13d24ad99ac46c21.module.js @@ -0,0 +1 @@ +var a; export default class {} export { a as default }; diff --git a/compiler/tests-js-parser/early/141df7dfb3f4ba30.js b/compiler/tests-js-parser/early/141df7dfb3f4ba30.js new file mode 100644 index 000000000..ca4b0fc77 --- /dev/null +++ b/compiler/tests-js-parser/early/141df7dfb3f4ba30.js @@ -0,0 +1 @@ +function a(){ c: while(1) continue b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1447683fba196181.js b/compiler/tests-js-parser/early/1447683fba196181.js new file mode 100644 index 000000000..e22a05939 --- /dev/null +++ b/compiler/tests-js-parser/early/1447683fba196181.js @@ -0,0 +1 @@ +/./\u0069 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/14780f0e432f5e53.js b/compiler/tests-js-parser/early/14780f0e432f5e53.js new file mode 100644 index 000000000..45e8c810c --- /dev/null +++ b/compiler/tests-js-parser/early/14780f0e432f5e53.js @@ -0,0 +1 @@ +function a() {'use strict'; eval = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/149af49baff5d371.js b/compiler/tests-js-parser/early/149af49baff5d371.js new file mode 100644 index 000000000..bff5470cf --- /dev/null +++ b/compiler/tests-js-parser/early/149af49baff5d371.js @@ -0,0 +1 @@ +for(const {a, a} in 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/14c149e612ab4111.js b/compiler/tests-js-parser/early/14c149e612ab4111.js new file mode 100644 index 000000000..2b22ffeb9 --- /dev/null +++ b/compiler/tests-js-parser/early/14c149e612ab4111.js @@ -0,0 +1 @@ +([a]) => { const a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/14d1d9ec5f97bd4e.module.js b/compiler/tests-js-parser/early/14d1d9ec5f97bd4e.module.js new file mode 100644 index 000000000..51df96cb4 --- /dev/null +++ b/compiler/tests-js-parser/early/14d1d9ec5f97bd4e.module.js @@ -0,0 +1 @@ +export let a; let b; export {b as a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/14eaa7e71c682461.js b/compiler/tests-js-parser/early/14eaa7e71c682461.js new file mode 100644 index 000000000..4788e4181 --- /dev/null +++ b/compiler/tests-js-parser/early/14eaa7e71c682461.js @@ -0,0 +1 @@ +("\u{FFFFFFF}") \ No newline at end of file diff --git a/compiler/tests-js-parser/early/14ebe56a5008e7c2.js b/compiler/tests-js-parser/early/14ebe56a5008e7c2.js new file mode 100644 index 000000000..5da70343a --- /dev/null +++ b/compiler/tests-js-parser/early/14ebe56a5008e7c2.js @@ -0,0 +1 @@ +break \ No newline at end of file diff --git a/compiler/tests-js-parser/early/156ba8b64a8720df.js b/compiler/tests-js-parser/early/156ba8b64a8720df.js new file mode 100644 index 000000000..dd963396e --- /dev/null +++ b/compiler/tests-js-parser/early/156ba8b64a8720df.js @@ -0,0 +1 @@ +!{ *a([b, b]){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/158193c5e3f4ef45.js b/compiler/tests-js-parser/early/158193c5e3f4ef45.js new file mode 100644 index 000000000..caa2040e4 --- /dev/null +++ b/compiler/tests-js-parser/early/158193c5e3f4ef45.js @@ -0,0 +1 @@ +"use strict"; function *a(){ var b = function yield(){}; } diff --git a/compiler/tests-js-parser/early/15e6b8396aa63c7a.js b/compiler/tests-js-parser/early/15e6b8396aa63c7a.js new file mode 100644 index 000000000..cf14002fc --- /dev/null +++ b/compiler/tests-js-parser/early/15e6b8396aa63c7a.js @@ -0,0 +1 @@ +function a() {'use strict'; function eval() { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/15f39ef18850325a.module.js b/compiler/tests-js-parser/early/15f39ef18850325a.module.js new file mode 100644 index 000000000..1f629480a --- /dev/null +++ b/compiler/tests-js-parser/early/15f39ef18850325a.module.js @@ -0,0 +1 @@ +var a; export let a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/160379fc701ab1a0.js b/compiler/tests-js-parser/early/160379fc701ab1a0.js new file mode 100644 index 000000000..9f02d2d1b --- /dev/null +++ b/compiler/tests-js-parser/early/160379fc701ab1a0.js @@ -0,0 +1 @@ +{ break; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/162cfa290302d177.module.js b/compiler/tests-js-parser/early/162cfa290302d177.module.js new file mode 100644 index 000000000..0b99079b1 --- /dev/null +++ b/compiler/tests-js-parser/early/162cfa290302d177.module.js @@ -0,0 +1 @@ +let a; export const a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/167909a2dbf8615b.js b/compiler/tests-js-parser/early/167909a2dbf8615b.js new file mode 100644 index 000000000..9ca057150 --- /dev/null +++ b/compiler/tests-js-parser/early/167909a2dbf8615b.js @@ -0,0 +1 @@ +a: while (true) { (function () { break; }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/16e3fd88e23fb59f.js b/compiler/tests-js-parser/early/16e3fd88e23fb59f.js new file mode 100644 index 000000000..2fdcd53d4 --- /dev/null +++ b/compiler/tests-js-parser/early/16e3fd88e23fb59f.js @@ -0,0 +1 @@ +function* a(){ ({ *b(c = d + e(yield)){} }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1731fab810b88f41.module.js b/compiler/tests-js-parser/early/1731fab810b88f41.module.js new file mode 100644 index 000000000..a077d4fa1 --- /dev/null +++ b/compiler/tests-js-parser/early/1731fab810b88f41.module.js @@ -0,0 +1 @@ +export default function(a){ const a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/18af7dfd6654aedb.js b/compiler/tests-js-parser/early/18af7dfd6654aedb.js new file mode 100644 index 000000000..5058eae47 --- /dev/null +++ b/compiler/tests-js-parser/early/18af7dfd6654aedb.js @@ -0,0 +1 @@ +'use strict'; function eval(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/18de13cf45fc2107.module.js b/compiler/tests-js-parser/early/18de13cf45fc2107.module.js new file mode 100644 index 000000000..e402b9786 --- /dev/null +++ b/compiler/tests-js-parser/early/18de13cf45fc2107.module.js @@ -0,0 +1 @@ +var a; export class a {}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1982ba04c60b6926.js b/compiler/tests-js-parser/early/1982ba04c60b6926.js new file mode 100644 index 000000000..f5cdc98f3 --- /dev/null +++ b/compiler/tests-js-parser/early/1982ba04c60b6926.js @@ -0,0 +1 @@ +function a() { "use strict"; interface = 1; } diff --git a/compiler/tests-js-parser/early/19e4308ef83dc278.js b/compiler/tests-js-parser/early/19e4308ef83dc278.js new file mode 100644 index 000000000..116b7c89f --- /dev/null +++ b/compiler/tests-js-parser/early/19e4308ef83dc278.js @@ -0,0 +1 @@ +{ var a; const a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1a1d935b84b0b362.js b/compiler/tests-js-parser/early/1a1d935b84b0b362.js new file mode 100644 index 000000000..a5fb591f7 --- /dev/null +++ b/compiler/tests-js-parser/early/1a1d935b84b0b362.js @@ -0,0 +1 @@ +function a([yield]){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1a37ff4b58d3c3fb.module.js b/compiler/tests-js-parser/early/1a37ff4b58d3c3fb.module.js new file mode 100644 index 000000000..946f59a5e --- /dev/null +++ b/compiler/tests-js-parser/early/1a37ff4b58d3c3fb.module.js @@ -0,0 +1 @@ +const a = 1; export let a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1ab79b644fb9500c.js b/compiler/tests-js-parser/early/1ab79b644fb9500c.js new file mode 100644 index 000000000..2b3ad4e3d --- /dev/null +++ b/compiler/tests-js-parser/early/1ab79b644fb9500c.js @@ -0,0 +1 @@ +for(const a;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1ae555b34fdc6291.js b/compiler/tests-js-parser/early/1ae555b34fdc6291.js new file mode 100644 index 000000000..06c88d9c3 --- /dev/null +++ b/compiler/tests-js-parser/early/1ae555b34fdc6291.js @@ -0,0 +1 @@ +function a() {'use strict'; (function eval() { }()) } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1aff49273f3e3a98.js b/compiler/tests-js-parser/early/1aff49273f3e3a98.js new file mode 100644 index 000000000..c989063ba --- /dev/null +++ b/compiler/tests-js-parser/early/1aff49273f3e3a98.js @@ -0,0 +1,14 @@ +function a() { + b.c('d'); +} +function a() { + b.c('e'); +} +{ + function a() { + b.c('d'); + } + function a() { + b.c('e'); + } +} diff --git a/compiler/tests-js-parser/early/1c22bc1b20bdacf1.js b/compiler/tests-js-parser/early/1c22bc1b20bdacf1.js new file mode 100644 index 000000000..71562555a --- /dev/null +++ b/compiler/tests-js-parser/early/1c22bc1b20bdacf1.js @@ -0,0 +1 @@ +({get a(){}} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1c933c0f1b7b87d4.js b/compiler/tests-js-parser/early/1c933c0f1b7b87d4.js new file mode 100644 index 000000000..f5ec621fa --- /dev/null +++ b/compiler/tests-js-parser/early/1c933c0f1b7b87d4.js @@ -0,0 +1 @@ +(a, a) => b; diff --git a/compiler/tests-js-parser/early/1cab3eedbdd8ecca.js b/compiler/tests-js-parser/early/1cab3eedbdd8ecca.js new file mode 100644 index 000000000..ec782595b --- /dev/null +++ b/compiler/tests-js-parser/early/1cab3eedbdd8ecca.js @@ -0,0 +1 @@ +function a(){ b: { b: ; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1cb15c6ead031a45.js b/compiler/tests-js-parser/early/1cb15c6ead031a45.js new file mode 100644 index 000000000..c5450fede --- /dev/null +++ b/compiler/tests-js-parser/early/1cb15c6ead031a45.js @@ -0,0 +1 @@ +function* a(){ function* b(c = d + b(yield)){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1cbc484d234f3d2e.js b/compiler/tests-js-parser/early/1cbc484d234f3d2e.js new file mode 100644 index 000000000..8e4cfb71b --- /dev/null +++ b/compiler/tests-js-parser/early/1cbc484d234f3d2e.js @@ -0,0 +1 @@ +class a extends b { c() { function* d(c = super.e()){} } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1ceb908ebceb9398.js b/compiler/tests-js-parser/early/1ceb908ebceb9398.js new file mode 100644 index 000000000..34584dab1 --- /dev/null +++ b/compiler/tests-js-parser/early/1ceb908ebceb9398.js @@ -0,0 +1 @@ +a: while (true) { (function () { break a; }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1e227ccd98d438fb.js b/compiler/tests-js-parser/early/1e227ccd98d438fb.js new file mode 100644 index 000000000..3e7fccc6d --- /dev/null +++ b/compiler/tests-js-parser/early/1e227ccd98d438fb.js @@ -0,0 +1 @@ +"use strict"; for (a in let) {} diff --git a/compiler/tests-js-parser/early/1e683bac3570349e.js b/compiler/tests-js-parser/early/1e683bac3570349e.js new file mode 100644 index 000000000..93e00acd6 --- /dev/null +++ b/compiler/tests-js-parser/early/1e683bac3570349e.js @@ -0,0 +1 @@ +function a(b){ super.c } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1efa7c2106f8e2ce.js b/compiler/tests-js-parser/early/1efa7c2106f8e2ce.js new file mode 100644 index 000000000..9b45c1b47 --- /dev/null +++ b/compiler/tests-js-parser/early/1efa7c2106f8e2ce.js @@ -0,0 +1 @@ +class a { *b(eval){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1f3bf9973704fd5f.js b/compiler/tests-js-parser/early/1f3bf9973704fd5f.js new file mode 100644 index 000000000..d74ac484e --- /dev/null +++ b/compiler/tests-js-parser/early/1f3bf9973704fd5f.js @@ -0,0 +1 @@ +!function* a(b = super()){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1f60e730ece29967.js b/compiler/tests-js-parser/early/1f60e730ece29967.js new file mode 100644 index 000000000..0c3e05779 --- /dev/null +++ b/compiler/tests-js-parser/early/1f60e730ece29967.js @@ -0,0 +1 @@ +'use strict'; let [eval] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/1fd7f24619b5f266.js b/compiler/tests-js-parser/early/1fd7f24619b5f266.js new file mode 100644 index 000000000..dc8b6d714 --- /dev/null +++ b/compiler/tests-js-parser/early/1fd7f24619b5f266.js @@ -0,0 +1 @@ +class a { static b({c, c}){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/205ffca8d2d55725.js b/compiler/tests-js-parser/early/205ffca8d2d55725.js new file mode 100644 index 000000000..6fadcbbb2 --- /dev/null +++ b/compiler/tests-js-parser/early/205ffca8d2d55725.js @@ -0,0 +1 @@ +!{ a([b, b]){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/210fb79a19872227.js b/compiler/tests-js-parser/early/210fb79a19872227.js new file mode 100644 index 000000000..ab690de06 --- /dev/null +++ b/compiler/tests-js-parser/early/210fb79a19872227.js @@ -0,0 +1 @@ +"use strict"; eval => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/212c9bd036be7fe3.js b/compiler/tests-js-parser/early/212c9bd036be7fe3.js new file mode 100644 index 000000000..f9215aa3c --- /dev/null +++ b/compiler/tests-js-parser/early/212c9bd036be7fe3.js @@ -0,0 +1 @@ +function* a(){ (b = yield* c) => 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/21f3dc70492447d0.js b/compiler/tests-js-parser/early/21f3dc70492447d0.js new file mode 100644 index 000000000..f34966842 --- /dev/null +++ b/compiler/tests-js-parser/early/21f3dc70492447d0.js @@ -0,0 +1 @@ +for({a: 0} of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/22287d4dfa9a5035.js b/compiler/tests-js-parser/early/22287d4dfa9a5035.js new file mode 100644 index 000000000..d3026a2cc --- /dev/null +++ b/compiler/tests-js-parser/early/22287d4dfa9a5035.js @@ -0,0 +1 @@ +!function* a(b) { super() } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/22718732250ca5cc.js b/compiler/tests-js-parser/early/22718732250ca5cc.js new file mode 100644 index 000000000..0d2862e93 --- /dev/null +++ b/compiler/tests-js-parser/early/22718732250ca5cc.js @@ -0,0 +1 @@ +b: break a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/227c9b7aff6a3a91.js b/compiler/tests-js-parser/early/227c9b7aff6a3a91.js new file mode 100644 index 000000000..6abafd5bf --- /dev/null +++ b/compiler/tests-js-parser/early/227c9b7aff6a3a91.js @@ -0,0 +1 @@ +!{ a(let) { 'use strict'; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/228aa4eba2418335.js b/compiler/tests-js-parser/early/228aa4eba2418335.js new file mode 100644 index 000000000..961d7f662 --- /dev/null +++ b/compiler/tests-js-parser/early/228aa4eba2418335.js @@ -0,0 +1 @@ +\u{0} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/230f5e3112d1e3f9.js b/compiler/tests-js-parser/early/230f5e3112d1e3f9.js new file mode 100644 index 000000000..dd9c1664a --- /dev/null +++ b/compiler/tests-js-parser/early/230f5e3112d1e3f9.js @@ -0,0 +1 @@ +switch(1) { case 2: let a; default: var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/244100b202daa83e.js b/compiler/tests-js-parser/early/244100b202daa83e.js new file mode 100644 index 000000000..e892220e8 --- /dev/null +++ b/compiler/tests-js-parser/early/244100b202daa83e.js @@ -0,0 +1 @@ +let a, let = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2484158f4a4987fa.js b/compiler/tests-js-parser/early/2484158f4a4987fa.js new file mode 100644 index 000000000..1bf989db3 --- /dev/null +++ b/compiler/tests-js-parser/early/2484158f4a4987fa.js @@ -0,0 +1 @@ +'use strict'; !{ set a(eval){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/24e27ce4ea8b1550.js b/compiler/tests-js-parser/early/24e27ce4ea8b1550.js new file mode 100644 index 000000000..55b5429f9 --- /dev/null +++ b/compiler/tests-js-parser/early/24e27ce4ea8b1550.js @@ -0,0 +1 @@ +(a, ...b) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/272a7c1b82c9c8b8.module.js b/compiler/tests-js-parser/early/272a7c1b82c9c8b8.module.js new file mode 100644 index 000000000..7a25cecc8 --- /dev/null +++ b/compiler/tests-js-parser/early/272a7c1b82c9c8b8.module.js @@ -0,0 +1 @@ +export { a, b as c } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/277a9ece19806bca.js b/compiler/tests-js-parser/early/277a9ece19806bca.js new file mode 100644 index 000000000..43542d0f1 --- /dev/null +++ b/compiler/tests-js-parser/early/277a9ece19806bca.js @@ -0,0 +1 @@ +__proto__: __proto__: 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/277ec371718b3aa0.js b/compiler/tests-js-parser/early/277ec371718b3aa0.js new file mode 100644 index 000000000..c928b6fc9 --- /dev/null +++ b/compiler/tests-js-parser/early/277ec371718b3aa0.js @@ -0,0 +1 @@ +(function a(eval) { "use strict"; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/282e57531a2b9cd3.js b/compiler/tests-js-parser/early/282e57531a2b9cd3.js new file mode 100644 index 000000000..c3019f717 --- /dev/null +++ b/compiler/tests-js-parser/early/282e57531a2b9cd3.js @@ -0,0 +1 @@ +!function(a = super.b){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2851e5fd6b1faaa2.js b/compiler/tests-js-parser/early/2851e5fd6b1faaa2.js new file mode 100644 index 000000000..aa9997f16 --- /dev/null +++ b/compiler/tests-js-parser/early/2851e5fd6b1faaa2.js @@ -0,0 +1 @@ +class a { get constructor() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/28fbe08ea84af592.js b/compiler/tests-js-parser/early/28fbe08ea84af592.js new file mode 100644 index 000000000..40d979304 --- /dev/null +++ b/compiler/tests-js-parser/early/28fbe08ea84af592.js @@ -0,0 +1 @@ +switch(1) { case 2: !function(){ break; }; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/293d515dfacc7ea6.module.js b/compiler/tests-js-parser/early/293d515dfacc7ea6.module.js new file mode 100644 index 000000000..2d1d35c30 --- /dev/null +++ b/compiler/tests-js-parser/early/293d515dfacc7ea6.module.js @@ -0,0 +1 @@ +export {a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2a3023267cfdb316.module.js b/compiler/tests-js-parser/early/2a3023267cfdb316.module.js new file mode 100644 index 000000000..b2f6a76c2 --- /dev/null +++ b/compiler/tests-js-parser/early/2a3023267cfdb316.module.js @@ -0,0 +1 @@ +import a, {b as a} from "module"; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2a53f86603b801fc.js b/compiler/tests-js-parser/early/2a53f86603b801fc.js new file mode 100644 index 000000000..979736c62 --- /dev/null +++ b/compiler/tests-js-parser/early/2a53f86603b801fc.js @@ -0,0 +1 @@ +function a() {'use strict'; --arguments; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2a8a50ac20483921.js b/compiler/tests-js-parser/early/2a8a50ac20483921.js new file mode 100644 index 000000000..fd7d50cfb --- /dev/null +++ b/compiler/tests-js-parser/early/2a8a50ac20483921.js @@ -0,0 +1 @@ +function a(){ let b; var b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2b3665fe3e0bc267.js b/compiler/tests-js-parser/early/2b3665fe3e0bc267.js new file mode 100644 index 000000000..f3e04b37e --- /dev/null +++ b/compiler/tests-js-parser/early/2b3665fe3e0bc267.js @@ -0,0 +1 @@ +for(let a;;) c: function b(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2b4520facdc72696.js b/compiler/tests-js-parser/early/2b4520facdc72696.js new file mode 100644 index 000000000..002553690 --- /dev/null +++ b/compiler/tests-js-parser/early/2b4520facdc72696.js @@ -0,0 +1 @@ +--0 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2c0f785914da9d0b.js b/compiler/tests-js-parser/early/2c0f785914da9d0b.js new file mode 100644 index 000000000..c915ef6ce --- /dev/null +++ b/compiler/tests-js-parser/early/2c0f785914da9d0b.js @@ -0,0 +1 @@ +(function package() {'use strict'; })() \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2c10310cb3f9beb8.js b/compiler/tests-js-parser/early/2c10310cb3f9beb8.js new file mode 100644 index 000000000..6d1160cf5 --- /dev/null +++ b/compiler/tests-js-parser/early/2c10310cb3f9beb8.js @@ -0,0 +1 @@ +let \u0061, \u{0061}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2c3cbce523ad436e.js b/compiler/tests-js-parser/early/2c3cbce523ad436e.js new file mode 100644 index 000000000..8d82b0737 --- /dev/null +++ b/compiler/tests-js-parser/early/2c3cbce523ad436e.js @@ -0,0 +1 @@ +(((a, ...b))) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2cfa21d258d48da0.js b/compiler/tests-js-parser/early/2cfa21d258d48da0.js new file mode 100644 index 000000000..b460e723c --- /dev/null +++ b/compiler/tests-js-parser/early/2cfa21d258d48da0.js @@ -0,0 +1 @@ +!{ a() { function b(a = super.c()){} } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2d06e2fe4ee154f4.js b/compiler/tests-js-parser/early/2d06e2fe4ee154f4.js new file mode 100644 index 000000000..72bfab392 --- /dev/null +++ b/compiler/tests-js-parser/early/2d06e2fe4ee154f4.js @@ -0,0 +1 @@ +a: { continue a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2d085d7876806d98.js b/compiler/tests-js-parser/early/2d085d7876806d98.js new file mode 100644 index 000000000..fc7d4f30c --- /dev/null +++ b/compiler/tests-js-parser/early/2d085d7876806d98.js @@ -0,0 +1 @@ +const a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2dae582489877ee5.js b/compiler/tests-js-parser/early/2dae582489877ee5.js new file mode 100644 index 000000000..719fbcbda --- /dev/null +++ b/compiler/tests-js-parser/early/2dae582489877ee5.js @@ -0,0 +1 @@ +class static {} diff --git a/compiler/tests-js-parser/early/2dca0ecc3e4f5bf4.js b/compiler/tests-js-parser/early/2dca0ecc3e4f5bf4.js new file mode 100644 index 000000000..9d3a50c9e --- /dev/null +++ b/compiler/tests-js-parser/early/2dca0ecc3e4f5bf4.js @@ -0,0 +1 @@ +switch(1) { case 2: let a; case 3: let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2dd665419e3df66e.module.js b/compiler/tests-js-parser/early/2dd665419e3df66e.module.js new file mode 100644 index 000000000..bb327a6e3 --- /dev/null +++ b/compiler/tests-js-parser/early/2dd665419e3df66e.module.js @@ -0,0 +1 @@ +let a, b; export {a, b as a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2dd671500974e7c0.js b/compiler/tests-js-parser/early/2dd671500974e7c0.js new file mode 100644 index 000000000..4a2e1d18c --- /dev/null +++ b/compiler/tests-js-parser/early/2dd671500974e7c0.js @@ -0,0 +1 @@ +'use strict'; ({a: arguments = 1} = 2) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2e95646f9143563e.js b/compiler/tests-js-parser/early/2e95646f9143563e.js new file mode 100644 index 000000000..9cc2c678a --- /dev/null +++ b/compiler/tests-js-parser/early/2e95646f9143563e.js @@ -0,0 +1 @@ +\u0000 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2ee61877dc80a257.js b/compiler/tests-js-parser/early/2ee61877dc80a257.js new file mode 100644 index 000000000..18fa74e57 --- /dev/null +++ b/compiler/tests-js-parser/early/2ee61877dc80a257.js @@ -0,0 +1 @@ +while(1) !function(){ break; }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2f0113dc941bf064.js b/compiler/tests-js-parser/early/2f0113dc941bf064.js new file mode 100644 index 000000000..635e87ce7 --- /dev/null +++ b/compiler/tests-js-parser/early/2f0113dc941bf064.js @@ -0,0 +1 @@ +if(1) break; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2fcc5b7e8d0ff3c9.js b/compiler/tests-js-parser/early/2fcc5b7e8d0ff3c9.js new file mode 100644 index 000000000..d84bed1e3 --- /dev/null +++ b/compiler/tests-js-parser/early/2fcc5b7e8d0ff3c9.js @@ -0,0 +1 @@ +!{ set a(eval){ 'use strict'; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/2ff71b4c3603175f.js b/compiler/tests-js-parser/early/2ff71b4c3603175f.js new file mode 100644 index 000000000..cfe52eec0 --- /dev/null +++ b/compiler/tests-js-parser/early/2ff71b4c3603175f.js @@ -0,0 +1 @@ +let a, a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/301abb5ba3b6506a.js b/compiler/tests-js-parser/early/301abb5ba3b6506a.js new file mode 100644 index 000000000..2ba0462b5 --- /dev/null +++ b/compiler/tests-js-parser/early/301abb5ba3b6506a.js @@ -0,0 +1 @@ +function* a(){ (b = c + d(yield)) => 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/302b9f99ef555d26.js b/compiler/tests-js-parser/early/302b9f99ef555d26.js new file mode 100644 index 000000000..4c4b63959 --- /dev/null +++ b/compiler/tests-js-parser/early/302b9f99ef555d26.js @@ -0,0 +1 @@ +for(let a in b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3121a50c07bfa0aa.js b/compiler/tests-js-parser/early/3121a50c07bfa0aa.js new file mode 100644 index 000000000..937a6053b --- /dev/null +++ b/compiler/tests-js-parser/early/3121a50c07bfa0aa.js @@ -0,0 +1 @@ +for(({a: 0}) in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3190762e2e329b66.js b/compiler/tests-js-parser/early/3190762e2e329b66.js new file mode 100644 index 000000000..62b9ce239 --- /dev/null +++ b/compiler/tests-js-parser/early/3190762e2e329b66.js @@ -0,0 +1 @@ +function *a() { ({b = yield}) => {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/32a3e279226eefa0.module.js b/compiler/tests-js-parser/early/32a3e279226eefa0.module.js new file mode 100644 index 000000000..e9481779b --- /dev/null +++ b/compiler/tests-js-parser/early/32a3e279226eefa0.module.js @@ -0,0 +1 @@ +export {a}; export function a(){}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/33aec60ac4f4c6b9.js b/compiler/tests-js-parser/early/33aec60ac4f4c6b9.js new file mode 100644 index 000000000..6e0749d3b --- /dev/null +++ b/compiler/tests-js-parser/early/33aec60ac4f4c6b9.js @@ -0,0 +1 @@ +function a(eval) {'use strict';} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/33c0166e3328813a.js b/compiler/tests-js-parser/early/33c0166e3328813a.js new file mode 100644 index 000000000..913913aee --- /dev/null +++ b/compiler/tests-js-parser/early/33c0166e3328813a.js @@ -0,0 +1 @@ +class a {set constructor(b){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/33e8f35b568836ba.module.js b/compiler/tests-js-parser/early/33e8f35b568836ba.module.js new file mode 100644 index 000000000..1e6cd1638 --- /dev/null +++ b/compiler/tests-js-parser/early/33e8f35b568836ba.module.js @@ -0,0 +1 @@ +var a; export function a(){}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/349c826f55163c71.js b/compiler/tests-js-parser/early/349c826f55163c71.js new file mode 100644 index 000000000..b0636e733 --- /dev/null +++ b/compiler/tests-js-parser/early/349c826f55163c71.js @@ -0,0 +1 @@ +if(1) c: b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/34aa7f65abf79bc9.js b/compiler/tests-js-parser/early/34aa7f65abf79bc9.js new file mode 100644 index 000000000..5201ce67b --- /dev/null +++ b/compiler/tests-js-parser/early/34aa7f65abf79bc9.js @@ -0,0 +1 @@ +(class static {}) diff --git a/compiler/tests-js-parser/early/34bf35c6588c6592.js b/compiler/tests-js-parser/early/34bf35c6588c6592.js new file mode 100644 index 000000000..2b635c4cb --- /dev/null +++ b/compiler/tests-js-parser/early/34bf35c6588c6592.js @@ -0,0 +1 @@ +while(1) !function(){ continue; }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/34d1b5497fe48bf8.js b/compiler/tests-js-parser/early/34d1b5497fe48bf8.js new file mode 100644 index 000000000..d2e4450dc --- /dev/null +++ b/compiler/tests-js-parser/early/34d1b5497fe48bf8.js @@ -0,0 +1 @@ +{ var a; let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/34ea24723a0bdcad.js b/compiler/tests-js-parser/early/34ea24723a0bdcad.js new file mode 100644 index 000000000..19556001a --- /dev/null +++ b/compiler/tests-js-parser/early/34ea24723a0bdcad.js @@ -0,0 +1 @@ +function* a(b = super()){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/356c693116e8584c.js b/compiler/tests-js-parser/early/356c693116e8584c.js new file mode 100644 index 000000000..d885d38b7 --- /dev/null +++ b/compiler/tests-js-parser/early/356c693116e8584c.js @@ -0,0 +1 @@ +super() \ No newline at end of file diff --git a/compiler/tests-js-parser/early/35a47c9aef604b8a.js b/compiler/tests-js-parser/early/35a47c9aef604b8a.js new file mode 100644 index 000000000..bf8622024 --- /dev/null +++ b/compiler/tests-js-parser/early/35a47c9aef604b8a.js @@ -0,0 +1 @@ +([a, a]) => 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/35d9a2bf90e49ecd.module.js b/compiler/tests-js-parser/early/35d9a2bf90e49ecd.module.js new file mode 100644 index 000000000..ce8f9a6a2 --- /dev/null +++ b/compiler/tests-js-parser/early/35d9a2bf90e49ecd.module.js @@ -0,0 +1 @@ +let a; export default function a(){}; diff --git a/compiler/tests-js-parser/early/3644a964c2a8522c.js b/compiler/tests-js-parser/early/3644a964c2a8522c.js new file mode 100644 index 000000000..3f9966ff9 --- /dev/null +++ b/compiler/tests-js-parser/early/3644a964c2a8522c.js @@ -0,0 +1 @@ +({ get __proto(){}, "__proto__": null, __proto__: null, }) diff --git a/compiler/tests-js-parser/early/36d9cc06fef55d8c.js b/compiler/tests-js-parser/early/36d9cc06fef55d8c.js new file mode 100644 index 000000000..ecbf1aa10 --- /dev/null +++ b/compiler/tests-js-parser/early/36d9cc06fef55d8c.js @@ -0,0 +1 @@ +(function({a: b}, {c: b}){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/36f87088d38e409b.js b/compiler/tests-js-parser/early/36f87088d38e409b.js new file mode 100644 index 000000000..a07e80d88 --- /dev/null +++ b/compiler/tests-js-parser/early/36f87088d38e409b.js @@ -0,0 +1 @@ +'use strict'; +private; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/37225dd994e42a78.js b/compiler/tests-js-parser/early/37225dd994e42a78.js new file mode 100644 index 000000000..a585589c8 --- /dev/null +++ b/compiler/tests-js-parser/early/37225dd994e42a78.js @@ -0,0 +1 @@ +!function* (a = super.b){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/372597f0f5a0900b.js b/compiler/tests-js-parser/early/372597f0f5a0900b.js new file mode 100644 index 000000000..bad4ca636 --- /dev/null +++ b/compiler/tests-js-parser/early/372597f0f5a0900b.js @@ -0,0 +1 @@ +for(let let;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/378f184f8744ff14.js b/compiler/tests-js-parser/early/378f184f8744ff14.js new file mode 100644 index 000000000..c17d369b5 --- /dev/null +++ b/compiler/tests-js-parser/early/378f184f8744ff14.js @@ -0,0 +1 @@ +function a(){ var b; let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/37cb3282e0c7d516.js b/compiler/tests-js-parser/early/37cb3282e0c7d516.js new file mode 100644 index 000000000..8e00c260d --- /dev/null +++ b/compiler/tests-js-parser/early/37cb3282e0c7d516.js @@ -0,0 +1 @@ +a\u0000 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/38936e125588bd1a.js b/compiler/tests-js-parser/early/38936e125588bd1a.js new file mode 100644 index 000000000..ce38ab7cd --- /dev/null +++ b/compiler/tests-js-parser/early/38936e125588bd1a.js @@ -0,0 +1 @@ +function a(){ break b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3a29281d7d6fba5a.module.js b/compiler/tests-js-parser/early/3a29281d7d6fba5a.module.js new file mode 100644 index 000000000..499493f64 --- /dev/null +++ b/compiler/tests-js-parser/early/3a29281d7d6fba5a.module.js @@ -0,0 +1 @@ +export default 1; export default function a(){}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3a6a32ff6ad7240d.js b/compiler/tests-js-parser/early/3a6a32ff6ad7240d.js new file mode 100644 index 000000000..ae4d90f1e --- /dev/null +++ b/compiler/tests-js-parser/early/3a6a32ff6ad7240d.js @@ -0,0 +1 @@ +'use strict'; function a(b, b){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3a9e8d5d266ca8cc.js b/compiler/tests-js-parser/early/3a9e8d5d266ca8cc.js new file mode 100644 index 000000000..cabf415d2 --- /dev/null +++ b/compiler/tests-js-parser/early/3a9e8d5d266ca8cc.js @@ -0,0 +1 @@ +'use strict'; !function (eval){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3abbddaa6f253dec.js b/compiler/tests-js-parser/early/3abbddaa6f253dec.js new file mode 100644 index 000000000..a25b16f8a --- /dev/null +++ b/compiler/tests-js-parser/early/3abbddaa6f253dec.js @@ -0,0 +1 @@ +try {} catch ({a, a}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3bc32f5a77e8468e.js b/compiler/tests-js-parser/early/3bc32f5a77e8468e.js new file mode 100644 index 000000000..87a61333a --- /dev/null +++ b/compiler/tests-js-parser/early/3bc32f5a77e8468e.js @@ -0,0 +1 @@ +[...0] = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3c93c40648ef8eae.js b/compiler/tests-js-parser/early/3c93c40648ef8eae.js new file mode 100644 index 000000000..e57925c6b --- /dev/null +++ b/compiler/tests-js-parser/early/3c93c40648ef8eae.js @@ -0,0 +1 @@ +function* a(){ (b = yield) => 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3c97613274574690.module.js b/compiler/tests-js-parser/early/3c97613274574690.module.js new file mode 100644 index 000000000..22082744b --- /dev/null +++ b/compiler/tests-js-parser/early/3c97613274574690.module.js @@ -0,0 +1 @@ +export {a, b}; diff --git a/compiler/tests-js-parser/early/3ca9089477fd16c1.js b/compiler/tests-js-parser/early/3ca9089477fd16c1.js new file mode 100644 index 000000000..93f243c21 --- /dev/null +++ b/compiler/tests-js-parser/early/3ca9089477fd16c1.js @@ -0,0 +1 @@ +while(1) { function a(){ continue; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3d3525bcdb365af8.js b/compiler/tests-js-parser/early/3d3525bcdb365af8.js new file mode 100644 index 000000000..73979f88c --- /dev/null +++ b/compiler/tests-js-parser/early/3d3525bcdb365af8.js @@ -0,0 +1 @@ +'use strict'; delete a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3d5969e02c02bd8f.js b/compiler/tests-js-parser/early/3d5969e02c02bd8f.js new file mode 100644 index 000000000..829b592cd --- /dev/null +++ b/compiler/tests-js-parser/early/3d5969e02c02bd8f.js @@ -0,0 +1 @@ +(([]) => {'use strict';}) diff --git a/compiler/tests-js-parser/early/3db5225c6a017594.js b/compiler/tests-js-parser/early/3db5225c6a017594.js new file mode 100644 index 000000000..a19c772c4 --- /dev/null +++ b/compiler/tests-js-parser/early/3db5225c6a017594.js @@ -0,0 +1 @@ +!function (eval){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3dc2deaafc74c4ad.js b/compiler/tests-js-parser/early/3dc2deaafc74c4ad.js new file mode 100644 index 000000000..c455bfc37 --- /dev/null +++ b/compiler/tests-js-parser/early/3dc2deaafc74c4ad.js @@ -0,0 +1 @@ +switch(1) { default: var a; case 2: const a = 3; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3dd7d3e784a292d6.js b/compiler/tests-js-parser/early/3dd7d3e784a292d6.js new file mode 100644 index 000000000..a68c089b4 --- /dev/null +++ b/compiler/tests-js-parser/early/3dd7d3e784a292d6.js @@ -0,0 +1 @@ +for(let {a, a} in 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3e4d9cd4f8cc13a1.js b/compiler/tests-js-parser/early/3e4d9cd4f8cc13a1.js new file mode 100644 index 000000000..93c00006e --- /dev/null +++ b/compiler/tests-js-parser/early/3e4d9cd4f8cc13a1.js @@ -0,0 +1 @@ +function* a() { (b = yield 1) => {} } diff --git a/compiler/tests-js-parser/early/3f5eefa02597ded3.js b/compiler/tests-js-parser/early/3f5eefa02597ded3.js new file mode 100644 index 000000000..3000942f5 --- /dev/null +++ b/compiler/tests-js-parser/early/3f5eefa02597ded3.js @@ -0,0 +1 @@ +'use strict'; arguments=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3faafed41c77b36c.js b/compiler/tests-js-parser/early/3faafed41c77b36c.js new file mode 100644 index 000000000..ab54a05c0 --- /dev/null +++ b/compiler/tests-js-parser/early/3faafed41c77b36c.js @@ -0,0 +1 @@ +function a() { "use strict"; var interface; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/3fccb1ddcd0b1a21.js b/compiler/tests-js-parser/early/3fccb1ddcd0b1a21.js new file mode 100644 index 000000000..5087dd125 --- /dev/null +++ b/compiler/tests-js-parser/early/3fccb1ddcd0b1a21.js @@ -0,0 +1 @@ +eval => {"use strict"}; diff --git a/compiler/tests-js-parser/early/3fd976020ee226ac.js b/compiler/tests-js-parser/early/3fd976020ee226ac.js new file mode 100644 index 000000000..0c22b83b9 --- /dev/null +++ b/compiler/tests-js-parser/early/3fd976020ee226ac.js @@ -0,0 +1 @@ +'use strict'; [,,,eval,] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4168cc3e92200ccf.js b/compiler/tests-js-parser/early/4168cc3e92200ccf.js new file mode 100644 index 000000000..13aac0bcd --- /dev/null +++ b/compiler/tests-js-parser/early/4168cc3e92200ccf.js @@ -0,0 +1 @@ +a: while (true) { (function () { continue; }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/41a7ff8ab6df21d6.js b/compiler/tests-js-parser/early/41a7ff8ab6df21d6.js new file mode 100644 index 000000000..00266aa85 --- /dev/null +++ b/compiler/tests-js-parser/early/41a7ff8ab6df21d6.js @@ -0,0 +1 @@ +"use strict"; function a({ b: { c } }, [{ b: { c } }]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4286a88aed2001ee.js b/compiler/tests-js-parser/early/4286a88aed2001ee.js new file mode 100644 index 000000000..57fd98f3e --- /dev/null +++ b/compiler/tests-js-parser/early/4286a88aed2001ee.js @@ -0,0 +1 @@ +class eval {} diff --git a/compiler/tests-js-parser/early/42af036c74044345.js b/compiler/tests-js-parser/early/42af036c74044345.js new file mode 100644 index 000000000..8cb76cf02 --- /dev/null +++ b/compiler/tests-js-parser/early/42af036c74044345.js @@ -0,0 +1 @@ +break; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/42eb99e6140aa317.js b/compiler/tests-js-parser/early/42eb99e6140aa317.js new file mode 100644 index 000000000..86c0dae75 --- /dev/null +++ b/compiler/tests-js-parser/early/42eb99e6140aa317.js @@ -0,0 +1 @@ +function* a(){ !function*([b = yield]){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/44053a65c9b77afe.js b/compiler/tests-js-parser/early/44053a65c9b77afe.js new file mode 100644 index 000000000..fb8c31b5a --- /dev/null +++ b/compiler/tests-js-parser/early/44053a65c9b77afe.js @@ -0,0 +1 @@ +function a() {'use strict'; ({ b: function b(eval) { } }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4435f19f2a2a24bd.js b/compiler/tests-js-parser/early/4435f19f2a2a24bd.js new file mode 100644 index 000000000..40c1ba2ab --- /dev/null +++ b/compiler/tests-js-parser/early/4435f19f2a2a24bd.js @@ -0,0 +1 @@ +!{ set a(let) { 'use strict'; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4497d48f4bdf5f47.module.js b/compiler/tests-js-parser/early/4497d48f4bdf5f47.module.js new file mode 100644 index 000000000..ae4e237d2 --- /dev/null +++ b/compiler/tests-js-parser/early/4497d48f4bdf5f47.module.js @@ -0,0 +1 @@ +var eval; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/466784af3ca30ec9.js b/compiler/tests-js-parser/early/466784af3ca30ec9.js new file mode 100644 index 000000000..5b3bd77fa --- /dev/null +++ b/compiler/tests-js-parser/early/466784af3ca30ec9.js @@ -0,0 +1 @@ +class a { b(eval){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/46dc9914db87e003.js b/compiler/tests-js-parser/early/46dc9914db87e003.js new file mode 100644 index 000000000..9b5b91a12 --- /dev/null +++ b/compiler/tests-js-parser/early/46dc9914db87e003.js @@ -0,0 +1 @@ +!{ set a(b){ let c; let c; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/46ec18e7c559b836.js b/compiler/tests-js-parser/early/46ec18e7c559b836.js new file mode 100644 index 000000000..d2b2c961d --- /dev/null +++ b/compiler/tests-js-parser/early/46ec18e7c559b836.js @@ -0,0 +1 @@ +function a(b = super.c){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/47ae14af022534a0.js b/compiler/tests-js-parser/early/47ae14af022534a0.js new file mode 100644 index 000000000..7b989a11e --- /dev/null +++ b/compiler/tests-js-parser/early/47ae14af022534a0.js @@ -0,0 +1 @@ +function a(yield){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/481cb733780fe9d3.js b/compiler/tests-js-parser/early/481cb733780fe9d3.js new file mode 100644 index 000000000..5f4753cae --- /dev/null +++ b/compiler/tests-js-parser/early/481cb733780fe9d3.js @@ -0,0 +1 @@ +a: while (true) { (function () { continue a; }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4834b6602497925c.js b/compiler/tests-js-parser/early/4834b6602497925c.js new file mode 100644 index 000000000..b26d04de7 --- /dev/null +++ b/compiler/tests-js-parser/early/4834b6602497925c.js @@ -0,0 +1 @@ +with(1) b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/495a73872c7c7591.js b/compiler/tests-js-parser/early/495a73872c7c7591.js new file mode 100644 index 000000000..ac6e985b4 --- /dev/null +++ b/compiler/tests-js-parser/early/495a73872c7c7591.js @@ -0,0 +1 @@ +class a {static "prototype"(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/49f1ef30691c3300.js b/compiler/tests-js-parser/early/49f1ef30691c3300.js new file mode 100644 index 000000000..e79fcdcc5 --- /dev/null +++ b/compiler/tests-js-parser/early/49f1ef30691c3300.js @@ -0,0 +1 @@ +function a() { "use strict"; (function b(c, c) { }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4a40d88c67646328.js b/compiler/tests-js-parser/early/4a40d88c67646328.js new file mode 100644 index 000000000..5fff3baf0 --- /dev/null +++ b/compiler/tests-js-parser/early/4a40d88c67646328.js @@ -0,0 +1 @@ +!{ a() { function b(){ super.c(); } } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4a8f16e67942fe7a.js b/compiler/tests-js-parser/early/4a8f16e67942fe7a.js new file mode 100644 index 000000000..f9b5ab274 --- /dev/null +++ b/compiler/tests-js-parser/early/4a8f16e67942fe7a.js @@ -0,0 +1 @@ +switch(1) { case 2: var a; default: let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4ae8ff355e763fa3.js b/compiler/tests-js-parser/early/4ae8ff355e763fa3.js new file mode 100644 index 000000000..bab68bea4 --- /dev/null +++ b/compiler/tests-js-parser/early/4ae8ff355e763fa3.js @@ -0,0 +1 @@ +'use strict'; function* a(eval){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4bcf4503e86630a7.js b/compiler/tests-js-parser/early/4bcf4503e86630a7.js new file mode 100644 index 000000000..dd12393c7 --- /dev/null +++ b/compiler/tests-js-parser/early/4bcf4503e86630a7.js @@ -0,0 +1 @@ +let a; var a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4cd2b0542f755d0f.js b/compiler/tests-js-parser/early/4cd2b0542f755d0f.js new file mode 100644 index 000000000..cbb9b06f6 --- /dev/null +++ b/compiler/tests-js-parser/early/4cd2b0542f755d0f.js @@ -0,0 +1 @@ +switch(1) { default: function a(){} case 2: let a } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4d46572591cbd5f7.js b/compiler/tests-js-parser/early/4d46572591cbd5f7.js new file mode 100644 index 000000000..03feae19c --- /dev/null +++ b/compiler/tests-js-parser/early/4d46572591cbd5f7.js @@ -0,0 +1 @@ +let let; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4d4a054fcd18118e.js b/compiler/tests-js-parser/early/4d4a054fcd18118e.js new file mode 100644 index 000000000..321422aec --- /dev/null +++ b/compiler/tests-js-parser/early/4d4a054fcd18118e.js @@ -0,0 +1 @@ +!{ *a(){ let b; var b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4de83a7417cd30dd.js b/compiler/tests-js-parser/early/4de83a7417cd30dd.js new file mode 100644 index 000000000..c62a6e41d --- /dev/null +++ b/compiler/tests-js-parser/early/4de83a7417cd30dd.js @@ -0,0 +1 @@ +/\u{110000}/u \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4e10bb3d581b9a8e.js b/compiler/tests-js-parser/early/4e10bb3d581b9a8e.js new file mode 100644 index 000000000..47d175877 --- /dev/null +++ b/compiler/tests-js-parser/early/4e10bb3d581b9a8e.js @@ -0,0 +1 @@ +switch(1) { case 2: let a; case 3: var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4e12bb4b1d278bab.module.js b/compiler/tests-js-parser/early/4e12bb4b1d278bab.module.js new file mode 100644 index 000000000..0515b8f06 --- /dev/null +++ b/compiler/tests-js-parser/early/4e12bb4b1d278bab.module.js @@ -0,0 +1 @@ +let a; export class a {}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4e6529771ad3343f.module.js b/compiler/tests-js-parser/early/4e6529771ad3343f.module.js new file mode 100644 index 000000000..cff06e6d7 --- /dev/null +++ b/compiler/tests-js-parser/early/4e6529771ad3343f.module.js @@ -0,0 +1 @@ +let a; export {b as a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/4f53a2581687c9f5.js b/compiler/tests-js-parser/early/4f53a2581687c9f5.js new file mode 100644 index 000000000..719b350f6 --- /dev/null +++ b/compiler/tests-js-parser/early/4f53a2581687c9f5.js @@ -0,0 +1 @@ +function a() { "use strict"; private = 1; } diff --git a/compiler/tests-js-parser/early/4fbbd35086e394e2.js b/compiler/tests-js-parser/early/4fbbd35086e394e2.js new file mode 100644 index 000000000..00dcbfd8d --- /dev/null +++ b/compiler/tests-js-parser/early/4fbbd35086e394e2.js @@ -0,0 +1 @@ +!{ a() { !function* (){ super.b(); } } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/50208b425cec1733.js b/compiler/tests-js-parser/early/50208b425cec1733.js new file mode 100644 index 000000000..b668a64be --- /dev/null +++ b/compiler/tests-js-parser/early/50208b425cec1733.js @@ -0,0 +1 @@ +"use strict"; (eval, a) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/50859dd9522a4259.js b/compiler/tests-js-parser/early/50859dd9522a4259.js new file mode 100644 index 000000000..7520dd805 --- /dev/null +++ b/compiler/tests-js-parser/early/50859dd9522a4259.js @@ -0,0 +1 @@ +!{ *a(){ let b; let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/50e4cd4d8fb1cdaa.js b/compiler/tests-js-parser/early/50e4cd4d8fb1cdaa.js new file mode 100644 index 000000000..bad4fec87 --- /dev/null +++ b/compiler/tests-js-parser/early/50e4cd4d8fb1cdaa.js @@ -0,0 +1 @@ +let \u{61}, \u{0061}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5127ca1fe7c943ba.module.js b/compiler/tests-js-parser/early/5127ca1fe7c943ba.module.js new file mode 100644 index 000000000..8c1bfd253 --- /dev/null +++ b/compiler/tests-js-parser/early/5127ca1fe7c943ba.module.js @@ -0,0 +1 @@ +export {a, b,}; diff --git a/compiler/tests-js-parser/early/5146c3637a58d570.js b/compiler/tests-js-parser/early/5146c3637a58d570.js new file mode 100644 index 000000000..d0779a02f --- /dev/null +++ b/compiler/tests-js-parser/early/5146c3637a58d570.js @@ -0,0 +1 @@ +let a; let a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/51e5a52e36642bf2.module.js b/compiler/tests-js-parser/early/51e5a52e36642bf2.module.js new file mode 100644 index 000000000..1ad04d6f8 --- /dev/null +++ b/compiler/tests-js-parser/early/51e5a52e36642bf2.module.js @@ -0,0 +1 @@ +eval=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/51fe41481b052604.js b/compiler/tests-js-parser/early/51fe41481b052604.js new file mode 100644 index 000000000..def76bfe8 --- /dev/null +++ b/compiler/tests-js-parser/early/51fe41481b052604.js @@ -0,0 +1 @@ +try {} catch(a) { let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/52049772f70b70ef.js b/compiler/tests-js-parser/early/52049772f70b70ef.js new file mode 100644 index 000000000..9ddefed23 --- /dev/null +++ b/compiler/tests-js-parser/early/52049772f70b70ef.js @@ -0,0 +1 @@ +(a,...a)=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/523ecdd626164b81.module.js b/compiler/tests-js-parser/early/523ecdd626164b81.module.js new file mode 100644 index 000000000..588748290 --- /dev/null +++ b/compiler/tests-js-parser/early/523ecdd626164b81.module.js @@ -0,0 +1 @@ +const a = 1; export const a = 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/524c5114bbf59c98.js b/compiler/tests-js-parser/early/524c5114bbf59c98.js new file mode 100644 index 000000000..3633bf356 --- /dev/null +++ b/compiler/tests-js-parser/early/524c5114bbf59c98.js @@ -0,0 +1 @@ +'use strict'; ({a: eval = 1} = 2) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/525cb9dd392f8a55.js b/compiler/tests-js-parser/early/525cb9dd392f8a55.js new file mode 100644 index 000000000..f4cffadc9 --- /dev/null +++ b/compiler/tests-js-parser/early/525cb9dd392f8a55.js @@ -0,0 +1 @@ +class a { static b(){ let c; let c; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/527ec3f074837a63.js b/compiler/tests-js-parser/early/527ec3f074837a63.js new file mode 100644 index 000000000..f451f6f14 --- /dev/null +++ b/compiler/tests-js-parser/early/527ec3f074837a63.js @@ -0,0 +1 @@ +class a { constructor() { super(); } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/52946a5d180ba7ee.js b/compiler/tests-js-parser/early/52946a5d180ba7ee.js new file mode 100644 index 000000000..0ffbd60af --- /dev/null +++ b/compiler/tests-js-parser/early/52946a5d180ba7ee.js @@ -0,0 +1 @@ +'use strict'; arguments = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/53699b3b15d7ce42.module.js b/compiler/tests-js-parser/early/53699b3b15d7ce42.module.js new file mode 100644 index 000000000..e5626c03c --- /dev/null +++ b/compiler/tests-js-parser/early/53699b3b15d7ce42.module.js @@ -0,0 +1 @@ +export {a}; export class a{}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/53a86ad112cc6c26.js b/compiler/tests-js-parser/early/53a86ad112cc6c26.js new file mode 100644 index 000000000..1481643e7 --- /dev/null +++ b/compiler/tests-js-parser/early/53a86ad112cc6c26.js @@ -0,0 +1 @@ +class a { *constructor() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/53b4e9d03648e9ee.js b/compiler/tests-js-parser/early/53b4e9d03648e9ee.js new file mode 100644 index 000000000..5365075ed --- /dev/null +++ b/compiler/tests-js-parser/early/53b4e9d03648e9ee.js @@ -0,0 +1 @@ +{ continue; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/540fe548c19b2197.js b/compiler/tests-js-parser/early/540fe548c19b2197.js new file mode 100644 index 000000000..d7ffe8186 --- /dev/null +++ b/compiler/tests-js-parser/early/540fe548c19b2197.js @@ -0,0 +1 @@ +(function a(package) { "use strict"; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5490739ebf844cf8.js b/compiler/tests-js-parser/early/5490739ebf844cf8.js new file mode 100644 index 000000000..fe6f17317 --- /dev/null +++ b/compiler/tests-js-parser/early/5490739ebf844cf8.js @@ -0,0 +1 @@ +while (true) { break a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5529555236f65506.js b/compiler/tests-js-parser/early/5529555236f65506.js new file mode 100644 index 000000000..35c210ec6 --- /dev/null +++ b/compiler/tests-js-parser/early/5529555236f65506.js @@ -0,0 +1 @@ +!{ a(eval){ 'use strict'; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5608727078b3c9f5.js b/compiler/tests-js-parser/early/5608727078b3c9f5.js new file mode 100644 index 000000000..70b5c5026 --- /dev/null +++ b/compiler/tests-js-parser/early/5608727078b3c9f5.js @@ -0,0 +1 @@ +class a extends (eval = null) { }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/567932002dcee8f5.js b/compiler/tests-js-parser/early/567932002dcee8f5.js new file mode 100644 index 000000000..828d07e80 --- /dev/null +++ b/compiler/tests-js-parser/early/567932002dcee8f5.js @@ -0,0 +1 @@ +switch(1) { case 2: let a; case 3: function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/56935fcc12e499e9.js b/compiler/tests-js-parser/early/56935fcc12e499e9.js new file mode 100644 index 000000000..f17ce15e1 --- /dev/null +++ b/compiler/tests-js-parser/early/56935fcc12e499e9.js @@ -0,0 +1 @@ +!{ a() { function* b(a = super.c()){} } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/56f208fa3a556108.module.js b/compiler/tests-js-parser/early/56f208fa3a556108.module.js new file mode 100644 index 000000000..20b6f0fb4 --- /dev/null +++ b/compiler/tests-js-parser/early/56f208fa3a556108.module.js @@ -0,0 +1 @@ +export default function(a){ super() } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/57326657ecdecd7f.js b/compiler/tests-js-parser/early/57326657ecdecd7f.js new file mode 100644 index 000000000..58f12692c --- /dev/null +++ b/compiler/tests-js-parser/early/57326657ecdecd7f.js @@ -0,0 +1 @@ +(function([a, a]){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/574ea84fc61bdc31.js b/compiler/tests-js-parser/early/574ea84fc61bdc31.js new file mode 100644 index 000000000..3dca41303 --- /dev/null +++ b/compiler/tests-js-parser/early/574ea84fc61bdc31.js @@ -0,0 +1 @@ +function arguments() {'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/57ddf6956d63bc7e.js b/compiler/tests-js-parser/early/57ddf6956d63bc7e.js new file mode 100644 index 000000000..2d490c727 --- /dev/null +++ b/compiler/tests-js-parser/early/57ddf6956d63bc7e.js @@ -0,0 +1 @@ +function a(static) { "use strict"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/57f4e4685e795dd4.js b/compiler/tests-js-parser/early/57f4e4685e795dd4.js new file mode 100644 index 000000000..bf7dd8062 --- /dev/null +++ b/compiler/tests-js-parser/early/57f4e4685e795dd4.js @@ -0,0 +1 @@ +function a() {'use strict'; arguments--; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/585649d8f4afe9e9.js b/compiler/tests-js-parser/early/585649d8f4afe9e9.js new file mode 100644 index 000000000..06c9f3e3a --- /dev/null +++ b/compiler/tests-js-parser/early/585649d8f4afe9e9.js @@ -0,0 +1 @@ +({ a(){ super(); } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/587f8eba459c585c.js b/compiler/tests-js-parser/early/587f8eba459c585c.js new file mode 100644 index 000000000..e399af6d6 --- /dev/null +++ b/compiler/tests-js-parser/early/587f8eba459c585c.js @@ -0,0 +1 @@ +({ __proto__: null, "__proto__": null }) diff --git a/compiler/tests-js-parser/early/58bb4a3a2d717d4f.js b/compiler/tests-js-parser/early/58bb4a3a2d717d4f.js new file mode 100644 index 000000000..4007b76a7 --- /dev/null +++ b/compiler/tests-js-parser/early/58bb4a3a2d717d4f.js @@ -0,0 +1 @@ +!{ a({b}){ let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5995f93582b8bd22.js b/compiler/tests-js-parser/early/5995f93582b8bd22.js new file mode 100644 index 000000000..05eeb748d --- /dev/null +++ b/compiler/tests-js-parser/early/5995f93582b8bd22.js @@ -0,0 +1 @@ +for(([0]) of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5997ad0fdb4c32d7.js b/compiler/tests-js-parser/early/5997ad0fdb4c32d7.js new file mode 100644 index 000000000..56a5077e9 --- /dev/null +++ b/compiler/tests-js-parser/early/5997ad0fdb4c32d7.js @@ -0,0 +1 @@ +function* a(){ function* b(c = yield d){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/59c2dac860a0ceb7.js b/compiler/tests-js-parser/early/59c2dac860a0ceb7.js new file mode 100644 index 000000000..70c308114 --- /dev/null +++ b/compiler/tests-js-parser/early/59c2dac860a0ceb7.js @@ -0,0 +1 @@ +'use strict'; delete ((a)); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/59eb4e0a7c215b4c.js b/compiler/tests-js-parser/early/59eb4e0a7c215b4c.js new file mode 100644 index 000000000..e1cd495ba --- /dev/null +++ b/compiler/tests-js-parser/early/59eb4e0a7c215b4c.js @@ -0,0 +1 @@ +0++ \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5a27931b548eec9b.js b/compiler/tests-js-parser/early/5a27931b548eec9b.js new file mode 100644 index 000000000..9ff12bb90 --- /dev/null +++ b/compiler/tests-js-parser/early/5a27931b548eec9b.js @@ -0,0 +1 @@ +function a(){ const b = 1; const b = 2; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5a2a5611d2f27ed8.js b/compiler/tests-js-parser/early/5a2a5611d2f27ed8.js new file mode 100644 index 000000000..3e6f7e9ec --- /dev/null +++ b/compiler/tests-js-parser/early/5a2a5611d2f27ed8.js @@ -0,0 +1 @@ +'use strict'; !function eval(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5a31e193bfb5215a.js b/compiler/tests-js-parser/early/5a31e193bfb5215a.js new file mode 100644 index 000000000..1a164f9d9 --- /dev/null +++ b/compiler/tests-js-parser/early/5a31e193bfb5215a.js @@ -0,0 +1 @@ +if(1) b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5b0f82ab482ac359.module.js b/compiler/tests-js-parser/early/5b0f82ab482ac359.module.js new file mode 100644 index 000000000..d2dc6010f --- /dev/null +++ b/compiler/tests-js-parser/early/5b0f82ab482ac359.module.js @@ -0,0 +1 @@ +export {a as b}; var b; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5b255dda6662d8ad.js b/compiler/tests-js-parser/early/5b255dda6662d8ad.js new file mode 100644 index 000000000..032ac4af5 --- /dev/null +++ b/compiler/tests-js-parser/early/5b255dda6662d8ad.js @@ -0,0 +1 @@ +let a, let; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5b824fcc88aa97d3.js b/compiler/tests-js-parser/early/5b824fcc88aa97d3.js new file mode 100644 index 000000000..7605ca938 --- /dev/null +++ b/compiler/tests-js-parser/early/5b824fcc88aa97d3.js @@ -0,0 +1 @@ +class a {get constructor(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5c68a4815a62ec45.js b/compiler/tests-js-parser/early/5c68a4815a62ec45.js new file mode 100644 index 000000000..f826ce915 --- /dev/null +++ b/compiler/tests-js-parser/early/5c68a4815a62ec45.js @@ -0,0 +1 @@ +for(const a = 1, b;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5cf3708e63aa9095.js b/compiler/tests-js-parser/early/5cf3708e63aa9095.js new file mode 100644 index 000000000..34b78c946 --- /dev/null +++ b/compiler/tests-js-parser/early/5cf3708e63aa9095.js @@ -0,0 +1 @@ +for(const [a, a] = 1;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5d5fcacbdbc2fe97.js b/compiler/tests-js-parser/early/5d5fcacbdbc2fe97.js new file mode 100644 index 000000000..6a67393c8 --- /dev/null +++ b/compiler/tests-js-parser/early/5d5fcacbdbc2fe97.js @@ -0,0 +1 @@ +'use strict'; if (1) function a(){} else; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5d70672ca7ccc3ec.js b/compiler/tests-js-parser/early/5d70672ca7ccc3ec.js new file mode 100644 index 000000000..6290b8f28 --- /dev/null +++ b/compiler/tests-js-parser/early/5d70672ca7ccc3ec.js @@ -0,0 +1 @@ +class a extends b { constructor() { !{get constructor() { super(); }}; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5e4a34251d0fc48d.js b/compiler/tests-js-parser/early/5e4a34251d0fc48d.js new file mode 100644 index 000000000..dc3ab4821 --- /dev/null +++ b/compiler/tests-js-parser/early/5e4a34251d0fc48d.js @@ -0,0 +1 @@ +for([0] of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5e601aa06b18557d.js b/compiler/tests-js-parser/early/5e601aa06b18557d.js new file mode 100644 index 000000000..e52d57da8 --- /dev/null +++ b/compiler/tests-js-parser/early/5e601aa06b18557d.js @@ -0,0 +1 @@ +!{ a({b, b}){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5f6c26cf3848f722.js b/compiler/tests-js-parser/early/5f6c26cf3848f722.js new file mode 100644 index 000000000..ba473aee9 --- /dev/null +++ b/compiler/tests-js-parser/early/5f6c26cf3848f722.js @@ -0,0 +1 @@ +function a({a:yield}){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/5fe53f7f6582b1c3.js b/compiler/tests-js-parser/early/5fe53f7f6582b1c3.js new file mode 100644 index 000000000..200c319bc --- /dev/null +++ b/compiler/tests-js-parser/early/5fe53f7f6582b1c3.js @@ -0,0 +1 @@ +class a extends b { static c() { super(); } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/604fbaf6313cef61.js b/compiler/tests-js-parser/early/604fbaf6313cef61.js new file mode 100644 index 000000000..3567fb84c --- /dev/null +++ b/compiler/tests-js-parser/early/604fbaf6313cef61.js @@ -0,0 +1 @@ +function a() { "use strict"; protected = 1; } diff --git a/compiler/tests-js-parser/early/6231fa8c107affff.js b/compiler/tests-js-parser/early/6231fa8c107affff.js new file mode 100644 index 000000000..6573de77e --- /dev/null +++ b/compiler/tests-js-parser/early/6231fa8c107affff.js @@ -0,0 +1 @@ +({a(yield){ 'use strict'; }}) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/627ae2300901a0b1.js b/compiler/tests-js-parser/early/627ae2300901a0b1.js new file mode 100644 index 000000000..9f9e48ea6 --- /dev/null +++ b/compiler/tests-js-parser/early/627ae2300901a0b1.js @@ -0,0 +1 @@ +({a}) => { let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/63452bbeb15314d6.js b/compiler/tests-js-parser/early/63452bbeb15314d6.js new file mode 100644 index 000000000..fa6b35f62 --- /dev/null +++ b/compiler/tests-js-parser/early/63452bbeb15314d6.js @@ -0,0 +1 @@ +[0] = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/63b4887495724d07.js b/compiler/tests-js-parser/early/63b4887495724d07.js new file mode 100644 index 000000000..28448cc31 --- /dev/null +++ b/compiler/tests-js-parser/early/63b4887495724d07.js @@ -0,0 +1 @@ +function a() { "use strict"; yield = 1; } diff --git a/compiler/tests-js-parser/early/63dfdc52eaf151e0.module.js b/compiler/tests-js-parser/early/63dfdc52eaf151e0.module.js new file mode 100644 index 000000000..2f0ad2398 --- /dev/null +++ b/compiler/tests-js-parser/early/63dfdc52eaf151e0.module.js @@ -0,0 +1 @@ +import a, * as a from "module"; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6404eba6ff959b8f.js b/compiler/tests-js-parser/early/6404eba6ff959b8f.js new file mode 100644 index 000000000..49f34686d --- /dev/null +++ b/compiler/tests-js-parser/early/6404eba6ff959b8f.js @@ -0,0 +1 @@ +switch(1) { case 2: const a = 3; case 4: var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/645e6678bee4ecc0.js b/compiler/tests-js-parser/early/645e6678bee4ecc0.js new file mode 100644 index 000000000..fc1765da7 --- /dev/null +++ b/compiler/tests-js-parser/early/645e6678bee4ecc0.js @@ -0,0 +1 @@ +switch(1) { default: let a; case 2: function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6473f07239ed08ef.js b/compiler/tests-js-parser/early/6473f07239ed08ef.js new file mode 100644 index 000000000..aa8b53317 --- /dev/null +++ b/compiler/tests-js-parser/early/6473f07239ed08ef.js @@ -0,0 +1 @@ +function a(b, b) { "use strict"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/64e293507c64020b.js b/compiler/tests-js-parser/early/64e293507c64020b.js new file mode 100644 index 000000000..7a7ab6b9e --- /dev/null +++ b/compiler/tests-js-parser/early/64e293507c64020b.js @@ -0,0 +1 @@ +class a { set constructor(b) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6504e183e3a28e19.module.js b/compiler/tests-js-parser/early/6504e183e3a28e19.module.js new file mode 100644 index 000000000..fc073d41d --- /dev/null +++ b/compiler/tests-js-parser/early/6504e183e3a28e19.module.js @@ -0,0 +1 @@ +export default function(a){ super.b } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/656ae090a367940a.module.js b/compiler/tests-js-parser/early/656ae090a367940a.module.js new file mode 100644 index 000000000..d6d618878 --- /dev/null +++ b/compiler/tests-js-parser/early/656ae090a367940a.module.js @@ -0,0 +1 @@ +let a; export {a, a as a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6592c9e18d21e698.js b/compiler/tests-js-parser/early/6592c9e18d21e698.js new file mode 100644 index 000000000..703446782 --- /dev/null +++ b/compiler/tests-js-parser/early/6592c9e18d21e698.js @@ -0,0 +1 @@ +class a {b(eval){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6653aea49db40d35.js b/compiler/tests-js-parser/early/6653aea49db40d35.js new file mode 100644 index 000000000..dd0b2a0ee --- /dev/null +++ b/compiler/tests-js-parser/early/6653aea49db40d35.js @@ -0,0 +1 @@ +switch(1) { case 2: var a; default: const a = 3; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/66c3d686d1737232.js b/compiler/tests-js-parser/early/66c3d686d1737232.js new file mode 100644 index 000000000..9fb338f64 --- /dev/null +++ b/compiler/tests-js-parser/early/66c3d686d1737232.js @@ -0,0 +1 @@ +'use strict'; !function* eval(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/670343391d88a743.js b/compiler/tests-js-parser/early/670343391d88a743.js new file mode 100644 index 000000000..01fb228c9 --- /dev/null +++ b/compiler/tests-js-parser/early/670343391d88a743.js @@ -0,0 +1 @@ +(...a) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6766ffa0bd0bcacc.module.js b/compiler/tests-js-parser/early/6766ffa0bd0bcacc.module.js new file mode 100644 index 000000000..c4aa351dc --- /dev/null +++ b/compiler/tests-js-parser/early/6766ffa0bd0bcacc.module.js @@ -0,0 +1 @@ +export default function(a, a){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/688a941ddfb2d920.js b/compiler/tests-js-parser/early/688a941ddfb2d920.js new file mode 100644 index 000000000..25430d048 --- /dev/null +++ b/compiler/tests-js-parser/early/688a941ddfb2d920.js @@ -0,0 +1 @@ +!function(a){ let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/690dc1df125a9be9.js b/compiler/tests-js-parser/early/690dc1df125a9be9.js new file mode 100644 index 000000000..081cdd9c1 --- /dev/null +++ b/compiler/tests-js-parser/early/690dc1df125a9be9.js @@ -0,0 +1 @@ +(a,...[a]) => 1; diff --git a/compiler/tests-js-parser/early/69a9f6b6e2fa6bf6.js b/compiler/tests-js-parser/early/69a9f6b6e2fa6bf6.js new file mode 100644 index 000000000..03bd6f195 --- /dev/null +++ b/compiler/tests-js-parser/early/69a9f6b6e2fa6bf6.js @@ -0,0 +1 @@ +try {} catch ({a: b, c: b}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/69c74d0785375c3c.js b/compiler/tests-js-parser/early/69c74d0785375c3c.js new file mode 100644 index 000000000..080c683f5 --- /dev/null +++ b/compiler/tests-js-parser/early/69c74d0785375c3c.js @@ -0,0 +1 @@ +function a() { "use strict"; var static; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/69e9a9e7b0344a30.module.js b/compiler/tests-js-parser/early/69e9a9e7b0344a30.module.js new file mode 100644 index 000000000..defbecd43 --- /dev/null +++ b/compiler/tests-js-parser/early/69e9a9e7b0344a30.module.js @@ -0,0 +1 @@ +import {a, b as a} from "module"; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6aca927dfa1df5f9.js b/compiler/tests-js-parser/early/6aca927dfa1df5f9.js new file mode 100644 index 000000000..b72def726 --- /dev/null +++ b/compiler/tests-js-parser/early/6aca927dfa1df5f9.js @@ -0,0 +1 @@ +function* a(){ ({ *b(c = yield){} }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6b278752ecdf8586.js b/compiler/tests-js-parser/early/6b278752ecdf8586.js new file mode 100644 index 000000000..21c3752cc --- /dev/null +++ b/compiler/tests-js-parser/early/6b278752ecdf8586.js @@ -0,0 +1 @@ +"use strict"; (a, a) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6b97ba6642568d1c.js b/compiler/tests-js-parser/early/6b97ba6642568d1c.js new file mode 100644 index 000000000..d86c8c27c --- /dev/null +++ b/compiler/tests-js-parser/early/6b97ba6642568d1c.js @@ -0,0 +1 @@ +class a extends b { constructor() { function c(d = super()){} } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6bb272e52a903c4c.js b/compiler/tests-js-parser/early/6bb272e52a903c4c.js new file mode 100644 index 000000000..4df5e9cfb --- /dev/null +++ b/compiler/tests-js-parser/early/6bb272e52a903c4c.js @@ -0,0 +1 @@ +function* a([b]){ let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6bfbb5581e7be7fa.js b/compiler/tests-js-parser/early/6bfbb5581e7be7fa.js new file mode 100644 index 000000000..37a7fbc0f --- /dev/null +++ b/compiler/tests-js-parser/early/6bfbb5581e7be7fa.js @@ -0,0 +1 @@ +'use strict'; !function arguments(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6c477b1ecaf24c7c.js b/compiler/tests-js-parser/early/6c477b1ecaf24c7c.js new file mode 100644 index 000000000..24e93a54d --- /dev/null +++ b/compiler/tests-js-parser/early/6c477b1ecaf24c7c.js @@ -0,0 +1 @@ +b: while(1) { function a(){ continue b; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6c4fe38464c16309.js b/compiler/tests-js-parser/early/6c4fe38464c16309.js new file mode 100644 index 000000000..485202cf6 --- /dev/null +++ b/compiler/tests-js-parser/early/6c4fe38464c16309.js @@ -0,0 +1 @@ +(function arguments() {'use strict'; })() \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6c71a06280f35c98.js b/compiler/tests-js-parser/early/6c71a06280f35c98.js new file mode 100644 index 000000000..115bf5a9b --- /dev/null +++ b/compiler/tests-js-parser/early/6c71a06280f35c98.js @@ -0,0 +1 @@ +'use strict'; ({a: arguments} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6cdbd39378a74bf7.js b/compiler/tests-js-parser/early/6cdbd39378a74bf7.js new file mode 100644 index 000000000..b428140a6 --- /dev/null +++ b/compiler/tests-js-parser/early/6cdbd39378a74bf7.js @@ -0,0 +1 @@ +'use strict'; !function([a, a]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6d96413c7ef0f717.js b/compiler/tests-js-parser/early/6d96413c7ef0f717.js new file mode 100644 index 000000000..63ed72065 --- /dev/null +++ b/compiler/tests-js-parser/early/6d96413c7ef0f717.js @@ -0,0 +1 @@ +for(let {a, a} of 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6d9e67514ed7d9cc.module.js b/compiler/tests-js-parser/early/6d9e67514ed7d9cc.module.js new file mode 100644 index 000000000..4a02fa9be --- /dev/null +++ b/compiler/tests-js-parser/early/6d9e67514ed7d9cc.module.js @@ -0,0 +1 @@ +import a, {a} from "module"; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6dd17972eccf6550.js b/compiler/tests-js-parser/early/6dd17972eccf6550.js new file mode 100644 index 000000000..bde233441 --- /dev/null +++ b/compiler/tests-js-parser/early/6dd17972eccf6550.js @@ -0,0 +1 @@ +function a() {'use strict'; try { } catch (arguments) { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6df27f99d312758c.js b/compiler/tests-js-parser/early/6df27f99d312758c.js new file mode 100644 index 000000000..66442065a --- /dev/null +++ b/compiler/tests-js-parser/early/6df27f99d312758c.js @@ -0,0 +1 @@ +"use strict"; (class a { static constructor() { super() }}) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6e95a8d810827157.js b/compiler/tests-js-parser/early/6e95a8d810827157.js new file mode 100644 index 000000000..3f43c9c30 --- /dev/null +++ b/compiler/tests-js-parser/early/6e95a8d810827157.js @@ -0,0 +1 @@ +function a(){ let b; const b = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6f1a2ff03d9733d4.js b/compiler/tests-js-parser/early/6f1a2ff03d9733d4.js new file mode 100644 index 000000000..bfd9c74bb --- /dev/null +++ b/compiler/tests-js-parser/early/6f1a2ff03d9733d4.js @@ -0,0 +1 @@ +!{ set a(b) { let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6f6d8eedf638f9a0.js b/compiler/tests-js-parser/early/6f6d8eedf638f9a0.js new file mode 100644 index 000000000..b4d4366ab --- /dev/null +++ b/compiler/tests-js-parser/early/6f6d8eedf638f9a0.js @@ -0,0 +1 @@ +'use strict'; function* a(b, b){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/6fa33c9f372768b5.js b/compiler/tests-js-parser/early/6fa33c9f372768b5.js new file mode 100644 index 000000000..8e82f10db --- /dev/null +++ b/compiler/tests-js-parser/early/6fa33c9f372768b5.js @@ -0,0 +1 @@ +({a, a}) => 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/70b6cc4ef8bc1f32.js b/compiler/tests-js-parser/early/70b6cc4ef8bc1f32.js new file mode 100644 index 000000000..bafe416f2 --- /dev/null +++ b/compiler/tests-js-parser/early/70b6cc4ef8bc1f32.js @@ -0,0 +1 @@ +function* a(b) { let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7134fe6667b4b228.js b/compiler/tests-js-parser/early/7134fe6667b4b228.js new file mode 100644 index 000000000..44c5d7d65 --- /dev/null +++ b/compiler/tests-js-parser/early/7134fe6667b4b228.js @@ -0,0 +1 @@ +continue diff --git a/compiler/tests-js-parser/early/7159f2eab607fc42.js b/compiler/tests-js-parser/early/7159f2eab607fc42.js new file mode 100644 index 000000000..c6d806cbb --- /dev/null +++ b/compiler/tests-js-parser/early/7159f2eab607fc42.js @@ -0,0 +1 @@ +function a(){ c: break b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7196b3db88cc83fe.js b/compiler/tests-js-parser/early/7196b3db88cc83fe.js new file mode 100644 index 000000000..867f9fb2c --- /dev/null +++ b/compiler/tests-js-parser/early/7196b3db88cc83fe.js @@ -0,0 +1 @@ +'use strict'; function a([b, b]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/724414dc804124c5.js b/compiler/tests-js-parser/early/724414dc804124c5.js new file mode 100644 index 000000000..96446dd1a --- /dev/null +++ b/compiler/tests-js-parser/early/724414dc804124c5.js @@ -0,0 +1 @@ +function a() {'use strict'; ({ b: 1, c(eval) { } }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/726aaf0164355893.js b/compiler/tests-js-parser/early/726aaf0164355893.js new file mode 100644 index 000000000..e968aa53f --- /dev/null +++ b/compiler/tests-js-parser/early/726aaf0164355893.js @@ -0,0 +1 @@ +'use strict'; b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7276d2d5d55eaa4e.js b/compiler/tests-js-parser/early/7276d2d5d55eaa4e.js new file mode 100644 index 000000000..857487fcb --- /dev/null +++ b/compiler/tests-js-parser/early/7276d2d5d55eaa4e.js @@ -0,0 +1 @@ +for(let a of b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/732d493316f50cbe.js b/compiler/tests-js-parser/early/732d493316f50cbe.js new file mode 100644 index 000000000..349581c4c --- /dev/null +++ b/compiler/tests-js-parser/early/732d493316f50cbe.js @@ -0,0 +1 @@ +function a() {'use strict'; (function arguments() { }()) } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/739b78faef2001c6.js b/compiler/tests-js-parser/early/739b78faef2001c6.js new file mode 100644 index 000000000..1744ee150 --- /dev/null +++ b/compiler/tests-js-parser/early/739b78faef2001c6.js @@ -0,0 +1 @@ +function a(){ 'use strict'; function a(a=yield){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/74060eb332483ead.js b/compiler/tests-js-parser/early/74060eb332483ead.js new file mode 100644 index 000000000..b672f0939 --- /dev/null +++ b/compiler/tests-js-parser/early/74060eb332483ead.js @@ -0,0 +1 @@ +let a, b, c, let = 1; diff --git a/compiler/tests-js-parser/early/7436ae673e9996b3.module.js b/compiler/tests-js-parser/early/7436ae673e9996b3.module.js new file mode 100644 index 000000000..25ec4baf6 --- /dev/null +++ b/compiler/tests-js-parser/early/7436ae673e9996b3.module.js @@ -0,0 +1 @@ +export default function(a = super()){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/743a08befb787b99.js b/compiler/tests-js-parser/early/743a08befb787b99.js new file mode 100644 index 000000000..e3d73bcd7 --- /dev/null +++ b/compiler/tests-js-parser/early/743a08befb787b99.js @@ -0,0 +1 @@ +function* a(){ !function*({b = yield}){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7484ac91150c8352.js b/compiler/tests-js-parser/early/7484ac91150c8352.js new file mode 100644 index 000000000..41a71e22a --- /dev/null +++ b/compiler/tests-js-parser/early/7484ac91150c8352.js @@ -0,0 +1 @@ +class a extends b { c() { function d(){ super.e(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/74a013e981b9b7ec.js b/compiler/tests-js-parser/early/74a013e981b9b7ec.js new file mode 100644 index 000000000..d14d38dfd --- /dev/null +++ b/compiler/tests-js-parser/early/74a013e981b9b7ec.js @@ -0,0 +1 @@ +!class extends (eval = null) { }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/74d2573205ac47fd.js b/compiler/tests-js-parser/early/74d2573205ac47fd.js new file mode 100644 index 000000000..908c1862e --- /dev/null +++ b/compiler/tests-js-parser/early/74d2573205ac47fd.js @@ -0,0 +1 @@ +switch(1) { case 2: function a(){ break; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/74dfa450d326d412.js b/compiler/tests-js-parser/early/74dfa450d326d412.js new file mode 100644 index 000000000..107ec0ddf --- /dev/null +++ b/compiler/tests-js-parser/early/74dfa450d326d412.js @@ -0,0 +1 @@ +switch(1) { default: let a; case 2: let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/74e50f7c11ccff35.js b/compiler/tests-js-parser/early/74e50f7c11ccff35.js new file mode 100644 index 000000000..5407bc345 --- /dev/null +++ b/compiler/tests-js-parser/early/74e50f7c11ccff35.js @@ -0,0 +1 @@ +for(let a in 1) { var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/75943e9bc83b6d0e.js b/compiler/tests-js-parser/early/75943e9bc83b6d0e.js new file mode 100644 index 000000000..417d6fc84 --- /dev/null +++ b/compiler/tests-js-parser/early/75943e9bc83b6d0e.js @@ -0,0 +1 @@ +try {} catch ([a,a]) {} diff --git a/compiler/tests-js-parser/early/75d3e8751d65dec9.js b/compiler/tests-js-parser/early/75d3e8751d65dec9.js new file mode 100644 index 000000000..91cf2e253 --- /dev/null +++ b/compiler/tests-js-parser/early/75d3e8751d65dec9.js @@ -0,0 +1 @@ +for(const let = 1;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/761785f06c6c5b5d.js b/compiler/tests-js-parser/early/761785f06c6c5b5d.js new file mode 100644 index 000000000..8bc0452e4 --- /dev/null +++ b/compiler/tests-js-parser/early/761785f06c6c5b5d.js @@ -0,0 +1 @@ +while(1) { function a(){ break; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/768374d1afae5581.js b/compiler/tests-js-parser/early/768374d1afae5581.js new file mode 100644 index 000000000..2023adb4e --- /dev/null +++ b/compiler/tests-js-parser/early/768374d1afae5581.js @@ -0,0 +1 @@ +function a(){ const b = 1; let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/768606c6831f0d63.js b/compiler/tests-js-parser/early/768606c6831f0d63.js new file mode 100644 index 000000000..e6df68592 --- /dev/null +++ b/compiler/tests-js-parser/early/768606c6831f0d63.js @@ -0,0 +1 @@ +'use strict'; with(1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/778c73e1a4e6d54e.js b/compiler/tests-js-parser/early/778c73e1a4e6d54e.js new file mode 100644 index 000000000..d43a2bb41 --- /dev/null +++ b/compiler/tests-js-parser/early/778c73e1a4e6d54e.js @@ -0,0 +1 @@ +"use strict"; arguments => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7806dc1ece7453db.js b/compiler/tests-js-parser/early/7806dc1ece7453db.js new file mode 100644 index 000000000..83d648b8e --- /dev/null +++ b/compiler/tests-js-parser/early/7806dc1ece7453db.js @@ -0,0 +1 @@ +() => { let a; let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7894c9b2e30eb327.js b/compiler/tests-js-parser/early/7894c9b2e30eb327.js new file mode 100644 index 000000000..7b3818915 --- /dev/null +++ b/compiler/tests-js-parser/early/7894c9b2e30eb327.js @@ -0,0 +1 @@ +{ let a; let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/78cb084c22573e4a.js b/compiler/tests-js-parser/early/78cb084c22573e4a.js new file mode 100644 index 000000000..b52cdb45d --- /dev/null +++ b/compiler/tests-js-parser/early/78cb084c22573e4a.js @@ -0,0 +1 @@ +[...[0]] = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7958864040a4f3c1.js b/compiler/tests-js-parser/early/7958864040a4f3c1.js new file mode 100644 index 000000000..c844b73a8 --- /dev/null +++ b/compiler/tests-js-parser/early/7958864040a4f3c1.js @@ -0,0 +1 @@ +function* a(){ ({[yield]: b}) => 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/79592a4804326355.js b/compiler/tests-js-parser/early/79592a4804326355.js new file mode 100644 index 000000000..fe42a4621 --- /dev/null +++ b/compiler/tests-js-parser/early/79592a4804326355.js @@ -0,0 +1 @@ +0 = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/79c4b346bfb73294.js b/compiler/tests-js-parser/early/79c4b346bfb73294.js new file mode 100644 index 000000000..479edf71f --- /dev/null +++ b/compiler/tests-js-parser/early/79c4b346bfb73294.js @@ -0,0 +1 @@ +function a() {'use strict'; function arguments() { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7a2bf91be132b22d.js b/compiler/tests-js-parser/early/7a2bf91be132b22d.js new file mode 100644 index 000000000..84eb07115 --- /dev/null +++ b/compiler/tests-js-parser/early/7a2bf91be132b22d.js @@ -0,0 +1 @@ +for({a: 0} in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7a4619d256ebac5e.js b/compiler/tests-js-parser/early/7a4619d256ebac5e.js new file mode 100644 index 000000000..e8eebbaba --- /dev/null +++ b/compiler/tests-js-parser/early/7a4619d256ebac5e.js @@ -0,0 +1 @@ +function a() {'use strict'; ({ b: function eval() { } }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7a916ef0ccd4ea9c.js b/compiler/tests-js-parser/early/7a916ef0ccd4ea9c.js new file mode 100644 index 000000000..b5a0371b5 --- /dev/null +++ b/compiler/tests-js-parser/early/7a916ef0ccd4ea9c.js @@ -0,0 +1 @@ +function* a({b}){ let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7b60688fbf8723d0.js b/compiler/tests-js-parser/early/7b60688fbf8723d0.js new file mode 100644 index 000000000..6a1b06b6f --- /dev/null +++ b/compiler/tests-js-parser/early/7b60688fbf8723d0.js @@ -0,0 +1 @@ +for(let a, a;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7b875b983e3a9ec8.js b/compiler/tests-js-parser/early/7b875b983e3a9ec8.js new file mode 100644 index 000000000..796d5514f --- /dev/null +++ b/compiler/tests-js-parser/early/7b875b983e3a9ec8.js @@ -0,0 +1 @@ +if(1) continue; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7c1ed05c850d5900.js b/compiler/tests-js-parser/early/7c1ed05c850d5900.js new file mode 100644 index 000000000..cabce53f8 --- /dev/null +++ b/compiler/tests-js-parser/early/7c1ed05c850d5900.js @@ -0,0 +1 @@ +do b: function a(){} while (1) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7ca5d521e3724537.js b/compiler/tests-js-parser/early/7ca5d521e3724537.js new file mode 100644 index 000000000..849787688 --- /dev/null +++ b/compiler/tests-js-parser/early/7ca5d521e3724537.js @@ -0,0 +1 @@ +let let; diff --git a/compiler/tests-js-parser/early/7cba993c4bca1e4d.module.js b/compiler/tests-js-parser/early/7cba993c4bca1e4d.module.js new file mode 100644 index 000000000..9eddb820f --- /dev/null +++ b/compiler/tests-js-parser/early/7cba993c4bca1e4d.module.js @@ -0,0 +1 @@ +let a; export let a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7d10259151fac4ed.js b/compiler/tests-js-parser/early/7d10259151fac4ed.js new file mode 100644 index 000000000..dc66edb8b --- /dev/null +++ b/compiler/tests-js-parser/early/7d10259151fac4ed.js @@ -0,0 +1 @@ +function* a(){ function* b([c = yield]){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7d91ca0f63ee9a57.js b/compiler/tests-js-parser/early/7d91ca0f63ee9a57.js new file mode 100644 index 000000000..2dc8476cf --- /dev/null +++ b/compiler/tests-js-parser/early/7d91ca0f63ee9a57.js @@ -0,0 +1 @@ +function a(){ const b = 1; var b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7df9b9bc309e08de.js b/compiler/tests-js-parser/early/7df9b9bc309e08de.js new file mode 100644 index 000000000..416d0d78d --- /dev/null +++ b/compiler/tests-js-parser/early/7df9b9bc309e08de.js @@ -0,0 +1 @@ +do b: function a(){} while (1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7e34dc0aa11f53ae.js b/compiler/tests-js-parser/early/7e34dc0aa11f53ae.js new file mode 100644 index 000000000..c357d1dcf --- /dev/null +++ b/compiler/tests-js-parser/early/7e34dc0aa11f53ae.js @@ -0,0 +1 @@ +function a(){ while(1) continue b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7ea0f80766201023.module.js b/compiler/tests-js-parser/early/7ea0f80766201023.module.js new file mode 100644 index 000000000..93208a5a8 --- /dev/null +++ b/compiler/tests-js-parser/early/7ea0f80766201023.module.js @@ -0,0 +1 @@ +var a; function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7ee16f8f3f02e496.js b/compiler/tests-js-parser/early/7ee16f8f3f02e496.js new file mode 100644 index 000000000..0f23a4c8c --- /dev/null +++ b/compiler/tests-js-parser/early/7ee16f8f3f02e496.js @@ -0,0 +1 @@ +function a() { "use strict"; var package; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7fc6f3a6590d207d.module.js b/compiler/tests-js-parser/early/7fc6f3a6590d207d.module.js new file mode 100644 index 000000000..3575c2d8a --- /dev/null +++ b/compiler/tests-js-parser/early/7fc6f3a6590d207d.module.js @@ -0,0 +1 @@ +export {a as b}; let b; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/7ff093da75220530.js b/compiler/tests-js-parser/early/7ff093da75220530.js new file mode 100644 index 000000000..91eb292f8 --- /dev/null +++ b/compiler/tests-js-parser/early/7ff093da75220530.js @@ -0,0 +1 @@ +class a { constructor(){} constructor(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/804b1f01b632ffe4.js b/compiler/tests-js-parser/early/804b1f01b632ffe4.js new file mode 100644 index 000000000..d5adac349 --- /dev/null +++ b/compiler/tests-js-parser/early/804b1f01b632ffe4.js @@ -0,0 +1 @@ +function a(){ let b; let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/805c7f7e24771841.js b/compiler/tests-js-parser/early/805c7f7e24771841.js new file mode 100644 index 000000000..2544a7be7 --- /dev/null +++ b/compiler/tests-js-parser/early/805c7f7e24771841.js @@ -0,0 +1 @@ +for(const a in 1) { var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/80c2d2d1d35c8dcc.js b/compiler/tests-js-parser/early/80c2d2d1d35c8dcc.js new file mode 100644 index 000000000..0be9dc70e --- /dev/null +++ b/compiler/tests-js-parser/early/80c2d2d1d35c8dcc.js @@ -0,0 +1 @@ +[a] *= 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/811e434afe688eb4.js b/compiler/tests-js-parser/early/811e434afe688eb4.js new file mode 100644 index 000000000..572673836 --- /dev/null +++ b/compiler/tests-js-parser/early/811e434afe688eb4.js @@ -0,0 +1 @@ +({ set __proto__(a){}, "__proto__": null, __proto__: null, }) diff --git a/compiler/tests-js-parser/early/8174015519199e36.js b/compiler/tests-js-parser/early/8174015519199e36.js new file mode 100644 index 000000000..6ab0bcc62 --- /dev/null +++ b/compiler/tests-js-parser/early/8174015519199e36.js @@ -0,0 +1 @@ +'use strict'; ({eval = 1} = 2); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/818141605e98714b.js b/compiler/tests-js-parser/early/818141605e98714b.js new file mode 100644 index 000000000..7e9c8cb94 --- /dev/null +++ b/compiler/tests-js-parser/early/818141605e98714b.js @@ -0,0 +1 @@ +function a() {'use strict'; ({ b: 1, set c(eval) { } }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/819eb20493851d57.js b/compiler/tests-js-parser/early/819eb20493851d57.js new file mode 100644 index 000000000..95a262399 --- /dev/null +++ b/compiler/tests-js-parser/early/819eb20493851d57.js @@ -0,0 +1 @@ +let a, b, c, let; diff --git a/compiler/tests-js-parser/early/823c6711626cd72c.js b/compiler/tests-js-parser/early/823c6711626cd72c.js new file mode 100644 index 000000000..ce6c80cfa --- /dev/null +++ b/compiler/tests-js-parser/early/823c6711626cd72c.js @@ -0,0 +1 @@ +'use strict'; +yield; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/82c93f9933c9710a.js b/compiler/tests-js-parser/early/82c93f9933c9710a.js new file mode 100644 index 000000000..fee4d0607 --- /dev/null +++ b/compiler/tests-js-parser/early/82c93f9933c9710a.js @@ -0,0 +1 @@ +"use strict"; function a(b, { b }){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/83502863425a5eec.js b/compiler/tests-js-parser/early/83502863425a5eec.js new file mode 100644 index 000000000..2acd0d8b3 --- /dev/null +++ b/compiler/tests-js-parser/early/83502863425a5eec.js @@ -0,0 +1 @@ +'use strict'; +interface; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/845e933d626fb6d0.js b/compiler/tests-js-parser/early/845e933d626fb6d0.js new file mode 100644 index 000000000..2283a792f --- /dev/null +++ b/compiler/tests-js-parser/early/845e933d626fb6d0.js @@ -0,0 +1 @@ +function a() { "use strict"; var implements; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8495aba101a6e23b.js b/compiler/tests-js-parser/early/8495aba101a6e23b.js new file mode 100644 index 000000000..745c01094 --- /dev/null +++ b/compiler/tests-js-parser/early/8495aba101a6e23b.js @@ -0,0 +1 @@ +let a = 1, a = 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/84a6ea824cac8e3b.js b/compiler/tests-js-parser/early/84a6ea824cac8e3b.js new file mode 100644 index 000000000..bf3fdcd66 --- /dev/null +++ b/compiler/tests-js-parser/early/84a6ea824cac8e3b.js @@ -0,0 +1 @@ +break diff --git a/compiler/tests-js-parser/early/84bf7b09d729a621.module.js b/compiler/tests-js-parser/early/84bf7b09d729a621.module.js new file mode 100644 index 000000000..c473248b0 --- /dev/null +++ b/compiler/tests-js-parser/early/84bf7b09d729a621.module.js @@ -0,0 +1 @@ +export default 1; export default class a {}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/84d6dcd55ead1a00.js b/compiler/tests-js-parser/early/84d6dcd55ead1a00.js new file mode 100644 index 000000000..363e05c8c --- /dev/null +++ b/compiler/tests-js-parser/early/84d6dcd55ead1a00.js @@ -0,0 +1 @@ +function a() { "use strict"; implements = 1; } diff --git a/compiler/tests-js-parser/early/84ef3bbaa772075f.js b/compiler/tests-js-parser/early/84ef3bbaa772075f.js new file mode 100644 index 000000000..29149eb72 --- /dev/null +++ b/compiler/tests-js-parser/early/84ef3bbaa772075f.js @@ -0,0 +1 @@ +(class eval {}) diff --git a/compiler/tests-js-parser/early/85ab51571417026e.js b/compiler/tests-js-parser/early/85ab51571417026e.js new file mode 100644 index 000000000..40cffa5cc --- /dev/null +++ b/compiler/tests-js-parser/early/85ab51571417026e.js @@ -0,0 +1 @@ +const a, b = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/85e66a82bb841343.js b/compiler/tests-js-parser/early/85e66a82bb841343.js new file mode 100644 index 000000000..6708ffcd3 --- /dev/null +++ b/compiler/tests-js-parser/early/85e66a82bb841343.js @@ -0,0 +1 @@ +class a extends b { constructor() { !{constructor() { super(); }}; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/86131c9fbad63a79.js b/compiler/tests-js-parser/early/86131c9fbad63a79.js new file mode 100644 index 000000000..a19dcbd23 --- /dev/null +++ b/compiler/tests-js-parser/early/86131c9fbad63a79.js @@ -0,0 +1 @@ +!class a { constructor(){} constructor(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8643da76fe7e95c7.js b/compiler/tests-js-parser/early/8643da76fe7e95c7.js new file mode 100644 index 000000000..52727a199 --- /dev/null +++ b/compiler/tests-js-parser/early/8643da76fe7e95c7.js @@ -0,0 +1 @@ +(function eval() {'use strict'; })() \ No newline at end of file diff --git a/compiler/tests-js-parser/early/869ac2b391a8c7cd.js b/compiler/tests-js-parser/early/869ac2b391a8c7cd.js new file mode 100644 index 000000000..6f4fbbaae --- /dev/null +++ b/compiler/tests-js-parser/early/869ac2b391a8c7cd.js @@ -0,0 +1 @@ +for([0] in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/86b8297085fecff2.js b/compiler/tests-js-parser/early/86b8297085fecff2.js new file mode 100644 index 000000000..7e32143a7 --- /dev/null +++ b/compiler/tests-js-parser/early/86b8297085fecff2.js @@ -0,0 +1 @@ +!{ set a([b, b]){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/86fd57539134f77e.js b/compiler/tests-js-parser/early/86fd57539134f77e.js new file mode 100644 index 000000000..6981d8657 --- /dev/null +++ b/compiler/tests-js-parser/early/86fd57539134f77e.js @@ -0,0 +1 @@ +super.a \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8720904980732ca4.module.js b/compiler/tests-js-parser/early/8720904980732ca4.module.js new file mode 100644 index 000000000..08a1e31f0 --- /dev/null +++ b/compiler/tests-js-parser/early/8720904980732ca4.module.js @@ -0,0 +1 @@ +var a; export const a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/879307750f26460e.js b/compiler/tests-js-parser/early/879307750f26460e.js new file mode 100644 index 000000000..b5028d1ad --- /dev/null +++ b/compiler/tests-js-parser/early/879307750f26460e.js @@ -0,0 +1 @@ +{ let a; var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/87946387ad39dde7.js b/compiler/tests-js-parser/early/87946387ad39dde7.js new file mode 100644 index 000000000..54a0a8383 --- /dev/null +++ b/compiler/tests-js-parser/early/87946387ad39dde7.js @@ -0,0 +1 @@ +function a(b, { b }){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/88c191b16e27775e.js b/compiler/tests-js-parser/early/88c191b16e27775e.js new file mode 100644 index 000000000..7a19fd173 --- /dev/null +++ b/compiler/tests-js-parser/early/88c191b16e27775e.js @@ -0,0 +1 @@ +!{ *a(b) { super() } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8a6549558d83d0ee.js b/compiler/tests-js-parser/early/8a6549558d83d0ee.js new file mode 100644 index 000000000..b7ffa6cd9 --- /dev/null +++ b/compiler/tests-js-parser/early/8a6549558d83d0ee.js @@ -0,0 +1 @@ +a: a: ; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8b659d2805837e98.js b/compiler/tests-js-parser/early/8b659d2805837e98.js new file mode 100644 index 000000000..43c3d3089 --- /dev/null +++ b/compiler/tests-js-parser/early/8b659d2805837e98.js @@ -0,0 +1 @@ +++0 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8bb1526104b02936.js b/compiler/tests-js-parser/early/8bb1526104b02936.js new file mode 100644 index 000000000..7a05d6c51 --- /dev/null +++ b/compiler/tests-js-parser/early/8bb1526104b02936.js @@ -0,0 +1 @@ +function a() { "use strict"; package = 1; } diff --git a/compiler/tests-js-parser/early/8be4906b5a315513.js b/compiler/tests-js-parser/early/8be4906b5a315513.js new file mode 100644 index 000000000..510003f53 --- /dev/null +++ b/compiler/tests-js-parser/early/8be4906b5a315513.js @@ -0,0 +1 @@ +{ const a = 1; const a = 2; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8c0dcbcb0ba9a5c6.js b/compiler/tests-js-parser/early/8c0dcbcb0ba9a5c6.js new file mode 100644 index 000000000..70314547d --- /dev/null +++ b/compiler/tests-js-parser/early/8c0dcbcb0ba9a5c6.js @@ -0,0 +1 @@ +function a([yield,...a]){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8c2b8fcd698fa3ac.js b/compiler/tests-js-parser/early/8c2b8fcd698fa3ac.js new file mode 100644 index 000000000..d83ce6df7 --- /dev/null +++ b/compiler/tests-js-parser/early/8c2b8fcd698fa3ac.js @@ -0,0 +1 @@ +function a(b){ let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8c62442458de872f.js b/compiler/tests-js-parser/early/8c62442458de872f.js new file mode 100644 index 000000000..4b6769024 --- /dev/null +++ b/compiler/tests-js-parser/early/8c62442458de872f.js @@ -0,0 +1 @@ +for(0 in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8c6595589877c45e.js b/compiler/tests-js-parser/early/8c6595589877c45e.js new file mode 100644 index 000000000..d0a2e1439 --- /dev/null +++ b/compiler/tests-js-parser/early/8c6595589877c45e.js @@ -0,0 +1 @@ +'use strict'; var eval; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8d2870226258eaea.js b/compiler/tests-js-parser/early/8d2870226258eaea.js new file mode 100644 index 000000000..d47b3d616 --- /dev/null +++ b/compiler/tests-js-parser/early/8d2870226258eaea.js @@ -0,0 +1 @@ +'use strict'; ({eval = a} = b) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8d5724a5ec47542d.js b/compiler/tests-js-parser/early/8d5724a5ec47542d.js new file mode 100644 index 000000000..d39d388a6 --- /dev/null +++ b/compiler/tests-js-parser/early/8d5724a5ec47542d.js @@ -0,0 +1 @@ +let a, b, a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8d7627d8f8cc16c8.js b/compiler/tests-js-parser/early/8d7627d8f8cc16c8.js new file mode 100644 index 000000000..698b0695e --- /dev/null +++ b/compiler/tests-js-parser/early/8d7627d8f8cc16c8.js @@ -0,0 +1 @@ +"use strict"; (eval, a = 1) => 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8e369dc6967d9718.js b/compiler/tests-js-parser/early/8e369dc6967d9718.js new file mode 100644 index 000000000..c1cb850fe --- /dev/null +++ b/compiler/tests-js-parser/early/8e369dc6967d9718.js @@ -0,0 +1 @@ +{ let a; const a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8e894147f07a904c.js b/compiler/tests-js-parser/early/8e894147f07a904c.js new file mode 100644 index 000000000..ffcb41186 --- /dev/null +++ b/compiler/tests-js-parser/early/8e894147f07a904c.js @@ -0,0 +1 @@ +const a = 1, b; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8ed5209e2c6208bb.js b/compiler/tests-js-parser/early/8ed5209e2c6208bb.js new file mode 100644 index 000000000..e5d3c8d42 --- /dev/null +++ b/compiler/tests-js-parser/early/8ed5209e2c6208bb.js @@ -0,0 +1 @@ +{ const a = 1; function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8f12b5b733b9b694.js b/compiler/tests-js-parser/early/8f12b5b733b9b694.js new file mode 100644 index 000000000..c36912445 --- /dev/null +++ b/compiler/tests-js-parser/early/8f12b5b733b9b694.js @@ -0,0 +1 @@ +(package) => {'use strict'} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8f2d88f14f125b42.js b/compiler/tests-js-parser/early/8f2d88f14f125b42.js new file mode 100644 index 000000000..ce57514e8 --- /dev/null +++ b/compiler/tests-js-parser/early/8f2d88f14f125b42.js @@ -0,0 +1 @@ +({ __proto__: 1, __proto__: 2 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/8ffe04111c1a982d.module.js b/compiler/tests-js-parser/early/8ffe04111c1a982d.module.js new file mode 100644 index 000000000..c399ecf6f --- /dev/null +++ b/compiler/tests-js-parser/early/8ffe04111c1a982d.module.js @@ -0,0 +1 @@ +export {a as b}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/90071de872ef5686.js b/compiler/tests-js-parser/early/90071de872ef5686.js new file mode 100644 index 000000000..757c10572 --- /dev/null +++ b/compiler/tests-js-parser/early/90071de872ef5686.js @@ -0,0 +1 @@ +function a(){ var b; const b = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/903b3f9a0ac6fae6.js b/compiler/tests-js-parser/early/903b3f9a0ac6fae6.js new file mode 100644 index 000000000..494a7853d --- /dev/null +++ b/compiler/tests-js-parser/early/903b3f9a0ac6fae6.js @@ -0,0 +1 @@ +function a(package) { "use strict"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/908f70eef690c4ed.js b/compiler/tests-js-parser/early/908f70eef690c4ed.js new file mode 100644 index 000000000..d90d684d6 --- /dev/null +++ b/compiler/tests-js-parser/early/908f70eef690c4ed.js @@ -0,0 +1 @@ +!{ get a(){ let b; var b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/90c089b382d8aaf9.js b/compiler/tests-js-parser/early/90c089b382d8aaf9.js new file mode 100644 index 000000000..41052b8e8 --- /dev/null +++ b/compiler/tests-js-parser/early/90c089b382d8aaf9.js @@ -0,0 +1 @@ +for((0) in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9162e559ff53891c.js b/compiler/tests-js-parser/early/9162e559ff53891c.js new file mode 100644 index 000000000..6bc4ed921 --- /dev/null +++ b/compiler/tests-js-parser/early/9162e559ff53891c.js @@ -0,0 +1 @@ +function* a(){ ({ *b({[yield]: c}){} }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/91af315899636cff.js b/compiler/tests-js-parser/early/91af315899636cff.js new file mode 100644 index 000000000..e1750dbb6 --- /dev/null +++ b/compiler/tests-js-parser/early/91af315899636cff.js @@ -0,0 +1 @@ +let [a, ...a] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/91c039bee82ebdb9.js b/compiler/tests-js-parser/early/91c039bee82ebdb9.js new file mode 100644 index 000000000..3d9493283 --- /dev/null +++ b/compiler/tests-js-parser/early/91c039bee82ebdb9.js @@ -0,0 +1 @@ +(a) => { let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/91e632d1f6f140ed.js b/compiler/tests-js-parser/early/91e632d1f6f140ed.js new file mode 100644 index 000000000..37079ef68 --- /dev/null +++ b/compiler/tests-js-parser/early/91e632d1f6f140ed.js @@ -0,0 +1 @@ +!{ *a({b, b}){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/931373070243928b.js b/compiler/tests-js-parser/early/931373070243928b.js new file mode 100644 index 000000000..92fe16751 --- /dev/null +++ b/compiler/tests-js-parser/early/931373070243928b.js @@ -0,0 +1 @@ +class a { *constructor(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/939bc78e89815e9e.js b/compiler/tests-js-parser/early/939bc78e89815e9e.js new file mode 100644 index 000000000..6d63e879a --- /dev/null +++ b/compiler/tests-js-parser/early/939bc78e89815e9e.js @@ -0,0 +1 @@ +for(let let of 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/93b1547f64fd0370.js b/compiler/tests-js-parser/early/93b1547f64fd0370.js new file mode 100644 index 000000000..a6efb82c5 --- /dev/null +++ b/compiler/tests-js-parser/early/93b1547f64fd0370.js @@ -0,0 +1 @@ +!{ *a([b]){ let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/940c94f0d51d3a49.js b/compiler/tests-js-parser/early/940c94f0d51d3a49.js new file mode 100644 index 000000000..820e70068 --- /dev/null +++ b/compiler/tests-js-parser/early/940c94f0d51d3a49.js @@ -0,0 +1 @@ +function* a(){ !function*(b = yield c){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/94fac3e2a049dac5.js b/compiler/tests-js-parser/early/94fac3e2a049dac5.js new file mode 100644 index 000000000..ac31d06bf --- /dev/null +++ b/compiler/tests-js-parser/early/94fac3e2a049dac5.js @@ -0,0 +1 @@ +({a([]){'use strict'}}) diff --git a/compiler/tests-js-parser/early/9521a03d607f8602.js b/compiler/tests-js-parser/early/9521a03d607f8602.js new file mode 100644 index 000000000..7489beaeb --- /dev/null +++ b/compiler/tests-js-parser/early/9521a03d607f8602.js @@ -0,0 +1 @@ +class a extends b { constructor() { function c(){ super(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/95768a750c75b822.js b/compiler/tests-js-parser/early/95768a750c75b822.js new file mode 100644 index 000000000..58cf5fb79 --- /dev/null +++ b/compiler/tests-js-parser/early/95768a750c75b822.js @@ -0,0 +1 @@ +'use strict'; eval=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/95bf27d640eada27.js b/compiler/tests-js-parser/early/95bf27d640eada27.js new file mode 100644 index 000000000..1a92019c0 --- /dev/null +++ b/compiler/tests-js-parser/early/95bf27d640eada27.js @@ -0,0 +1 @@ +!{ __proto__: null, __proto__: null }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/95c4810b20741e13.js b/compiler/tests-js-parser/early/95c4810b20741e13.js new file mode 100644 index 000000000..8d602d3b6 --- /dev/null +++ b/compiler/tests-js-parser/early/95c4810b20741e13.js @@ -0,0 +1 @@ +function a() { 'use strict'; function b(eval) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/962dacad9c079314.js b/compiler/tests-js-parser/early/962dacad9c079314.js new file mode 100644 index 000000000..112071203 --- /dev/null +++ b/compiler/tests-js-parser/early/962dacad9c079314.js @@ -0,0 +1 @@ +!function a(){ let b; let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/96533ed6c7244382.module.js b/compiler/tests-js-parser/early/96533ed6c7244382.module.js new file mode 100644 index 000000000..90e507986 --- /dev/null +++ b/compiler/tests-js-parser/early/96533ed6c7244382.module.js @@ -0,0 +1 @@ +export {a}; diff --git a/compiler/tests-js-parser/early/96eaedb4bbe1deee.js b/compiler/tests-js-parser/early/96eaedb4bbe1deee.js new file mode 100644 index 000000000..dcd1c142b --- /dev/null +++ b/compiler/tests-js-parser/early/96eaedb4bbe1deee.js @@ -0,0 +1 @@ +while (true) { continue a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9775da9e2a562646.js b/compiler/tests-js-parser/early/9775da9e2a562646.js new file mode 100644 index 000000000..73f146ae4 --- /dev/null +++ b/compiler/tests-js-parser/early/9775da9e2a562646.js @@ -0,0 +1 @@ +function a() { "use strict"; var let; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9786d06ece1b3cd4.js b/compiler/tests-js-parser/early/9786d06ece1b3cd4.js new file mode 100644 index 000000000..959e4dcb7 --- /dev/null +++ b/compiler/tests-js-parser/early/9786d06ece1b3cd4.js @@ -0,0 +1 @@ +"use strict"; (arguments, a) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/978c2537efe98437.js b/compiler/tests-js-parser/early/978c2537efe98437.js new file mode 100644 index 000000000..ae4925013 --- /dev/null +++ b/compiler/tests-js-parser/early/978c2537efe98437.js @@ -0,0 +1 @@ +for (const let of a); diff --git a/compiler/tests-js-parser/early/9790460167204c05.js b/compiler/tests-js-parser/early/9790460167204c05.js new file mode 100644 index 000000000..dcbb51abf --- /dev/null +++ b/compiler/tests-js-parser/early/9790460167204c05.js @@ -0,0 +1 @@ +'use strict'; for (let in a) {} diff --git a/compiler/tests-js-parser/early/97c457b4a0ab3909.js b/compiler/tests-js-parser/early/97c457b4a0ab3909.js new file mode 100644 index 000000000..e64f506ff --- /dev/null +++ b/compiler/tests-js-parser/early/97c457b4a0ab3909.js @@ -0,0 +1 @@ +"use strict"; function a(b, ...[b]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/981cb65680c8c362.js b/compiler/tests-js-parser/early/981cb65680c8c362.js new file mode 100644 index 000000000..f1fa8eda1 --- /dev/null +++ b/compiler/tests-js-parser/early/981cb65680c8c362.js @@ -0,0 +1 @@ +for(;;) d: c: b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/982ee1ff0385dd2b.js b/compiler/tests-js-parser/early/982ee1ff0385dd2b.js new file mode 100644 index 000000000..ba06a43e5 --- /dev/null +++ b/compiler/tests-js-parser/early/982ee1ff0385dd2b.js @@ -0,0 +1 @@ +function* a(){ function* b({c = yield}){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/987442878ab414e7.js b/compiler/tests-js-parser/early/987442878ab414e7.js new file mode 100644 index 000000000..b49ace4b4 --- /dev/null +++ b/compiler/tests-js-parser/early/987442878ab414e7.js @@ -0,0 +1 @@ +(class arguments {}) diff --git a/compiler/tests-js-parser/early/990d245794f297e7.js b/compiler/tests-js-parser/early/990d245794f297e7.js new file mode 100644 index 000000000..aba5048d5 --- /dev/null +++ b/compiler/tests-js-parser/early/990d245794f297e7.js @@ -0,0 +1 @@ +const a = 1; let a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/99103b52eecff8c8.js b/compiler/tests-js-parser/early/99103b52eecff8c8.js new file mode 100644 index 000000000..239d1c1ba --- /dev/null +++ b/compiler/tests-js-parser/early/99103b52eecff8c8.js @@ -0,0 +1 @@ +"use strict"; function a(...yield) {} diff --git a/compiler/tests-js-parser/early/99195a9828091096.js b/compiler/tests-js-parser/early/99195a9828091096.js new file mode 100644 index 000000000..866d1cfa5 --- /dev/null +++ b/compiler/tests-js-parser/early/99195a9828091096.js @@ -0,0 +1 @@ +for(const let of 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9990a6d1d39f313d.js b/compiler/tests-js-parser/early/9990a6d1d39f313d.js new file mode 100644 index 000000000..0f8d567fd --- /dev/null +++ b/compiler/tests-js-parser/early/9990a6d1d39f313d.js @@ -0,0 +1 @@ +break a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9a14a32ab3a5801b.js b/compiler/tests-js-parser/early/9a14a32ab3a5801b.js new file mode 100644 index 000000000..8a1cf663b --- /dev/null +++ b/compiler/tests-js-parser/early/9a14a32ab3a5801b.js @@ -0,0 +1 @@ +'use strict'; function arguments(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9a36b325bc0c8329.module.js b/compiler/tests-js-parser/early/9a36b325bc0c8329.module.js new file mode 100644 index 000000000..e0fab62b8 --- /dev/null +++ b/compiler/tests-js-parser/early/9a36b325bc0c8329.module.js @@ -0,0 +1 @@ +let a; function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9adb143304483420.js b/compiler/tests-js-parser/early/9adb143304483420.js new file mode 100644 index 000000000..3f8f5ee7b --- /dev/null +++ b/compiler/tests-js-parser/early/9adb143304483420.js @@ -0,0 +1 @@ +(function({a: b, c: b}){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9afd2205d1850e37.js b/compiler/tests-js-parser/early/9afd2205d1850e37.js new file mode 100644 index 000000000..00b2f18dc --- /dev/null +++ b/compiler/tests-js-parser/early/9afd2205d1850e37.js @@ -0,0 +1 @@ +function a() { "use strict"; var yield; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9cc210fd96d9bd31.js b/compiler/tests-js-parser/early/9cc210fd96d9bd31.js new file mode 100644 index 000000000..deacc995b --- /dev/null +++ b/compiler/tests-js-parser/early/9cc210fd96d9bd31.js @@ -0,0 +1 @@ +'use strict'; !function*(a, a){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9cc4d445cd51e85a.js b/compiler/tests-js-parser/early/9cc4d445cd51e85a.js new file mode 100644 index 000000000..d3108245f --- /dev/null +++ b/compiler/tests-js-parser/early/9cc4d445cd51e85a.js @@ -0,0 +1 @@ +class a {static prototype(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9cf79ed7b0532da1.js b/compiler/tests-js-parser/early/9cf79ed7b0532da1.js new file mode 100644 index 000000000..6e4905a87 --- /dev/null +++ b/compiler/tests-js-parser/early/9cf79ed7b0532da1.js @@ -0,0 +1 @@ +while(1) b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9d030e1cf08f5d77.js b/compiler/tests-js-parser/early/9d030e1cf08f5d77.js new file mode 100644 index 000000000..f6f2331df --- /dev/null +++ b/compiler/tests-js-parser/early/9d030e1cf08f5d77.js @@ -0,0 +1 @@ +for((0) of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9d7dae2010089c43.js b/compiler/tests-js-parser/early/9d7dae2010089c43.js new file mode 100644 index 000000000..cc16b0b2e --- /dev/null +++ b/compiler/tests-js-parser/early/9d7dae2010089c43.js @@ -0,0 +1 @@ +function a() {'use strict'; --eval; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9d893d3b185cdca0.js b/compiler/tests-js-parser/early/9d893d3b185cdca0.js new file mode 100644 index 000000000..4e890f936 --- /dev/null +++ b/compiler/tests-js-parser/early/9d893d3b185cdca0.js @@ -0,0 +1 @@ +({ "__proto__": null, __proto__: null }) diff --git a/compiler/tests-js-parser/early/9d8bc7d41a06ba76.js b/compiler/tests-js-parser/early/9d8bc7d41a06ba76.js new file mode 100644 index 000000000..541da5f8f --- /dev/null +++ b/compiler/tests-js-parser/early/9d8bc7d41a06ba76.js @@ -0,0 +1 @@ +for(const let in 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9dddeef0977c5289.js b/compiler/tests-js-parser/early/9dddeef0977c5289.js new file mode 100644 index 000000000..9cef7f3db --- /dev/null +++ b/compiler/tests-js-parser/early/9dddeef0977c5289.js @@ -0,0 +1 @@ +class a extends b { c() { super(); } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9e289784bb34a427.js b/compiler/tests-js-parser/early/9e289784bb34a427.js new file mode 100644 index 000000000..27abf67dc --- /dev/null +++ b/compiler/tests-js-parser/early/9e289784bb34a427.js @@ -0,0 +1 @@ +switch(1) { case 2: let a; default: let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9ef7cc46ec36bb51.js b/compiler/tests-js-parser/early/9ef7cc46ec36bb51.js new file mode 100644 index 000000000..d42d62172 --- /dev/null +++ b/compiler/tests-js-parser/early/9ef7cc46ec36bb51.js @@ -0,0 +1 @@ +({a}) => { const a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/9efca380f8fbc57b.js b/compiler/tests-js-parser/early/9efca380f8fbc57b.js new file mode 100644 index 000000000..9fd5fd330 --- /dev/null +++ b/compiler/tests-js-parser/early/9efca380f8fbc57b.js @@ -0,0 +1 @@ +function a(eval){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a080bb9d7e28c7d3.js b/compiler/tests-js-parser/early/a080bb9d7e28c7d3.js new file mode 100644 index 000000000..2d8d9a636 --- /dev/null +++ b/compiler/tests-js-parser/early/a080bb9d7e28c7d3.js @@ -0,0 +1 @@ +let [a, a] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a0c1039fe0e17f79.js b/compiler/tests-js-parser/early/a0c1039fe0e17f79.js new file mode 100644 index 000000000..27c8cb667 --- /dev/null +++ b/compiler/tests-js-parser/early/a0c1039fe0e17f79.js @@ -0,0 +1 @@ +for(let a, let;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a13cdb9c0402001f.js b/compiler/tests-js-parser/early/a13cdb9c0402001f.js new file mode 100644 index 000000000..7b475a396 --- /dev/null +++ b/compiler/tests-js-parser/early/a13cdb9c0402001f.js @@ -0,0 +1,4 @@ +"use strict"; +function a([a,a]){ } +function a([a,...a]){ } +function a([{a},...a]){ } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a1e3beb1ecc1ae87.js b/compiler/tests-js-parser/early/a1e3beb1ecc1ae87.js new file mode 100644 index 000000000..2a010dcd0 --- /dev/null +++ b/compiler/tests-js-parser/early/a1e3beb1ecc1ae87.js @@ -0,0 +1 @@ +function* a(b){ super.c } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a236c74609b92c02.module.js b/compiler/tests-js-parser/early/a236c74609b92c02.module.js new file mode 100644 index 000000000..efa061c4e --- /dev/null +++ b/compiler/tests-js-parser/early/a236c74609b92c02.module.js @@ -0,0 +1 @@ +export {a as default}; diff --git a/compiler/tests-js-parser/early/a2784eb16be093f0.js b/compiler/tests-js-parser/early/a2784eb16be093f0.js new file mode 100644 index 000000000..132a4d78b --- /dev/null +++ b/compiler/tests-js-parser/early/a2784eb16be093f0.js @@ -0,0 +1 @@ +const a = 1, b = 2, a = 3; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a27a9e29d57c578f.js b/compiler/tests-js-parser/early/a27a9e29d57c578f.js new file mode 100644 index 000000000..9cc8301ba --- /dev/null +++ b/compiler/tests-js-parser/early/a27a9e29d57c578f.js @@ -0,0 +1 @@ +for(var a of b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a2b7b198fe6300ac.js b/compiler/tests-js-parser/early/a2b7b198fe6300ac.js new file mode 100644 index 000000000..60ffcdfd7 --- /dev/null +++ b/compiler/tests-js-parser/early/a2b7b198fe6300ac.js @@ -0,0 +1 @@ +([a,[b],...b])=>1; diff --git a/compiler/tests-js-parser/early/a2f7a99e669acacc.js b/compiler/tests-js-parser/early/a2f7a99e669acacc.js new file mode 100644 index 000000000..2e9ec2b33 --- /dev/null +++ b/compiler/tests-js-parser/early/a2f7a99e669acacc.js @@ -0,0 +1 @@ +([a],...a)=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a2f99303eecab290.js b/compiler/tests-js-parser/early/a2f99303eecab290.js new file mode 100644 index 000000000..330612a2d --- /dev/null +++ b/compiler/tests-js-parser/early/a2f99303eecab290.js @@ -0,0 +1 @@ +switch(1) { case 2: var a; case 3: const a = 4; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a373aa14257bfb5d.module.js b/compiler/tests-js-parser/early/a373aa14257bfb5d.module.js new file mode 100644 index 000000000..8df1041a9 --- /dev/null +++ b/compiler/tests-js-parser/early/a373aa14257bfb5d.module.js @@ -0,0 +1 @@ +let a; export function a(){}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a3751f208965bf8b.js b/compiler/tests-js-parser/early/a3751f208965bf8b.js new file mode 100644 index 000000000..9c7ee274a --- /dev/null +++ b/compiler/tests-js-parser/early/a3751f208965bf8b.js @@ -0,0 +1 @@ +!{ a() { !function(a = super.b()){} } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a43f52eb198ba587.js b/compiler/tests-js-parser/early/a43f52eb198ba587.js new file mode 100644 index 000000000..d15515f78 --- /dev/null +++ b/compiler/tests-js-parser/early/a43f52eb198ba587.js @@ -0,0 +1 @@ +!{ *a(b) { let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a49630e381ef33c3.js b/compiler/tests-js-parser/early/a49630e381ef33c3.js new file mode 100644 index 000000000..84bbf56f7 --- /dev/null +++ b/compiler/tests-js-parser/early/a49630e381ef33c3.js @@ -0,0 +1 @@ +!{ a() { function* b(){ super.c(); } } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a4feba0316ea5fbd.js b/compiler/tests-js-parser/early/a4feba0316ea5fbd.js new file mode 100644 index 000000000..66e9ca452 --- /dev/null +++ b/compiler/tests-js-parser/early/a4feba0316ea5fbd.js @@ -0,0 +1 @@ +'use strict'; function* eval(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a610a46980d6cc37.js b/compiler/tests-js-parser/early/a610a46980d6cc37.js new file mode 100644 index 000000000..06a250b4b --- /dev/null +++ b/compiler/tests-js-parser/early/a610a46980d6cc37.js @@ -0,0 +1 @@ +try {} catch(a) { function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a622bc925508b963.js b/compiler/tests-js-parser/early/a622bc925508b963.js new file mode 100644 index 000000000..9edc64a62 --- /dev/null +++ b/compiler/tests-js-parser/early/a622bc925508b963.js @@ -0,0 +1 @@ +'use strict'; function a(eval){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a633b3217b5b8026.js b/compiler/tests-js-parser/early/a633b3217b5b8026.js new file mode 100644 index 000000000..e5d956d8f --- /dev/null +++ b/compiler/tests-js-parser/early/a633b3217b5b8026.js @@ -0,0 +1 @@ +({a} += 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a6d3c1f46877d8af.js b/compiler/tests-js-parser/early/a6d3c1f46877d8af.js new file mode 100644 index 000000000..d494a4138 --- /dev/null +++ b/compiler/tests-js-parser/early/a6d3c1f46877d8af.js @@ -0,0 +1 @@ +class a extends b { c() { !function(c = super.d()){} } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a75bfa84ae7ce2dc.js b/compiler/tests-js-parser/early/a75bfa84ae7ce2dc.js new file mode 100644 index 000000000..8a9bf32f1 --- /dev/null +++ b/compiler/tests-js-parser/early/a75bfa84ae7ce2dc.js @@ -0,0 +1 @@ +function a(eval) { "use strict"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/a7de7889cfb86fa0.js b/compiler/tests-js-parser/early/a7de7889cfb86fa0.js new file mode 100644 index 000000000..d69e96a48 --- /dev/null +++ b/compiler/tests-js-parser/early/a7de7889cfb86fa0.js @@ -0,0 +1 @@ +"use strict"; for (a of let) {} diff --git a/compiler/tests-js-parser/early/a87c5d5237b34393.module.js b/compiler/tests-js-parser/early/a87c5d5237b34393.module.js new file mode 100644 index 000000000..5ea90daa4 --- /dev/null +++ b/compiler/tests-js-parser/early/a87c5d5237b34393.module.js @@ -0,0 +1 @@ +export let a; export {a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/aa54b408d3785414.module.js b/compiler/tests-js-parser/early/aa54b408d3785414.module.js new file mode 100644 index 000000000..ba4af9e64 --- /dev/null +++ b/compiler/tests-js-parser/early/aa54b408d3785414.module.js @@ -0,0 +1 @@ +const a = 1; export class a {}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/aa796531364c9806.js b/compiler/tests-js-parser/early/aa796531364c9806.js new file mode 100644 index 000000000..458844cbe --- /dev/null +++ b/compiler/tests-js-parser/early/aa796531364c9806.js @@ -0,0 +1 @@ +for(let a;;) { var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/aa83e06a5ca45ef3.js b/compiler/tests-js-parser/early/aa83e06a5ca45ef3.js new file mode 100644 index 000000000..50b5aca93 --- /dev/null +++ b/compiler/tests-js-parser/early/aa83e06a5ca45ef3.js @@ -0,0 +1 @@ +"use strict"; function a() { yield } diff --git a/compiler/tests-js-parser/early/ab77450c1913d3e3.js b/compiler/tests-js-parser/early/ab77450c1913d3e3.js new file mode 100644 index 000000000..a6436ec54 --- /dev/null +++ b/compiler/tests-js-parser/early/ab77450c1913d3e3.js @@ -0,0 +1 @@ +a = { __proto__: 1, __proto__: 2 } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ab966c8708b47ed1.js b/compiler/tests-js-parser/early/ab966c8708b47ed1.js new file mode 100644 index 000000000..1e67c4c99 --- /dev/null +++ b/compiler/tests-js-parser/early/ab966c8708b47ed1.js @@ -0,0 +1 @@ +'use strict'; !function(a, a){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/abe07ddcc6b1cbc0.js b/compiler/tests-js-parser/early/abe07ddcc6b1cbc0.js new file mode 100644 index 000000000..0c998f364 --- /dev/null +++ b/compiler/tests-js-parser/early/abe07ddcc6b1cbc0.js @@ -0,0 +1 @@ +let x\u{61}, x\u{0061}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ac3921480b299e26.js b/compiler/tests-js-parser/early/ac3921480b299e26.js new file mode 100644 index 000000000..ed24ca007 --- /dev/null +++ b/compiler/tests-js-parser/early/ac3921480b299e26.js @@ -0,0 +1 @@ +switch(1) { case 2: const a = 3; default: var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ac3b4fb560d60fe6.js b/compiler/tests-js-parser/early/ac3b4fb560d60fe6.js new file mode 100644 index 000000000..d9da3c708 --- /dev/null +++ b/compiler/tests-js-parser/early/ac3b4fb560d60fe6.js @@ -0,0 +1 @@ +function* a(){ !function*(b = yield){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/aca2b59599b813df.js b/compiler/tests-js-parser/early/aca2b59599b813df.js new file mode 100644 index 000000000..18919a4d4 --- /dev/null +++ b/compiler/tests-js-parser/early/aca2b59599b813df.js @@ -0,0 +1 @@ +function* a(){ ([b = yield]) => 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/aca911e336954a5b.js b/compiler/tests-js-parser/early/aca911e336954a5b.js new file mode 100644 index 000000000..a2aafd29f --- /dev/null +++ b/compiler/tests-js-parser/early/aca911e336954a5b.js @@ -0,0 +1 @@ +("\u{110000}") \ No newline at end of file diff --git a/compiler/tests-js-parser/early/acb48ea96fde24d8.js b/compiler/tests-js-parser/early/acb48ea96fde24d8.js new file mode 100644 index 000000000..31f4100f5 --- /dev/null +++ b/compiler/tests-js-parser/early/acb48ea96fde24d8.js @@ -0,0 +1 @@ +class a { get constructor(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ad29dd84ee295f9d.js b/compiler/tests-js-parser/early/ad29dd84ee295f9d.js new file mode 100644 index 000000000..9cc8b6383 --- /dev/null +++ b/compiler/tests-js-parser/early/ad29dd84ee295f9d.js @@ -0,0 +1 @@ +{ const a = 1; let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ade5ef35ca93ebb2.js b/compiler/tests-js-parser/early/ade5ef35ca93ebb2.js new file mode 100644 index 000000000..4dcfd64a4 --- /dev/null +++ b/compiler/tests-js-parser/early/ade5ef35ca93ebb2.js @@ -0,0 +1 @@ +!{ get a() { 'use strict'; +let; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/aecc5068d346867a.js b/compiler/tests-js-parser/early/aecc5068d346867a.js new file mode 100644 index 000000000..65fd2ae01 --- /dev/null +++ b/compiler/tests-js-parser/early/aecc5068d346867a.js @@ -0,0 +1 @@ +{ let a; { var a; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/aee7ae9a9789061f.js b/compiler/tests-js-parser/early/aee7ae9a9789061f.js new file mode 100644 index 000000000..dd6662d1d --- /dev/null +++ b/compiler/tests-js-parser/early/aee7ae9a9789061f.js @@ -0,0 +1 @@ +function a(){ 'use strict'; function a(yield){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/af0c4685b25c36e9.js b/compiler/tests-js-parser/early/af0c4685b25c36e9.js new file mode 100644 index 000000000..9be621e23 --- /dev/null +++ b/compiler/tests-js-parser/early/af0c4685b25c36e9.js @@ -0,0 +1 @@ +class a extends b { constructor() { !function(){ super(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/afd80df2c284d9d7.js b/compiler/tests-js-parser/early/afd80df2c284d9d7.js new file mode 100644 index 000000000..ad0feafb4 --- /dev/null +++ b/compiler/tests-js-parser/early/afd80df2c284d9d7.js @@ -0,0 +1 @@ +a: if(1) continue a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b01e3a73a92863c5.js b/compiler/tests-js-parser/early/b01e3a73a92863c5.js new file mode 100644 index 000000000..32a7c201f --- /dev/null +++ b/compiler/tests-js-parser/early/b01e3a73a92863c5.js @@ -0,0 +1 @@ +!{ set a([b]){ let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b027ef7abbf9d70e.js b/compiler/tests-js-parser/early/b027ef7abbf9d70e.js new file mode 100644 index 000000000..9bd170156 --- /dev/null +++ b/compiler/tests-js-parser/early/b027ef7abbf9d70e.js @@ -0,0 +1 @@ +function a() { "use strict"; ({ b(c, c) { } }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b081584d076a029d.js b/compiler/tests-js-parser/early/b081584d076a029d.js new file mode 100644 index 000000000..96675efc6 --- /dev/null +++ b/compiler/tests-js-parser/early/b081584d076a029d.js @@ -0,0 +1 @@ +for(;;) b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b118f7ba23d3f8dd.module.js b/compiler/tests-js-parser/early/b118f7ba23d3f8dd.module.js new file mode 100644 index 000000000..81d5c0fb5 --- /dev/null +++ b/compiler/tests-js-parser/early/b118f7ba23d3f8dd.module.js @@ -0,0 +1 @@ +var a, b; export default a; export { b as default }; diff --git a/compiler/tests-js-parser/early/b12df210d46f08b7.js b/compiler/tests-js-parser/early/b12df210d46f08b7.js new file mode 100644 index 000000000..f7734c9a2 --- /dev/null +++ b/compiler/tests-js-parser/early/b12df210d46f08b7.js @@ -0,0 +1 @@ +"use strict"; try {} catch (yield) {} diff --git a/compiler/tests-js-parser/early/b13a72ca35327c5e.js b/compiler/tests-js-parser/early/b13a72ca35327c5e.js new file mode 100644 index 000000000..e97b183c1 --- /dev/null +++ b/compiler/tests-js-parser/early/b13a72ca35327c5e.js @@ -0,0 +1 @@ +'use strict'; [eval] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b1739a6a2bda8479.js b/compiler/tests-js-parser/early/b1739a6a2bda8479.js new file mode 100644 index 000000000..0028ccb5a --- /dev/null +++ b/compiler/tests-js-parser/early/b1739a6a2bda8479.js @@ -0,0 +1 @@ +"use strict"; ([yield] = a) diff --git a/compiler/tests-js-parser/early/b1fc7710d5fc4366.module.js b/compiler/tests-js-parser/early/b1fc7710d5fc4366.module.js new file mode 100644 index 000000000..af92ce632 --- /dev/null +++ b/compiler/tests-js-parser/early/b1fc7710d5fc4366.module.js @@ -0,0 +1 @@ +let a; export {a, a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b25c9a33c9fe3d70.js b/compiler/tests-js-parser/early/b25c9a33c9fe3d70.js new file mode 100644 index 000000000..ebf67215b --- /dev/null +++ b/compiler/tests-js-parser/early/b25c9a33c9fe3d70.js @@ -0,0 +1 @@ +class a extends b { constructor() { !{*constructor() { super(); }}; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b2dd410b65103d37.js b/compiler/tests-js-parser/early/b2dd410b65103d37.js new file mode 100644 index 000000000..ef6e8ae5c --- /dev/null +++ b/compiler/tests-js-parser/early/b2dd410b65103d37.js @@ -0,0 +1 @@ +'use strict'; ({a: eval} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b3dbc884256f809f.js b/compiler/tests-js-parser/early/b3dbc884256f809f.js new file mode 100644 index 000000000..089df67ca --- /dev/null +++ b/compiler/tests-js-parser/early/b3dbc884256f809f.js @@ -0,0 +1 @@ +'use strict'; +public; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b3fe185a3fd950fe.js b/compiler/tests-js-parser/early/b3fe185a3fd950fe.js new file mode 100644 index 000000000..fdec2717b --- /dev/null +++ b/compiler/tests-js-parser/early/b3fe185a3fd950fe.js @@ -0,0 +1 @@ +'use strict'; !function* arguments(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b42bfecaa9fae216.js b/compiler/tests-js-parser/early/b42bfecaa9fae216.js new file mode 100644 index 000000000..1f0a738e1 --- /dev/null +++ b/compiler/tests-js-parser/early/b42bfecaa9fae216.js @@ -0,0 +1 @@ +function a() { "use strict"; public = 1; } diff --git a/compiler/tests-js-parser/early/b436edeb7f28244b.js b/compiler/tests-js-parser/early/b436edeb7f28244b.js new file mode 100644 index 000000000..e7679fcd7 --- /dev/null +++ b/compiler/tests-js-parser/early/b436edeb7f28244b.js @@ -0,0 +1 @@ +function a() {'use strict'; arguments++; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b44d69c497ba8742.js b/compiler/tests-js-parser/early/b44d69c497ba8742.js new file mode 100644 index 000000000..5a3aa265a --- /dev/null +++ b/compiler/tests-js-parser/early/b44d69c497ba8742.js @@ -0,0 +1 @@ +!{ *a(eval){ 'use strict'; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b4639f2d0e68597c.js b/compiler/tests-js-parser/early/b4639f2d0e68597c.js new file mode 100644 index 000000000..e6ac900d0 --- /dev/null +++ b/compiler/tests-js-parser/early/b4639f2d0e68597c.js @@ -0,0 +1 @@ +function a() {'use strict'; var eval = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b4994b656f8c8e75.js b/compiler/tests-js-parser/early/b4994b656f8c8e75.js new file mode 100644 index 000000000..f6cd5e507 --- /dev/null +++ b/compiler/tests-js-parser/early/b4994b656f8c8e75.js @@ -0,0 +1 @@ +let x\u{E01D5}, x󠇕; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b4cac065cfcbc658.js b/compiler/tests-js-parser/early/b4cac065cfcbc658.js new file mode 100644 index 000000000..9a927d87b --- /dev/null +++ b/compiler/tests-js-parser/early/b4cac065cfcbc658.js @@ -0,0 +1 @@ +({a: 0} = 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b4cf1c141b7a40ba.js b/compiler/tests-js-parser/early/b4cf1c141b7a40ba.js new file mode 100644 index 000000000..0b46712e2 --- /dev/null +++ b/compiler/tests-js-parser/early/b4cf1c141b7a40ba.js @@ -0,0 +1 @@ +function a() { "use strict"; function b(c, c) { }; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b539d81720945922.js b/compiler/tests-js-parser/early/b539d81720945922.js new file mode 100644 index 000000000..184aa4431 --- /dev/null +++ b/compiler/tests-js-parser/early/b539d81720945922.js @@ -0,0 +1 @@ +const let diff --git a/compiler/tests-js-parser/early/b54a26f97b626bfb.js b/compiler/tests-js-parser/early/b54a26f97b626bfb.js new file mode 100644 index 000000000..744a3e85d --- /dev/null +++ b/compiler/tests-js-parser/early/b54a26f97b626bfb.js @@ -0,0 +1 @@ +!function(a){ super.b } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b5933f8db416872d.js b/compiler/tests-js-parser/early/b5933f8db416872d.js new file mode 100644 index 000000000..ad926088d --- /dev/null +++ b/compiler/tests-js-parser/early/b5933f8db416872d.js @@ -0,0 +1 @@ +function* a(){ ({ *b(c = yield* d){} }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b674947be42ad087.js b/compiler/tests-js-parser/early/b674947be42ad087.js new file mode 100644 index 000000000..81ccdb305 --- /dev/null +++ b/compiler/tests-js-parser/early/b674947be42ad087.js @@ -0,0 +1 @@ +function a() {'use strict'; ({ set b(eval) { } }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b688b7f0231f59d0.js b/compiler/tests-js-parser/early/b688b7f0231f59d0.js new file mode 100644 index 000000000..dd63521ae --- /dev/null +++ b/compiler/tests-js-parser/early/b688b7f0231f59d0.js @@ -0,0 +1 @@ +for(a of b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b6a72a718cb7ca67.js b/compiler/tests-js-parser/early/b6a72a718cb7ca67.js new file mode 100644 index 000000000..0d0c6dde2 --- /dev/null +++ b/compiler/tests-js-parser/early/b6a72a718cb7ca67.js @@ -0,0 +1 @@ +({ a = 0 }); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/b8a915136484b7c6.js b/compiler/tests-js-parser/early/b8a915136484b7c6.js new file mode 100644 index 000000000..cffb82d40 --- /dev/null +++ b/compiler/tests-js-parser/early/b8a915136484b7c6.js @@ -0,0 +1 @@ +(function ([]){'use strict';}) diff --git a/compiler/tests-js-parser/early/b91738534d58ec37.js b/compiler/tests-js-parser/early/b91738534d58ec37.js new file mode 100644 index 000000000..1a4fde366 --- /dev/null +++ b/compiler/tests-js-parser/early/b91738534d58ec37.js @@ -0,0 +1 @@ +function* a(){ ({ *b([c = yield]){} }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ba2bfa1952f3e537.module.js b/compiler/tests-js-parser/early/ba2bfa1952f3e537.module.js new file mode 100644 index 000000000..ac92345f0 --- /dev/null +++ b/compiler/tests-js-parser/early/ba2bfa1952f3e537.module.js @@ -0,0 +1 @@ +export {a as default, b}; diff --git a/compiler/tests-js-parser/early/bbeec25d16a55b8c.js b/compiler/tests-js-parser/early/bbeec25d16a55b8c.js new file mode 100644 index 000000000..b92a6713f --- /dev/null +++ b/compiler/tests-js-parser/early/bbeec25d16a55b8c.js @@ -0,0 +1 @@ +'use strict'; !function* (eval){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/bc04ce895077f312.js b/compiler/tests-js-parser/early/bc04ce895077f312.js new file mode 100644 index 000000000..5fec95c5b --- /dev/null +++ b/compiler/tests-js-parser/early/bc04ce895077f312.js @@ -0,0 +1 @@ +'use strict'; ({arguments} = 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/bd0a88a0f6b9250e.js b/compiler/tests-js-parser/early/bd0a88a0f6b9250e.js new file mode 100644 index 000000000..7c6492df1 --- /dev/null +++ b/compiler/tests-js-parser/early/bd0a88a0f6b9250e.js @@ -0,0 +1 @@ +for(({a: 0}) of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/bd320eba790d65a4.js b/compiler/tests-js-parser/early/bd320eba790d65a4.js new file mode 100644 index 000000000..2ce319ca0 --- /dev/null +++ b/compiler/tests-js-parser/early/bd320eba790d65a4.js @@ -0,0 +1 @@ +function a([]){'use strict';} diff --git a/compiler/tests-js-parser/early/bd6d1e619ecd12e3.js b/compiler/tests-js-parser/early/bd6d1e619ecd12e3.js new file mode 100644 index 000000000..d983a5974 --- /dev/null +++ b/compiler/tests-js-parser/early/bd6d1e619ecd12e3.js @@ -0,0 +1 @@ +switch(1) { default: var a; case 2: let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/be7329119eaa3d47.js b/compiler/tests-js-parser/early/be7329119eaa3d47.js new file mode 100644 index 000000000..9e4882290 --- /dev/null +++ b/compiler/tests-js-parser/early/be7329119eaa3d47.js @@ -0,0 +1,11 @@ +(function () { + { + function a() { + b.c('d'); + } + function a() { + b.c('e'); + } + a(); + } +}()); diff --git a/compiler/tests-js-parser/early/c0044f28f0620a60.js b/compiler/tests-js-parser/early/c0044f28f0620a60.js new file mode 100644 index 000000000..1c7fe54ac --- /dev/null +++ b/compiler/tests-js-parser/early/c0044f28f0620a60.js @@ -0,0 +1 @@ +!function a(b = super[1]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c020a8b89b508036.js b/compiler/tests-js-parser/early/c020a8b89b508036.js new file mode 100644 index 000000000..78f397a44 --- /dev/null +++ b/compiler/tests-js-parser/early/c020a8b89b508036.js @@ -0,0 +1 @@ +function *a() { (b = yield) => {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c06b30c34a3a7e5b.js b/compiler/tests-js-parser/early/c06b30c34a3a7e5b.js new file mode 100644 index 000000000..0312fcb99 --- /dev/null +++ b/compiler/tests-js-parser/early/c06b30c34a3a7e5b.js @@ -0,0 +1 @@ +'use strict'; +package; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c06fd9680b078c2c.js b/compiler/tests-js-parser/early/c06fd9680b078c2c.js new file mode 100644 index 000000000..49c52ba34 --- /dev/null +++ b/compiler/tests-js-parser/early/c06fd9680b078c2c.js @@ -0,0 +1 @@ +'use strict'; if (1) function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c0de4c602bee2121.js b/compiler/tests-js-parser/early/c0de4c602bee2121.js new file mode 100644 index 000000000..8d0da7221 --- /dev/null +++ b/compiler/tests-js-parser/early/c0de4c602bee2121.js @@ -0,0 +1 @@ +function *a() { (b = yield) => {} } diff --git a/compiler/tests-js-parser/early/c0e83f0bd56db14e.module.js b/compiler/tests-js-parser/early/c0e83f0bd56db14e.module.js new file mode 100644 index 000000000..215871b74 --- /dev/null +++ b/compiler/tests-js-parser/early/c0e83f0bd56db14e.module.js @@ -0,0 +1 @@ +const a = 1; export function a(){}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c211e5a7799f20ad.js b/compiler/tests-js-parser/early/c211e5a7799f20ad.js new file mode 100644 index 000000000..2d94903b2 --- /dev/null +++ b/compiler/tests-js-parser/early/c211e5a7799f20ad.js @@ -0,0 +1 @@ +function a(b, b) {'use strict';} diff --git a/compiler/tests-js-parser/early/c33da51b85893244.module.js b/compiler/tests-js-parser/early/c33da51b85893244.module.js new file mode 100644 index 000000000..e180f0727 --- /dev/null +++ b/compiler/tests-js-parser/early/c33da51b85893244.module.js @@ -0,0 +1 @@ +export { a, b } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c388f44fecc314f8.js b/compiler/tests-js-parser/early/c388f44fecc314f8.js new file mode 100644 index 000000000..f7ca67407 --- /dev/null +++ b/compiler/tests-js-parser/early/c388f44fecc314f8.js @@ -0,0 +1 @@ +var a; let a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c3928e48a7a4a6e6.js b/compiler/tests-js-parser/early/c3928e48a7a4a6e6.js new file mode 100644 index 000000000..b10eb3c63 --- /dev/null +++ b/compiler/tests-js-parser/early/c3928e48a7a4a6e6.js @@ -0,0 +1 @@ +a: while(1) !function(){ continue a; }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c43fab38afd5044c.js b/compiler/tests-js-parser/early/c43fab38afd5044c.js new file mode 100644 index 000000000..a749f2343 --- /dev/null +++ b/compiler/tests-js-parser/early/c43fab38afd5044c.js @@ -0,0 +1 @@ +'use strict'; [...eval] = a \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c4e665091d299228.js b/compiler/tests-js-parser/early/c4e665091d299228.js new file mode 100644 index 000000000..2764b55e5 --- /dev/null +++ b/compiler/tests-js-parser/early/c4e665091d299228.js @@ -0,0 +1 @@ +b: while(1) continue a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c54830397bdd2597.js b/compiler/tests-js-parser/early/c54830397bdd2597.js new file mode 100644 index 000000000..cbbc5583b --- /dev/null +++ b/compiler/tests-js-parser/early/c54830397bdd2597.js @@ -0,0 +1 @@ +for(const a in b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c570b0dab9ed058c.js b/compiler/tests-js-parser/early/c570b0dab9ed058c.js new file mode 100644 index 000000000..de67221ff --- /dev/null +++ b/compiler/tests-js-parser/early/c570b0dab9ed058c.js @@ -0,0 +1 @@ +class a extends b { constructor() { function* c(){ super(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c5cd9ca53df14944.js b/compiler/tests-js-parser/early/c5cd9ca53df14944.js new file mode 100644 index 000000000..db2743c83 --- /dev/null +++ b/compiler/tests-js-parser/early/c5cd9ca53df14944.js @@ -0,0 +1 @@ +function a() { "use strict"; static = 1; } diff --git a/compiler/tests-js-parser/early/c5e8b0c5093b4520.js b/compiler/tests-js-parser/early/c5e8b0c5093b4520.js new file mode 100644 index 000000000..864f90458 --- /dev/null +++ b/compiler/tests-js-parser/early/c5e8b0c5093b4520.js @@ -0,0 +1 @@ +class a extends b { c() { function d(c = super.e()){} } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c635335476821654.js b/compiler/tests-js-parser/early/c635335476821654.js new file mode 100644 index 000000000..12b6e435a --- /dev/null +++ b/compiler/tests-js-parser/early/c635335476821654.js @@ -0,0 +1 @@ +(function () { 'use strict'; with (a); }()) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c64846422c8fcb25.js b/compiler/tests-js-parser/early/c64846422c8fcb25.js new file mode 100644 index 000000000..4c1606b44 --- /dev/null +++ b/compiler/tests-js-parser/early/c64846422c8fcb25.js @@ -0,0 +1 @@ +for(let a of 1) { var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c76e17a417f486e6.js b/compiler/tests-js-parser/early/c76e17a417f486e6.js new file mode 100644 index 000000000..33e286e15 --- /dev/null +++ b/compiler/tests-js-parser/early/c76e17a417f486e6.js @@ -0,0 +1 @@ +'use strict'; (eval)=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c82fcf7c29e24b40.module.js b/compiler/tests-js-parser/early/c82fcf7c29e24b40.module.js new file mode 100644 index 000000000..7d87022df --- /dev/null +++ b/compiler/tests-js-parser/early/c82fcf7c29e24b40.module.js @@ -0,0 +1 @@ +import {a, a} from "module"; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c9276d58d3d3ccab.js b/compiler/tests-js-parser/early/c9276d58d3d3ccab.js new file mode 100644 index 000000000..70b4c4cf0 --- /dev/null +++ b/compiler/tests-js-parser/early/c9276d58d3d3ccab.js @@ -0,0 +1 @@ +function a() {'use strict'; var arguments = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/c9566d6dccc93ae5.js b/compiler/tests-js-parser/early/c9566d6dccc93ae5.js new file mode 100644 index 000000000..f114a3093 --- /dev/null +++ b/compiler/tests-js-parser/early/c9566d6dccc93ae5.js @@ -0,0 +1 @@ +/./a \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ca1a07cb97d0e4df.js b/compiler/tests-js-parser/early/ca1a07cb97d0e4df.js new file mode 100644 index 000000000..5adfd157b --- /dev/null +++ b/compiler/tests-js-parser/early/ca1a07cb97d0e4df.js @@ -0,0 +1 @@ +class a { static b([c, c]){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cb47e724cbcd94f0.js b/compiler/tests-js-parser/early/cb47e724cbcd94f0.js new file mode 100644 index 000000000..650fb9f99 --- /dev/null +++ b/compiler/tests-js-parser/early/cb47e724cbcd94f0.js @@ -0,0 +1 @@ +!function a(){ let b; var b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cbc725ff1936ca38.js b/compiler/tests-js-parser/early/cbc725ff1936ca38.js new file mode 100644 index 000000000..4f430b9e1 --- /dev/null +++ b/compiler/tests-js-parser/early/cbc725ff1936ca38.js @@ -0,0 +1 @@ +"use strict"; (yield) => 1 diff --git a/compiler/tests-js-parser/early/cc0122b6d261427b.js b/compiler/tests-js-parser/early/cc0122b6d261427b.js new file mode 100644 index 000000000..be94b2400 --- /dev/null +++ b/compiler/tests-js-parser/early/cc0122b6d261427b.js @@ -0,0 +1 @@ +({ "__proto__": null, '__proto__': null }) diff --git a/compiler/tests-js-parser/early/cc23480bdd763207.js b/compiler/tests-js-parser/early/cc23480bdd763207.js new file mode 100644 index 000000000..7e44b674b --- /dev/null +++ b/compiler/tests-js-parser/early/cc23480bdd763207.js @@ -0,0 +1 @@ +([a]) => { let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cc3a712aaffdd07f.js b/compiler/tests-js-parser/early/cc3a712aaffdd07f.js new file mode 100644 index 000000000..293bb4db0 --- /dev/null +++ b/compiler/tests-js-parser/early/cc3a712aaffdd07f.js @@ -0,0 +1 @@ +function a(arguments) {'use strict';} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cc5d77c28734dad8.js b/compiler/tests-js-parser/early/cc5d77c28734dad8.js new file mode 100644 index 000000000..bfeaf63ec --- /dev/null +++ b/compiler/tests-js-parser/early/cc5d77c28734dad8.js @@ -0,0 +1 @@ +({ a(){ {{ if(1) (( super() )); }} } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cc698af08b56cb84.js b/compiler/tests-js-parser/early/cc698af08b56cb84.js new file mode 100644 index 000000000..8a2b8008a --- /dev/null +++ b/compiler/tests-js-parser/early/cc698af08b56cb84.js @@ -0,0 +1 @@ +"use strict"; const let = 1; diff --git a/compiler/tests-js-parser/early/cc77a54f02cbc1ba.js b/compiler/tests-js-parser/early/cc77a54f02cbc1ba.js new file mode 100644 index 000000000..91ceea141 --- /dev/null +++ b/compiler/tests-js-parser/early/cc77a54f02cbc1ba.js @@ -0,0 +1 @@ +var a; const a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ccecca0820018fef.js b/compiler/tests-js-parser/early/ccecca0820018fef.js new file mode 100644 index 000000000..860cafa48 --- /dev/null +++ b/compiler/tests-js-parser/early/ccecca0820018fef.js @@ -0,0 +1 @@ +function a([], []) {'use strict';} diff --git a/compiler/tests-js-parser/early/cceeb8a91dca0d83.js b/compiler/tests-js-parser/early/cceeb8a91dca0d83.js new file mode 100644 index 000000000..a31de66ff --- /dev/null +++ b/compiler/tests-js-parser/early/cceeb8a91dca0d83.js @@ -0,0 +1 @@ +'use strict'; const {a: eval} = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cd3c00f9eeb4236e.js b/compiler/tests-js-parser/early/cd3c00f9eeb4236e.js new file mode 100644 index 000000000..f5cf2e079 --- /dev/null +++ b/compiler/tests-js-parser/early/cd3c00f9eeb4236e.js @@ -0,0 +1 @@ +function a() { "use strict"; var public; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cda71bae4a1561f6.js b/compiler/tests-js-parser/early/cda71bae4a1561f6.js new file mode 100644 index 000000000..09007b2bb --- /dev/null +++ b/compiler/tests-js-parser/early/cda71bae4a1561f6.js @@ -0,0 +1 @@ +function a(b){ super() } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cdceb01cec39f8d0.js b/compiler/tests-js-parser/early/cdceb01cec39f8d0.js new file mode 100644 index 000000000..d0f852a2d --- /dev/null +++ b/compiler/tests-js-parser/early/cdceb01cec39f8d0.js @@ -0,0 +1 @@ +try {} catch ({a = 1, b: a}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cdea3406c440ecf3.js b/compiler/tests-js-parser/early/cdea3406c440ecf3.js new file mode 100644 index 000000000..6f5ed1c53 --- /dev/null +++ b/compiler/tests-js-parser/early/cdea3406c440ecf3.js @@ -0,0 +1 @@ +({a(b){}} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cf09b247aab59934.js b/compiler/tests-js-parser/early/cf09b247aab59934.js new file mode 100644 index 000000000..683fab976 --- /dev/null +++ b/compiler/tests-js-parser/early/cf09b247aab59934.js @@ -0,0 +1 @@ +function a(b){ const b = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cf4ec8205001e331.js b/compiler/tests-js-parser/early/cf4ec8205001e331.js new file mode 100644 index 000000000..28dc3189f --- /dev/null +++ b/compiler/tests-js-parser/early/cf4ec8205001e331.js @@ -0,0 +1 @@ +for(var a;;) c: function b(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cf6241d836f7f9b1.js b/compiler/tests-js-parser/early/cf6241d836f7f9b1.js new file mode 100644 index 000000000..d6f166141 --- /dev/null +++ b/compiler/tests-js-parser/early/cf6241d836f7f9b1.js @@ -0,0 +1 @@ +([let]) => {'use strict'} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/cfb0ed6955efa22f.js b/compiler/tests-js-parser/early/cfb0ed6955efa22f.js new file mode 100644 index 000000000..d55a4ebf5 --- /dev/null +++ b/compiler/tests-js-parser/early/cfb0ed6955efa22f.js @@ -0,0 +1 @@ +!{ set a(b){ let c; var c; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d008c8cd68d4446e.js b/compiler/tests-js-parser/early/d008c8cd68d4446e.js new file mode 100644 index 000000000..eefb75f52 --- /dev/null +++ b/compiler/tests-js-parser/early/d008c8cd68d4446e.js @@ -0,0 +1 @@ +a\u{0} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d04b86fdb653529a.js b/compiler/tests-js-parser/early/d04b86fdb653529a.js new file mode 100644 index 000000000..56bb95ccb --- /dev/null +++ b/compiler/tests-js-parser/early/d04b86fdb653529a.js @@ -0,0 +1 @@ +'use strict'; +let; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d04e69bc307eada0.js b/compiler/tests-js-parser/early/d04e69bc307eada0.js new file mode 100644 index 000000000..d1fb6715c --- /dev/null +++ b/compiler/tests-js-parser/early/d04e69bc307eada0.js @@ -0,0 +1 @@ +'use strict'; function* arguments(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d070112b8eb9781e.module.js b/compiler/tests-js-parser/early/d070112b8eb9781e.module.js new file mode 100644 index 000000000..43de33aec --- /dev/null +++ b/compiler/tests-js-parser/early/d070112b8eb9781e.module.js @@ -0,0 +1 @@ +export {a as b}; diff --git a/compiler/tests-js-parser/early/d08e667cbd73912f.js b/compiler/tests-js-parser/early/d08e667cbd73912f.js new file mode 100644 index 000000000..74dda02c6 --- /dev/null +++ b/compiler/tests-js-parser/early/d08e667cbd73912f.js @@ -0,0 +1 @@ +(a, a) => 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d0b47c964e36292c.js b/compiler/tests-js-parser/early/d0b47c964e36292c.js new file mode 100644 index 000000000..b3feb3585 --- /dev/null +++ b/compiler/tests-js-parser/early/d0b47c964e36292c.js @@ -0,0 +1 @@ +function a() { "use strict"; let = 1; } diff --git a/compiler/tests-js-parser/early/d13906312520166c.js b/compiler/tests-js-parser/early/d13906312520166c.js new file mode 100644 index 000000000..bb694b80f --- /dev/null +++ b/compiler/tests-js-parser/early/d13906312520166c.js @@ -0,0 +1 @@ +function a() { "use strict"; var protected; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d13bc7b3ba9144d3.js b/compiler/tests-js-parser/early/d13bc7b3ba9144d3.js new file mode 100644 index 000000000..9c7580531 --- /dev/null +++ b/compiler/tests-js-parser/early/d13bc7b3ba9144d3.js @@ -0,0 +1 @@ +function a() {'use strict'; try { } catch (eval) { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d1779a4749085a10.js b/compiler/tests-js-parser/early/d1779a4749085a10.js new file mode 100644 index 000000000..f0f7f2cbf --- /dev/null +++ b/compiler/tests-js-parser/early/d1779a4749085a10.js @@ -0,0 +1 @@ +!{ a([b]){ let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d17c5f9623ec3a71.js b/compiler/tests-js-parser/early/d17c5f9623ec3a71.js new file mode 100644 index 000000000..9a8256ab9 --- /dev/null +++ b/compiler/tests-js-parser/early/d17c5f9623ec3a71.js @@ -0,0 +1 @@ +function* a(eval){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d21fe40ced010372.js b/compiler/tests-js-parser/early/d21fe40ced010372.js new file mode 100644 index 000000000..5f9d22f2c --- /dev/null +++ b/compiler/tests-js-parser/early/d21fe40ced010372.js @@ -0,0 +1 @@ +{ let a; function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d24da3566d2ff712.js b/compiler/tests-js-parser/early/d24da3566d2ff712.js new file mode 100644 index 000000000..d75d2fc95 --- /dev/null +++ b/compiler/tests-js-parser/early/d24da3566d2ff712.js @@ -0,0 +1 @@ +const a = 1, a = 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d29b223bd410cace.js b/compiler/tests-js-parser/early/d29b223bd410cace.js new file mode 100644 index 000000000..fe4a21fe6 --- /dev/null +++ b/compiler/tests-js-parser/early/d29b223bd410cace.js @@ -0,0 +1 @@ +!function(a){ const a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d32d2f1285789b8e.js b/compiler/tests-js-parser/early/d32d2f1285789b8e.js new file mode 100644 index 000000000..bf15391c1 --- /dev/null +++ b/compiler/tests-js-parser/early/d32d2f1285789b8e.js @@ -0,0 +1 @@ +new.target \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d33299b545e367a3.js b/compiler/tests-js-parser/early/d33299b545e367a3.js new file mode 100644 index 000000000..c82f3cc8d --- /dev/null +++ b/compiler/tests-js-parser/early/d33299b545e367a3.js @@ -0,0 +1 @@ +class a extends b { constructor() { !{set constructor(c) { super(); }}; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d33fac4370fa022c.js b/compiler/tests-js-parser/early/d33fac4370fa022c.js new file mode 100644 index 000000000..3c16f56f4 --- /dev/null +++ b/compiler/tests-js-parser/early/d33fac4370fa022c.js @@ -0,0 +1 @@ +!{ a(b, b){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d412cecc75edd30d.js b/compiler/tests-js-parser/early/d412cecc75edd30d.js new file mode 100644 index 000000000..e94cadfcc --- /dev/null +++ b/compiler/tests-js-parser/early/d412cecc75edd30d.js @@ -0,0 +1 @@ +!{ set a({b}){ let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d4a13233c92786fc.js b/compiler/tests-js-parser/early/d4a13233c92786fc.js new file mode 100644 index 000000000..aa63d0e70 --- /dev/null +++ b/compiler/tests-js-parser/early/d4a13233c92786fc.js @@ -0,0 +1 @@ +switch(1) { default: function a(){ break; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d4cca3fe80995f12.js b/compiler/tests-js-parser/early/d4cca3fe80995f12.js new file mode 100644 index 000000000..a641cf218 --- /dev/null +++ b/compiler/tests-js-parser/early/d4cca3fe80995f12.js @@ -0,0 +1 @@ +!{ __proto__: null, __proto__: null, }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d52f769ab39372c7.js b/compiler/tests-js-parser/early/d52f769ab39372c7.js new file mode 100644 index 000000000..3c63f3130 --- /dev/null +++ b/compiler/tests-js-parser/early/d52f769ab39372c7.js @@ -0,0 +1 @@ +/./\u{69} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d61a5bab4b0e2467.js b/compiler/tests-js-parser/early/d61a5bab4b0e2467.js new file mode 100644 index 000000000..534e4aac2 --- /dev/null +++ b/compiler/tests-js-parser/early/d61a5bab4b0e2467.js @@ -0,0 +1 @@ +class a { set b(eval){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d6750f33acde1f15.js b/compiler/tests-js-parser/early/d6750f33acde1f15.js new file mode 100644 index 000000000..f79c874c3 --- /dev/null +++ b/compiler/tests-js-parser/early/d6750f33acde1f15.js @@ -0,0 +1 @@ +function a() {'use strict'; ++eval; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d6828a45cebf554c.js b/compiler/tests-js-parser/early/d6828a45cebf554c.js new file mode 100644 index 000000000..476671682 --- /dev/null +++ b/compiler/tests-js-parser/early/d6828a45cebf554c.js @@ -0,0 +1 @@ +(eval) => { "use strict"; 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d74cf547da723dcb.js b/compiler/tests-js-parser/early/d74cf547da723dcb.js new file mode 100644 index 000000000..85821bb1e --- /dev/null +++ b/compiler/tests-js-parser/early/d74cf547da723dcb.js @@ -0,0 +1 @@ +function a() {'use strict'; eval++; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d756882da49b5122.js b/compiler/tests-js-parser/early/d756882da49b5122.js new file mode 100644 index 000000000..6e56843c0 --- /dev/null +++ b/compiler/tests-js-parser/early/d756882da49b5122.js @@ -0,0 +1 @@ +class a extends b { constructor() { !function(c = super()){} } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d76a6ab8347fca64.js b/compiler/tests-js-parser/early/d76a6ab8347fca64.js new file mode 100644 index 000000000..04fee6c1e --- /dev/null +++ b/compiler/tests-js-parser/early/d76a6ab8347fca64.js @@ -0,0 +1 @@ +class a {constructor(){} "constructor"(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d868cb3eba295d1c.js b/compiler/tests-js-parser/early/d868cb3eba295d1c.js new file mode 100644 index 000000000..3a79ac40a --- /dev/null +++ b/compiler/tests-js-parser/early/d868cb3eba295d1c.js @@ -0,0 +1 @@ +for(var a in b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d880e8e678023e20.js b/compiler/tests-js-parser/early/d880e8e678023e20.js new file mode 100644 index 000000000..05e4ded2c --- /dev/null +++ b/compiler/tests-js-parser/early/d880e8e678023e20.js @@ -0,0 +1 @@ +"use strict"; (class a {constructor() { super() }}) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/d92beccacbf5218c.js b/compiler/tests-js-parser/early/d92beccacbf5218c.js new file mode 100644 index 000000000..053df41a3 --- /dev/null +++ b/compiler/tests-js-parser/early/d92beccacbf5218c.js @@ -0,0 +1 @@ +!{ *a(b = super()){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/da27232e999248dc.js b/compiler/tests-js-parser/early/da27232e999248dc.js new file mode 100644 index 000000000..c8e7b5193 --- /dev/null +++ b/compiler/tests-js-parser/early/da27232e999248dc.js @@ -0,0 +1 @@ +"use strict"; function *a() { var b = function(yield) {} } diff --git a/compiler/tests-js-parser/early/da9203fbbc024397.js b/compiler/tests-js-parser/early/da9203fbbc024397.js new file mode 100644 index 000000000..290f01db3 --- /dev/null +++ b/compiler/tests-js-parser/early/da9203fbbc024397.js @@ -0,0 +1 @@ +class a extends b { c() { !function(){ super.d(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/dac98d6ccccd4b3e.js b/compiler/tests-js-parser/early/dac98d6ccccd4b3e.js new file mode 100644 index 000000000..ec518e82d --- /dev/null +++ b/compiler/tests-js-parser/early/dac98d6ccccd4b3e.js @@ -0,0 +1 @@ +const a = 1; var a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/db85c599bd0e1e91.js b/compiler/tests-js-parser/early/db85c599bd0e1e91.js new file mode 100644 index 000000000..cd9321b74 --- /dev/null +++ b/compiler/tests-js-parser/early/db85c599bd0e1e91.js @@ -0,0 +1 @@ +function a(){ b: if(1) b: ; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/dbdab36f976e9905.js b/compiler/tests-js-parser/early/dbdab36f976e9905.js new file mode 100644 index 000000000..0999f7943 --- /dev/null +++ b/compiler/tests-js-parser/early/dbdab36f976e9905.js @@ -0,0 +1 @@ +const a = 1; const a = 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ddd7c5ab222b3285.js b/compiler/tests-js-parser/early/ddd7c5ab222b3285.js new file mode 100644 index 000000000..93b0368db --- /dev/null +++ b/compiler/tests-js-parser/early/ddd7c5ab222b3285.js @@ -0,0 +1 @@ +(a, a) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/dde0f3b68ee88398.js b/compiler/tests-js-parser/early/dde0f3b68ee88398.js new file mode 100644 index 000000000..5d3ce53ff --- /dev/null +++ b/compiler/tests-js-parser/early/dde0f3b68ee88398.js @@ -0,0 +1 @@ +function a(b = super()){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/de07a50e8f528926.js b/compiler/tests-js-parser/early/de07a50e8f528926.js new file mode 100644 index 000000000..67bdf9745 --- /dev/null +++ b/compiler/tests-js-parser/early/de07a50e8f528926.js @@ -0,0 +1 @@ +function a({yield}){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/de0aaffe8b70483c.js b/compiler/tests-js-parser/early/de0aaffe8b70483c.js new file mode 100644 index 000000000..e8947e0af --- /dev/null +++ b/compiler/tests-js-parser/early/de0aaffe8b70483c.js @@ -0,0 +1 @@ +function* a(){ function* b(c = yield* d){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/de9d9a6cd61407f5.js b/compiler/tests-js-parser/early/de9d9a6cd61407f5.js new file mode 100644 index 000000000..ffc842416 --- /dev/null +++ b/compiler/tests-js-parser/early/de9d9a6cd61407f5.js @@ -0,0 +1 @@ +(function a(b, b) { "use strict"; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/deb13a470cb01aab.js b/compiler/tests-js-parser/early/deb13a470cb01aab.js new file mode 100644 index 000000000..1f054d6e5 --- /dev/null +++ b/compiler/tests-js-parser/early/deb13a470cb01aab.js @@ -0,0 +1 @@ +class a { static b(){ let c; var c; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/df5916fa5c0c159e.js b/compiler/tests-js-parser/early/df5916fa5c0c159e.js new file mode 100644 index 000000000..3c589bf66 --- /dev/null +++ b/compiler/tests-js-parser/early/df5916fa5c0c159e.js @@ -0,0 +1 @@ +"use strict"; (eval = 1) => 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/df5d2ef379b00ca6.js b/compiler/tests-js-parser/early/df5d2ef379b00ca6.js new file mode 100644 index 000000000..46715a217 --- /dev/null +++ b/compiler/tests-js-parser/early/df5d2ef379b00ca6.js @@ -0,0 +1 @@ +'use strict'; ({arguments = 1} = 2); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/df84c672bf74a63c.js b/compiler/tests-js-parser/early/df84c672bf74a63c.js new file mode 100644 index 000000000..bce7b5a78 --- /dev/null +++ b/compiler/tests-js-parser/early/df84c672bf74a63c.js @@ -0,0 +1 @@ +{ const a = 1; var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e0bcfb63cbe11c82.js b/compiler/tests-js-parser/early/e0bcfb63cbe11c82.js new file mode 100644 index 000000000..4fe06e205 --- /dev/null +++ b/compiler/tests-js-parser/early/e0bcfb63cbe11c82.js @@ -0,0 +1 @@ +'use strict'; let + 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e0c3d30b6fe96812.js b/compiler/tests-js-parser/early/e0c3d30b6fe96812.js new file mode 100644 index 000000000..02d8601f7 --- /dev/null +++ b/compiler/tests-js-parser/early/e0c3d30b6fe96812.js @@ -0,0 +1 @@ +function static() { "use strict"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e1831477442a7ebf.js b/compiler/tests-js-parser/early/e1831477442a7ebf.js new file mode 100644 index 000000000..21ec0ac6a --- /dev/null +++ b/compiler/tests-js-parser/early/e1831477442a7ebf.js @@ -0,0 +1 @@ +!{ *a({b}){ let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e1837613ba157085.module.js b/compiler/tests-js-parser/early/e1837613ba157085.module.js new file mode 100644 index 000000000..94358ec97 --- /dev/null +++ b/compiler/tests-js-parser/early/e1837613ba157085.module.js @@ -0,0 +1 @@ +let a; export default class a {}; diff --git a/compiler/tests-js-parser/early/e1c728c287d43ca5.js b/compiler/tests-js-parser/early/e1c728c287d43ca5.js new file mode 100644 index 000000000..925f162df --- /dev/null +++ b/compiler/tests-js-parser/early/e1c728c287d43ca5.js @@ -0,0 +1 @@ +() => { let a; var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e2430bb781d34c21.js b/compiler/tests-js-parser/early/e2430bb781d34c21.js new file mode 100644 index 000000000..6be6547ed --- /dev/null +++ b/compiler/tests-js-parser/early/e2430bb781d34c21.js @@ -0,0 +1 @@ +!function* (eval){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e251aff584fd427f.js b/compiler/tests-js-parser/early/e251aff584fd427f.js new file mode 100644 index 000000000..59cd0c8ea --- /dev/null +++ b/compiler/tests-js-parser/early/e251aff584fd427f.js @@ -0,0 +1 @@ +function a() {'use strict'; eval--; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e2561dd1e2736bfd.js b/compiler/tests-js-parser/early/e2561dd1e2736bfd.js new file mode 100644 index 000000000..0352b0247 --- /dev/null +++ b/compiler/tests-js-parser/early/e2561dd1e2736bfd.js @@ -0,0 +1 @@ +!function(a = super()){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e256ee8e7aff6957.js b/compiler/tests-js-parser/early/e256ee8e7aff6957.js new file mode 100644 index 000000000..b2960313c --- /dev/null +++ b/compiler/tests-js-parser/early/e256ee8e7aff6957.js @@ -0,0 +1 @@ +continue \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e25b19185b3988dc.js b/compiler/tests-js-parser/early/e25b19185b3988dc.js new file mode 100644 index 000000000..9f2f5bc05 --- /dev/null +++ b/compiler/tests-js-parser/early/e25b19185b3988dc.js @@ -0,0 +1 @@ +({ '__proto__': 1, __proto__: 2 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e262ea7682c36f92.js b/compiler/tests-js-parser/early/e262ea7682c36f92.js new file mode 100644 index 000000000..a321ee075 --- /dev/null +++ b/compiler/tests-js-parser/early/e262ea7682c36f92.js @@ -0,0 +1 @@ +{ function a(){} function* a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e299aa99dc3d30e8.js b/compiler/tests-js-parser/early/e299aa99dc3d30e8.js new file mode 100644 index 000000000..770f6f429 --- /dev/null +++ b/compiler/tests-js-parser/early/e299aa99dc3d30e8.js @@ -0,0 +1 @@ +for(const a of b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e2bb548a629fbb17.js b/compiler/tests-js-parser/early/e2bb548a629fbb17.js new file mode 100644 index 000000000..bcf70bb57 --- /dev/null +++ b/compiler/tests-js-parser/early/e2bb548a629fbb17.js @@ -0,0 +1 @@ +class a extends b { static prototype(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e421d953546800f5.js b/compiler/tests-js-parser/early/e421d953546800f5.js new file mode 100644 index 000000000..28956a33f --- /dev/null +++ b/compiler/tests-js-parser/early/e421d953546800f5.js @@ -0,0 +1 @@ +if(1) ; else b: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e4a22fdf83a82194.js b/compiler/tests-js-parser/early/e4a22fdf83a82194.js new file mode 100644 index 000000000..9be6fb182 --- /dev/null +++ b/compiler/tests-js-parser/early/e4a22fdf83a82194.js @@ -0,0 +1 @@ +!{ get a(){ let b; let b; } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e526e23690c3333d.js b/compiler/tests-js-parser/early/e526e23690c3333d.js new file mode 100644 index 000000000..f7ac624dc --- /dev/null +++ b/compiler/tests-js-parser/early/e526e23690c3333d.js @@ -0,0 +1 @@ +'use strict'; [arguments] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e6315737f25b2e1c.js b/compiler/tests-js-parser/early/e6315737f25b2e1c.js new file mode 100644 index 000000000..5e4907b91 --- /dev/null +++ b/compiler/tests-js-parser/early/e6315737f25b2e1c.js @@ -0,0 +1 @@ +"use strict"; (eval) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e6a9e14c6a08a7f7.module.js b/compiler/tests-js-parser/early/e6a9e14c6a08a7f7.module.js new file mode 100644 index 000000000..b3b16dd86 --- /dev/null +++ b/compiler/tests-js-parser/early/e6a9e14c6a08a7f7.module.js @@ -0,0 +1 @@ +export { a as default } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e6bf6eec9bccde06.module.js b/compiler/tests-js-parser/early/e6bf6eec9bccde06.module.js new file mode 100644 index 000000000..912ac8e7e --- /dev/null +++ b/compiler/tests-js-parser/early/e6bf6eec9bccde06.module.js @@ -0,0 +1 @@ +export default 1; export default 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e75adbd88143b882.js b/compiler/tests-js-parser/early/e75adbd88143b882.js new file mode 100644 index 000000000..8a920d0c9 --- /dev/null +++ b/compiler/tests-js-parser/early/e75adbd88143b882.js @@ -0,0 +1 @@ +"use strict"; (a = yield) => {} diff --git a/compiler/tests-js-parser/early/e76c09a13339cbe9.js b/compiler/tests-js-parser/early/e76c09a13339cbe9.js new file mode 100644 index 000000000..a4a2a5b42 --- /dev/null +++ b/compiler/tests-js-parser/early/e76c09a13339cbe9.js @@ -0,0 +1 @@ +"use strict"; let yield = 1; diff --git a/compiler/tests-js-parser/early/e777215433af6809.module.js b/compiler/tests-js-parser/early/e777215433af6809.module.js new file mode 100644 index 000000000..bac5aaf74 --- /dev/null +++ b/compiler/tests-js-parser/early/e777215433af6809.module.js @@ -0,0 +1 @@ +var a; export default function() {} export { a as default }; diff --git a/compiler/tests-js-parser/early/e83eb9e8b9106b66.js b/compiler/tests-js-parser/early/e83eb9e8b9106b66.js new file mode 100644 index 000000000..914dddbda --- /dev/null +++ b/compiler/tests-js-parser/early/e83eb9e8b9106b66.js @@ -0,0 +1 @@ +function a() {'use strict'; arguments = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e8f3bbd8830b5338.js b/compiler/tests-js-parser/early/e8f3bbd8830b5338.js new file mode 100644 index 000000000..c4bf3dc2a --- /dev/null +++ b/compiler/tests-js-parser/early/e8f3bbd8830b5338.js @@ -0,0 +1 @@ +!{ a() { !function(){ super.b(); } } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e929ff0c0dcb70c0.js b/compiler/tests-js-parser/early/e929ff0c0dcb70c0.js new file mode 100644 index 000000000..0051f4d16 --- /dev/null +++ b/compiler/tests-js-parser/early/e929ff0c0dcb70c0.js @@ -0,0 +1 @@ +for(const a of 1) { var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e94af0a4ed3c838c.js b/compiler/tests-js-parser/early/e94af0a4ed3c838c.js new file mode 100644 index 000000000..cf81618bd --- /dev/null +++ b/compiler/tests-js-parser/early/e94af0a4ed3c838c.js @@ -0,0 +1 @@ +for(let let in 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e9a40a98ec62f818.js b/compiler/tests-js-parser/early/e9a40a98ec62f818.js new file mode 100644 index 000000000..cac32ed39 --- /dev/null +++ b/compiler/tests-js-parser/early/e9a40a98ec62f818.js @@ -0,0 +1 @@ +for(0 of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/e9af991a7b1821ee.js b/compiler/tests-js-parser/early/e9af991a7b1821ee.js new file mode 100644 index 000000000..a9c586035 --- /dev/null +++ b/compiler/tests-js-parser/early/e9af991a7b1821ee.js @@ -0,0 +1 @@ +function a({yield=1}){ 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ea548dff1a942307.js b/compiler/tests-js-parser/early/ea548dff1a942307.js new file mode 100644 index 000000000..4ee7beaf2 --- /dev/null +++ b/compiler/tests-js-parser/early/ea548dff1a942307.js @@ -0,0 +1 @@ +class a {set b(yield){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ea84c60f3b157d35.js b/compiler/tests-js-parser/early/ea84c60f3b157d35.js new file mode 100644 index 000000000..6db29dc3e --- /dev/null +++ b/compiler/tests-js-parser/early/ea84c60f3b157d35.js @@ -0,0 +1 @@ +0 /= 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/eaba146fa7cbe088.js b/compiler/tests-js-parser/early/eaba146fa7cbe088.js new file mode 100644 index 000000000..0f56f1074 --- /dev/null +++ b/compiler/tests-js-parser/early/eaba146fa7cbe088.js @@ -0,0 +1 @@ +'use strict'; var [yield] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/eac5e9a554000a84.js b/compiler/tests-js-parser/early/eac5e9a554000a84.js new file mode 100644 index 000000000..0a59b207a --- /dev/null +++ b/compiler/tests-js-parser/early/eac5e9a554000a84.js @@ -0,0 +1 @@ +class a { constructor(){} "constructor"(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ebb83b50e80709a6.js b/compiler/tests-js-parser/early/ebb83b50e80709a6.js new file mode 100644 index 000000000..d2a55f109 --- /dev/null +++ b/compiler/tests-js-parser/early/ebb83b50e80709a6.js @@ -0,0 +1 @@ +"use strict"; function a(yield) {} diff --git a/compiler/tests-js-parser/early/ec31fa5e521c5df4.js b/compiler/tests-js-parser/early/ec31fa5e521c5df4.js new file mode 100644 index 000000000..8de94a35f --- /dev/null +++ b/compiler/tests-js-parser/early/ec31fa5e521c5df4.js @@ -0,0 +1,20 @@ +// Do not optimize this pattern +function a() { + b.c('d'); +} + +{ + function a() { + b.c('d'); + } + a(); + function a() { + b.c('e'); + } +} + +a(); + +function a() { + b.c('e'); +} diff --git a/compiler/tests-js-parser/early/ec93b40c2e19fac2.js b/compiler/tests-js-parser/early/ec93b40c2e19fac2.js new file mode 100644 index 000000000..14f5739a3 --- /dev/null +++ b/compiler/tests-js-parser/early/ec93b40c2e19fac2.js @@ -0,0 +1 @@ +!function(a){ super() } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ece750e11173aee6.js b/compiler/tests-js-parser/early/ece750e11173aee6.js new file mode 100644 index 000000000..7a81af9db --- /dev/null +++ b/compiler/tests-js-parser/early/ece750e11173aee6.js @@ -0,0 +1 @@ +"use strict"; function a(__proto__, __proto__) { } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ed11580534c9821e.js b/compiler/tests-js-parser/early/ed11580534c9821e.js new file mode 100644 index 000000000..81bbf89b1 --- /dev/null +++ b/compiler/tests-js-parser/early/ed11580534c9821e.js @@ -0,0 +1 @@ +"use strict"; var { a: yield } = b; diff --git a/compiler/tests-js-parser/early/ed8872fbcbf7837e.js b/compiler/tests-js-parser/early/ed8872fbcbf7837e.js new file mode 100644 index 000000000..a58776bc6 --- /dev/null +++ b/compiler/tests-js-parser/early/ed8872fbcbf7837e.js @@ -0,0 +1 @@ +class a extends b { static *prototype(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ee01d971b6d831a9.js b/compiler/tests-js-parser/early/ee01d971b6d831a9.js new file mode 100644 index 000000000..b6bd685af --- /dev/null +++ b/compiler/tests-js-parser/early/ee01d971b6d831a9.js @@ -0,0 +1 @@ +!{ __proto__: null, "__proto__": null }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ee3bf6b50e45aa94.js b/compiler/tests-js-parser/early/ee3bf6b50e45aa94.js new file mode 100644 index 000000000..b278eade0 --- /dev/null +++ b/compiler/tests-js-parser/early/ee3bf6b50e45aa94.js @@ -0,0 +1 @@ +if(1) b: function a(){} else ; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ee57292e5169facf.js b/compiler/tests-js-parser/early/ee57292e5169facf.js new file mode 100644 index 000000000..fa307b335 --- /dev/null +++ b/compiler/tests-js-parser/early/ee57292e5169facf.js @@ -0,0 +1 @@ +function* a(){ ({ *b(c = yield d){} }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/eeb5ffaafa815bb2.js b/compiler/tests-js-parser/early/eeb5ffaafa815bb2.js new file mode 100644 index 000000000..112b5ff8d --- /dev/null +++ b/compiler/tests-js-parser/early/eeb5ffaafa815bb2.js @@ -0,0 +1 @@ +({ __proto__: null, __proto__: null }) diff --git a/compiler/tests-js-parser/early/ef31d273b93b7048.js b/compiler/tests-js-parser/early/ef31d273b93b7048.js new file mode 100644 index 000000000..4230edbac --- /dev/null +++ b/compiler/tests-js-parser/early/ef31d273b93b7048.js @@ -0,0 +1 @@ +switch(1) { default: let a; case 2: var a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/ef63ef2fa948d9b1.js b/compiler/tests-js-parser/early/ef63ef2fa948d9b1.js new file mode 100644 index 000000000..72760b0b3 --- /dev/null +++ b/compiler/tests-js-parser/early/ef63ef2fa948d9b1.js @@ -0,0 +1 @@ +/./ii \ No newline at end of file diff --git a/compiler/tests-js-parser/early/efd3de358662f915.js b/compiler/tests-js-parser/early/efd3de358662f915.js new file mode 100644 index 000000000..060b76d00 --- /dev/null +++ b/compiler/tests-js-parser/early/efd3de358662f915.js @@ -0,0 +1 @@ +for (const let in a); diff --git a/compiler/tests-js-parser/early/efe0e7dcea3c9e78.js b/compiler/tests-js-parser/early/efe0e7dcea3c9e78.js new file mode 100644 index 000000000..7939ecaca --- /dev/null +++ b/compiler/tests-js-parser/early/efe0e7dcea3c9e78.js @@ -0,0 +1 @@ +for(a in b) d: function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f07e993dfadb77ba.js b/compiler/tests-js-parser/early/f07e993dfadb77ba.js new file mode 100644 index 000000000..d5d824e88 --- /dev/null +++ b/compiler/tests-js-parser/early/f07e993dfadb77ba.js @@ -0,0 +1 @@ +let a, [a] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f086abdecf788fdc.js b/compiler/tests-js-parser/early/f086abdecf788fdc.js new file mode 100644 index 000000000..a47326700 --- /dev/null +++ b/compiler/tests-js-parser/early/f086abdecf788fdc.js @@ -0,0 +1 @@ +class a extends b { static set prototype(c) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f09a082a6f796773.js b/compiler/tests-js-parser/early/f09a082a6f796773.js new file mode 100644 index 000000000..bb08181ea --- /dev/null +++ b/compiler/tests-js-parser/early/f09a082a6f796773.js @@ -0,0 +1 @@ +let {a: b, c: b} = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f0a495a059d1de15.js b/compiler/tests-js-parser/early/f0a495a059d1de15.js new file mode 100644 index 000000000..7cf016df4 --- /dev/null +++ b/compiler/tests-js-parser/early/f0a495a059d1de15.js @@ -0,0 +1 @@ +function *a(b = yield){} diff --git a/compiler/tests-js-parser/early/f0e47254d16fb114.js b/compiler/tests-js-parser/early/f0e47254d16fb114.js new file mode 100644 index 000000000..683cdbae8 --- /dev/null +++ b/compiler/tests-js-parser/early/f0e47254d16fb114.js @@ -0,0 +1 @@ +[...new a] = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f145f628d834b3fd.js b/compiler/tests-js-parser/early/f145f628d834b3fd.js new file mode 100644 index 000000000..12ed8d199 --- /dev/null +++ b/compiler/tests-js-parser/early/f145f628d834b3fd.js @@ -0,0 +1 @@ +'use strict'; ({eval} = 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f1c97690720ac13e.js b/compiler/tests-js-parser/early/f1c97690720ac13e.js new file mode 100644 index 000000000..037efae4f --- /dev/null +++ b/compiler/tests-js-parser/early/f1c97690720ac13e.js @@ -0,0 +1 @@ +function* a(){ !function*(b = yield* c){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f1de9fc3ec4637cc.js b/compiler/tests-js-parser/early/f1de9fc3ec4637cc.js new file mode 100644 index 000000000..4f98db019 --- /dev/null +++ b/compiler/tests-js-parser/early/f1de9fc3ec4637cc.js @@ -0,0 +1 @@ +class arguments {} diff --git a/compiler/tests-js-parser/early/f25183676693850d.js b/compiler/tests-js-parser/early/f25183676693850d.js new file mode 100644 index 000000000..2d1f7b42a --- /dev/null +++ b/compiler/tests-js-parser/early/f25183676693850d.js @@ -0,0 +1 @@ +try {} catch ([a, a]) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f27ed2a85649894f.js b/compiler/tests-js-parser/early/f27ed2a85649894f.js new file mode 100644 index 000000000..883df8c15 --- /dev/null +++ b/compiler/tests-js-parser/early/f27ed2a85649894f.js @@ -0,0 +1 @@ +'use strict'; +static; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f3943346692438ba.js b/compiler/tests-js-parser/early/f3943346692438ba.js new file mode 100644 index 000000000..2b059b60c --- /dev/null +++ b/compiler/tests-js-parser/early/f3943346692438ba.js @@ -0,0 +1 @@ +'use strict'; ({ __proto__: 1, __proto__: 2 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f3c9e78cb021ccd2.js b/compiler/tests-js-parser/early/f3c9e78cb021ccd2.js new file mode 100644 index 000000000..c22f096e4 --- /dev/null +++ b/compiler/tests-js-parser/early/f3c9e78cb021ccd2.js @@ -0,0 +1 @@ +function a(){ b: b: ; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f62e0262960d0687.js b/compiler/tests-js-parser/early/f62e0262960d0687.js new file mode 100644 index 000000000..c947c1917 --- /dev/null +++ b/compiler/tests-js-parser/early/f62e0262960d0687.js @@ -0,0 +1 @@ +function* a(){ ({ *b({c = yield}){} }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f66c23bae93d2561.module.js b/compiler/tests-js-parser/early/f66c23bae93d2561.module.js new file mode 100644 index 000000000..4b6c90c32 --- /dev/null +++ b/compiler/tests-js-parser/early/f66c23bae93d2561.module.js @@ -0,0 +1 @@ +export default function(a = super.b){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f75496ac9ccac866.js b/compiler/tests-js-parser/early/f75496ac9ccac866.js new file mode 100644 index 000000000..bbda13808 --- /dev/null +++ b/compiler/tests-js-parser/early/f75496ac9ccac866.js @@ -0,0 +1 @@ +while(1) continue a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f7c0a2c1dc2907b9.js b/compiler/tests-js-parser/early/f7c0a2c1dc2907b9.js new file mode 100644 index 000000000..430e7eebc --- /dev/null +++ b/compiler/tests-js-parser/early/f7c0a2c1dc2907b9.js @@ -0,0 +1 @@ +function* a(){ !function*(b = c + d(yield)){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f7df8b7ca4fd194d.js b/compiler/tests-js-parser/early/f7df8b7ca4fd194d.js new file mode 100644 index 000000000..a9df4805e --- /dev/null +++ b/compiler/tests-js-parser/early/f7df8b7ca4fd194d.js @@ -0,0 +1 @@ +a: while (true) { a: while (true) { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f7f9bb74dc8d96ac.module.js b/compiler/tests-js-parser/early/f7f9bb74dc8d96ac.module.js new file mode 100644 index 000000000..8a0cdac82 --- /dev/null +++ b/compiler/tests-js-parser/early/f7f9bb74dc8d96ac.module.js @@ -0,0 +1 @@ +export var a; export var a; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f80280ff0433ee4c.js b/compiler/tests-js-parser/early/f80280ff0433ee4c.js new file mode 100644 index 000000000..1d303a048 --- /dev/null +++ b/compiler/tests-js-parser/early/f80280ff0433ee4c.js @@ -0,0 +1 @@ +let a; const a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f84a7bced16d1caf.module.js b/compiler/tests-js-parser/early/f84a7bced16d1caf.module.js new file mode 100644 index 000000000..1db5322ab --- /dev/null +++ b/compiler/tests-js-parser/early/f84a7bced16d1caf.module.js @@ -0,0 +1 @@ +export default function([a, a]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f850f00481b1ca6c.js b/compiler/tests-js-parser/early/f850f00481b1ca6c.js new file mode 100644 index 000000000..e9905d09c --- /dev/null +++ b/compiler/tests-js-parser/early/f850f00481b1ca6c.js @@ -0,0 +1 @@ +for(const a = 1, let = 2;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f87eda3e920311ce.js b/compiler/tests-js-parser/early/f87eda3e920311ce.js new file mode 100644 index 000000000..b56b96f5c --- /dev/null +++ b/compiler/tests-js-parser/early/f87eda3e920311ce.js @@ -0,0 +1 @@ +'use strict'; [,,,arguments,] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f89017fd3f793d0d.js b/compiler/tests-js-parser/early/f89017fd3f793d0d.js new file mode 100644 index 000000000..f023ebc3e --- /dev/null +++ b/compiler/tests-js-parser/early/f89017fd3f793d0d.js @@ -0,0 +1 @@ +!{ set a({b, b}){} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f933ec047b8a7c3d.js b/compiler/tests-js-parser/early/f933ec047b8a7c3d.js new file mode 100644 index 000000000..ab216d431 --- /dev/null +++ b/compiler/tests-js-parser/early/f933ec047b8a7c3d.js @@ -0,0 +1 @@ +0-- \ No newline at end of file diff --git a/compiler/tests-js-parser/early/f9d44f5aa2f3ffc3.js b/compiler/tests-js-parser/early/f9d44f5aa2f3ffc3.js new file mode 100644 index 000000000..c77814569 --- /dev/null +++ b/compiler/tests-js-parser/early/f9d44f5aa2f3ffc3.js @@ -0,0 +1 @@ +({set a([]){'use strict'}}) diff --git a/compiler/tests-js-parser/early/f9e0efceb5690fdd.module.js b/compiler/tests-js-parser/early/f9e0efceb5690fdd.module.js new file mode 100644 index 000000000..a1bdf125a --- /dev/null +++ b/compiler/tests-js-parser/early/f9e0efceb5690fdd.module.js @@ -0,0 +1 @@ +export { a } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/fa56fc427be3e801.module.js b/compiler/tests-js-parser/early/fa56fc427be3e801.module.js new file mode 100644 index 000000000..8c9865ac0 --- /dev/null +++ b/compiler/tests-js-parser/early/fa56fc427be3e801.module.js @@ -0,0 +1 @@ +var a; export {b as a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/fa652663d4281822.js b/compiler/tests-js-parser/early/fa652663d4281822.js new file mode 100644 index 000000000..ca01666c7 --- /dev/null +++ b/compiler/tests-js-parser/early/fa652663d4281822.js @@ -0,0 +1 @@ +function* a(b){ super() } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/faf0f6cf1530de37.js b/compiler/tests-js-parser/early/faf0f6cf1530de37.js new file mode 100644 index 000000000..2cf18852d --- /dev/null +++ b/compiler/tests-js-parser/early/faf0f6cf1530de37.js @@ -0,0 +1 @@ +switch(1) { case 2: var a; case 3: let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/fb40f86db65f8e6a.js b/compiler/tests-js-parser/early/fb40f86db65f8e6a.js new file mode 100644 index 000000000..7257d03fe --- /dev/null +++ b/compiler/tests-js-parser/early/fb40f86db65f8e6a.js @@ -0,0 +1 @@ +function a(b, [b]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/early/fb9dc66d0a451d9e.js b/compiler/tests-js-parser/early/fb9dc66d0a451d9e.js new file mode 100644 index 000000000..18aea63f0 --- /dev/null +++ b/compiler/tests-js-parser/early/fb9dc66d0a451d9e.js @@ -0,0 +1 @@ +function a(){ const b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/fc6fe891ccb0eb4e.js b/compiler/tests-js-parser/early/fc6fe891ccb0eb4e.js new file mode 100644 index 000000000..ac86ccb6c --- /dev/null +++ b/compiler/tests-js-parser/early/fc6fe891ccb0eb4e.js @@ -0,0 +1 @@ +function* a(){ !function*({[yield]: b}){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/early/fc9cad7477872ddf.js b/compiler/tests-js-parser/early/fc9cad7477872ddf.js new file mode 100644 index 000000000..d96a1e710 --- /dev/null +++ b/compiler/tests-js-parser/early/fc9cad7477872ddf.js @@ -0,0 +1 @@ +var a = new.target; diff --git a/compiler/tests-js-parser/early/fdfd032c335e96a7.js b/compiler/tests-js-parser/early/fdfd032c335e96a7.js new file mode 100644 index 000000000..5d6662812 --- /dev/null +++ b/compiler/tests-js-parser/early/fdfd032c335e96a7.js @@ -0,0 +1 @@ +'use strict'; +implements; \ No newline at end of file diff --git a/compiler/tests-js-parser/early/fe68564c21bdb519.js b/compiler/tests-js-parser/early/fe68564c21bdb519.js new file mode 100644 index 000000000..2715b73e7 --- /dev/null +++ b/compiler/tests-js-parser/early/fe68564c21bdb519.js @@ -0,0 +1 @@ +'use strict'; (arguments)=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0053737b6145994c.js b/compiler/tests-js-parser/fail/0053737b6145994c.js new file mode 100644 index 000000000..f65751702 --- /dev/null +++ b/compiler/tests-js-parser/fail/0053737b6145994c.js @@ -0,0 +1 @@ +var x, ; diff --git a/compiler/tests-js-parser/fail/0131cd88c5774915.js b/compiler/tests-js-parser/fail/0131cd88c5774915.js new file mode 100644 index 000000000..a11e719fa --- /dev/null +++ b/compiler/tests-js-parser/fail/0131cd88c5774915.js @@ -0,0 +1 @@ +({get{a}:0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/021fb596db81e6d0.js b/compiler/tests-js-parser/fail/021fb596db81e6d0.js new file mode 100644 index 000000000..81750b96f --- /dev/null +++ b/compiler/tests-js-parser/fail/021fb596db81e6d0.js @@ -0,0 +1 @@ +{ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/025560435ed0b9a6.js b/compiler/tests-js-parser/fail/025560435ed0b9a6.js new file mode 100644 index 000000000..c9a4262e2 --- /dev/null +++ b/compiler/tests-js-parser/fail/025560435ed0b9a6.js @@ -0,0 +1,3 @@ +/* + + diff --git a/compiler/tests-js-parser/fail/02a5ebb2378de234.js b/compiler/tests-js-parser/fail/02a5ebb2378de234.js new file mode 100644 index 000000000..406b9be9b --- /dev/null +++ b/compiler/tests-js-parser/fail/02a5ebb2378de234.js @@ -0,0 +1 @@ +import * as enum from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/02c40a1caad5961a.js b/compiler/tests-js-parser/fail/02c40a1caad5961a.js new file mode 100644 index 000000000..b6a8c8b9c --- /dev/null +++ b/compiler/tests-js-parser/fail/02c40a1caad5961a.js @@ -0,0 +1 @@ +/42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/02e5861a1ef10c42.js b/compiler/tests-js-parser/fail/02e5861a1ef10c42.js new file mode 100644 index 000000000..bfcca3b1f --- /dev/null +++ b/compiler/tests-js-parser/fail/02e5861a1ef10c42.js @@ -0,0 +1 @@ +{ return; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/033c083bb1f44642.js b/compiler/tests-js-parser/fail/033c083bb1f44642.js new file mode 100644 index 000000000..a7e84c277 --- /dev/null +++ b/compiler/tests-js-parser/fail/033c083bb1f44642.js @@ -0,0 +1 @@ +\uD800\x62 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/034bde9700ab4518.js b/compiler/tests-js-parser/fail/034bde9700ab4518.js new file mode 100644 index 000000000..2ffcc5875 --- /dev/null +++ b/compiler/tests-js-parser/fail/034bde9700ab4518.js @@ -0,0 +1 @@ +var new A = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/036f6b8da7e53ee5.js b/compiler/tests-js-parser/fail/036f6b8da7e53ee5.js new file mode 100644 index 000000000..9cbbaf933 --- /dev/null +++ b/compiler/tests-js-parser/fail/036f6b8da7e53ee5.js @@ -0,0 +1 @@ +({get \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0386dace9a9fc47e.js b/compiler/tests-js-parser/fail/0386dace9a9fc47e.js new file mode 100644 index 000000000..f72465372 --- /dev/null +++ b/compiler/tests-js-parser/fail/0386dace9a9fc47e.js @@ -0,0 +1 @@ +function null() { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/03d13b6c40f6aaea.js b/compiler/tests-js-parser/fail/03d13b6c40f6aaea.js new file mode 100644 index 000000000..c9d60db9d --- /dev/null +++ b/compiler/tests-js-parser/fail/03d13b6c40f6aaea.js @@ -0,0 +1 @@ +[{a=0},...0] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/03d335d8e007f61e.js b/compiler/tests-js-parser/fail/03d335d8e007f61e.js new file mode 100644 index 000000000..97d352f35 --- /dev/null +++ b/compiler/tests-js-parser/fail/03d335d8e007f61e.js @@ -0,0 +1,2 @@ +x + is y \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/043ab1c3982db3cd.js b/compiler/tests-js-parser/fail/043ab1c3982db3cd.js new file mode 100644 index 000000000..ea5e2b94b --- /dev/null +++ b/compiler/tests-js-parser/fail/043ab1c3982db3cd.js @@ -0,0 +1 @@ +function x(...a = 1){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/04bc213db9cd1130.js b/compiler/tests-js-parser/fail/04bc213db9cd1130.js new file mode 100644 index 000000000..45ef94336 --- /dev/null +++ b/compiler/tests-js-parser/fail/04bc213db9cd1130.js @@ -0,0 +1 @@ +function *g() { function yield() {} } diff --git a/compiler/tests-js-parser/fail/0557c70da3f698b5.module.js b/compiler/tests-js-parser/fail/0557c70da3f698b5.module.js new file mode 100644 index 000000000..0ab76554d --- /dev/null +++ b/compiler/tests-js-parser/fail/0557c70da3f698b5.module.js @@ -0,0 +1 @@ +import {b,,c} from 'a'; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/05b898d7ef3c0300.js b/compiler/tests-js-parser/fail/05b898d7ef3c0300.js new file mode 100644 index 000000000..0eb95c676 --- /dev/null +++ b/compiler/tests-js-parser/fail/05b898d7ef3c0300.js @@ -0,0 +1 @@ +0b1a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/06272e1e03d6ced7.js b/compiler/tests-js-parser/fail/06272e1e03d6ced7.js new file mode 100644 index 000000000..4a8a2a26c --- /dev/null +++ b/compiler/tests-js-parser/fail/06272e1e03d6ced7.js @@ -0,0 +1 @@ +[...x,,] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/06be4d4082484d98.module.js b/compiler/tests-js-parser/fail/06be4d4082484d98.module.js new file mode 100644 index 000000000..e796fce09 --- /dev/null +++ b/compiler/tests-js-parser/fail/06be4d4082484d98.module.js @@ -0,0 +1 @@ +import {b as,} from 'a'; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0817f13d2237d8d2.js b/compiler/tests-js-parser/fail/0817f13d2237d8d2.js new file mode 100644 index 000000000..d775807dd --- /dev/null +++ b/compiler/tests-js-parser/fail/0817f13d2237d8d2.js @@ -0,0 +1 @@ +new.prop \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0889113e04d3203f.js b/compiler/tests-js-parser/fail/0889113e04d3203f.js new file mode 100644 index 000000000..1e88aff85 --- /dev/null +++ b/compiler/tests-js-parser/fail/0889113e04d3203f.js @@ -0,0 +1 @@ +class \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/08bafe059b17ac92.js b/compiler/tests-js-parser/fail/08bafe059b17ac92.js new file mode 100644 index 000000000..0e149e9a8 --- /dev/null +++ b/compiler/tests-js-parser/fail/08bafe059b17ac92.js @@ -0,0 +1 @@ +[+{a = 0}]; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/08fa65d2ecddcfbe.js b/compiler/tests-js-parser/fail/08fa65d2ecddcfbe.js new file mode 100644 index 000000000..32ecb82f8 --- /dev/null +++ b/compiler/tests-js-parser/fail/08fa65d2ecddcfbe.js @@ -0,0 +1 @@ +({ set: s() { } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/095bea002b10b8e1.js b/compiler/tests-js-parser/fail/095bea002b10b8e1.js new file mode 100644 index 000000000..df80d0da6 --- /dev/null +++ b/compiler/tests-js-parser/fail/095bea002b10b8e1.js @@ -0,0 +1 @@ +foo[/42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/09af6db5fe41b857.js b/compiler/tests-js-parser/fail/09af6db5fe41b857.js new file mode 100644 index 000000000..4cdfc5f6e --- /dev/null +++ b/compiler/tests-js-parser/fail/09af6db5fe41b857.js @@ -0,0 +1 @@ +yield v \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0a225effb5493c00.js b/compiler/tests-js-parser/fail/0a225effb5493c00.js new file mode 100644 index 000000000..c2ff91743 --- /dev/null +++ b/compiler/tests-js-parser/fail/0a225effb5493c00.js @@ -0,0 +1 @@ +for (const of 42); diff --git a/compiler/tests-js-parser/fail/0abefbc80bf651fa.js b/compiler/tests-js-parser/fail/0abefbc80bf651fa.js new file mode 100644 index 000000000..9ba53f43b --- /dev/null +++ b/compiler/tests-js-parser/fail/0abefbc80bf651fa.js @@ -0,0 +1 @@ +for (let let;;;) {} diff --git a/compiler/tests-js-parser/fail/0bee7999482c66a0.js b/compiler/tests-js-parser/fail/0bee7999482c66a0.js new file mode 100644 index 000000000..a6d5e4ae4 --- /dev/null +++ b/compiler/tests-js-parser/fail/0bee7999482c66a0.js @@ -0,0 +1 @@ +(10) => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0c7d4912f3869297.js b/compiler/tests-js-parser/fail/0c7d4912f3869297.js new file mode 100644 index 000000000..bc4b1c37f --- /dev/null +++ b/compiler/tests-js-parser/fail/0c7d4912f3869297.js @@ -0,0 +1 @@ +\u12 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0d3b0899890c5f8e.js b/compiler/tests-js-parser/fail/0d3b0899890c5f8e.js new file mode 100644 index 000000000..c6b07359e --- /dev/null +++ b/compiler/tests-js-parser/fail/0d3b0899890c5f8e.js @@ -0,0 +1 @@ +class a {b(enum){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0d4ff79ab93c897a.js b/compiler/tests-js-parser/fail/0d4ff79ab93c897a.js new file mode 100644 index 000000000..37f41feaa --- /dev/null +++ b/compiler/tests-js-parser/fail/0d4ff79ab93c897a.js @@ -0,0 +1 @@ +({a,,} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0d5e450f1da8a92a.js b/compiler/tests-js-parser/fail/0d5e450f1da8a92a.js new file mode 100644 index 000000000..8eb4bc8a7 --- /dev/null +++ b/compiler/tests-js-parser/fail/0d5e450f1da8a92a.js @@ -0,0 +1 @@ +('\9') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0dbe57298be12eac.js b/compiler/tests-js-parser/fail/0dbe57298be12eac.js new file mode 100644 index 000000000..71ef9ad1d --- /dev/null +++ b/compiler/tests-js-parser/fail/0dbe57298be12eac.js @@ -0,0 +1 @@ +var x,; diff --git a/compiler/tests-js-parser/fail/0ddab4a1a651034c.js b/compiler/tests-js-parser/fail/0ddab4a1a651034c.js new file mode 100644 index 000000000..7838e6ddf --- /dev/null +++ b/compiler/tests-js-parser/fail/0ddab4a1a651034c.js @@ -0,0 +1 @@ +for (let x = 42 in list) process(x); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0df19c6187ef3cbc.module.js b/compiler/tests-js-parser/fail/0df19c6187ef3cbc.module.js new file mode 100644 index 000000000..4190d5947 --- /dev/null +++ b/compiler/tests-js-parser/fail/0df19c6187ef3cbc.module.js @@ -0,0 +1,3 @@ +function a(){ +--> +} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0eb4ed330b5d7e2f.js b/compiler/tests-js-parser/fail/0eb4ed330b5d7e2f.js new file mode 100644 index 000000000..4dc400f18 --- /dev/null +++ b/compiler/tests-js-parser/fail/0eb4ed330b5d7e2f.js @@ -0,0 +1 @@ +({get a(){}})=0 diff --git a/compiler/tests-js-parser/fail/0ebf57bd8c051d27.js b/compiler/tests-js-parser/fail/0ebf57bd8c051d27.js new file mode 100644 index 000000000..d1cdda9f3 --- /dev/null +++ b/compiler/tests-js-parser/fail/0ebf57bd8c051d27.js @@ -0,0 +1 @@ +[{a = 0}]; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0f175471e2f0c3d5.js b/compiler/tests-js-parser/fail/0f175471e2f0c3d5.js new file mode 100644 index 000000000..8440d1571 --- /dev/null +++ b/compiler/tests-js-parser/fail/0f175471e2f0c3d5.js @@ -0,0 +1 @@ +class \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0f2794d0bcec2dd7.js b/compiler/tests-js-parser/fail/0f2794d0bcec2dd7.js new file mode 100644 index 000000000..b035918c1 --- /dev/null +++ b/compiler/tests-js-parser/fail/0f2794d0bcec2dd7.js @@ -0,0 +1 @@ +'\x1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0f512c4376a62de8.js b/compiler/tests-js-parser/fail/0f512c4376a62de8.js new file mode 100644 index 000000000..5a6d989c2 --- /dev/null +++ b/compiler/tests-js-parser/fail/0f512c4376a62de8.js @@ -0,0 +1 @@ +a enum; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0f8806b7b4358487.js b/compiler/tests-js-parser/fail/0f8806b7b4358487.js new file mode 100644 index 000000000..8d1420050 --- /dev/null +++ b/compiler/tests-js-parser/fail/0f8806b7b4358487.js @@ -0,0 +1 @@ +import foo from "foo"; diff --git a/compiler/tests-js-parser/fail/0ff2a5bb12a4f5be.js b/compiler/tests-js-parser/fail/0ff2a5bb12a4f5be.js new file mode 100644 index 000000000..a167d2a48 --- /dev/null +++ b/compiler/tests-js-parser/fail/0ff2a5bb12a4f5be.js @@ -0,0 +1 @@ +(10) => 00 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0ff3826356c94f67.js b/compiler/tests-js-parser/fail/0ff3826356c94f67.js new file mode 100644 index 000000000..e2e95fbd2 --- /dev/null +++ b/compiler/tests-js-parser/fail/0ff3826356c94f67.js @@ -0,0 +1 @@ +({function} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/0ffb1c3ecf85660e.js b/compiler/tests-js-parser/fail/0ffb1c3ecf85660e.js new file mode 100644 index 000000000..cc392622e --- /dev/null +++ b/compiler/tests-js-parser/fail/0ffb1c3ecf85660e.js @@ -0,0 +1,2 @@ +"Hello +World" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1004b5fec18f14ec.js b/compiler/tests-js-parser/fail/1004b5fec18f14ec.js new file mode 100644 index 000000000..91e132b46 --- /dev/null +++ b/compiler/tests-js-parser/fail/1004b5fec18f14ec.js @@ -0,0 +1 @@ +1 + { t:t, \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/100c329e6dd70e5a.js b/compiler/tests-js-parser/fail/100c329e6dd70e5a.js new file mode 100644 index 000000000..5c83007e6 --- /dev/null +++ b/compiler/tests-js-parser/fail/100c329e6dd70e5a.js @@ -0,0 +1 @@ +/*
 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/113749707e7c3519.js b/compiler/tests-js-parser/fail/113749707e7c3519.js new file mode 100644 index 000000000..79f9dcadd --- /dev/null +++ b/compiler/tests-js-parser/fail/113749707e7c3519.js @@ -0,0 +1 @@ +0B9 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/11d61dbd7c1fbd1b.js b/compiler/tests-js-parser/fail/11d61dbd7c1fbd1b.js new file mode 100644 index 000000000..4545763c3 --- /dev/null +++ b/compiler/tests-js-parser/fail/11d61dbd7c1fbd1b.js @@ -0,0 +1 @@ +function hello() { 'use strict'; 021; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/11db90549ed49ac3.js b/compiler/tests-js-parser/fail/11db90549ed49ac3.js new file mode 100644 index 000000000..7b8913191 --- /dev/null +++ b/compiler/tests-js-parser/fail/11db90549ed49ac3.js @@ -0,0 +1 @@ +let x,; diff --git a/compiler/tests-js-parser/fail/12a3250154ea8ef5.js b/compiler/tests-js-parser/fail/12a3250154ea8ef5.js new file mode 100644 index 000000000..324a6ebff --- /dev/null +++ b/compiler/tests-js-parser/fail/12a3250154ea8ef5.js @@ -0,0 +1 @@ +for(let ? b : c in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/12f5bc355427b8f8.js b/compiler/tests-js-parser/fail/12f5bc355427b8f8.js new file mode 100644 index 000000000..01bf085db --- /dev/null +++ b/compiler/tests-js-parser/fail/12f5bc355427b8f8.js @@ -0,0 +1 @@ +() + 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1395e3a9d2acf65c.js b/compiler/tests-js-parser/fail/1395e3a9d2acf65c.js new file mode 100644 index 000000000..ca7e48ae0 --- /dev/null +++ b/compiler/tests-js-parser/fail/1395e3a9d2acf65c.js @@ -0,0 +1 @@ +`\07` \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/13ce2dd24993176a.js b/compiler/tests-js-parser/fail/13ce2dd24993176a.js new file mode 100644 index 000000000..56fcf4d9e --- /dev/null +++ b/compiler/tests-js-parser/fail/13ce2dd24993176a.js @@ -0,0 +1 @@ +for(let [a, a];;); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/143481afd6573e9b.js b/compiler/tests-js-parser/fail/143481afd6573e9b.js new file mode 100644 index 000000000..d5537dd3e --- /dev/null +++ b/compiler/tests-js-parser/fail/143481afd6573e9b.js @@ -0,0 +1 @@ +function* a({e: a.b}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/147fa078a7436e0e.js b/compiler/tests-js-parser/fail/147fa078a7436e0e.js new file mode 100644 index 000000000..cf73a4e7c --- /dev/null +++ b/compiler/tests-js-parser/fail/147fa078a7436e0e.js @@ -0,0 +1 @@ +function hello() { "octal directive\1"; "octal directive\2"; "use strict"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/14d6adc74d396c58.js b/compiler/tests-js-parser/fail/14d6adc74d396c58.js new file mode 100644 index 000000000..69e522755 --- /dev/null +++ b/compiler/tests-js-parser/fail/14d6adc74d396c58.js @@ -0,0 +1 @@ +[...x, y] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/14eaa7e71c682461.js b/compiler/tests-js-parser/fail/14eaa7e71c682461.js new file mode 100644 index 000000000..4788e4181 --- /dev/null +++ b/compiler/tests-js-parser/fail/14eaa7e71c682461.js @@ -0,0 +1 @@ +("\u{FFFFFFF}") \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/154f02d86fce5e81.js b/compiler/tests-js-parser/fail/154f02d86fce5e81.js new file mode 100644 index 000000000..2c6e10ed3 --- /dev/null +++ b/compiler/tests-js-parser/fail/154f02d86fce5e81.js @@ -0,0 +1 @@ +for (const x = 0 in y){} diff --git a/compiler/tests-js-parser/fail/15a6123f6b825c38.js b/compiler/tests-js-parser/fail/15a6123f6b825c38.js new file mode 100644 index 000000000..a7303d5dd --- /dev/null +++ b/compiler/tests-js-parser/fail/15a6123f6b825c38.js @@ -0,0 +1 @@ +function hello() { "octal directive\1"; "use strict"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/15ce7f870c38eaff.js b/compiler/tests-js-parser/fail/15ce7f870c38eaff.js new file mode 100644 index 000000000..f960bb216 --- /dev/null +++ b/compiler/tests-js-parser/fail/15ce7f870c38eaff.js @@ -0,0 +1 @@ +() ? 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/15de970e269ae56f.js b/compiler/tests-js-parser/fail/15de970e269ae56f.js new file mode 100644 index 000000000..9ee7f1123 --- /dev/null +++ b/compiler/tests-js-parser/fail/15de970e269ae56f.js @@ -0,0 +1 @@ +(1 + 1) = 10 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/15fde0c6d07e5d6d.js b/compiler/tests-js-parser/fail/15fde0c6d07e5d6d.js new file mode 100644 index 000000000..3a042f29c --- /dev/null +++ b/compiler/tests-js-parser/fail/15fde0c6d07e5d6d.js @@ -0,0 +1 @@ +1.e \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/168502012959421f.js b/compiler/tests-js-parser/fail/168502012959421f.js new file mode 100644 index 000000000..fa5676ee7 --- /dev/null +++ b/compiler/tests-js-parser/fail/168502012959421f.js @@ -0,0 +1 @@ +for(([a]) of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/16947dc1d11e5e70.js b/compiler/tests-js-parser/fail/16947dc1d11e5e70.js new file mode 100644 index 000000000..0fdfd886f --- /dev/null +++ b/compiler/tests-js-parser/fail/16947dc1d11e5e70.js @@ -0,0 +1 @@ +(function*yield(){}) diff --git a/compiler/tests-js-parser/fail/175c1c09015415e1.js b/compiler/tests-js-parser/fail/175c1c09015415e1.js new file mode 100644 index 000000000..ba68917fe --- /dev/null +++ b/compiler/tests-js-parser/fail/175c1c09015415e1.js @@ -0,0 +1 @@ +'use strict'; ('\41') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/17904d9a6b6ec31b.js b/compiler/tests-js-parser/fail/17904d9a6b6ec31b.js new file mode 100644 index 000000000..131192a6d --- /dev/null +++ b/compiler/tests-js-parser/fail/17904d9a6b6ec31b.js @@ -0,0 +1 @@ +f(..a) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/17ee4c1ca63f700d.js b/compiler/tests-js-parser/fail/17ee4c1ca63f700d.js new file mode 100644 index 000000000..08162d6a5 --- /dev/null +++ b/compiler/tests-js-parser/fail/17ee4c1ca63f700d.js @@ -0,0 +1 @@ +0B12 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/19699bcdea35eb46.js b/compiler/tests-js-parser/fail/19699bcdea35eb46.js new file mode 100644 index 000000000..fff55183c --- /dev/null +++ b/compiler/tests-js-parser/fail/19699bcdea35eb46.js @@ -0,0 +1 @@ +'use strict'; ('\4') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1976350e287d5156.js b/compiler/tests-js-parser/fail/1976350e287d5156.js new file mode 100644 index 000000000..5cdbfcd3e --- /dev/null +++ b/compiler/tests-js-parser/fail/1976350e287d5156.js @@ -0,0 +1 @@ +class A extends a + b {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1a32df2e8d4bea98.js b/compiler/tests-js-parser/fail/1a32df2e8d4bea98.js new file mode 100644 index 000000000..786e859b6 --- /dev/null +++ b/compiler/tests-js-parser/fail/1a32df2e8d4bea98.js @@ -0,0 +1 @@ +function *g() { var yield; } diff --git a/compiler/tests-js-parser/fail/1a5b0dfa9fde985d.js b/compiler/tests-js-parser/fail/1a5b0dfa9fde985d.js new file mode 100644 index 000000000..d11240e18 --- /dev/null +++ b/compiler/tests-js-parser/fail/1a5b0dfa9fde985d.js @@ -0,0 +1 @@ +function* f() { [yield {a = 0}]; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1a62d7bb44c06bd0.js b/compiler/tests-js-parser/fail/1a62d7bb44c06bd0.js new file mode 100644 index 000000000..9746c9111 --- /dev/null +++ b/compiler/tests-js-parser/fail/1a62d7bb44c06bd0.js @@ -0,0 +1 @@ +function t(if) { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1acada3c651821cf.js b/compiler/tests-js-parser/fail/1acada3c651821cf.js new file mode 100644 index 000000000..16c93f9e0 --- /dev/null +++ b/compiler/tests-js-parser/fail/1acada3c651821cf.js @@ -0,0 +1 @@ +`hello ${10;test` \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1ad1143aa95cf8bf.js b/compiler/tests-js-parser/fail/1ad1143aa95cf8bf.js new file mode 100644 index 000000000..335150598 --- /dev/null +++ b/compiler/tests-js-parser/fail/1ad1143aa95cf8bf.js @@ -0,0 +1 @@ +\uD800x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1aefe47e20eb91fa.module.js b/compiler/tests-js-parser/fail/1aefe47e20eb91fa.module.js new file mode 100644 index 000000000..623375662 --- /dev/null +++ b/compiler/tests-js-parser/fail/1aefe47e20eb91fa.module.js @@ -0,0 +1 @@ +await \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1b0b9bca042d4440.module.js b/compiler/tests-js-parser/fail/1b0b9bca042d4440.module.js new file mode 100644 index 000000000..9b12e6419 --- /dev/null +++ b/compiler/tests-js-parser/fail/1b0b9bca042d4440.module.js @@ -0,0 +1 @@ +export 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1b2e164ac5015a12.js b/compiler/tests-js-parser/fail/1b2e164ac5015a12.js new file mode 100644 index 000000000..d5e70a757 --- /dev/null +++ b/compiler/tests-js-parser/fail/1b2e164ac5015a12.js @@ -0,0 +1 @@ +({a({e: a.b}){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1b518d6a4144ec99.js b/compiler/tests-js-parser/fail/1b518d6a4144ec99.js new file mode 100644 index 000000000..8afd64d25 --- /dev/null +++ b/compiler/tests-js-parser/fail/1b518d6a4144ec99.js @@ -0,0 +1 @@ +a\o \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1b87f4048bac9335.js b/compiler/tests-js-parser/fail/1b87f4048bac9335.js new file mode 100644 index 000000000..bfdfb98f8 --- /dev/null +++ b/compiler/tests-js-parser/fail/1b87f4048bac9335.js @@ -0,0 +1 @@ +[...{a: 0}] = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1bc43dd97a16b9bb.module.js b/compiler/tests-js-parser/fail/1bc43dd97a16b9bb.module.js new file mode 100644 index 000000000..faadb8d0e --- /dev/null +++ b/compiler/tests-js-parser/fail/1bc43dd97a16b9bb.module.js @@ -0,0 +1 @@ +import {}; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1bde73ba53c309c8.js b/compiler/tests-js-parser/fail/1bde73ba53c309c8.js new file mode 100644 index 000000000..c55ce5513 --- /dev/null +++ b/compiler/tests-js-parser/fail/1bde73ba53c309c8.js @@ -0,0 +1 @@ +({ *[yield iter]() {} }) diff --git a/compiler/tests-js-parser/fail/1c04d8bc2ab25c1e.js b/compiler/tests-js-parser/fail/1c04d8bc2ab25c1e.js new file mode 100644 index 000000000..e7d066cf2 --- /dev/null +++ b/compiler/tests-js-parser/fail/1c04d8bc2ab25c1e.js @@ -0,0 +1 @@ +'use strict'; `\00`; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1c4f1040317d4869.js b/compiler/tests-js-parser/fail/1c4f1040317d4869.js new file mode 100644 index 000000000..ecbca055a --- /dev/null +++ b/compiler/tests-js-parser/fail/1c4f1040317d4869.js @@ -0,0 +1 @@ +break 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1c6ba8177a9624f0.js b/compiler/tests-js-parser/fail/1c6ba8177a9624f0.js new file mode 100644 index 000000000..4ac635a84 --- /dev/null +++ b/compiler/tests-js-parser/fail/1c6ba8177a9624f0.js @@ -0,0 +1 @@ +/* diff --git a/compiler/tests-js-parser/fail/1f6b80ce4e3e3509.js b/compiler/tests-js-parser/fail/1f6b80ce4e3e3509.js new file mode 100644 index 000000000..5af2393b8 --- /dev/null +++ b/compiler/tests-js-parser/fail/1f6b80ce4e3e3509.js @@ -0,0 +1 @@ +3e- \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1f7f17241661662d.js b/compiler/tests-js-parser/fail/1f7f17241661662d.js new file mode 100644 index 000000000..664eb4fb6 --- /dev/null +++ b/compiler/tests-js-parser/fail/1f7f17241661662d.js @@ -0,0 +1 @@ +[]=>0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1fc70bca408f884c.js b/compiler/tests-js-parser/fail/1fc70bca408f884c.js new file mode 100644 index 000000000..67e103798 --- /dev/null +++ b/compiler/tests-js-parser/fail/1fc70bca408f884c.js @@ -0,0 +1 @@ +export var await \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/1fc78fd0e00f4e92.js b/compiler/tests-js-parser/fail/1fc78fd0e00f4e92.js new file mode 100644 index 000000000..1b27d3ab6 --- /dev/null +++ b/compiler/tests-js-parser/fail/1fc78fd0e00f4e92.js @@ -0,0 +1 @@ +function default() {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2079bad53fe76b1d.js b/compiler/tests-js-parser/fail/2079bad53fe76b1d.js new file mode 100644 index 000000000..c6bdc6dd8 --- /dev/null +++ b/compiler/tests-js-parser/fail/2079bad53fe76b1d.js @@ -0,0 +1 @@ +with(x) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/211656c4eaff2d9c.js b/compiler/tests-js-parser/fail/211656c4eaff2d9c.js new file mode 100644 index 000000000..6c1fa23ec --- /dev/null +++ b/compiler/tests-js-parser/fail/211656c4eaff2d9c.js @@ -0,0 +1,2 @@ +a +=> 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/219ce45c23f9e1cc.js b/compiler/tests-js-parser/fail/219ce45c23f9e1cc.js new file mode 100644 index 000000000..60ae5ccce --- /dev/null +++ b/compiler/tests-js-parser/fail/219ce45c23f9e1cc.js @@ -0,0 +1 @@ +function if() { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2226edabbd2261a7.module.js b/compiler/tests-js-parser/fail/2226edabbd2261a7.module.js new file mode 100644 index 000000000..bfea3dac6 --- /dev/null +++ b/compiler/tests-js-parser/fail/2226edabbd2261a7.module.js @@ -0,0 +1 @@ +function f() { var await } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/23368c25ea374e2f.js b/compiler/tests-js-parser/fail/23368c25ea374e2f.js new file mode 100644 index 000000000..edb5ea614 --- /dev/null +++ b/compiler/tests-js-parser/fail/23368c25ea374e2f.js @@ -0,0 +1 @@ +(a,b)=(c,d); diff --git a/compiler/tests-js-parser/fail/235adc0d4af204c6.js b/compiler/tests-js-parser/fail/235adc0d4af204c6.js new file mode 100644 index 000000000..2c2ab927f --- /dev/null +++ b/compiler/tests-js-parser/fail/235adc0d4af204c6.js @@ -0,0 +1 @@ +var [a.b] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/245843abef9e72e7.js b/compiler/tests-js-parser/fail/245843abef9e72e7.js new file mode 100644 index 000000000..8e2f0bef1 --- /dev/null +++ b/compiler/tests-js-parser/fail/245843abef9e72e7.js @@ -0,0 +1 @@ +[ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/247e71c8786de6b6.js b/compiler/tests-js-parser/fail/247e71c8786de6b6.js new file mode 100644 index 000000000..8a97652fa --- /dev/null +++ b/compiler/tests-js-parser/fail/247e71c8786de6b6.js @@ -0,0 +1 @@ +(function() { "use strict"; f(yield v) }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/25b1013a4046bd70.js b/compiler/tests-js-parser/fail/25b1013a4046bd70.js new file mode 100644 index 000000000..134603057 --- /dev/null +++ b/compiler/tests-js-parser/fail/25b1013a4046bd70.js @@ -0,0 +1 @@ +try {} catch (answer()) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/26031afc9eaef976.js b/compiler/tests-js-parser/fail/26031afc9eaef976.js new file mode 100644 index 000000000..410a94b48 --- /dev/null +++ b/compiler/tests-js-parser/fail/26031afc9eaef976.js @@ -0,0 +1 @@ +a\u11z \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/265fda17a34611b1.js b/compiler/tests-js-parser/fail/265fda17a34611b1.js new file mode 100644 index 000000000..ad2823b48 --- /dev/null +++ b/compiler/tests-js-parser/fail/265fda17a34611b1.js @@ -0,0 +1 @@ +' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2687d6d9043bd5cb.js b/compiler/tests-js-parser/fail/2687d6d9043bd5cb.js new file mode 100644 index 000000000..3487e9334 --- /dev/null +++ b/compiler/tests-js-parser/fail/2687d6d9043bd5cb.js @@ -0,0 +1 @@ +"\u{}" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/26c0710a6449872a.module.js b/compiler/tests-js-parser/fail/26c0710a6449872a.module.js new file mode 100644 index 000000000..559e18dd1 --- /dev/null +++ b/compiler/tests-js-parser/fail/26c0710a6449872a.module.js @@ -0,0 +1 @@ +export {as b} from a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/26d1675c03b0ce51.js b/compiler/tests-js-parser/fail/26d1675c03b0ce51.js new file mode 100644 index 000000000..9c39e64b4 --- /dev/null +++ b/compiler/tests-js-parser/fail/26d1675c03b0ce51.js @@ -0,0 +1 @@ +export { default as foo } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/26de1e8cdfa61321.js b/compiler/tests-js-parser/fail/26de1e8cdfa61321.js new file mode 100644 index 000000000..dc8424ab9 --- /dev/null +++ b/compiler/tests-js-parser/fail/26de1e8cdfa61321.js @@ -0,0 +1 @@ +i + 2 = 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/26f0d66be5e7895a.js b/compiler/tests-js-parser/fail/26f0d66be5e7895a.js new file mode 100644 index 000000000..71b98df67 --- /dev/null +++ b/compiler/tests-js-parser/fail/26f0d66be5e7895a.js @@ -0,0 +1 @@ +if(false) doThis(); else \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2774b3cce5a09798.js b/compiler/tests-js-parser/fail/2774b3cce5a09798.js new file mode 100644 index 000000000..198270174 --- /dev/null +++ b/compiler/tests-js-parser/fail/2774b3cce5a09798.js @@ -0,0 +1 @@ +(function *(x, ...yield){}) diff --git a/compiler/tests-js-parser/fail/27e55098f070e9ef.js b/compiler/tests-js-parser/fail/27e55098f070e9ef.js new file mode 100644 index 000000000..236cff3fa --- /dev/null +++ b/compiler/tests-js-parser/fail/27e55098f070e9ef.js @@ -0,0 +1 @@ +"\u{FFFF" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/28151222a45ac800.js b/compiler/tests-js-parser/fail/28151222a45ac800.js new file mode 100644 index 000000000..c8fa3ee59 --- /dev/null +++ b/compiler/tests-js-parser/fail/28151222a45ac800.js @@ -0,0 +1 @@ +\ua \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/28520880d460c4f9.js b/compiler/tests-js-parser/fail/28520880d460c4f9.js new file mode 100644 index 000000000..3781f00e7 --- /dev/null +++ b/compiler/tests-js-parser/fail/28520880d460c4f9.js @@ -0,0 +1 @@ +({a: b = 0, c = 0}); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2884c585d2f035a5.js b/compiler/tests-js-parser/fail/2884c585d2f035a5.js new file mode 100644 index 000000000..a48b9b00e --- /dev/null +++ b/compiler/tests-js-parser/fail/2884c585d2f035a5.js @@ -0,0 +1 @@ +(([a])=0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2945f2ec8c9f3483.js b/compiler/tests-js-parser/fail/2945f2ec8c9f3483.js new file mode 100644 index 000000000..a006aa6b3 --- /dev/null +++ b/compiler/tests-js-parser/fail/2945f2ec8c9f3483.js @@ -0,0 +1 @@ +i #= 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/295b0ed4d7872983.js b/compiler/tests-js-parser/fail/295b0ed4d7872983.js new file mode 100644 index 000000000..c422002b8 --- /dev/null +++ b/compiler/tests-js-parser/fail/295b0ed4d7872983.js @@ -0,0 +1 @@ +'use strict'; ('\00') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/29fb02620b662387.js b/compiler/tests-js-parser/fail/29fb02620b662387.js new file mode 100644 index 000000000..37211a0d3 --- /dev/null +++ b/compiler/tests-js-parser/fail/29fb02620b662387.js @@ -0,0 +1 @@ +for(let [let];;); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2b050de45ab44c8c.js b/compiler/tests-js-parser/fail/2b050de45ab44c8c.js new file mode 100644 index 000000000..2b5eb5d3d --- /dev/null +++ b/compiler/tests-js-parser/fail/2b050de45ab44c8c.js @@ -0,0 +1 @@ +for (var x = 1 of y); diff --git a/compiler/tests-js-parser/fail/2b8d54f6fc1dcbd6.js b/compiler/tests-js-parser/fail/2b8d54f6fc1dcbd6.js new file mode 100644 index 000000000..7eff32a5f --- /dev/null +++ b/compiler/tests-js-parser/fail/2b8d54f6fc1dcbd6.js @@ -0,0 +1 @@ +function*g(){ var yield = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2c1d54df80263e07.js b/compiler/tests-js-parser/fail/2c1d54df80263e07.js new file mode 100644 index 000000000..a34027e98 --- /dev/null +++ b/compiler/tests-js-parser/fail/2c1d54df80263e07.js @@ -0,0 +1 @@ +�\ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2cbdd5fad4e5332d.js b/compiler/tests-js-parser/fail/2cbdd5fad4e5332d.js new file mode 100644 index 000000000..4a1cd602a --- /dev/null +++ b/compiler/tests-js-parser/fail/2cbdd5fad4e5332d.js @@ -0,0 +1,2 @@ +var x, + y,; diff --git a/compiler/tests-js-parser/fail/2cfb3ee18926479e.js b/compiler/tests-js-parser/fail/2cfb3ee18926479e.js new file mode 100644 index 000000000..ba39fedac --- /dev/null +++ b/compiler/tests-js-parser/fail/2cfb3ee18926479e.js @@ -0,0 +1 @@ +let [] diff --git a/compiler/tests-js-parser/fail/2d1410e37ecc3647.js b/compiler/tests-js-parser/fail/2d1410e37ecc3647.js new file mode 100644 index 000000000..600f00187 --- /dev/null +++ b/compiler/tests-js-parser/fail/2d1410e37ecc3647.js @@ -0,0 +1 @@ +function f(a, ...b = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2d46c7c14cfb0330.js b/compiler/tests-js-parser/fail/2d46c7c14cfb0330.js new file mode 100644 index 000000000..b86f21808 --- /dev/null +++ b/compiler/tests-js-parser/fail/2d46c7c14cfb0330.js @@ -0,0 +1 @@ +function hello() { 'use strict'; "\1"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2d86a01ca9731879.module.js b/compiler/tests-js-parser/fail/2d86a01ca9731879.module.js new file mode 100644 index 000000000..f2b76f671 --- /dev/null +++ b/compiler/tests-js-parser/fail/2d86a01ca9731879.module.js @@ -0,0 +1 @@ +export {a,b} from a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2dddc87017946cca.js b/compiler/tests-js-parser/fail/2dddc87017946cca.js new file mode 100644 index 000000000..fa450c2fc --- /dev/null +++ b/compiler/tests-js-parser/fail/2dddc87017946cca.js @@ -0,0 +1 @@ +import foo \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2e6ef2acc3ed75a9.module.js b/compiler/tests-js-parser/fail/2e6ef2acc3ed75a9.module.js new file mode 100644 index 000000000..7da07a17c --- /dev/null +++ b/compiler/tests-js-parser/fail/2e6ef2acc3ed75a9.module.js @@ -0,0 +1 @@ +export {a,b} from \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2e8378f658290622.js b/compiler/tests-js-parser/fail/2e8378f658290622.js new file mode 100644 index 000000000..296d2bb39 --- /dev/null +++ b/compiler/tests-js-parser/fail/2e8378f658290622.js @@ -0,0 +1 @@ +for (+i in {}); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2e95646f9143563e.js b/compiler/tests-js-parser/fail/2e95646f9143563e.js new file mode 100644 index 000000000..9cc2c678a --- /dev/null +++ b/compiler/tests-js-parser/fail/2e95646f9143563e.js @@ -0,0 +1 @@ +\u0000 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2ea49149c8e6373d.js b/compiler/tests-js-parser/fail/2ea49149c8e6373d.js new file mode 100644 index 000000000..eacba6a01 --- /dev/null +++ b/compiler/tests-js-parser/fail/2ea49149c8e6373d.js @@ -0,0 +1 @@ +`${a}a${b} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2f4d2b0c0c1f960f.js b/compiler/tests-js-parser/fail/2f4d2b0c0c1f960f.js new file mode 100644 index 000000000..2474c3076 --- /dev/null +++ b/compiler/tests-js-parser/fail/2f4d2b0c0c1f960f.js @@ -0,0 +1 @@ +0b12 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2f95824f19005b11.js b/compiler/tests-js-parser/fail/2f95824f19005b11.js new file mode 100644 index 000000000..5c727ca5c --- /dev/null +++ b/compiler/tests-js-parser/fail/2f95824f19005b11.js @@ -0,0 +1 @@ +var a = { set foo(...v) {} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/2fa321f0374c7017.js b/compiler/tests-js-parser/fail/2fa321f0374c7017.js new file mode 100644 index 000000000..8ddb65cc4 --- /dev/null +++ b/compiler/tests-js-parser/fail/2fa321f0374c7017.js @@ -0,0 +1 @@ +var _ð–«µ = 11; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/302a0dfffc3edf37.js b/compiler/tests-js-parser/fail/302a0dfffc3edf37.js new file mode 100644 index 000000000..bae08446b --- /dev/null +++ b/compiler/tests-js-parser/fail/302a0dfffc3edf37.js @@ -0,0 +1 @@ +import * as class from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/305ebbf168c6d218.js b/compiler/tests-js-parser/fail/305ebbf168c6d218.js new file mode 100644 index 000000000..306429be0 --- /dev/null +++ b/compiler/tests-js-parser/fail/305ebbf168c6d218.js @@ -0,0 +1 @@ +let x, diff --git a/compiler/tests-js-parser/fail/3078b4fed5626e2a.js b/compiler/tests-js-parser/fail/3078b4fed5626e2a.js new file mode 100644 index 000000000..846bc4e3c --- /dev/null +++ b/compiler/tests-js-parser/fail/3078b4fed5626e2a.js @@ -0,0 +1 @@ +'use strict'; 08 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/30d72b2b7f70b4d7.js b/compiler/tests-js-parser/fail/30d72b2b7f70b4d7.js new file mode 100644 index 000000000..5aa6590fe --- /dev/null +++ b/compiler/tests-js-parser/fail/30d72b2b7f70b4d7.js @@ -0,0 +1 @@ +\o \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/30f6acf0bf2f7f06.js b/compiler/tests-js-parser/fail/30f6acf0bf2f7f06.js new file mode 100644 index 000000000..e9aafb363 --- /dev/null +++ b/compiler/tests-js-parser/fail/30f6acf0bf2f7f06.js @@ -0,0 +1 @@ +function *g(){ (a, b, c, yield) => 42 } diff --git a/compiler/tests-js-parser/fail/3118eaa619345896.js b/compiler/tests-js-parser/fail/3118eaa619345896.js new file mode 100644 index 000000000..7465fdb40 --- /dev/null +++ b/compiler/tests-js-parser/fail/3118eaa619345896.js @@ -0,0 +1,2 @@ +/* +*/] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3162394f5bc07198.js b/compiler/tests-js-parser/fail/3162394f5bc07198.js new file mode 100644 index 000000000..f36db0ace --- /dev/null +++ b/compiler/tests-js-parser/fail/3162394f5bc07198.js @@ -0,0 +1 @@ +for(const a = 0 in b); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3178dcc570888e15.js b/compiler/tests-js-parser/fail/3178dcc570888e15.js new file mode 100644 index 000000000..9ccba00e4 --- /dev/null +++ b/compiler/tests-js-parser/fail/3178dcc570888e15.js @@ -0,0 +1 @@ +function true() { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/317c81f05510f4ad.js b/compiler/tests-js-parser/fail/317c81f05510f4ad.js new file mode 100644 index 000000000..7a250e12d --- /dev/null +++ b/compiler/tests-js-parser/fail/317c81f05510f4ad.js @@ -0,0 +1 @@ +for (var {x} = y of z); diff --git a/compiler/tests-js-parser/fail/320eade064b2c635.js b/compiler/tests-js-parser/fail/320eade064b2c635.js new file mode 100644 index 000000000..b82b97aa7 --- /dev/null +++ b/compiler/tests-js-parser/fail/320eade064b2c635.js @@ -0,0 +1 @@ +a: function* a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/324ab48c6d89125d.js b/compiler/tests-js-parser/fail/324ab48c6d89125d.js new file mode 100644 index 000000000..2afdf76ea --- /dev/null +++ b/compiler/tests-js-parser/fail/324ab48c6d89125d.js @@ -0,0 +1 @@ +function f() { new..target; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/32529ec69f32cac1.js b/compiler/tests-js-parser/fail/32529ec69f32cac1.js new file mode 100644 index 000000000..d36903158 --- /dev/null +++ b/compiler/tests-js-parser/fail/32529ec69f32cac1.js @@ -0,0 +1 @@ +(function *(yield){}) diff --git a/compiler/tests-js-parser/fail/328fddc7bdffb499.js b/compiler/tests-js-parser/fail/328fddc7bdffb499.js new file mode 100644 index 000000000..5ca8b641d --- /dev/null +++ b/compiler/tests-js-parser/fail/328fddc7bdffb499.js @@ -0,0 +1 @@ +function*g({yield}){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/338848861369f3b7.js b/compiler/tests-js-parser/fail/338848861369f3b7.js new file mode 100644 index 000000000..237b140f9 --- /dev/null +++ b/compiler/tests-js-parser/fail/338848861369f3b7.js @@ -0,0 +1 @@ +(function(...a, b){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/33bc068464342558.js b/compiler/tests-js-parser/fail/33bc068464342558.js new file mode 100644 index 000000000..e26d95883 --- /dev/null +++ b/compiler/tests-js-parser/fail/33bc068464342558.js @@ -0,0 +1 @@ +(class {a:0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/33cf50480671cfec.js b/compiler/tests-js-parser/fail/33cf50480671cfec.js new file mode 100644 index 000000000..362e0fffb --- /dev/null +++ b/compiler/tests-js-parser/fail/33cf50480671cfec.js @@ -0,0 +1 @@ +try { } catch() {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/33d43e9f01bda5ce.js b/compiler/tests-js-parser/fail/33d43e9f01bda5ce.js new file mode 100644 index 000000000..6686af738 --- /dev/null +++ b/compiler/tests-js-parser/fail/33d43e9f01bda5ce.js @@ -0,0 +1 @@ +for (let x = 0 in y){} diff --git a/compiler/tests-js-parser/fail/3425ca087ec1adb1.js b/compiler/tests-js-parser/fail/3425ca087ec1adb1.js new file mode 100644 index 000000000..e6d7b0640 --- /dev/null +++ b/compiler/tests-js-parser/fail/3425ca087ec1adb1.js @@ -0,0 +1 @@ +var {x: y = yield 3} = z; diff --git a/compiler/tests-js-parser/fail/346316bef54d805a.js b/compiler/tests-js-parser/fail/346316bef54d805a.js new file mode 100644 index 000000000..604229286 --- /dev/null +++ b/compiler/tests-js-parser/fail/346316bef54d805a.js @@ -0,0 +1 @@ +([a,...b,])=>0; diff --git a/compiler/tests-js-parser/fail/3558f8c0f0ba825b.js b/compiler/tests-js-parser/fail/3558f8c0f0ba825b.js new file mode 100644 index 000000000..c8641016c --- /dev/null +++ b/compiler/tests-js-parser/fail/3558f8c0f0ba825b.js @@ -0,0 +1 @@ +class A extends B { constructor() { (super).a(); } } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/35e93eb65d07f8e8.js b/compiler/tests-js-parser/fail/35e93eb65d07f8e8.js new file mode 100644 index 000000000..ccd6e8857 --- /dev/null +++ b/compiler/tests-js-parser/fail/35e93eb65d07f8e8.js @@ -0,0 +1 @@ +3x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/363ecb9e2e556694.js b/compiler/tests-js-parser/fail/363ecb9e2e556694.js new file mode 100644 index 000000000..5f6a3034b --- /dev/null +++ b/compiler/tests-js-parser/fail/363ecb9e2e556694.js @@ -0,0 +1 @@ +new f(... ... g); diff --git a/compiler/tests-js-parser/fail/364c1c6fe5df4e6c.js b/compiler/tests-js-parser/fail/364c1c6fe5df4e6c.js new file mode 100644 index 000000000..ba5e91a72 --- /dev/null +++ b/compiler/tests-js-parser/fail/364c1c6fe5df4e6c.js @@ -0,0 +1 @@ +try {} catch (42) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/369676814db0cbbf.js b/compiler/tests-js-parser/fail/369676814db0cbbf.js new file mode 100644 index 000000000..580951675 --- /dev/null +++ b/compiler/tests-js-parser/fail/369676814db0cbbf.js @@ -0,0 +1 @@ +({set a({e: a.b}){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/36c32455da0fd7e8.js b/compiler/tests-js-parser/fail/36c32455da0fd7e8.js new file mode 100644 index 000000000..caeb70b51 --- /dev/null +++ b/compiler/tests-js-parser/fail/36c32455da0fd7e8.js @@ -0,0 +1 @@ +[0,{a=0}] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/379c49fbf3259511.js b/compiler/tests-js-parser/fail/379c49fbf3259511.js new file mode 100644 index 000000000..b9d25c43a --- /dev/null +++ b/compiler/tests-js-parser/fail/379c49fbf3259511.js @@ -0,0 +1 @@ +throw /* 
 */ e \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/37b860dbda4d4c9c.js b/compiler/tests-js-parser/fail/37b860dbda4d4c9c.js new file mode 100644 index 000000000..e88270d51 --- /dev/null +++ b/compiler/tests-js-parser/fail/37b860dbda4d4c9c.js @@ -0,0 +1 @@ +(function() { yield 3; }) diff --git a/compiler/tests-js-parser/fail/37cb7557997d4fd6.js b/compiler/tests-js-parser/fail/37cb7557997d4fd6.js new file mode 100644 index 000000000..81be20f00 --- /dev/null +++ b/compiler/tests-js-parser/fail/37cb7557997d4fd6.js @@ -0,0 +1 @@ +"use strict"; for (let [a = let];;) {} diff --git a/compiler/tests-js-parser/fail/37e9fb0470e7ec3d.js b/compiler/tests-js-parser/fail/37e9fb0470e7ec3d.js new file mode 100644 index 000000000..e07ce9b0a --- /dev/null +++ b/compiler/tests-js-parser/fail/37e9fb0470e7ec3d.js @@ -0,0 +1 @@ +'use strict'; ('\000') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/386cf314bb05acda.js b/compiler/tests-js-parser/fail/386cf314bb05acda.js new file mode 100644 index 000000000..00a258400 --- /dev/null +++ b/compiler/tests-js-parser/fail/386cf314bb05acda.js @@ -0,0 +1 @@ +"\ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/38816d56f582672f.js b/compiler/tests-js-parser/fail/38816d56f582672f.js new file mode 100644 index 000000000..e9e0b39fe --- /dev/null +++ b/compiler/tests-js-parser/fail/38816d56f582672f.js @@ -0,0 +1 @@ +[v] += ary \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/39551fb86dcd3b29.js b/compiler/tests-js-parser/fail/39551fb86dcd3b29.js new file mode 100644 index 000000000..1f0f3b5c5 --- /dev/null +++ b/compiler/tests-js-parser/fail/39551fb86dcd3b29.js @@ -0,0 +1 @@ +for (const let = 1;;;) {} diff --git a/compiler/tests-js-parser/fail/3990bb94b19b1071.module.js b/compiler/tests-js-parser/fail/3990bb94b19b1071.module.js new file mode 100644 index 000000000..32a4537cd --- /dev/null +++ b/compiler/tests-js-parser/fail/3990bb94b19b1071.module.js @@ -0,0 +1 @@ +('\1') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/39a0bd52fcde419f.js b/compiler/tests-js-parser/fail/39a0bd52fcde419f.js new file mode 100644 index 000000000..da343da20 --- /dev/null +++ b/compiler/tests-js-parser/fail/39a0bd52fcde419f.js @@ -0,0 +1 @@ +export * \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3a3e59edfed719b0.js b/compiler/tests-js-parser/fail/3a3e59edfed719b0.js new file mode 100644 index 000000000..67f4e9ae3 --- /dev/null +++ b/compiler/tests-js-parser/fail/3a3e59edfed719b0.js @@ -0,0 +1 @@ +({ obj:20 }) = 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3a9fa392421db6dd.js b/compiler/tests-js-parser/fail/3a9fa392421db6dd.js new file mode 100644 index 000000000..35c90e794 --- /dev/null +++ b/compiler/tests-js-parser/fail/3a9fa392421db6dd.js @@ -0,0 +1 @@ +({[a,b]:0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3b473034dde14c98.js b/compiler/tests-js-parser/fail/3b473034dde14c98.js new file mode 100644 index 000000000..ce2c7dfa9 --- /dev/null +++ b/compiler/tests-js-parser/fail/3b473034dde14c98.js @@ -0,0 +1 @@ +"\xx"; diff --git a/compiler/tests-js-parser/fail/3b6f737a4ac948a8.js b/compiler/tests-js-parser/fail/3b6f737a4ac948a8.js new file mode 100644 index 000000000..a5f4a0795 --- /dev/null +++ b/compiler/tests-js-parser/fail/3b6f737a4ac948a8.js @@ -0,0 +1 @@ +({a:b[0]})=>0 diff --git a/compiler/tests-js-parser/fail/3bbeaf1dd9ca1159.js b/compiler/tests-js-parser/fail/3bbeaf1dd9ca1159.js new file mode 100644 index 000000000..5fc2a5f3e --- /dev/null +++ b/compiler/tests-js-parser/fail/3bbeaf1dd9ca1159.js @@ -0,0 +1 @@ +({ 5 }) => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3bc2b27a7430f818.js b/compiler/tests-js-parser/fail/3bc2b27a7430f818.js new file mode 100644 index 000000000..584201bc5 --- /dev/null +++ b/compiler/tests-js-parser/fail/3bc2b27a7430f818.js @@ -0,0 +1 @@ + "\1"; 'use strict'; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3c644395035bbe46.js b/compiler/tests-js-parser/fail/3c644395035bbe46.js new file mode 100644 index 000000000..38f8bb719 --- /dev/null +++ b/compiler/tests-js-parser/fail/3c644395035bbe46.js @@ -0,0 +1 @@ +3in[] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3d3e6ce2b81a224d.js b/compiler/tests-js-parser/fail/3d3e6ce2b81a224d.js new file mode 100644 index 000000000..0b4149040 --- /dev/null +++ b/compiler/tests-js-parser/fail/3d3e6ce2b81a224d.js @@ -0,0 +1 @@ +[[[[[[[[[[[[[[[[[[[[{a=b}]]]]]]]]]]]]]]]]]]]] diff --git a/compiler/tests-js-parser/fail/3dbb6e166b14a6c0.js b/compiler/tests-js-parser/fail/3dbb6e166b14a6c0.js new file mode 100644 index 000000000..33a10c89c --- /dev/null +++ b/compiler/tests-js-parser/fail/3dbb6e166b14a6c0.js @@ -0,0 +1 @@ +function a() { new.\u0074arget; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3e298e6e882d5cad.js b/compiler/tests-js-parser/fail/3e298e6e882d5cad.js new file mode 100644 index 000000000..ee2270234 --- /dev/null +++ b/compiler/tests-js-parser/fail/3e298e6e882d5cad.js @@ -0,0 +1 @@ +with(true) let a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3e6146fd7daff493.js b/compiler/tests-js-parser/fail/3e6146fd7daff493.js new file mode 100644 index 000000000..3cee0cd40 --- /dev/null +++ b/compiler/tests-js-parser/fail/3e6146fd7daff493.js @@ -0,0 +1 @@ +for(;;) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3f70195fa344151e.js b/compiler/tests-js-parser/fail/3f70195fa344151e.js new file mode 100644 index 000000000..07afe03dd --- /dev/null +++ b/compiler/tests-js-parser/fail/3f70195fa344151e.js @@ -0,0 +1 @@ +new X()."s" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/3f9ce9123e9ea7cb.js b/compiler/tests-js-parser/fail/3f9ce9123e9ea7cb.js new file mode 100644 index 000000000..6ceadd20a --- /dev/null +++ b/compiler/tests-js-parser/fail/3f9ce9123e9ea7cb.js @@ -0,0 +1 @@ +function a([a.b]) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/40449ddc6ec37b35.js b/compiler/tests-js-parser/fail/40449ddc6ec37b35.js new file mode 100644 index 000000000..42152f80d --- /dev/null +++ b/compiler/tests-js-parser/fail/40449ddc6ec37b35.js @@ -0,0 +1 @@ +() => {}() \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4045c354c559bed0.js b/compiler/tests-js-parser/fail/4045c354c559bed0.js new file mode 100644 index 000000000..d21f17465 --- /dev/null +++ b/compiler/tests-js-parser/fail/4045c354c559bed0.js @@ -0,0 +1 @@ +({0} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/412beffc411b3cb1.js b/compiler/tests-js-parser/fail/412beffc411b3cb1.js new file mode 100644 index 000000000..88969c4e9 --- /dev/null +++ b/compiler/tests-js-parser/fail/412beffc411b3cb1.js @@ -0,0 +1 @@ +a\x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/414f485082a04cbe.js b/compiler/tests-js-parser/fail/414f485082a04cbe.js new file mode 100644 index 000000000..204bdc4e5 --- /dev/null +++ b/compiler/tests-js-parser/fail/414f485082a04cbe.js @@ -0,0 +1 @@ +var const \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/41895c8145489971.js b/compiler/tests-js-parser/fail/41895c8145489971.js new file mode 100644 index 000000000..7e96238c7 --- /dev/null +++ b/compiler/tests-js-parser/fail/41895c8145489971.js @@ -0,0 +1 @@ +`hello ${10 `test` \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/41bb6cfb5f18770c.js b/compiler/tests-js-parser/fail/41bb6cfb5f18770c.js new file mode 100644 index 000000000..c4a6a8f6b --- /dev/null +++ b/compiler/tests-js-parser/fail/41bb6cfb5f18770c.js @@ -0,0 +1 @@ +import { a as class } from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/41dc02fc2a2ab563.js b/compiler/tests-js-parser/fail/41dc02fc2a2ab563.js new file mode 100644 index 000000000..aa46d139e --- /dev/null +++ b/compiler/tests-js-parser/fail/41dc02fc2a2ab563.js @@ -0,0 +1 @@ +() ? 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/420d5571366f2df6.js b/compiler/tests-js-parser/fail/420d5571366f2df6.js new file mode 100644 index 000000000..98fe21c70 --- /dev/null +++ b/compiler/tests-js-parser/fail/420d5571366f2df6.js @@ -0,0 +1 @@ +try {} catch (-x) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/42cb3f2a38cb2930.js b/compiler/tests-js-parser/fail/42cb3f2a38cb2930.js new file mode 100644 index 000000000..db9e136f4 --- /dev/null +++ b/compiler/tests-js-parser/fail/42cb3f2a38cb2930.js @@ -0,0 +1,2 @@ +/* +*/] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4485930b35bf8cb6.js b/compiler/tests-js-parser/fail/4485930b35bf8cb6.js new file mode 100644 index 000000000..0b45806e0 --- /dev/null +++ b/compiler/tests-js-parser/fail/4485930b35bf8cb6.js @@ -0,0 +1 @@ +[...a, b] = c \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/44dda972051e652d.js b/compiler/tests-js-parser/fail/44dda972051e652d.js new file mode 100644 index 000000000..375786f2b --- /dev/null +++ b/compiler/tests-js-parser/fail/44dda972051e652d.js @@ -0,0 +1 @@ +class A { get prop(x) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4554c00dbb28cad8.js b/compiler/tests-js-parser/fail/4554c00dbb28cad8.js new file mode 100644 index 000000000..ea9b101e1 --- /dev/null +++ b/compiler/tests-js-parser/fail/4554c00dbb28cad8.js @@ -0,0 +1 @@ +export default function () {} diff --git a/compiler/tests-js-parser/fail/455c19cd6608ab5d.module.js b/compiler/tests-js-parser/fail/455c19cd6608ab5d.module.js new file mode 100644 index 000000000..ae0f00279 --- /dev/null +++ b/compiler/tests-js-parser/fail/455c19cd6608ab5d.module.js @@ -0,0 +1 @@ +export {a as} from a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/45b295d6c9abe25d.js b/compiler/tests-js-parser/fail/45b295d6c9abe25d.js new file mode 100644 index 000000000..f34ab0f70 --- /dev/null +++ b/compiler/tests-js-parser/fail/45b295d6c9abe25d.js @@ -0,0 +1 @@ +({ * }) diff --git a/compiler/tests-js-parser/fail/45cb305cf7a07edd.js b/compiler/tests-js-parser/fail/45cb305cf7a07edd.js new file mode 100644 index 000000000..06c253f37 --- /dev/null +++ b/compiler/tests-js-parser/fail/45cb305cf7a07edd.js @@ -0,0 +1 @@ +({ set prop() {} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/45db351b2b07663a.module.js b/compiler/tests-js-parser/fail/45db351b2b07663a.module.js new file mode 100644 index 000000000..36985b530 --- /dev/null +++ b/compiler/tests-js-parser/fail/45db351b2b07663a.module.js @@ -0,0 +1 @@ +export / from a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/464c40302f9a1a10.js b/compiler/tests-js-parser/fail/464c40302f9a1a10.js new file mode 100644 index 000000000..08eb2e095 --- /dev/null +++ b/compiler/tests-js-parser/fail/464c40302f9a1a10.js @@ -0,0 +1 @@ +x\ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/479332b63ff26de1.js b/compiler/tests-js-parser/fail/479332b63ff26de1.js new file mode 100644 index 000000000..c027f29a4 --- /dev/null +++ b/compiler/tests-js-parser/fail/479332b63ff26de1.js @@ -0,0 +1 @@ +({a = 0}); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/47b1abed697fe128.js b/compiler/tests-js-parser/fail/47b1abed697fe128.js new file mode 100644 index 000000000..df151fb1b --- /dev/null +++ b/compiler/tests-js-parser/fail/47b1abed697fe128.js @@ -0,0 +1 @@ +((a),...b) => 0; diff --git a/compiler/tests-js-parser/fail/481292e787273e5a.js b/compiler/tests-js-parser/fail/481292e787273e5a.js new file mode 100644 index 000000000..cf44db59a --- /dev/null +++ b/compiler/tests-js-parser/fail/481292e787273e5a.js @@ -0,0 +1 @@ +(a,...a)/* */ => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/487674a4d34703db.js b/compiler/tests-js-parser/fail/487674a4d34703db.js new file mode 100644 index 000000000..71b4fc470 --- /dev/null +++ b/compiler/tests-js-parser/fail/487674a4d34703db.js @@ -0,0 +1 @@ ++i = 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4882f5db31935a04.js b/compiler/tests-js-parser/fail/4882f5db31935a04.js new file mode 100644 index 000000000..a0e7dcf9d --- /dev/null +++ b/compiler/tests-js-parser/fail/4882f5db31935a04.js @@ -0,0 +1 @@ +function*g() { var yield; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/48c7f50c23d3cbc0.js b/compiler/tests-js-parser/fail/48c7f50c23d3cbc0.js new file mode 100644 index 000000000..95a282978 --- /dev/null +++ b/compiler/tests-js-parser/fail/48c7f50c23d3cbc0.js @@ -0,0 +1 @@ +a: let a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/48dee14b7a3a3767.module.js b/compiler/tests-js-parser/fail/48dee14b7a3a3767.module.js new file mode 100644 index 000000000..c1813b770 --- /dev/null +++ b/compiler/tests-js-parser/fail/48dee14b7a3a3767.module.js @@ -0,0 +1 @@ +export let[a] = 0 export let[b] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/49624f905645b7d0.js b/compiler/tests-js-parser/fail/49624f905645b7d0.js new file mode 100644 index 000000000..c06a12a9c --- /dev/null +++ b/compiler/tests-js-parser/fail/49624f905645b7d0.js @@ -0,0 +1 @@ +for (let x, y, z, let;;;) {} diff --git a/compiler/tests-js-parser/fail/49861fa3ca0ffc30.js b/compiler/tests-js-parser/fail/49861fa3ca0ffc30.js new file mode 100644 index 000000000..fba65c91d --- /dev/null +++ b/compiler/tests-js-parser/fail/49861fa3ca0ffc30.js @@ -0,0 +1 @@ +for ((i in {})); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/49aed3377f457f08.js b/compiler/tests-js-parser/fail/49aed3377f457f08.js new file mode 100644 index 000000000..862276837 --- /dev/null +++ b/compiler/tests-js-parser/fail/49aed3377f457f08.js @@ -0,0 +1 @@ +const const; diff --git a/compiler/tests-js-parser/fail/49edc77061449ae3.js b/compiler/tests-js-parser/fail/49edc77061449ae3.js new file mode 100644 index 000000000..9ac988810 --- /dev/null +++ b/compiler/tests-js-parser/fail/49edc77061449ae3.js @@ -0,0 +1 @@ +class A extends B { constructor() { super; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4a19d40213c79876.js b/compiler/tests-js-parser/fail/4a19d40213c79876.js new file mode 100644 index 000000000..f05d13266 --- /dev/null +++ b/compiler/tests-js-parser/fail/4a19d40213c79876.js @@ -0,0 +1 @@ +i #= 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4a866d4657f5a83a.js b/compiler/tests-js-parser/fail/4a866d4657f5a83a.js new file mode 100644 index 000000000..1d463534c --- /dev/null +++ b/compiler/tests-js-parser/fail/4a866d4657f5a83a.js @@ -0,0 +1 @@ +(class {[3]:0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4a887c2761eb95fb.js b/compiler/tests-js-parser/fail/4a887c2761eb95fb.js new file mode 100644 index 000000000..f45ad84ce --- /dev/null +++ b/compiler/tests-js-parser/fail/4a887c2761eb95fb.js @@ -0,0 +1 @@ +function*g(){ function yield(){}; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4aa964c9923ef975.js b/compiler/tests-js-parser/fail/4aa964c9923ef975.js new file mode 100644 index 000000000..9cb968b9b --- /dev/null +++ b/compiler/tests-js-parser/fail/4aa964c9923ef975.js @@ -0,0 +1 @@ +0b9 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4b106388b810de25.js b/compiler/tests-js-parser/fail/4b106388b810de25.js new file mode 100644 index 000000000..2c0801899 --- /dev/null +++ b/compiler/tests-js-parser/fail/4b106388b810de25.js @@ -0,0 +1 @@ +3x0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4c048218847a0242.js b/compiler/tests-js-parser/fail/4c048218847a0242.js new file mode 100644 index 000000000..673c412ec --- /dev/null +++ b/compiler/tests-js-parser/fail/4c048218847a0242.js @@ -0,0 +1 @@ +([ 5 ]) => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4c1a7f94a43fddbd.js b/compiler/tests-js-parser/fail/4c1a7f94a43fddbd.js new file mode 100644 index 000000000..a25b98066 --- /dev/null +++ b/compiler/tests-js-parser/fail/4c1a7f94a43fddbd.js @@ -0,0 +1 @@ +0o \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4c3f75c2ad9dc102.js b/compiler/tests-js-parser/fail/4c3f75c2ad9dc102.js new file mode 100644 index 000000000..b96ae85fb --- /dev/null +++ b/compiler/tests-js-parser/fail/4c3f75c2ad9dc102.js @@ -0,0 +1 @@ +({ set: s(if) { } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4c7ea6a86bafaf0f.js b/compiler/tests-js-parser/fail/4c7ea6a86bafaf0f.js new file mode 100644 index 000000000..a8c2dd3e0 --- /dev/null +++ b/compiler/tests-js-parser/fail/4c7ea6a86bafaf0f.js @@ -0,0 +1 @@ +(function ({e: a.b}) {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4cce9feb5a563377.js b/compiler/tests-js-parser/fail/4cce9feb5a563377.js new file mode 100644 index 000000000..f9fe95f14 --- /dev/null +++ b/compiler/tests-js-parser/fail/4cce9feb5a563377.js @@ -0,0 +1 @@ +(a,...a) diff --git a/compiler/tests-js-parser/fail/4ce3c0a393c624d5.js b/compiler/tests-js-parser/fail/4ce3c0a393c624d5.js new file mode 100644 index 000000000..9b99ddeb0 --- /dev/null +++ b/compiler/tests-js-parser/fail/4ce3c0a393c624d5.js @@ -0,0 +1 @@ +'use strict'; 0123 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4d117d87d4a40541.js b/compiler/tests-js-parser/fail/4d117d87d4a40541.js new file mode 100644 index 000000000..5ff072b23 --- /dev/null +++ b/compiler/tests-js-parser/fail/4d117d87d4a40541.js @@ -0,0 +1 @@ +continue 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4d579849c75cfef9.js b/compiler/tests-js-parser/fail/4d579849c75cfef9.js new file mode 100644 index 000000000..f820c95d8 --- /dev/null +++ b/compiler/tests-js-parser/fail/4d579849c75cfef9.js @@ -0,0 +1,4 @@ + + + +{ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4daec155c0322d5e.js b/compiler/tests-js-parser/fail/4daec155c0322d5e.js new file mode 100644 index 000000000..772d6ceda --- /dev/null +++ b/compiler/tests-js-parser/fail/4daec155c0322d5e.js @@ -0,0 +1 @@ +function a({e: a.b}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4e2cce832b4449f1.js b/compiler/tests-js-parser/fail/4e2cce832b4449f1.js new file mode 100644 index 000000000..93fdac873 --- /dev/null +++ b/compiler/tests-js-parser/fail/4e2cce832b4449f1.js @@ -0,0 +1 @@ +for(let x=1 of [1,2,3]) 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4e880c0482d146e0.js b/compiler/tests-js-parser/fail/4e880c0482d146e0.js new file mode 100644 index 000000000..0d5bf18dd --- /dev/null +++ b/compiler/tests-js-parser/fail/4e880c0482d146e0.js @@ -0,0 +1 @@ +import foo from bar \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4e885526e8dfaa12.js b/compiler/tests-js-parser/fail/4e885526e8dfaa12.js new file mode 100644 index 000000000..1ed33e16d --- /dev/null +++ b/compiler/tests-js-parser/fail/4e885526e8dfaa12.js @@ -0,0 +1 @@ +f({x = 0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4ec83547ebdea18c.js b/compiler/tests-js-parser/fail/4ec83547ebdea18c.js new file mode 100644 index 000000000..300b8f147 --- /dev/null +++ b/compiler/tests-js-parser/fail/4ec83547ebdea18c.js @@ -0,0 +1 @@ +yield 10 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4ee75fab1ccee715.js b/compiler/tests-js-parser/fail/4ee75fab1ccee715.js new file mode 100644 index 000000000..86dd14750 --- /dev/null +++ b/compiler/tests-js-parser/fail/4ee75fab1ccee715.js @@ -0,0 +1 @@ +({ a() { (super).b(); } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4ee7b10cd97f554c.js b/compiler/tests-js-parser/fail/4ee7b10cd97f554c.js new file mode 100644 index 000000000..6295fdc36 --- /dev/null +++ b/compiler/tests-js-parser/fail/4ee7b10cd97f554c.js @@ -0,0 +1 @@ +[, \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4ef1d6ca8eceb313.js b/compiler/tests-js-parser/fail/4ef1d6ca8eceb313.js new file mode 100644 index 000000000..9dda16df4 --- /dev/null +++ b/compiler/tests-js-parser/fail/4ef1d6ca8eceb313.js @@ -0,0 +1 @@ +function* f() { [yield* {a = 0}]; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4f0b15bd78646107.js b/compiler/tests-js-parser/fail/4f0b15bd78646107.js new file mode 100644 index 000000000..6a5ca8a32 --- /dev/null +++ b/compiler/tests-js-parser/fail/4f0b15bd78646107.js @@ -0,0 +1 @@ +1-- \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4f6d3aaae5c7ad56.js b/compiler/tests-js-parser/fail/4f6d3aaae5c7ad56.js new file mode 100644 index 000000000..643f0a846 --- /dev/null +++ b/compiler/tests-js-parser/fail/4f6d3aaae5c7ad56.js @@ -0,0 +1 @@ +var {(a)} = 0 diff --git a/compiler/tests-js-parser/fail/4fd864d1c4df25b0.js b/compiler/tests-js-parser/fail/4fd864d1c4df25b0.js new file mode 100644 index 000000000..814bee439 --- /dev/null +++ b/compiler/tests-js-parser/fail/4fd864d1c4df25b0.js @@ -0,0 +1 @@ +({ get test() { } }) => 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/4ff4b78ff3e2de6e.js b/compiler/tests-js-parser/fail/4ff4b78ff3e2de6e.js new file mode 100644 index 000000000..aaa307efe --- /dev/null +++ b/compiler/tests-js-parser/fail/4ff4b78ff3e2de6e.js @@ -0,0 +1 @@ +(a) => {}() \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5051401f9d49ca56.js b/compiler/tests-js-parser/fail/5051401f9d49ca56.js new file mode 100644 index 000000000..2c62a4ecd --- /dev/null +++ b/compiler/tests-js-parser/fail/5051401f9d49ca56.js @@ -0,0 +1 @@ +�! \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5059efc702f08060.js b/compiler/tests-js-parser/fail/5059efc702f08060.js new file mode 100644 index 000000000..5c898785e --- /dev/null +++ b/compiler/tests-js-parser/fail/5059efc702f08060.js @@ -0,0 +1 @@ +for(var a = 0 of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/50a060984b757dc1.js b/compiler/tests-js-parser/fail/50a060984b757dc1.js new file mode 100644 index 000000000..21f2fe41d --- /dev/null +++ b/compiler/tests-js-parser/fail/50a060984b757dc1.js @@ -0,0 +1 @@ +({a:(b = 0)} = 1) diff --git a/compiler/tests-js-parser/fail/50efa1f220e37136.js b/compiler/tests-js-parser/fail/50efa1f220e37136.js new file mode 100644 index 000000000..833c70022 --- /dev/null +++ b/compiler/tests-js-parser/fail/50efa1f220e37136.js @@ -0,0 +1 @@ +{ ; ; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/525c5220320e32ee.js b/compiler/tests-js-parser/fail/525c5220320e32ee.js new file mode 100644 index 000000000..1b2a04396 --- /dev/null +++ b/compiler/tests-js-parser/fail/525c5220320e32ee.js @@ -0,0 +1 @@ +try { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/52a2eb6caebf1bf7.js b/compiler/tests-js-parser/fail/52a2eb6caebf1bf7.js new file mode 100644 index 000000000..2a1960b1e --- /dev/null +++ b/compiler/tests-js-parser/fail/52a2eb6caebf1bf7.js @@ -0,0 +1 @@ +var x, diff --git a/compiler/tests-js-parser/fail/5301846f80919b63.js b/compiler/tests-js-parser/fail/5301846f80919b63.js new file mode 100644 index 000000000..c977c7c98 --- /dev/null +++ b/compiler/tests-js-parser/fail/5301846f80919b63.js @@ -0,0 +1 @@ +function *g() { let yield; } diff --git a/compiler/tests-js-parser/fail/531ee852cc8ed0a7.js b/compiler/tests-js-parser/fail/531ee852cc8ed0a7.js new file mode 100644 index 000000000..b73434ffb --- /dev/null +++ b/compiler/tests-js-parser/fail/531ee852cc8ed0a7.js @@ -0,0 +1 @@ +[...0,a]=0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/534dac338ea83de6.js b/compiler/tests-js-parser/fail/534dac338ea83de6.js new file mode 100644 index 000000000..d72fce040 --- /dev/null +++ b/compiler/tests-js-parser/fail/534dac338ea83de6.js @@ -0,0 +1 @@ +3in [] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/537c4a516d7c8d7f.js b/compiler/tests-js-parser/fail/537c4a516d7c8d7f.js new file mode 100644 index 000000000..ae6e698b7 --- /dev/null +++ b/compiler/tests-js-parser/fail/537c4a516d7c8d7f.js @@ -0,0 +1 @@ +try {} catch ({e: x.a}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5427bdf48f3eb6d9.js b/compiler/tests-js-parser/fail/5427bdf48f3eb6d9.js new file mode 100644 index 000000000..0fba6431c --- /dev/null +++ b/compiler/tests-js-parser/fail/5427bdf48f3eb6d9.js @@ -0,0 +1 @@ +('\u{2028') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/54490a2da590c074.js b/compiler/tests-js-parser/fail/54490a2da590c074.js new file mode 100644 index 000000000..d8e3b4f9d --- /dev/null +++ b/compiler/tests-js-parser/fail/54490a2da590c074.js @@ -0,0 +1 @@ +0B1a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/54b72e05f42d7802.js b/compiler/tests-js-parser/fail/54b72e05f42d7802.js new file mode 100644 index 000000000..25b0e4e9f --- /dev/null +++ b/compiler/tests-js-parser/fail/54b72e05f42d7802.js @@ -0,0 +1 @@ +1 + () \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/556900b449f81433.js b/compiler/tests-js-parser/fail/556900b449f81433.js new file mode 100644 index 000000000..9ac3c124d --- /dev/null +++ b/compiler/tests-js-parser/fail/556900b449f81433.js @@ -0,0 +1 @@ +(a,...a)/*
*/ => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/55b9f51ad21c7f25.js b/compiler/tests-js-parser/fail/55b9f51ad21c7f25.js new file mode 100644 index 000000000..8f04b7702 --- /dev/null +++ b/compiler/tests-js-parser/fail/55b9f51ad21c7f25.js @@ -0,0 +1 @@ +"\u"; diff --git a/compiler/tests-js-parser/fail/5684b2ff53af4f76.js b/compiler/tests-js-parser/fail/5684b2ff53af4f76.js new file mode 100644 index 000000000..5ab609e68 --- /dev/null +++ b/compiler/tests-js-parser/fail/5684b2ff53af4f76.js @@ -0,0 +1 @@ +function t(true) { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/56c154237f4f1298.js b/compiler/tests-js-parser/fail/56c154237f4f1298.js new file mode 100644 index 000000000..1e728b643 --- /dev/null +++ b/compiler/tests-js-parser/fail/56c154237f4f1298.js @@ -0,0 +1 @@ +a\ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/575367951ac8635d.js b/compiler/tests-js-parser/fail/575367951ac8635d.js new file mode 100644 index 000000000..92c074e91 --- /dev/null +++ b/compiler/tests-js-parser/fail/575367951ac8635d.js @@ -0,0 +1 @@ +('\u') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/576b2243fb8c3b54.js b/compiler/tests-js-parser/fail/576b2243fb8c3b54.js new file mode 100644 index 000000000..3512adae6 --- /dev/null +++ b/compiler/tests-js-parser/fail/576b2243fb8c3b54.js @@ -0,0 +1 @@ +({ get prop(x) {} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/57a53aa66f7bc4da.js b/compiler/tests-js-parser/fail/57a53aa66f7bc4da.js new file mode 100644 index 000000000..2cbeb9a8f --- /dev/null +++ b/compiler/tests-js-parser/fail/57a53aa66f7bc4da.js @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/581bedbbce2541be.js b/compiler/tests-js-parser/fail/581bedbbce2541be.js new file mode 100644 index 000000000..ec4b3d7ee --- /dev/null +++ b/compiler/tests-js-parser/fail/581bedbbce2541be.js @@ -0,0 +1 @@ +for (i + 1 in {}); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5855e0715bd298ae.js b/compiler/tests-js-parser/fail/5855e0715bd298ae.js new file mode 100644 index 000000000..ff1fc888c --- /dev/null +++ b/compiler/tests-js-parser/fail/5855e0715bd298ae.js @@ -0,0 +1 @@ +import default from "foo" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5864c96b99472ffc.js b/compiler/tests-js-parser/fail/5864c96b99472ffc.js new file mode 100644 index 000000000..f5e7b15e4 --- /dev/null +++ b/compiler/tests-js-parser/fail/5864c96b99472ffc.js @@ -0,0 +1 @@ +function f() { (super)() } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/58707e130fe451a8.js b/compiler/tests-js-parser/fail/58707e130fe451a8.js new file mode 100644 index 000000000..a348212c0 --- /dev/null +++ b/compiler/tests-js-parser/fail/58707e130fe451a8.js @@ -0,0 +1 @@ +void { [1, 2]: 3 }; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/58d9ebcbb28bf3a7.js b/compiler/tests-js-parser/fail/58d9ebcbb28bf3a7.js new file mode 100644 index 000000000..0ac3b1609 --- /dev/null +++ b/compiler/tests-js-parser/fail/58d9ebcbb28bf3a7.js @@ -0,0 +1 @@ +for(let[a].b of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/58e911fb2bbc1f6e.js b/compiler/tests-js-parser/fail/58e911fb2bbc1f6e.js new file mode 100644 index 000000000..a0468498b --- /dev/null +++ b/compiler/tests-js-parser/fail/58e911fb2bbc1f6e.js @@ -0,0 +1 @@ +1.e+z \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5a627d08e9b33ad1.js b/compiler/tests-js-parser/fail/5a627d08e9b33ad1.js new file mode 100644 index 000000000..e9a8c0181 --- /dev/null +++ b/compiler/tests-js-parser/fail/5a627d08e9b33ad1.js @@ -0,0 +1 @@ +"\u00"; diff --git a/compiler/tests-js-parser/fail/5ab1050053c11514.js b/compiler/tests-js-parser/fail/5ab1050053c11514.js new file mode 100644 index 000000000..1aed2d999 --- /dev/null +++ b/compiler/tests-js-parser/fail/5ab1050053c11514.js @@ -0,0 +1 @@ +for((1 + 1) in list) process(x); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5bb13cf33cea5691.js b/compiler/tests-js-parser/fail/5bb13cf33cea5691.js new file mode 100644 index 000000000..e8de7f5ef --- /dev/null +++ b/compiler/tests-js-parser/fail/5bb13cf33cea5691.js @@ -0,0 +1 @@ +class A {a:0} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5bbf7371c3c77f3c.module.js b/compiler/tests-js-parser/fail/5bbf7371c3c77f3c.module.js new file mode 100644 index 000000000..04da186f8 --- /dev/null +++ b/compiler/tests-js-parser/fail/5bbf7371c3c77f3c.module.js @@ -0,0 +1 @@ +import; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5c63ac420337d014.js b/compiler/tests-js-parser/fail/5c63ac420337d014.js new file mode 100644 index 000000000..8ef38575d --- /dev/null +++ b/compiler/tests-js-parser/fail/5c63ac420337d014.js @@ -0,0 +1 @@ +function hello() { 'use strict'; "\000"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5d42f9f543d5f55c.js b/compiler/tests-js-parser/fail/5d42f9f543d5f55c.js new file mode 100644 index 000000000..6bd75a4f3 --- /dev/null +++ b/compiler/tests-js-parser/fail/5d42f9f543d5f55c.js @@ -0,0 +1 @@ +function*g({a: yield}){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5d5b9de6d9b95f3e.module.js b/compiler/tests-js-parser/fail/5d5b9de6d9b95f3e.module.js new file mode 100644 index 000000000..172d7582d --- /dev/null +++ b/compiler/tests-js-parser/fail/5d5b9de6d9b95f3e.module.js @@ -0,0 +1 @@ +--> \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5e60832af79173e3.js b/compiler/tests-js-parser/fail/5e60832af79173e3.js new file mode 100644 index 000000000..42bd7f558 --- /dev/null +++ b/compiler/tests-js-parser/fail/5e60832af79173e3.js @@ -0,0 +1 @@ +3e \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5e6f67a0e748cc42.js b/compiler/tests-js-parser/fail/5e6f67a0e748cc42.js new file mode 100644 index 000000000..8093fc9b8 --- /dev/null +++ b/compiler/tests-js-parser/fail/5e6f67a0e748cc42.js @@ -0,0 +1 @@ +function *g() { function *yield(){} } diff --git a/compiler/tests-js-parser/fail/5fae862d7fe6531c.js b/compiler/tests-js-parser/fail/5fae862d7fe6531c.js new file mode 100644 index 000000000..1f2632b0e --- /dev/null +++ b/compiler/tests-js-parser/fail/5fae862d7fe6531c.js @@ -0,0 +1 @@ +({a = 0}, {a = 0}, 0) => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/5fe7ff5c5cb5f438.module.js b/compiler/tests-js-parser/fail/5fe7ff5c5cb5f438.module.js new file mode 100644 index 000000000..2f3e7e60f --- /dev/null +++ b/compiler/tests-js-parser/fail/5fe7ff5c5cb5f438.module.js @@ -0,0 +1 @@ +import a, b from 'a' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6069bca758f9503d.js b/compiler/tests-js-parser/fail/6069bca758f9503d.js new file mode 100644 index 000000000..ebc8b1810 --- /dev/null +++ b/compiler/tests-js-parser/fail/6069bca758f9503d.js @@ -0,0 +1 @@ +function f(a, ...b, c){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6097ad2394486d46.js b/compiler/tests-js-parser/fail/6097ad2394486d46.js new file mode 100644 index 000000000..49ff04345 --- /dev/null +++ b/compiler/tests-js-parser/fail/6097ad2394486d46.js @@ -0,0 +1 @@ +const default \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/60ccdc5a8217f2ce.js b/compiler/tests-js-parser/fail/60ccdc5a8217f2ce.js new file mode 100644 index 000000000..eca576abc --- /dev/null +++ b/compiler/tests-js-parser/fail/60ccdc5a8217f2ce.js @@ -0,0 +1,2 @@ +/\ +0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/610fe4450d41c81e.js b/compiler/tests-js-parser/fail/610fe4450d41c81e.js new file mode 100644 index 000000000..51e7f4c46 --- /dev/null +++ b/compiler/tests-js-parser/fail/610fe4450d41c81e.js @@ -0,0 +1 @@ +\u \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/618f5bdbe9497960.js b/compiler/tests-js-parser/fail/618f5bdbe9497960.js new file mode 100644 index 000000000..b13178752 --- /dev/null +++ b/compiler/tests-js-parser/fail/618f5bdbe9497960.js @@ -0,0 +1 @@ +'use strict'; ('\11') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/61b72f954b679c22.js b/compiler/tests-js-parser/fail/61b72f954b679c22.js new file mode 100644 index 000000000..6dce84ad5 --- /dev/null +++ b/compiler/tests-js-parser/fail/61b72f954b679c22.js @@ -0,0 +1 @@ +\u1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/62d72a3c3d14d150.js b/compiler/tests-js-parser/fail/62d72a3c3d14d150.js new file mode 100644 index 000000000..b02ef5aa1 --- /dev/null +++ b/compiler/tests-js-parser/fail/62d72a3c3d14d150.js @@ -0,0 +1,2 @@ + + ] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/635ca73d00d4f28b.js b/compiler/tests-js-parser/fail/635ca73d00d4f28b.js new file mode 100644 index 000000000..d3523d976 --- /dev/null +++ b/compiler/tests-js-parser/fail/635ca73d00d4f28b.js @@ -0,0 +1 @@ +0b \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/63e918a2df1dcdde.js b/compiler/tests-js-parser/fail/63e918a2df1dcdde.js new file mode 100644 index 000000000..91d0e2a64 --- /dev/null +++ b/compiler/tests-js-parser/fail/63e918a2df1dcdde.js @@ -0,0 +1 @@ +�\x62 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/65a73ccacb2dc502.js b/compiler/tests-js-parser/fail/65a73ccacb2dc502.js new file mode 100644 index 000000000..bd9d4c5b3 --- /dev/null +++ b/compiler/tests-js-parser/fail/65a73ccacb2dc502.js @@ -0,0 +1 @@ +(class [a] {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/65a7e95d594ad7ad.js b/compiler/tests-js-parser/fail/65a7e95d594ad7ad.js new file mode 100644 index 000000000..95a6f3a2b --- /dev/null +++ b/compiler/tests-js-parser/fail/65a7e95d594ad7ad.js @@ -0,0 +1,3 @@ +/* + +* \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/665ab370012f20cf.js b/compiler/tests-js-parser/fail/665ab370012f20cf.js new file mode 100644 index 000000000..a1bbd7c90 --- /dev/null +++ b/compiler/tests-js-parser/fail/665ab370012f20cf.js @@ -0,0 +1 @@ +with(true) function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/66abd1d09c28ada8.js b/compiler/tests-js-parser/fail/66abd1d09c28ada8.js new file mode 100644 index 000000000..6464bf42e --- /dev/null +++ b/compiler/tests-js-parser/fail/66abd1d09c28ada8.js @@ -0,0 +1 @@ +for(this of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/66dd7a60a05be9f8.js b/compiler/tests-js-parser/fail/66dd7a60a05be9f8.js new file mode 100644 index 000000000..11eb57ff1 --- /dev/null +++ b/compiler/tests-js-parser/fail/66dd7a60a05be9f8.js @@ -0,0 +1 @@ +'\x1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/66e383bfd18e66ab.js b/compiler/tests-js-parser/fail/66e383bfd18e66ab.js new file mode 100644 index 000000000..40cc41886 --- /dev/null +++ b/compiler/tests-js-parser/fail/66e383bfd18e66ab.js @@ -0,0 +1 @@ +/\1/u \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/66e667cc2b718770.js b/compiler/tests-js-parser/fail/66e667cc2b718770.js new file mode 100644 index 000000000..2eeb8bb5f --- /dev/null +++ b/compiler/tests-js-parser/fail/66e667cc2b718770.js @@ -0,0 +1 @@ +function hello() { 'use strict'; ({ 021: 42 }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/67419010fc81184a.js b/compiler/tests-js-parser/fail/67419010fc81184a.js new file mode 100644 index 000000000..365f61fb5 --- /dev/null +++ b/compiler/tests-js-parser/fail/67419010fc81184a.js @@ -0,0 +1,2 @@ +/* + */] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6775a7f39c6b90fa.js b/compiler/tests-js-parser/fail/6775a7f39c6b90fa.js new file mode 100644 index 000000000..abf3ad689 --- /dev/null +++ b/compiler/tests-js-parser/fail/6775a7f39c6b90fa.js @@ -0,0 +1 @@ +class A; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/679ab0881c66b0cf.js b/compiler/tests-js-parser/fail/679ab0881c66b0cf.js new file mode 100644 index 000000000..4edaa423c --- /dev/null +++ b/compiler/tests-js-parser/fail/679ab0881c66b0cf.js @@ -0,0 +1,2 @@ + +] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/67c714796e7f40a4.js b/compiler/tests-js-parser/fail/67c714796e7f40a4.js new file mode 100644 index 000000000..802142b39 --- /dev/null +++ b/compiler/tests-js-parser/fail/67c714796e7f40a4.js @@ -0,0 +1 @@ +for (const x = 1 of y); diff --git a/compiler/tests-js-parser/fail/6856c5a3a26b5a3f.js b/compiler/tests-js-parser/fail/6856c5a3a26b5a3f.js new file mode 100644 index 000000000..47d26df80 --- /dev/null +++ b/compiler/tests-js-parser/fail/6856c5a3a26b5a3f.js @@ -0,0 +1 @@ +0a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/68766c3f46c4851a.js b/compiler/tests-js-parser/fail/68766c3f46c4851a.js new file mode 100644 index 000000000..dbc1a20c6 --- /dev/null +++ b/compiler/tests-js-parser/fail/68766c3f46c4851a.js @@ -0,0 +1 @@ +\u005c \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/68f0106ad505b13f.js b/compiler/tests-js-parser/fail/68f0106ad505b13f.js new file mode 100644 index 000000000..b321f19a2 --- /dev/null +++ b/compiler/tests-js-parser/fail/68f0106ad505b13f.js @@ -0,0 +1 @@ +while(false) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/69990f0abf6d88e0.js b/compiler/tests-js-parser/fail/69990f0abf6d88e0.js new file mode 100644 index 000000000..01cabf959 --- /dev/null +++ b/compiler/tests-js-parser/fail/69990f0abf6d88e0.js @@ -0,0 +1 @@ +class; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6a7197b11e9847ed.js b/compiler/tests-js-parser/fail/6a7197b11e9847ed.js new file mode 100644 index 000000000..3bf2327ee --- /dev/null +++ b/compiler/tests-js-parser/fail/6a7197b11e9847ed.js @@ -0,0 +1 @@ +if (1) let x = 10; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6a96389a0cce57e9.js b/compiler/tests-js-parser/fail/6a96389a0cce57e9.js new file mode 100644 index 000000000..924bc2b30 --- /dev/null +++ b/compiler/tests-js-parser/fail/6a96389a0cce57e9.js @@ -0,0 +1 @@ +var x = /[a-z]/\ux \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6ac4f95d48362a35.js b/compiler/tests-js-parser/fail/6ac4f95d48362a35.js new file mode 100644 index 000000000..01d48181f --- /dev/null +++ b/compiler/tests-js-parser/fail/6ac4f95d48362a35.js @@ -0,0 +1 @@ +'use strict'; ('\001') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6aeff33ceda72475.js b/compiler/tests-js-parser/fail/6aeff33ceda72475.js new file mode 100644 index 000000000..664f3aeb8 --- /dev/null +++ b/compiler/tests-js-parser/fail/6aeff33ceda72475.js @@ -0,0 +1 @@ +class A extends yield B { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6b9bc191e6f5ef69.js b/compiler/tests-js-parser/fail/6b9bc191e6f5ef69.js new file mode 100644 index 000000000..4581fe41f --- /dev/null +++ b/compiler/tests-js-parser/fail/6b9bc191e6f5ef69.js @@ -0,0 +1 @@ +for (let {a: b = let};;) {} diff --git a/compiler/tests-js-parser/fail/6bc739c23342216d.js b/compiler/tests-js-parser/fail/6bc739c23342216d.js new file mode 100644 index 000000000..050d885c5 --- /dev/null +++ b/compiler/tests-js-parser/fail/6bc739c23342216d.js @@ -0,0 +1 @@ +({set a([a.b]){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6c3a76d368c398cc.js b/compiler/tests-js-parser/fail/6c3a76d368c398cc.js new file mode 100644 index 000000000..b7a8fa039 --- /dev/null +++ b/compiler/tests-js-parser/fail/6c3a76d368c398cc.js @@ -0,0 +1 @@ +a\u1z \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6cb3fc8ff354bd89.js b/compiler/tests-js-parser/fail/6cb3fc8ff354bd89.js new file mode 100644 index 000000000..4d6bdaa5f --- /dev/null +++ b/compiler/tests-js-parser/fail/6cb3fc8ff354bd89.js @@ -0,0 +1 @@ +a\uz \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6cd36f7e68bdfb7a.js b/compiler/tests-js-parser/fail/6cd36f7e68bdfb7a.js new file mode 100644 index 000000000..520853afc --- /dev/null +++ b/compiler/tests-js-parser/fail/6cd36f7e68bdfb7a.js @@ -0,0 +1 @@ +for(;;) function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6dabf190eea04883.js b/compiler/tests-js-parser/fail/6dabf190eea04883.js new file mode 100644 index 000000000..13d242d02 --- /dev/null +++ b/compiler/tests-js-parser/fail/6dabf190eea04883.js @@ -0,0 +1 @@ +(...a) + 1 diff --git a/compiler/tests-js-parser/fail/6e2b7743e872769c.js b/compiler/tests-js-parser/fail/6e2b7743e872769c.js new file mode 100644 index 000000000..8850706c9 --- /dev/null +++ b/compiler/tests-js-parser/fail/6e2b7743e872769c.js @@ -0,0 +1 @@ +var this = 10; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6e736ba5cc38de01.js b/compiler/tests-js-parser/fail/6e736ba5cc38de01.js new file mode 100644 index 000000000..73c887c7f --- /dev/null +++ b/compiler/tests-js-parser/fail/6e736ba5cc38de01.js @@ -0,0 +1 @@ +'\x12 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6e792760337980f7.js b/compiler/tests-js-parser/fail/6e792760337980f7.js new file mode 100644 index 000000000..824c663a0 --- /dev/null +++ b/compiler/tests-js-parser/fail/6e792760337980f7.js @@ -0,0 +1 @@ +\uD800\ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6f717516b576717c.js b/compiler/tests-js-parser/fail/6f717516b576717c.js new file mode 100644 index 000000000..6e9e5a6e2 --- /dev/null +++ b/compiler/tests-js-parser/fail/6f717516b576717c.js @@ -0,0 +1,2 @@ +(a,...a)/* +*/ => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/6f7a5e4988b7d758.js b/compiler/tests-js-parser/fail/6f7a5e4988b7d758.js new file mode 100644 index 000000000..652b683a0 --- /dev/null +++ b/compiler/tests-js-parser/fail/6f7a5e4988b7d758.js @@ -0,0 +1 @@ +for(let of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7187f0675eb38279.js b/compiler/tests-js-parser/fail/7187f0675eb38279.js new file mode 100644 index 000000000..55b1f0f4f --- /dev/null +++ b/compiler/tests-js-parser/fail/7187f0675eb38279.js @@ -0,0 +1 @@ +return \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/721efc4cbc95a6a0.js b/compiler/tests-js-parser/fail/721efc4cbc95a6a0.js new file mode 100644 index 000000000..f2891b80c --- /dev/null +++ b/compiler/tests-js-parser/fail/721efc4cbc95a6a0.js @@ -0,0 +1 @@ +function *g() { try {} catch (yield) {} } diff --git a/compiler/tests-js-parser/fail/7222f595c694ef81.module.js b/compiler/tests-js-parser/fail/7222f595c694ef81.module.js new file mode 100644 index 000000000..32ade6b60 --- /dev/null +++ b/compiler/tests-js-parser/fail/7222f595c694ef81.module.js @@ -0,0 +1 @@ +export {a,,} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7291411fc225eabd.js b/compiler/tests-js-parser/fail/7291411fc225eabd.js new file mode 100644 index 000000000..e585fd25d --- /dev/null +++ b/compiler/tests-js-parser/fail/7291411fc225eabd.js @@ -0,0 +1 @@ +1.a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/733a157cb1896d10.js b/compiler/tests-js-parser/fail/733a157cb1896d10.js new file mode 100644 index 000000000..ddff2f376 --- /dev/null +++ b/compiler/tests-js-parser/fail/733a157cb1896d10.js @@ -0,0 +1,5 @@ +class A extends B { + constructor() { + (super)(); + } +} diff --git a/compiler/tests-js-parser/fail/73b0a0c9a26e1950.js b/compiler/tests-js-parser/fail/73b0a0c9a26e1950.js new file mode 100644 index 000000000..88dc22022 --- /dev/null +++ b/compiler/tests-js-parser/fail/73b0a0c9a26e1950.js @@ -0,0 +1 @@ +a\u113 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/73c84046ac613107.js b/compiler/tests-js-parser/fail/73c84046ac613107.js new file mode 100644 index 000000000..0e0fb8fb4 --- /dev/null +++ b/compiler/tests-js-parser/fail/73c84046ac613107.js @@ -0,0 +1 @@ +"\ux"; diff --git a/compiler/tests-js-parser/fail/73d061b5d635a807.js b/compiler/tests-js-parser/fail/73d061b5d635a807.js new file mode 100644 index 000000000..936b48528 --- /dev/null +++ b/compiler/tests-js-parser/fail/73d061b5d635a807.js @@ -0,0 +1 @@ +for (let x = 42 of list) process(x); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/73d1b1b1bc1dabfb.js b/compiler/tests-js-parser/fail/73d1b1b1bc1dabfb.js new file mode 100644 index 000000000..4e3f12458 --- /dev/null +++ b/compiler/tests-js-parser/fail/73d1b1b1bc1dabfb.js @@ -0,0 +1 @@ +super \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/743e2b125ba6d248.js b/compiler/tests-js-parser/fail/743e2b125ba6d248.js new file mode 100644 index 000000000..de2dc1248 --- /dev/null +++ b/compiler/tests-js-parser/fail/743e2b125ba6d248.js @@ -0,0 +1,2 @@ +x + isnt y \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7464b0dfc4974a48.module.js b/compiler/tests-js-parser/fail/7464b0dfc4974a48.module.js new file mode 100644 index 000000000..b766f7d5c --- /dev/null +++ b/compiler/tests-js-parser/fail/7464b0dfc4974a48.module.js @@ -0,0 +1 @@ +import * as b, a from 'a' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/748656edbfb2d0bb.js b/compiler/tests-js-parser/fail/748656edbfb2d0bb.js new file mode 100644 index 000000000..b00455f6f --- /dev/null +++ b/compiler/tests-js-parser/fail/748656edbfb2d0bb.js @@ -0,0 +1 @@ +('\8') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/75412422951a6362.js b/compiler/tests-js-parser/fail/75412422951a6362.js new file mode 100644 index 000000000..60fee4fc6 --- /dev/null +++ b/compiler/tests-js-parser/fail/75412422951a6362.js @@ -0,0 +1 @@ +import { class } from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7562c2148b3f455c.js b/compiler/tests-js-parser/fail/7562c2148b3f455c.js new file mode 100644 index 000000000..03d8c2c86 --- /dev/null +++ b/compiler/tests-js-parser/fail/7562c2148b3f455c.js @@ -0,0 +1 @@ +;/**/--> \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/75b52e0f57aab958.js b/compiler/tests-js-parser/fail/75b52e0f57aab958.js new file mode 100644 index 000000000..40ac1e2b4 --- /dev/null +++ b/compiler/tests-js-parser/fail/75b52e0f57aab958.js @@ -0,0 +1 @@ +"use strict"; ({ v: eval }) = obj \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/75f1656578c2d7e8.js b/compiler/tests-js-parser/fail/75f1656578c2d7e8.js new file mode 100644 index 000000000..8ee1fc18c --- /dev/null +++ b/compiler/tests-js-parser/fail/75f1656578c2d7e8.js @@ -0,0 +1 @@ +x\u005c \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7615ff9f43ea0dde.js b/compiler/tests-js-parser/fail/7615ff9f43ea0dde.js new file mode 100644 index 000000000..278581d58 --- /dev/null +++ b/compiler/tests-js-parser/fail/7615ff9f43ea0dde.js @@ -0,0 +1 @@ +class default \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7624feb2a003e001.js b/compiler/tests-js-parser/fail/7624feb2a003e001.js new file mode 100644 index 000000000..084e7418f --- /dev/null +++ b/compiler/tests-js-parser/fail/7624feb2a003e001.js @@ -0,0 +1 @@ +\uD800 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/76465e2c7af91e73.js b/compiler/tests-js-parser/fail/76465e2c7af91e73.js new file mode 100644 index 000000000..e757a7021 --- /dev/null +++ b/compiler/tests-js-parser/fail/76465e2c7af91e73.js @@ -0,0 +1 @@ +for(var x=1 of [1,2,3]) 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/766e0153d3f7ec95.js b/compiler/tests-js-parser/fail/766e0153d3f7ec95.js new file mode 100644 index 000000000..22e83649f --- /dev/null +++ b/compiler/tests-js-parser/fail/766e0153d3f7ec95.js @@ -0,0 +1 @@ +/* \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/77cb7be200e0a2aa.js b/compiler/tests-js-parser/fail/77cb7be200e0a2aa.js new file mode 100644 index 000000000..7e8819e32 --- /dev/null +++ b/compiler/tests-js-parser/fail/77cb7be200e0a2aa.js @@ -0,0 +1 @@ +‌ = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/77e5dccd799284ee.module.js b/compiler/tests-js-parser/fail/77e5dccd799284ee.module.js new file mode 100644 index 000000000..ccdcee70a --- /dev/null +++ b/compiler/tests-js-parser/fail/77e5dccd799284ee.module.js @@ -0,0 +1 @@ +export default default \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/77fe5a8d6ae33dd1.js b/compiler/tests-js-parser/fail/77fe5a8d6ae33dd1.js new file mode 100644 index 000000000..8df4b7c0c --- /dev/null +++ b/compiler/tests-js-parser/fail/77fe5a8d6ae33dd1.js @@ -0,0 +1 @@ +function t() { ; ; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/783865dd3a3c2200.module.js b/compiler/tests-js-parser/fail/783865dd3a3c2200.module.js new file mode 100644 index 000000000..198a3491e --- /dev/null +++ b/compiler/tests-js-parser/fail/783865dd3a3c2200.module.js @@ -0,0 +1 @@ +export function () {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/783aeb8c90c3775d.js b/compiler/tests-js-parser/fail/783aeb8c90c3775d.js new file mode 100644 index 000000000..92547c1bb --- /dev/null +++ b/compiler/tests-js-parser/fail/783aeb8c90c3775d.js @@ -0,0 +1 @@ +for(({a}) of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/783f01472f94a412.js b/compiler/tests-js-parser/fail/783f01472f94a412.js new file mode 100644 index 000000000..b77b4ffa0 --- /dev/null +++ b/compiler/tests-js-parser/fail/783f01472f94a412.js @@ -0,0 +1 @@ +"\u000"; diff --git a/compiler/tests-js-parser/fail/78c215fabdf13bae.js b/compiler/tests-js-parser/fail/78c215fabdf13bae.js new file mode 100644 index 000000000..35dfcb3eb --- /dev/null +++ b/compiler/tests-js-parser/fail/78c215fabdf13bae.js @@ -0,0 +1 @@ +/{*/u; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/78e777115c4cfcc2.js b/compiler/tests-js-parser/fail/78e777115c4cfcc2.js new file mode 100644 index 000000000..d1dab07d1 --- /dev/null +++ b/compiler/tests-js-parser/fail/78e777115c4cfcc2.js @@ -0,0 +1 @@ +do { x } * \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/78e861dca5c2377d.js b/compiler/tests-js-parser/fail/78e861dca5c2377d.js new file mode 100644 index 000000000..25bb3beaa --- /dev/null +++ b/compiler/tests-js-parser/fail/78e861dca5c2377d.js @@ -0,0 +1 @@ +function* y({yield}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7909e04a06928dea.js b/compiler/tests-js-parser/fail/7909e04a06928dea.js new file mode 100644 index 000000000..0d93cbb50 --- /dev/null +++ b/compiler/tests-js-parser/fail/7909e04a06928dea.js @@ -0,0 +1 @@ +if(true) let a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/794032efdfb20d41.js b/compiler/tests-js-parser/fail/794032efdfb20d41.js new file mode 100644 index 000000000..64b012444 --- /dev/null +++ b/compiler/tests-js-parser/fail/794032efdfb20d41.js @@ -0,0 +1 @@ +(0, {a = 0}) => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/796e4feabf0e0fef.js b/compiler/tests-js-parser/fail/796e4feabf0e0fef.js new file mode 100644 index 000000000..955e50b12 --- /dev/null +++ b/compiler/tests-js-parser/fail/796e4feabf0e0fef.js @@ -0,0 +1 @@ +for(let[a]().b of 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7974c69bdfcceea8.js b/compiler/tests-js-parser/fail/7974c69bdfcceea8.js new file mode 100644 index 000000000..79ff928dc --- /dev/null +++ b/compiler/tests-js-parser/fail/7974c69bdfcceea8.js @@ -0,0 +1 @@ +({get a(){}}) => 0; diff --git a/compiler/tests-js-parser/fail/79f882da06f88c9f.js b/compiler/tests-js-parser/fail/79f882da06f88c9f.js new file mode 100644 index 000000000..a8293feaf --- /dev/null +++ b/compiler/tests-js-parser/fail/79f882da06f88c9f.js @@ -0,0 +1 @@ +"\8"; diff --git a/compiler/tests-js-parser/fail/7b0456581bef4cb1.js b/compiler/tests-js-parser/fail/7b0456581bef4cb1.js new file mode 100644 index 000000000..755c8ff38 --- /dev/null +++ b/compiler/tests-js-parser/fail/7b0456581bef4cb1.js @@ -0,0 +1 @@ +throw \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7b70beed5a327548.js b/compiler/tests-js-parser/fail/7b70beed5a327548.js new file mode 100644 index 000000000..6ed0c5026 --- /dev/null +++ b/compiler/tests-js-parser/fail/7b70beed5a327548.js @@ -0,0 +1 @@ +({ *a }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7b876ca5139f1ca8.js b/compiler/tests-js-parser/fail/7b876ca5139f1ca8.js new file mode 100644 index 000000000..1c0211123 --- /dev/null +++ b/compiler/tests-js-parser/fail/7b876ca5139f1ca8.js @@ -0,0 +1 @@ +class A extends B { constructor() { new super(); } } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7bfaaa1e80d6255f.js b/compiler/tests-js-parser/fail/7bfaaa1e80d6255f.js new file mode 100644 index 000000000..d99e1e02b --- /dev/null +++ b/compiler/tests-js-parser/fail/7bfaaa1e80d6255f.js @@ -0,0 +1 @@ +if (false) { return; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7da8521583578fd0.js b/compiler/tests-js-parser/fail/7da8521583578fd0.js new file mode 100644 index 000000000..5362a3d04 --- /dev/null +++ b/compiler/tests-js-parser/fail/7da8521583578fd0.js @@ -0,0 +1,2 @@ +var x = /[a-z +]/\ux \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7dd7279ecf6a7eb8.js b/compiler/tests-js-parser/fail/7dd7279ecf6a7eb8.js new file mode 100644 index 000000000..893bd180d --- /dev/null +++ b/compiler/tests-js-parser/fail/7dd7279ecf6a7eb8.js @@ -0,0 +1 @@ +f(..g); diff --git a/compiler/tests-js-parser/fail/7de28635b9d2015a.js b/compiler/tests-js-parser/fail/7de28635b9d2015a.js new file mode 100644 index 000000000..b96dcdc9e --- /dev/null +++ b/compiler/tests-js-parser/fail/7de28635b9d2015a.js @@ -0,0 +1 @@ +(a,...a)/*
*/ => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7de586a1b43f8f7a.js b/compiler/tests-js-parser/fail/7de586a1b43f8f7a.js new file mode 100644 index 000000000..0902e3e85 --- /dev/null +++ b/compiler/tests-js-parser/fail/7de586a1b43f8f7a.js @@ -0,0 +1 @@ +function* a([a.b]) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7e3299107ab474ce.js b/compiler/tests-js-parser/fail/7e3299107ab474ce.js new file mode 100644 index 000000000..33fb953fc --- /dev/null +++ b/compiler/tests-js-parser/fail/7e3299107ab474ce.js @@ -0,0 +1 @@ +({'a'} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7e811fe4eb307470.js b/compiler/tests-js-parser/fail/7e811fe4eb307470.js new file mode 100644 index 000000000..9fc941b2c --- /dev/null +++ b/compiler/tests-js-parser/fail/7e811fe4eb307470.js @@ -0,0 +1 @@ +var [] diff --git a/compiler/tests-js-parser/fail/7f9bbf314145e16f.js b/compiler/tests-js-parser/fail/7f9bbf314145e16f.js new file mode 100644 index 000000000..76fa79dbc --- /dev/null +++ b/compiler/tests-js-parser/fail/7f9bbf314145e16f.js @@ -0,0 +1 @@ +({}=>0) diff --git a/compiler/tests-js-parser/fail/7fc173197c3cc75d.js b/compiler/tests-js-parser/fail/7fc173197c3cc75d.js new file mode 100644 index 000000000..29646a2c3 --- /dev/null +++ b/compiler/tests-js-parser/fail/7fc173197c3cc75d.js @@ -0,0 +1 @@ +(class extends !a {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7fdf990c6f42edcd.js b/compiler/tests-js-parser/fail/7fdf990c6f42edcd.js new file mode 100644 index 000000000..848bdd00b --- /dev/null +++ b/compiler/tests-js-parser/fail/7fdf990c6f42edcd.js @@ -0,0 +1 @@ +export * from "a" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/7fe1dff1cf764f72.js b/compiler/tests-js-parser/fail/7fe1dff1cf764f72.js new file mode 100644 index 000000000..487bb99ec --- /dev/null +++ b/compiler/tests-js-parser/fail/7fe1dff1cf764f72.js @@ -0,0 +1 @@ +((a)) => 0 diff --git a/compiler/tests-js-parser/fail/8053fd407fd3d848.js b/compiler/tests-js-parser/fail/8053fd407fd3d848.js new file mode 100644 index 000000000..cc7b1e379 --- /dev/null +++ b/compiler/tests-js-parser/fail/8053fd407fd3d848.js @@ -0,0 +1 @@ +((a)) => 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/80bfa9f27278bbba.js b/compiler/tests-js-parser/fail/80bfa9f27278bbba.js new file mode 100644 index 000000000..2b0d03a6f --- /dev/null +++ b/compiler/tests-js-parser/fail/80bfa9f27278bbba.js @@ -0,0 +1 @@ +"use strict";function foo(){"use strict";}function bar(){var v = 015} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/80d1e106056a576f.js b/compiler/tests-js-parser/fail/80d1e106056a576f.js new file mode 100644 index 000000000..3d698a841 --- /dev/null +++ b/compiler/tests-js-parser/fail/80d1e106056a576f.js @@ -0,0 +1 @@ +function *a(){yield*} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/80da22a7d2a15fc5.js b/compiler/tests-js-parser/fail/80da22a7d2a15fc5.js new file mode 100644 index 000000000..dde05e910 --- /dev/null +++ b/compiler/tests-js-parser/fail/80da22a7d2a15fc5.js @@ -0,0 +1 @@ +import 'a' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/80ea01a6fbf80920.js b/compiler/tests-js-parser/fail/80ea01a6fbf80920.js new file mode 100644 index 000000000..6e6cedef5 --- /dev/null +++ b/compiler/tests-js-parser/fail/80ea01a6fbf80920.js @@ -0,0 +1 @@ +((a),...a) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/814e26b2395ad89d.module.js b/compiler/tests-js-parser/fail/814e26b2395ad89d.module.js new file mode 100644 index 000000000..42151f0b8 --- /dev/null +++ b/compiler/tests-js-parser/fail/814e26b2395ad89d.module.js @@ -0,0 +1 @@ +export \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/81a5bf75eb66ff83.js b/compiler/tests-js-parser/fail/81a5bf75eb66ff83.js new file mode 100644 index 000000000..84c06cc1d --- /dev/null +++ b/compiler/tests-js-parser/fail/81a5bf75eb66ff83.js @@ -0,0 +1 @@ +() <= 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8262e85f06cb459c.js b/compiler/tests-js-parser/fail/8262e85f06cb459c.js new file mode 100644 index 000000000..1078dba79 --- /dev/null +++ b/compiler/tests-js-parser/fail/8262e85f06cb459c.js @@ -0,0 +1 @@ +new f(....g); diff --git a/compiler/tests-js-parser/fail/829d9261aa6cd22c.js b/compiler/tests-js-parser/fail/829d9261aa6cd22c.js new file mode 100644 index 000000000..913ea4bde --- /dev/null +++ b/compiler/tests-js-parser/fail/829d9261aa6cd22c.js @@ -0,0 +1 @@ +([a.b]) => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/82b8003b91d8b346.js b/compiler/tests-js-parser/fail/82b8003b91d8b346.js new file mode 100644 index 000000000..20a41f53d --- /dev/null +++ b/compiler/tests-js-parser/fail/82b8003b91d8b346.js @@ -0,0 +1 @@ +(b, ...a) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/831b4a1caf3c5a06.js b/compiler/tests-js-parser/fail/831b4a1caf3c5a06.js new file mode 100644 index 000000000..ff120cf6c --- /dev/null +++ b/compiler/tests-js-parser/fail/831b4a1caf3c5a06.js @@ -0,0 +1 @@ +try { } catch ([a] = []) { } diff --git a/compiler/tests-js-parser/fail/8355671c9cafd876.js b/compiler/tests-js-parser/fail/8355671c9cafd876.js new file mode 100644 index 000000000..e5179a4da --- /dev/null +++ b/compiler/tests-js-parser/fail/8355671c9cafd876.js @@ -0,0 +1 @@ +1 / % \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8373e2a6865dc08c.js b/compiler/tests-js-parser/fail/8373e2a6865dc08c.js new file mode 100644 index 000000000..3f16f8fbf --- /dev/null +++ b/compiler/tests-js-parser/fail/8373e2a6865dc08c.js @@ -0,0 +1 @@ +class A {a(){},b(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/83d544ccc223c057.js b/compiler/tests-js-parser/fail/83d544ccc223c057.js new file mode 100644 index 000000000..f488f8491 --- /dev/null +++ b/compiler/tests-js-parser/fail/83d544ccc223c057.js @@ -0,0 +1 @@ +� \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/842c5cb4a70228de.js b/compiler/tests-js-parser/fail/842c5cb4a70228de.js new file mode 100644 index 000000000..94f077133 --- /dev/null +++ b/compiler/tests-js-parser/fail/842c5cb4a70228de.js @@ -0,0 +1 @@ +new f(..g); diff --git a/compiler/tests-js-parser/fail/84633c379e4010bf.js b/compiler/tests-js-parser/fail/84633c379e4010bf.js new file mode 100644 index 000000000..6d4eb1036 --- /dev/null +++ b/compiler/tests-js-parser/fail/84633c379e4010bf.js @@ -0,0 +1 @@ +function *g() { return yield.x; } diff --git a/compiler/tests-js-parser/fail/851bfeb09635c752.js b/compiler/tests-js-parser/fail/851bfeb09635c752.js new file mode 100644 index 000000000..1c8af926b --- /dev/null +++ b/compiler/tests-js-parser/fail/851bfeb09635c752.js @@ -0,0 +1 @@ +1++ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/85351ad05c8d5f1b.js b/compiler/tests-js-parser/fail/85351ad05c8d5f1b.js new file mode 100644 index 000000000..79b8c0ac0 --- /dev/null +++ b/compiler/tests-js-parser/fail/85351ad05c8d5f1b.js @@ -0,0 +1 @@ +09.x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/854ff4a8b5f8ff01.js b/compiler/tests-js-parser/fail/854ff4a8b5f8ff01.js new file mode 100644 index 000000000..489bae9c5 --- /dev/null +++ b/compiler/tests-js-parser/fail/854ff4a8b5f8ff01.js @@ -0,0 +1 @@ +var {a:a}; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8552e0809ca624cd.js b/compiler/tests-js-parser/fail/8552e0809ca624cd.js new file mode 100644 index 000000000..c21963951 --- /dev/null +++ b/compiler/tests-js-parser/fail/8552e0809ca624cd.js @@ -0,0 +1,3 @@ +(function*() { + function*({x: y = yield 3}) {} +}) diff --git a/compiler/tests-js-parser/fail/858b72be7f8f19d7.js b/compiler/tests-js-parser/fail/858b72be7f8f19d7.js new file mode 100644 index 000000000..4fac6d5b2 --- /dev/null +++ b/compiler/tests-js-parser/fail/858b72be7f8f19d7.js @@ -0,0 +1 @@ +for(let a = 0 of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/85bb33accf520f1d.js b/compiler/tests-js-parser/fail/85bb33accf520f1d.js new file mode 100644 index 000000000..e365ebea9 --- /dev/null +++ b/compiler/tests-js-parser/fail/85bb33accf520f1d.js @@ -0,0 +1,2 @@ +// +] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/85ee036d67974729.js b/compiler/tests-js-parser/fail/85ee036d67974729.js new file mode 100644 index 000000000..1f7ceef3f --- /dev/null +++ b/compiler/tests-js-parser/fail/85ee036d67974729.js @@ -0,0 +1 @@ +({get +:3}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/862fa3d5f7a928be.js b/compiler/tests-js-parser/fail/862fa3d5f7a928be.js new file mode 100644 index 000000000..3c056edf1 --- /dev/null +++ b/compiler/tests-js-parser/fail/862fa3d5f7a928be.js @@ -0,0 +1 @@ +var if = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/86308fd40fa95e9d.js b/compiler/tests-js-parser/fail/86308fd40fa95e9d.js new file mode 100644 index 000000000..c1dc0e466 --- /dev/null +++ b/compiler/tests-js-parser/fail/86308fd40fa95e9d.js @@ -0,0 +1 @@ +/*hello \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8753a1cb7850d657.js b/compiler/tests-js-parser/fail/8753a1cb7850d657.js new file mode 100644 index 000000000..c1f30b450 --- /dev/null +++ b/compiler/tests-js-parser/fail/8753a1cb7850d657.js @@ -0,0 +1 @@ +({var} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/87d2d99776638ab6.module.js b/compiler/tests-js-parser/fail/87d2d99776638ab6.module.js new file mode 100644 index 000000000..dde0a5d3a --- /dev/null +++ b/compiler/tests-js-parser/fail/87d2d99776638ab6.module.js @@ -0,0 +1 @@ +import {b,,} from 'a'; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/87dfd34c1ed7ab04.js b/compiler/tests-js-parser/fail/87dfd34c1ed7ab04.js new file mode 100644 index 000000000..d02151626 --- /dev/null +++ b/compiler/tests-js-parser/fail/87dfd34c1ed7ab04.js @@ -0,0 +1 @@ +[2] = 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/888d17b2ef3b2afc.js b/compiler/tests-js-parser/fail/888d17b2ef3b2afc.js new file mode 100644 index 000000000..33338e4fb --- /dev/null +++ b/compiler/tests-js-parser/fail/888d17b2ef3b2afc.js @@ -0,0 +1 @@ +1 + { t:t \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/88f3d521fae776b9.js b/compiler/tests-js-parser/fail/88f3d521fae776b9.js new file mode 100644 index 000000000..65c6d77e3 --- /dev/null +++ b/compiler/tests-js-parser/fail/88f3d521fae776b9.js @@ -0,0 +1 @@ +[...0,...{a=0}]=0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/89036b2edb64c00c.js b/compiler/tests-js-parser/fail/89036b2edb64c00c.js new file mode 100644 index 000000000..e2c3037d4 --- /dev/null +++ b/compiler/tests-js-parser/fail/89036b2edb64c00c.js @@ -0,0 +1,2 @@ +(' +') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/893986e2bbf8b7c5.js b/compiler/tests-js-parser/fail/893986e2bbf8b7c5.js new file mode 100644 index 000000000..08c9ad9cc --- /dev/null +++ b/compiler/tests-js-parser/fail/893986e2bbf8b7c5.js @@ -0,0 +1 @@ +var ([x]) = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/89ace2a47ff50b0d.module.js b/compiler/tests-js-parser/fail/89ace2a47ff50b0d.module.js new file mode 100644 index 000000000..6e7093a2d --- /dev/null +++ b/compiler/tests-js-parser/fail/89ace2a47ff50b0d.module.js @@ -0,0 +1 @@ +import {,} from 'a'; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8a331fdde7032f33.js b/compiler/tests-js-parser/fail/8a331fdde7032f33.js new file mode 100644 index 000000000..9d68933c4 --- /dev/null +++ b/compiler/tests-js-parser/fail/8a331fdde7032f33.js @@ -0,0 +1 @@ +" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8a4f56aa3f296bd0.js b/compiler/tests-js-parser/fail/8a4f56aa3f296bd0.js new file mode 100644 index 000000000..50ec12f43 --- /dev/null +++ b/compiler/tests-js-parser/fail/8a4f56aa3f296bd0.js @@ -0,0 +1 @@ +0B \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8a5edab282632443.js b/compiler/tests-js-parser/fail/8a5edab282632443.js new file mode 100644 index 000000000..35ec3b9d7 --- /dev/null +++ b/compiler/tests-js-parser/fail/8a5edab282632443.js @@ -0,0 +1 @@ +/ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8a91dde242686a52.js b/compiler/tests-js-parser/fail/8a91dde242686a52.js new file mode 100644 index 000000000..2e676ea6c --- /dev/null +++ b/compiler/tests-js-parser/fail/8a91dde242686a52.js @@ -0,0 +1 @@ +({a.b} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8b1042fbb7c43423.js b/compiler/tests-js-parser/fail/8b1042fbb7c43423.js new file mode 100644 index 000000000..508fd1119 --- /dev/null +++ b/compiler/tests-js-parser/fail/8b1042fbb7c43423.js @@ -0,0 +1 @@ +var (x) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8b1bf74ad28fc10c.js b/compiler/tests-js-parser/fail/8b1bf74ad28fc10c.js new file mode 100644 index 000000000..adc4228b3 --- /dev/null +++ b/compiler/tests-js-parser/fail/8b1bf74ad28fc10c.js @@ -0,0 +1 @@ +01a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8b6b9c72c875f0d8.js b/compiler/tests-js-parser/fail/8b6b9c72c875f0d8.js new file mode 100644 index 000000000..ab05b5116 --- /dev/null +++ b/compiler/tests-js-parser/fail/8b6b9c72c875f0d8.js @@ -0,0 +1 @@ +({ set prop(x, y) {} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8b72c44bd531621a.js b/compiler/tests-js-parser/fail/8b72c44bd531621a.js new file mode 100644 index 000000000..5b475e3c5 --- /dev/null +++ b/compiler/tests-js-parser/fail/8b72c44bd531621a.js @@ -0,0 +1 @@ +for (var [p]=q of r); diff --git a/compiler/tests-js-parser/fail/8ba15f5246ca756c.js b/compiler/tests-js-parser/fail/8ba15f5246ca756c.js new file mode 100644 index 000000000..2889cae16 --- /dev/null +++ b/compiler/tests-js-parser/fail/8ba15f5246ca756c.js @@ -0,0 +1 @@ +class A { \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8beaabe25ab7e0a8.js b/compiler/tests-js-parser/fail/8beaabe25ab7e0a8.js new file mode 100644 index 000000000..699755fe9 --- /dev/null +++ b/compiler/tests-js-parser/fail/8beaabe25ab7e0a8.js @@ -0,0 +1 @@ +return; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8bf8438d0a686b4e.js b/compiler/tests-js-parser/fail/8bf8438d0a686b4e.js new file mode 100644 index 000000000..62605d1d0 --- /dev/null +++ b/compiler/tests-js-parser/fail/8bf8438d0a686b4e.js @@ -0,0 +1 @@ +[a, ...(b = c)] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8c353ce78b905b58.js b/compiler/tests-js-parser/fail/8c353ce78b905b58.js new file mode 100644 index 000000000..1b23c3ab3 --- /dev/null +++ b/compiler/tests-js-parser/fail/8c353ce78b905b58.js @@ -0,0 +1 @@ +`${a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8cd3c4653493b667.js b/compiler/tests-js-parser/fail/8cd3c4653493b667.js new file mode 100644 index 000000000..574fa2542 --- /dev/null +++ b/compiler/tests-js-parser/fail/8cd3c4653493b667.js @@ -0,0 +1 @@ +export { if } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8cf27fd80ffbc24e.js b/compiler/tests-js-parser/fail/8cf27fd80ffbc24e.js new file mode 100644 index 000000000..c4f9100f9 --- /dev/null +++ b/compiler/tests-js-parser/fail/8cf27fd80ffbc24e.js @@ -0,0 +1 @@ +[a += b] = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8d33f520a3c4cef8.js b/compiler/tests-js-parser/fail/8d33f520a3c4cef8.js new file mode 100644 index 000000000..64845fb76 --- /dev/null +++ b/compiler/tests-js-parser/fail/8d33f520a3c4cef8.js @@ -0,0 +1 @@ +` \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8d5ef4dee9c7c622.js b/compiler/tests-js-parser/fail/8d5ef4dee9c7c622.js new file mode 100644 index 000000000..056bda9ef --- /dev/null +++ b/compiler/tests-js-parser/fail/8d5ef4dee9c7c622.js @@ -0,0 +1 @@ +for(const a = 0 of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8d64a30d9de151b6.js b/compiler/tests-js-parser/fail/8d64a30d9de151b6.js new file mode 100644 index 000000000..45ee88f1b --- /dev/null +++ b/compiler/tests-js-parser/fail/8d64a30d9de151b6.js @@ -0,0 +1 @@ +/** \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8d732f3933df4bd4.js b/compiler/tests-js-parser/fail/8d732f3933df4bd4.js new file mode 100644 index 000000000..aca11afec --- /dev/null +++ b/compiler/tests-js-parser/fail/8d732f3933df4bd4.js @@ -0,0 +1 @@ +var this \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8dc484a35dd0dc16.js b/compiler/tests-js-parser/fail/8dc484a35dd0dc16.js new file mode 100644 index 000000000..4a8b268a6 --- /dev/null +++ b/compiler/tests-js-parser/fail/8dc484a35dd0dc16.js @@ -0,0 +1 @@ +'use strict'; ('\123') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8dc7370bc6dec92b.js b/compiler/tests-js-parser/fail/8dc7370bc6dec92b.js new file mode 100644 index 000000000..bcd16c628 --- /dev/null +++ b/compiler/tests-js-parser/fail/8dc7370bc6dec92b.js @@ -0,0 +1 @@ +throw; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8dfb252e12b6b17e.js b/compiler/tests-js-parser/fail/8dfb252e12b6b17e.js new file mode 100644 index 000000000..6d5430f13 --- /dev/null +++ b/compiler/tests-js-parser/fail/8dfb252e12b6b17e.js @@ -0,0 +1,2 @@ +/test +/ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8e93bcbd389c6bf6.js b/compiler/tests-js-parser/fail/8e93bcbd389c6bf6.js new file mode 100644 index 000000000..758a22a27 --- /dev/null +++ b/compiler/tests-js-parser/fail/8e93bcbd389c6bf6.js @@ -0,0 +1 @@ +({ *[0]: 0 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8f05256d87c7a6ae.js b/compiler/tests-js-parser/fail/8f05256d87c7a6ae.js new file mode 100644 index 000000000..18db16664 --- /dev/null +++ b/compiler/tests-js-parser/fail/8f05256d87c7a6ae.js @@ -0,0 +1 @@ +throw diff --git a/compiler/tests-js-parser/fail/8f7c7b7f4d70f975.js b/compiler/tests-js-parser/fail/8f7c7b7f4d70f975.js new file mode 100644 index 000000000..0505244ad --- /dev/null +++ b/compiler/tests-js-parser/fail/8f7c7b7f4d70f975.js @@ -0,0 +1,2 @@ + +] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/8fdb7e6ddfb89e3a.js b/compiler/tests-js-parser/fail/8fdb7e6ddfb89e3a.js new file mode 100644 index 000000000..572f574f1 --- /dev/null +++ b/compiler/tests-js-parser/fail/8fdb7e6ddfb89e3a.js @@ -0,0 +1 @@ +function *g(yield){} diff --git a/compiler/tests-js-parser/fail/9015de51ceefe60a.js b/compiler/tests-js-parser/fail/9015de51ceefe60a.js new file mode 100644 index 000000000..280fb0e9f --- /dev/null +++ b/compiler/tests-js-parser/fail/9015de51ceefe60a.js @@ -0,0 +1 @@ +({(a):0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/90193ee960b49acd.js b/compiler/tests-js-parser/fail/90193ee960b49acd.js new file mode 100644 index 000000000..8b5d41d95 --- /dev/null +++ b/compiler/tests-js-parser/fail/90193ee960b49acd.js @@ -0,0 +1 @@ +0o9 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/90450253498eeb10.js b/compiler/tests-js-parser/fail/90450253498eeb10.js new file mode 100644 index 000000000..3c7f409aa --- /dev/null +++ b/compiler/tests-js-parser/fail/90450253498eeb10.js @@ -0,0 +1,2 @@ +throw +10; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/90cd97db35a1a503.js b/compiler/tests-js-parser/fail/90cd97db35a1a503.js new file mode 100644 index 000000000..0913bd7ae --- /dev/null +++ b/compiler/tests-js-parser/fail/90cd97db35a1a503.js @@ -0,0 +1 @@ +({a: (b = 0)} = {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/91150a288bbb31b3.js b/compiler/tests-js-parser/fail/91150a288bbb31b3.js new file mode 100644 index 000000000..bedb5239d --- /dev/null +++ b/compiler/tests-js-parser/fail/91150a288bbb31b3.js @@ -0,0 +1 @@ +try {} catch (0) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/91cb0ae4feb7f531.js b/compiler/tests-js-parser/fail/91cb0ae4feb7f531.js new file mode 100644 index 000000000..e4587fbdf --- /dev/null +++ b/compiler/tests-js-parser/fail/91cb0ae4feb7f531.js @@ -0,0 +1 @@ +({a:this}=0) diff --git a/compiler/tests-js-parser/fail/92b6af54adef3624.js b/compiler/tests-js-parser/fail/92b6af54adef3624.js new file mode 100644 index 000000000..a29592d0f --- /dev/null +++ b/compiler/tests-js-parser/fail/92b6af54adef3624.js @@ -0,0 +1 @@ +"\9"; diff --git a/compiler/tests-js-parser/fail/92dfbd6c58d2c61f.js b/compiler/tests-js-parser/fail/92dfbd6c58d2c61f.js new file mode 100644 index 000000000..a8da036fb --- /dev/null +++ b/compiler/tests-js-parser/fail/92dfbd6c58d2c61f.js @@ -0,0 +1 @@ +a\u \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/92ed8c5d2d151ff9.js b/compiler/tests-js-parser/fail/92ed8c5d2d151ff9.js new file mode 100644 index 000000000..0f5dbf08b --- /dev/null +++ b/compiler/tests-js-parser/fail/92ed8c5d2d151ff9.js @@ -0,0 +1 @@ +'\x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/938db8c9f82c8cb5.module.js b/compiler/tests-js-parser/fail/938db8c9f82c8cb5.module.js new file mode 100644 index 000000000..a616ad491 --- /dev/null +++ b/compiler/tests-js-parser/fail/938db8c9f82c8cb5.module.js @@ -0,0 +1 @@ +01 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/939b16a89d0e8704.js b/compiler/tests-js-parser/fail/939b16a89d0e8704.js new file mode 100644 index 000000000..cb924f3bb --- /dev/null +++ b/compiler/tests-js-parser/fail/939b16a89d0e8704.js @@ -0,0 +1 @@ +"use strict"; ({ v: arguments }) = obj \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/943297e7b6314bd8.module.js b/compiler/tests-js-parser/fail/943297e7b6314bd8.module.js new file mode 100644 index 000000000..2da40ec84 --- /dev/null +++ b/compiler/tests-js-parser/fail/943297e7b6314bd8.module.js @@ -0,0 +1 @@ +import * As a from 'a' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/944ea2478d838026.js b/compiler/tests-js-parser/fail/944ea2478d838026.js new file mode 100644 index 000000000..a328ea018 --- /dev/null +++ b/compiler/tests-js-parser/fail/944ea2478d838026.js @@ -0,0 +1 @@ +label: function* a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/94535dc25ef762ee.js b/compiler/tests-js-parser/fail/94535dc25ef762ee.js new file mode 100644 index 000000000..aafc7d7bf --- /dev/null +++ b/compiler/tests-js-parser/fail/94535dc25ef762ee.js @@ -0,0 +1 @@ +var x = /[a-z]/\\ux \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/95682e688db64065.js b/compiler/tests-js-parser/fail/95682e688db64065.js new file mode 100644 index 000000000..915059241 --- /dev/null +++ b/compiler/tests-js-parser/fail/95682e688db64065.js @@ -0,0 +1 @@ +for (this of that); diff --git a/compiler/tests-js-parser/fail/959004d1d6a439d7.js b/compiler/tests-js-parser/fail/959004d1d6a439d7.js new file mode 100644 index 000000000..9e1a5ea2e --- /dev/null +++ b/compiler/tests-js-parser/fail/959004d1d6a439d7.js @@ -0,0 +1 @@ +var 🀒 diff --git a/compiler/tests-js-parser/fail/95c10472e36270b6.js b/compiler/tests-js-parser/fail/95c10472e36270b6.js new file mode 100644 index 000000000..d57a24d4a --- /dev/null +++ b/compiler/tests-js-parser/fail/95c10472e36270b6.js @@ -0,0 +1 @@ +(a,...a) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/95e67679ebbacf14.js b/compiler/tests-js-parser/fail/95e67679ebbacf14.js new file mode 100644 index 000000000..c9c078c63 --- /dev/null +++ b/compiler/tests-js-parser/fail/95e67679ebbacf14.js @@ -0,0 +1 @@ +class A {static static static(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/96060983e86029b6.js b/compiler/tests-js-parser/fail/96060983e86029b6.js new file mode 100644 index 000000000..9c7f15e36 --- /dev/null +++ b/compiler/tests-js-parser/fail/96060983e86029b6.js @@ -0,0 +1 @@ +var [a]; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9660037e1c979757.js b/compiler/tests-js-parser/fail/9660037e1c979757.js new file mode 100644 index 000000000..3de539ac3 --- /dev/null +++ b/compiler/tests-js-parser/fail/9660037e1c979757.js @@ -0,0 +1,3 @@ +(function*() { + function({x: y = yield 3}) {} +}) diff --git a/compiler/tests-js-parser/fail/96914a2df2c94687.js b/compiler/tests-js-parser/fail/96914a2df2c94687.js new file mode 100644 index 000000000..1cd320def --- /dev/null +++ b/compiler/tests-js-parser/fail/96914a2df2c94687.js @@ -0,0 +1 @@ +(function((a)){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/96d7443d69f12eea.js b/compiler/tests-js-parser/fail/96d7443d69f12eea.js new file mode 100644 index 000000000..5dfb87e2a --- /dev/null +++ b/compiler/tests-js-parser/fail/96d7443d69f12eea.js @@ -0,0 +1 @@ +({get[a,b]:0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/971cf622ebaef28e.js b/compiler/tests-js-parser/fail/971cf622ebaef28e.js new file mode 100644 index 000000000..2aa2d7736 --- /dev/null +++ b/compiler/tests-js-parser/fail/971cf622ebaef28e.js @@ -0,0 +1 @@ +with(true) class a {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/974222e3683f284a.js b/compiler/tests-js-parser/fail/974222e3683f284a.js new file mode 100644 index 000000000..95fe09f25 --- /dev/null +++ b/compiler/tests-js-parser/fail/974222e3683f284a.js @@ -0,0 +1 @@ +function hello() { "use strict"; function inner() { "octal directive\1"; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/975d02f132c05a98.js b/compiler/tests-js-parser/fail/975d02f132c05a98.js new file mode 100644 index 000000000..b00db74f6 --- /dev/null +++ b/compiler/tests-js-parser/fail/975d02f132c05a98.js @@ -0,0 +1 @@ +export { if } from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9767d9a6c9ea543c.js b/compiler/tests-js-parser/fail/9767d9a6c9ea543c.js new file mode 100644 index 000000000..8e293f807 --- /dev/null +++ b/compiler/tests-js-parser/fail/9767d9a6c9ea543c.js @@ -0,0 +1 @@ +(class extends a,b {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/976b6247ca78ab51.js b/compiler/tests-js-parser/fail/976b6247ca78ab51.js new file mode 100644 index 000000000..c312c0969 --- /dev/null +++ b/compiler/tests-js-parser/fail/976b6247ca78ab51.js @@ -0,0 +1 @@ +[...{a=0},]=0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/97fc32bf01227e39.js b/compiler/tests-js-parser/fail/97fc32bf01227e39.js new file mode 100644 index 000000000..11d7a8028 --- /dev/null +++ b/compiler/tests-js-parser/fail/97fc32bf01227e39.js @@ -0,0 +1 @@ +[/[/] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/98204d734f8c72b3.js b/compiler/tests-js-parser/fail/98204d734f8c72b3.js new file mode 100644 index 000000000..2ac763ab2 --- /dev/null +++ b/compiler/tests-js-parser/fail/98204d734f8c72b3.js @@ -0,0 +1 @@ +(class {a}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/983987033f0e1170.js b/compiler/tests-js-parser/fail/983987033f0e1170.js new file mode 100644 index 000000000..fa29cdfff --- /dev/null +++ b/compiler/tests-js-parser/fail/983987033f0e1170.js @@ -0,0 +1 @@ +** \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/98e0b4521b7ec370.module.js b/compiler/tests-js-parser/fail/98e0b4521b7ec370.module.js new file mode 100644 index 000000000..0a33ae08e --- /dev/null +++ b/compiler/tests-js-parser/fail/98e0b4521b7ec370.module.js @@ -0,0 +1 @@ +export; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/98f5714a70195f28.module.js b/compiler/tests-js-parser/fail/98f5714a70195f28.module.js new file mode 100644 index 000000000..9066c11e8 --- /dev/null +++ b/compiler/tests-js-parser/fail/98f5714a70195f28.module.js @@ -0,0 +1 @@ +import {a as function} from 'a'; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9ba7f8619b63519f.js b/compiler/tests-js-parser/fail/9ba7f8619b63519f.js new file mode 100644 index 000000000..bc7938c17 --- /dev/null +++ b/compiler/tests-js-parser/fail/9ba7f8619b63519f.js @@ -0,0 +1,3 @@ +(function*() { + function*(x = yield 3) {} +}) diff --git a/compiler/tests-js-parser/fail/9c9196e04a0615c0.js b/compiler/tests-js-parser/fail/9c9196e04a0615c0.js new file mode 100644 index 000000000..b1df4de03 --- /dev/null +++ b/compiler/tests-js-parser/fail/9c9196e04a0615c0.js @@ -0,0 +1 @@ +({ get: g(d) { } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9c961739e5d9e2ff.module.js b/compiler/tests-js-parser/fail/9c961739e5d9e2ff.module.js new file mode 100644 index 000000000..11f229c9c --- /dev/null +++ b/compiler/tests-js-parser/fail/9c961739e5d9e2ff.module.js @@ -0,0 +1 @@ +export * From "a" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9ca6021261b01550.js b/compiler/tests-js-parser/fail/9ca6021261b01550.js new file mode 100644 index 000000000..1bd0a8fb6 --- /dev/null +++ b/compiler/tests-js-parser/fail/9ca6021261b01550.js @@ -0,0 +1 @@ +0o1a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9cbce7d794e8d679.js b/compiler/tests-js-parser/fail/9cbce7d794e8d679.js new file mode 100644 index 000000000..d083bcf3f --- /dev/null +++ b/compiler/tests-js-parser/fail/9cbce7d794e8d679.js @@ -0,0 +1 @@ +class A { set prop() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9cc8f0d9f8555a71.js b/compiler/tests-js-parser/fail/9cc8f0d9f8555a71.js new file mode 100644 index 000000000..b8a2bb9b9 --- /dev/null +++ b/compiler/tests-js-parser/fail/9cc8f0d9f8555a71.js @@ -0,0 +1,2 @@ +(a,...a)/* +*/ => 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9f08fdb641588efc.module.js b/compiler/tests-js-parser/fail/9f08fdb641588efc.module.js new file mode 100644 index 000000000..4cdb7199b --- /dev/null +++ b/compiler/tests-js-parser/fail/9f08fdb641588efc.module.js @@ -0,0 +1 @@ +import {b,c,,} from 'a'; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9f15affa01060595.js b/compiler/tests-js-parser/fail/9f15affa01060595.js new file mode 100644 index 000000000..8c521a6b6 --- /dev/null +++ b/compiler/tests-js-parser/fail/9f15affa01060595.js @@ -0,0 +1 @@ +function*g(yield = 0){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9f5a6dae7645976a.js b/compiler/tests-js-parser/fail/9f5a6dae7645976a.js new file mode 100644 index 000000000..827973d74 --- /dev/null +++ b/compiler/tests-js-parser/fail/9f5a6dae7645976a.js @@ -0,0 +1 @@ +`\37` \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9fa56398be8a1769.js b/compiler/tests-js-parser/fail/9fa56398be8a1769.js new file mode 100644 index 000000000..19848a993 --- /dev/null +++ b/compiler/tests-js-parser/fail/9fa56398be8a1769.js @@ -0,0 +1 @@ +[...x, ...y] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9fc618bb96c91f1b.js b/compiler/tests-js-parser/fail/9fc618bb96c91f1b.js new file mode 100644 index 000000000..4fb08bf41 --- /dev/null +++ b/compiler/tests-js-parser/fail/9fc618bb96c91f1b.js @@ -0,0 +1 @@ +0O18 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9fc6ddfbb0f1cbe3.js b/compiler/tests-js-parser/fail/9fc6ddfbb0f1cbe3.js new file mode 100644 index 000000000..c392a2980 --- /dev/null +++ b/compiler/tests-js-parser/fail/9fc6ddfbb0f1cbe3.js @@ -0,0 +1 @@ +f(....a) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/9fdb9877fcc446e2.js b/compiler/tests-js-parser/fail/9fdb9877fcc446e2.js new file mode 100644 index 000000000..360727b87 --- /dev/null +++ b/compiler/tests-js-parser/fail/9fdb9877fcc446e2.js @@ -0,0 +1 @@ +if (b,...a, ); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a028a9ab5777d337.js b/compiler/tests-js-parser/fail/a028a9ab5777d337.js new file mode 100644 index 000000000..7dc9437ed --- /dev/null +++ b/compiler/tests-js-parser/fail/a028a9ab5777d337.js @@ -0,0 +1 @@ +'use strict'; ('\01') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a02fdefc85b71fee.js b/compiler/tests-js-parser/fail/a02fdefc85b71fee.js new file mode 100644 index 000000000..02eec9e5d --- /dev/null +++ b/compiler/tests-js-parser/fail/a02fdefc85b71fee.js @@ -0,0 +1 @@ +(function* ({e: a.b}) {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a069c2ecbeb0f43a.js b/compiler/tests-js-parser/fail/a069c2ecbeb0f43a.js new file mode 100644 index 000000000..9a8629f96 --- /dev/null +++ b/compiler/tests-js-parser/fail/a069c2ecbeb0f43a.js @@ -0,0 +1 @@ +switch (cond) { case 10: let a = 20; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a0998570a3bf9869.js b/compiler/tests-js-parser/fail/a0998570a3bf9869.js new file mode 100644 index 000000000..f8177d130 --- /dev/null +++ b/compiler/tests-js-parser/fail/a0998570a3bf9869.js @@ -0,0 +1 @@ +"use strict"; `${test}\02`; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a1701f6320c02703.js b/compiler/tests-js-parser/fail/a1701f6320c02703.js new file mode 100644 index 000000000..a3fce2d85 --- /dev/null +++ b/compiler/tests-js-parser/fail/a1701f6320c02703.js @@ -0,0 +1 @@ +var {a:(b)} = 0 diff --git a/compiler/tests-js-parser/fail/a20584c5a6110526.js b/compiler/tests-js-parser/fail/a20584c5a6110526.js new file mode 100644 index 000000000..82e6374d3 --- /dev/null +++ b/compiler/tests-js-parser/fail/a20584c5a6110526.js @@ -0,0 +1 @@ +import { class, var } from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a24d5a2bf175ee97.js b/compiler/tests-js-parser/fail/a24d5a2bf175ee97.js new file mode 100644 index 000000000..7a64c42f2 --- /dev/null +++ b/compiler/tests-js-parser/fail/a24d5a2bf175ee97.js @@ -0,0 +1 @@ +a enum \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a31d1202f94df972.js b/compiler/tests-js-parser/fail/a31d1202f94df972.js new file mode 100644 index 000000000..9cba4866c --- /dev/null +++ b/compiler/tests-js-parser/fail/a31d1202f94df972.js @@ -0,0 +1 @@ +var {a: b.c} = 0; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a3710b36f9b97324.js b/compiler/tests-js-parser/fail/a3710b36f9b97324.js new file mode 100644 index 000000000..70875a275 --- /dev/null +++ b/compiler/tests-js-parser/fail/a3710b36f9b97324.js @@ -0,0 +1 @@ +f(....g); diff --git a/compiler/tests-js-parser/fail/a38011d2c010999e.js b/compiler/tests-js-parser/fail/a38011d2c010999e.js new file mode 100644 index 000000000..8fdca8258 --- /dev/null +++ b/compiler/tests-js-parser/fail/a38011d2c010999e.js @@ -0,0 +1 @@ +for({a=0};;); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a39be920807be551.js b/compiler/tests-js-parser/fail/a39be920807be551.js new file mode 100644 index 000000000..fb3d8305f --- /dev/null +++ b/compiler/tests-js-parser/fail/a39be920807be551.js @@ -0,0 +1 @@ +var default \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a3ec3739bb2f89ad.js b/compiler/tests-js-parser/fail/a3ec3739bb2f89ad.js new file mode 100644 index 000000000..a9ceda372 --- /dev/null +++ b/compiler/tests-js-parser/fail/a3ec3739bb2f89ad.js @@ -0,0 +1,2 @@ +let x, +y = 3, diff --git a/compiler/tests-js-parser/fail/a4bfa8e3b523c466.module.js b/compiler/tests-js-parser/fail/a4bfa8e3b523c466.module.js new file mode 100644 index 000000000..e968749d6 --- /dev/null +++ b/compiler/tests-js-parser/fail/a4bfa8e3b523c466.module.js @@ -0,0 +1 @@ +{export default 3;} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a5370cb0412d7c8a.js b/compiler/tests-js-parser/fail/a5370cb0412d7c8a.js new file mode 100644 index 000000000..6673c561e --- /dev/null +++ b/compiler/tests-js-parser/fail/a5370cb0412d7c8a.js @@ -0,0 +1 @@ +0x3in[] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a54942c8e365f378.js b/compiler/tests-js-parser/fail/a54942c8e365f378.js new file mode 100644 index 000000000..99e07d0f0 --- /dev/null +++ b/compiler/tests-js-parser/fail/a54942c8e365f378.js @@ -0,0 +1 @@ +0x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a5a24bd27eef1337.js b/compiler/tests-js-parser/fail/a5a24bd27eef1337.js new file mode 100644 index 000000000..1ca20284b --- /dev/null +++ b/compiler/tests-js-parser/fail/a5a24bd27eef1337.js @@ -0,0 +1,3 @@ +(function*() { + function*({[yield 3]: y}) {} +}) diff --git a/compiler/tests-js-parser/fail/a633b3217b5b8026.js b/compiler/tests-js-parser/fail/a633b3217b5b8026.js new file mode 100644 index 000000000..e5d956d8f --- /dev/null +++ b/compiler/tests-js-parser/fail/a633b3217b5b8026.js @@ -0,0 +1 @@ +({a} += 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a651ee9d0db08692.js b/compiler/tests-js-parser/fail/a651ee9d0db08692.js new file mode 100644 index 000000000..38cb9d92f --- /dev/null +++ b/compiler/tests-js-parser/fail/a651ee9d0db08692.js @@ -0,0 +1 @@ +for (let [a = let];;) {} diff --git a/compiler/tests-js-parser/fail/a660fb69f32f7ad2.js b/compiler/tests-js-parser/fail/a660fb69f32f7ad2.js new file mode 100644 index 000000000..2300a37d2 --- /dev/null +++ b/compiler/tests-js-parser/fail/a660fb69f32f7ad2.js @@ -0,0 +1 @@ +try {} catch ((e)) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a70483c4d46a58e2.js b/compiler/tests-js-parser/fail/a70483c4d46a58e2.js new file mode 100644 index 000000000..a44b415cb --- /dev/null +++ b/compiler/tests-js-parser/fail/a70483c4d46a58e2.js @@ -0,0 +1 @@ +for (let [let];;;) {} diff --git a/compiler/tests-js-parser/fail/a7571e2f3c5d075c.js b/compiler/tests-js-parser/fail/a7571e2f3c5d075c.js new file mode 100644 index 000000000..1f929174d --- /dev/null +++ b/compiler/tests-js-parser/fail/a7571e2f3c5d075c.js @@ -0,0 +1 @@ +var if = 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a77add5a553e5cce.js b/compiler/tests-js-parser/fail/a77add5a553e5cce.js new file mode 100644 index 000000000..a34db3c2c --- /dev/null +++ b/compiler/tests-js-parser/fail/a77add5a553e5cce.js @@ -0,0 +1 @@ +0.toString \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a793dd27762c8ec8.js b/compiler/tests-js-parser/fail/a793dd27762c8ec8.js new file mode 100644 index 000000000..f63fdfc52 --- /dev/null +++ b/compiler/tests-js-parser/fail/a793dd27762c8ec8.js @@ -0,0 +1 @@ +for(([a]) in 0); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a79b044230246e2c.js b/compiler/tests-js-parser/fail/a79b044230246e2c.js new file mode 100644 index 000000000..7bc006407 --- /dev/null +++ b/compiler/tests-js-parser/fail/a79b044230246e2c.js @@ -0,0 +1,3 @@ +(function*() { + function({[yield 3]: y}) {} +}) diff --git a/compiler/tests-js-parser/fail/a7b643867c8f150d.js b/compiler/tests-js-parser/fail/a7b643867c8f150d.js new file mode 100644 index 000000000..135f2688c --- /dev/null +++ b/compiler/tests-js-parser/fail/a7b643867c8f150d.js @@ -0,0 +1 @@ +var [(a)] = 0 diff --git a/compiler/tests-js-parser/fail/a7be138dfd29025e.js b/compiler/tests-js-parser/fail/a7be138dfd29025e.js new file mode 100644 index 000000000..0739904dc --- /dev/null +++ b/compiler/tests-js-parser/fail/a7be138dfd29025e.js @@ -0,0 +1,3 @@ +(function*() { + { *[yield iter]() {} } +}) diff --git a/compiler/tests-js-parser/fail/a7c82de4904833cc.js b/compiler/tests-js-parser/fail/a7c82de4904833cc.js new file mode 100644 index 000000000..4ca72a935 --- /dev/null +++ b/compiler/tests-js-parser/fail/a7c82de4904833cc.js @@ -0,0 +1 @@ +(class {3:0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a86d6dedf5bd962e.js b/compiler/tests-js-parser/fail/a86d6dedf5bd962e.js new file mode 100644 index 000000000..0d4eae5d5 --- /dev/null +++ b/compiler/tests-js-parser/fail/a86d6dedf5bd962e.js @@ -0,0 +1 @@ +\x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a87ce46793cc659b.js b/compiler/tests-js-parser/fail/a87ce46793cc659b.js new file mode 100644 index 000000000..17131e698 --- /dev/null +++ b/compiler/tests-js-parser/fail/a87ce46793cc659b.js @@ -0,0 +1 @@ +�x \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a8beb1480f385441.js b/compiler/tests-js-parser/fail/a8beb1480f385441.js new file mode 100644 index 000000000..88a4a1129 --- /dev/null +++ b/compiler/tests-js-parser/fail/a8beb1480f385441.js @@ -0,0 +1 @@ +func() = 4 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a9253dc8529dd214.js b/compiler/tests-js-parser/fail/a9253dc8529dd214.js new file mode 100644 index 000000000..b7d5379f9 --- /dev/null +++ b/compiler/tests-js-parser/fail/a9253dc8529dd214.js @@ -0,0 +1 @@ +\ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/a9431906f263368d.js b/compiler/tests-js-parser/fail/a9431906f263368d.js new file mode 100644 index 000000000..b8f1f5c12 --- /dev/null +++ b/compiler/tests-js-parser/fail/a9431906f263368d.js @@ -0,0 +1 @@ +({a = 0}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/aa232c1eb3da8805.js b/compiler/tests-js-parser/fail/aa232c1eb3da8805.js new file mode 100644 index 000000000..46f68eb45 --- /dev/null +++ b/compiler/tests-js-parser/fail/aa232c1eb3da8805.js @@ -0,0 +1 @@ +function*g() { try {} catch (yield) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/aa5e59b2d67fb00f.js b/compiler/tests-js-parser/fail/aa5e59b2d67fb00f.js new file mode 100644 index 000000000..56316046c --- /dev/null +++ b/compiler/tests-js-parser/fail/aa5e59b2d67fb00f.js @@ -0,0 +1 @@ +let default \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/aaa4c4245303bd6d.js b/compiler/tests-js-parser/fail/aaa4c4245303bd6d.js new file mode 100644 index 000000000..c4250ca11 --- /dev/null +++ b/compiler/tests-js-parser/fail/aaa4c4245303bd6d.js @@ -0,0 +1 @@ +{ get 2 } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/aae5dc521eff47c4.js b/compiler/tests-js-parser/fail/aae5dc521eff47c4.js new file mode 100644 index 000000000..893fc62f4 --- /dev/null +++ b/compiler/tests-js-parser/fail/aae5dc521eff47c4.js @@ -0,0 +1 @@ +class a { set foo(...v) {} }; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/aae75623a18fa153.module.js b/compiler/tests-js-parser/fail/aae75623a18fa153.module.js new file mode 100644 index 000000000..f87827d25 --- /dev/null +++ b/compiler/tests-js-parser/fail/aae75623a18fa153.module.js @@ -0,0 +1 @@ +import {} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ab35979364766bf0.js b/compiler/tests-js-parser/fail/ab35979364766bf0.js new file mode 100644 index 000000000..7b6a50209 --- /dev/null +++ b/compiler/tests-js-parser/fail/ab35979364766bf0.js @@ -0,0 +1 @@ +'use strict'; 07 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ab9d14c2ef38f180.js b/compiler/tests-js-parser/fail/ab9d14c2ef38f180.js new file mode 100644 index 000000000..f8e428c3e --- /dev/null +++ b/compiler/tests-js-parser/fail/ab9d14c2ef38f180.js @@ -0,0 +1 @@ +(0, {a = 0}) = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/abc46381e4e6bcca.js b/compiler/tests-js-parser/fail/abc46381e4e6bcca.js new file mode 100644 index 000000000..bf6b77217 --- /dev/null +++ b/compiler/tests-js-parser/fail/abc46381e4e6bcca.js @@ -0,0 +1 @@ +var \uD83B\uDE00 diff --git a/compiler/tests-js-parser/fail/abe5f49acb8e132a.js b/compiler/tests-js-parser/fail/abe5f49acb8e132a.js new file mode 100644 index 000000000..0ba3cbe0b --- /dev/null +++ b/compiler/tests-js-parser/fail/abe5f49acb8e132a.js @@ -0,0 +1 @@ +"\u{FFZ}" \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ac0b52a2ae6ef999.js b/compiler/tests-js-parser/fail/ac0b52a2ae6ef999.js new file mode 100644 index 000000000..7d46b283b --- /dev/null +++ b/compiler/tests-js-parser/fail/ac0b52a2ae6ef999.js @@ -0,0 +1 @@ +do \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ac1ee2739ad30d66.js b/compiler/tests-js-parser/fail/ac1ee2739ad30d66.js new file mode 100644 index 000000000..48a770996 --- /dev/null +++ b/compiler/tests-js-parser/fail/ac1ee2739ad30d66.js @@ -0,0 +1 @@ +/* \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ac4ee5fb095faad0.js b/compiler/tests-js-parser/fail/ac4ee5fb095faad0.js new file mode 100644 index 000000000..11e48b474 --- /dev/null +++ b/compiler/tests-js-parser/fail/ac4ee5fb095faad0.js @@ -0,0 +1 @@ +for (let x, y, z, let = 1;;;) {} diff --git a/compiler/tests-js-parser/fail/aca911e336954a5b.js b/compiler/tests-js-parser/fail/aca911e336954a5b.js new file mode 100644 index 000000000..a2aafd29f --- /dev/null +++ b/compiler/tests-js-parser/fail/aca911e336954a5b.js @@ -0,0 +1 @@ +("\u{110000}") \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/adb1ba1ed78bb9f4.js b/compiler/tests-js-parser/fail/adb1ba1ed78bb9f4.js new file mode 100644 index 000000000..99cb40d2b --- /dev/null +++ b/compiler/tests-js-parser/fail/adb1ba1ed78bb9f4.js @@ -0,0 +1 @@ +0xz \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/addee2ebe09cfa9c.js b/compiler/tests-js-parser/fail/addee2ebe09cfa9c.js new file mode 100644 index 000000000..d6169342e --- /dev/null +++ b/compiler/tests-js-parser/fail/addee2ebe09cfa9c.js @@ -0,0 +1 @@ +({a: this} = 0); diff --git a/compiler/tests-js-parser/fail/ae0a7ac275bc9f5c.js b/compiler/tests-js-parser/fail/ae0a7ac275bc9f5c.js new file mode 100644 index 000000000..e15ba6bf9 --- /dev/null +++ b/compiler/tests-js-parser/fail/ae0a7ac275bc9f5c.js @@ -0,0 +1 @@ +[...a, ] = b \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/af366e0bf7f97bec.js b/compiler/tests-js-parser/fail/af366e0bf7f97bec.js new file mode 100644 index 000000000..7ea18d96e --- /dev/null +++ b/compiler/tests-js-parser/fail/af366e0bf7f97bec.js @@ -0,0 +1 @@ +import { enum } from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/af3a9b653481f43a.js b/compiler/tests-js-parser/fail/af3a9b653481f43a.js new file mode 100644 index 000000000..686937f4e --- /dev/null +++ b/compiler/tests-js-parser/fail/af3a9b653481f43a.js @@ -0,0 +1 @@ +'use strict'; 00 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b02b296bd115b9b9.js b/compiler/tests-js-parser/fail/b02b296bd115b9b9.js new file mode 100644 index 000000000..2c0141cbb --- /dev/null +++ b/compiler/tests-js-parser/fail/b02b296bd115b9b9.js @@ -0,0 +1 @@ +for (const x = 1, y = 2, z = 3, let = 0;;;) {} diff --git a/compiler/tests-js-parser/fail/b02cbe75ce1ceb06.js b/compiler/tests-js-parser/fail/b02cbe75ce1ceb06.js new file mode 100644 index 000000000..61aa5a4ae --- /dev/null +++ b/compiler/tests-js-parser/fail/b02cbe75ce1ceb06.js @@ -0,0 +1 @@ +[...0,{a=0}]=0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b03ee881dce1a367.js b/compiler/tests-js-parser/fail/b03ee881dce1a367.js new file mode 100644 index 000000000..874dec75a --- /dev/null +++ b/compiler/tests-js-parser/fail/b03ee881dce1a367.js @@ -0,0 +1 @@ +([a.a]) => 42 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b11b4ca186c00769.js b/compiler/tests-js-parser/fail/b11b4ca186c00769.js new file mode 100644 index 000000000..ea4f9caa9 --- /dev/null +++ b/compiler/tests-js-parser/fail/b11b4ca186c00769.js @@ -0,0 +1 @@ +\\ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b1f1e599a3dcf9c5.js b/compiler/tests-js-parser/fail/b1f1e599a3dcf9c5.js new file mode 100644 index 000000000..bbf5aaab7 --- /dev/null +++ b/compiler/tests-js-parser/fail/b1f1e599a3dcf9c5.js @@ -0,0 +1 @@ +let [...a,] = 0 diff --git a/compiler/tests-js-parser/fail/b23c154206fb45fa.module.js b/compiler/tests-js-parser/fail/b23c154206fb45fa.module.js new file mode 100644 index 000000000..d9ece4e1c --- /dev/null +++ b/compiler/tests-js-parser/fail/b23c154206fb45fa.module.js @@ -0,0 +1 @@ +export {a,,b} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b25024dbded18139.js b/compiler/tests-js-parser/fail/b25024dbded18139.js new file mode 100644 index 000000000..2fd34315a --- /dev/null +++ b/compiler/tests-js-parser/fail/b25024dbded18139.js @@ -0,0 +1 @@ +a b; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b306d9ff847c120d.js b/compiler/tests-js-parser/fail/b306d9ff847c120d.js new file mode 100644 index 000000000..32bcdf1ac --- /dev/null +++ b/compiler/tests-js-parser/fail/b306d9ff847c120d.js @@ -0,0 +1 @@ +/test \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b3b14fb0e398703d.js b/compiler/tests-js-parser/fail/b3b14fb0e398703d.js new file mode 100644 index 000000000..64b9f753e --- /dev/null +++ b/compiler/tests-js-parser/fail/b3b14fb0e398703d.js @@ -0,0 +1 @@ +function*g(yield){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b3fc8ced7ce28c35.js b/compiler/tests-js-parser/fail/b3fc8ced7ce28c35.js new file mode 100644 index 000000000..b996954aa --- /dev/null +++ b/compiler/tests-js-parser/fail/b3fc8ced7ce28c35.js @@ -0,0 +1 @@ +('\x') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b48bdd4be8adc5d9.js b/compiler/tests-js-parser/fail/b48bdd4be8adc5d9.js new file mode 100644 index 000000000..6efd559d8 --- /dev/null +++ b/compiler/tests-js-parser/fail/b48bdd4be8adc5d9.js @@ -0,0 +1 @@ +0O9 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b508d676bbb2b2af.js b/compiler/tests-js-parser/fail/b508d676bbb2b2af.js new file mode 100644 index 000000000..60b84e989 --- /dev/null +++ b/compiler/tests-js-parser/fail/b508d676bbb2b2af.js @@ -0,0 +1 @@ +(function ([a.b]) {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b61406dafcaab4b7.js b/compiler/tests-js-parser/fail/b61406dafcaab4b7.js new file mode 100644 index 000000000..32905f812 --- /dev/null +++ b/compiler/tests-js-parser/fail/b61406dafcaab4b7.js @@ -0,0 +1 @@ +('\x0') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b6e0c72c00ebb26b.js b/compiler/tests-js-parser/fail/b6e0c72c00ebb26b.js new file mode 100644 index 000000000..c7dc1993a --- /dev/null +++ b/compiler/tests-js-parser/fail/b6e0c72c00ebb26b.js @@ -0,0 +1 @@ +0O1a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b724e6baaf7fd094.js b/compiler/tests-js-parser/fail/b724e6baaf7fd094.js new file mode 100644 index 000000000..99192a030 --- /dev/null +++ b/compiler/tests-js-parser/fail/b724e6baaf7fd094.js @@ -0,0 +1 @@ +function false() { } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b757d5d1b6a40259.js b/compiler/tests-js-parser/fail/b757d5d1b6a40259.js new file mode 100644 index 000000000..f4f741b08 --- /dev/null +++ b/compiler/tests-js-parser/fail/b757d5d1b6a40259.js @@ -0,0 +1 @@ +class A { set prop(x, y) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b7ae8c17f892abf6.js b/compiler/tests-js-parser/fail/b7ae8c17f892abf6.js new file mode 100644 index 000000000..89ac62245 --- /dev/null +++ b/compiler/tests-js-parser/fail/b7ae8c17f892abf6.js @@ -0,0 +1,2 @@ +// + ] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b7b057684207633b.js b/compiler/tests-js-parser/fail/b7b057684207633b.js new file mode 100644 index 000000000..8d9106f9c --- /dev/null +++ b/compiler/tests-js-parser/fail/b7b057684207633b.js @@ -0,0 +1 @@ +`\1`; diff --git a/compiler/tests-js-parser/fail/b8599b4858409b7f.js b/compiler/tests-js-parser/fail/b8599b4858409b7f.js new file mode 100644 index 000000000..7ff4e307c --- /dev/null +++ b/compiler/tests-js-parser/fail/b8599b4858409b7f.js @@ -0,0 +1 @@ +'use strict'; a package \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b87364b546f27bff.js b/compiler/tests-js-parser/fail/b87364b546f27bff.js new file mode 100644 index 000000000..067496080 --- /dev/null +++ b/compiler/tests-js-parser/fail/b87364b546f27bff.js @@ -0,0 +1 @@ +var [x] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b88ab70205263170.module.js b/compiler/tests-js-parser/fail/b88ab70205263170.module.js new file mode 100644 index 000000000..e564286d9 --- /dev/null +++ b/compiler/tests-js-parser/fail/b88ab70205263170.module.js @@ -0,0 +1 @@ +{export {a};} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b8de6b7c0e5753f1.js b/compiler/tests-js-parser/fail/b8de6b7c0e5753f1.js new file mode 100644 index 000000000..39678c741 --- /dev/null +++ b/compiler/tests-js-parser/fail/b8de6b7c0e5753f1.js @@ -0,0 +1 @@ +({[x]}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b94007220f24ebe5.js b/compiler/tests-js-parser/fail/b94007220f24ebe5.js new file mode 100644 index 000000000..43ea55056 --- /dev/null +++ b/compiler/tests-js-parser/fail/b94007220f24ebe5.js @@ -0,0 +1 @@ +const x = 0, y = 1,; diff --git a/compiler/tests-js-parser/fail/b9422ea5edcddf0b.js b/compiler/tests-js-parser/fail/b9422ea5edcddf0b.js new file mode 100644 index 000000000..b992f1802 --- /dev/null +++ b/compiler/tests-js-parser/fail/b9422ea5edcddf0b.js @@ -0,0 +1 @@ +`\00`; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b94278c0e4bdb364.js b/compiler/tests-js-parser/fail/b94278c0e4bdb364.js new file mode 100644 index 000000000..a00bf8195 --- /dev/null +++ b/compiler/tests-js-parser/fail/b94278c0e4bdb364.js @@ -0,0 +1 @@ +__ \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/b996783239113de2.js b/compiler/tests-js-parser/fail/b996783239113de2.js new file mode 100644 index 000000000..de1208284 --- /dev/null +++ b/compiler/tests-js-parser/fail/b996783239113de2.js @@ -0,0 +1 @@ +(a ...b) => 0 diff --git a/compiler/tests-js-parser/fail/b9b5930aa449a36a.js b/compiler/tests-js-parser/fail/b9b5930aa449a36a.js new file mode 100644 index 000000000..0a3bc95b1 --- /dev/null +++ b/compiler/tests-js-parser/fail/b9b5930aa449a36a.js @@ -0,0 +1 @@ +a => {}() \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ba2d36d35efa68ec.js b/compiler/tests-js-parser/fail/ba2d36d35efa68ec.js new file mode 100644 index 000000000..b84cd8ffa --- /dev/null +++ b/compiler/tests-js-parser/fail/ba2d36d35efa68ec.js @@ -0,0 +1 @@ +a --> \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/baddfc428e73b8b8.js b/compiler/tests-js-parser/fail/baddfc428e73b8b8.js new file mode 100644 index 000000000..c0f36e030 --- /dev/null +++ b/compiler/tests-js-parser/fail/baddfc428e73b8b8.js @@ -0,0 +1 @@ +import { a as enum } from 'foo' \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/bb0f3d2d2848abe9.js b/compiler/tests-js-parser/fail/bb0f3d2d2848abe9.js new file mode 100644 index 000000000..edefc106d --- /dev/null +++ b/compiler/tests-js-parser/fail/bb0f3d2d2848abe9.js @@ -0,0 +1 @@ +if(false) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/bb210b308413d99c.js b/compiler/tests-js-parser/fail/bb210b308413d99c.js new file mode 100644 index 000000000..7d8f773fc --- /dev/null +++ b/compiler/tests-js-parser/fail/bb210b308413d99c.js @@ -0,0 +1 @@ +(...a, ...b) => 0 diff --git a/compiler/tests-js-parser/fail/bcde05eea9466dfd.js b/compiler/tests-js-parser/fail/bcde05eea9466dfd.js new file mode 100644 index 000000000..4c8fa16fd --- /dev/null +++ b/compiler/tests-js-parser/fail/bcde05eea9466dfd.js @@ -0,0 +1 @@ +[...{a=0},] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/bdb0f8dd27e0e164.js b/compiler/tests-js-parser/fail/bdb0f8dd27e0e164.js new file mode 100644 index 000000000..66386204a --- /dev/null +++ b/compiler/tests-js-parser/fail/bdb0f8dd27e0e164.js @@ -0,0 +1 @@ +var x = " diff --git a/compiler/tests-js-parser/fail/bdb40451ba403567.js b/compiler/tests-js-parser/fail/bdb40451ba403567.js new file mode 100644 index 000000000..eb7229687 --- /dev/null +++ b/compiler/tests-js-parser/fail/bdb40451ba403567.js @@ -0,0 +1 @@ +a\u1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/bede010c6ab4fedd.js b/compiler/tests-js-parser/fail/bede010c6ab4fedd.js new file mode 100644 index 000000000..bf457f651 --- /dev/null +++ b/compiler/tests-js-parser/fail/bede010c6ab4fedd.js @@ -0,0 +1 @@ +‿ = 10 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/beead77994cf5733.js b/compiler/tests-js-parser/fail/beead77994cf5733.js new file mode 100644 index 000000000..5a77f0583 --- /dev/null +++ b/compiler/tests-js-parser/fail/beead77994cf5733.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/befeaa367d8f27db.js b/compiler/tests-js-parser/fail/befeaa367d8f27db.js new file mode 100644 index 000000000..618be385e --- /dev/null +++ b/compiler/tests-js-parser/fail/befeaa367d8f27db.js @@ -0,0 +1 @@ +x\u002a \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/bf18cf6919ab9dfd.js b/compiler/tests-js-parser/fail/bf18cf6919ab9dfd.js new file mode 100644 index 000000000..44c364400 --- /dev/null +++ b/compiler/tests-js-parser/fail/bf18cf6919ab9dfd.js @@ -0,0 +1 @@ +0x1z \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/bf49ec8d96884562.js b/compiler/tests-js-parser/fail/bf49ec8d96884562.js new file mode 100644 index 000000000..67227aaa8 --- /dev/null +++ b/compiler/tests-js-parser/fail/bf49ec8d96884562.js @@ -0,0 +1 @@ +/(?!.){0,}?/u \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/bfadeead1ddbd122.js b/compiler/tests-js-parser/fail/bfadeead1ddbd122.js new file mode 100644 index 000000000..d5bf272b1 --- /dev/null +++ b/compiler/tests-js-parser/fail/bfadeead1ddbd122.js @@ -0,0 +1 @@ +function hello() { 'use strict'; "\00"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c045e273186c0644.js b/compiler/tests-js-parser/fail/c045e273186c0644.js new file mode 100644 index 000000000..092a3fb6e --- /dev/null +++ b/compiler/tests-js-parser/fail/c045e273186c0644.js @@ -0,0 +1 @@ +({a: 0, b = 0}); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c060a3014ad24dfd.js b/compiler/tests-js-parser/fail/c060a3014ad24dfd.js new file mode 100644 index 000000000..6d5f2bc04 --- /dev/null +++ b/compiler/tests-js-parser/fail/c060a3014ad24dfd.js @@ -0,0 +1 @@ +var ð« ž_ = 12; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c06e4b51c181990e.js b/compiler/tests-js-parser/fail/c06e4b51c181990e.js new file mode 100644 index 000000000..bf4f139b2 --- /dev/null +++ b/compiler/tests-js-parser/fail/c06e4b51c181990e.js @@ -0,0 +1,3 @@ +class A { + foo() { new super + 3 } +} diff --git a/compiler/tests-js-parser/fail/c0a136a959991f46.js b/compiler/tests-js-parser/fail/c0a136a959991f46.js new file mode 100644 index 000000000..e9a89a890 --- /dev/null +++ b/compiler/tests-js-parser/fail/c0a136a959991f46.js @@ -0,0 +1 @@ +†= [] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c0a8cdfa09f3b86c.js b/compiler/tests-js-parser/fail/c0a8cdfa09f3b86c.js new file mode 100644 index 000000000..a88631fe2 --- /dev/null +++ b/compiler/tests-js-parser/fail/c0a8cdfa09f3b86c.js @@ -0,0 +1 @@ +function*g([yield]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c0ad1c20e662c8ed.js b/compiler/tests-js-parser/fail/c0ad1c20e662c8ed.js new file mode 100644 index 000000000..c965b0dce --- /dev/null +++ b/compiler/tests-js-parser/fail/c0ad1c20e662c8ed.js @@ -0,0 +1 @@ +obj = {x = 0} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c0d2e6ca2ab7f753.js b/compiler/tests-js-parser/fail/c0d2e6ca2ab7f753.js new file mode 100644 index 000000000..113ade6cf --- /dev/null +++ b/compiler/tests-js-parser/fail/c0d2e6ca2ab7f753.js @@ -0,0 +1 @@ +x = { get method() 42 } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c0e9a7c671122ea5.js b/compiler/tests-js-parser/fail/c0e9a7c671122ea5.js new file mode 100644 index 000000000..6c046e352 --- /dev/null +++ b/compiler/tests-js-parser/fail/c0e9a7c671122ea5.js @@ -0,0 +1 @@ +f(... ... g); diff --git a/compiler/tests-js-parser/fail/c177366cb56cf1bc.js b/compiler/tests-js-parser/fail/c177366cb56cf1bc.js new file mode 100644 index 000000000..6da2429bc --- /dev/null +++ b/compiler/tests-js-parser/fail/c177366cb56cf1bc.js @@ -0,0 +1 @@ +a class; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c1a24e62e6724892.js b/compiler/tests-js-parser/fail/c1a24e62e6724892.js new file mode 100644 index 000000000..bca5ab902 --- /dev/null +++ b/compiler/tests-js-parser/fail/c1a24e62e6724892.js @@ -0,0 +1 @@ +({*a({e: a.b}){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c220924a9ace3542.js b/compiler/tests-js-parser/fail/c220924a9ace3542.js new file mode 100644 index 000000000..0273d50d6 --- /dev/null +++ b/compiler/tests-js-parser/fail/c220924a9ace3542.js @@ -0,0 +1 @@ +class Foo { * } diff --git a/compiler/tests-js-parser/fail/c3731145e0e65d1d.js b/compiler/tests-js-parser/fail/c3731145e0e65d1d.js new file mode 100644 index 000000000..2e5977ca6 --- /dev/null +++ b/compiler/tests-js-parser/fail/c3731145e0e65d1d.js @@ -0,0 +1 @@ +#= \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c3afed3cb0fb92ab.js b/compiler/tests-js-parser/fail/c3afed3cb0fb92ab.js new file mode 100644 index 000000000..5c8d2a928 --- /dev/null +++ b/compiler/tests-js-parser/fail/c3afed3cb0fb92ab.js @@ -0,0 +1 @@ +\uD800\u \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c4236b612ac61d44.js b/compiler/tests-js-parser/fail/c4236b612ac61d44.js new file mode 100644 index 000000000..95fe1b048 --- /dev/null +++ b/compiler/tests-js-parser/fail/c4236b612ac61d44.js @@ -0,0 +1 @@ +let x, y, ; diff --git a/compiler/tests-js-parser/fail/c45a4b00a2a24c2b.js b/compiler/tests-js-parser/fail/c45a4b00a2a24c2b.js new file mode 100644 index 000000000..01454956d --- /dev/null +++ b/compiler/tests-js-parser/fail/c45a4b00a2a24c2b.js @@ -0,0 +1 @@ +p = { "q"/ } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c473ffb7c354496e.js b/compiler/tests-js-parser/fail/c473ffb7c354496e.js new file mode 100644 index 000000000..0b86a7284 --- /dev/null +++ b/compiler/tests-js-parser/fail/c473ffb7c354496e.js @@ -0,0 +1 @@ +{ set 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c49106fce7ac6b09.js b/compiler/tests-js-parser/fail/c49106fce7ac6b09.js new file mode 100644 index 000000000..5965dc1f8 --- /dev/null +++ b/compiler/tests-js-parser/fail/c49106fce7ac6b09.js @@ -0,0 +1 @@ + ] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c510fa0f191310ed.js b/compiler/tests-js-parser/fail/c510fa0f191310ed.js new file mode 100644 index 000000000..a04d1677e --- /dev/null +++ b/compiler/tests-js-parser/fail/c510fa0f191310ed.js @@ -0,0 +1 @@ +({a: b += 0} = {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c578b57e8e6ce80d.js b/compiler/tests-js-parser/fail/c578b57e8e6ce80d.js new file mode 100644 index 000000000..d773b4c31 --- /dev/null +++ b/compiler/tests-js-parser/fail/c578b57e8e6ce80d.js @@ -0,0 +1 @@ +var answer = 42, diff --git a/compiler/tests-js-parser/fail/c5af6ad6ff9d213f.js b/compiler/tests-js-parser/fail/c5af6ad6ff9d213f.js new file mode 100644 index 000000000..d39f6c06e --- /dev/null +++ b/compiler/tests-js-parser/fail/c5af6ad6ff9d213f.js @@ -0,0 +1 @@ +function*g() { let yield; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c5f9c5bfdf66ef66.js b/compiler/tests-js-parser/fail/c5f9c5bfdf66ef66.js new file mode 100644 index 000000000..06050b10c --- /dev/null +++ b/compiler/tests-js-parser/fail/c5f9c5bfdf66ef66.js @@ -0,0 +1 @@ +a if; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c66507ec6e15220d.js b/compiler/tests-js-parser/fail/c66507ec6e15220d.js new file mode 100644 index 000000000..54e06727b --- /dev/null +++ b/compiler/tests-js-parser/fail/c66507ec6e15220d.js @@ -0,0 +1 @@ +export { default } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c7023e867afea771.js b/compiler/tests-js-parser/fail/c7023e867afea771.js new file mode 100644 index 000000000..c5a7dbbee --- /dev/null +++ b/compiler/tests-js-parser/fail/c7023e867afea771.js @@ -0,0 +1,2 @@ +// +] \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c75e9f5ea55611f3.js b/compiler/tests-js-parser/fail/c75e9f5ea55611f3.js new file mode 100644 index 000000000..38f1fe3f3 --- /dev/null +++ b/compiler/tests-js-parser/fail/c75e9f5ea55611f3.js @@ -0,0 +1 @@ +for(let x=1 in [1,2,3]) 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c79647e7baf81f8f.js b/compiler/tests-js-parser/fail/c79647e7baf81f8f.js new file mode 100644 index 000000000..fdf6b4ff7 --- /dev/null +++ b/compiler/tests-js-parser/fail/c79647e7baf81f8f.js @@ -0,0 +1 @@ +"\x0"; diff --git a/compiler/tests-js-parser/fail/c7ad2478fd72bffe.js b/compiler/tests-js-parser/fail/c7ad2478fd72bffe.js new file mode 100644 index 000000000..b4b5640ce --- /dev/null +++ b/compiler/tests-js-parser/fail/c7ad2478fd72bffe.js @@ -0,0 +1 @@ +for(a in b) function c(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c86872dc97dd35aa.js b/compiler/tests-js-parser/fail/c86872dc97dd35aa.js new file mode 100644 index 000000000..0362a8a95 --- /dev/null +++ b/compiler/tests-js-parser/fail/c86872dc97dd35aa.js @@ -0,0 +1 @@ +var \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c86a72939cce6f53.js b/compiler/tests-js-parser/fail/c86a72939cce6f53.js new file mode 100644 index 000000000..d062943f2 --- /dev/null +++ b/compiler/tests-js-parser/fail/c86a72939cce6f53.js @@ -0,0 +1 @@ +"\u \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c91a41d48af2ef00.js b/compiler/tests-js-parser/fail/c91a41d48af2ef00.js new file mode 100644 index 000000000..a6d087982 --- /dev/null +++ b/compiler/tests-js-parser/fail/c91a41d48af2ef00.js @@ -0,0 +1 @@ +var a.b; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/c939f8663a298a09.js b/compiler/tests-js-parser/fail/c939f8663a298a09.js new file mode 100644 index 000000000..cb1031190 --- /dev/null +++ b/compiler/tests-js-parser/fail/c939f8663a298a09.js @@ -0,0 +1 @@ +class A {a static(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ca2716d236c027cd.js b/compiler/tests-js-parser/fail/ca2716d236c027cd.js new file mode 100644 index 000000000..8994ebca7 --- /dev/null +++ b/compiler/tests-js-parser/fail/ca2716d236c027cd.js @@ -0,0 +1 @@ +function hello() { 'use strict'; ({ "\1": 42 }); } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ca27a03a9d04acd2.js b/compiler/tests-js-parser/fail/ca27a03a9d04acd2.js new file mode 100644 index 000000000..caa92f786 --- /dev/null +++ b/compiler/tests-js-parser/fail/ca27a03a9d04acd2.js @@ -0,0 +1 @@ +"use strict"; (a) => 00 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ca3dd7ea0b4626dd.js b/compiler/tests-js-parser/fail/ca3dd7ea0b4626dd.js new file mode 100644 index 000000000..a392c6b66 --- /dev/null +++ b/compiler/tests-js-parser/fail/ca3dd7ea0b4626dd.js @@ -0,0 +1 @@ +console.log(typeof () => {}); \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ca424e812e0896bd.js b/compiler/tests-js-parser/fail/ca424e812e0896bd.js new file mode 100644 index 000000000..c1449d886 --- /dev/null +++ b/compiler/tests-js-parser/fail/ca424e812e0896bd.js @@ -0,0 +1 @@ +(function* ([a.b]) {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/cac0705bab074520.js b/compiler/tests-js-parser/fail/cac0705bab074520.js new file mode 100644 index 000000000..dc1b123d5 --- /dev/null +++ b/compiler/tests-js-parser/fail/cac0705bab074520.js @@ -0,0 +1 @@ +var f = function() { new.unknown_property; } diff --git a/compiler/tests-js-parser/fail/cb92787da5075fd1.js b/compiler/tests-js-parser/fail/cb92787da5075fd1.js new file mode 100644 index 000000000..a0f03b966 --- /dev/null +++ b/compiler/tests-js-parser/fail/cb92787da5075fd1.js @@ -0,0 +1 @@ +([[[[[[[[[[[[[[[[[[[[{a:b[0]}]]]]]]]]]]]]]]]]]]]])=>0; diff --git a/compiler/tests-js-parser/fail/cbb2fa2e2d167a54.js b/compiler/tests-js-parser/fail/cbb2fa2e2d167a54.js new file mode 100644 index 000000000..4a2a7b74f --- /dev/null +++ b/compiler/tests-js-parser/fail/cbb2fa2e2d167a54.js @@ -0,0 +1 @@ +function f() { new.anythingElse; } \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/cbc28b1205acaac8.js b/compiler/tests-js-parser/fail/cbc28b1205acaac8.js new file mode 100644 index 000000000..65116d42d --- /dev/null +++ b/compiler/tests-js-parser/fail/cbc28b1205acaac8.js @@ -0,0 +1 @@ +(b, ...a) + 1 diff --git a/compiler/tests-js-parser/fail/cbc35276c97fcf51.js b/compiler/tests-js-parser/fail/cbc35276c97fcf51.js new file mode 100644 index 000000000..74207107f --- /dev/null +++ b/compiler/tests-js-parser/fail/cbc35276c97fcf51.js @@ -0,0 +1 @@ +((a)) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/cc1519d0d99fc450.js b/compiler/tests-js-parser/fail/cc1519d0d99fc450.js new file mode 100644 index 000000000..c36e6f2d8 --- /dev/null +++ b/compiler/tests-js-parser/fail/cc1519d0d99fc450.js @@ -0,0 +1 @@ +if(true) const a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/cc28dc2255cfe34d.js b/compiler/tests-js-parser/fail/cc28dc2255cfe34d.js new file mode 100644 index 000000000..f0d07c014 --- /dev/null +++ b/compiler/tests-js-parser/fail/cc28dc2255cfe34d.js @@ -0,0 +1 @@ +(function*() { yield* }) diff --git a/compiler/tests-js-parser/fail/ce7800f269603948.js b/compiler/tests-js-parser/fail/ce7800f269603948.js new file mode 100644 index 000000000..44efff9df --- /dev/null +++ b/compiler/tests-js-parser/fail/ce7800f269603948.js @@ -0,0 +1 @@ +[0] = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/cee6d8878d1e6589.js b/compiler/tests-js-parser/fail/cee6d8878d1e6589.js new file mode 100644 index 000000000..104611249 --- /dev/null +++ b/compiler/tests-js-parser/fail/cee6d8878d1e6589.js @@ -0,0 +1 @@ +({ *a: 0 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/ceeb9c1fda84ac72.js b/compiler/tests-js-parser/fail/ceeb9c1fda84ac72.js new file mode 100644 index 000000000..c0da4ec86 --- /dev/null +++ b/compiler/tests-js-parser/fail/ceeb9c1fda84ac72.js @@ -0,0 +1 @@ +({a:function} = 0) \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/cf23f5d7f2364a44.js b/compiler/tests-js-parser/fail/cf23f5d7f2364a44.js new file mode 100644 index 000000000..698bed933 --- /dev/null +++ b/compiler/tests-js-parser/fail/cf23f5d7f2364a44.js @@ -0,0 +1 @@ +() + 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/d012888b0c720723.js b/compiler/tests-js-parser/fail/d012888b0c720723.js new file mode 100644 index 000000000..6c808fb17 --- /dev/null +++ b/compiler/tests-js-parser/fail/d012888b0c720723.js @@ -0,0 +1 @@ +( { get x() {} } ) = 0 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/d04aecd166354406.js b/compiler/tests-js-parser/fail/d04aecd166354406.js new file mode 100644 index 000000000..0b0ab0a53 --- /dev/null +++ b/compiler/tests-js-parser/fail/d04aecd166354406.js @@ -0,0 +1 @@ +'use strict'; ('\1') \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/d056300d8658429f.js b/compiler/tests-js-parser/fail/d056300d8658429f.js new file mode 100644 index 000000000..2982a3a19 --- /dev/null +++ b/compiler/tests-js-parser/fail/d056300d8658429f.js @@ -0,0 +1 @@ +/*
 \ No newline at end of file diff --git a/compiler/tests-js-parser/fail/d0804b4856dbb6be.module.js b/compiler/tests-js-parser/fail/d0804b4856dbb6be.module.js new file mode 100644 index 000000000..54ca615c6 --- /dev/null +++ b/compiler/tests-js-parser/fail/d0804b4856dbb6be.module.js @@ -0,0 +1,3 @@ +function a(){ +comment in"; +} diff --git a/compiler/tests-js-parser/pass-explicit/2e371094f1b1ac51.js b/compiler/tests-js-parser/pass-explicit/2e371094f1b1ac51.js new file mode 100644 index 000000000..7a952d6cb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2e371094f1b1ac51.js @@ -0,0 +1 @@ +("I1"); diff --git a/compiler/tests-js-parser/pass-explicit/2e5fbf7b1685fa1b.js b/compiler/tests-js-parser/pass-explicit/2e5fbf7b1685fa1b.js new file mode 100644 index 000000000..4c76b0d1f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2e5fbf7b1685fa1b.js @@ -0,0 +1,7 @@ +((function () { + var a = (1); + arguments[2] = (3); + ((function () { + eval(""); + })()); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/2e7336dc8eba87ef.js b/compiler/tests-js-parser/pass-explicit/2e7336dc8eba87ef.js new file mode 100644 index 000000000..af807bcff --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2e7336dc8eba87ef.js @@ -0,0 +1 @@ +a.b; diff --git a/compiler/tests-js-parser/pass-explicit/2e75e3bd39e6df05.js b/compiler/tests-js-parser/pass-explicit/2e75e3bd39e6df05.js new file mode 100644 index 000000000..d0143ff16 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2e75e3bd39e6df05.js @@ -0,0 +1,4 @@ +a = (("b").c); +a = ((("b") + ("d"))[("e") + ("f")]); +a = (g.c); +a = ((("b") + g).c); diff --git a/compiler/tests-js-parser/pass-explicit/2e7f443b2f555bc5.js b/compiler/tests-js-parser/pass-explicit/2e7f443b2f555bc5.js new file mode 100644 index 000000000..33a90f123 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2e7f443b2f555bc5.js @@ -0,0 +1,3 @@ +function a() { + function b() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/2e8a88da875f40c7.js b/compiler/tests-js-parser/pass-explicit/2e8a88da875f40c7.js new file mode 100644 index 000000000..31da3db84 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2e8a88da875f40c7.js @@ -0,0 +1 @@ +delete (/test/); diff --git a/compiler/tests-js-parser/pass-explicit/2ef5ba0343d739dc.js b/compiler/tests-js-parser/pass-explicit/2ef5ba0343d739dc.js new file mode 100644 index 000000000..4af6bf0ce --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2ef5ba0343d739dc.js @@ -0,0 +1 @@ +let.let; diff --git a/compiler/tests-js-parser/pass-explicit/2f6d8a2215407ae3.js b/compiler/tests-js-parser/pass-explicit/2f6d8a2215407ae3.js new file mode 100644 index 000000000..176331453 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2f6d8a2215407ae3.js @@ -0,0 +1,3 @@ +function a() { + for (var b = (1), c = (2); b < (3); ++b) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/2f84859abd5a242c.js b/compiler/tests-js-parser/pass-explicit/2f84859abd5a242c.js new file mode 100644 index 000000000..df558eac3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/2f84859abd5a242c.js @@ -0,0 +1,5 @@ +((function () { + do { + a(); + } while (false); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/300a638d978d0f2c.js b/compiler/tests-js-parser/pass-explicit/300a638d978d0f2c.js new file mode 100644 index 000000000..9aaff00e2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/300a638d978d0f2c.js @@ -0,0 +1 @@ +T†= ([]); diff --git a/compiler/tests-js-parser/pass-explicit/30142c5b79e4eea9.js b/compiler/tests-js-parser/pass-explicit/30142c5b79e4eea9.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/30142c5b79e4eea9.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/3085290028dd33e1.js b/compiler/tests-js-parser/pass-explicit/3085290028dd33e1.js new file mode 100644 index 000000000..d8fb27029 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3085290028dd33e1.js @@ -0,0 +1,6 @@ +function a(b, c) { + function d() { + e(); + } + return b + c; +} diff --git a/compiler/tests-js-parser/pass-explicit/3097f73926c93640.js b/compiler/tests-js-parser/pass-explicit/3097f73926c93640.js new file mode 100644 index 000000000..c3ebda5b5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3097f73926c93640.js @@ -0,0 +1,3 @@ +(function () { + return; +}); diff --git a/compiler/tests-js-parser/pass-explicit/3098b57020860587.js b/compiler/tests-js-parser/pass-explicit/3098b57020860587.js new file mode 100644 index 000000000..501145042 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3098b57020860587.js @@ -0,0 +1,4 @@ +((function () { + var a = (1); + eval(""); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/30aee1020fc69090.js b/compiler/tests-js-parser/pass-explicit/30aee1020fc69090.js new file mode 100644 index 000000000..d3ff98f71 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/30aee1020fc69090.js @@ -0,0 +1,5 @@ +(class { + set a (b) { + "use strict"; + } +}); diff --git a/compiler/tests-js-parser/pass-explicit/30c2911c05100e92.js b/compiler/tests-js-parser/pass-explicit/30c2911c05100e92.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/31232b72db0fd24f.js b/compiler/tests-js-parser/pass-explicit/31232b72db0fd24f.js new file mode 100644 index 000000000..8cd82895c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/31232b72db0fd24f.js @@ -0,0 +1 @@ +a(b(c, c), d(c, c), e(c, c)); diff --git a/compiler/tests-js-parser/pass-explicit/31237b174ba6047a.js b/compiler/tests-js-parser/pass-explicit/31237b174ba6047a.js new file mode 100644 index 000000000..0a571f956 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/31237b174ba6047a.js @@ -0,0 +1 @@ +ð€€; diff --git a/compiler/tests-js-parser/pass-explicit/312f85fecc352681.js b/compiler/tests-js-parser/pass-explicit/312f85fecc352681.js new file mode 100644 index 000000000..a555a35e7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/312f85fecc352681.js @@ -0,0 +1,4 @@ +(function a() { + b; + c(); +}); diff --git a/compiler/tests-js-parser/pass-explicit/315692af7fe2aad3.js b/compiler/tests-js-parser/pass-explicit/315692af7fe2aad3.js new file mode 100644 index 000000000..d517f6d34 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/315692af7fe2aad3.js @@ -0,0 +1,4 @@ +var a = ({}); +a.b = (1); +a.c = (2); +(d.e)(a.c); diff --git a/compiler/tests-js-parser/pass-explicit/3156a92ca5319b8b.js b/compiler/tests-js-parser/pass-explicit/3156a92ca5319b8b.js new file mode 100644 index 000000000..0117dbfc5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3156a92ca5319b8b.js @@ -0,0 +1,2 @@ +throw "a"; +b(); diff --git a/compiler/tests-js-parser/pass-explicit/317532451c2ce8ff.js b/compiler/tests-js-parser/pass-explicit/317532451c2ce8ff.js new file mode 100644 index 000000000..912317dc3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/317532451c2ce8ff.js @@ -0,0 +1,2 @@ +"use strict"; +var a = ((function () {})(b())); diff --git a/compiler/tests-js-parser/pass-explicit/318c169a25ee42c5.js b/compiler/tests-js-parser/pass-explicit/318c169a25ee42c5.js new file mode 100644 index 000000000..7863a0876 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/318c169a25ee42c5.js @@ -0,0 +1 @@ +new a(...(.5)); diff --git a/compiler/tests-js-parser/pass-explicit/31ad88cae27258b7.js b/compiler/tests-js-parser/pass-explicit/31ad88cae27258b7.js new file mode 100644 index 000000000..fa0b6380a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/31ad88cae27258b7.js @@ -0,0 +1 @@ +var a = (/[\]/]/); diff --git a/compiler/tests-js-parser/pass-explicit/31cca30ad2bf696d.js b/compiler/tests-js-parser/pass-explicit/31cca30ad2bf696d.js new file mode 100644 index 000000000..873613817 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/31cca30ad2bf696d.js @@ -0,0 +1,3 @@ +((function () { + ((function () {})()); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/323783be9a53a31e.js b/compiler/tests-js-parser/pass-explicit/323783be9a53a31e.js new file mode 100644 index 000000000..688f63e4c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/323783be9a53a31e.js @@ -0,0 +1 @@ +8; diff --git a/compiler/tests-js-parser/pass-explicit/329bc0e532da6227.js b/compiler/tests-js-parser/pass-explicit/329bc0e532da6227.js new file mode 100644 index 000000000..39620ce4c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/329bc0e532da6227.js @@ -0,0 +1 @@ +(``)``; diff --git a/compiler/tests-js-parser/pass-explicit/32a9af0615bf7618.js b/compiler/tests-js-parser/pass-explicit/32a9af0615bf7618.js new file mode 100644 index 000000000..5768f556c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/32a9af0615bf7618.js @@ -0,0 +1,6 @@ +((function () { + var a = (1); + with (b) { + a += (a += (2)); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/32b4780ad9c4292a.js b/compiler/tests-js-parser/pass-explicit/32b4780ad9c4292a.js new file mode 100644 index 000000000..710f79ea2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/32b4780ad9c4292a.js @@ -0,0 +1,2 @@ +a: 1; +a: 2; diff --git a/compiler/tests-js-parser/pass-explicit/32b635a9667a9fb1.js b/compiler/tests-js-parser/pass-explicit/32b635a9667a9fb1.js new file mode 100644 index 000000000..7138894c1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/32b635a9667a9fb1.js @@ -0,0 +1,3 @@ +(((function () { + var a = (1); +}).b)(this)); diff --git a/compiler/tests-js-parser/pass-explicit/32b6854d07aefbda.js b/compiler/tests-js-parser/pass-explicit/32b6854d07aefbda.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/32b6854d07aefbda.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/32efa0efd255748a.js b/compiler/tests-js-parser/pass-explicit/32efa0efd255748a.js new file mode 100644 index 000000000..7469504c5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/32efa0efd255748a.js @@ -0,0 +1,3 @@ +class a { + static *[b]() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/32f782a4b16306aa.js b/compiler/tests-js-parser/pass-explicit/32f782a4b16306aa.js new file mode 100644 index 000000000..79f6ebcb0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/32f782a4b16306aa.js @@ -0,0 +1 @@ +(a << b) << c; diff --git a/compiler/tests-js-parser/pass-explicit/3315c524a740fe55.js b/compiler/tests-js-parser/pass-explicit/3315c524a740fe55.js new file mode 100644 index 000000000..d006ff898 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3315c524a740fe55.js @@ -0,0 +1 @@ +("\\'"); diff --git a/compiler/tests-js-parser/pass-explicit/332f0bc46d28db25.js b/compiler/tests-js-parser/pass-explicit/332f0bc46d28db25.js new file mode 100644 index 000000000..9ac5e5675 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/332f0bc46d28db25.js @@ -0,0 +1 @@ +({a}) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/3348741c8bdd4f3c.js b/compiler/tests-js-parser/pass-explicit/3348741c8bdd4f3c.js new file mode 100644 index 000000000..c228a72bd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3348741c8bdd4f3c.js @@ -0,0 +1 @@ +for (const a of b) c(a); diff --git a/compiler/tests-js-parser/pass-explicit/33720cee3dabde0d.js b/compiler/tests-js-parser/pass-explicit/33720cee3dabde0d.js new file mode 100644 index 000000000..23951928e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/33720cee3dabde0d.js @@ -0,0 +1 @@ +a || (b && c); diff --git a/compiler/tests-js-parser/pass-explicit/338762eadb13a2f0.js b/compiler/tests-js-parser/pass-explicit/338762eadb13a2f0.js new file mode 100644 index 000000000..6b7f0455b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/338762eadb13a2f0.js @@ -0,0 +1 @@ +a ^= (1); diff --git a/compiler/tests-js-parser/pass-explicit/341bc3f1b434f6d1.js b/compiler/tests-js-parser/pass-explicit/341bc3f1b434f6d1.js new file mode 100644 index 000000000..d1217527c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/341bc3f1b434f6d1.js @@ -0,0 +1 @@ +((``)``)``; diff --git a/compiler/tests-js-parser/pass-explicit/345713fe7f52524a.js b/compiler/tests-js-parser/pass-explicit/345713fe7f52524a.js new file mode 100644 index 000000000..f5c20fdcc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/345713fe7f52524a.js @@ -0,0 +1 @@ +({a, b} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/347e9a5443e4cd3c.js b/compiler/tests-js-parser/pass-explicit/347e9a5443e4cd3c.js new file mode 100644 index 000000000..50a844ff7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/347e9a5443e4cd3c.js @@ -0,0 +1,3 @@ +{ + let a; +} diff --git a/compiler/tests-js-parser/pass-explicit/34d5455824302935.js b/compiler/tests-js-parser/pass-explicit/34d5455824302935.js new file mode 100644 index 000000000..765110ed7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/34d5455824302935.js @@ -0,0 +1,3 @@ +function* a() { + yield* (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/350a7ec7041c079f.js b/compiler/tests-js-parser/pass-explicit/350a7ec7041c079f.js new file mode 100644 index 000000000..2e7ea2535 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/350a7ec7041c079f.js @@ -0,0 +1 @@ +a = ({set: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/3514acf61732f662.js b/compiler/tests-js-parser/pass-explicit/3514acf61732f662.js new file mode 100644 index 000000000..e26bd9a24 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3514acf61732f662.js @@ -0,0 +1 @@ +9; diff --git a/compiler/tests-js-parser/pass-explicit/35bf182594dc08ac.js b/compiler/tests-js-parser/pass-explicit/35bf182594dc08ac.js new file mode 100644 index 000000000..f8b737338 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/35bf182594dc08ac.js @@ -0,0 +1,3 @@ +function a(b, c, d, e, f) { + return b + c; +} diff --git a/compiler/tests-js-parser/pass-explicit/35e730121a5e6326.js b/compiler/tests-js-parser/pass-explicit/35e730121a5e6326.js new file mode 100644 index 000000000..033099e99 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/35e730121a5e6326.js @@ -0,0 +1 @@ +for (;;) if (a()) b(); else break; diff --git a/compiler/tests-js-parser/pass-explicit/35eb2e229858a6c7.js b/compiler/tests-js-parser/pass-explicit/35eb2e229858a6c7.js new file mode 100644 index 000000000..f5e95965e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/35eb2e229858a6c7.js @@ -0,0 +1 @@ +a => ("b"); diff --git a/compiler/tests-js-parser/pass-explicit/3610e596404818d6.js b/compiler/tests-js-parser/pass-explicit/3610e596404818d6.js new file mode 100644 index 000000000..60b61a97f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3610e596404818d6.js @@ -0,0 +1 @@ +with (1) ; diff --git a/compiler/tests-js-parser/pass-explicit/36224cf8215ad8e4.js b/compiler/tests-js-parser/pass-explicit/36224cf8215ad8e4.js new file mode 100644 index 000000000..d436c226d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/36224cf8215ad8e4.js @@ -0,0 +1,2 @@ +(function (a, ...b) {}); +(function (...c) {}); diff --git a/compiler/tests-js-parser/pass-explicit/366585381e4610b4.js b/compiler/tests-js-parser/pass-explicit/366585381e4610b4.js new file mode 100644 index 000000000..8e729c643 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/366585381e4610b4.js @@ -0,0 +1 @@ +a + (((b()), (c())), (d())); diff --git a/compiler/tests-js-parser/pass-explicit/369b56fe359d52fc.js b/compiler/tests-js-parser/pass-explicit/369b56fe359d52fc.js new file mode 100644 index 000000000..aa271b0c5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/369b56fe359d52fc.js @@ -0,0 +1 @@ +(a())``; diff --git a/compiler/tests-js-parser/pass-explicit/369fd0a1e40030d8.js b/compiler/tests-js-parser/pass-explicit/369fd0a1e40030d8.js new file mode 100644 index 000000000..8f0dcddba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/369fd0a1e40030d8.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + return super[1]; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/36a9e7f1c95b82ff.js b/compiler/tests-js-parser/pass-explicit/36a9e7f1c95b82ff.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/36fb3e9c8cedf764.js b/compiler/tests-js-parser/pass-explicit/36fb3e9c8cedf764.js new file mode 100644 index 000000000..33eac346f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/36fb3e9c8cedf764.js @@ -0,0 +1,3 @@ +class a { + set(b) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/36ff120198eea816.js b/compiler/tests-js-parser/pass-explicit/36ff120198eea816.js new file mode 100644 index 000000000..bd38b1bce --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/36ff120198eea816.js @@ -0,0 +1 @@ +var {yield: a} = (b); diff --git a/compiler/tests-js-parser/pass-explicit/370a2bd1387fd440.js b/compiler/tests-js-parser/pass-explicit/370a2bd1387fd440.js new file mode 100644 index 000000000..81c4ce62d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/370a2bd1387fd440.js @@ -0,0 +1 @@ +for ({a, b} of c) ; diff --git a/compiler/tests-js-parser/pass-explicit/372097a44c33daf2.js b/compiler/tests-js-parser/pass-explicit/372097a44c33daf2.js new file mode 100644 index 000000000..fe432c32a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/372097a44c33daf2.js @@ -0,0 +1 @@ +eval => (1); diff --git a/compiler/tests-js-parser/pass-explicit/373e35460ecaccc6.js b/compiler/tests-js-parser/pass-explicit/373e35460ecaccc6.js new file mode 100644 index 000000000..b4e01f663 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/373e35460ecaccc6.js @@ -0,0 +1 @@ +1.49241783e-10; diff --git a/compiler/tests-js-parser/pass-explicit/3793ec99f844de1c.js b/compiler/tests-js-parser/pass-explicit/3793ec99f844de1c.js new file mode 100644 index 000000000..0e301ba83 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3793ec99f844de1c.js @@ -0,0 +1,2 @@ +"use strict"; +var a = ({b: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/37ac3bcee6fa89f9.js b/compiler/tests-js-parser/pass-explicit/37ac3bcee6fa89f9.js new file mode 100644 index 000000000..765da1143 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/37ac3bcee6fa89f9.js @@ -0,0 +1 @@ +2; diff --git a/compiler/tests-js-parser/pass-explicit/37c0f5275362d1c9.js b/compiler/tests-js-parser/pass-explicit/37c0f5275362d1c9.js new file mode 100644 index 000000000..1e13f6603 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/37c0f5275362d1c9.js @@ -0,0 +1 @@ +"\u{00000000034}"; diff --git a/compiler/tests-js-parser/pass-explicit/37d26e3bec6d9a0f.js b/compiler/tests-js-parser/pass-explicit/37d26e3bec6d9a0f.js new file mode 100644 index 000000000..ca0baacf9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/37d26e3bec6d9a0f.js @@ -0,0 +1,6 @@ +switch (a) { + default: + ((function () { + b("c"); + })()); +} diff --git a/compiler/tests-js-parser/pass-explicit/37e4a6eca1ece7e5.js b/compiler/tests-js-parser/pass-explicit/37e4a6eca1ece7e5.js new file mode 100644 index 000000000..72e510f5d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/37e4a6eca1ece7e5.js @@ -0,0 +1 @@ +(function a([b, c]) {}); diff --git a/compiler/tests-js-parser/pass-explicit/37e845e0d8283fb3.js b/compiler/tests-js-parser/pass-explicit/37e845e0d8283fb3.js new file mode 100644 index 000000000..9944ae521 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/37e845e0d8283fb3.js @@ -0,0 +1,3 @@ +((function () { + (null) != (a ? (void (1)) : b); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/380e999de8f31c7d.js b/compiler/tests-js-parser/pass-explicit/380e999de8f31c7d.js new file mode 100644 index 000000000..0b8c72fe4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/380e999de8f31c7d.js @@ -0,0 +1 @@ +function a([b, c]) {} diff --git a/compiler/tests-js-parser/pass-explicit/3812dc38bcdc97db.js b/compiler/tests-js-parser/pass-explicit/3812dc38bcdc97db.js new file mode 100644 index 000000000..9491c58d0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3812dc38bcdc97db.js @@ -0,0 +1,4 @@ +b: for (var a = (1); a < (2); ++a) { + if (a < (3)) continue b; + (c.d)(a); +} diff --git a/compiler/tests-js-parser/pass-explicit/38284ea2d9914d86.js b/compiler/tests-js-parser/pass-explicit/38284ea2d9914d86.js new file mode 100644 index 000000000..3e2cb02b6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/38284ea2d9914d86.js @@ -0,0 +1 @@ +({get a() {}, get a() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/3852fb3ffb8fd8d5.js b/compiler/tests-js-parser/pass-explicit/3852fb3ffb8fd8d5.js new file mode 100644 index 000000000..1083c70c7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3852fb3ffb8fd8d5.js @@ -0,0 +1 @@ +if (true) a(); else ; diff --git a/compiler/tests-js-parser/pass-explicit/38594572e7bb32f4.js b/compiler/tests-js-parser/pass-explicit/38594572e7bb32f4.js new file mode 100644 index 000000000..c795f27b4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/38594572e7bb32f4.js @@ -0,0 +1,6 @@ +((function () { + function arguments() { + a(arguments); + } + a(arguments); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/389adf81b76d8b25.js b/compiler/tests-js-parser/pass-explicit/389adf81b76d8b25.js new file mode 100644 index 000000000..89dda8e35 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/389adf81b76d8b25.js @@ -0,0 +1 @@ +T‿; diff --git a/compiler/tests-js-parser/pass-explicit/38befc89fcf92e25.js b/compiler/tests-js-parser/pass-explicit/38befc89fcf92e25.js new file mode 100644 index 000000000..6ad4d9d0a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/38befc89fcf92e25.js @@ -0,0 +1 @@ +(+({})) / (1); diff --git a/compiler/tests-js-parser/pass-explicit/38c0e030050edb57.js b/compiler/tests-js-parser/pass-explicit/38c0e030050edb57.js new file mode 100644 index 000000000..117ef6ab6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/38c0e030050edb57.js @@ -0,0 +1,3 @@ +((function () { + -(1); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/38e0b9de817f645c.js b/compiler/tests-js-parser/pass-explicit/38e0b9de817f645c.js new file mode 100644 index 000000000..ff464d15b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/38e0b9de817f645c.js @@ -0,0 +1 @@ +null; diff --git a/compiler/tests-js-parser/pass-explicit/38fefd37caf6f8bb.js b/compiler/tests-js-parser/pass-explicit/38fefd37caf6f8bb.js new file mode 100644 index 000000000..22d6eddb1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/38fefd37caf6f8bb.js @@ -0,0 +1 @@ +(a | b) | c; diff --git a/compiler/tests-js-parser/pass-explicit/3990bb94b19b1071.js b/compiler/tests-js-parser/pass-explicit/3990bb94b19b1071.js new file mode 100644 index 000000000..3574128a7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3990bb94b19b1071.js @@ -0,0 +1 @@ +(""); diff --git a/compiler/tests-js-parser/pass-explicit/39bd53b0c3dcd639.js b/compiler/tests-js-parser/pass-explicit/39bd53b0c3dcd639.js new file mode 100644 index 000000000..aa6e1e62d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/39bd53b0c3dcd639.js @@ -0,0 +1 @@ +let {a} = (b); diff --git a/compiler/tests-js-parser/pass-explicit/3a1ccd915e97ed68.js b/compiler/tests-js-parser/pass-explicit/3a1ccd915e97ed68.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3a1ccd915e97ed68.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/3a1f039e533d1543.js b/compiler/tests-js-parser/pass-explicit/3a1f039e533d1543.js new file mode 100644 index 000000000..1a96b802e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3a1f039e533d1543.js @@ -0,0 +1,2 @@ +"use strict"; +(a.static)(); diff --git a/compiler/tests-js-parser/pass-explicit/3a50539d66e7fb07.js b/compiler/tests-js-parser/pass-explicit/3a50539d66e7fb07.js new file mode 100644 index 000000000..ce68c67fe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3a50539d66e7fb07.js @@ -0,0 +1,8 @@ +{ + var a = (1); + b(); + { + b(); + b(); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/3a5a7699f0631c6f.js b/compiler/tests-js-parser/pass-explicit/3a5a7699f0631c6f.js new file mode 100644 index 000000000..be47ad7dc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3a5a7699f0631c6f.js @@ -0,0 +1,2 @@ +with ({}) {} +; diff --git a/compiler/tests-js-parser/pass-explicit/3a707c56867f396c.js b/compiler/tests-js-parser/pass-explicit/3a707c56867f396c.js new file mode 100644 index 000000000..e0178681e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3a707c56867f396c.js @@ -0,0 +1,7 @@ +d: while (a) { + b(); + c(); + break d; + e(); + f(); +} diff --git a/compiler/tests-js-parser/pass-explicit/3aa600e48cbd8a5c.js b/compiler/tests-js-parser/pass-explicit/3aa600e48cbd8a5c.js new file mode 100644 index 000000000..f9e4c6ae0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3aa600e48cbd8a5c.js @@ -0,0 +1,3 @@ +class a { + static [b]() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/3ae4f46daa688c58.js b/compiler/tests-js-parser/pass-explicit/3ae4f46daa688c58.js new file mode 100644 index 000000000..7f0cb3a76 Binary files /dev/null and b/compiler/tests-js-parser/pass-explicit/3ae4f46daa688c58.js differ diff --git a/compiler/tests-js-parser/pass-explicit/3b1ab093f7ebeb51.module.js b/compiler/tests-js-parser/pass-explicit/3b1ab093f7ebeb51.module.js new file mode 100644 index 000000000..f41639e85 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3b1ab093f7ebeb51.module.js @@ -0,0 +1 @@ +export var a; diff --git a/compiler/tests-js-parser/pass-explicit/3b1fca65828182ab.js b/compiler/tests-js-parser/pass-explicit/3b1fca65828182ab.js new file mode 100644 index 000000000..c6f526b3f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3b1fca65828182ab.js @@ -0,0 +1 @@ +/(?=.)*/; diff --git a/compiler/tests-js-parser/pass-explicit/3b36d546985cd9cb.js b/compiler/tests-js-parser/pass-explicit/3b36d546985cd9cb.js new file mode 100644 index 000000000..40e159015 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3b36d546985cd9cb.js @@ -0,0 +1,2 @@ +'Hello\ +world'; diff --git a/compiler/tests-js-parser/pass-explicit/3b57183c81070eec.js b/compiler/tests-js-parser/pass-explicit/3b57183c81070eec.js new file mode 100644 index 000000000..8f3c9bac3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3b57183c81070eec.js @@ -0,0 +1,3 @@ +a = ({set null (b) { + c = b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/3b5d1fb0e093dab8.js b/compiler/tests-js-parser/pass-explicit/3b5d1fb0e093dab8.js new file mode 100644 index 000000000..d54fc0883 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3b5d1fb0e093dab8.js @@ -0,0 +1 @@ +a => ((b, c) => ((a, b), c)); diff --git a/compiler/tests-js-parser/pass-explicit/3b9779d2e19376a1.js b/compiler/tests-js-parser/pass-explicit/3b9779d2e19376a1.js new file mode 100644 index 000000000..765da1143 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3b9779d2e19376a1.js @@ -0,0 +1 @@ +2; diff --git a/compiler/tests-js-parser/pass-explicit/3b9e8797aacce77f.js b/compiler/tests-js-parser/pass-explicit/3b9e8797aacce77f.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3b9e8797aacce77f.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/3bac973df7480fe9.js b/compiler/tests-js-parser/pass-explicit/3bac973df7480fe9.js new file mode 100644 index 000000000..af74d8843 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3bac973df7480fe9.js @@ -0,0 +1,3 @@ +(class { + 3() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/3bbd75d597d54fe6.js b/compiler/tests-js-parser/pass-explicit/3bbd75d597d54fe6.js new file mode 100644 index 000000000..6701dde8b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3bbd75d597d54fe6.js @@ -0,0 +1 @@ +(function yield() {}); diff --git a/compiler/tests-js-parser/pass-explicit/3bc21b350f65c8f2.js b/compiler/tests-js-parser/pass-explicit/3bc21b350f65c8f2.js new file mode 100644 index 000000000..aa65ec3f9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3bc21b350f65c8f2.js @@ -0,0 +1,3 @@ +if (a) { + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/3c0c251ad455218d.js b/compiler/tests-js-parser/pass-explicit/3c0c251ad455218d.js new file mode 100644 index 000000000..9db05d8c2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3c0c251ad455218d.js @@ -0,0 +1 @@ +do a(); while (true); diff --git a/compiler/tests-js-parser/pass-explicit/3c1e2ada0ac2b8e3.js b/compiler/tests-js-parser/pass-explicit/3c1e2ada0ac2b8e3.js new file mode 100644 index 000000000..92d6ae92d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3c1e2ada0ac2b8e3.js @@ -0,0 +1,3 @@ +(function* (a, b, c) { + yield* a; +}); diff --git a/compiler/tests-js-parser/pass-explicit/3c6b557b1aa9cc05.js b/compiler/tests-js-parser/pass-explicit/3c6b557b1aa9cc05.js new file mode 100644 index 000000000..f017908a2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3c6b557b1aa9cc05.js @@ -0,0 +1,4 @@ +for (var a = (1); a < (2); ++a) { + if (a < (3)) continue; + (b.c)(a); +} diff --git a/compiler/tests-js-parser/pass-explicit/3c895971bd50ea01.js b/compiler/tests-js-parser/pass-explicit/3c895971bd50ea01.js new file mode 100644 index 000000000..c1e5c5037 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3c895971bd50ea01.js @@ -0,0 +1 @@ +for ({a = 1} in b) ; diff --git a/compiler/tests-js-parser/pass-explicit/3caf07d66e4f7b5a.js b/compiler/tests-js-parser/pass-explicit/3caf07d66e4f7b5a.js new file mode 100644 index 000000000..c118e05c1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3caf07d66e4f7b5a.js @@ -0,0 +1,3 @@ +({__proto__() { + return 1; +}, __proto__: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/3cbf0138d2dc0686.js b/compiler/tests-js-parser/pass-explicit/3cbf0138d2dc0686.js new file mode 100644 index 000000000..d9065eeef --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3cbf0138d2dc0686.js @@ -0,0 +1,7 @@ +((function () { + var a = (1); + var b = (2); + var c = (3); + var d = (((([]).e).f)(arguments)); + return [a, b, c, g]; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/3cf11f8790169c3f.js b/compiler/tests-js-parser/pass-explicit/3cf11f8790169c3f.js new file mode 100644 index 000000000..9cf7cc898 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3cf11f8790169c3f.js @@ -0,0 +1 @@ +a !== b; diff --git a/compiler/tests-js-parser/pass-explicit/3cf53efb53099596.js b/compiler/tests-js-parser/pass-explicit/3cf53efb53099596.js new file mode 100644 index 000000000..6fa8e80c3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3cf53efb53099596.js @@ -0,0 +1,5 @@ +for (; a();) { + if (b()) c(); else break; + d(); + e(); +} diff --git a/compiler/tests-js-parser/pass-explicit/3d0c4eda96e0412b.js b/compiler/tests-js-parser/pass-explicit/3d0c4eda96e0412b.js new file mode 100644 index 000000000..024d57df7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3d0c4eda96e0412b.js @@ -0,0 +1 @@ +a ^ b; diff --git a/compiler/tests-js-parser/pass-explicit/3d137e7b0cb6c8bc.js b/compiler/tests-js-parser/pass-explicit/3d137e7b0cb6c8bc.js new file mode 100644 index 000000000..ef15d2dab --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3d137e7b0cb6c8bc.js @@ -0,0 +1,9 @@ +((function () { + if (a) { + b(); + } else { + return 1; + c(); + } + return 2; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/3d2ab39608730a47.js b/compiler/tests-js-parser/pass-explicit/3d2ab39608730a47.js new file mode 100644 index 000000000..4c3b763be Binary files /dev/null and b/compiler/tests-js-parser/pass-explicit/3d2ab39608730a47.js differ diff --git a/compiler/tests-js-parser/pass-explicit/3d3ddc63a85b13a0.js b/compiler/tests-js-parser/pass-explicit/3d3ddc63a85b13a0.js new file mode 100644 index 000000000..4a88c6048 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3d3ddc63a85b13a0.js @@ -0,0 +1 @@ +let {a} = (1); diff --git a/compiler/tests-js-parser/pass-explicit/3d9c76216b0a9d4b.js b/compiler/tests-js-parser/pass-explicit/3d9c76216b0a9d4b.js new file mode 100644 index 000000000..002e592be --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3d9c76216b0a9d4b.js @@ -0,0 +1 @@ +for (a; a < (1); a++) b(a); diff --git a/compiler/tests-js-parser/pass-explicit/3dabeca76119d501.js b/compiler/tests-js-parser/pass-explicit/3dabeca76119d501.js new file mode 100644 index 000000000..5bd457248 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3dabeca76119d501.js @@ -0,0 +1,3 @@ +try {} catch (a) { + if (1) function a() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/3df03e7e138b7760.js b/compiler/tests-js-parser/pass-explicit/3df03e7e138b7760.js new file mode 100644 index 000000000..73ce82026 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3df03e7e138b7760.js @@ -0,0 +1,3 @@ +function a() { + new (["b"]); +} diff --git a/compiler/tests-js-parser/pass-explicit/3e1a6f702041b599.js b/compiler/tests-js-parser/pass-explicit/3e1a6f702041b599.js new file mode 100644 index 000000000..415d3befa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3e1a6f702041b599.js @@ -0,0 +1,4 @@ +b: while (1) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/3e3a99768a4a1502.js b/compiler/tests-js-parser/pass-explicit/3e3a99768a4a1502.js new file mode 100644 index 000000000..a3926343d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3e3a99768a4a1502.js @@ -0,0 +1 @@ +a => ({b: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/3e48826018d23c85.js b/compiler/tests-js-parser/pass-explicit/3e48826018d23c85.js new file mode 100644 index 000000000..e5353d487 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3e48826018d23c85.js @@ -0,0 +1 @@ +("a"); diff --git a/compiler/tests-js-parser/pass-explicit/3e665d875e0049a3.js b/compiler/tests-js-parser/pass-explicit/3e665d875e0049a3.js new file mode 100644 index 000000000..e7939440c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3e665d875e0049a3.js @@ -0,0 +1,3 @@ +function a() { + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/3e69c5cc1a7ac103.js b/compiler/tests-js-parser/pass-explicit/3e69c5cc1a7ac103.js new file mode 100644 index 000000000..344939ff1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3e69c5cc1a7ac103.js @@ -0,0 +1 @@ +try {} catch ([a, ...b]) {} diff --git a/compiler/tests-js-parser/pass-explicit/3ea15e86885d3c1a.js b/compiler/tests-js-parser/pass-explicit/3ea15e86885d3c1a.js new file mode 100644 index 000000000..b54b7904a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3ea15e86885d3c1a.js @@ -0,0 +1 @@ +a: while (true) while (true) continue a; diff --git a/compiler/tests-js-parser/pass-explicit/3eac36e29398cdc5.js b/compiler/tests-js-parser/pass-explicit/3eac36e29398cdc5.js new file mode 100644 index 000000000..f64732e35 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3eac36e29398cdc5.js @@ -0,0 +1 @@ +try {} catch ([a]) {} diff --git a/compiler/tests-js-parser/pass-explicit/3eb2c2bf585c0916.js b/compiler/tests-js-parser/pass-explicit/3eb2c2bf585c0916.js new file mode 100644 index 000000000..8ee8d14bc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3eb2c2bf585c0916.js @@ -0,0 +1 @@ +void (("a") + ("a")); diff --git a/compiler/tests-js-parser/pass-explicit/3ec1e9982b5f4a45.js b/compiler/tests-js-parser/pass-explicit/3ec1e9982b5f4a45.js new file mode 100644 index 000000000..f7ea05509 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3ec1e9982b5f4a45.js @@ -0,0 +1 @@ +(a && b) ? (1) : (2); diff --git a/compiler/tests-js-parser/pass-explicit/3ee117e37bd3bcea.js b/compiler/tests-js-parser/pass-explicit/3ee117e37bd3bcea.js new file mode 100644 index 000000000..648a719ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3ee117e37bd3bcea.js @@ -0,0 +1 @@ +2e308; diff --git a/compiler/tests-js-parser/pass-explicit/3f34ca3add7bcb9b.js b/compiler/tests-js-parser/pass-explicit/3f34ca3add7bcb9b.js new file mode 100644 index 000000000..706d25ea7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3f34ca3add7bcb9b.js @@ -0,0 +1 @@ +let [{a}] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/3f39e406df3080dc.js b/compiler/tests-js-parser/pass-explicit/3f39e406df3080dc.js new file mode 100644 index 000000000..d268fdb8b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3f39e406df3080dc.js @@ -0,0 +1 @@ +a(...b, c, d); diff --git a/compiler/tests-js-parser/pass-explicit/3f44c09167d5753d.js b/compiler/tests-js-parser/pass-explicit/3f44c09167d5753d.js new file mode 100644 index 000000000..0fa08e374 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3f44c09167d5753d.js @@ -0,0 +1 @@ +let â„®; diff --git a/compiler/tests-js-parser/pass-explicit/3f46ee1db509d55d.js b/compiler/tests-js-parser/pass-explicit/3f46ee1db509d55d.js new file mode 100644 index 000000000..3a750c06d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3f46ee1db509d55d.js @@ -0,0 +1 @@ +((1), (a["a"]))(); diff --git a/compiler/tests-js-parser/pass-explicit/3f6fd744861ee7c3.js b/compiler/tests-js-parser/pass-explicit/3f6fd744861ee7c3.js new file mode 100644 index 000000000..aa88f41aa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3f6fd744861ee7c3.js @@ -0,0 +1 @@ +arguments--; diff --git a/compiler/tests-js-parser/pass-explicit/3f8b15109761ea65.js b/compiler/tests-js-parser/pass-explicit/3f8b15109761ea65.js new file mode 100644 index 000000000..ade6126fc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3f8b15109761ea65.js @@ -0,0 +1 @@ +var a = (/[a-z]/u); diff --git a/compiler/tests-js-parser/pass-explicit/3f9b0dd207c09990.js b/compiler/tests-js-parser/pass-explicit/3f9b0dd207c09990.js new file mode 100644 index 000000000..a3d00f07d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3f9b0dd207c09990.js @@ -0,0 +1,11 @@ +switch ((1) + (2)) { + case 3: + a(); + break; + case (4) + (5): + b(); + break; + case ((6) + (7)) + (8): + c(); + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/3fb07536eb5aea8d.js b/compiler/tests-js-parser/pass-explicit/3fb07536eb5aea8d.js new file mode 100644 index 000000000..6e417abd1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3fb07536eb5aea8d.js @@ -0,0 +1 @@ +"Hello\412World"; diff --git a/compiler/tests-js-parser/pass-explicit/3ff52d86c77678bd.js b/compiler/tests-js-parser/pass-explicit/3ff52d86c77678bd.js new file mode 100644 index 000000000..b6434ec4f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/3ff52d86c77678bd.js @@ -0,0 +1 @@ +(function (...a) {}); diff --git a/compiler/tests-js-parser/pass-explicit/4014ec6c7931de54.js b/compiler/tests-js-parser/pass-explicit/4014ec6c7931de54.js new file mode 100644 index 000000000..19550514d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4014ec6c7931de54.js @@ -0,0 +1 @@ +a = ({b: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/401544b8abe9d656.js b/compiler/tests-js-parser/pass-explicit/401544b8abe9d656.js new file mode 100644 index 000000000..d26fc603b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/401544b8abe9d656.js @@ -0,0 +1 @@ +var [{a, b}, ...c] = (d); diff --git a/compiler/tests-js-parser/pass-explicit/40215319424a8227.js b/compiler/tests-js-parser/pass-explicit/40215319424a8227.js new file mode 100644 index 000000000..31142aabf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/40215319424a8227.js @@ -0,0 +1 @@ +a; diff --git a/compiler/tests-js-parser/pass-explicit/402c32920b1b9991.js b/compiler/tests-js-parser/pass-explicit/402c32920b1b9991.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/402c32920b1b9991.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/402e8d30db64e5af.js b/compiler/tests-js-parser/pass-explicit/402e8d30db64e5af.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/402e8d30db64e5af.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/403a7d28c611b71b.js b/compiler/tests-js-parser/pass-explicit/403a7d28c611b71b.js new file mode 100644 index 000000000..908abf3eb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/403a7d28c611b71b.js @@ -0,0 +1 @@ +(a.b)(b, c); diff --git a/compiler/tests-js-parser/pass-explicit/4040d47a3534b244.js b/compiler/tests-js-parser/pass-explicit/4040d47a3534b244.js new file mode 100644 index 000000000..81c1fc5c6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4040d47a3534b244.js @@ -0,0 +1 @@ +a = ({true: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/40766161d96ac708.js b/compiler/tests-js-parser/pass-explicit/40766161d96ac708.js new file mode 100644 index 000000000..e70f77a4b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/40766161d96ac708.js @@ -0,0 +1 @@ +({a: b} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/4086605956ddfcbb.js b/compiler/tests-js-parser/pass-explicit/4086605956ddfcbb.js new file mode 100644 index 000000000..ef3019fae --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4086605956ddfcbb.js @@ -0,0 +1 @@ +if ((!a) || (b())) ; diff --git a/compiler/tests-js-parser/pass-explicit/408971d922c72ea2.js b/compiler/tests-js-parser/pass-explicit/408971d922c72ea2.js new file mode 100644 index 000000000..e7b99499a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/408971d922c72ea2.js @@ -0,0 +1,6 @@ +((function () { + for (; false;) { + a(); + } + b(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/409f30dc7efe75d5.js b/compiler/tests-js-parser/pass-explicit/409f30dc7efe75d5.js new file mode 100644 index 000000000..61904da89 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/409f30dc7efe75d5.js @@ -0,0 +1 @@ +({get __proto__() {}, set __proto__ (a) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/40adcdf7cfe3fa0d.js b/compiler/tests-js-parser/pass-explicit/40adcdf7cfe3fa0d.js new file mode 100644 index 000000000..607f3cfba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/40adcdf7cfe3fa0d.js @@ -0,0 +1,3 @@ +function a() { + "use strict"; +} diff --git a/compiler/tests-js-parser/pass-explicit/40b9ff090910c512.js b/compiler/tests-js-parser/pass-explicit/40b9ff090910c512.js new file mode 100644 index 000000000..536f321d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/40b9ff090910c512.js @@ -0,0 +1,8 @@ +((function () { + if (a == (true)) { + b(); + } + if (a == (false)) { + b(); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/414b9b02f2789648.js b/compiler/tests-js-parser/pass-explicit/414b9b02f2789648.js new file mode 100644 index 000000000..47a089350 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/414b9b02f2789648.js @@ -0,0 +1,36 @@ +var a; +a = (b ? (true) : (false)); +a = ((!b) ? (true) : (false)); +a = ((b()) ? (true) : (false)); +a = (b ? (!(1)) : (!(2))); +a = ((!b) ? (!(null)) : (!(3))); +a = ((b()) ? (!(4)) : (!(-(3.5)))); +if (b) { + a = (true); +} else { + a = (false); +} +if (b) { + a = (!(5)); +} else { + a = (!(6)); +} +a = (b ? (false) : (true)); +a = ((!b) ? (false) : (true)); +a = ((b()) ? (false) : (true)); +a = (b ? (!(7)) : (!(8))); +a = ((!b) ? (!(9)) : (!(10))); +a = ((b()) ? (!(11)) : (!(12))); +if (b) { + a = (false); +} else { + a = (true); +} +if (b) { + a = (!(13)); +} else { + a = (!(14)); +} +a = (b ? (15) : (false)); +a = ((!b) ? (true) : (16)); +a = (b ? (17) : (18)); diff --git a/compiler/tests-js-parser/pass-explicit/4180f57196d0388d.js b/compiler/tests-js-parser/pass-explicit/4180f57196d0388d.js new file mode 100644 index 000000000..212deccbb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4180f57196d0388d.js @@ -0,0 +1,3 @@ +function* a() { + (b.yield)(); +} diff --git a/compiler/tests-js-parser/pass-explicit/41ad2d6d8414c573.js b/compiler/tests-js-parser/pass-explicit/41ad2d6d8414c573.js new file mode 100644 index 000000000..1c2ffa27f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/41ad2d6d8414c573.js @@ -0,0 +1 @@ +var [a] = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/41b805ea7ac014e2.js b/compiler/tests-js-parser/pass-explicit/41b805ea7ac014e2.js new file mode 100644 index 000000000..092bc2b04 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/41b805ea7ac014e2.js @@ -0,0 +1 @@ +; diff --git a/compiler/tests-js-parser/pass-explicit/41e79ea43f242aed.js b/compiler/tests-js-parser/pass-explicit/41e79ea43f242aed.js new file mode 100644 index 000000000..0d6f1fc54 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/41e79ea43f242aed.js @@ -0,0 +1,7 @@ +((function (a) { + switch (a) { + case 1: + default: + b("c"); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/41fc5bd8d644937c.js b/compiler/tests-js-parser/pass-explicit/41fc5bd8d644937c.js new file mode 100644 index 000000000..408d76d48 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/41fc5bd8d644937c.js @@ -0,0 +1,3 @@ +var a = (function b() { + c(); +}); diff --git a/compiler/tests-js-parser/pass-explicit/420855197cbff7ce.js b/compiler/tests-js-parser/pass-explicit/420855197cbff7ce.js new file mode 100644 index 000000000..7889cf209 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/420855197cbff7ce.js @@ -0,0 +1,9 @@ +((function () { + if (a) { + return 1; + b(); + } else { + c(); + } + return 2; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/424fb5db0f6734b6.js b/compiler/tests-js-parser/pass-explicit/424fb5db0f6734b6.js new file mode 100644 index 000000000..d68b5babd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/424fb5db0f6734b6.js @@ -0,0 +1 @@ +var [{__proto__: a, __proto__: b}] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/4263e76758123044.js b/compiler/tests-js-parser/pass-explicit/4263e76758123044.js new file mode 100644 index 000000000..097da7005 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4263e76758123044.js @@ -0,0 +1 @@ +a === b; diff --git a/compiler/tests-js-parser/pass-explicit/42907dc7a3d7b79b.js b/compiler/tests-js-parser/pass-explicit/42907dc7a3d7b79b.js new file mode 100644 index 000000000..a04408bb0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/42907dc7a3d7b79b.js @@ -0,0 +1,4 @@ +while (true) { + break; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/43023cd549deee77.js b/compiler/tests-js-parser/pass-explicit/43023cd549deee77.js new file mode 100644 index 000000000..0f447adbd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/43023cd549deee77.js @@ -0,0 +1 @@ +try {} catch (a) {} diff --git a/compiler/tests-js-parser/pass-explicit/43163c094787d534.js b/compiler/tests-js-parser/pass-explicit/43163c094787d534.js new file mode 100644 index 000000000..7765826b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/43163c094787d534.js @@ -0,0 +1 @@ +for (const {a, b} of c) ; diff --git a/compiler/tests-js-parser/pass-explicit/431ecef8c85d4d24.js b/compiler/tests-js-parser/pass-explicit/431ecef8c85d4d24.js new file mode 100644 index 000000000..329a08bfb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/431ecef8c85d4d24.js @@ -0,0 +1 @@ +ã‚› + ã‚œ; diff --git a/compiler/tests-js-parser/pass-explicit/432639592c565344.js b/compiler/tests-js-parser/pass-explicit/432639592c565344.js new file mode 100644 index 000000000..24a2c5f2b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/432639592c565344.js @@ -0,0 +1 @@ +new a(...b); diff --git a/compiler/tests-js-parser/pass-explicit/433859474119631f.js b/compiler/tests-js-parser/pass-explicit/433859474119631f.js new file mode 100644 index 000000000..ff7e20f03 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/433859474119631f.js @@ -0,0 +1 @@ +[a, {b: {c = 1}}] = d; diff --git a/compiler/tests-js-parser/pass-explicit/4369559377b6394e.js b/compiler/tests-js-parser/pass-explicit/4369559377b6394e.js new file mode 100644 index 000000000..287823a48 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4369559377b6394e.js @@ -0,0 +1 @@ +a: while (true) break a; diff --git a/compiler/tests-js-parser/pass-explicit/438521c40cf1b08b.js b/compiler/tests-js-parser/pass-explicit/438521c40cf1b08b.js new file mode 100644 index 000000000..d8b6457e7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/438521c40cf1b08b.js @@ -0,0 +1 @@ +a => (yield * (1)); diff --git a/compiler/tests-js-parser/pass-explicit/4389b59f7805c7c7.js b/compiler/tests-js-parser/pass-explicit/4389b59f7805c7c7.js new file mode 100644 index 000000000..7c4be3fbc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4389b59f7805c7c7.js @@ -0,0 +1 @@ +(a + b) * c; diff --git a/compiler/tests-js-parser/pass-explicit/43bbb253d4035175.module.js b/compiler/tests-js-parser/pass-explicit/43bbb253d4035175.module.js new file mode 100644 index 000000000..82780db83 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/43bbb253d4035175.module.js @@ -0,0 +1 @@ +export {a as b} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/4412172b5dc13cd6.js b/compiler/tests-js-parser/pass-explicit/4412172b5dc13cd6.js new file mode 100644 index 000000000..6edda9873 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4412172b5dc13cd6.js @@ -0,0 +1 @@ +/\0/; diff --git a/compiler/tests-js-parser/pass-explicit/44136fa355b3678a.js b/compiler/tests-js-parser/pass-explicit/44136fa355b3678a.js new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/44136fa355b3678a.js @@ -0,0 +1 @@ +{} diff --git a/compiler/tests-js-parser/pass-explicit/441a92357939904a.js b/compiler/tests-js-parser/pass-explicit/441a92357939904a.js new file mode 100644 index 000000000..5da02d1b5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/441a92357939904a.js @@ -0,0 +1 @@ +[a = (0)]; diff --git a/compiler/tests-js-parser/pass-explicit/444856ec05e8d330.js b/compiler/tests-js-parser/pass-explicit/444856ec05e8d330.js new file mode 100644 index 000000000..56ec0e102 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/444856ec05e8d330.js @@ -0,0 +1 @@ +function a(b = new.target) {} diff --git a/compiler/tests-js-parser/pass-explicit/446ffc8afda7e47f.js b/compiler/tests-js-parser/pass-explicit/446ffc8afda7e47f.js new file mode 100644 index 000000000..e62d7e4f9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/446ffc8afda7e47f.js @@ -0,0 +1,4 @@ +((function () { + var a, b, c = (1), d, e, f = (2); + ((a, b), c) + ((d, e), f); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/44af28febe2288cc.js b/compiler/tests-js-parser/pass-explicit/44af28febe2288cc.js new file mode 100644 index 000000000..9ee603f98 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/44af28febe2288cc.js @@ -0,0 +1,3 @@ +a = ({set b (c) { + d = c; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/44b0c8a5a1ecb389.js b/compiler/tests-js-parser/pass-explicit/44b0c8a5a1ecb389.js new file mode 100644 index 000000000..862496704 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/44b0c8a5a1ecb389.js @@ -0,0 +1,2 @@ +a = (b => (false)); +a = (() => (false)); diff --git a/compiler/tests-js-parser/pass-explicit/44f31660bd715f05.js b/compiler/tests-js-parser/pass-explicit/44f31660bd715f05.js new file mode 100644 index 000000000..f4f8745a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/44f31660bd715f05.js @@ -0,0 +1 @@ +T‌ = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/45ab34717c038020.js b/compiler/tests-js-parser/pass-explicit/45ab34717c038020.js new file mode 100644 index 000000000..07fcc8e61 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/45ab34717c038020.js @@ -0,0 +1 @@ +for (; a; b) ; diff --git a/compiler/tests-js-parser/pass-explicit/45d1662a41c9a1e9.js b/compiler/tests-js-parser/pass-explicit/45d1662a41c9a1e9.js new file mode 100644 index 000000000..07de35905 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/45d1662a41c9a1e9.js @@ -0,0 +1 @@ +for (;;) continue; diff --git a/compiler/tests-js-parser/pass-explicit/45dd9586f26a3cf4.js b/compiler/tests-js-parser/pass-explicit/45dd9586f26a3cf4.js new file mode 100644 index 000000000..9d2f13a2f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/45dd9586f26a3cf4.js @@ -0,0 +1 @@ +18; diff --git a/compiler/tests-js-parser/pass-explicit/45ed987996568823.js b/compiler/tests-js-parser/pass-explicit/45ed987996568823.js new file mode 100644 index 000000000..afd72cb88 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/45ed987996568823.js @@ -0,0 +1,2 @@ +` +`; diff --git a/compiler/tests-js-parser/pass-explicit/45ff445d87e37214.js b/compiler/tests-js-parser/pass-explicit/45ff445d87e37214.js new file mode 100644 index 000000000..182d8a333 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/45ff445d87e37214.js @@ -0,0 +1 @@ +(a = (a + (1))), (b = (b in c)); diff --git a/compiler/tests-js-parser/pass-explicit/46173461e93df4c2.js b/compiler/tests-js-parser/pass-explicit/46173461e93df4c2.js new file mode 100644 index 000000000..464c14329 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/46173461e93df4c2.js @@ -0,0 +1 @@ +for ((a, b), c;;) ; diff --git a/compiler/tests-js-parser/pass-explicit/46279e885d2aa853.js b/compiler/tests-js-parser/pass-explicit/46279e885d2aa853.js new file mode 100644 index 000000000..a6e956190 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/46279e885d2aa853.js @@ -0,0 +1 @@ +((new a).b)(); diff --git a/compiler/tests-js-parser/pass-explicit/465b79616fdc9794.js b/compiler/tests-js-parser/pass-explicit/465b79616fdc9794.js new file mode 100644 index 000000000..27701c34c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/465b79616fdc9794.js @@ -0,0 +1 @@ +var ℘℘; diff --git a/compiler/tests-js-parser/pass-explicit/46657ec13f5857d5.js b/compiler/tests-js-parser/pass-explicit/46657ec13f5857d5.js new file mode 100644 index 000000000..c160313fe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/46657ec13f5857d5.js @@ -0,0 +1,7 @@ +switch (a) { + case 1: + ((function () { + b("c"); + })()); + b("d"); +} diff --git a/compiler/tests-js-parser/pass-explicit/4672c2ef688237c9.js b/compiler/tests-js-parser/pass-explicit/4672c2ef688237c9.js new file mode 100644 index 000000000..99f1c5107 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4672c2ef688237c9.js @@ -0,0 +1 @@ +"\n\r\t\v\b\f\\\'\"\0"; diff --git a/compiler/tests-js-parser/pass-explicit/4694af065eecd95a.js b/compiler/tests-js-parser/pass-explicit/4694af065eecd95a.js new file mode 100644 index 000000000..69ddfd2ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4694af065eecd95a.js @@ -0,0 +1,3 @@ +class a { + static b() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/47094fe8a994b7de.js b/compiler/tests-js-parser/pass-explicit/47094fe8a994b7de.js new file mode 100644 index 000000000..5913de950 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/47094fe8a994b7de.js @@ -0,0 +1 @@ +var a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/4724023c6bb03bac.js b/compiler/tests-js-parser/pass-explicit/4724023c6bb03bac.js new file mode 100644 index 000000000..166a9bfa8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4724023c6bb03bac.js @@ -0,0 +1,4 @@ +while (true) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/472765ae4585cf8b.js b/compiler/tests-js-parser/pass-explicit/472765ae4585cf8b.js new file mode 100644 index 000000000..52dc5ef20 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/472765ae4585cf8b.js @@ -0,0 +1 @@ +a(...b, c, ...d); diff --git a/compiler/tests-js-parser/pass-explicit/4743508488414d6a.js b/compiler/tests-js-parser/pass-explicit/4743508488414d6a.js new file mode 100644 index 000000000..d0706e6a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4743508488414d6a.js @@ -0,0 +1 @@ +for (a = (1);;) ; diff --git a/compiler/tests-js-parser/pass-explicit/4789c3375f112cd4.js b/compiler/tests-js-parser/pass-explicit/4789c3375f112cd4.js new file mode 100644 index 000000000..24d6994bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4789c3375f112cd4.js @@ -0,0 +1 @@ +a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/478ede4cfe7906d5.js b/compiler/tests-js-parser/pass-explicit/478ede4cfe7906d5.js new file mode 100644 index 000000000..5832f43d6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/478ede4cfe7906d5.js @@ -0,0 +1,3 @@ +(function* () { + yield (yield (1)); +}); diff --git a/compiler/tests-js-parser/pass-explicit/47ddfd79dcd20fd5.js b/compiler/tests-js-parser/pass-explicit/47ddfd79dcd20fd5.js new file mode 100644 index 000000000..358f4acfc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/47ddfd79dcd20fd5.js @@ -0,0 +1 @@ +a = (function (b = 1) {}); diff --git a/compiler/tests-js-parser/pass-explicit/47ea193a5fc3f2c7.js b/compiler/tests-js-parser/pass-explicit/47ea193a5fc3f2c7.js new file mode 100644 index 000000000..73ace408d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/47ea193a5fc3f2c7.js @@ -0,0 +1,3 @@ +((function () { + a["b"]; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/47f974d6fc52e3e4.js b/compiler/tests-js-parser/pass-explicit/47f974d6fc52e3e4.js new file mode 100644 index 000000000..32fd8b6e9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/47f974d6fc52e3e4.js @@ -0,0 +1 @@ +a = ({y, z}); diff --git a/compiler/tests-js-parser/pass-explicit/47fce5046a1b2098.js b/compiler/tests-js-parser/pass-explicit/47fce5046a1b2098.js new file mode 100644 index 000000000..d7240431d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/47fce5046a1b2098.js @@ -0,0 +1 @@ ++(/test/); diff --git a/compiler/tests-js-parser/pass-explicit/48567b651f81277e.js b/compiler/tests-js-parser/pass-explicit/48567b651f81277e.js new file mode 100644 index 000000000..c4cd20ddb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/48567b651f81277e.js @@ -0,0 +1 @@ +({["__proto__"]: 1, ["__proto__"]: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/4869454dd215468e.js b/compiler/tests-js-parser/pass-explicit/4869454dd215468e.js new file mode 100644 index 000000000..30c73b89a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4869454dd215468e.js @@ -0,0 +1 @@ +try {} catch (a) {} finally {} diff --git a/compiler/tests-js-parser/pass-explicit/488ae37630cb4d83.js b/compiler/tests-js-parser/pass-explicit/488ae37630cb4d83.js new file mode 100644 index 000000000..452d9e8a4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/488ae37630cb4d83.js @@ -0,0 +1 @@ +() => (() => (1)); diff --git a/compiler/tests-js-parser/pass-explicit/488cd27c94308caa.js b/compiler/tests-js-parser/pass-explicit/488cd27c94308caa.js new file mode 100644 index 000000000..4d7f90f6f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/488cd27c94308caa.js @@ -0,0 +1,4 @@ +function a() { + var b = ({}); + b[void (1)] = ((c()), d); +} diff --git a/compiler/tests-js-parser/pass-explicit/489e6113a41ef33f.js b/compiler/tests-js-parser/pass-explicit/489e6113a41ef33f.js new file mode 100644 index 000000000..d199dbdd4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/489e6113a41ef33f.js @@ -0,0 +1 @@ +(a & b) | c; diff --git a/compiler/tests-js-parser/pass-explicit/48b43f80306f5dff.js b/compiler/tests-js-parser/pass-explicit/48b43f80306f5dff.js new file mode 100644 index 000000000..d40c337e3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/48b43f80306f5dff.js @@ -0,0 +1 @@ +let {} = (1); diff --git a/compiler/tests-js-parser/pass-explicit/48b6f8ce65d3b3ee.js b/compiler/tests-js-parser/pass-explicit/48b6f8ce65d3b3ee.js new file mode 100644 index 000000000..5f331e083 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/48b6f8ce65d3b3ee.js @@ -0,0 +1,4 @@ +!((function () { + a(); +})()); +b(); diff --git a/compiler/tests-js-parser/pass-explicit/48bb091783df3da9.js b/compiler/tests-js-parser/pass-explicit/48bb091783df3da9.js new file mode 100644 index 000000000..3bfaa971d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/48bb091783df3da9.js @@ -0,0 +1,5 @@ +function a() {} +var b = ("is a valid variable name"); +b = ({b: "is ok"}); +c.b; +b: d(); diff --git a/compiler/tests-js-parser/pass-explicit/48bb138a6b033a34.js b/compiler/tests-js-parser/pass-explicit/48bb138a6b033a34.js new file mode 100644 index 000000000..73c910345 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/48bb138a6b033a34.js @@ -0,0 +1,3 @@ +(class { + a() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/48f39ccbea69907a.js b/compiler/tests-js-parser/pass-explicit/48f39ccbea69907a.js new file mode 100644 index 000000000..9beca7910 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/48f39ccbea69907a.js @@ -0,0 +1 @@ +arguments++; diff --git a/compiler/tests-js-parser/pass-explicit/490efeb71bdb7c3b.js b/compiler/tests-js-parser/pass-explicit/490efeb71bdb7c3b.js new file mode 100644 index 000000000..0c99ce8f3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/490efeb71bdb7c3b.js @@ -0,0 +1,2 @@ +true; +false; diff --git a/compiler/tests-js-parser/pass-explicit/492d3fde7a53e85a.js b/compiler/tests-js-parser/pass-explicit/492d3fde7a53e85a.js new file mode 100644 index 000000000..007744721 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/492d3fde7a53e85a.js @@ -0,0 +1,4 @@ +switch (a) { + case 1: + let b; +} diff --git a/compiler/tests-js-parser/pass-explicit/4933a329b80ed6ec.js b/compiler/tests-js-parser/pass-explicit/4933a329b80ed6ec.js new file mode 100644 index 000000000..23d669c13 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4933a329b80ed6ec.js @@ -0,0 +1,6 @@ +((function () { + function a() { + var b = (1); + return b; + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/495c05812d179d67.js b/compiler/tests-js-parser/pass-explicit/495c05812d179d67.js new file mode 100644 index 000000000..296422a8d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/495c05812d179d67.js @@ -0,0 +1 @@ +/[a-z]/gimuy; diff --git a/compiler/tests-js-parser/pass-explicit/49bdb14b27afe650.js b/compiler/tests-js-parser/pass-explicit/49bdb14b27afe650.js new file mode 100644 index 000000000..207f59d30 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/49bdb14b27afe650.js @@ -0,0 +1 @@ +[a, , ] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/49e54e5acd18a8e1.js b/compiler/tests-js-parser/pass-explicit/49e54e5acd18a8e1.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/49e54e5acd18a8e1.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/4a0d9236bc523b77.js b/compiler/tests-js-parser/pass-explicit/4a0d9236bc523b77.js new file mode 100644 index 000000000..27f0a0d45 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4a0d9236bc523b77.js @@ -0,0 +1 @@ +("ø"); diff --git a/compiler/tests-js-parser/pass-explicit/4a479db6af79906e.js b/compiler/tests-js-parser/pass-explicit/4a479db6af79906e.js new file mode 100644 index 000000000..315a77019 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4a479db6af79906e.js @@ -0,0 +1 @@ +a, b; diff --git a/compiler/tests-js-parser/pass-explicit/4a56cf2dea99fcd6.js b/compiler/tests-js-parser/pass-explicit/4a56cf2dea99fcd6.js new file mode 100644 index 000000000..bf59b2eca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4a56cf2dea99fcd6.js @@ -0,0 +1 @@ +({get a() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/4a5fe6bf2362352b.js b/compiler/tests-js-parser/pass-explicit/4a5fe6bf2362352b.js new file mode 100644 index 000000000..4761a657e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4a5fe6bf2362352b.js @@ -0,0 +1 @@ +(class a extends a {}); diff --git a/compiler/tests-js-parser/pass-explicit/4a79205bd8cd49d0.js b/compiler/tests-js-parser/pass-explicit/4a79205bd8cd49d0.js new file mode 100644 index 000000000..674a00c86 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4a79205bd8cd49d0.js @@ -0,0 +1,3 @@ +((function a() { + b((typeof (a())) == ("c")); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/4a807fda565547a2.js b/compiler/tests-js-parser/pass-explicit/4a807fda565547a2.js new file mode 100644 index 000000000..990f692f6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4a807fda565547a2.js @@ -0,0 +1 @@ +for (let a in b) c(a); diff --git a/compiler/tests-js-parser/pass-explicit/4ac1a1bc6b3cbe66.js b/compiler/tests-js-parser/pass-explicit/4ac1a1bc6b3cbe66.js new file mode 100644 index 000000000..755033343 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4ac1a1bc6b3cbe66.js @@ -0,0 +1 @@ +(a % b) * c; diff --git a/compiler/tests-js-parser/pass-explicit/4ad6e3a59e27e9b1.js b/compiler/tests-js-parser/pass-explicit/4ad6e3a59e27e9b1.js new file mode 100644 index 000000000..e00e9e9f4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4ad6e3a59e27e9b1.js @@ -0,0 +1 @@ +/[\uD834\uDF06-\uD834\uDF08a-z]/u; diff --git a/compiler/tests-js-parser/pass-explicit/4ada45968b9f45ec.js b/compiler/tests-js-parser/pass-explicit/4ada45968b9f45ec.js new file mode 100644 index 000000000..f6acdd775 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4ada45968b9f45ec.js @@ -0,0 +1 @@ +(+(a++)) / (1); diff --git a/compiler/tests-js-parser/pass-explicit/4ae32442eef8a4e0.js b/compiler/tests-js-parser/pass-explicit/4ae32442eef8a4e0.js new file mode 100644 index 000000000..092bc2b04 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4ae32442eef8a4e0.js @@ -0,0 +1 @@ +; diff --git a/compiler/tests-js-parser/pass-explicit/4b346e8c85a29408.js b/compiler/tests-js-parser/pass-explicit/4b346e8c85a29408.js new file mode 100644 index 000000000..1f35b0b81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4b346e8c85a29408.js @@ -0,0 +1,3 @@ +((function () { + var a = ({b: 1}); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/4b40241551a495c2.js b/compiler/tests-js-parser/pass-explicit/4b40241551a495c2.js new file mode 100644 index 000000000..5b91c5876 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4b40241551a495c2.js @@ -0,0 +1 @@ +({[a]: 1, b: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/4b6559716b2f7b21.js b/compiler/tests-js-parser/pass-explicit/4b6559716b2f7b21.js new file mode 100644 index 000000000..146d398f6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4b6559716b2f7b21.js @@ -0,0 +1,3 @@ +a++; +{} +/foo/; diff --git a/compiler/tests-js-parser/pass-explicit/4ba667b7404cc45d.js b/compiler/tests-js-parser/pass-explicit/4ba667b7404cc45d.js new file mode 100644 index 000000000..b060704a4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4ba667b7404cc45d.js @@ -0,0 +1,3 @@ +{ + const a = (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/4bd3199f5a4d8e52.js b/compiler/tests-js-parser/pass-explicit/4bd3199f5a4d8e52.js new file mode 100644 index 000000000..b0a8b39ad --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4bd3199f5a4d8e52.js @@ -0,0 +1 @@ +try {} catch ({a}) {} diff --git a/compiler/tests-js-parser/pass-explicit/4bd7e14411b6a889.js b/compiler/tests-js-parser/pass-explicit/4bd7e14411b6a889.js new file mode 100644 index 000000000..dd48341cd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4bd7e14411b6a889.js @@ -0,0 +1 @@ +[a, a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/4beb0b6ae8b9801a.js b/compiler/tests-js-parser/pass-explicit/4beb0b6ae8b9801a.js new file mode 100644 index 000000000..5b576774b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4beb0b6ae8b9801a.js @@ -0,0 +1 @@ +function a({}) {} diff --git a/compiler/tests-js-parser/pass-explicit/4bffa044ecd9d841.js b/compiler/tests-js-parser/pass-explicit/4bffa044ecd9d841.js new file mode 100644 index 000000000..1d536a509 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4bffa044ecd9d841.js @@ -0,0 +1 @@ +var [a, ...[b, c]] = (d); diff --git a/compiler/tests-js-parser/pass-explicit/4c2a2b32f0470048.js b/compiler/tests-js-parser/pass-explicit/4c2a2b32f0470048.js new file mode 100644 index 000000000..187cb3e3e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4c2a2b32f0470048.js @@ -0,0 +1 @@ +10; diff --git a/compiler/tests-js-parser/pass-explicit/4c3a394af4d281d1.js b/compiler/tests-js-parser/pass-explicit/4c3a394af4d281d1.js new file mode 100644 index 000000000..4ce036ca0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4c3a394af4d281d1.js @@ -0,0 +1,3 @@ +function a(b, c) { + return b < (!(--c)); +} diff --git a/compiler/tests-js-parser/pass-explicit/4c44d7c28ec0f6ca.js b/compiler/tests-js-parser/pass-explicit/4c44d7c28ec0f6ca.js new file mode 100644 index 000000000..eab746921 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4c44d7c28ec0f6ca.js @@ -0,0 +1 @@ +debugger; diff --git a/compiler/tests-js-parser/pass-explicit/4c56fb063bea0ec2.js b/compiler/tests-js-parser/pass-explicit/4c56fb063bea0ec2.js new file mode 100644 index 000000000..f5bae6bd8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4c56fb063bea0ec2.js @@ -0,0 +1 @@ +for (var a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/4c71e11fbbc56349.js b/compiler/tests-js-parser/pass-explicit/4c71e11fbbc56349.js new file mode 100644 index 000000000..490e5b2c4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4c71e11fbbc56349.js @@ -0,0 +1 @@ +({set a (b) {}, set a (b) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/4d2c7020de650d40.js b/compiler/tests-js-parser/pass-explicit/4d2c7020de650d40.js new file mode 100644 index 000000000..2558f95de --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4d2c7020de650d40.js @@ -0,0 +1 @@ +var ð« _ = (1); diff --git a/compiler/tests-js-parser/pass-explicit/4d310ef039a7435c.js b/compiler/tests-js-parser/pass-explicit/4d310ef039a7435c.js new file mode 100644 index 000000000..097e462f4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4d310ef039a7435c.js @@ -0,0 +1 @@ +({a(b, c) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/4d833cbc56caaaf9.js b/compiler/tests-js-parser/pass-explicit/4d833cbc56caaaf9.js new file mode 100644 index 000000000..bc8680a84 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4d833cbc56caaaf9.js @@ -0,0 +1,3 @@ +({set 10 (a) { + a; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/4d88f169e3827587.js b/compiler/tests-js-parser/pass-explicit/4d88f169e3827587.js new file mode 100644 index 000000000..e6066b54c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4d88f169e3827587.js @@ -0,0 +1 @@ +try {} catch ({a = 1}) {} diff --git a/compiler/tests-js-parser/pass-explicit/4dc600d5ae71e8eb.js b/compiler/tests-js-parser/pass-explicit/4dc600d5ae71e8eb.js new file mode 100644 index 000000000..2cc347f13 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4dc600d5ae71e8eb.js @@ -0,0 +1 @@ +!(/test/); diff --git a/compiler/tests-js-parser/pass-explicit/4deb8938d7b36024.js b/compiler/tests-js-parser/pass-explicit/4deb8938d7b36024.js new file mode 100644 index 000000000..05cf4ce42 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4deb8938d7b36024.js @@ -0,0 +1 @@ +a = (((b()), (c())), (d())); diff --git a/compiler/tests-js-parser/pass-explicit/4df14f701f9881fd.js b/compiler/tests-js-parser/pass-explicit/4df14f701f9881fd.js new file mode 100644 index 000000000..87dd78e3a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4df14f701f9881fd.js @@ -0,0 +1 @@ +var [a, b] = (c); diff --git a/compiler/tests-js-parser/pass-explicit/4dfe7c0219422eff.module.js b/compiler/tests-js-parser/pass-explicit/4dfe7c0219422eff.module.js new file mode 100644 index 000000000..6aada4f3e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4dfe7c0219422eff.module.js @@ -0,0 +1 @@ +export var a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/4e07f8992cca7db0.js b/compiler/tests-js-parser/pass-explicit/4e07f8992cca7db0.js new file mode 100644 index 000000000..3979e1d96 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e07f8992cca7db0.js @@ -0,0 +1,2 @@ +"use strict"; +0; diff --git a/compiler/tests-js-parser/pass-explicit/4e1a0da46ca45afe.js b/compiler/tests-js-parser/pass-explicit/4e1a0da46ca45afe.js new file mode 100644 index 000000000..267e946e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e1a0da46ca45afe.js @@ -0,0 +1 @@ +function x(...{a}) {} diff --git a/compiler/tests-js-parser/pass-explicit/4e3de59ad16a7d0f.js b/compiler/tests-js-parser/pass-explicit/4e3de59ad16a7d0f.js new file mode 100644 index 000000000..07c34dfdd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e3de59ad16a7d0f.js @@ -0,0 +1 @@ +throw this; diff --git a/compiler/tests-js-parser/pass-explicit/4e625840177567fc.js b/compiler/tests-js-parser/pass-explicit/4e625840177567fc.js new file mode 100644 index 000000000..4903f33b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e625840177567fc.js @@ -0,0 +1,8 @@ +while (a) { + if (b) break; + (c.d)("a"); +} +e: while (a) { + if (b) break e; + (c.d)("a"); +} diff --git a/compiler/tests-js-parser/pass-explicit/4e742059e0fc3d3c.js b/compiler/tests-js-parser/pass-explicit/4e742059e0fc3d3c.js new file mode 100644 index 000000000..0d176fe48 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e742059e0fc3d3c.js @@ -0,0 +1 @@ +for (a, b;;) ; diff --git a/compiler/tests-js-parser/pass-explicit/4e7c58761e24d77c.js b/compiler/tests-js-parser/pass-explicit/4e7c58761e24d77c.js new file mode 100644 index 000000000..6d3a7a100 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e7c58761e24d77c.js @@ -0,0 +1 @@ +a = ({get null() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/4e8e7d6fe1e67ce5.js b/compiler/tests-js-parser/pass-explicit/4e8e7d6fe1e67ce5.js new file mode 100644 index 000000000..4d23e84b1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e8e7d6fe1e67ce5.js @@ -0,0 +1 @@ +({1: ({}) / (1)}); diff --git a/compiler/tests-js-parser/pass-explicit/4e9006104ab9afe8.js b/compiler/tests-js-parser/pass-explicit/4e9006104ab9afe8.js new file mode 100644 index 000000000..e2b8228bb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e9006104ab9afe8.js @@ -0,0 +1 @@ +[, , ] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/4e997dab642864ca.js b/compiler/tests-js-parser/pass-explicit/4e997dab642864ca.js new file mode 100644 index 000000000..217df3c8d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4e997dab642864ca.js @@ -0,0 +1 @@ +var ABC; diff --git a/compiler/tests-js-parser/pass-explicit/4eafc760484cd72b.js b/compiler/tests-js-parser/pass-explicit/4eafc760484cd72b.js new file mode 100644 index 000000000..594645248 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4eafc760484cd72b.js @@ -0,0 +1,5 @@ +function a() { + function b() {} + function c() {} + function d() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/4ec2942a940cd0b8.js b/compiler/tests-js-parser/pass-explicit/4ec2942a940cd0b8.js new file mode 100644 index 000000000..ef310a100 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4ec2942a940cd0b8.js @@ -0,0 +1,9 @@ +for (;;) { + if (a) { + if (b) { + continue; + } + } else { + ; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/4ed17e0e2686e5e5.js b/compiler/tests-js-parser/pass-explicit/4ed17e0e2686e5e5.js new file mode 100644 index 000000000..0e6615a9e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4ed17e0e2686e5e5.js @@ -0,0 +1,4 @@ +((function () { + var a = (1); + a + (((b()), (c())), (d())); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/4eee835d0ac8382a.js b/compiler/tests-js-parser/pass-explicit/4eee835d0ac8382a.js new file mode 100644 index 000000000..93ab65dfe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4eee835d0ac8382a.js @@ -0,0 +1 @@ +(a && b) && c; diff --git a/compiler/tests-js-parser/pass-explicit/4efcd175a5db8b47.js b/compiler/tests-js-parser/pass-explicit/4efcd175a5db8b47.js new file mode 100644 index 000000000..570745250 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4efcd175a5db8b47.js @@ -0,0 +1 @@ +if (a) b; else c; diff --git a/compiler/tests-js-parser/pass-explicit/4f21a4e88694c0d8.js b/compiler/tests-js-parser/pass-explicit/4f21a4e88694c0d8.js new file mode 100644 index 000000000..8f3c9bac3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4f21a4e88694c0d8.js @@ -0,0 +1,3 @@ +a = ({set null (b) { + c = b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/4f24ffe2c3ebe706.js b/compiler/tests-js-parser/pass-explicit/4f24ffe2c3ebe706.js new file mode 100644 index 000000000..c801b0c36 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4f24ffe2c3ebe706.js @@ -0,0 +1 @@ +((a.b).c).d; diff --git a/compiler/tests-js-parser/pass-explicit/4f53cda18c2baa0c.js b/compiler/tests-js-parser/pass-explicit/4f53cda18c2baa0c.js new file mode 100644 index 000000000..5e1ab7855 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4f53cda18c2baa0c.js @@ -0,0 +1 @@ +[]; diff --git a/compiler/tests-js-parser/pass-explicit/4f5419fe648c691b.js b/compiler/tests-js-parser/pass-explicit/4f5419fe648c691b.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/4f60d8fbb4be1120.js b/compiler/tests-js-parser/pass-explicit/4f60d8fbb4be1120.js new file mode 100644 index 000000000..e26bd9a24 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4f60d8fbb4be1120.js @@ -0,0 +1 @@ +9; diff --git a/compiler/tests-js-parser/pass-explicit/4f731d62a74ab666.js b/compiler/tests-js-parser/pass-explicit/4f731d62a74ab666.js new file mode 100644 index 000000000..9fb083818 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4f731d62a74ab666.js @@ -0,0 +1 @@ +(let[a] = b); diff --git a/compiler/tests-js-parser/pass-explicit/4f805a43cc2e8854.js b/compiler/tests-js-parser/pass-explicit/4f805a43cc2e8854.js new file mode 100644 index 000000000..9a86395fa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4f805a43cc2e8854.js @@ -0,0 +1 @@ +/[x-z]/i; diff --git a/compiler/tests-js-parser/pass-explicit/4fa08a62c2d8c495.js b/compiler/tests-js-parser/pass-explicit/4fa08a62c2d8c495.js new file mode 100644 index 000000000..41d926c79 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4fa08a62c2d8c495.js @@ -0,0 +1 @@ +(a = (b("100"))) == a; diff --git a/compiler/tests-js-parser/pass-explicit/4fa4f9e47503bc5f.js b/compiler/tests-js-parser/pass-explicit/4fa4f9e47503bc5f.js new file mode 100644 index 000000000..80ec0bc15 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4fa4f9e47503bc5f.js @@ -0,0 +1 @@ +var a = (1), b = (2), c = (3); diff --git a/compiler/tests-js-parser/pass-explicit/4fdc22a42fa0d040.js b/compiler/tests-js-parser/pass-explicit/4fdc22a42fa0d040.js new file mode 100644 index 000000000..406389365 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4fdc22a42fa0d040.js @@ -0,0 +1 @@ +(a - b) + c; diff --git a/compiler/tests-js-parser/pass-explicit/4fee4ac53bdfd7f7.js b/compiler/tests-js-parser/pass-explicit/4fee4ac53bdfd7f7.js new file mode 100644 index 000000000..c2890cbd6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/4fee4ac53bdfd7f7.js @@ -0,0 +1 @@ +"Hello\0World"; diff --git a/compiler/tests-js-parser/pass-explicit/500804fd29695dac.js b/compiler/tests-js-parser/pass-explicit/500804fd29695dac.js new file mode 100644 index 000000000..91c7c311e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/500804fd29695dac.js @@ -0,0 +1 @@ +26; diff --git a/compiler/tests-js-parser/pass-explicit/5021396f85a70480.js b/compiler/tests-js-parser/pass-explicit/5021396f85a70480.js new file mode 100644 index 000000000..b7cc66dde --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5021396f85a70480.js @@ -0,0 +1,3 @@ +switch (a) { + case 1: +} diff --git a/compiler/tests-js-parser/pass-explicit/503cf49b200abf64.js b/compiler/tests-js-parser/pass-explicit/503cf49b200abf64.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/503cf49b200abf64.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/50ac15a08f7c812f.js b/compiler/tests-js-parser/pass-explicit/50ac15a08f7c812f.js new file mode 100644 index 000000000..014ab00ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/50ac15a08f7c812f.js @@ -0,0 +1 @@ +({get __proto__() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/50bc1f24c865c57a.js b/compiler/tests-js-parser/pass-explicit/50bc1f24c865c57a.js new file mode 100644 index 000000000..52093c063 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/50bc1f24c865c57a.js @@ -0,0 +1 @@ +a(b, c); diff --git a/compiler/tests-js-parser/pass-explicit/50c6ab935ccb020a.module.js b/compiler/tests-js-parser/pass-explicit/50c6ab935ccb020a.module.js new file mode 100644 index 000000000..c595f701a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/50c6ab935ccb020a.module.js @@ -0,0 +1 @@ +export default (class {}); diff --git a/compiler/tests-js-parser/pass-explicit/50cea0e25b2b707d.js b/compiler/tests-js-parser/pass-explicit/50cea0e25b2b707d.js new file mode 100644 index 000000000..55ceb77d7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/50cea0e25b2b707d.js @@ -0,0 +1,4 @@ +function a(b, c) { + var d = (1), e = (f), f = (d + e), g = (h()); + return b + c; +} diff --git a/compiler/tests-js-parser/pass-explicit/50e04108598730ff.js b/compiler/tests-js-parser/pass-explicit/50e04108598730ff.js new file mode 100644 index 000000000..86593aff1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/50e04108598730ff.js @@ -0,0 +1 @@ +({a = 1} = (2)); diff --git a/compiler/tests-js-parser/pass-explicit/511a2a5fd8cac64d.js b/compiler/tests-js-parser/pass-explicit/511a2a5fd8cac64d.js new file mode 100644 index 000000000..c139dae80 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/511a2a5fd8cac64d.js @@ -0,0 +1,8 @@ +d: { + b: { + if (a) break b; + if (a) break b; + if (a) break b; + } + if (c) break d; +} diff --git a/compiler/tests-js-parser/pass-explicit/513275ce0e3c7ef3.js b/compiler/tests-js-parser/pass-explicit/513275ce0e3c7ef3.js new file mode 100644 index 000000000..576cd2133 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/513275ce0e3c7ef3.js @@ -0,0 +1,2 @@ +"use strict"; +var a = ({arguments: 1, eval: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/5147bda197f961c1.js b/compiler/tests-js-parser/pass-explicit/5147bda197f961c1.js new file mode 100644 index 000000000..46b565cfb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5147bda197f961c1.js @@ -0,0 +1 @@ +({[("a") + (1)]: "b"}); diff --git a/compiler/tests-js-parser/pass-explicit/515825915b8d1cd8.js b/compiler/tests-js-parser/pass-explicit/515825915b8d1cd8.js new file mode 100644 index 000000000..88e945505 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/515825915b8d1cd8.js @@ -0,0 +1,6 @@ +while (a) { + try {} catch (b) {} + ((function () { + c("d"); + })()); +} diff --git a/compiler/tests-js-parser/pass-explicit/5171e99c2d9d3e5a.js b/compiler/tests-js-parser/pass-explicit/5171e99c2d9d3e5a.js new file mode 100644 index 000000000..4113019e1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5171e99c2d9d3e5a.js @@ -0,0 +1,7 @@ +if (a) { + if (b) { + true; + } +} else { + false; +} diff --git a/compiler/tests-js-parser/pass-explicit/5183eafe6b4cd6e0.js b/compiler/tests-js-parser/pass-explicit/5183eafe6b4cd6e0.js new file mode 100644 index 000000000..4e858104e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5183eafe6b4cd6e0.js @@ -0,0 +1 @@ +for (var a; b; c) ; diff --git a/compiler/tests-js-parser/pass-explicit/51a3505b43223a9f.js b/compiler/tests-js-parser/pass-explicit/51a3505b43223a9f.js new file mode 100644 index 000000000..bf50bca4f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/51a3505b43223a9f.js @@ -0,0 +1 @@ +if (a) {} else {} diff --git a/compiler/tests-js-parser/pass-explicit/51b243bb5076b692.js b/compiler/tests-js-parser/pass-explicit/51b243bb5076b692.js new file mode 100644 index 000000000..7f132f389 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/51b243bb5076b692.js @@ -0,0 +1 @@ +(...a) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/51b58dc84e1fab89.js b/compiler/tests-js-parser/pass-explicit/51b58dc84e1fab89.js new file mode 100644 index 000000000..8f7993c02 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/51b58dc84e1fab89.js @@ -0,0 +1 @@ +4; diff --git a/compiler/tests-js-parser/pass-explicit/51ea4e18429c02e4.js b/compiler/tests-js-parser/pass-explicit/51ea4e18429c02e4.js new file mode 100644 index 000000000..40890215d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/51ea4e18429c02e4.js @@ -0,0 +1 @@ +if (a) var b = (1); diff --git a/compiler/tests-js-parser/pass-explicit/51fd2b53ad7e1581.js b/compiler/tests-js-parser/pass-explicit/51fd2b53ad7e1581.js new file mode 100644 index 000000000..333b2cc0c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/51fd2b53ad7e1581.js @@ -0,0 +1,3 @@ +class a { + b() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/5203633f36fbe544.js b/compiler/tests-js-parser/pass-explicit/5203633f36fbe544.js new file mode 100644 index 000000000..3b87c7ef7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5203633f36fbe544.js @@ -0,0 +1,2 @@ +"use strict"; +var {yield: a} = (b); diff --git a/compiler/tests-js-parser/pass-explicit/5212ddf4e4b70261.js b/compiler/tests-js-parser/pass-explicit/5212ddf4e4b70261.js new file mode 100644 index 000000000..321b51018 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5212ddf4e4b70261.js @@ -0,0 +1 @@ +a = b; diff --git a/compiler/tests-js-parser/pass-explicit/521479b987ae2d7f.js b/compiler/tests-js-parser/pass-explicit/521479b987ae2d7f.js new file mode 100644 index 000000000..3b05181a6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/521479b987ae2d7f.js @@ -0,0 +1,10 @@ +while (a) { + if (b) { + switch (true) { + case c(): + d(); + } + continue; + } + e(); +} diff --git a/compiler/tests-js-parser/pass-explicit/521b6dfff0a28aa1.js b/compiler/tests-js-parser/pass-explicit/521b6dfff0a28aa1.js new file mode 100644 index 000000000..1f46689eb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/521b6dfff0a28aa1.js @@ -0,0 +1 @@ +function a([a = 1]) {} diff --git a/compiler/tests-js-parser/pass-explicit/523950fa023d7305.js b/compiler/tests-js-parser/pass-explicit/523950fa023d7305.js new file mode 100644 index 000000000..7114bc61a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/523950fa023d7305.js @@ -0,0 +1,3 @@ +{ + let a = (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/5239dd0fc0effb71.js b/compiler/tests-js-parser/pass-explicit/5239dd0fc0effb71.js new file mode 100644 index 000000000..e3b56fe5e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5239dd0fc0effb71.js @@ -0,0 +1,6 @@ +function a() { + var b; + with (c) { + b; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/524172bf792ef97e.js b/compiler/tests-js-parser/pass-explicit/524172bf792ef97e.js new file mode 100644 index 000000000..ef4a390da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/524172bf792ef97e.js @@ -0,0 +1 @@ +for (a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/52aeec7b8da212a2.js b/compiler/tests-js-parser/pass-explicit/52aeec7b8da212a2.js new file mode 100644 index 000000000..a87c628c7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/52aeec7b8da212a2.js @@ -0,0 +1 @@ +if (1) function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/52ce5853ea953f0f.js b/compiler/tests-js-parser/pass-explicit/52ce5853ea953f0f.js new file mode 100644 index 000000000..cb6596ea0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/52ce5853ea953f0f.js @@ -0,0 +1 @@ ++({}); diff --git a/compiler/tests-js-parser/pass-explicit/52f2f30356750b9b.js b/compiler/tests-js-parser/pass-explicit/52f2f30356750b9b.js new file mode 100644 index 000000000..c367c703d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/52f2f30356750b9b.js @@ -0,0 +1 @@ +var a = (/[P QR]/i); diff --git a/compiler/tests-js-parser/pass-explicit/52f9245e7cd97f6a.js b/compiler/tests-js-parser/pass-explicit/52f9245e7cd97f6a.js new file mode 100644 index 000000000..245f5e76d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/52f9245e7cd97f6a.js @@ -0,0 +1 @@ +a: break a; diff --git a/compiler/tests-js-parser/pass-explicit/5317b960ad78bbfe.js b/compiler/tests-js-parser/pass-explicit/5317b960ad78bbfe.js new file mode 100644 index 000000000..3a76f6bdf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5317b960ad78bbfe.js @@ -0,0 +1,9 @@ +function a(b, c) { + function d() { + return e(); + } + function e() { + return d(); + } + return b + c; +} diff --git a/compiler/tests-js-parser/pass-explicit/5333f04581124314.js b/compiler/tests-js-parser/pass-explicit/5333f04581124314.js new file mode 100644 index 000000000..cdbedfdf9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5333f04581124314.js @@ -0,0 +1,9 @@ +if (a) { + with (b) { + if (c) { + debugger; + } + } +} else { + d(); +} diff --git a/compiler/tests-js-parser/pass-explicit/53645d3765e5f67f.js b/compiler/tests-js-parser/pass-explicit/53645d3765e5f67f.js new file mode 100644 index 000000000..a9840891a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/53645d3765e5f67f.js @@ -0,0 +1,4 @@ +((function () { + if (a) return b; + return c; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/54032532b8655caf.js b/compiler/tests-js-parser/pass-explicit/54032532b8655caf.js new file mode 100644 index 000000000..e70f77a4b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/54032532b8655caf.js @@ -0,0 +1 @@ +({a: b} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/5406bea2982a6e13.module.js b/compiler/tests-js-parser/pass-explicit/5406bea2982a6e13.module.js new file mode 100644 index 000000000..c0748305d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5406bea2982a6e13.module.js @@ -0,0 +1 @@ +import "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/54190cc5a11a0233.js b/compiler/tests-js-parser/pass-explicit/54190cc5a11a0233.js new file mode 100644 index 000000000..cab3e19db --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/54190cc5a11a0233.js @@ -0,0 +1,3 @@ +((function () { + (a ? (1) : (2)) != (null); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/541ee533b54ae664.js b/compiler/tests-js-parser/pass-explicit/541ee533b54ae664.js new file mode 100644 index 000000000..f22eab077 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/541ee533b54ae664.js @@ -0,0 +1 @@ +function a(__proto__) {} diff --git a/compiler/tests-js-parser/pass-explicit/54257d53a8fffe8c.js b/compiler/tests-js-parser/pass-explicit/54257d53a8fffe8c.js new file mode 100644 index 000000000..fffff98d3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/54257d53a8fffe8c.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + [super.d] = e; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/547fa50af16beca7.js b/compiler/tests-js-parser/pass-explicit/547fa50af16beca7.js new file mode 100644 index 000000000..5d413ad81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/547fa50af16beca7.js @@ -0,0 +1 @@ +let [a, , b] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/5495e25325fdd364.js b/compiler/tests-js-parser/pass-explicit/5495e25325fdd364.js new file mode 100644 index 000000000..a9e934691 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5495e25325fdd364.js @@ -0,0 +1 @@ +function a(b = c) {} diff --git a/compiler/tests-js-parser/pass-explicit/54e70df597a4f9a3.js b/compiler/tests-js-parser/pass-explicit/54e70df597a4f9a3.js new file mode 100644 index 000000000..831dfff43 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/54e70df597a4f9a3.js @@ -0,0 +1 @@ +try {} catch (eval) {} diff --git a/compiler/tests-js-parser/pass-explicit/54fb77cb2384a86b.js b/compiler/tests-js-parser/pass-explicit/54fb77cb2384a86b.js new file mode 100644 index 000000000..730a9f015 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/54fb77cb2384a86b.js @@ -0,0 +1,9 @@ +"use strict"; +{ + var a = (1); + b(); + { + b(); + b(); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/551af1dc1686e912.module.js b/compiler/tests-js-parser/pass-explicit/551af1dc1686e912.module.js new file mode 100644 index 000000000..9132d49f1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/551af1dc1686e912.module.js @@ -0,0 +1 @@ +export {a} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/5526c98fdf9150c1.js b/compiler/tests-js-parser/pass-explicit/5526c98fdf9150c1.js new file mode 100644 index 000000000..896e34bbf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5526c98fdf9150c1.js @@ -0,0 +1,8 @@ +((function () { + try { + throw "a"; + } catch (b) {} finally { + return 1; + } + c(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/55b74de671f60184.js b/compiler/tests-js-parser/pass-explicit/55b74de671f60184.js new file mode 100644 index 000000000..2e4d4d1a3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/55b74de671f60184.js @@ -0,0 +1,4 @@ +class a { + constructor() {} + ["constructor"]() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/55c15fe174790fb2.js b/compiler/tests-js-parser/pass-explicit/55c15fe174790fb2.js new file mode 100644 index 000000000..288856ce3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/55c15fe174790fb2.js @@ -0,0 +1,6 @@ +((function () { + var a = (1); + with (b) { + (a, (2)), (3); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/55c27b3727ba1165.js b/compiler/tests-js-parser/pass-explicit/55c27b3727ba1165.js new file mode 100644 index 000000000..c7acfa052 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/55c27b3727ba1165.js @@ -0,0 +1 @@ +(a, ...b) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/55d1482dc2d95e91.js b/compiler/tests-js-parser/pass-explicit/55d1482dc2d95e91.js new file mode 100644 index 000000000..75f2dd7f2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/55d1482dc2d95e91.js @@ -0,0 +1 @@ +((1) + (2)) << (3); diff --git a/compiler/tests-js-parser/pass-explicit/55d721b105cc1780.js b/compiler/tests-js-parser/pass-explicit/55d721b105cc1780.js new file mode 100644 index 000000000..2a2976449 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/55d721b105cc1780.js @@ -0,0 +1,3 @@ +a(); +b(); +c(); diff --git a/compiler/tests-js-parser/pass-explicit/560c364700fdb6b2.js b/compiler/tests-js-parser/pass-explicit/560c364700fdb6b2.js new file mode 100644 index 000000000..33269c8da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/560c364700fdb6b2.js @@ -0,0 +1,8 @@ +((function () { + var a = (1); + a; + var b = (2); + with (c) { + b; + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/561ccbf2e5091865.js b/compiler/tests-js-parser/pass-explicit/561ccbf2e5091865.js new file mode 100644 index 000000000..9a3c74373 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/561ccbf2e5091865.js @@ -0,0 +1 @@ +!(a = b); diff --git a/compiler/tests-js-parser/pass-explicit/5641ad33abcd1752.js b/compiler/tests-js-parser/pass-explicit/5641ad33abcd1752.js new file mode 100644 index 000000000..80d3e8d6c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5641ad33abcd1752.js @@ -0,0 +1 @@ +a = ({get true() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/5654d4106d7025c2.js b/compiler/tests-js-parser/pass-explicit/5654d4106d7025c2.js new file mode 100644 index 000000000..03912eb93 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5654d4106d7025c2.js @@ -0,0 +1 @@ +let; diff --git a/compiler/tests-js-parser/pass-explicit/5665da18579dd006.js b/compiler/tests-js-parser/pass-explicit/5665da18579dd006.js new file mode 100644 index 000000000..1bf74962b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5665da18579dd006.js @@ -0,0 +1 @@ +(1) + (((a()), (b())), (c())); diff --git a/compiler/tests-js-parser/pass-explicit/569a2c1bad3beeb2.js b/compiler/tests-js-parser/pass-explicit/569a2c1bad3beeb2.js new file mode 100644 index 000000000..77352f8f8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/569a2c1bad3beeb2.js @@ -0,0 +1 @@ +({a,...b}) => 0; diff --git a/compiler/tests-js-parser/pass-explicit/56dcd0733a23aa26.js b/compiler/tests-js-parser/pass-explicit/56dcd0733a23aa26.js new file mode 100644 index 000000000..133e738c0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/56dcd0733a23aa26.js @@ -0,0 +1,11 @@ +if (a) { + try {} catch (b) {} + ((function () { + c("d"); + })()); +} else { + try {} catch (b) {} + ((function () { + c("d"); + })()); +} diff --git a/compiler/tests-js-parser/pass-explicit/56debc26cbc2e077.js b/compiler/tests-js-parser/pass-explicit/56debc26cbc2e077.js new file mode 100644 index 000000000..8f565d427 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/56debc26cbc2e077.js @@ -0,0 +1 @@ +a = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/56e2ba90e05f5659.js b/compiler/tests-js-parser/pass-explicit/56e2ba90e05f5659.js new file mode 100644 index 000000000..03912eb93 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/56e2ba90e05f5659.js @@ -0,0 +1 @@ +let; diff --git a/compiler/tests-js-parser/pass-explicit/56ec311ffc030121.module.js b/compiler/tests-js-parser/pass-explicit/56ec311ffc030121.module.js new file mode 100644 index 000000000..1c7bf2993 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/56ec311ffc030121.module.js @@ -0,0 +1 @@ +export let a; diff --git a/compiler/tests-js-parser/pass-explicit/56fd564979894636.js b/compiler/tests-js-parser/pass-explicit/56fd564979894636.js new file mode 100644 index 000000000..8123b6e8b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/56fd564979894636.js @@ -0,0 +1 @@ +/\.\/\\/u; diff --git a/compiler/tests-js-parser/pass-explicit/571bb9d1fdd6fcc0.js b/compiler/tests-js-parser/pass-explicit/571bb9d1fdd6fcc0.js new file mode 100644 index 000000000..f6266bd4e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/571bb9d1fdd6fcc0.js @@ -0,0 +1,3 @@ +a: !(function () { + a: ; +}); diff --git a/compiler/tests-js-parser/pass-explicit/5727b1080ddcd68e.js b/compiler/tests-js-parser/pass-explicit/5727b1080ddcd68e.js new file mode 100644 index 000000000..52042106a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5727b1080ddcd68e.js @@ -0,0 +1 @@ +日本語 = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/575306c08cc44b10.js b/compiler/tests-js-parser/pass-explicit/575306c08cc44b10.js new file mode 100644 index 000000000..65fa3b671 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/575306c08cc44b10.js @@ -0,0 +1,3 @@ +((function () { + a["NaN"] = (1); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/578ebe526f02ab34.js b/compiler/tests-js-parser/pass-explicit/578ebe526f02ab34.js new file mode 100644 index 000000000..9d67530ba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/578ebe526f02ab34.js @@ -0,0 +1,4 @@ +{ + var a = (1), b = (2); + c; +} diff --git a/compiler/tests-js-parser/pass-explicit/57971b49e239c0ff.js b/compiler/tests-js-parser/pass-explicit/57971b49e239c0ff.js new file mode 100644 index 000000000..4da99397a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/57971b49e239c0ff.js @@ -0,0 +1,3 @@ +function a(a) { + "use strict"; +} diff --git a/compiler/tests-js-parser/pass-explicit/57ad28ff7d96f031.js b/compiler/tests-js-parser/pass-explicit/57ad28ff7d96f031.js new file mode 100644 index 000000000..9748d90e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/57ad28ff7d96f031.js @@ -0,0 +1,3 @@ +for (var a in b) { + c; +} diff --git a/compiler/tests-js-parser/pass-explicit/5829d742ab805866.js b/compiler/tests-js-parser/pass-explicit/5829d742ab805866.js new file mode 100644 index 000000000..7e4fe7836 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5829d742ab805866.js @@ -0,0 +1 @@ +({a: b} = (0)); diff --git a/compiler/tests-js-parser/pass-explicit/585130f356b0729f.js b/compiler/tests-js-parser/pass-explicit/585130f356b0729f.js new file mode 100644 index 000000000..2fd03fac8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/585130f356b0729f.js @@ -0,0 +1 @@ +let [a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/5856de37689f8db9.js b/compiler/tests-js-parser/pass-explicit/5856de37689f8db9.js new file mode 100644 index 000000000..461dca9da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5856de37689f8db9.js @@ -0,0 +1 @@ +a => (a * yield); diff --git a/compiler/tests-js-parser/pass-explicit/585b857c11763bad.js b/compiler/tests-js-parser/pass-explicit/585b857c11763bad.js new file mode 100644 index 000000000..bb980c4b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/585b857c11763bad.js @@ -0,0 +1 @@ +([[[[[[[[[[[[[[[[[[[[{a = b}]]]]]]]]]]]]]]]]]]]]) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/587400d1c019785a.js b/compiler/tests-js-parser/pass-explicit/587400d1c019785a.js new file mode 100644 index 000000000..b2eff24ce --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/587400d1c019785a.js @@ -0,0 +1,3 @@ +try {} finally { + a(b); +} diff --git a/compiler/tests-js-parser/pass-explicit/589dc8ad3b9aa28f.js b/compiler/tests-js-parser/pass-explicit/589dc8ad3b9aa28f.js new file mode 100644 index 000000000..8b5db73da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/589dc8ad3b9aa28f.js @@ -0,0 +1,3 @@ +((function () { + a(((1), (2)), (3)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/58a52091eaa8746c.js b/compiler/tests-js-parser/pass-explicit/58a52091eaa8746c.js new file mode 100644 index 000000000..dfe257163 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/58a52091eaa8746c.js @@ -0,0 +1,3 @@ +((function () { + a(); +})()), ((b()) + (1)); diff --git a/compiler/tests-js-parser/pass-explicit/58cb05d17f7ec010.js b/compiler/tests-js-parser/pass-explicit/58cb05d17f7ec010.js new file mode 100644 index 000000000..6356ce72d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/58cb05d17f7ec010.js @@ -0,0 +1 @@ +var _ð’¦ = (1); diff --git a/compiler/tests-js-parser/pass-explicit/58cf2c5c0cecdf0e.js b/compiler/tests-js-parser/pass-explicit/58cf2c5c0cecdf0e.js new file mode 100644 index 000000000..a210f3553 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/58cf2c5c0cecdf0e.js @@ -0,0 +1 @@ +class a {} diff --git a/compiler/tests-js-parser/pass-explicit/58d72762ccb4d31f.js b/compiler/tests-js-parser/pass-explicit/58d72762ccb4d31f.js new file mode 100644 index 000000000..aa817ed43 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/58d72762ccb4d31f.js @@ -0,0 +1 @@ +typeof a; diff --git a/compiler/tests-js-parser/pass-explicit/58ed6ffb30191684.js b/compiler/tests-js-parser/pass-explicit/58ed6ffb30191684.js new file mode 100644 index 000000000..31d0c6653 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/58ed6ffb30191684.js @@ -0,0 +1,3 @@ +({set false (a) { + a; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/596746323492fbfd.js b/compiler/tests-js-parser/pass-explicit/596746323492fbfd.js new file mode 100644 index 000000000..f2d8cba7c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/596746323492fbfd.js @@ -0,0 +1 @@ +var _𞸃; diff --git a/compiler/tests-js-parser/pass-explicit/597108fd45a6e79b.js b/compiler/tests-js-parser/pass-explicit/597108fd45a6e79b.js new file mode 100644 index 000000000..ff3564aaa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/597108fd45a6e79b.js @@ -0,0 +1,5 @@ +class a extends b { + constructor() { + ({c: super()}); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/597b9759467727fc.js b/compiler/tests-js-parser/pass-explicit/597b9759467727fc.js new file mode 100644 index 000000000..f3977cd42 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/597b9759467727fc.js @@ -0,0 +1 @@ +({a} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/5984eac0c5c6d947.js b/compiler/tests-js-parser/pass-explicit/5984eac0c5c6d947.js new file mode 100644 index 000000000..5e1ab7855 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5984eac0c5c6d947.js @@ -0,0 +1 @@ +[]; diff --git a/compiler/tests-js-parser/pass-explicit/598a5cedba92154d.js b/compiler/tests-js-parser/pass-explicit/598a5cedba92154d.js new file mode 100644 index 000000000..02e55f711 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/598a5cedba92154d.js @@ -0,0 +1 @@ +[a = (0)] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/599dff255c5ec792.js b/compiler/tests-js-parser/pass-explicit/599dff255c5ec792.js new file mode 100644 index 000000000..fd846b7f3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/599dff255c5ec792.js @@ -0,0 +1 @@ +eval => ("use strict"); diff --git a/compiler/tests-js-parser/pass-explicit/59ae0289778b80cd.js b/compiler/tests-js-parser/pass-explicit/59ae0289778b80cd.js new file mode 100644 index 000000000..bf8202778 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/59ae0289778b80cd.js @@ -0,0 +1 @@ +if (1) function a() {} else ; diff --git a/compiler/tests-js-parser/pass-explicit/5a06dab3e9fd0f65.js b/compiler/tests-js-parser/pass-explicit/5a06dab3e9fd0f65.js new file mode 100644 index 000000000..3da067c27 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5a06dab3e9fd0f65.js @@ -0,0 +1,7 @@ +((function () { + for (;;) { + break; + a(); + } + b(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/5a079debdfff12da.js b/compiler/tests-js-parser/pass-explicit/5a079debdfff12da.js new file mode 100644 index 000000000..14d197e0a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5a079debdfff12da.js @@ -0,0 +1 @@ +a - b; diff --git a/compiler/tests-js-parser/pass-explicit/5a0dcc9e43fed2c2.js b/compiler/tests-js-parser/pass-explicit/5a0dcc9e43fed2c2.js new file mode 100644 index 000000000..3f2af1675 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5a0dcc9e43fed2c2.js @@ -0,0 +1 @@ +({a: null, b: null}); diff --git a/compiler/tests-js-parser/pass-explicit/5a2a8e992fa4fe37.js b/compiler/tests-js-parser/pass-explicit/5a2a8e992fa4fe37.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/5a51417e1ceb294f.js b/compiler/tests-js-parser/pass-explicit/5a51417e1ceb294f.js new file mode 100644 index 000000000..ed7eab813 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5a51417e1ceb294f.js @@ -0,0 +1,5 @@ +for (;;) { + while (true) { + continue; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/5a54ee2c0b326b18.js b/compiler/tests-js-parser/pass-explicit/5a54ee2c0b326b18.js new file mode 100644 index 000000000..bcece63ba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5a54ee2c0b326b18.js @@ -0,0 +1,3 @@ +function a(b) { + for (var c = (1), d = ((b.e)());; c++) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/5a7812b78a03b937.js b/compiler/tests-js-parser/pass-explicit/5a7812b78a03b937.js new file mode 100644 index 000000000..08e66effe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5a7812b78a03b937.js @@ -0,0 +1 @@ +new a; diff --git a/compiler/tests-js-parser/pass-explicit/5aca2791ab698851.js b/compiler/tests-js-parser/pass-explicit/5aca2791ab698851.js new file mode 100644 index 000000000..1d7c28cbb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5aca2791ab698851.js @@ -0,0 +1,5 @@ +((function () { + with (a) { + b = ((c()), (1)); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/5b146261dda66d63.js b/compiler/tests-js-parser/pass-explicit/5b146261dda66d63.js new file mode 100644 index 000000000..2726951f2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5b146261dda66d63.js @@ -0,0 +1 @@ +("‪"); diff --git a/compiler/tests-js-parser/pass-explicit/5b39aca97d9006f4.js b/compiler/tests-js-parser/pass-explicit/5b39aca97d9006f4.js new file mode 100644 index 000000000..01145ab03 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5b39aca97d9006f4.js @@ -0,0 +1 @@ +a`token ${`nested ${(`deeply`) + ({})} blah`}`; diff --git a/compiler/tests-js-parser/pass-explicit/5b4cef6792d9462f.js b/compiler/tests-js-parser/pass-explicit/5b4cef6792d9462f.js new file mode 100644 index 000000000..36534620e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5b4cef6792d9462f.js @@ -0,0 +1 @@ +void a; diff --git a/compiler/tests-js-parser/pass-explicit/5b683275df4548d1.js b/compiler/tests-js-parser/pass-explicit/5b683275df4548d1.js new file mode 100644 index 000000000..c9cb10a4e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5b683275df4548d1.js @@ -0,0 +1,5 @@ +((function () { + var a = (1); + a; + eval(""); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/5b8d2b991d2c1f5b.js b/compiler/tests-js-parser/pass-explicit/5b8d2b991d2c1f5b.js new file mode 100644 index 000000000..b3bf1ddb0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5b8d2b991d2c1f5b.js @@ -0,0 +1 @@ +({}); diff --git a/compiler/tests-js-parser/pass-explicit/5b8fad162f489b3b.js b/compiler/tests-js-parser/pass-explicit/5b8fad162f489b3b.js new file mode 100644 index 000000000..807fae416 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5b8fad162f489b3b.js @@ -0,0 +1 @@ +a--; diff --git a/compiler/tests-js-parser/pass-explicit/5b9f113c3bdd0c49.js b/compiler/tests-js-parser/pass-explicit/5b9f113c3bdd0c49.js new file mode 100644 index 000000000..af61ef3da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5b9f113c3bdd0c49.js @@ -0,0 +1,16 @@ +function a() { + b(); + c = (1); + throw "d"; + if (c) { + e(); + var c; + function b() {} + ; + ((function () { + var f; + function e() {} + ; + })()); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/5bae374be95382c6.js b/compiler/tests-js-parser/pass-explicit/5bae374be95382c6.js new file mode 100644 index 000000000..272f49471 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5bae374be95382c6.js @@ -0,0 +1,5 @@ +function a() { + return; + {} + /foo/; +} diff --git a/compiler/tests-js-parser/pass-explicit/5bb4c1e68b0925d1.js b/compiler/tests-js-parser/pass-explicit/5bb4c1e68b0925d1.js new file mode 100644 index 000000000..89f7e185c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5bb4c1e68b0925d1.js @@ -0,0 +1 @@ +a.b = ((c()), (1)); diff --git a/compiler/tests-js-parser/pass-explicit/5beffd72ddb47f13.js b/compiler/tests-js-parser/pass-explicit/5beffd72ddb47f13.js new file mode 100644 index 000000000..a1a575c76 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5beffd72ddb47f13.js @@ -0,0 +1 @@ +("a"); diff --git a/compiler/tests-js-parser/pass-explicit/5c3d125ce5f032aa.js b/compiler/tests-js-parser/pass-explicit/5c3d125ce5f032aa.js new file mode 100644 index 000000000..fdc51ec87 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5c3d125ce5f032aa.js @@ -0,0 +1 @@ +var 𞸀; diff --git a/compiler/tests-js-parser/pass-explicit/5c57eec29a019ebb.js b/compiler/tests-js-parser/pass-explicit/5c57eec29a019ebb.js new file mode 100644 index 000000000..b64ffb637 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5c57eec29a019ebb.js @@ -0,0 +1,4 @@ +class a { + static [b]() {} + static [c]() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/5c587adcfe50a8c6.js b/compiler/tests-js-parser/pass-explicit/5c587adcfe50a8c6.js new file mode 100644 index 000000000..788500901 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5c587adcfe50a8c6.js @@ -0,0 +1,5 @@ +switch (a) { + case 1: + default: + case 2: +} diff --git a/compiler/tests-js-parser/pass-explicit/5c5ef7a4bdc3e081.js b/compiler/tests-js-parser/pass-explicit/5c5ef7a4bdc3e081.js new file mode 100644 index 000000000..71f2477fe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5c5ef7a4bdc3e081.js @@ -0,0 +1,6 @@ +var a; +if (b) { + a = ((1) + (2)); +} else { + a = (3); +} diff --git a/compiler/tests-js-parser/pass-explicit/5cc7ceeebdccb6d4.js b/compiler/tests-js-parser/pass-explicit/5cc7ceeebdccb6d4.js new file mode 100644 index 000000000..ee7f03155 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5cc7ceeebdccb6d4.js @@ -0,0 +1 @@ +for (const a = (1);;) ; diff --git a/compiler/tests-js-parser/pass-explicit/5cf0dc4259e98c15.js b/compiler/tests-js-parser/pass-explicit/5cf0dc4259e98c15.js new file mode 100644 index 000000000..e1bfcf96f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5cf0dc4259e98c15.js @@ -0,0 +1,3 @@ +var a, b; +a.c = ((a = ({})), (1)); +b = ((b = ({})), (2)); diff --git a/compiler/tests-js-parser/pass-explicit/5d0cbb3fb27c21b7.js b/compiler/tests-js-parser/pass-explicit/5d0cbb3fb27c21b7.js new file mode 100644 index 000000000..3b89081e5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5d0cbb3fb27c21b7.js @@ -0,0 +1,8 @@ +for (;;) { + if (a) { + if (b) { + continue; + } + c(); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/5d1a7c61bf135457.js b/compiler/tests-js-parser/pass-explicit/5d1a7c61bf135457.js new file mode 100644 index 000000000..31142aabf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5d1a7c61bf135457.js @@ -0,0 +1 @@ +a; diff --git a/compiler/tests-js-parser/pass-explicit/5d3e89c83953788e.js b/compiler/tests-js-parser/pass-explicit/5d3e89c83953788e.js new file mode 100644 index 000000000..b1bafcb36 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5d3e89c83953788e.js @@ -0,0 +1,3 @@ +function a() { + for (var b in c) ; +} diff --git a/compiler/tests-js-parser/pass-explicit/5d5b9de6d9b95f3e.js b/compiler/tests-js-parser/pass-explicit/5d5b9de6d9b95f3e.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/5d687a45c607ea42.js b/compiler/tests-js-parser/pass-explicit/5d687a45c607ea42.js new file mode 100644 index 000000000..939bce0b4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5d687a45c607ea42.js @@ -0,0 +1,8 @@ +{ + { + a; + } +} +{ + b; +} diff --git a/compiler/tests-js-parser/pass-explicit/5d8ab2c35c7eb883.js b/compiler/tests-js-parser/pass-explicit/5d8ab2c35c7eb883.js new file mode 100644 index 000000000..63f92a51c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5d8ab2c35c7eb883.js @@ -0,0 +1,6 @@ +var a; +if (b()) { + a(); +} else { + a(); +} diff --git a/compiler/tests-js-parser/pass-explicit/5d9d30af901ba176.js b/compiler/tests-js-parser/pass-explicit/5d9d30af901ba176.js new file mode 100644 index 000000000..469a0fdf1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5d9d30af901ba176.js @@ -0,0 +1,5 @@ +for (;;) { + with (a) { + continue; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/5dd65055dace49bc.js b/compiler/tests-js-parser/pass-explicit/5dd65055dace49bc.js new file mode 100644 index 000000000..0000c4121 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5dd65055dace49bc.js @@ -0,0 +1 @@ +({a, b = b, a: c, [a]: [d]}) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/5e0cab2e2e36274c.js b/compiler/tests-js-parser/pass-explicit/5e0cab2e2e36274c.js new file mode 100644 index 000000000..93661276e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5e0cab2e2e36274c.js @@ -0,0 +1 @@ +a(...(0)); diff --git a/compiler/tests-js-parser/pass-explicit/5e1cbe1737b1bbc6.js b/compiler/tests-js-parser/pass-explicit/5e1cbe1737b1bbc6.js new file mode 100644 index 000000000..5b474acb4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5e1cbe1737b1bbc6.js @@ -0,0 +1 @@ +(eval, a = 1) => (2); diff --git a/compiler/tests-js-parser/pass-explicit/5e6d5c3edf519b99.js b/compiler/tests-js-parser/pass-explicit/5e6d5c3edf519b99.js new file mode 100644 index 000000000..545ed59e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5e6d5c3edf519b99.js @@ -0,0 +1 @@ +a = (function ({b} = {b: 1}) {}); diff --git a/compiler/tests-js-parser/pass-explicit/5e7ca8611aaa4d53.js b/compiler/tests-js-parser/pass-explicit/5e7ca8611aaa4d53.js new file mode 100644 index 000000000..a192c5649 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5e7ca8611aaa4d53.js @@ -0,0 +1 @@ +let [a, , ] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/5ec03710bd21b933.js b/compiler/tests-js-parser/pass-explicit/5ec03710bd21b933.js new file mode 100644 index 000000000..415d3befa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5ec03710bd21b933.js @@ -0,0 +1,4 @@ +b: while (1) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/5ecbbdc097bee212.js b/compiler/tests-js-parser/pass-explicit/5ecbbdc097bee212.js new file mode 100644 index 000000000..36682d215 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5ecbbdc097bee212.js @@ -0,0 +1 @@ +for (a in let) {} diff --git a/compiler/tests-js-parser/pass-explicit/5ecf2f4d83e6260d.module.js b/compiler/tests-js-parser/pass-explicit/5ecf2f4d83e6260d.module.js new file mode 100644 index 000000000..3918c74e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5ecf2f4d83e6260d.module.js @@ -0,0 +1 @@ +"use strict"; diff --git a/compiler/tests-js-parser/pass-explicit/5ed18bdbe48cc4c3.js b/compiler/tests-js-parser/pass-explicit/5ed18bdbe48cc4c3.js new file mode 100644 index 000000000..8481256a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5ed18bdbe48cc4c3.js @@ -0,0 +1,3 @@ +function* a() { + var b = (function yield() {}); +} diff --git a/compiler/tests-js-parser/pass-explicit/5f1e0eff7ac775ee.js b/compiler/tests-js-parser/pass-explicit/5f1e0eff7ac775ee.js new file mode 100644 index 000000000..db9eda517 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5f1e0eff7ac775ee.js @@ -0,0 +1 @@ +delete (((1), a), (2)); diff --git a/compiler/tests-js-parser/pass-explicit/5f2834246274eccc.js b/compiler/tests-js-parser/pass-explicit/5f2834246274eccc.js new file mode 100644 index 000000000..36534620e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5f2834246274eccc.js @@ -0,0 +1 @@ +void a; diff --git a/compiler/tests-js-parser/pass-explicit/5f5e1d12ad68e832.js b/compiler/tests-js-parser/pass-explicit/5f5e1d12ad68e832.js new file mode 100644 index 000000000..b7728c774 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5f5e1d12ad68e832.js @@ -0,0 +1,3 @@ +if (a && b) { + (((c(a))[1]).b).d = (e()); +} else (((c(a))[2]).b).d = (f()); diff --git a/compiler/tests-js-parser/pass-explicit/5f730961df66e8e8.js b/compiler/tests-js-parser/pass-explicit/5f730961df66e8e8.js new file mode 100644 index 000000000..6a947d79b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5f730961df66e8e8.js @@ -0,0 +1 @@ +a = ({get false() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/5f85b0b6828b081b.js b/compiler/tests-js-parser/pass-explicit/5f85b0b6828b081b.js new file mode 100644 index 000000000..01aae6f3d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5f85b0b6828b081b.js @@ -0,0 +1 @@ +(a, ...[b]) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/5f9eeac7b076f34b.js b/compiler/tests-js-parser/pass-explicit/5f9eeac7b076f34b.js new file mode 100644 index 000000000..878c26c0d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5f9eeac7b076f34b.js @@ -0,0 +1 @@ +(a, {b = 1}) => (2); diff --git a/compiler/tests-js-parser/pass-explicit/5fa8c711247d70f5.js b/compiler/tests-js-parser/pass-explicit/5fa8c711247d70f5.js new file mode 100644 index 000000000..ff14abefe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5fa8c711247d70f5.js @@ -0,0 +1 @@ +() => {}; diff --git a/compiler/tests-js-parser/pass-explicit/5fcc16142185c87c.js b/compiler/tests-js-parser/pass-explicit/5fcc16142185c87c.js new file mode 100644 index 000000000..272c1417a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/5fcc16142185c87c.js @@ -0,0 +1 @@ +var [] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/600327b79f60606c.js b/compiler/tests-js-parser/pass-explicit/600327b79f60606c.js new file mode 100644 index 000000000..30caf28fb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/600327b79f60606c.js @@ -0,0 +1,3 @@ +((function () { + (a ? (1) : b) != (null); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/600fd3c4d9f2ca42.js b/compiler/tests-js-parser/pass-explicit/600fd3c4d9f2ca42.js new file mode 100644 index 000000000..8728667af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/600fd3c4d9f2ca42.js @@ -0,0 +1 @@ +a -= (1); diff --git a/compiler/tests-js-parser/pass-explicit/60a1991953372b97.js b/compiler/tests-js-parser/pass-explicit/60a1991953372b97.js new file mode 100644 index 000000000..2eed4cad0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/60a1991953372b97.js @@ -0,0 +1,7 @@ +((function () { + for (;;) { + continue; + a(); + } + b(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/60bb345d725fe68b.js b/compiler/tests-js-parser/pass-explicit/60bb345d725fe68b.js new file mode 100644 index 000000000..4fd869859 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/60bb345d725fe68b.js @@ -0,0 +1,10 @@ +((function () { + if (a) { + b(); + return 1; + } else { + b(); + return 2; + } + c(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/60c092cb83b525f2.js b/compiler/tests-js-parser/pass-explicit/60c092cb83b525f2.js new file mode 100644 index 000000000..c7a3ea68d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/60c092cb83b525f2.js @@ -0,0 +1 @@ +a &= (1); diff --git a/compiler/tests-js-parser/pass-explicit/60dcd48a3f6af44f.js b/compiler/tests-js-parser/pass-explicit/60dcd48a3f6af44f.js new file mode 100644 index 000000000..c39c877a9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/60dcd48a3f6af44f.js @@ -0,0 +1,3 @@ +try {} catch (a) { + var a = (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/610b397691988417.module.js b/compiler/tests-js-parser/pass-explicit/610b397691988417.module.js new file mode 100644 index 000000000..92e9831d7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/610b397691988417.module.js @@ -0,0 +1 @@ +import {b as a} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/612fed84b89e42a8.js b/compiler/tests-js-parser/pass-explicit/612fed84b89e42a8.js new file mode 100644 index 000000000..04a58421a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/612fed84b89e42a8.js @@ -0,0 +1 @@ +(1) instanceof (2); diff --git a/compiler/tests-js-parser/pass-explicit/6196b3f969486455.js b/compiler/tests-js-parser/pass-explicit/6196b3f969486455.js new file mode 100644 index 000000000..bc621c8a3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6196b3f969486455.js @@ -0,0 +1 @@ +yield => (1); diff --git a/compiler/tests-js-parser/pass-explicit/61ceb5809404ee85.js b/compiler/tests-js-parser/pass-explicit/61ceb5809404ee85.js new file mode 100644 index 000000000..fe199772f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/61ceb5809404ee85.js @@ -0,0 +1 @@ +a + b; diff --git a/compiler/tests-js-parser/pass-explicit/61d8a7e497b6db72.js b/compiler/tests-js-parser/pass-explicit/61d8a7e497b6db72.js new file mode 100644 index 000000000..4b5444254 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/61d8a7e497b6db72.js @@ -0,0 +1,8 @@ +((function () { + function a() { + ((function () { + b("c"); + })()); + } + a(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/61f55d9f22cc8426.js b/compiler/tests-js-parser/pass-explicit/61f55d9f22cc8426.js new file mode 100644 index 000000000..f08c9cd2e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/61f55d9f22cc8426.js @@ -0,0 +1,3 @@ +class a { + static static() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/623cec03370f088a.js b/compiler/tests-js-parser/pass-explicit/623cec03370f088a.js new file mode 100644 index 000000000..a87a7cb81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/623cec03370f088a.js @@ -0,0 +1 @@ +a(...b, ...c, ...d); diff --git a/compiler/tests-js-parser/pass-explicit/624bc7f99260037f.js b/compiler/tests-js-parser/pass-explicit/624bc7f99260037f.js new file mode 100644 index 000000000..b94e031c5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/624bc7f99260037f.js @@ -0,0 +1 @@ +function a(b = 1) {} diff --git a/compiler/tests-js-parser/pass-explicit/62541961bcef8d79.js b/compiler/tests-js-parser/pass-explicit/62541961bcef8d79.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/62541961bcef8d79.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/627fede559e0bcac.js b/compiler/tests-js-parser/pass-explicit/627fede559e0bcac.js new file mode 100644 index 000000000..1ab5cf1f6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/627fede559e0bcac.js @@ -0,0 +1 @@ +(a = (b("100"))) != a; diff --git a/compiler/tests-js-parser/pass-explicit/62ab44289ebbba49.js b/compiler/tests-js-parser/pass-explicit/62ab44289ebbba49.js new file mode 100644 index 000000000..f7df8c162 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/62ab44289ebbba49.js @@ -0,0 +1,4 @@ +((function () { + return 1; + function a() {} +})()); diff --git a/compiler/tests-js-parser/pass-explicit/62c217b2844680ab.js b/compiler/tests-js-parser/pass-explicit/62c217b2844680ab.js new file mode 100644 index 000000000..8e86880aa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/62c217b2844680ab.js @@ -0,0 +1 @@ +a + (b / c); diff --git a/compiler/tests-js-parser/pass-explicit/62d0da6771d5317d.js b/compiler/tests-js-parser/pass-explicit/62d0da6771d5317d.js new file mode 100644 index 000000000..14366af1f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/62d0da6771d5317d.js @@ -0,0 +1,3 @@ +function* a() { + yield a; +} diff --git a/compiler/tests-js-parser/pass-explicit/62d7c1ee4e1626c4.js b/compiler/tests-js-parser/pass-explicit/62d7c1ee4e1626c4.js new file mode 100644 index 000000000..1e1010fe8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/62d7c1ee4e1626c4.js @@ -0,0 +1,4 @@ +(function () { + return; + a; +}); diff --git a/compiler/tests-js-parser/pass-explicit/63208a19ffb4baeb.js b/compiler/tests-js-parser/pass-explicit/63208a19ffb4baeb.js new file mode 100644 index 000000000..581d57f50 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/63208a19ffb4baeb.js @@ -0,0 +1 @@ +({[("a") + ("b")]: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/633fac25082a90af.js b/compiler/tests-js-parser/pass-explicit/633fac25082a90af.js new file mode 100644 index 000000000..3a1a6dab0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/633fac25082a90af.js @@ -0,0 +1 @@ +var [{a = 1}] = (2); diff --git a/compiler/tests-js-parser/pass-explicit/63586de6fec2e3cf.js b/compiler/tests-js-parser/pass-explicit/63586de6fec2e3cf.js new file mode 100644 index 000000000..06a71b6f5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/63586de6fec2e3cf.js @@ -0,0 +1 @@ +({[a]: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/639b9076cc56e57c.js b/compiler/tests-js-parser/pass-explicit/639b9076cc56e57c.js new file mode 100644 index 000000000..326b48878 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/639b9076cc56e57c.js @@ -0,0 +1,3 @@ +while (true) { + if (a) break; else b; +} diff --git a/compiler/tests-js-parser/pass-explicit/63c92209eb77315a.js b/compiler/tests-js-parser/pass-explicit/63c92209eb77315a.js new file mode 100644 index 000000000..a7aa97561 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/63c92209eb77315a.js @@ -0,0 +1 @@ +var let; diff --git a/compiler/tests-js-parser/pass-explicit/63ee9cd383dc68a3.js b/compiler/tests-js-parser/pass-explicit/63ee9cd383dc68a3.js new file mode 100644 index 000000000..4d70931c4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/63ee9cd383dc68a3.js @@ -0,0 +1,11 @@ +switch (1) { + case 2: + a(); + if (b) break; + c(); + break; + case (3) + (4): + d(); + default: + e(); +} diff --git a/compiler/tests-js-parser/pass-explicit/64117d5c682ec505.js b/compiler/tests-js-parser/pass-explicit/64117d5c682ec505.js new file mode 100644 index 000000000..cd661911a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/64117d5c682ec505.js @@ -0,0 +1,5 @@ +while (a) { + b(); + c(); + continue; +} diff --git a/compiler/tests-js-parser/pass-explicit/641ac9060a206183.js b/compiler/tests-js-parser/pass-explicit/641ac9060a206183.js new file mode 100644 index 000000000..cde249953 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/641ac9060a206183.js @@ -0,0 +1 @@ +([a, , b]) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/645e8cce491528cd.js b/compiler/tests-js-parser/pass-explicit/645e8cce491528cd.js new file mode 100644 index 000000000..2ef840675 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/645e8cce491528cd.js @@ -0,0 +1 @@ +typeof (/test/); diff --git a/compiler/tests-js-parser/pass-explicit/646c2391c11102b5.js b/compiler/tests-js-parser/pass-explicit/646c2391c11102b5.js new file mode 100644 index 000000000..438b46be0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/646c2391c11102b5.js @@ -0,0 +1 @@ +a, a; diff --git a/compiler/tests-js-parser/pass-explicit/647e21f8f157c338.js b/compiler/tests-js-parser/pass-explicit/647e21f8f157c338.js new file mode 100644 index 000000000..ef222baf6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/647e21f8f157c338.js @@ -0,0 +1 @@ +'
' diff --git a/compiler/tests-js-parser/pass-explicit/6498dcc494193cb4.js b/compiler/tests-js-parser/pass-explicit/6498dcc494193cb4.js new file mode 100644 index 000000000..10a5aa005 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6498dcc494193cb4.js @@ -0,0 +1,7 @@ +{ + 1; + 2; + 3; + 4; + 5; +} diff --git a/compiler/tests-js-parser/pass-explicit/64cc57f82a54b7fb.js b/compiler/tests-js-parser/pass-explicit/64cc57f82a54b7fb.js new file mode 100644 index 000000000..b83f7a0fc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/64cc57f82a54b7fb.js @@ -0,0 +1 @@ +({get 10() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/64ff3b3ee7f636c5.js b/compiler/tests-js-parser/pass-explicit/64ff3b3ee7f636c5.js new file mode 100644 index 000000000..07c6eed0b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/64ff3b3ee7f636c5.js @@ -0,0 +1 @@ +(function a({b, c}) {}); diff --git a/compiler/tests-js-parser/pass-explicit/65047600233c760c.js b/compiler/tests-js-parser/pass-explicit/65047600233c760c.js new file mode 100644 index 000000000..de7483d85 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/65047600233c760c.js @@ -0,0 +1 @@ +a = (false); diff --git a/compiler/tests-js-parser/pass-explicit/65228d6a31a06406.js b/compiler/tests-js-parser/pass-explicit/65228d6a31a06406.js new file mode 100644 index 000000000..ab4d83aff --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/65228d6a31a06406.js @@ -0,0 +1,27 @@ +var a; +a = ((true) && b); +a = ((1) && ((c.d)("a"))); +a = (((2) * (3)) && ((4) * b)); +a = (((5) == (6)) && (b + (7))); +a = (("e") && ((8) - b)); +a = (((9) + ("")) && (b / (10))); +a = ((-(4.5)) && ((11) << b)); +a = ((12) && (13)); +a = ((false) && b); +a = (NaN && ((c.d)("f"))); +a = ((14) && ((c.d)("g"))); +a = (h && ((15) * b)); +a = ((null) && (b + (16))); +a = ((((17) * (18)) - (19)) && ((20) - b)); +a = (((21) == (22)) && (b / (23))); +a = ((!("e")) && ((24) % b)); +a = ((25) && (26)); +a = (b && (true)); +a = (((c.d)("a")) && (27)); +a = (((28) - b) && ("e")); +a = (((29) << b) && (-(4.5))); +a = (b && (false)); +a = (((c.d)("f")) && NaN); +a = (((c.d)("g")) && (30)); +a = (((31) * b) && h); +a = ((b + (32)) && (null)); diff --git a/compiler/tests-js-parser/pass-explicit/65401ed8dc152370.js b/compiler/tests-js-parser/pass-explicit/65401ed8dc152370.js new file mode 100644 index 000000000..26d65636c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/65401ed8dc152370.js @@ -0,0 +1 @@ +var let = (1); diff --git a/compiler/tests-js-parser/pass-explicit/655eab0815e0567e.js b/compiler/tests-js-parser/pass-explicit/655eab0815e0567e.js new file mode 100644 index 000000000..ba565a244 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/655eab0815e0567e.js @@ -0,0 +1 @@ +function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/65fcb1f93f1684ef.js b/compiler/tests-js-parser/pass-explicit/65fcb1f93f1684ef.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/660f5a175a2d46ac.js b/compiler/tests-js-parser/pass-explicit/660f5a175a2d46ac.js new file mode 100644 index 000000000..66dba739b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/660f5a175a2d46ac.js @@ -0,0 +1 @@ +(let[a]); diff --git a/compiler/tests-js-parser/pass-explicit/664b0da1dd015106.js b/compiler/tests-js-parser/pass-explicit/664b0da1dd015106.js new file mode 100644 index 000000000..ba8ab05b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/664b0da1dd015106.js @@ -0,0 +1,5 @@ +a["b"] = ("c"); +a["if"] = ("if"); +a["*"] = ("d"); +a["ຳ"] = ("e"); +a[""] = ("f"); diff --git a/compiler/tests-js-parser/pass-explicit/665f4940c7cf30c9.js b/compiler/tests-js-parser/pass-explicit/665f4940c7cf30c9.js new file mode 100644 index 000000000..c3ebda5b5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/665f4940c7cf30c9.js @@ -0,0 +1,3 @@ +(function () { + return; +}); diff --git a/compiler/tests-js-parser/pass-explicit/668ab87597363d53.js b/compiler/tests-js-parser/pass-explicit/668ab87597363d53.js new file mode 100644 index 000000000..c7b8391ac --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/668ab87597363d53.js @@ -0,0 +1 @@ +a: while (true) continue a; diff --git a/compiler/tests-js-parser/pass-explicit/66aabbb5b00fb1ae.js b/compiler/tests-js-parser/pass-explicit/66aabbb5b00fb1ae.js new file mode 100644 index 000000000..c9cb10a4e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/66aabbb5b00fb1ae.js @@ -0,0 +1,5 @@ +((function () { + var a = (1); + a; + eval(""); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/66bd9903ea05f8cc.js b/compiler/tests-js-parser/pass-explicit/66bd9903ea05f8cc.js new file mode 100644 index 000000000..1da278515 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/66bd9903ea05f8cc.js @@ -0,0 +1,2 @@ +function a() {} +function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/66d2dbcb692491ec.module.js b/compiler/tests-js-parser/pass-explicit/66d2dbcb692491ec.module.js new file mode 100644 index 000000000..2643c1074 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/66d2dbcb692491ec.module.js @@ -0,0 +1 @@ +export * from "a"; diff --git a/compiler/tests-js-parser/pass-explicit/66ea15f7de78add7.module.js b/compiler/tests-js-parser/pass-explicit/66ea15f7de78add7.module.js new file mode 100644 index 000000000..f41639e85 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/66ea15f7de78add7.module.js @@ -0,0 +1 @@ +export var a; diff --git a/compiler/tests-js-parser/pass-explicit/671c914df5da04df.js b/compiler/tests-js-parser/pass-explicit/671c914df5da04df.js new file mode 100644 index 000000000..2f406b0ea --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/671c914df5da04df.js @@ -0,0 +1 @@ +({a: null}); diff --git a/compiler/tests-js-parser/pass-explicit/6733f491913ccff2.js b/compiler/tests-js-parser/pass-explicit/6733f491913ccff2.js new file mode 100644 index 000000000..d1354f310 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6733f491913ccff2.js @@ -0,0 +1,3 @@ +class a { + constructor() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/673e6f2765ef3cb3.js b/compiler/tests-js-parser/pass-explicit/673e6f2765ef3cb3.js new file mode 100644 index 000000000..e0d9a8281 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/673e6f2765ef3cb3.js @@ -0,0 +1 @@ +a = ({}); diff --git a/compiler/tests-js-parser/pass-explicit/67711cbb84083749.js b/compiler/tests-js-parser/pass-explicit/67711cbb84083749.js new file mode 100644 index 000000000..de8212853 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/67711cbb84083749.js @@ -0,0 +1 @@ +a(b(c), d(c), e(c), b(), d(), e()); diff --git a/compiler/tests-js-parser/pass-explicit/6776e2c88e03f1a2.js b/compiler/tests-js-parser/pass-explicit/6776e2c88e03f1a2.js new file mode 100644 index 000000000..af2b0f0b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6776e2c88e03f1a2.js @@ -0,0 +1 @@ +function* yield() {} diff --git a/compiler/tests-js-parser/pass-explicit/680880af107834e8.js b/compiler/tests-js-parser/pass-explicit/680880af107834e8.js new file mode 100644 index 000000000..7fd258adc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/680880af107834e8.js @@ -0,0 +1 @@ +(/test/) && (/test/); diff --git a/compiler/tests-js-parser/pass-explicit/68125aef6f5cc46f.js b/compiler/tests-js-parser/pass-explicit/68125aef6f5cc46f.js new file mode 100644 index 000000000..3979e1d96 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/68125aef6f5cc46f.js @@ -0,0 +1,2 @@ +"use strict"; +0; diff --git a/compiler/tests-js-parser/pass-explicit/6815ab22de966de8.js b/compiler/tests-js-parser/pass-explicit/6815ab22de966de8.js new file mode 100644 index 000000000..391b0d229 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6815ab22de966de8.js @@ -0,0 +1 @@ +for (let();;) ; diff --git a/compiler/tests-js-parser/pass-explicit/681f352b7356594c.js b/compiler/tests-js-parser/pass-explicit/681f352b7356594c.js new file mode 100644 index 000000000..962cc53ed --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/681f352b7356594c.js @@ -0,0 +1,3 @@ +a => { + return 1; +}; diff --git a/compiler/tests-js-parser/pass-explicit/6823058797ddd563.js b/compiler/tests-js-parser/pass-explicit/6823058797ddd563.js new file mode 100644 index 000000000..cc1e1fed9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6823058797ddd563.js @@ -0,0 +1 @@ +/[a-z]/gim; diff --git a/compiler/tests-js-parser/pass-explicit/684237281767d41d.js b/compiler/tests-js-parser/pass-explicit/684237281767d41d.js new file mode 100644 index 000000000..0f9ecf6d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/684237281767d41d.js @@ -0,0 +1,4 @@ +{ + do ; while (false); + false; +} diff --git a/compiler/tests-js-parser/pass-explicit/6861bb23b186f65a.js b/compiler/tests-js-parser/pass-explicit/6861bb23b186f65a.js new file mode 100644 index 000000000..75c904856 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6861bb23b186f65a.js @@ -0,0 +1 @@ +/=([^=\s])+/g; diff --git a/compiler/tests-js-parser/pass-explicit/687b7b904904fcfd.js b/compiler/tests-js-parser/pass-explicit/687b7b904904fcfd.js new file mode 100644 index 000000000..c1ad23a64 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/687b7b904904fcfd.js @@ -0,0 +1,3 @@ +class a { + prototype() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/687f678cde900411.js b/compiler/tests-js-parser/pass-explicit/687f678cde900411.js new file mode 100644 index 000000000..cd42d7876 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/687f678cde900411.js @@ -0,0 +1 @@ +([1]).a = (2); diff --git a/compiler/tests-js-parser/pass-explicit/69063bc9496ea6e5.js b/compiler/tests-js-parser/pass-explicit/69063bc9496ea6e5.js new file mode 100644 index 000000000..8775a9d5c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/69063bc9496ea6e5.js @@ -0,0 +1 @@ +a`hello ${b}`; diff --git a/compiler/tests-js-parser/pass-explicit/691e1d9954f3e6e2.js b/compiler/tests-js-parser/pass-explicit/691e1d9954f3e6e2.js new file mode 100644 index 000000000..09ce2c164 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/691e1d9954f3e6e2.js @@ -0,0 +1 @@ +a = ({__proto__: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/697b3d30c1d06918.js b/compiler/tests-js-parser/pass-explicit/697b3d30c1d06918.js new file mode 100644 index 000000000..2cb6f32aa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/697b3d30c1d06918.js @@ -0,0 +1,4 @@ +function a() { + "use strict"; + ({b: 1, b: 2}); +} diff --git a/compiler/tests-js-parser/pass-explicit/698a8cfb0705c277.js b/compiler/tests-js-parser/pass-explicit/698a8cfb0705c277.js new file mode 100644 index 000000000..ada18649f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/698a8cfb0705c277.js @@ -0,0 +1 @@ +({a: 1, get a() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/69bbdc7c34ed23cc.js b/compiler/tests-js-parser/pass-explicit/69bbdc7c34ed23cc.js new file mode 100644 index 000000000..13519fbd8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/69bbdc7c34ed23cc.js @@ -0,0 +1 @@ +({get a() {}, a: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/69bdc785b6e244ff.js b/compiler/tests-js-parser/pass-explicit/69bdc785b6e244ff.js new file mode 100644 index 000000000..388c475cc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/69bdc785b6e244ff.js @@ -0,0 +1 @@ +a || (b || (c || (d || (e || f)))); diff --git a/compiler/tests-js-parser/pass-explicit/69cbe8ec2f64382d.js b/compiler/tests-js-parser/pass-explicit/69cbe8ec2f64382d.js new file mode 100644 index 000000000..eb86b6925 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/69cbe8ec2f64382d.js @@ -0,0 +1 @@ +var a, b; diff --git a/compiler/tests-js-parser/pass-explicit/6a218750a221c68b.module.js b/compiler/tests-js-parser/pass-explicit/6a218750a221c68b.module.js new file mode 100644 index 000000000..b782a7641 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6a218750a221c68b.module.js @@ -0,0 +1 @@ +import * as a from "a"; diff --git a/compiler/tests-js-parser/pass-explicit/6a220df693ce521c.js b/compiler/tests-js-parser/pass-explicit/6a220df693ce521c.js new file mode 100644 index 000000000..a33a8e75c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6a220df693ce521c.js @@ -0,0 +1 @@ +for ((a(b in c))[1] in d) ; diff --git a/compiler/tests-js-parser/pass-explicit/6a240463b40550d2.js b/compiler/tests-js-parser/pass-explicit/6a240463b40550d2.js new file mode 100644 index 000000000..154e6937f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6a240463b40550d2.js @@ -0,0 +1 @@ +(1e20), (1e21); diff --git a/compiler/tests-js-parser/pass-explicit/6a323491fe75918a.js b/compiler/tests-js-parser/pass-explicit/6a323491fe75918a.js new file mode 100644 index 000000000..484f80212 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6a323491fe75918a.js @@ -0,0 +1,3 @@ +(function* () { + yield (1); +}); diff --git a/compiler/tests-js-parser/pass-explicit/6a735105a5e79722.js b/compiler/tests-js-parser/pass-explicit/6a735105a5e79722.js new file mode 100644 index 000000000..180e5d1b4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6a735105a5e79722.js @@ -0,0 +1,3 @@ +((function () { + for (var a = (1); a < (2); ++a) ; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/6a7ed6cb99ea0b81.js b/compiler/tests-js-parser/pass-explicit/6a7ed6cb99ea0b81.js new file mode 100644 index 000000000..b50efcc06 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6a7ed6cb99ea0b81.js @@ -0,0 +1 @@ +a = (a += (1)); diff --git a/compiler/tests-js-parser/pass-explicit/6b0e8bbdc3dca1c5.js b/compiler/tests-js-parser/pass-explicit/6b0e8bbdc3dca1c5.js new file mode 100644 index 000000000..93f3fa715 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6b0e8bbdc3dca1c5.js @@ -0,0 +1,9 @@ +if (a) { + with (b) { + if (c) { + d(); + } + } +} else { + d(); +} diff --git a/compiler/tests-js-parser/pass-explicit/6b36b5ad4f3ad84d.js b/compiler/tests-js-parser/pass-explicit/6b36b5ad4f3ad84d.js new file mode 100644 index 000000000..1c22953b4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6b36b5ad4f3ad84d.js @@ -0,0 +1 @@ +let.let = a; diff --git a/compiler/tests-js-parser/pass-explicit/6b5e7e125097d439.js b/compiler/tests-js-parser/pass-explicit/6b5e7e125097d439.js new file mode 100644 index 000000000..e8f4c2467 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6b5e7e125097d439.js @@ -0,0 +1 @@ +a.a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/6b63d36394b0ffb3.js b/compiler/tests-js-parser/pass-explicit/6b63d36394b0ffb3.js new file mode 100644 index 000000000..48e71fea3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6b63d36394b0ffb3.js @@ -0,0 +1 @@ +() => ("a"); diff --git a/compiler/tests-js-parser/pass-explicit/6b68aefbfbf0beb9.js b/compiler/tests-js-parser/pass-explicit/6b68aefbfbf0beb9.js new file mode 100644 index 000000000..cf5e70466 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6b68aefbfbf0beb9.js @@ -0,0 +1 @@ +a = ({set() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/6b76b8761a049c19.js b/compiler/tests-js-parser/pass-explicit/6b76b8761a049c19.js new file mode 100644 index 000000000..b1a14d1d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6b76b8761a049c19.js @@ -0,0 +1,3 @@ +function* a() { + ({set b (yield) {}}); +} diff --git a/compiler/tests-js-parser/pass-explicit/6b86b273ff34fce1.js b/compiler/tests-js-parser/pass-explicit/6b86b273ff34fce1.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6b86b273ff34fce1.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/6bb2a138b9eb0088.js b/compiler/tests-js-parser/pass-explicit/6bb2a138b9eb0088.js new file mode 100644 index 000000000..4c481d4e0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6bb2a138b9eb0088.js @@ -0,0 +1 @@ +(1) * (2); diff --git a/compiler/tests-js-parser/pass-explicit/6c27d048b07ca7e0.js b/compiler/tests-js-parser/pass-explicit/6c27d048b07ca7e0.js new file mode 100644 index 000000000..dd94688bd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6c27d048b07ca7e0.js @@ -0,0 +1,14 @@ +class a { + constructor() {} + b() {} +} +; +class c { + constructor(...d) {} + b() {} +} +; +class e extends a {} +; +var f = (class g {}); +var h = (class {}); diff --git a/compiler/tests-js-parser/pass-explicit/6c42024bfadac21f.js b/compiler/tests-js-parser/pass-explicit/6c42024bfadac21f.js new file mode 100644 index 000000000..64619e3ec --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6c42024bfadac21f.js @@ -0,0 +1 @@ +a = ({if: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/6c5f0dd83c417a5a.js b/compiler/tests-js-parser/pass-explicit/6c5f0dd83c417a5a.js new file mode 100644 index 000000000..428a0e695 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6c5f0dd83c417a5a.js @@ -0,0 +1,8 @@ +function a() { + try { + a(); + } catch (b) { + var c = (1); + } + return c; +} diff --git a/compiler/tests-js-parser/pass-explicit/6c688efe01b3631e.js b/compiler/tests-js-parser/pass-explicit/6c688efe01b3631e.js new file mode 100644 index 000000000..b284d698c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6c688efe01b3631e.js @@ -0,0 +1,3 @@ +function* a() { + yield* a; +} diff --git a/compiler/tests-js-parser/pass-explicit/6cfcfc99afcb6e1a.js b/compiler/tests-js-parser/pass-explicit/6cfcfc99afcb6e1a.js new file mode 100644 index 000000000..84ed86b8f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6cfcfc99afcb6e1a.js @@ -0,0 +1 @@ +for (let a of [1, 2]) 3; diff --git a/compiler/tests-js-parser/pass-explicit/6d1bf4c3db76b489.js b/compiler/tests-js-parser/pass-explicit/6d1bf4c3db76b489.js new file mode 100644 index 000000000..9e379aee7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6d1bf4c3db76b489.js @@ -0,0 +1 @@ +3567; diff --git a/compiler/tests-js-parser/pass-explicit/6d707802519c7158.js b/compiler/tests-js-parser/pass-explicit/6d707802519c7158.js new file mode 100644 index 000000000..22956e531 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6d707802519c7158.js @@ -0,0 +1 @@ +a(`${b} + ${c} = ${b + c}`); diff --git a/compiler/tests-js-parser/pass-explicit/6d79220c64963dad.js b/compiler/tests-js-parser/pass-explicit/6d79220c64963dad.js new file mode 100644 index 000000000..5c7b67266 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6d79220c64963dad.js @@ -0,0 +1 @@ +do ; while (true); diff --git a/compiler/tests-js-parser/pass-explicit/6d8728cbc7bfe6b5.js b/compiler/tests-js-parser/pass-explicit/6d8728cbc7bfe6b5.js new file mode 100644 index 000000000..a576b0c29 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6d8728cbc7bfe6b5.js @@ -0,0 +1 @@ +({}) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/6d8c97119162ad95.js b/compiler/tests-js-parser/pass-explicit/6d8c97119162ad95.js new file mode 100644 index 000000000..3a9665a45 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6d8c97119162ad95.js @@ -0,0 +1,3 @@ +` + +`; diff --git a/compiler/tests-js-parser/pass-explicit/6d981ff8b6a3faec.js b/compiler/tests-js-parser/pass-explicit/6d981ff8b6a3faec.js new file mode 100644 index 000000000..6f844a692 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6d981ff8b6a3faec.js @@ -0,0 +1,3 @@ +var a = ({*b() { + yield* c; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/6db6e4c3ba0299b7.js b/compiler/tests-js-parser/pass-explicit/6db6e4c3ba0299b7.js new file mode 100644 index 000000000..ca9651d5f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6db6e4c3ba0299b7.js @@ -0,0 +1 @@ +a instanceof b; diff --git a/compiler/tests-js-parser/pass-explicit/6db7dbc9b1365dfa.module.js b/compiler/tests-js-parser/pass-explicit/6db7dbc9b1365dfa.module.js new file mode 100644 index 000000000..d786c1855 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6db7dbc9b1365dfa.module.js @@ -0,0 +1 @@ +export default /foo/; diff --git a/compiler/tests-js-parser/pass-explicit/6dcd76e9be7c3d00.js b/compiler/tests-js-parser/pass-explicit/6dcd76e9be7c3d00.js new file mode 100644 index 000000000..ab89e6493 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6dcd76e9be7c3d00.js @@ -0,0 +1,4 @@ +b: { + if (a) break b; + (c.d)("e"); +} diff --git a/compiler/tests-js-parser/pass-explicit/6e5fe0c2bb20b016.js b/compiler/tests-js-parser/pass-explicit/6e5fe0c2bb20b016.js new file mode 100644 index 000000000..1dddceca5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6e5fe0c2bb20b016.js @@ -0,0 +1 @@ +({a: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/6ec818aa7f27cdbf.js b/compiler/tests-js-parser/pass-explicit/6ec818aa7f27cdbf.js new file mode 100644 index 000000000..283144e01 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6ec818aa7f27cdbf.js @@ -0,0 +1 @@ +const a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/6edc155d463535cb.js b/compiler/tests-js-parser/pass-explicit/6edc155d463535cb.js new file mode 100644 index 000000000..1fa63bf9d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6edc155d463535cb.js @@ -0,0 +1,5 @@ +(function () { + "use strict"; + a = (1); + function b() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/6f256be2ef45a7d6.js b/compiler/tests-js-parser/pass-explicit/6f256be2ef45a7d6.js new file mode 100644 index 000000000..5c7d54f2b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6f256be2ef45a7d6.js @@ -0,0 +1,3 @@ +__proto__: while (true) { + break __proto__; +} diff --git a/compiler/tests-js-parser/pass-explicit/6f6e870785069487.js b/compiler/tests-js-parser/pass-explicit/6f6e870785069487.js new file mode 100644 index 000000000..2e5e40bf4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6f6e870785069487.js @@ -0,0 +1 @@ +/((((((((((((.))))))))))))\12/; diff --git a/compiler/tests-js-parser/pass-explicit/6f824ec22e22a198.js b/compiler/tests-js-parser/pass-explicit/6f824ec22e22a198.js new file mode 100644 index 000000000..d4ead8473 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6f824ec22e22a198.js @@ -0,0 +1 @@ +({a(b, ...c) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/6ffb11115fcefb96.js b/compiler/tests-js-parser/pass-explicit/6ffb11115fcefb96.js new file mode 100644 index 000000000..8a9ab14f8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6ffb11115fcefb96.js @@ -0,0 +1,8 @@ +c: { + a("b"); + break c; +} +c: { + a("b"); + break c; +} diff --git a/compiler/tests-js-parser/pass-explicit/6ffb1fb47c2dd12f.js b/compiler/tests-js-parser/pass-explicit/6ffb1fb47c2dd12f.js new file mode 100644 index 000000000..43ca88ea2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6ffb1fb47c2dd12f.js @@ -0,0 +1 @@ +({a, a: a, a: a = a, [a]: {a}, a: (b())[a], a: (this).a} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/6ffc173d4e1e5158.js b/compiler/tests-js-parser/pass-explicit/6ffc173d4e1e5158.js new file mode 100644 index 000000000..07ed6f599 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6ffc173d4e1e5158.js @@ -0,0 +1 @@ +(class {}); diff --git a/compiler/tests-js-parser/pass-explicit/6ffd0afb19f0a92c.js b/compiler/tests-js-parser/pass-explicit/6ffd0afb19f0a92c.js new file mode 100644 index 000000000..7fd09db77 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/6ffd0afb19f0a92c.js @@ -0,0 +1 @@ +var a = (class extends (b, c) {}); diff --git a/compiler/tests-js-parser/pass-explicit/702e4ee53d26635a.module.js b/compiler/tests-js-parser/pass-explicit/702e4ee53d26635a.module.js new file mode 100644 index 000000000..4b992e32e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/702e4ee53d26635a.module.js @@ -0,0 +1 @@ +import a from "a"; diff --git a/compiler/tests-js-parser/pass-explicit/7055b45fe7f74d94.js b/compiler/tests-js-parser/pass-explicit/7055b45fe7f74d94.js new file mode 100644 index 000000000..c018f18cb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7055b45fe7f74d94.js @@ -0,0 +1,5 @@ +class a extends b { + constructor() { + super(); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/70ad5a19a1b2a4b6.js b/compiler/tests-js-parser/pass-explicit/70ad5a19a1b2a4b6.js new file mode 100644 index 000000000..da9aa4123 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/70ad5a19a1b2a4b6.js @@ -0,0 +1,8 @@ +((function () { + a: for (;;) { + for (;;) { + break a; + b(); + } + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/70b701c0eb7d36fd.js b/compiler/tests-js-parser/pass-explicit/70b701c0eb7d36fd.js new file mode 100644 index 000000000..d7273f387 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/70b701c0eb7d36fd.js @@ -0,0 +1 @@ +if (!a) debugger; diff --git a/compiler/tests-js-parser/pass-explicit/70bf2c409480ae10.js b/compiler/tests-js-parser/pass-explicit/70bf2c409480ae10.js new file mode 100644 index 000000000..332f557d9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/70bf2c409480ae10.js @@ -0,0 +1 @@ +({get true() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/70c2ced6bad143f1.js b/compiler/tests-js-parser/pass-explicit/70c2ced6bad143f1.js new file mode 100644 index 000000000..523c01484 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/70c2ced6bad143f1.js @@ -0,0 +1 @@ +new (a.b); diff --git a/compiler/tests-js-parser/pass-explicit/70da848e355cdfd2.js b/compiler/tests-js-parser/pass-explicit/70da848e355cdfd2.js new file mode 100644 index 000000000..08e66effe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/70da848e355cdfd2.js @@ -0,0 +1 @@ +new a; diff --git a/compiler/tests-js-parser/pass-explicit/7148f242d6770f89.js b/compiler/tests-js-parser/pass-explicit/7148f242d6770f89.js new file mode 100644 index 000000000..a0e4c40a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7148f242d6770f89.js @@ -0,0 +1,3 @@ +while (a) { + b; +} diff --git a/compiler/tests-js-parser/pass-explicit/714be6d28082eaa7.js b/compiler/tests-js-parser/pass-explicit/714be6d28082eaa7.js new file mode 100644 index 000000000..24d6994bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/714be6d28082eaa7.js @@ -0,0 +1 @@ +a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/717b2f65b69e809e.js b/compiler/tests-js-parser/pass-explicit/717b2f65b69e809e.js new file mode 100644 index 000000000..fde7091f0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/717b2f65b69e809e.js @@ -0,0 +1,2 @@ +"use strict"; +a => (1); diff --git a/compiler/tests-js-parser/pass-explicit/717def9f9459b4e1.module.js b/compiler/tests-js-parser/pass-explicit/717def9f9459b4e1.module.js new file mode 100644 index 000000000..158f0d4e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/717def9f9459b4e1.module.js @@ -0,0 +1 @@ +export {} from "a"; diff --git a/compiler/tests-js-parser/pass-explicit/7188bf4c56d2ffc8.js b/compiler/tests-js-parser/pass-explicit/7188bf4c56d2ffc8.js new file mode 100644 index 000000000..217df3c8d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7188bf4c56d2ffc8.js @@ -0,0 +1 @@ +var ABC; diff --git a/compiler/tests-js-parser/pass-explicit/71a2d3e7d606a959.js b/compiler/tests-js-parser/pass-explicit/71a2d3e7d606a959.js new file mode 100644 index 000000000..d9cc14d81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/71a2d3e7d606a959.js @@ -0,0 +1 @@ +(1) >> (2); diff --git a/compiler/tests-js-parser/pass-explicit/71bcb4b846c22c58.js b/compiler/tests-js-parser/pass-explicit/71bcb4b846c22c58.js new file mode 100644 index 000000000..b3e32ae28 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/71bcb4b846c22c58.js @@ -0,0 +1,4 @@ +a["0"]; +a["1"]; +a["00"]; +a["0x20"]; diff --git a/compiler/tests-js-parser/pass-explicit/71e066a0fa01825b.js b/compiler/tests-js-parser/pass-explicit/71e066a0fa01825b.js new file mode 100644 index 000000000..1d236106a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/71e066a0fa01825b.js @@ -0,0 +1 @@ +("\t"); diff --git a/compiler/tests-js-parser/pass-explicit/72286da2cadacba6.js b/compiler/tests-js-parser/pass-explicit/72286da2cadacba6.js new file mode 100644 index 000000000..16f9b767f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/72286da2cadacba6.js @@ -0,0 +1 @@ +let [a] = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/726ee28a1b50ff13.module.js b/compiler/tests-js-parser/pass-explicit/726ee28a1b50ff13.module.js new file mode 100644 index 000000000..aed454845 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/726ee28a1b50ff13.module.js @@ -0,0 +1 @@ +export default {a: 1}; diff --git a/compiler/tests-js-parser/pass-explicit/729212ece9234c48.js b/compiler/tests-js-parser/pass-explicit/729212ece9234c48.js new file mode 100644 index 000000000..307fbb159 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/729212ece9234c48.js @@ -0,0 +1 @@ +(a[1]).b; diff --git a/compiler/tests-js-parser/pass-explicit/72d79750e81ef03d.js b/compiler/tests-js-parser/pass-explicit/72d79750e81ef03d.js new file mode 100644 index 000000000..01dd55d7f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/72d79750e81ef03d.js @@ -0,0 +1 @@ +x ** y; diff --git a/compiler/tests-js-parser/pass-explicit/72e4f3f9f66a40b8.js b/compiler/tests-js-parser/pass-explicit/72e4f3f9f66a40b8.js new file mode 100644 index 000000000..a0244869d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/72e4f3f9f66a40b8.js @@ -0,0 +1,3 @@ +function* a() { + yield (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/7305be27a0713dfa.js b/compiler/tests-js-parser/pass-explicit/7305be27a0713dfa.js new file mode 100644 index 000000000..7a65b7593 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7305be27a0713dfa.js @@ -0,0 +1,5 @@ +do { + ((function () { + a("b"); + })()); +} while (c); diff --git a/compiler/tests-js-parser/pass-explicit/73298cb8636154f2.js b/compiler/tests-js-parser/pass-explicit/73298cb8636154f2.js new file mode 100644 index 000000000..feff3ae10 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/73298cb8636154f2.js @@ -0,0 +1 @@ +var a = (function eval() {}); diff --git a/compiler/tests-js-parser/pass-explicit/739bef73b11c87de.js b/compiler/tests-js-parser/pass-explicit/739bef73b11c87de.js new file mode 100644 index 000000000..83a57db7a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/739bef73b11c87de.js @@ -0,0 +1 @@ +/[--]/; diff --git a/compiler/tests-js-parser/pass-explicit/74234e98afe7498f.js b/compiler/tests-js-parser/pass-explicit/74234e98afe7498f.js new file mode 100644 index 000000000..ff464d15b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/74234e98afe7498f.js @@ -0,0 +1 @@ +null; diff --git a/compiler/tests-js-parser/pass-explicit/748a60621d2abe2b.js b/compiler/tests-js-parser/pass-explicit/748a60621d2abe2b.js new file mode 100644 index 000000000..0f2032ba9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/748a60621d2abe2b.js @@ -0,0 +1 @@ +__proto__: a; diff --git a/compiler/tests-js-parser/pass-explicit/74c5ebda713c8bd7.js b/compiler/tests-js-parser/pass-explicit/74c5ebda713c8bd7.js new file mode 100644 index 000000000..e94711009 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/74c5ebda713c8bd7.js @@ -0,0 +1,3 @@ +a = ({set false (b) { + c = b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/74cfbae1c9639338.js b/compiler/tests-js-parser/pass-explicit/74cfbae1c9639338.js new file mode 100644 index 000000000..048597818 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/74cfbae1c9639338.js @@ -0,0 +1 @@ +var [a, ...a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/75172741c27c7703.js b/compiler/tests-js-parser/pass-explicit/75172741c27c7703.js new file mode 100644 index 000000000..9d16804d6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/75172741c27c7703.js @@ -0,0 +1 @@ +(function (yield) {}); diff --git a/compiler/tests-js-parser/pass-explicit/753341b6f22ec11f.js b/compiler/tests-js-parser/pass-explicit/753341b6f22ec11f.js new file mode 100644 index 000000000..9ebf3afe3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/753341b6f22ec11f.js @@ -0,0 +1,3 @@ +function* a() { + (function yield() {}); +} diff --git a/compiler/tests-js-parser/pass-explicit/753a8b016a700975.js b/compiler/tests-js-parser/pass-explicit/753a8b016a700975.js new file mode 100644 index 000000000..e236ae4c6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/753a8b016a700975.js @@ -0,0 +1 @@ +(function (a = b) {}); diff --git a/compiler/tests-js-parser/pass-explicit/756579211447db0b.js b/compiler/tests-js-parser/pass-explicit/756579211447db0b.js new file mode 100644 index 000000000..765da1143 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/756579211447db0b.js @@ -0,0 +1 @@ +2; diff --git a/compiler/tests-js-parser/pass-explicit/756e3fe0ef87b136.js b/compiler/tests-js-parser/pass-explicit/756e3fe0ef87b136.js new file mode 100644 index 000000000..f99d73aaa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/756e3fe0ef87b136.js @@ -0,0 +1,10 @@ +function a() { + b(); + c(); + return d(); +} +function e() { + b(); + c(); + throw new f; +} diff --git a/compiler/tests-js-parser/pass-explicit/757fc3fbe38b4ecb.js b/compiler/tests-js-parser/pass-explicit/757fc3fbe38b4ecb.js new file mode 100644 index 000000000..446c96f1f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/757fc3fbe38b4ecb.js @@ -0,0 +1 @@ +a(...b); diff --git a/compiler/tests-js-parser/pass-explicit/75969544af546abc.js b/compiler/tests-js-parser/pass-explicit/75969544af546abc.js new file mode 100644 index 000000000..fb44362dc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/75969544af546abc.js @@ -0,0 +1 @@ +new a(...b, ...c, ...d); diff --git a/compiler/tests-js-parser/pass-explicit/75ad6a8ee6579761.js b/compiler/tests-js-parser/pass-explicit/75ad6a8ee6579761.js new file mode 100644 index 000000000..b69d853e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/75ad6a8ee6579761.js @@ -0,0 +1,3 @@ +function a() { + new.target; +} diff --git a/compiler/tests-js-parser/pass-explicit/75b0eeaf3aa61e74.js b/compiler/tests-js-parser/pass-explicit/75b0eeaf3aa61e74.js new file mode 100644 index 000000000..8329e1375 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/75b0eeaf3aa61e74.js @@ -0,0 +1,13 @@ +function a() { + if (b) return; + c(); + d(); +} +function e() { + if (b) return; + if (c) return; + if (d) return; + if (f) return; + g(); + h(); +} diff --git a/compiler/tests-js-parser/pass-explicit/75bb6594d6ad253f.module.js b/compiler/tests-js-parser/pass-explicit/75bb6594d6ad253f.module.js new file mode 100644 index 000000000..5e354df56 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/75bb6594d6ad253f.module.js @@ -0,0 +1 @@ +export let a = ({}); diff --git a/compiler/tests-js-parser/pass-explicit/75e16348fe9e6213.js b/compiler/tests-js-parser/pass-explicit/75e16348fe9e6213.js new file mode 100644 index 000000000..5f973a844 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/75e16348fe9e6213.js @@ -0,0 +1,5 @@ +var a = (((((((((("b") + ("c")) + (d())) + ("e")) + ("b")) + (f())) + ("d")) + ("f")) + ("g")) + (h())); +var i = ((((("b") + (1)) + (d())) + (2)) + ("j")); +var k = ((((3) + (d())) + (4)) + ("j")); +var l = (((((5) + (d())) + (6)) + (7)) + ("j")); +var m = ((((((8) + (d())) + (9)) + ("n")) + (10)) + ("j")); diff --git a/compiler/tests-js-parser/pass-explicit/764e72657e7321b5.js b/compiler/tests-js-parser/pass-explicit/764e72657e7321b5.js new file mode 100644 index 000000000..5913de950 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/764e72657e7321b5.js @@ -0,0 +1 @@ +var a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/765a7a823aa1b070.js b/compiler/tests-js-parser/pass-explicit/765a7a823aa1b070.js new file mode 100644 index 000000000..0a0831e16 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/765a7a823aa1b070.js @@ -0,0 +1,3 @@ +((function () { + (1) / (2); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/76703c4b987330fb.js b/compiler/tests-js-parser/pass-explicit/76703c4b987330fb.js new file mode 100644 index 000000000..c775eb73d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/76703c4b987330fb.js @@ -0,0 +1,3 @@ +a => { + b: 1; +}; diff --git a/compiler/tests-js-parser/pass-explicit/76a46be6c2f09fa3.js b/compiler/tests-js-parser/pass-explicit/76a46be6c2f09fa3.js new file mode 100644 index 000000000..e8c01d78f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/76a46be6c2f09fa3.js @@ -0,0 +1,5 @@ +function a() { + "use strict"; + return 1; +} +; diff --git a/compiler/tests-js-parser/pass-explicit/76d4858e4a60be95.js b/compiler/tests-js-parser/pass-explicit/76d4858e4a60be95.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/771467ccdae93157.js b/compiler/tests-js-parser/pass-explicit/771467ccdae93157.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/771467ccdae93157.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/7716587c3d80e9ab.js b/compiler/tests-js-parser/pass-explicit/7716587c3d80e9ab.js new file mode 100644 index 000000000..9314288cf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7716587c3d80e9ab.js @@ -0,0 +1,5 @@ +(class { + constructor() { + super.a; + } +}); diff --git a/compiler/tests-js-parser/pass-explicit/7733ab7955652851.js b/compiler/tests-js-parser/pass-explicit/7733ab7955652851.js new file mode 100644 index 000000000..99e22fdea --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7733ab7955652851.js @@ -0,0 +1 @@ +({a = 1}, {}) => (2); diff --git a/compiler/tests-js-parser/pass-explicit/776076cb09759e40.js b/compiler/tests-js-parser/pass-explicit/776076cb09759e40.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/776076cb09759e40.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/77710aedc74ecfa3.js b/compiler/tests-js-parser/pass-explicit/77710aedc74ecfa3.js new file mode 100644 index 000000000..c444097d0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/77710aedc74ecfa3.js @@ -0,0 +1 @@ +日本語; diff --git a/compiler/tests-js-parser/pass-explicit/7779cfcd717e97d3.js b/compiler/tests-js-parser/pass-explicit/7779cfcd717e97d3.js new file mode 100644 index 000000000..b6739703a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7779cfcd717e97d3.js @@ -0,0 +1,3 @@ +while (true) { + continue; +} diff --git a/compiler/tests-js-parser/pass-explicit/7788d3c1e1247da9.js b/compiler/tests-js-parser/pass-explicit/7788d3c1e1247da9.js new file mode 100644 index 000000000..674d166a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7788d3c1e1247da9.js @@ -0,0 +1 @@ +[a.b] = (0); diff --git a/compiler/tests-js-parser/pass-explicit/779e65d6349f1616.js b/compiler/tests-js-parser/pass-explicit/779e65d6349f1616.js new file mode 100644 index 000000000..ca710c789 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/779e65d6349f1616.js @@ -0,0 +1,8 @@ +a = (typeof (1)); +b = (typeof ("c")); +d = (typeof ([])); +e = (typeof ({})); +f = (typeof (/./)); +g = (typeof (false)); +h = (typeof (function () {})); +i = (typeof j); diff --git a/compiler/tests-js-parser/pass-explicit/77a541b0502d0bde.js b/compiler/tests-js-parser/pass-explicit/77a541b0502d0bde.js new file mode 100644 index 000000000..d26f9187a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/77a541b0502d0bde.js @@ -0,0 +1 @@ +(""); diff --git a/compiler/tests-js-parser/pass-explicit/77c661b2fbe3dd3a.js b/compiler/tests-js-parser/pass-explicit/77c661b2fbe3dd3a.js new file mode 100644 index 000000000..94937068a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/77c661b2fbe3dd3a.js @@ -0,0 +1,3 @@ +(a, b) => { + 1; +}; diff --git a/compiler/tests-js-parser/pass-explicit/77db52b103913973.js b/compiler/tests-js-parser/pass-explicit/77db52b103913973.js new file mode 100644 index 000000000..cecbe861b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/77db52b103913973.js @@ -0,0 +1 @@ +[a, ...(b = c)]; diff --git a/compiler/tests-js-parser/pass-explicit/78435241f6c87ece.js b/compiler/tests-js-parser/pass-explicit/78435241f6c87ece.js new file mode 100644 index 000000000..fbd255895 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/78435241f6c87ece.js @@ -0,0 +1 @@ +(123) + (1); diff --git a/compiler/tests-js-parser/pass-explicit/784a059faa166072.js b/compiler/tests-js-parser/pass-explicit/784a059faa166072.js new file mode 100644 index 000000000..466895011 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/784a059faa166072.js @@ -0,0 +1 @@ +(function a(b, b) {}); diff --git a/compiler/tests-js-parser/pass-explicit/784cbc06d5ade346.js b/compiler/tests-js-parser/pass-explicit/784cbc06d5ade346.js new file mode 100644 index 000000000..be182b7af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/784cbc06d5ade346.js @@ -0,0 +1 @@ +/[-a-b-]/; diff --git a/compiler/tests-js-parser/pass-explicit/7855fbf5ea10e622.js b/compiler/tests-js-parser/pass-explicit/7855fbf5ea10e622.js new file mode 100644 index 000000000..ae528f6de --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7855fbf5ea10e622.js @@ -0,0 +1 @@ +if (a) (function () {}); diff --git a/compiler/tests-js-parser/pass-explicit/787170711cb8abd6.js b/compiler/tests-js-parser/pass-explicit/787170711cb8abd6.js new file mode 100644 index 000000000..ea4308468 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/787170711cb8abd6.js @@ -0,0 +1 @@ +a(a); diff --git a/compiler/tests-js-parser/pass-explicit/789af9b27c832306.js b/compiler/tests-js-parser/pass-explicit/789af9b27c832306.js new file mode 100644 index 000000000..24209bcd9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/789af9b27c832306.js @@ -0,0 +1,4 @@ +; +; +; +; diff --git a/compiler/tests-js-parser/pass-explicit/78cf02220fb0937c.js b/compiler/tests-js-parser/pass-explicit/78cf02220fb0937c.js new file mode 100644 index 000000000..7ff75158a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/78cf02220fb0937c.js @@ -0,0 +1 @@ +[a, a, , ...a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/78e1b8a4f3318967.js b/compiler/tests-js-parser/pass-explicit/78e1b8a4f3318967.js new file mode 100644 index 000000000..9506b9f59 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/78e1b8a4f3318967.js @@ -0,0 +1 @@ +"\u{714E}\u{8336}"; diff --git a/compiler/tests-js-parser/pass-explicit/78ea6e4e98c18f91.js b/compiler/tests-js-parser/pass-explicit/78ea6e4e98c18f91.js new file mode 100644 index 000000000..0e35c7264 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/78ea6e4e98c18f91.js @@ -0,0 +1,2 @@ +function a() {} +/ 1 /; diff --git a/compiler/tests-js-parser/pass-explicit/78eb22badc114b6f.js b/compiler/tests-js-parser/pass-explicit/78eb22badc114b6f.js new file mode 100644 index 000000000..dde1bacae --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/78eb22badc114b6f.js @@ -0,0 +1,7 @@ +function a() { + try { + a(); + } catch (b) { + var c = (1); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/78ecd285b8b44e99.js b/compiler/tests-js-parser/pass-explicit/78ecd285b8b44e99.js new file mode 100644 index 000000000..acd81b7f2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/78ecd285b8b44e99.js @@ -0,0 +1 @@ +var {a} = ({}); diff --git a/compiler/tests-js-parser/pass-explicit/78fa04077cf1950c.js b/compiler/tests-js-parser/pass-explicit/78fa04077cf1950c.js new file mode 100644 index 000000000..f8c875592 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/78fa04077cf1950c.js @@ -0,0 +1 @@ +({set a ([{b = 1}]) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/790a34467d7d9d58.js b/compiler/tests-js-parser/pass-explicit/790a34467d7d9d58.js new file mode 100644 index 000000000..a0376a43f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/790a34467d7d9d58.js @@ -0,0 +1 @@ +function eval() {} diff --git a/compiler/tests-js-parser/pass-explicit/7912cf1671c75406.js b/compiler/tests-js-parser/pass-explicit/7912cf1671c75406.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7912cf1671c75406.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/791ee64772f0ea45.js b/compiler/tests-js-parser/pass-explicit/791ee64772f0ea45.js new file mode 100644 index 000000000..4220c23dd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/791ee64772f0ea45.js @@ -0,0 +1,3 @@ +function a() { + var b = (function c() {}); +} diff --git a/compiler/tests-js-parser/pass-explicit/7993945fc0f58feb.js b/compiler/tests-js-parser/pass-explicit/7993945fc0f58feb.js new file mode 100644 index 000000000..8d95a9f94 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7993945fc0f58feb.js @@ -0,0 +1,3 @@ +a => { + yield + a; +}; diff --git a/compiler/tests-js-parser/pass-explicit/799fad61dcd88f30.js b/compiler/tests-js-parser/pass-explicit/799fad61dcd88f30.js new file mode 100644 index 000000000..86593aff1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/799fad61dcd88f30.js @@ -0,0 +1 @@ +({a = 1} = (2)); diff --git a/compiler/tests-js-parser/pass-explicit/79a4d1fdd55febec.js b/compiler/tests-js-parser/pass-explicit/79a4d1fdd55febec.js new file mode 100644 index 000000000..584b01aa7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/79a4d1fdd55febec.js @@ -0,0 +1 @@ +var a = ((((!b) && ((!c) || d)) && ((!e) || f)) && (g())); diff --git a/compiler/tests-js-parser/pass-explicit/79b7f48e8a6d401c.js b/compiler/tests-js-parser/pass-explicit/79b7f48e8a6d401c.js new file mode 100644 index 000000000..f07d655f2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/79b7f48e8a6d401c.js @@ -0,0 +1 @@ +(a - b) - c; diff --git a/compiler/tests-js-parser/pass-explicit/79ea421b940c3474.js b/compiler/tests-js-parser/pass-explicit/79ea421b940c3474.js new file mode 100644 index 000000000..31b4a4111 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/79ea421b940c3474.js @@ -0,0 +1 @@ +a << b; diff --git a/compiler/tests-js-parser/pass-explicit/79f7d5d83decb768.js b/compiler/tests-js-parser/pass-explicit/79f7d5d83decb768.js new file mode 100644 index 000000000..3a2e4467b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/79f7d5d83decb768.js @@ -0,0 +1,8 @@ +((function () { + a: for (;;) { + for (;;) { + continue a; + b(); + } + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/7a405ea1fdb6a26e.js b/compiler/tests-js-parser/pass-explicit/7a405ea1fdb6a26e.js new file mode 100644 index 000000000..f1855e3a1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7a405ea1fdb6a26e.js @@ -0,0 +1,3 @@ +a: b: while (true) { + continue a; +} diff --git a/compiler/tests-js-parser/pass-explicit/7a71c5f849677cd1.js b/compiler/tests-js-parser/pass-explicit/7a71c5f849677cd1.js new file mode 100644 index 000000000..9db05d8c2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7a71c5f849677cd1.js @@ -0,0 +1 @@ +do a(); while (true); diff --git a/compiler/tests-js-parser/pass-explicit/7a815cb480c3cac2.js b/compiler/tests-js-parser/pass-explicit/7a815cb480c3cac2.js new file mode 100644 index 000000000..5646cdcf2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7a815cb480c3cac2.js @@ -0,0 +1 @@ +({} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/7a964712d5220b79.js b/compiler/tests-js-parser/pass-explicit/7a964712d5220b79.js new file mode 100644 index 000000000..59143c073 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7a964712d5220b79.js @@ -0,0 +1 @@ +eval = (1); diff --git a/compiler/tests-js-parser/pass-explicit/7ab6a1dd47c6bc1f.js b/compiler/tests-js-parser/pass-explicit/7ab6a1dd47c6bc1f.js new file mode 100644 index 000000000..fdd05f97b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7ab6a1dd47c6bc1f.js @@ -0,0 +1 @@ ++a; diff --git a/compiler/tests-js-parser/pass-explicit/7ac0063e99bc8720.js b/compiler/tests-js-parser/pass-explicit/7ac0063e99bc8720.js new file mode 100644 index 000000000..478754e59 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7ac0063e99bc8720.js @@ -0,0 +1 @@ +for (var a of b) c(a); diff --git a/compiler/tests-js-parser/pass-explicit/7ae57d0c2d30db3a.js b/compiler/tests-js-parser/pass-explicit/7ae57d0c2d30db3a.js new file mode 100644 index 000000000..1172e7bfc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7ae57d0c2d30db3a.js @@ -0,0 +1 @@ +a >> b; diff --git a/compiler/tests-js-parser/pass-explicit/7afd38d79e6795a8.js b/compiler/tests-js-parser/pass-explicit/7afd38d79e6795a8.js new file mode 100644 index 000000000..f45c79255 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7afd38d79e6795a8.js @@ -0,0 +1,5 @@ +((function () { + void (1); + "not a directive"; + a(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/7b0a9215ec756496.js b/compiler/tests-js-parser/pass-explicit/7b0a9215ec756496.js new file mode 100644 index 000000000..4989e81d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7b0a9215ec756496.js @@ -0,0 +1,4 @@ +{ + throw a; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/7b514406528ff126.js b/compiler/tests-js-parser/pass-explicit/7b514406528ff126.js new file mode 100644 index 000000000..b5be987bc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7b514406528ff126.js @@ -0,0 +1 @@ +"Hello\02World"; diff --git a/compiler/tests-js-parser/pass-explicit/7b71bc250036251c.js b/compiler/tests-js-parser/pass-explicit/7b71bc250036251c.js new file mode 100644 index 000000000..06dbdba2c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7b71bc250036251c.js @@ -0,0 +1 @@ +do continue; while (1); diff --git a/compiler/tests-js-parser/pass-explicit/7b72d7b43bedc895.js b/compiler/tests-js-parser/pass-explicit/7b72d7b43bedc895.js new file mode 100644 index 000000000..73716b24d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7b72d7b43bedc895.js @@ -0,0 +1,2 @@ +"use strict"; +var a = ({10: 1, 0: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/7b8a8232be18df90.js b/compiler/tests-js-parser/pass-explicit/7b8a8232be18df90.js new file mode 100644 index 000000000..6029008eb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7b8a8232be18df90.js @@ -0,0 +1,5 @@ +((function () { + if (true) { + a(); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/7bc8dc445fc0f1c3.js b/compiler/tests-js-parser/pass-explicit/7bc8dc445fc0f1c3.js new file mode 100644 index 000000000..2f114aecf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7bc8dc445fc0f1c3.js @@ -0,0 +1,3 @@ +for (;;) { + continue; +} diff --git a/compiler/tests-js-parser/pass-explicit/7bdcce70c382a9a4.js b/compiler/tests-js-parser/pass-explicit/7bdcce70c382a9a4.js new file mode 100644 index 000000000..dd8923d39 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7bdcce70c382a9a4.js @@ -0,0 +1,4 @@ +((function () { + var a = ({}); + (a.b) + (((c()), (d())), (e())); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/7be9be4918d25634.js b/compiler/tests-js-parser/pass-explicit/7be9be4918d25634.js new file mode 100644 index 000000000..139d2f815 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7be9be4918d25634.js @@ -0,0 +1 @@ +--arguments; diff --git a/compiler/tests-js-parser/pass-explicit/7c027cdbc7f493b2.js b/compiler/tests-js-parser/pass-explicit/7c027cdbc7f493b2.js new file mode 100644 index 000000000..4e6dbf972 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7c027cdbc7f493b2.js @@ -0,0 +1 @@ +var a = (/[a-z]/y); diff --git a/compiler/tests-js-parser/pass-explicit/7c03e5eb6a9f6f1a.js b/compiler/tests-js-parser/pass-explicit/7c03e5eb6a9f6f1a.js new file mode 100644 index 000000000..0af3cd9bd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7c03e5eb6a9f6f1a.js @@ -0,0 +1,4 @@ +function a() { + "use strict"; + "\0"; +} diff --git a/compiler/tests-js-parser/pass-explicit/7c3fc6d2a783ecd9.js b/compiler/tests-js-parser/pass-explicit/7c3fc6d2a783ecd9.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7c3fc6d2a783ecd9.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/7c46ecc8f111b567.js b/compiler/tests-js-parser/pass-explicit/7c46ecc8f111b567.js new file mode 100644 index 000000000..9db05d8c2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7c46ecc8f111b567.js @@ -0,0 +1 @@ +do a(); while (true); diff --git a/compiler/tests-js-parser/pass-explicit/7c508ad20a5ecbce.js b/compiler/tests-js-parser/pass-explicit/7c508ad20a5ecbce.js new file mode 100644 index 000000000..8c5ebd972 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7c508ad20a5ecbce.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + ({d: super[e]} = f); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/7c6d13458e08e1f4.js b/compiler/tests-js-parser/pass-explicit/7c6d13458e08e1f4.js new file mode 100644 index 000000000..197d5946e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7c6d13458e08e1f4.js @@ -0,0 +1 @@ +(1).a; diff --git a/compiler/tests-js-parser/pass-explicit/7c9c0cce695bc705.js b/compiler/tests-js-parser/pass-explicit/7c9c0cce695bc705.js new file mode 100644 index 000000000..942592f7d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7c9c0cce695bc705.js @@ -0,0 +1,9 @@ +((function () { + a(); + function a() { + (b.c)("d"); + } + function a() { + (b.c)("e"); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/7cbf77c14b9c89bc.js b/compiler/tests-js-parser/pass-explicit/7cbf77c14b9c89bc.js new file mode 100644 index 000000000..6776227a6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7cbf77c14b9c89bc.js @@ -0,0 +1,3 @@ +function a(b, c) { + return (b--) > c; +} diff --git a/compiler/tests-js-parser/pass-explicit/7cd7c68a6131f816.js b/compiler/tests-js-parser/pass-explicit/7cd7c68a6131f816.js new file mode 100644 index 000000000..0412eba36 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7cd7c68a6131f816.js @@ -0,0 +1,3 @@ +a = ({set true (b) { + c = b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/7d029e0be60dc821.module.js b/compiler/tests-js-parser/pass-explicit/7d029e0be60dc821.module.js new file mode 100644 index 000000000..e604fae78 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7d029e0be60dc821.module.js @@ -0,0 +1 @@ +import a from "b"; diff --git a/compiler/tests-js-parser/pass-explicit/7d7dd05015778d56.js b/compiler/tests-js-parser/pass-explicit/7d7dd05015778d56.js new file mode 100644 index 000000000..37a132de7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7d7dd05015778d56.js @@ -0,0 +1 @@ +(a, b) => ((1) + (2)); diff --git a/compiler/tests-js-parser/pass-explicit/7d8b61ba2a3a275c.js b/compiler/tests-js-parser/pass-explicit/7d8b61ba2a3a275c.js new file mode 100644 index 000000000..b6b78d6ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7d8b61ba2a3a275c.js @@ -0,0 +1,3 @@ +with (a) ((function () { + b("c"); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/7da12349ac9f51f2.js b/compiler/tests-js-parser/pass-explicit/7da12349ac9f51f2.js new file mode 100644 index 000000000..ad95819c5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7da12349ac9f51f2.js @@ -0,0 +1 @@ +((a, b), (c && d)) && e; diff --git a/compiler/tests-js-parser/pass-explicit/7dab6e55461806c9.js b/compiler/tests-js-parser/pass-explicit/7dab6e55461806c9.js new file mode 100644 index 000000000..a764d8aab --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7dab6e55461806c9.js @@ -0,0 +1,3 @@ +function* a() { + yield (~(0)); +} diff --git a/compiler/tests-js-parser/pass-explicit/7dde401422530d6b.js b/compiler/tests-js-parser/pass-explicit/7dde401422530d6b.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/7dea677261fc5dd8.module.js b/compiler/tests-js-parser/pass-explicit/7dea677261fc5dd8.module.js new file mode 100644 index 000000000..14bbc7729 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7dea677261fc5dd8.module.js @@ -0,0 +1 @@ +export var a = (function () {}); diff --git a/compiler/tests-js-parser/pass-explicit/7df2a606ecc6cd84.js b/compiler/tests-js-parser/pass-explicit/7df2a606ecc6cd84.js new file mode 100644 index 000000000..1e1010fe8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7df2a606ecc6cd84.js @@ -0,0 +1,4 @@ +(function () { + return; + a; +}); diff --git a/compiler/tests-js-parser/pass-explicit/7dfb625b91c5c879.js b/compiler/tests-js-parser/pass-explicit/7dfb625b91c5c879.js new file mode 100644 index 000000000..a0b5d81ea --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7dfb625b91c5c879.js @@ -0,0 +1,4 @@ +(function a() { + "use strict"; + return 1; +}); diff --git a/compiler/tests-js-parser/pass-explicit/7e094109208fc749.js b/compiler/tests-js-parser/pass-explicit/7e094109208fc749.js new file mode 100644 index 000000000..31a1c0f27 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e094109208fc749.js @@ -0,0 +1 @@ +/[a-z]/g; diff --git a/compiler/tests-js-parser/pass-explicit/7e28d9664deeef8a.js b/compiler/tests-js-parser/pass-explicit/7e28d9664deeef8a.js new file mode 100644 index 000000000..db6c75377 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e28d9664deeef8a.js @@ -0,0 +1 @@ +[{a = b} = (1)]; diff --git a/compiler/tests-js-parser/pass-explicit/7e50a0527f791c52.js b/compiler/tests-js-parser/pass-explicit/7e50a0527f791c52.js new file mode 100644 index 000000000..648a719ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e50a0527f791c52.js @@ -0,0 +1 @@ +2e308; diff --git a/compiler/tests-js-parser/pass-explicit/7e6e3b4c766a4d33.js b/compiler/tests-js-parser/pass-explicit/7e6e3b4c766a4d33.js new file mode 100644 index 000000000..944c7c669 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e6e3b4c766a4d33.js @@ -0,0 +1 @@ +(a = (b("100"))) <= a; diff --git a/compiler/tests-js-parser/pass-explicit/7e6eac5fdc429608.js b/compiler/tests-js-parser/pass-explicit/7e6eac5fdc429608.js new file mode 100644 index 000000000..c91400fff --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e6eac5fdc429608.js @@ -0,0 +1 @@ +for (a; a < (1);) ; diff --git a/compiler/tests-js-parser/pass-explicit/7e88047a36603238.js b/compiler/tests-js-parser/pass-explicit/7e88047a36603238.js new file mode 100644 index 000000000..08961a442 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e88047a36603238.js @@ -0,0 +1 @@ +a != b; diff --git a/compiler/tests-js-parser/pass-explicit/7e8f17e7be305a2a.js b/compiler/tests-js-parser/pass-explicit/7e8f17e7be305a2a.js new file mode 100644 index 000000000..d0bfb2b5f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e8f17e7be305a2a.js @@ -0,0 +1 @@ +var [a = b] = (c); diff --git a/compiler/tests-js-parser/pass-explicit/7e99cc8b7ce365fb.js b/compiler/tests-js-parser/pass-explicit/7e99cc8b7ce365fb.js new file mode 100644 index 000000000..5a22fa8e7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7e99cc8b7ce365fb.js @@ -0,0 +1,4 @@ +var a = ({}); +a.b = (1); +a.c = (2); +(d.e)(a.b); diff --git a/compiler/tests-js-parser/pass-explicit/7ebaa39b4a9b5b5b.js b/compiler/tests-js-parser/pass-explicit/7ebaa39b4a9b5b5b.js new file mode 100644 index 000000000..3d135f8a3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7ebaa39b4a9b5b5b.js @@ -0,0 +1,2 @@ +var a, b, c, d; +a = (!(((b()), (c())), (d()))); diff --git a/compiler/tests-js-parser/pass-explicit/7f4c40906c3ebe2b.js b/compiler/tests-js-parser/pass-explicit/7f4c40906c3ebe2b.js new file mode 100644 index 000000000..cfda47463 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7f4c40906c3ebe2b.js @@ -0,0 +1 @@ +var {a} = (1); diff --git a/compiler/tests-js-parser/pass-explicit/7f88f149f16fe97a.js b/compiler/tests-js-parser/pass-explicit/7f88f149f16fe97a.js new file mode 100644 index 000000000..b57abf20e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7f88f149f16fe97a.js @@ -0,0 +1 @@ +var a = ({arguments: 1, eval: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/7fac17daa2bd5186.js b/compiler/tests-js-parser/pass-explicit/7fac17daa2bd5186.js new file mode 100644 index 000000000..502562f3d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7fac17daa2bd5186.js @@ -0,0 +1 @@ +for (a = (1); a < (2);) ; diff --git a/compiler/tests-js-parser/pass-explicit/7fbe94acda67721e.js b/compiler/tests-js-parser/pass-explicit/7fbe94acda67721e.js new file mode 100644 index 000000000..a9f73cd97 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7fbe94acda67721e.js @@ -0,0 +1 @@ +({*yield() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/7fdf990c6f42edcd.module.js b/compiler/tests-js-parser/pass-explicit/7fdf990c6f42edcd.module.js new file mode 100644 index 000000000..2643c1074 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7fdf990c6f42edcd.module.js @@ -0,0 +1 @@ +export * from "a"; diff --git a/compiler/tests-js-parser/pass-explicit/7fe89d8edf6e778a.js b/compiler/tests-js-parser/pass-explicit/7fe89d8edf6e778a.js new file mode 100644 index 000000000..0a8efb4d5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/7fe89d8edf6e778a.js @@ -0,0 +1 @@ +"a\u0026b"; diff --git a/compiler/tests-js-parser/pass-explicit/801ac33e4c34efb8.js b/compiler/tests-js-parser/pass-explicit/801ac33e4c34efb8.js new file mode 100644 index 000000000..38eb94231 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/801ac33e4c34efb8.js @@ -0,0 +1 @@ +({false: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/802658d6ef9a83ec.js b/compiler/tests-js-parser/pass-explicit/802658d6ef9a83ec.js new file mode 100644 index 000000000..5d75b93dc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/802658d6ef9a83ec.js @@ -0,0 +1 @@ +({["__proto__"]: 1, __proto__: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/804e022cd08b4ae1.js b/compiler/tests-js-parser/pass-explicit/804e022cd08b4ae1.js new file mode 100644 index 000000000..e70785168 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/804e022cd08b4ae1.js @@ -0,0 +1 @@ +[a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/807dfc91f4ed4394.js b/compiler/tests-js-parser/pass-explicit/807dfc91f4ed4394.js new file mode 100644 index 000000000..abb62133e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/807dfc91f4ed4394.js @@ -0,0 +1,3 @@ +function* a() { + yield (2e308); +} diff --git a/compiler/tests-js-parser/pass-explicit/80950061e291542b.js b/compiler/tests-js-parser/pass-explicit/80950061e291542b.js new file mode 100644 index 000000000..38f16500c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/80950061e291542b.js @@ -0,0 +1,3 @@ +(function () { + return a * b; +}); diff --git a/compiler/tests-js-parser/pass-explicit/80c6bda5cad0fbc5.js b/compiler/tests-js-parser/pass-explicit/80c6bda5cad0fbc5.js new file mode 100644 index 000000000..2771d2653 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/80c6bda5cad0fbc5.js @@ -0,0 +1 @@ +var a, [a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/80d2351a5ae68524.js b/compiler/tests-js-parser/pass-explicit/80d2351a5ae68524.js new file mode 100644 index 000000000..c6186030b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/80d2351a5ae68524.js @@ -0,0 +1 @@ +a = ({set b (c) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/80f60039028189e4.js b/compiler/tests-js-parser/pass-explicit/80f60039028189e4.js new file mode 100644 index 000000000..2df046e95 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/80f60039028189e4.js @@ -0,0 +1 @@ +a(0); diff --git a/compiler/tests-js-parser/pass-explicit/811b309b010a36ce.js b/compiler/tests-js-parser/pass-explicit/811b309b010a36ce.js new file mode 100644 index 000000000..fe1301b5d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/811b309b010a36ce.js @@ -0,0 +1 @@ +({[(1) * (2)]: 3}); diff --git a/compiler/tests-js-parser/pass-explicit/8152f05423c90f61.js b/compiler/tests-js-parser/pass-explicit/8152f05423c90f61.js new file mode 100644 index 000000000..cf168c046 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8152f05423c90f61.js @@ -0,0 +1 @@ +a >>>= (1); diff --git a/compiler/tests-js-parser/pass-explicit/8179659ef4fd0965.js b/compiler/tests-js-parser/pass-explicit/8179659ef4fd0965.js new file mode 100644 index 000000000..e70f77a4b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8179659ef4fd0965.js @@ -0,0 +1 @@ +({a: b} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/818ea8eaeef8b3da.js b/compiler/tests-js-parser/pass-explicit/818ea8eaeef8b3da.js new file mode 100644 index 000000000..71742a1af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/818ea8eaeef8b3da.js @@ -0,0 +1 @@ +(let[let]); diff --git a/compiler/tests-js-parser/pass-explicit/81a0322e554af8da.js b/compiler/tests-js-parser/pass-explicit/81a0322e554af8da.js new file mode 100644 index 000000000..cc6e684f0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/81a0322e554af8da.js @@ -0,0 +1,3 @@ +((function () { + a((typeof b) === ("c")); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/81a6472df96f185f.js b/compiler/tests-js-parser/pass-explicit/81a6472df96f185f.js new file mode 100644 index 000000000..8f565d427 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/81a6472df96f185f.js @@ -0,0 +1 @@ +a = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/81b986948b58ffda.js b/compiler/tests-js-parser/pass-explicit/81b986948b58ffda.js new file mode 100644 index 000000000..645efdb1c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/81b986948b58ffda.js @@ -0,0 +1,5 @@ +((function () { + while ((!a) || (b())) { + c(); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/81be1572d1eebdf2.js b/compiler/tests-js-parser/pass-explicit/81be1572d1eebdf2.js new file mode 100644 index 000000000..181b260d4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/81be1572d1eebdf2.js @@ -0,0 +1 @@ +a = ({b(c = 1) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/81be47a15713178e.js b/compiler/tests-js-parser/pass-explicit/81be47a15713178e.js new file mode 100644 index 000000000..b7dbde399 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/81be47a15713178e.js @@ -0,0 +1 @@ +(a + b) + c; diff --git a/compiler/tests-js-parser/pass-explicit/820521ef532dce18.js b/compiler/tests-js-parser/pass-explicit/820521ef532dce18.js new file mode 100644 index 000000000..4f37e1828 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/820521ef532dce18.js @@ -0,0 +1 @@ +function a([b] = [1]) {} diff --git a/compiler/tests-js-parser/pass-explicit/8286caaa8e0196bb.js b/compiler/tests-js-parser/pass-explicit/8286caaa8e0196bb.js new file mode 100644 index 000000000..60e932ce6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8286caaa8e0196bb.js @@ -0,0 +1,3 @@ +{ + function a() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/8290412f79ac2bb6.js b/compiler/tests-js-parser/pass-explicit/8290412f79ac2bb6.js new file mode 100644 index 000000000..5ab15a7a7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8290412f79ac2bb6.js @@ -0,0 +1 @@ +/a/; diff --git a/compiler/tests-js-parser/pass-explicit/82a730bd109206bb.js b/compiler/tests-js-parser/pass-explicit/82a730bd109206bb.js new file mode 100644 index 000000000..7b729b100 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/82a730bd109206bb.js @@ -0,0 +1 @@ +ⅣⅡ = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/82c827ccaecbe22b.js b/compiler/tests-js-parser/pass-explicit/82c827ccaecbe22b.js new file mode 100644 index 000000000..647827e78 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/82c827ccaecbe22b.js @@ -0,0 +1 @@ +[a = (b = c)] = (0); diff --git a/compiler/tests-js-parser/pass-explicit/832ad002639ce202.js b/compiler/tests-js-parser/pass-explicit/832ad002639ce202.js new file mode 100644 index 000000000..8c4d3cd72 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/832ad002639ce202.js @@ -0,0 +1 @@ +const a = (1), b = (2), c = (3); diff --git a/compiler/tests-js-parser/pass-explicit/8340cdb8653046bb.js b/compiler/tests-js-parser/pass-explicit/8340cdb8653046bb.js new file mode 100644 index 000000000..2d2c48a6a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8340cdb8653046bb.js @@ -0,0 +1 @@ +for (var [a, b] in c) {} diff --git a/compiler/tests-js-parser/pass-explicit/836158118a07b45d.js b/compiler/tests-js-parser/pass-explicit/836158118a07b45d.js new file mode 100644 index 000000000..57d36b471 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/836158118a07b45d.js @@ -0,0 +1 @@ +var {a, b: {c: a}} = (1); diff --git a/compiler/tests-js-parser/pass-explicit/8386fbff927a9e0e.js b/compiler/tests-js-parser/pass-explicit/8386fbff927a9e0e.js new file mode 100644 index 000000000..e311b5263 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8386fbff927a9e0e.js @@ -0,0 +1 @@ +1e30; diff --git a/compiler/tests-js-parser/pass-explicit/838d87085df03a6d.js b/compiler/tests-js-parser/pass-explicit/838d87085df03a6d.js new file mode 100644 index 000000000..8aac4522e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/838d87085df03a6d.js @@ -0,0 +1 @@ +"Hello\nworld"; diff --git a/compiler/tests-js-parser/pass-explicit/83cea3f2e14d1e23.js b/compiler/tests-js-parser/pass-explicit/83cea3f2e14d1e23.js new file mode 100644 index 000000000..7afb8b621 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/83cea3f2e14d1e23.js @@ -0,0 +1 @@ +(class a extends (1) {}); diff --git a/compiler/tests-js-parser/pass-explicit/83f083525ae5a0e0.js b/compiler/tests-js-parser/pass-explicit/83f083525ae5a0e0.js new file mode 100644 index 000000000..8f6bcc424 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/83f083525ae5a0e0.js @@ -0,0 +1,5 @@ +((function () { + if (!(!a)) { + b(); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/83fc5b5bbdb601ef.js b/compiler/tests-js-parser/pass-explicit/83fc5b5bbdb601ef.js new file mode 100644 index 000000000..912808f3a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/83fc5b5bbdb601ef.js @@ -0,0 +1,5 @@ +((function () { + function a() {} + function b() {} + function c() {} +})()); diff --git a/compiler/tests-js-parser/pass-explicit/8411f3c15e3e8529.js b/compiler/tests-js-parser/pass-explicit/8411f3c15e3e8529.js new file mode 100644 index 000000000..f4b05493c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8411f3c15e3e8529.js @@ -0,0 +1,4 @@ +{ + {} + /foo/; +} diff --git a/compiler/tests-js-parser/pass-explicit/84250e15785d8a9e.js b/compiler/tests-js-parser/pass-explicit/84250e15785d8a9e.js new file mode 100644 index 000000000..dbee76070 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/84250e15785d8a9e.js @@ -0,0 +1,3 @@ +({set true (a) { + a; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/842fe071562c1a9e.js b/compiler/tests-js-parser/pass-explicit/842fe071562c1a9e.js new file mode 100644 index 000000000..1bfa25893 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/842fe071562c1a9e.js @@ -0,0 +1,3 @@ +function* a() { + yield; +} diff --git a/compiler/tests-js-parser/pass-explicit/845368e466d341f5.js b/compiler/tests-js-parser/pass-explicit/845368e466d341f5.js new file mode 100644 index 000000000..aa8b6cf89 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/845368e466d341f5.js @@ -0,0 +1 @@ +[{a, b}, ...c] = d; diff --git a/compiler/tests-js-parser/pass-explicit/845631d1a33b3409.js b/compiler/tests-js-parser/pass-explicit/845631d1a33b3409.js new file mode 100644 index 000000000..b9badbed7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/845631d1a33b3409.js @@ -0,0 +1,4 @@ +class a { + b() {} + get b() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/845e30448809e2bc.js b/compiler/tests-js-parser/pass-explicit/845e30448809e2bc.js new file mode 100644 index 000000000..19531e93e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/845e30448809e2bc.js @@ -0,0 +1 @@ +(a.b).c; diff --git a/compiler/tests-js-parser/pass-explicit/8462f068b299bca2.js b/compiler/tests-js-parser/pass-explicit/8462f068b299bca2.js new file mode 100644 index 000000000..cd4acdb58 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8462f068b299bca2.js @@ -0,0 +1 @@ +var {let, yield} = (1); diff --git a/compiler/tests-js-parser/pass-explicit/849e112b480fda30.js b/compiler/tests-js-parser/pass-explicit/849e112b480fda30.js new file mode 100644 index 000000000..36534620e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/849e112b480fda30.js @@ -0,0 +1 @@ +void a; diff --git a/compiler/tests-js-parser/pass-explicit/84b2a5d834daee2f.js b/compiler/tests-js-parser/pass-explicit/84b2a5d834daee2f.js new file mode 100644 index 000000000..187cb3e3e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/84b2a5d834daee2f.js @@ -0,0 +1 @@ +10; diff --git a/compiler/tests-js-parser/pass-explicit/84eaae502ca93891.js b/compiler/tests-js-parser/pass-explicit/84eaae502ca93891.js new file mode 100644 index 000000000..878ba8dfa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/84eaae502ca93891.js @@ -0,0 +1,5 @@ +class a { + b() { + new (super.c); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/84f901eb37273117.js b/compiler/tests-js-parser/pass-explicit/84f901eb37273117.js new file mode 100644 index 000000000..31c4a8b66 Binary files /dev/null and b/compiler/tests-js-parser/pass-explicit/84f901eb37273117.js differ diff --git a/compiler/tests-js-parser/pass-explicit/850a60daa178d3b6.js b/compiler/tests-js-parser/pass-explicit/850a60daa178d3b6.js new file mode 100644 index 000000000..d60fb1a75 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/850a60daa178d3b6.js @@ -0,0 +1 @@ +() => ((1) + (2)); diff --git a/compiler/tests-js-parser/pass-explicit/85263ecacc7a4dc5.js b/compiler/tests-js-parser/pass-explicit/85263ecacc7a4dc5.js new file mode 100644 index 000000000..dd1e61090 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/85263ecacc7a4dc5.js @@ -0,0 +1,4 @@ +(function () { + "use strict"; + function a() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/8543b43f3c48c975.module.js b/compiler/tests-js-parser/pass-explicit/8543b43f3c48c975.module.js new file mode 100644 index 000000000..9c7e04e84 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8543b43f3c48c975.module.js @@ -0,0 +1 @@ +export {default} from "a"; diff --git a/compiler/tests-js-parser/pass-explicit/855b8dea36c841ed.js b/compiler/tests-js-parser/pass-explicit/855b8dea36c841ed.js new file mode 100644 index 000000000..22dd98188 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/855b8dea36c841ed.js @@ -0,0 +1,4 @@ +((function () { + "use\x20strict"; + with (a) ; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/858d6a756ff641f3.js b/compiler/tests-js-parser/pass-explicit/858d6a756ff641f3.js new file mode 100644 index 000000000..193273db3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/858d6a756ff641f3.js @@ -0,0 +1,3 @@ +function a(b) { + c(); +} diff --git a/compiler/tests-js-parser/pass-explicit/8597768c0fe519eb.js b/compiler/tests-js-parser/pass-explicit/8597768c0fe519eb.js new file mode 100644 index 000000000..bdf36ccee --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8597768c0fe519eb.js @@ -0,0 +1 @@ +`${a}$`; diff --git a/compiler/tests-js-parser/pass-explicit/85d2d93264f2672d.module.js b/compiler/tests-js-parser/pass-explicit/85d2d93264f2672d.module.js new file mode 100644 index 000000000..ddcbace8f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/85d2d93264f2672d.module.js @@ -0,0 +1 @@ +import a, {b} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/85d6723f13f33101.js b/compiler/tests-js-parser/pass-explicit/85d6723f13f33101.js new file mode 100644 index 000000000..e70f77a4b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/85d6723f13f33101.js @@ -0,0 +1 @@ +({a: b} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/85e4314fa8f0661f.js b/compiler/tests-js-parser/pass-explicit/85e4314fa8f0661f.js new file mode 100644 index 000000000..6d11657a2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/85e4314fa8f0661f.js @@ -0,0 +1 @@ +a(b, ...(c = d)); diff --git a/compiler/tests-js-parser/pass-explicit/8628cd459b39ffe8.js b/compiler/tests-js-parser/pass-explicit/8628cd459b39ffe8.js new file mode 100644 index 000000000..8db91f229 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8628cd459b39ffe8.js @@ -0,0 +1 @@ +try {} catch ([a = 1]) {} diff --git a/compiler/tests-js-parser/pass-explicit/8664d1a4e7a73078.js b/compiler/tests-js-parser/pass-explicit/8664d1a4e7a73078.js new file mode 100644 index 000000000..f754ed5ef --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8664d1a4e7a73078.js @@ -0,0 +1 @@ +function a({[b]: c}) {} diff --git a/compiler/tests-js-parser/pass-explicit/86a25a2a0e393ed6.js b/compiler/tests-js-parser/pass-explicit/86a25a2a0e393ed6.js new file mode 100644 index 000000000..00ebbb19d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/86a25a2a0e393ed6.js @@ -0,0 +1,5 @@ +switch (a) { + case 1: + let b = (2); + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/86b0ffc811e713ec.js b/compiler/tests-js-parser/pass-explicit/86b0ffc811e713ec.js new file mode 100644 index 000000000..72156b0a6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/86b0ffc811e713ec.js @@ -0,0 +1 @@ +({__proto__: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/86d8f1465e745b44.js b/compiler/tests-js-parser/pass-explicit/86d8f1465e745b44.js new file mode 100644 index 000000000..af1479ea3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/86d8f1465e745b44.js @@ -0,0 +1 @@ +[a[b] = b] = c; diff --git a/compiler/tests-js-parser/pass-explicit/86f68610fcefaeae.js b/compiler/tests-js-parser/pass-explicit/86f68610fcefaeae.js new file mode 100644 index 000000000..9b63319e5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/86f68610fcefaeae.js @@ -0,0 +1,4 @@ +class a { + b() {} + static c() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/870a0b8d891753e9.js b/compiler/tests-js-parser/pass-explicit/870a0b8d891753e9.js new file mode 100644 index 000000000..a62733fc0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/870a0b8d891753e9.js @@ -0,0 +1 @@ +(function (a, ...b) {}); diff --git a/compiler/tests-js-parser/pass-explicit/8751eb24f903c279.js b/compiler/tests-js-parser/pass-explicit/8751eb24f903c279.js new file mode 100644 index 000000000..5913de950 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8751eb24f903c279.js @@ -0,0 +1 @@ +var a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/87844be2334fba9e.js b/compiler/tests-js-parser/pass-explicit/87844be2334fba9e.js new file mode 100644 index 000000000..c2d980866 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/87844be2334fba9e.js @@ -0,0 +1,3 @@ +function a() { + ("use strict") + (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/87a9b0d1d80812cc.js b/compiler/tests-js-parser/pass-explicit/87a9b0d1d80812cc.js new file mode 100644 index 000000000..da1287082 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/87a9b0d1d80812cc.js @@ -0,0 +1,3 @@ +((function () { + a(((b()), (1)), (2)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/87cb789c4ed2b97a.js b/compiler/tests-js-parser/pass-explicit/87cb789c4ed2b97a.js new file mode 100644 index 000000000..b6ba29467 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/87cb789c4ed2b97a.js @@ -0,0 +1,3 @@ +a: while (true) { + continue a; +} diff --git a/compiler/tests-js-parser/pass-explicit/87e1d3eab9d05339.js b/compiler/tests-js-parser/pass-explicit/87e1d3eab9d05339.js new file mode 100644 index 000000000..db851a3af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/87e1d3eab9d05339.js @@ -0,0 +1 @@ +while (a()) b(); diff --git a/compiler/tests-js-parser/pass-explicit/88127d108648d05b.js b/compiler/tests-js-parser/pass-explicit/88127d108648d05b.js new file mode 100644 index 000000000..166a9bfa8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/88127d108648d05b.js @@ -0,0 +1,4 @@ +while (true) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/881a7a3d4e17e621.js b/compiler/tests-js-parser/pass-explicit/881a7a3d4e17e621.js new file mode 100644 index 000000000..5290b4434 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/881a7a3d4e17e621.js @@ -0,0 +1,9 @@ +function a(b, c) { + var d = (function () { + return e(); + }); + var e = (function () { + return d(); + }); + return b + c; +} diff --git a/compiler/tests-js-parser/pass-explicit/882910de7dd1aef9.js b/compiler/tests-js-parser/pass-explicit/882910de7dd1aef9.js new file mode 100644 index 000000000..31142aabf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/882910de7dd1aef9.js @@ -0,0 +1 @@ +a; diff --git a/compiler/tests-js-parser/pass-explicit/884e5c2703ce95f3.js b/compiler/tests-js-parser/pass-explicit/884e5c2703ce95f3.js new file mode 100644 index 000000000..6d275ceaf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/884e5c2703ce95f3.js @@ -0,0 +1,3 @@ +({*a() { + super.b = (1); +}}); diff --git a/compiler/tests-js-parser/pass-explicit/8854cac4acddd510.js b/compiler/tests-js-parser/pass-explicit/8854cac4acddd510.js new file mode 100644 index 000000000..b7dd05c3e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8854cac4acddd510.js @@ -0,0 +1 @@ +(null) && (a += (null)); diff --git a/compiler/tests-js-parser/pass-explicit/88561e211e862344.js b/compiler/tests-js-parser/pass-explicit/88561e211e862344.js new file mode 100644 index 000000000..ff464d15b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/88561e211e862344.js @@ -0,0 +1 @@ +null; diff --git a/compiler/tests-js-parser/pass-explicit/88827d8021b5b3ab.js b/compiler/tests-js-parser/pass-explicit/88827d8021b5b3ab.js new file mode 100644 index 000000000..f42d8a45f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/88827d8021b5b3ab.js @@ -0,0 +1 @@ +new a("aa, bb", "return aa;"); diff --git a/compiler/tests-js-parser/pass-explicit/88af07b3dc006159.js b/compiler/tests-js-parser/pass-explicit/88af07b3dc006159.js new file mode 100644 index 000000000..6d0211170 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/88af07b3dc006159.js @@ -0,0 +1 @@ +a | (b ^ c); diff --git a/compiler/tests-js-parser/pass-explicit/88c21621e3e8bba0.js b/compiler/tests-js-parser/pass-explicit/88c21621e3e8bba0.js new file mode 100644 index 000000000..a1a575c76 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/88c21621e3e8bba0.js @@ -0,0 +1 @@ +("a"); diff --git a/compiler/tests-js-parser/pass-explicit/88d42455ac933ef5.js b/compiler/tests-js-parser/pass-explicit/88d42455ac933ef5.js new file mode 100644 index 000000000..93ab24127 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/88d42455ac933ef5.js @@ -0,0 +1,4 @@ +class a { + static constructor() {} + static constructor() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/88e99d6cd8e8d87f.js b/compiler/tests-js-parser/pass-explicit/88e99d6cd8e8d87f.js new file mode 100644 index 000000000..4df46943d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/88e99d6cd8e8d87f.js @@ -0,0 +1 @@ +function* a() {} diff --git a/compiler/tests-js-parser/pass-explicit/891fc3470b618587.js b/compiler/tests-js-parser/pass-explicit/891fc3470b618587.js new file mode 100644 index 000000000..9883dc521 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/891fc3470b618587.js @@ -0,0 +1 @@ +a((b, c) => {}); diff --git a/compiler/tests-js-parser/pass-explicit/892f6e09c02c35b5.js b/compiler/tests-js-parser/pass-explicit/892f6e09c02c35b5.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/892f6e09c02c35b5.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/8996d3eb07c6f7cd.js b/compiler/tests-js-parser/pass-explicit/8996d3eb07c6f7cd.js new file mode 100644 index 000000000..0f065674c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8996d3eb07c6f7cd.js @@ -0,0 +1 @@ +for (let a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/89a31837e6736b2a.js b/compiler/tests-js-parser/pass-explicit/89a31837e6736b2a.js new file mode 100644 index 000000000..7d577451c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/89a31837e6736b2a.js @@ -0,0 +1,3 @@ +{ + a: 1; +} diff --git a/compiler/tests-js-parser/pass-explicit/89c872e56d527908.js b/compiler/tests-js-parser/pass-explicit/89c872e56d527908.js new file mode 100644 index 000000000..67356ccfe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/89c872e56d527908.js @@ -0,0 +1 @@ +(1) + (2); diff --git a/compiler/tests-js-parser/pass-explicit/8a0fc8ea31727188.module.js b/compiler/tests-js-parser/pass-explicit/8a0fc8ea31727188.module.js new file mode 100644 index 000000000..9ec8f63ab --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8a0fc8ea31727188.module.js @@ -0,0 +1 @@ +export * from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/8a40542f1f53c4f0.js b/compiler/tests-js-parser/pass-explicit/8a40542f1f53c4f0.js new file mode 100644 index 000000000..0b7cb2835 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8a40542f1f53c4f0.js @@ -0,0 +1 @@ +for (const a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/8aa3cd2609b4f278.js b/compiler/tests-js-parser/pass-explicit/8aa3cd2609b4f278.js new file mode 100644 index 000000000..19550514d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8aa3cd2609b4f278.js @@ -0,0 +1 @@ +a = ({b: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/8ad4edbe9317df28.js b/compiler/tests-js-parser/pass-explicit/8ad4edbe9317df28.js new file mode 100644 index 000000000..ca8b5cd73 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ad4edbe9317df28.js @@ -0,0 +1 @@ +a(...b, ...c); diff --git a/compiler/tests-js-parser/pass-explicit/8ae0c86bd7897b7b.js b/compiler/tests-js-parser/pass-explicit/8ae0c86bd7897b7b.js new file mode 100644 index 000000000..be49b0ad3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ae0c86bd7897b7b.js @@ -0,0 +1 @@ +a(...(b = c)); diff --git a/compiler/tests-js-parser/pass-explicit/8af69d8f15295ed2.js b/compiler/tests-js-parser/pass-explicit/8af69d8f15295ed2.js new file mode 100644 index 000000000..c68661e3e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8af69d8f15295ed2.js @@ -0,0 +1 @@ +'
' diff --git a/compiler/tests-js-parser/pass-explicit/8b4ff58f416e17b5.js b/compiler/tests-js-parser/pass-explicit/8b4ff58f416e17b5.js new file mode 100644 index 000000000..b833b5ab3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8b4ff58f416e17b5.js @@ -0,0 +1 @@ +a++; diff --git a/compiler/tests-js-parser/pass-explicit/8b6bded4f89f89f6.js b/compiler/tests-js-parser/pass-explicit/8b6bded4f89f89f6.js new file mode 100644 index 000000000..fa68aad88 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8b6bded4f89f89f6.js @@ -0,0 +1,10 @@ +if ((function () { + return true; +})()) { + a(true); +} else { + b(false); +} +((function () { + (c.d)("e"); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/8b8edcb36909900b.js b/compiler/tests-js-parser/pass-explicit/8b8edcb36909900b.js new file mode 100644 index 000000000..08e66effe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8b8edcb36909900b.js @@ -0,0 +1 @@ +new a; diff --git a/compiler/tests-js-parser/pass-explicit/8b9cd46352285386.js b/compiler/tests-js-parser/pass-explicit/8b9cd46352285386.js new file mode 100644 index 000000000..9762da1d5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8b9cd46352285386.js @@ -0,0 +1 @@ +new (a[b]); diff --git a/compiler/tests-js-parser/pass-explicit/8bd57faa6bcca5e2.js b/compiler/tests-js-parser/pass-explicit/8bd57faa6bcca5e2.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/8be0df708b9e56ca.js b/compiler/tests-js-parser/pass-explicit/8be0df708b9e56ca.js new file mode 100644 index 000000000..64d2c98e1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8be0df708b9e56ca.js @@ -0,0 +1 @@ +a = ([1]); diff --git a/compiler/tests-js-parser/pass-explicit/8bf3ec35c55ed3c0.js b/compiler/tests-js-parser/pass-explicit/8bf3ec35c55ed3c0.js new file mode 100644 index 000000000..a1f3e7697 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8bf3ec35c55ed3c0.js @@ -0,0 +1 @@ +(class extends a {}); diff --git a/compiler/tests-js-parser/pass-explicit/8c27fb7ef1e3ca3d.js b/compiler/tests-js-parser/pass-explicit/8c27fb7ef1e3ca3d.js new file mode 100644 index 000000000..2d184bc9a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8c27fb7ef1e3ca3d.js @@ -0,0 +1,3 @@ +((function () { + if (a) return b; else return c; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/8c56513a6ac3cdff.js b/compiler/tests-js-parser/pass-explicit/8c56513a6ac3cdff.js new file mode 100644 index 000000000..2f406b0ea --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8c56513a6ac3cdff.js @@ -0,0 +1 @@ +({a: null}); diff --git a/compiler/tests-js-parser/pass-explicit/8c56cf12f007a392.js b/compiler/tests-js-parser/pass-explicit/8c56cf12f007a392.js new file mode 100644 index 000000000..fe199772f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8c56cf12f007a392.js @@ -0,0 +1 @@ +a + b; diff --git a/compiler/tests-js-parser/pass-explicit/8c5c46a300d5addb.module.js b/compiler/tests-js-parser/pass-explicit/8c5c46a300d5addb.module.js new file mode 100644 index 000000000..60dfa8b04 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8c5c46a300d5addb.module.js @@ -0,0 +1,3 @@ +export function a() {} +; +1; diff --git a/compiler/tests-js-parser/pass-explicit/8c80f7ee04352eba.js b/compiler/tests-js-parser/pass-explicit/8c80f7ee04352eba.js new file mode 100644 index 000000000..059a38363 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8c80f7ee04352eba.js @@ -0,0 +1 @@ +(...[]) => (0); diff --git a/compiler/tests-js-parser/pass-explicit/8c8a7a2941fb6d64.js b/compiler/tests-js-parser/pass-explicit/8c8a7a2941fb6d64.js new file mode 100644 index 000000000..a41a0dfb0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8c8a7a2941fb6d64.js @@ -0,0 +1 @@ +a = ([1, 2, , 3]); diff --git a/compiler/tests-js-parser/pass-explicit/8ce30bb40ffff192.js b/compiler/tests-js-parser/pass-explicit/8ce30bb40ffff192.js new file mode 100644 index 000000000..c25f98528 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ce30bb40ffff192.js @@ -0,0 +1 @@ +arguments => (1); diff --git a/compiler/tests-js-parser/pass-explicit/8d14286a8cc6ee9d.js b/compiler/tests-js-parser/pass-explicit/8d14286a8cc6ee9d.js new file mode 100644 index 000000000..afef7384d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d14286a8cc6ee9d.js @@ -0,0 +1 @@ +(function* (...a) {}); diff --git a/compiler/tests-js-parser/pass-explicit/8d2463220e3cd0d7.js b/compiler/tests-js-parser/pass-explicit/8d2463220e3cd0d7.js new file mode 100644 index 000000000..46e2c367f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d2463220e3cd0d7.js @@ -0,0 +1,11 @@ +((function () { + b: { + if (a) break b; + ((function () { + b: { + if (a) break b; + c("d"); + } + })()); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/8d2ffebc7214c34f.js b/compiler/tests-js-parser/pass-explicit/8d2ffebc7214c34f.js new file mode 100644 index 000000000..318a40ce5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d2ffebc7214c34f.js @@ -0,0 +1 @@ +yield * (1); diff --git a/compiler/tests-js-parser/pass-explicit/8d40617aec6fabe5.js b/compiler/tests-js-parser/pass-explicit/8d40617aec6fabe5.js new file mode 100644 index 000000000..61f44a2a7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d40617aec6fabe5.js @@ -0,0 +1 @@ +({a: b = 1} = (2)); diff --git a/compiler/tests-js-parser/pass-explicit/8d470354c5d2e216.js b/compiler/tests-js-parser/pass-explicit/8d470354c5d2e216.js new file mode 100644 index 000000000..73cef3d6c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d470354c5d2e216.js @@ -0,0 +1,2 @@ +; +function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/8d5679ec94e658e1.js b/compiler/tests-js-parser/pass-explicit/8d5679ec94e658e1.js new file mode 100644 index 000000000..7288776af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d5679ec94e658e1.js @@ -0,0 +1 @@ +~a; diff --git a/compiler/tests-js-parser/pass-explicit/8d5aeaf1120f0897.js b/compiler/tests-js-parser/pass-explicit/8d5aeaf1120f0897.js new file mode 100644 index 000000000..84722003b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d5aeaf1120f0897.js @@ -0,0 +1 @@ +throw a; diff --git a/compiler/tests-js-parser/pass-explicit/8d6435fa243d5b1a.js b/compiler/tests-js-parser/pass-explicit/8d6435fa243d5b1a.js new file mode 100644 index 000000000..ff11539ba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d6435fa243d5b1a.js @@ -0,0 +1 @@ +var a; diff --git a/compiler/tests-js-parser/pass-explicit/8d67ad04bfc356c9.js b/compiler/tests-js-parser/pass-explicit/8d67ad04bfc356c9.js new file mode 100644 index 000000000..9b668a0c6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d67ad04bfc356c9.js @@ -0,0 +1 @@ +({set __proto__ (a) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/8d6ab6352a3f7fa0.js b/compiler/tests-js-parser/pass-explicit/8d6ab6352a3f7fa0.js new file mode 100644 index 000000000..737d2d705 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d6ab6352a3f7fa0.js @@ -0,0 +1 @@ +(a = (b("100"))) >= a; diff --git a/compiler/tests-js-parser/pass-explicit/8d7d59e5d573ca84.js b/compiler/tests-js-parser/pass-explicit/8d7d59e5d573ca84.js new file mode 100644 index 000000000..8e9721026 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d7d59e5d573ca84.js @@ -0,0 +1 @@ +({__proto__: null, set __proto__ (a) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/8d8913ebd8403c6a.js b/compiler/tests-js-parser/pass-explicit/8d8913ebd8403c6a.js new file mode 100644 index 000000000..7d8d3f0e6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8d8913ebd8403c6a.js @@ -0,0 +1,10 @@ +a(); +b(); +for (; false;) ; +a(); +b(); +for (c = (1); false;) ; +c = (a in b); +for (; false;) ; +c = (a in b); +for (d = (2); false;) ; diff --git a/compiler/tests-js-parser/pass-explicit/8db74b0d31f10261.js b/compiler/tests-js-parser/pass-explicit/8db74b0d31f10261.js new file mode 100644 index 000000000..fc96f1810 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8db74b0d31f10261.js @@ -0,0 +1,4 @@ +{ + a; + --b; +} diff --git a/compiler/tests-js-parser/pass-explicit/8dbf5f9322d8b5ac.js b/compiler/tests-js-parser/pass-explicit/8dbf5f9322d8b5ac.js new file mode 100644 index 000000000..0272b6fc5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8dbf5f9322d8b5ac.js @@ -0,0 +1 @@ +a = ({b(c) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/8ddbdc8954dd7aa9.js b/compiler/tests-js-parser/pass-explicit/8ddbdc8954dd7aa9.js new file mode 100644 index 000000000..5e088a836 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ddbdc8954dd7aa9.js @@ -0,0 +1,8 @@ +function a() { + if (false) { + var b = (1); + } else { + var c = (2); + } + d(c, b); +} diff --git a/compiler/tests-js-parser/pass-explicit/8de47a8b53495792.js b/compiler/tests-js-parser/pass-explicit/8de47a8b53495792.js new file mode 100644 index 000000000..3b20fa87c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8de47a8b53495792.js @@ -0,0 +1 @@ +function a(yield) {} diff --git a/compiler/tests-js-parser/pass-explicit/8e37579cd5ffb2df.js b/compiler/tests-js-parser/pass-explicit/8e37579cd5ffb2df.js new file mode 100644 index 000000000..93955b281 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8e37579cd5ffb2df.js @@ -0,0 +1 @@ +var [...a] = (b); diff --git a/compiler/tests-js-parser/pass-explicit/8e3f0660b32fbfd2.js b/compiler/tests-js-parser/pass-explicit/8e3f0660b32fbfd2.js new file mode 100644 index 000000000..79e85f72c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8e3f0660b32fbfd2.js @@ -0,0 +1 @@ +("a"); diff --git a/compiler/tests-js-parser/pass-explicit/8e609bb71c20b858.module.js b/compiler/tests-js-parser/pass-explicit/8e609bb71c20b858.module.js new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8e609bb71c20b858.module.js @@ -0,0 +1 @@ +export {}; diff --git a/compiler/tests-js-parser/pass-explicit/8e6c915d1746636d.js b/compiler/tests-js-parser/pass-explicit/8e6c915d1746636d.js new file mode 100644 index 000000000..15ae38923 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8e6c915d1746636d.js @@ -0,0 +1 @@ +({a} = {a: 1}) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/8e8e921a75194950.js b/compiler/tests-js-parser/pass-explicit/8e8e921a75194950.js new file mode 100644 index 000000000..4b653c6a9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8e8e921a75194950.js @@ -0,0 +1,3 @@ +do { + a; +} while (b); diff --git a/compiler/tests-js-parser/pass-explicit/8ec6a55806087669.js b/compiler/tests-js-parser/pass-explicit/8ec6a55806087669.js new file mode 100644 index 000000000..d3ddc17f4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ec6a55806087669.js @@ -0,0 +1 @@ +a = ((b--) > (1)); diff --git a/compiler/tests-js-parser/pass-explicit/8ecaef2617d8c6a7.js b/compiler/tests-js-parser/pass-explicit/8ecaef2617d8c6a7.js new file mode 100644 index 000000000..0f447adbd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ecaef2617d8c6a7.js @@ -0,0 +1 @@ +try {} catch (a) {} diff --git a/compiler/tests-js-parser/pass-explicit/8ed2a171ab34c301.js b/compiler/tests-js-parser/pass-explicit/8ed2a171ab34c301.js new file mode 100644 index 000000000..e918776f3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ed2a171ab34c301.js @@ -0,0 +1 @@ +eval++; diff --git a/compiler/tests-js-parser/pass-explicit/8ed2fce2b9b43fb7.js b/compiler/tests-js-parser/pass-explicit/8ed2fce2b9b43fb7.js new file mode 100644 index 000000000..823a2af21 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ed2fce2b9b43fb7.js @@ -0,0 +1 @@ +a(b, ...c); diff --git a/compiler/tests-js-parser/pass-explicit/8ef08a335a7f5966.js b/compiler/tests-js-parser/pass-explicit/8ef08a335a7f5966.js new file mode 100644 index 000000000..618eb0c5b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8ef08a335a7f5966.js @@ -0,0 +1,2 @@ +(a.b)("c"); +((a.b).d)(a, arguments); diff --git a/compiler/tests-js-parser/pass-explicit/8f0084b1073e1877.js b/compiler/tests-js-parser/pass-explicit/8f0084b1073e1877.js new file mode 100644 index 000000000..0b6231037 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8f0084b1073e1877.js @@ -0,0 +1 @@ +a, (1); diff --git a/compiler/tests-js-parser/pass-explicit/8f4f97274dea4723.js b/compiler/tests-js-parser/pass-explicit/8f4f97274dea4723.js new file mode 100644 index 000000000..5bdfcdc99 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8f4f97274dea4723.js @@ -0,0 +1,7 @@ +((function () { + a: { + break a; + b(); + } + c(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/8f659ed872554f99.js b/compiler/tests-js-parser/pass-explicit/8f659ed872554f99.js new file mode 100644 index 000000000..2df4af9d8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8f659ed872554f99.js @@ -0,0 +1,3 @@ +class a { + static get() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/8f8a9f6ca890939e.js b/compiler/tests-js-parser/pass-explicit/8f8a9f6ca890939e.js new file mode 100644 index 000000000..72156b0a6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8f8a9f6ca890939e.js @@ -0,0 +1 @@ +({__proto__: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/8f8bfb27569ac008.js b/compiler/tests-js-parser/pass-explicit/8f8bfb27569ac008.js new file mode 100644 index 000000000..a18958fc0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8f8bfb27569ac008.js @@ -0,0 +1,2 @@ +"use strict"; +eval[1] = (2); diff --git a/compiler/tests-js-parser/pass-explicit/8f9e8be5a6c50e77.js b/compiler/tests-js-parser/pass-explicit/8f9e8be5a6c50e77.js new file mode 100644 index 000000000..b7c23d694 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8f9e8be5a6c50e77.js @@ -0,0 +1,3 @@ +function a() { + return function b(c) {}; +} diff --git a/compiler/tests-js-parser/pass-explicit/8fcaa7f3f8926a5e.js b/compiler/tests-js-parser/pass-explicit/8fcaa7f3f8926a5e.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/8fcaa7f3f8926a5e.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/9013f39c33dc8416.js b/compiler/tests-js-parser/pass-explicit/9013f39c33dc8416.js new file mode 100644 index 000000000..84722003b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9013f39c33dc8416.js @@ -0,0 +1 @@ +throw a; diff --git a/compiler/tests-js-parser/pass-explicit/901fca17189cd709.js b/compiler/tests-js-parser/pass-explicit/901fca17189cd709.js new file mode 100644 index 000000000..273d24ffe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/901fca17189cd709.js @@ -0,0 +1,6 @@ +function* a() { + (class { + [(yield)]() {} + }); +} +; diff --git a/compiler/tests-js-parser/pass-explicit/9027dae72a91a9ed.js b/compiler/tests-js-parser/pass-explicit/9027dae72a91a9ed.js new file mode 100644 index 000000000..24d6994bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9027dae72a91a9ed.js @@ -0,0 +1 @@ +a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/9036914be00c0dc7.js b/compiler/tests-js-parser/pass-explicit/9036914be00c0dc7.js new file mode 100644 index 000000000..0179db0fb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9036914be00c0dc7.js @@ -0,0 +1 @@ +(a, b, [c]) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/903dd05bf49c8fac.js b/compiler/tests-js-parser/pass-explicit/903dd05bf49c8fac.js new file mode 100644 index 000000000..ecca1cd10 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/903dd05bf49c8fac.js @@ -0,0 +1,2 @@ +a(b, ...c); +a(...d); diff --git a/compiler/tests-js-parser/pass-explicit/906e545ceef0fcfd.js b/compiler/tests-js-parser/pass-explicit/906e545ceef0fcfd.js new file mode 100644 index 000000000..b2899ea0c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/906e545ceef0fcfd.js @@ -0,0 +1,3 @@ +((function () { + if (a) throw b; else throw c; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/90919cd6fd06c4d8.js b/compiler/tests-js-parser/pass-explicit/90919cd6fd06c4d8.js new file mode 100644 index 000000000..14366af1f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/90919cd6fd06c4d8.js @@ -0,0 +1,3 @@ +function* a() { + yield a; +} diff --git a/compiler/tests-js-parser/pass-explicit/90abe26c46af6975.js b/compiler/tests-js-parser/pass-explicit/90abe26c46af6975.js new file mode 100644 index 000000000..612735e47 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/90abe26c46af6975.js @@ -0,0 +1 @@ +function yield() {} diff --git a/compiler/tests-js-parser/pass-explicit/90ad0135b905a622.js b/compiler/tests-js-parser/pass-explicit/90ad0135b905a622.js new file mode 100644 index 000000000..3455f6877 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/90ad0135b905a622.js @@ -0,0 +1,4 @@ +function a() { + var b = (1); + c && ((((2), (3)), d), b); +} diff --git a/compiler/tests-js-parser/pass-explicit/90fa9751ab71ce28.js b/compiler/tests-js-parser/pass-explicit/90fa9751ab71ce28.js new file mode 100644 index 000000000..098e9e665 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/90fa9751ab71ce28.js @@ -0,0 +1,7 @@ +((function () { + var a; + with (b) { + a; + } + a = (a += (1)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/914ae3168da48965.js b/compiler/tests-js-parser/pass-explicit/914ae3168da48965.js new file mode 100644 index 000000000..778886fcb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/914ae3168da48965.js @@ -0,0 +1 @@ +throw {}; diff --git a/compiler/tests-js-parser/pass-explicit/9159ea4175a5a021.js b/compiler/tests-js-parser/pass-explicit/9159ea4175a5a021.js new file mode 100644 index 000000000..01308dc92 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9159ea4175a5a021.js @@ -0,0 +1 @@ +for (a = (1); a < (2); a++) ; diff --git a/compiler/tests-js-parser/pass-explicit/918e105a2ff6c64a.js b/compiler/tests-js-parser/pass-explicit/918e105a2ff6c64a.js new file mode 100644 index 000000000..21ad9b818 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/918e105a2ff6c64a.js @@ -0,0 +1,3 @@ +class a extends b { + get c() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/91cbb6971c86509e.js b/compiler/tests-js-parser/pass-explicit/91cbb6971c86509e.js new file mode 100644 index 000000000..f55e9d921 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/91cbb6971c86509e.js @@ -0,0 +1 @@ +({a = 1}, {b = 2}, {c = 3}) => (4); diff --git a/compiler/tests-js-parser/pass-explicit/91f2fa0b11550b30.js b/compiler/tests-js-parser/pass-explicit/91f2fa0b11550b30.js new file mode 100644 index 000000000..8d3eb39b5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/91f2fa0b11550b30.js @@ -0,0 +1,3 @@ +function* a() { + yield ("a"); +} diff --git a/compiler/tests-js-parser/pass-explicit/9203cb34e9b091dc.js b/compiler/tests-js-parser/pass-explicit/9203cb34e9b091dc.js new file mode 100644 index 000000000..f54d51d22 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9203cb34e9b091dc.js @@ -0,0 +1 @@ +a: if (true) break a; diff --git a/compiler/tests-js-parser/pass-explicit/9208254b5f8a8481.js b/compiler/tests-js-parser/pass-explicit/9208254b5f8a8481.js new file mode 100644 index 000000000..1149909eb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9208254b5f8a8481.js @@ -0,0 +1 @@ +a == b; diff --git a/compiler/tests-js-parser/pass-explicit/923c99b441ab5a26.js b/compiler/tests-js-parser/pass-explicit/923c99b441ab5a26.js new file mode 100644 index 000000000..81e59bd6a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/923c99b441ab5a26.js @@ -0,0 +1,10 @@ +var a = (((["b", "c", "d"]).e)("")); +var f = (((["b", "c", "d"]).e)()); +var g = (((["b", 1, 2, 3, "c"]).e)("")); +var h = ((([i(), "b", 4, 5, 6, "c", c()]).e)("")); +var j = ((([i(), c(), "b", 7, 8, 9, "c", c()]).e)("")); +var k = ((([10, 11, "b", "c", d()]).e)("")); +var l = (((["b", ((12) + (13)) + ("c"), "d"]).e)("m")); +var n = ((([]).e)(b + c)); +var o = ((([]).e)("")); +var p = ((([]).e)("b")); diff --git a/compiler/tests-js-parser/pass-explicit/925443c6cf79aa88.js b/compiler/tests-js-parser/pass-explicit/925443c6cf79aa88.js new file mode 100644 index 000000000..06e073a36 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/925443c6cf79aa88.js @@ -0,0 +1 @@ +a: do do continue a; while (true); while (true); diff --git a/compiler/tests-js-parser/pass-explicit/927b1e0dd52248a6.js b/compiler/tests-js-parser/pass-explicit/927b1e0dd52248a6.js new file mode 100644 index 000000000..3be1a6133 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/927b1e0dd52248a6.js @@ -0,0 +1,3 @@ +with (a) { + b; +} diff --git a/compiler/tests-js-parser/pass-explicit/927efb51d4882ccb.js b/compiler/tests-js-parser/pass-explicit/927efb51d4882ccb.js new file mode 100644 index 000000000..9444d6051 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/927efb51d4882ccb.js @@ -0,0 +1,3 @@ +((function () { + (1) / (-(2)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/92a997b1ba17876e.js b/compiler/tests-js-parser/pass-explicit/92a997b1ba17876e.js new file mode 100644 index 000000000..3c4daa093 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/92a997b1ba17876e.js @@ -0,0 +1 @@ +({a = 1}) => a; diff --git a/compiler/tests-js-parser/pass-explicit/92dd079c741d2a95.js b/compiler/tests-js-parser/pass-explicit/92dd079c741d2a95.js new file mode 100644 index 000000000..ac604637e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/92dd079c741d2a95.js @@ -0,0 +1 @@ +a <= b; diff --git a/compiler/tests-js-parser/pass-explicit/92fd8e24864fde0a.js b/compiler/tests-js-parser/pass-explicit/92fd8e24864fde0a.js new file mode 100644 index 000000000..aa5cbac40 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/92fd8e24864fde0a.js @@ -0,0 +1 @@ +(function eval() {}); diff --git a/compiler/tests-js-parser/pass-explicit/93108a695e5ff29d.js b/compiler/tests-js-parser/pass-explicit/93108a695e5ff29d.js new file mode 100644 index 000000000..34555cbe3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/93108a695e5ff29d.js @@ -0,0 +1,16 @@ +((((((function () { + var a; + if (b) return; + a = (new c); + return a; +})())(function () { + var a; + if (b) return; + a = (new c); + return a; +}))())(function () { + var a; + if (b) return; + a = (new c); + return a; +}))()); diff --git a/compiler/tests-js-parser/pass-explicit/9312a1adbbf0a4c0.js b/compiler/tests-js-parser/pass-explicit/9312a1adbbf0a4c0.js new file mode 100644 index 000000000..eab746921 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9312a1adbbf0a4c0.js @@ -0,0 +1 @@ +debugger; diff --git a/compiler/tests-js-parser/pass-explicit/9331c78bb0fc6a55.js b/compiler/tests-js-parser/pass-explicit/9331c78bb0fc6a55.js new file mode 100644 index 000000000..9c005117d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9331c78bb0fc6a55.js @@ -0,0 +1 @@ +-(1); diff --git a/compiler/tests-js-parser/pass-explicit/9349f48a456341b8.js b/compiler/tests-js-parser/pass-explicit/9349f48a456341b8.js new file mode 100644 index 000000000..a6e956190 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9349f48a456341b8.js @@ -0,0 +1 @@ +((new a).b)(); diff --git a/compiler/tests-js-parser/pass-explicit/937059a5e53177e5.js b/compiler/tests-js-parser/pass-explicit/937059a5e53177e5.js new file mode 100644 index 000000000..29dfd406b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/937059a5e53177e5.js @@ -0,0 +1 @@ +[...[...a[b]]] = c; diff --git a/compiler/tests-js-parser/pass-explicit/939479d60d564ccd.js b/compiler/tests-js-parser/pass-explicit/939479d60d564ccd.js new file mode 100644 index 000000000..98813bc1f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/939479d60d564ccd.js @@ -0,0 +1 @@ +({*a(b, c, d) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/93bd9d668ac308a0.js b/compiler/tests-js-parser/pass-explicit/93bd9d668ac308a0.js new file mode 100644 index 000000000..c26c97ada --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/93bd9d668ac308a0.js @@ -0,0 +1,4 @@ +var a = (function (b) { + b(); + a(); +}); diff --git a/compiler/tests-js-parser/pass-explicit/93c32bb0a4bad388.module.js b/compiler/tests-js-parser/pass-explicit/93c32bb0a4bad388.module.js new file mode 100644 index 000000000..54fcb4dba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/93c32bb0a4bad388.module.js @@ -0,0 +1 @@ +import {default as a} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/93c75264893587a5.js b/compiler/tests-js-parser/pass-explicit/93c75264893587a5.js new file mode 100644 index 000000000..a9f73cd97 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/93c75264893587a5.js @@ -0,0 +1 @@ +({*yield() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/93cac77bbf2242ab.js b/compiler/tests-js-parser/pass-explicit/93cac77bbf2242ab.js new file mode 100644 index 000000000..d596d2708 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/93cac77bbf2242ab.js @@ -0,0 +1 @@ +(((a()), (b())), (c())) + (((d()), (e())), (f())); diff --git a/compiler/tests-js-parser/pass-explicit/93d4c5dfbddf859d.js b/compiler/tests-js-parser/pass-explicit/93d4c5dfbddf859d.js new file mode 100644 index 000000000..5568a4ab4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/93d4c5dfbddf859d.js @@ -0,0 +1,12 @@ +if (a) { + if (b) c; +} else d; +if (a) { + if (b) throw c; +} else d; +if (a) { + with (a) if (b) throw c; +} else d; +if (a) { + do if (b) throw c; while (a); +} else d; diff --git a/compiler/tests-js-parser/pass-explicit/9427da8abb4e7c67.js b/compiler/tests-js-parser/pass-explicit/9427da8abb4e7c67.js new file mode 100644 index 000000000..582290fd1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9427da8abb4e7c67.js @@ -0,0 +1 @@ +ⅣⅡ; diff --git a/compiler/tests-js-parser/pass-explicit/946bee37652a31fa.js b/compiler/tests-js-parser/pass-explicit/946bee37652a31fa.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/94846b0ae1cac1a2.js b/compiler/tests-js-parser/pass-explicit/94846b0ae1cac1a2.js new file mode 100644 index 000000000..4b00c998a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/94846b0ae1cac1a2.js @@ -0,0 +1 @@ +void (void (void (/test/))); diff --git a/compiler/tests-js-parser/pass-explicit/9495a0dcecf5713c.js b/compiler/tests-js-parser/pass-explicit/9495a0dcecf5713c.js new file mode 100644 index 000000000..7a666d94a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9495a0dcecf5713c.js @@ -0,0 +1 @@ +({[a]: () => {}}); diff --git a/compiler/tests-js-parser/pass-explicit/94b8a654a87039b9.js b/compiler/tests-js-parser/pass-explicit/94b8a654a87039b9.js new file mode 100644 index 000000000..9e89aebc3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/94b8a654a87039b9.js @@ -0,0 +1 @@ +(function* (a, b, c) {}); diff --git a/compiler/tests-js-parser/pass-explicit/94be09b126b946b8.js b/compiler/tests-js-parser/pass-explicit/94be09b126b946b8.js new file mode 100644 index 000000000..f68249507 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/94be09b126b946b8.js @@ -0,0 +1,3 @@ +` + + `; diff --git a/compiler/tests-js-parser/pass-explicit/94c72b68d8726b07.js b/compiler/tests-js-parser/pass-explicit/94c72b68d8726b07.js new file mode 100644 index 000000000..c8e8d6883 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/94c72b68d8726b07.js @@ -0,0 +1 @@ +(1), a; diff --git a/compiler/tests-js-parser/pass-explicit/94cb828d5dcfd136.js b/compiler/tests-js-parser/pass-explicit/94cb828d5dcfd136.js new file mode 100644 index 000000000..c832bb8ed --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/94cb828d5dcfd136.js @@ -0,0 +1 @@ +try {} catch (arguments) {} diff --git a/compiler/tests-js-parser/pass-explicit/951e1b875db534f9.js b/compiler/tests-js-parser/pass-explicit/951e1b875db534f9.js new file mode 100644 index 000000000..0b1e2b548 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/951e1b875db534f9.js @@ -0,0 +1 @@ +a = ((1) ? (2) : (3)); diff --git a/compiler/tests-js-parser/pass-explicit/95408309cc3a1d30.js b/compiler/tests-js-parser/pass-explicit/95408309cc3a1d30.js new file mode 100644 index 000000000..e0fe8c3c2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/95408309cc3a1d30.js @@ -0,0 +1,8 @@ +function a() { + if (void (1)) { + var b = (2); + } else { + c(a); + } + c(b); +} diff --git a/compiler/tests-js-parser/pass-explicit/954a896471379dc8.js b/compiler/tests-js-parser/pass-explicit/954a896471379dc8.js new file mode 100644 index 000000000..338f3b36e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/954a896471379dc8.js @@ -0,0 +1 @@ +[a, ...a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/95520bedf0fdd4c9.js b/compiler/tests-js-parser/pass-explicit/95520bedf0fdd4c9.js new file mode 100644 index 000000000..3a5c29fd2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/95520bedf0fdd4c9.js @@ -0,0 +1,6 @@ +function a() { + (b, c), d; + if (e) { + throw "f"; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/955c5fedb3931500.js b/compiler/tests-js-parser/pass-explicit/955c5fedb3931500.js new file mode 100644 index 000000000..56e61bf40 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/955c5fedb3931500.js @@ -0,0 +1 @@ +("a") + ("a"); diff --git a/compiler/tests-js-parser/pass-explicit/95ab0d795c04ff38.js b/compiler/tests-js-parser/pass-explicit/95ab0d795c04ff38.js new file mode 100644 index 000000000..648b7cc6f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/95ab0d795c04ff38.js @@ -0,0 +1 @@ +("I"); diff --git a/compiler/tests-js-parser/pass-explicit/96059002704b3ac3.js b/compiler/tests-js-parser/pass-explicit/96059002704b3ac3.js new file mode 100644 index 000000000..61d967762 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/96059002704b3ac3.js @@ -0,0 +1,7 @@ +for (; a();) { + b(); + c(); + if (d()) e(); else break; + f(); + g(); +} diff --git a/compiler/tests-js-parser/pass-explicit/9677a7160d769b1a.js b/compiler/tests-js-parser/pass-explicit/9677a7160d769b1a.js new file mode 100644 index 000000000..652920f8d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9677a7160d769b1a.js @@ -0,0 +1 @@ +var a = ({delete: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/9681f5d844d7acd0.js b/compiler/tests-js-parser/pass-explicit/9681f5d844d7acd0.js new file mode 100644 index 000000000..19af11402 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9681f5d844d7acd0.js @@ -0,0 +1,10 @@ +a => b; +(a, b) => c; +() => b; +a => (b => c); +a => (b => c); +() => ((b, c) => d); +a => { + return b; +}; +a => ("e"); diff --git a/compiler/tests-js-parser/pass-explicit/96909e1dce85ca53.module.js b/compiler/tests-js-parser/pass-explicit/96909e1dce85ca53.module.js new file mode 100644 index 000000000..aef22247d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/96909e1dce85ca53.module.js @@ -0,0 +1 @@ +export default 1; diff --git a/compiler/tests-js-parser/pass-explicit/96941f16c2d7cec4.js b/compiler/tests-js-parser/pass-explicit/96941f16c2d7cec4.js new file mode 100644 index 000000000..24d6994bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/96941f16c2d7cec4.js @@ -0,0 +1 @@ +a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/96e1b294d19a101d.js b/compiler/tests-js-parser/pass-explicit/96e1b294d19a101d.js new file mode 100644 index 000000000..f5e95965e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/96e1b294d19a101d.js @@ -0,0 +1 @@ +a => ("b"); diff --git a/compiler/tests-js-parser/pass-explicit/96ea36bc180f25d5.js b/compiler/tests-js-parser/pass-explicit/96ea36bc180f25d5.js new file mode 100644 index 000000000..a784ccccb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/96ea36bc180f25d5.js @@ -0,0 +1 @@ +with (a) b; diff --git a/compiler/tests-js-parser/pass-explicit/96f5d93be9a54573.js b/compiler/tests-js-parser/pass-explicit/96f5d93be9a54573.js new file mode 100644 index 000000000..e25f4f0a7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/96f5d93be9a54573.js @@ -0,0 +1,3 @@ +({a, b}); +[{a}]; +a({x}); diff --git a/compiler/tests-js-parser/pass-explicit/970fb35ce6ce89bb.js b/compiler/tests-js-parser/pass-explicit/970fb35ce6ce89bb.js new file mode 100644 index 000000000..776d13c12 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/970fb35ce6ce89bb.js @@ -0,0 +1,6 @@ +function a() { + var a = (1); + function b() { + var c = (a); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/973cbc9ece13acbc.js b/compiler/tests-js-parser/pass-explicit/973cbc9ece13acbc.js new file mode 100644 index 000000000..3b82a3045 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/973cbc9ece13acbc.js @@ -0,0 +1,2 @@ +function* a() {} +function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/974e7275fdedce49.js b/compiler/tests-js-parser/pass-explicit/974e7275fdedce49.js new file mode 100644 index 000000000..197d5946e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/974e7275fdedce49.js @@ -0,0 +1 @@ +(1).a; diff --git a/compiler/tests-js-parser/pass-explicit/97593deb177d09ae.js b/compiler/tests-js-parser/pass-explicit/97593deb177d09ae.js new file mode 100644 index 000000000..dde4f23cf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/97593deb177d09ae.js @@ -0,0 +1,3 @@ +function a(b, c) { + return (b--) >>> c; +} diff --git a/compiler/tests-js-parser/pass-explicit/976afd9ae5f5d71a.module.js b/compiler/tests-js-parser/pass-explicit/976afd9ae5f5d71a.module.js new file mode 100644 index 000000000..11080b753 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/976afd9ae5f5d71a.module.js @@ -0,0 +1,2 @@ +export function a() {} +; diff --git a/compiler/tests-js-parser/pass-explicit/979b36a2c530f286.js b/compiler/tests-js-parser/pass-explicit/979b36a2c530f286.js new file mode 100644 index 000000000..64b0a898b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/979b36a2c530f286.js @@ -0,0 +1 @@ +var {a: yield} = (b); diff --git a/compiler/tests-js-parser/pass-explicit/97e246302dfe8616.js b/compiler/tests-js-parser/pass-explicit/97e246302dfe8616.js new file mode 100644 index 000000000..84bb5ee78 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/97e246302dfe8616.js @@ -0,0 +1,3 @@ +function a(b, c) { + return b << (!(--c)); +} diff --git a/compiler/tests-js-parser/pass-explicit/982595e2af9d9703.js b/compiler/tests-js-parser/pass-explicit/982595e2af9d9703.js new file mode 100644 index 000000000..cf10a5bfb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/982595e2af9d9703.js @@ -0,0 +1 @@ +for (a = (1); a < (2); a++) b(a); diff --git a/compiler/tests-js-parser/pass-explicit/982835d8c977075c.js b/compiler/tests-js-parser/pass-explicit/982835d8c977075c.js new file mode 100644 index 000000000..5ab15a7a7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/982835d8c977075c.js @@ -0,0 +1 @@ +/a/; diff --git a/compiler/tests-js-parser/pass-explicit/988e362ed9ddcac5.js b/compiler/tests-js-parser/pass-explicit/988e362ed9ddcac5.js new file mode 100644 index 000000000..03b6bf7ba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/988e362ed9ddcac5.js @@ -0,0 +1 @@ +(a ** b).c = (0); diff --git a/compiler/tests-js-parser/pass-explicit/988f8a06b68457ef.js b/compiler/tests-js-parser/pass-explicit/988f8a06b68457ef.js new file mode 100644 index 000000000..f2a434c5c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/988f8a06b68457ef.js @@ -0,0 +1 @@ +T‿ = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/98c7fb7947f7eae4.js b/compiler/tests-js-parser/pass-explicit/98c7fb7947f7eae4.js new file mode 100644 index 000000000..420a1fcd3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/98c7fb7947f7eae4.js @@ -0,0 +1 @@ +eval--; diff --git a/compiler/tests-js-parser/pass-explicit/98df58b0c40fac90.js b/compiler/tests-js-parser/pass-explicit/98df58b0c40fac90.js new file mode 100644 index 000000000..1002b50f3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/98df58b0c40fac90.js @@ -0,0 +1 @@ +a = ((function () {})(b())); diff --git a/compiler/tests-js-parser/pass-explicit/993584ec37388320.js b/compiler/tests-js-parser/pass-explicit/993584ec37388320.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/993584ec37388320.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/9949a2e1a6844836.module.js b/compiler/tests-js-parser/pass-explicit/9949a2e1a6844836.module.js new file mode 100644 index 000000000..d7422344b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9949a2e1a6844836.module.js @@ -0,0 +1,3 @@ +(function* () { + yield a; +}); diff --git a/compiler/tests-js-parser/pass-explicit/996001e00a0c575b.js b/compiler/tests-js-parser/pass-explicit/996001e00a0c575b.js new file mode 100644 index 000000000..f2095ce00 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/996001e00a0c575b.js @@ -0,0 +1 @@ +({a}); diff --git a/compiler/tests-js-parser/pass-explicit/9974571a855d4447.js b/compiler/tests-js-parser/pass-explicit/9974571a855d4447.js new file mode 100644 index 000000000..bfb42f5be --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9974571a855d4447.js @@ -0,0 +1,3 @@ +function* a() { + yield (false); +} diff --git a/compiler/tests-js-parser/pass-explicit/9975820eb10bc0ff.js b/compiler/tests-js-parser/pass-explicit/9975820eb10bc0ff.js new file mode 100644 index 000000000..b28add34a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9975820eb10bc0ff.js @@ -0,0 +1,5 @@ +for (;;) { + a(); + continue; + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/999c1001e3761320.js b/compiler/tests-js-parser/pass-explicit/999c1001e3761320.js new file mode 100644 index 000000000..5cfb8dbd1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/999c1001e3761320.js @@ -0,0 +1 @@ +`abc`; diff --git a/compiler/tests-js-parser/pass-explicit/99cdfc40e20af6f5.js b/compiler/tests-js-parser/pass-explicit/99cdfc40e20af6f5.js new file mode 100644 index 000000000..cdf355636 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/99cdfc40e20af6f5.js @@ -0,0 +1 @@ +var a = ((function () {})(b())); diff --git a/compiler/tests-js-parser/pass-explicit/99fceed987b8ec3d.js b/compiler/tests-js-parser/pass-explicit/99fceed987b8ec3d.js new file mode 100644 index 000000000..82c781dd1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/99fceed987b8ec3d.js @@ -0,0 +1 @@ +function a(...[]) {} diff --git a/compiler/tests-js-parser/pass-explicit/9a5b92dfd9d19f60.js b/compiler/tests-js-parser/pass-explicit/9a5b92dfd9d19f60.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9a5b92dfd9d19f60.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/9a666205cafd530f.js b/compiler/tests-js-parser/pass-explicit/9a666205cafd530f.js new file mode 100644 index 000000000..982f61ffe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9a666205cafd530f.js @@ -0,0 +1,5 @@ +function* a() { + ({b() { + yield; + }}); +} diff --git a/compiler/tests-js-parser/pass-explicit/9a6711e879a99536.js b/compiler/tests-js-parser/pass-explicit/9a6711e879a99536.js new file mode 100644 index 000000000..50a844ff7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9a6711e879a99536.js @@ -0,0 +1,3 @@ +{ + let a; +} diff --git a/compiler/tests-js-parser/pass-explicit/9a7f06880ce32bbc.js b/compiler/tests-js-parser/pass-explicit/9a7f06880ce32bbc.js new file mode 100644 index 000000000..24d6994bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9a7f06880ce32bbc.js @@ -0,0 +1 @@ +a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/9a9cb616daadf90a.js b/compiler/tests-js-parser/pass-explicit/9a9cb616daadf90a.js new file mode 100644 index 000000000..4f90b0a27 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9a9cb616daadf90a.js @@ -0,0 +1,3 @@ +(function () { + return a; +}); diff --git a/compiler/tests-js-parser/pass-explicit/9aa93e1e417ce8e3.js b/compiler/tests-js-parser/pass-explicit/9aa93e1e417ce8e3.js new file mode 100644 index 000000000..381d0c741 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9aa93e1e417ce8e3.js @@ -0,0 +1 @@ +for ((let) in a) {} diff --git a/compiler/tests-js-parser/pass-explicit/9b9d0e250e01155d.js b/compiler/tests-js-parser/pass-explicit/9b9d0e250e01155d.js new file mode 100644 index 000000000..9b008d62b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9b9d0e250e01155d.js @@ -0,0 +1,6 @@ +var a, b; +if (c()) { + a = (new b(1)); +} else { + a = (new b(2)); +} diff --git a/compiler/tests-js-parser/pass-explicit/9bcae7c7f00b4e3c.js b/compiler/tests-js-parser/pass-explicit/9bcae7c7f00b4e3c.js new file mode 100644 index 000000000..ddebeb5d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9bcae7c7f00b4e3c.js @@ -0,0 +1 @@ +(function x(...[a, b]) {}); diff --git a/compiler/tests-js-parser/pass-explicit/9c30b0817f412a30.js b/compiler/tests-js-parser/pass-explicit/9c30b0817f412a30.js new file mode 100644 index 000000000..eed9da36c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9c30b0817f412a30.js @@ -0,0 +1,3 @@ +(((function () { + return {}; +})()).a = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/9cf32425f04fd865.js b/compiler/tests-js-parser/pass-explicit/9cf32425f04fd865.js new file mode 100644 index 000000000..1557d8f86 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9cf32425f04fd865.js @@ -0,0 +1 @@ +`${a}${b}`; diff --git a/compiler/tests-js-parser/pass-explicit/9d0fd95dd43f59ec.js b/compiler/tests-js-parser/pass-explicit/9d0fd95dd43f59ec.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9d0fd95dd43f59ec.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/9d1320f0185b1586.js b/compiler/tests-js-parser/pass-explicit/9d1320f0185b1586.js new file mode 100644 index 000000000..cd90089a2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9d1320f0185b1586.js @@ -0,0 +1 @@ +(a[b])(b, c); diff --git a/compiler/tests-js-parser/pass-explicit/9d3d960e32528788.js b/compiler/tests-js-parser/pass-explicit/9d3d960e32528788.js new file mode 100644 index 000000000..f6f0e3f83 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9d3d960e32528788.js @@ -0,0 +1 @@ +(function () {}) / (1); diff --git a/compiler/tests-js-parser/pass-explicit/9d935d1b787ed251.js b/compiler/tests-js-parser/pass-explicit/9d935d1b787ed251.js new file mode 100644 index 000000000..3e8d51caf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9d935d1b787ed251.js @@ -0,0 +1,2 @@ +; +a; diff --git a/compiler/tests-js-parser/pass-explicit/9db4dccf1122bfc4.js b/compiler/tests-js-parser/pass-explicit/9db4dccf1122bfc4.js new file mode 100644 index 000000000..700af3188 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9db4dccf1122bfc4.js @@ -0,0 +1 @@ +new (new a); diff --git a/compiler/tests-js-parser/pass-explicit/9db573299f02bf36.js b/compiler/tests-js-parser/pass-explicit/9db573299f02bf36.js new file mode 100644 index 000000000..6624f0785 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9db573299f02bf36.js @@ -0,0 +1,6 @@ +var a = (((["b", "c", d(), "e", "f", "g"]).h)("")); +var i = (((["b", "c", d(), "e", "f", "g"]).h)("j")); +var k = (((["b", "c", d(), "e", "f", "g"]).h)("l")); +var m = (((["b", "c", d(), ((["b", 1, 2, 3, "c"]).h)("+"), "e", "f", "g"]).h)("j")); +var n = (((["b", "c", d(), ((["b", 4, 5, 6, "c"]).h)("+"), "e", "f", "g"]).h)("l")); +var o = (((["p", ("p") + q, "b", "c", ("r") + b]).h)("")); diff --git a/compiler/tests-js-parser/pass-explicit/9dc20e081005fba4.js b/compiler/tests-js-parser/pass-explicit/9dc20e081005fba4.js new file mode 100644 index 000000000..050b3e3f2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9dc20e081005fba4.js @@ -0,0 +1,6 @@ +a = ({b(c, d) { + return a; +}}); +e = ({b([{c}]) { + return c; +}, f() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/9dfa08b5b7ad82a9.js b/compiler/tests-js-parser/pass-explicit/9dfa08b5b7ad82a9.js new file mode 100644 index 000000000..6ae72b9dd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9dfa08b5b7ad82a9.js @@ -0,0 +1 @@ +var [a, ...b] = (c); diff --git a/compiler/tests-js-parser/pass-explicit/9e3e46891aaf13de.js b/compiler/tests-js-parser/pass-explicit/9e3e46891aaf13de.js new file mode 100644 index 000000000..f24569bc9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9e3e46891aaf13de.js @@ -0,0 +1 @@ +let {a: b} = ({}); diff --git a/compiler/tests-js-parser/pass-explicit/9e98dbfde77e3dfe.js b/compiler/tests-js-parser/pass-explicit/9e98dbfde77e3dfe.js new file mode 100644 index 000000000..6b00ae5f3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9e98dbfde77e3dfe.js @@ -0,0 +1 @@ +[, , 1]; diff --git a/compiler/tests-js-parser/pass-explicit/9ec644dbf797e95c.js b/compiler/tests-js-parser/pass-explicit/9ec644dbf797e95c.js new file mode 100644 index 000000000..1240f329c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9ec644dbf797e95c.js @@ -0,0 +1 @@ +("`"); diff --git a/compiler/tests-js-parser/pass-explicit/9ed0369295348e76.js b/compiler/tests-js-parser/pass-explicit/9ed0369295348e76.js new file mode 100644 index 000000000..871571de1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9ed0369295348e76.js @@ -0,0 +1,6 @@ +((function () { + return 1; + { + var a = (2); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/9f0d8eb6f7ab8180.js b/compiler/tests-js-parser/pass-explicit/9f0d8eb6f7ab8180.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/9f23d57c37e238cb.js b/compiler/tests-js-parser/pass-explicit/9f23d57c37e238cb.js new file mode 100644 index 000000000..76937f861 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9f23d57c37e238cb.js @@ -0,0 +1 @@ +var a = (1), b = (2); diff --git a/compiler/tests-js-parser/pass-explicit/9f272d23fc62842a.js b/compiler/tests-js-parser/pass-explicit/9f272d23fc62842a.js new file mode 100644 index 000000000..91e89d6f8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9f272d23fc62842a.js @@ -0,0 +1 @@ +a || (b || c); diff --git a/compiler/tests-js-parser/pass-explicit/9fd584806e085e35.js b/compiler/tests-js-parser/pass-explicit/9fd584806e085e35.js new file mode 100644 index 000000000..dfa6d6fa2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9fd584806e085e35.js @@ -0,0 +1,4 @@ +class a { + b() {} + c() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/9fe1d41db318afba.js b/compiler/tests-js-parser/pass-explicit/9fe1d41db318afba.js new file mode 100644 index 000000000..69be57afa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/9fe1d41db318afba.js @@ -0,0 +1 @@ +for ((let) in 1) ; diff --git a/compiler/tests-js-parser/pass-explicit/a0079146ab045c26.js b/compiler/tests-js-parser/pass-explicit/a0079146ab045c26.js new file mode 100644 index 000000000..478be5dcd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a0079146ab045c26.js @@ -0,0 +1 @@ +/[-a-]/; diff --git a/compiler/tests-js-parser/pass-explicit/a022debc42a58f0c.js b/compiler/tests-js-parser/pass-explicit/a022debc42a58f0c.js new file mode 100644 index 000000000..044e8da34 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a022debc42a58f0c.js @@ -0,0 +1 @@ +([a]) => ([1]); diff --git a/compiler/tests-js-parser/pass-explicit/a03475b02913e16a.js b/compiler/tests-js-parser/pass-explicit/a03475b02913e16a.js new file mode 100644 index 000000000..5e3f4db7b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a03475b02913e16a.js @@ -0,0 +1 @@ +for (; a();) if (b()) break; diff --git a/compiler/tests-js-parser/pass-explicit/a08ed291f78352a0.js b/compiler/tests-js-parser/pass-explicit/a08ed291f78352a0.js new file mode 100644 index 000000000..7e69d2a7d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a08ed291f78352a0.js @@ -0,0 +1,7 @@ +a(function () { + function b() {} + if (b()) { + b(); + return void (1); + } +}); diff --git a/compiler/tests-js-parser/pass-explicit/a0af29e4dd6d3845.js b/compiler/tests-js-parser/pass-explicit/a0af29e4dd6d3845.js new file mode 100644 index 000000000..9f17f15f1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a0af29e4dd6d3845.js @@ -0,0 +1,6 @@ +((function () { + while (false) { + a(); + } + b(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a0b7bf790311b763.js b/compiler/tests-js-parser/pass-explicit/a0b7bf790311b763.js new file mode 100644 index 000000000..d2624733d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a0b7bf790311b763.js @@ -0,0 +1 @@ +/[a-z]/u; diff --git a/compiler/tests-js-parser/pass-explicit/a0fba75a10c21ac9.js b/compiler/tests-js-parser/pass-explicit/a0fba75a10c21ac9.js new file mode 100644 index 000000000..cede57078 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a0fba75a10c21ac9.js @@ -0,0 +1 @@ +(!a) ? (1) : (2); diff --git a/compiler/tests-js-parser/pass-explicit/a10929d2c1b0d792.js b/compiler/tests-js-parser/pass-explicit/a10929d2c1b0d792.js new file mode 100644 index 000000000..3be1a6133 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a10929d2c1b0d792.js @@ -0,0 +1,3 @@ +with (a) { + b; +} diff --git a/compiler/tests-js-parser/pass-explicit/a11e875c4dd100af.js b/compiler/tests-js-parser/pass-explicit/a11e875c4dd100af.js new file mode 100644 index 000000000..b2bdda227 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a11e875c4dd100af.js @@ -0,0 +1,3 @@ +for (var a = (1); a < (2); ++a) ((function () { + b("c"); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a150e917230aa57d.js b/compiler/tests-js-parser/pass-explicit/a150e917230aa57d.js new file mode 100644 index 000000000..58f69d2ad --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a150e917230aa57d.js @@ -0,0 +1,8 @@ +((function () { + if ((true) == a) { + b(); + } + if ((false) == a) { + b(); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a157424306915066.js b/compiler/tests-js-parser/pass-explicit/a157424306915066.js new file mode 100644 index 000000000..6674c64b4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a157424306915066.js @@ -0,0 +1,5 @@ +function* a() { + b => { + yield + b; + }; +} diff --git a/compiler/tests-js-parser/pass-explicit/a1594a4d0c0ee99a.js b/compiler/tests-js-parser/pass-explicit/a1594a4d0c0ee99a.js new file mode 100644 index 000000000..f940bba3a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a1594a4d0c0ee99a.js @@ -0,0 +1 @@ +for (let a = (let);;) {} diff --git a/compiler/tests-js-parser/pass-explicit/a15c90cc56980c41.js b/compiler/tests-js-parser/pass-explicit/a15c90cc56980c41.js new file mode 100644 index 000000000..ac2394c13 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a15c90cc56980c41.js @@ -0,0 +1,3 @@ +a: while (true) { + break a; +} diff --git a/compiler/tests-js-parser/pass-explicit/a18a8865e65d4bdd.js b/compiler/tests-js-parser/pass-explicit/a18a8865e65d4bdd.js new file mode 100644 index 000000000..c290d0a1c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a18a8865e65d4bdd.js @@ -0,0 +1 @@ +({[a]() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/a194909bf50b1467.js b/compiler/tests-js-parser/pass-explicit/a194909bf50b1467.js new file mode 100644 index 000000000..adb98dfbc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a194909bf50b1467.js @@ -0,0 +1,3 @@ +function* a() { + yield (yield); +} diff --git a/compiler/tests-js-parser/pass-explicit/a1ab463999957845.js b/compiler/tests-js-parser/pass-explicit/a1ab463999957845.js new file mode 100644 index 000000000..0f2ce7ebf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a1ab463999957845.js @@ -0,0 +1 @@ +a(); diff --git a/compiler/tests-js-parser/pass-explicit/a1cd0d76806cef90.js b/compiler/tests-js-parser/pass-explicit/a1cd0d76806cef90.js new file mode 100644 index 000000000..d9835da83 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a1cd0d76806cef90.js @@ -0,0 +1,3 @@ +((function () { + return (typeof (a())) != ("b"); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a1dde88d8a87b573.module.js b/compiler/tests-js-parser/pass-explicit/a1dde88d8a87b573.module.js new file mode 100644 index 000000000..8f19f10e3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a1dde88d8a87b573.module.js @@ -0,0 +1 @@ +import {a} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/a2042d86c592dd55.js b/compiler/tests-js-parser/pass-explicit/a2042d86c592dd55.js new file mode 100644 index 000000000..91da166fa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a2042d86c592dd55.js @@ -0,0 +1 @@ +("a") - (1); diff --git a/compiler/tests-js-parser/pass-explicit/a248ef84a404262c.js b/compiler/tests-js-parser/pass-explicit/a248ef84a404262c.js new file mode 100644 index 000000000..34b58ff08 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a248ef84a404262c.js @@ -0,0 +1 @@ +`$`; diff --git a/compiler/tests-js-parser/pass-explicit/a2781f8227f7f1e6.js b/compiler/tests-js-parser/pass-explicit/a2781f8227f7f1e6.js new file mode 100644 index 000000000..e5155ac94 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a2781f8227f7f1e6.js @@ -0,0 +1 @@ +[...{a}] = b; diff --git a/compiler/tests-js-parser/pass-explicit/a2798917405b080b.js b/compiler/tests-js-parser/pass-explicit/a2798917405b080b.js new file mode 100644 index 000000000..828c2361b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a2798917405b080b.js @@ -0,0 +1 @@ +try {} catch ({}) {} diff --git a/compiler/tests-js-parser/pass-explicit/a29b007e8fb9d020.js b/compiler/tests-js-parser/pass-explicit/a29b007e8fb9d020.js new file mode 100644 index 000000000..cdd199752 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a29b007e8fb9d020.js @@ -0,0 +1 @@ +[a, b, ...c] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/a2c2339691fc48fb.js b/compiler/tests-js-parser/pass-explicit/a2c2339691fc48fb.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/a2cb5a14559c6a50.js b/compiler/tests-js-parser/pass-explicit/a2cb5a14559c6a50.js new file mode 100644 index 000000000..42c9869dc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a2cb5a14559c6a50.js @@ -0,0 +1 @@ +try {} catch (yield) {} diff --git a/compiler/tests-js-parser/pass-explicit/a2f26b79b01628f9.js b/compiler/tests-js-parser/pass-explicit/a2f26b79b01628f9.js new file mode 100644 index 000000000..1a70dfd2e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a2f26b79b01628f9.js @@ -0,0 +1,4 @@ +((function () { + var a = (1); + with (b) arguments = (2); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a33250f92a2f000e.js b/compiler/tests-js-parser/pass-explicit/a33250f92a2f000e.js new file mode 100644 index 000000000..9d6793c97 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a33250f92a2f000e.js @@ -0,0 +1,3 @@ +function a(b, c) { + return (b--) >> c; +} diff --git a/compiler/tests-js-parser/pass-explicit/a353c62d8ed56d6f.js b/compiler/tests-js-parser/pass-explicit/a353c62d8ed56d6f.js new file mode 100644 index 000000000..4989e81d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a353c62d8ed56d6f.js @@ -0,0 +1,4 @@ +{ + throw a; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/a378fc25898cf05b.js b/compiler/tests-js-parser/pass-explicit/a378fc25898cf05b.js new file mode 100644 index 000000000..a6e956190 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a378fc25898cf05b.js @@ -0,0 +1 @@ +((new a).b)(); diff --git a/compiler/tests-js-parser/pass-explicit/a3b497c58f78b243.js b/compiler/tests-js-parser/pass-explicit/a3b497c58f78b243.js new file mode 100644 index 000000000..33cc66975 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a3b497c58f78b243.js @@ -0,0 +1,3 @@ +((function () { + function a() {} +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a41e5072dd6dda98.js b/compiler/tests-js-parser/pass-explicit/a41e5072dd6dda98.js new file mode 100644 index 000000000..a784ccccb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a41e5072dd6dda98.js @@ -0,0 +1 @@ +with (a) b; diff --git a/compiler/tests-js-parser/pass-explicit/a42a93f3af33bbc5.js b/compiler/tests-js-parser/pass-explicit/a42a93f3af33bbc5.js new file mode 100644 index 000000000..daf2f2f4b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a42a93f3af33bbc5.js @@ -0,0 +1,10 @@ +a = (1); +if (b) c(); +a = (2); +for (d = (3); d < (4); d++) (e.f)(d); +a = (5); +for (; d < (6); d++) (e.f)(d); +a = (7); +switch (b) {} +a = (8); +with (g) {} diff --git a/compiler/tests-js-parser/pass-explicit/a43df1aea659fab8.js b/compiler/tests-js-parser/pass-explicit/a43df1aea659fab8.js new file mode 100644 index 000000000..64b454c3b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a43df1aea659fab8.js @@ -0,0 +1 @@ +(a & b) & c; diff --git a/compiler/tests-js-parser/pass-explicit/a445a478b4ce0c58.js b/compiler/tests-js-parser/pass-explicit/a445a478b4ce0c58.js new file mode 100644 index 000000000..7e11e4771 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a445a478b4ce0c58.js @@ -0,0 +1,3 @@ +({get a() { + return b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/a454d2e2ab3484e6.js b/compiler/tests-js-parser/pass-explicit/a454d2e2ab3484e6.js new file mode 100644 index 000000000..064fa2a39 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a454d2e2ab3484e6.js @@ -0,0 +1 @@ +(function* () {}); diff --git a/compiler/tests-js-parser/pass-explicit/a487d6498ec0efbf.module.js b/compiler/tests-js-parser/pass-explicit/a487d6498ec0efbf.module.js new file mode 100644 index 000000000..4b992e32e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a487d6498ec0efbf.module.js @@ -0,0 +1 @@ +import a from "a"; diff --git a/compiler/tests-js-parser/pass-explicit/a4931f8127e03c4e.js b/compiler/tests-js-parser/pass-explicit/a4931f8127e03c4e.js new file mode 100644 index 000000000..4439aaab1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a4931f8127e03c4e.js @@ -0,0 +1 @@ +a.null; diff --git a/compiler/tests-js-parser/pass-explicit/a4b3402765acaa0e.js b/compiler/tests-js-parser/pass-explicit/a4b3402765acaa0e.js new file mode 100644 index 000000000..e0555370c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a4b3402765acaa0e.js @@ -0,0 +1 @@ +a ? b : c; diff --git a/compiler/tests-js-parser/pass-explicit/a4d62a651f69d815.js b/compiler/tests-js-parser/pass-explicit/a4d62a651f69d815.js new file mode 100644 index 000000000..6ae854921 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a4d62a651f69d815.js @@ -0,0 +1 @@ +if (a) function b() {} diff --git a/compiler/tests-js-parser/pass-explicit/a515d7aaea7b816f.js b/compiler/tests-js-parser/pass-explicit/a515d7aaea7b816f.js new file mode 100644 index 000000000..109f75592 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a515d7aaea7b816f.js @@ -0,0 +1,3 @@ +((function () { + if (a) return 1; else return; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a54cca69085ad35a.js b/compiler/tests-js-parser/pass-explicit/a54cca69085ad35a.js new file mode 100644 index 000000000..d0af9f5ae --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a54cca69085ad35a.js @@ -0,0 +1,3 @@ +class a { + static set b (c) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/a54ce6036e646e24.js b/compiler/tests-js-parser/pass-explicit/a54ce6036e646e24.js new file mode 100644 index 000000000..a2e489ad7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a54ce6036e646e24.js @@ -0,0 +1,2 @@ +a = ((((b % c) / c) * d) * (1)); +a = ((b % c) * (2)); diff --git a/compiler/tests-js-parser/pass-explicit/a59e0d0b4d3e1b7d.js b/compiler/tests-js-parser/pass-explicit/a59e0d0b4d3e1b7d.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a59e0d0b4d3e1b7d.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/a5a01023fef4d506.js b/compiler/tests-js-parser/pass-explicit/a5a01023fef4d506.js new file mode 100644 index 000000000..d8f4483f3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a5a01023fef4d506.js @@ -0,0 +1,4 @@ +a["b"]; +a["in"]; +a["eval"]; +a["arguments"]; diff --git a/compiler/tests-js-parser/pass-explicit/a5a7eb83bf27418b.js b/compiler/tests-js-parser/pass-explicit/a5a7eb83bf27418b.js new file mode 100644 index 000000000..94afe7955 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a5a7eb83bf27418b.js @@ -0,0 +1 @@ +for (a in b) c(a); diff --git a/compiler/tests-js-parser/pass-explicit/a5aaa3992025795a.js b/compiler/tests-js-parser/pass-explicit/a5aaa3992025795a.js new file mode 100644 index 000000000..60d8653ed --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a5aaa3992025795a.js @@ -0,0 +1 @@ +({yield = 1} = (2)); diff --git a/compiler/tests-js-parser/pass-explicit/a5b30a03e9c774af.js b/compiler/tests-js-parser/pass-explicit/a5b30a03e9c774af.js new file mode 100644 index 000000000..09b576409 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a5b30a03e9c774af.js @@ -0,0 +1,13 @@ +try { + ((function () { + a("b"); + })()); +} catch (c) { + ((function () { + a("b"); + })()); +} finally { + ((function () { + a("b"); + })()); +} diff --git a/compiler/tests-js-parser/pass-explicit/a62c6323a3696fa8.js b/compiler/tests-js-parser/pass-explicit/a62c6323a3696fa8.js new file mode 100644 index 000000000..d26f9187a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a62c6323a3696fa8.js @@ -0,0 +1 @@ +(""); diff --git a/compiler/tests-js-parser/pass-explicit/a6806d6fedbf6759.js b/compiler/tests-js-parser/pass-explicit/a6806d6fedbf6759.js new file mode 100644 index 000000000..21538a372 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a6806d6fedbf6759.js @@ -0,0 +1 @@ +[1, 2, , 3]; diff --git a/compiler/tests-js-parser/pass-explicit/a68bf27df978135d.module.js b/compiler/tests-js-parser/pass-explicit/a68bf27df978135d.module.js new file mode 100644 index 000000000..619ada57a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a68bf27df978135d.module.js @@ -0,0 +1,2 @@ +export default 1; +2; diff --git a/compiler/tests-js-parser/pass-explicit/a6b7dab7088e5269.js b/compiler/tests-js-parser/pass-explicit/a6b7dab7088e5269.js new file mode 100644 index 000000000..efdbd0971 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a6b7dab7088e5269.js @@ -0,0 +1 @@ +var a = (/[a-z]/i); diff --git a/compiler/tests-js-parser/pass-explicit/a6cb605b66ef0eb5.js b/compiler/tests-js-parser/pass-explicit/a6cb605b66ef0eb5.js new file mode 100644 index 000000000..8f3f27e8a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a6cb605b66ef0eb5.js @@ -0,0 +1,3 @@ +((function () { + ((!(!a)), (!b)), (1); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a7964b1dcfd2dc21.js b/compiler/tests-js-parser/pass-explicit/a7964b1dcfd2dc21.js new file mode 100644 index 000000000..4e271444b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a7964b1dcfd2dc21.js @@ -0,0 +1 @@ +(() => (1)), (2); diff --git a/compiler/tests-js-parser/pass-explicit/a7b8ce1d4c0f0bc2.js b/compiler/tests-js-parser/pass-explicit/a7b8ce1d4c0f0bc2.js new file mode 100644 index 000000000..415d3befa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a7b8ce1d4c0f0bc2.js @@ -0,0 +1,4 @@ +b: while (1) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/a7c8ad2a73ed00d0.js b/compiler/tests-js-parser/pass-explicit/a7c8ad2a73ed00d0.js new file mode 100644 index 000000000..6d0216c88 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a7c8ad2a73ed00d0.js @@ -0,0 +1 @@ +for (let [a, b] of c) ; diff --git a/compiler/tests-js-parser/pass-explicit/a830df7cf2e74c9f.js b/compiler/tests-js-parser/pass-explicit/a830df7cf2e74c9f.js new file mode 100644 index 000000000..ff3c9948c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a830df7cf2e74c9f.js @@ -0,0 +1,3 @@ +({get a() { + super[1] = (2); +}}); diff --git a/compiler/tests-js-parser/pass-explicit/a8535eac4c7c9c3a.js b/compiler/tests-js-parser/pass-explicit/a8535eac4c7c9c3a.js new file mode 100644 index 000000000..03ceb306b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a8535eac4c7c9c3a.js @@ -0,0 +1,3 @@ +class a { + static() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/a86a29773d1168d3.js b/compiler/tests-js-parser/pass-explicit/a86a29773d1168d3.js new file mode 100644 index 000000000..4d5aaa8c4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a86a29773d1168d3.js @@ -0,0 +1 @@ +try {} catch ([]) {} diff --git a/compiler/tests-js-parser/pass-explicit/a871e54c3956acd9.js b/compiler/tests-js-parser/pass-explicit/a871e54c3956acd9.js new file mode 100644 index 000000000..b6ba29467 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a871e54c3956acd9.js @@ -0,0 +1,3 @@ +a: while (true) { + continue a; +} diff --git a/compiler/tests-js-parser/pass-explicit/a885d88fb046dea5.js b/compiler/tests-js-parser/pass-explicit/a885d88fb046dea5.js new file mode 100644 index 000000000..891c9f1b5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a885d88fb046dea5.js @@ -0,0 +1,3 @@ +((function () { + for (var a in []) ; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/a8a03a88237c4e8f.js b/compiler/tests-js-parser/pass-explicit/a8a03a88237c4e8f.js new file mode 100644 index 000000000..b0b3469b2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a8a03a88237c4e8f.js @@ -0,0 +1 @@ +({a: b = (0)}); diff --git a/compiler/tests-js-parser/pass-explicit/a8b6c3139974f6e1.js b/compiler/tests-js-parser/pass-explicit/a8b6c3139974f6e1.js new file mode 100644 index 000000000..f9b7b4d01 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a8b6c3139974f6e1.js @@ -0,0 +1,3 @@ +({set null (a) { + a; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/a8b832d61af9cdc4.js b/compiler/tests-js-parser/pass-explicit/a8b832d61af9cdc4.js new file mode 100644 index 000000000..a6ee0a540 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a8b832d61af9cdc4.js @@ -0,0 +1 @@ +/[a-z]/y; diff --git a/compiler/tests-js-parser/pass-explicit/a8fea31fe6aa588e.js b/compiler/tests-js-parser/pass-explicit/a8fea31fe6aa588e.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a8fea31fe6aa588e.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/a91ad31c88855e59.js b/compiler/tests-js-parser/pass-explicit/a91ad31c88855e59.js new file mode 100644 index 000000000..e33d29a9a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a91ad31c88855e59.js @@ -0,0 +1 @@ +var implements, interface, package; diff --git a/compiler/tests-js-parser/pass-explicit/a93f6b22796d4868.js b/compiler/tests-js-parser/pass-explicit/a93f6b22796d4868.js new file mode 100644 index 000000000..32d7999de --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a93f6b22796d4868.js @@ -0,0 +1,3 @@ +function* a() { + () => yield; +} diff --git a/compiler/tests-js-parser/pass-explicit/a953f09a1b6b6725.js b/compiler/tests-js-parser/pass-explicit/a953f09a1b6b6725.js new file mode 100644 index 000000000..765da1143 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a953f09a1b6b6725.js @@ -0,0 +1 @@ +2; diff --git a/compiler/tests-js-parser/pass-explicit/a955c7a892679016.js b/compiler/tests-js-parser/pass-explicit/a955c7a892679016.js new file mode 100644 index 000000000..20fbb77a6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a955c7a892679016.js @@ -0,0 +1 @@ +for (var a in b) c(a); diff --git a/compiler/tests-js-parser/pass-explicit/a9b0aedbd9f25ec9.js b/compiler/tests-js-parser/pass-explicit/a9b0aedbd9f25ec9.js new file mode 100644 index 000000000..a3cce3987 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a9b0aedbd9f25ec9.js @@ -0,0 +1,3 @@ +var a = (function () { + b(); +}); diff --git a/compiler/tests-js-parser/pass-explicit/a9e054dbd43d4b86.js b/compiler/tests-js-parser/pass-explicit/a9e054dbd43d4b86.js new file mode 100644 index 000000000..d685cab15 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a9e054dbd43d4b86.js @@ -0,0 +1 @@ +(a * b) / c; diff --git a/compiler/tests-js-parser/pass-explicit/a9e4ff39f145a1fd.js b/compiler/tests-js-parser/pass-explicit/a9e4ff39f145a1fd.js new file mode 100644 index 000000000..1b4069163 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a9e4ff39f145a1fd.js @@ -0,0 +1 @@ +({a({b} = {b: 1}) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/a9f99e657441a735.js b/compiler/tests-js-parser/pass-explicit/a9f99e657441a735.js new file mode 100644 index 000000000..764ae8da8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/a9f99e657441a735.js @@ -0,0 +1,3 @@ +(class { + static() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/aa06ccdc7ff9e10d.js b/compiler/tests-js-parser/pass-explicit/aa06ccdc7ff9e10d.js new file mode 100644 index 000000000..453f42fd1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aa06ccdc7ff9e10d.js @@ -0,0 +1 @@ +({a: [b] = 1} = (2)); diff --git a/compiler/tests-js-parser/pass-explicit/aa3b466be5c7f7e3.js b/compiler/tests-js-parser/pass-explicit/aa3b466be5c7f7e3.js new file mode 100644 index 000000000..71931a686 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aa3b466be5c7f7e3.js @@ -0,0 +1,4 @@ +for (;;) { + if (a) continue; + continue; +} diff --git a/compiler/tests-js-parser/pass-explicit/aa3d1fa7a22e6460.js b/compiler/tests-js-parser/pass-explicit/aa3d1fa7a22e6460.js new file mode 100644 index 000000000..2815b34f5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aa3d1fa7a22e6460.js @@ -0,0 +1 @@ +while (true) var a; diff --git a/compiler/tests-js-parser/pass-explicit/aa7e721756949024.js b/compiler/tests-js-parser/pass-explicit/aa7e721756949024.js new file mode 100644 index 000000000..112a6a0d8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aa7e721756949024.js @@ -0,0 +1,3 @@ +({set a (b) { + (super.c)[1] = (2); +}}); diff --git a/compiler/tests-js-parser/pass-explicit/aaa0bc7fa72df5e4.js b/compiler/tests-js-parser/pass-explicit/aaa0bc7fa72df5e4.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aaa0bc7fa72df5e4.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/aab08ba9fd01cbb8.js b/compiler/tests-js-parser/pass-explicit/aab08ba9fd01cbb8.js new file mode 100644 index 000000000..3cd8d485a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aab08ba9fd01cbb8.js @@ -0,0 +1 @@ +(((a.b).c).d)(1); diff --git a/compiler/tests-js-parser/pass-explicit/aab51bc524d9c623.js b/compiler/tests-js-parser/pass-explicit/aab51bc524d9c623.js new file mode 100644 index 000000000..915c71a0d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aab51bc524d9c623.js @@ -0,0 +1,3 @@ +((function () { + a((null) != (b ? c : (void (1)))); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/aac70baa56299267.js b/compiler/tests-js-parser/pass-explicit/aac70baa56299267.js new file mode 100644 index 000000000..031ec74d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aac70baa56299267.js @@ -0,0 +1,3 @@ +function a() { + return (((void (1)), (void (2))), a), (void (3)); +} diff --git a/compiler/tests-js-parser/pass-explicit/aaf1be6cd60a9ac9.js b/compiler/tests-js-parser/pass-explicit/aaf1be6cd60a9ac9.js new file mode 100644 index 000000000..0ca5d95af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aaf1be6cd60a9ac9.js @@ -0,0 +1 @@ +({a() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/ab23ca0a6e356883.js b/compiler/tests-js-parser/pass-explicit/ab23ca0a6e356883.js new file mode 100644 index 000000000..25d84a62b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ab23ca0a6e356883.js @@ -0,0 +1,4 @@ +do { + a(); +} while (false); +b(); diff --git a/compiler/tests-js-parser/pass-explicit/ab452fc45813857a.js b/compiler/tests-js-parser/pass-explicit/ab452fc45813857a.js new file mode 100644 index 000000000..0407539cb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ab452fc45813857a.js @@ -0,0 +1,8 @@ +if (a) { + try { + b("try"); + } catch (c) {} + ((function () { + b("d"); + })()); +} diff --git a/compiler/tests-js-parser/pass-explicit/ab4734949243c00a.js b/compiler/tests-js-parser/pass-explicit/ab4734949243c00a.js new file mode 100644 index 000000000..ac860270c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ab4734949243c00a.js @@ -0,0 +1 @@ +new a(b, ...(c = d)); diff --git a/compiler/tests-js-parser/pass-explicit/ab7ea8d738da7043.js b/compiler/tests-js-parser/pass-explicit/ab7ea8d738da7043.js new file mode 100644 index 000000000..0fedeed82 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ab7ea8d738da7043.js @@ -0,0 +1,3 @@ +function a() { + return; +} diff --git a/compiler/tests-js-parser/pass-explicit/abcfae2381708c43.module.js b/compiler/tests-js-parser/pass-explicit/abcfae2381708c43.module.js new file mode 100644 index 000000000..2c7930d92 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/abcfae2381708c43.module.js @@ -0,0 +1 @@ +export {default} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/abd5e4aa1a9f99ba.js b/compiler/tests-js-parser/pass-explicit/abd5e4aa1a9f99ba.js new file mode 100644 index 000000000..56b958c01 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/abd5e4aa1a9f99ba.js @@ -0,0 +1 @@ +let a, x󠇕; diff --git a/compiler/tests-js-parser/pass-explicit/ac09566949f0db57.js b/compiler/tests-js-parser/pass-explicit/ac09566949f0db57.js new file mode 100644 index 000000000..ecc0a6b56 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ac09566949f0db57.js @@ -0,0 +1,4 @@ +{ + do {} while (false); + false; +} diff --git a/compiler/tests-js-parser/pass-explicit/ac112e0c69fe603e.js b/compiler/tests-js-parser/pass-explicit/ac112e0c69fe603e.js new file mode 100644 index 000000000..e28e3c87c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ac112e0c69fe603e.js @@ -0,0 +1 @@ +(a, b) => ("c"); diff --git a/compiler/tests-js-parser/pass-explicit/ac1bc6b81949c063.module.js b/compiler/tests-js-parser/pass-explicit/ac1bc6b81949c063.module.js new file mode 100644 index 000000000..e9b43e86f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ac1bc6b81949c063.module.js @@ -0,0 +1 @@ +let a; diff --git a/compiler/tests-js-parser/pass-explicit/ac6bbe8465f70ebd.module.js b/compiler/tests-js-parser/pass-explicit/ac6bbe8465f70ebd.module.js new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ac6bbe8465f70ebd.module.js @@ -0,0 +1 @@ +export {}; diff --git a/compiler/tests-js-parser/pass-explicit/ac73bc36bbc48890.js b/compiler/tests-js-parser/pass-explicit/ac73bc36bbc48890.js new file mode 100644 index 000000000..39082732b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ac73bc36bbc48890.js @@ -0,0 +1,2 @@ +"use\x20strict"; +with (a) b = c; diff --git a/compiler/tests-js-parser/pass-explicit/ad06370e34811a6a.js b/compiler/tests-js-parser/pass-explicit/ad06370e34811a6a.js new file mode 100644 index 000000000..2c1bf58a2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ad06370e34811a6a.js @@ -0,0 +1 @@ +({a: b = (0)} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/ad0fd65944942eee.js b/compiler/tests-js-parser/pass-explicit/ad0fd65944942eee.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ad0fd65944942eee.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/ad410fec8c09f67b.js b/compiler/tests-js-parser/pass-explicit/ad410fec8c09f67b.js new file mode 100644 index 000000000..a3040d826 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ad410fec8c09f67b.js @@ -0,0 +1 @@ +for ([a, b] of c) ; diff --git a/compiler/tests-js-parser/pass-explicit/ad4414fcaaa6abb7.js b/compiler/tests-js-parser/pass-explicit/ad4414fcaaa6abb7.js new file mode 100644 index 000000000..1c2a2c2b1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ad4414fcaaa6abb7.js @@ -0,0 +1 @@ +if (a) b; diff --git a/compiler/tests-js-parser/pass-explicit/ad6bf12aa7eda975.js b/compiler/tests-js-parser/pass-explicit/ad6bf12aa7eda975.js new file mode 100644 index 000000000..219c229ce --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ad6bf12aa7eda975.js @@ -0,0 +1 @@ +(function ([a]) {}); diff --git a/compiler/tests-js-parser/pass-explicit/ad6bfcbfca5afde1.js b/compiler/tests-js-parser/pass-explicit/ad6bfcbfca5afde1.js new file mode 100644 index 000000000..af22c443a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ad6bfcbfca5afde1.js @@ -0,0 +1 @@ +.14; diff --git a/compiler/tests-js-parser/pass-explicit/ad7d61a732903cd8.js b/compiler/tests-js-parser/pass-explicit/ad7d61a732903cd8.js new file mode 100644 index 000000000..6c3394b85 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ad7d61a732903cd8.js @@ -0,0 +1 @@ +({a([b, c]) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/adad54e09949b0e9.js b/compiler/tests-js-parser/pass-explicit/adad54e09949b0e9.js new file mode 100644 index 000000000..076705f99 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/adad54e09949b0e9.js @@ -0,0 +1 @@ +a && b; diff --git a/compiler/tests-js-parser/pass-explicit/ade301f0d871c610.js b/compiler/tests-js-parser/pass-explicit/ade301f0d871c610.js new file mode 100644 index 000000000..f37dbb6ed --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ade301f0d871c610.js @@ -0,0 +1 @@ +"Hello\122World"; diff --git a/compiler/tests-js-parser/pass-explicit/ae204e41bacd8237.js b/compiler/tests-js-parser/pass-explicit/ae204e41bacd8237.js new file mode 100644 index 000000000..1143eace5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ae204e41bacd8237.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + super.yield; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/ae4bbee73a0f80a5.js b/compiler/tests-js-parser/pass-explicit/ae4bbee73a0f80a5.js new file mode 100644 index 000000000..1e28584e2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ae4bbee73a0f80a5.js @@ -0,0 +1 @@ +[1]; diff --git a/compiler/tests-js-parser/pass-explicit/ae700e3f8ff82c6c.js b/compiler/tests-js-parser/pass-explicit/ae700e3f8ff82c6c.js new file mode 100644 index 000000000..033b8b77a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ae700e3f8ff82c6c.js @@ -0,0 +1 @@ +(a()) + ((((b()), (c())), (d())), (e())); diff --git a/compiler/tests-js-parser/pass-explicit/ae89d08bdd65b56b.js b/compiler/tests-js-parser/pass-explicit/ae89d08bdd65b56b.js new file mode 100644 index 000000000..dfa6d6fa2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ae89d08bdd65b56b.js @@ -0,0 +1,4 @@ +class a { + b() {} + c() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/ae9667ad0d837abc.js b/compiler/tests-js-parser/pass-explicit/ae9667ad0d837abc.js new file mode 100644 index 000000000..2d356f83f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ae9667ad0d837abc.js @@ -0,0 +1,2 @@ +(((1), (2)), a)(); +(((3), (4)), (b.a))(); diff --git a/compiler/tests-js-parser/pass-explicit/ae97d36bd01b43b2.js b/compiler/tests-js-parser/pass-explicit/ae97d36bd01b43b2.js new file mode 100644 index 000000000..3f3ac12fb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ae97d36bd01b43b2.js @@ -0,0 +1 @@ +let [...a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/ae9a8ca09473df05.js b/compiler/tests-js-parser/pass-explicit/ae9a8ca09473df05.js new file mode 100644 index 000000000..82574fda9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ae9a8ca09473df05.js @@ -0,0 +1,3 @@ +((function () { + void (a ? (1) : (2)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/aec65a9745669870.js b/compiler/tests-js-parser/pass-explicit/aec65a9745669870.js new file mode 100644 index 000000000..a5c146638 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aec65a9745669870.js @@ -0,0 +1,4 @@ +((function () { + var a, b, c, d, e, f; + ((a, b), (c())) + ((d, e), (f())); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/aeca992c7be882ba.js b/compiler/tests-js-parser/pass-explicit/aeca992c7be882ba.js new file mode 100644 index 000000000..e468d7409 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/aeca992c7be882ba.js @@ -0,0 +1,3 @@ +((function () { + (a, (1)), (2); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/af17707f71e402a7.module.js b/compiler/tests-js-parser/pass-explicit/af17707f71e402a7.module.js new file mode 100644 index 000000000..b198c0910 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/af17707f71e402a7.module.js @@ -0,0 +1 @@ +import {a, b} from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/af1d905ed056724f.js b/compiler/tests-js-parser/pass-explicit/af1d905ed056724f.js new file mode 100644 index 000000000..b35725e34 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/af1d905ed056724f.js @@ -0,0 +1 @@ +var a = (function arguments() {}); diff --git a/compiler/tests-js-parser/pass-explicit/af4bbcea9802b120.js b/compiler/tests-js-parser/pass-explicit/af4bbcea9802b120.js new file mode 100644 index 000000000..73c910345 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/af4bbcea9802b120.js @@ -0,0 +1,3 @@ +(class { + a() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/af5766d06630bbc5.js b/compiler/tests-js-parser/pass-explicit/af5766d06630bbc5.js new file mode 100644 index 000000000..ed73c50b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/af5766d06630bbc5.js @@ -0,0 +1 @@ +[[a]] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/af97a3752e579223.js b/compiler/tests-js-parser/pass-explicit/af97a3752e579223.js new file mode 100644 index 000000000..702c8a4ff --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/af97a3752e579223.js @@ -0,0 +1,3 @@ +(function () { + yield * (1); +}); diff --git a/compiler/tests-js-parser/pass-explicit/afa63b136c835723.js b/compiler/tests-js-parser/pass-explicit/afa63b136c835723.js new file mode 100644 index 000000000..0421e093b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/afa63b136c835723.js @@ -0,0 +1 @@ +({a: 1, get b() {}, set 3 (c) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/afcf8bace3839da2.js b/compiler/tests-js-parser/pass-explicit/afcf8bace3839da2.js new file mode 100644 index 000000000..643bcbf31 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/afcf8bace3839da2.js @@ -0,0 +1,6 @@ +for (;;) { + with (a) { + continue; + } + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/affd557fd820e1f2.js b/compiler/tests-js-parser/pass-explicit/affd557fd820e1f2.js new file mode 100644 index 000000000..c228cf2d8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/affd557fd820e1f2.js @@ -0,0 +1 @@ +({get [a]() {}, set [a] (b) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/afffb6d317e53b92.js b/compiler/tests-js-parser/pass-explicit/afffb6d317e53b92.js new file mode 100644 index 000000000..d26f9187a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/afffb6d317e53b92.js @@ -0,0 +1 @@ +(""); diff --git a/compiler/tests-js-parser/pass-explicit/b030378ad6e36751.js b/compiler/tests-js-parser/pass-explicit/b030378ad6e36751.js new file mode 100644 index 000000000..f9e4c6ae0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b030378ad6e36751.js @@ -0,0 +1,3 @@ +class a { + static [b]() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/b0423be1317c7b69.js b/compiler/tests-js-parser/pass-explicit/b0423be1317c7b69.js new file mode 100644 index 000000000..6a213bdbe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b0423be1317c7b69.js @@ -0,0 +1 @@ +((1) + (2)) + (3); diff --git a/compiler/tests-js-parser/pass-explicit/b05d4355cc5e2802.js b/compiler/tests-js-parser/pass-explicit/b05d4355cc5e2802.js new file mode 100644 index 000000000..40327d1e8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b05d4355cc5e2802.js @@ -0,0 +1 @@ +a => (b => (c => (1))); diff --git a/compiler/tests-js-parser/pass-explicit/b0659cf9cb6793a2.js b/compiler/tests-js-parser/pass-explicit/b0659cf9cb6793a2.js new file mode 100644 index 000000000..c99ea190d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b0659cf9cb6793a2.js @@ -0,0 +1,3 @@ +class a extends b { + constructor(c = super()) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/b06e2c3814e46579.js b/compiler/tests-js-parser/pass-explicit/b06e2c3814e46579.js new file mode 100644 index 000000000..f9987ca6e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b06e2c3814e46579.js @@ -0,0 +1,3 @@ +function* a() { + yield (class {}); +} diff --git a/compiler/tests-js-parser/pass-explicit/b07c5fdc1003316b.js b/compiler/tests-js-parser/pass-explicit/b07c5fdc1003316b.js new file mode 100644 index 000000000..07a30db21 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b07c5fdc1003316b.js @@ -0,0 +1,7 @@ +switch (a) { + case "b": + c(); + break; + default: + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/b0a834e1180ccd73.js b/compiler/tests-js-parser/pass-explicit/b0a834e1180ccd73.js new file mode 100644 index 000000000..2e035d847 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b0a834e1180ccd73.js @@ -0,0 +1 @@ +(1) / (2); diff --git a/compiler/tests-js-parser/pass-explicit/b0c6752e1db068ed.js b/compiler/tests-js-parser/pass-explicit/b0c6752e1db068ed.js new file mode 100644 index 000000000..48cde3640 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b0c6752e1db068ed.js @@ -0,0 +1 @@ +(a = yield) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/b0d44fd20353fd82.js b/compiler/tests-js-parser/pass-explicit/b0d44fd20353fd82.js new file mode 100644 index 000000000..bae164c5b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b0d44fd20353fd82.js @@ -0,0 +1 @@ +for (let yield in 1) ; diff --git a/compiler/tests-js-parser/pass-explicit/b0fdc038ee292aba.js b/compiler/tests-js-parser/pass-explicit/b0fdc038ee292aba.js new file mode 100644 index 000000000..e26bd9a24 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b0fdc038ee292aba.js @@ -0,0 +1 @@ +9; diff --git a/compiler/tests-js-parser/pass-explicit/b1072e92becf06a9.js b/compiler/tests-js-parser/pass-explicit/b1072e92becf06a9.js new file mode 100644 index 000000000..2e06797b8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b1072e92becf06a9.js @@ -0,0 +1,3 @@ +((function () { + a((typeof b) === ("function")); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/b13e700d2613a5a7.js b/compiler/tests-js-parser/pass-explicit/b13e700d2613a5a7.js new file mode 100644 index 000000000..e36b25599 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b13e700d2613a5a7.js @@ -0,0 +1,5 @@ +while (a) { + b(); + c(); + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/b15ab152f8531a9f.js b/compiler/tests-js-parser/pass-explicit/b15ab152f8531a9f.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/b175bdef718c4012.js b/compiler/tests-js-parser/pass-explicit/b175bdef718c4012.js new file mode 100644 index 000000000..aa65ec3f9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b175bdef718c4012.js @@ -0,0 +1,3 @@ +if (a) { + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/b195e06e2ba5e787.js b/compiler/tests-js-parser/pass-explicit/b195e06e2ba5e787.js new file mode 100644 index 000000000..2e30be494 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b195e06e2ba5e787.js @@ -0,0 +1 @@ +(a.in) / b; diff --git a/compiler/tests-js-parser/pass-explicit/b1b969fae2973dae.js b/compiler/tests-js-parser/pass-explicit/b1b969fae2973dae.js new file mode 100644 index 000000000..6d675ea22 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b1b969fae2973dae.js @@ -0,0 +1,7 @@ +while (a) { + { + b(); + while (a) ; + } + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/b1c37dedeec0b867.js b/compiler/tests-js-parser/pass-explicit/b1c37dedeec0b867.js new file mode 100644 index 000000000..7b129501f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b1c37dedeec0b867.js @@ -0,0 +1 @@ +function a(...b) {} diff --git a/compiler/tests-js-parser/pass-explicit/b2048a6a14348122.js b/compiler/tests-js-parser/pass-explicit/b2048a6a14348122.js new file mode 100644 index 000000000..bc848c89e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b2048a6a14348122.js @@ -0,0 +1 @@ +for (a; b; c) ; diff --git a/compiler/tests-js-parser/pass-explicit/b205355de22689d1.js b/compiler/tests-js-parser/pass-explicit/b205355de22689d1.js new file mode 100644 index 000000000..be03dc48b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b205355de22689d1.js @@ -0,0 +1,5 @@ +function* a() { + ({set b (c) { + yield; + }}); +} diff --git a/compiler/tests-js-parser/pass-explicit/b2495b0864c7835a.js b/compiler/tests-js-parser/pass-explicit/b2495b0864c7835a.js new file mode 100644 index 000000000..23358d8df --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b2495b0864c7835a.js @@ -0,0 +1,3 @@ +a: { + break a; +} diff --git a/compiler/tests-js-parser/pass-explicit/b24fa2a1936d38d9.js b/compiler/tests-js-parser/pass-explicit/b24fa2a1936d38d9.js new file mode 100644 index 000000000..c8405f72e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b24fa2a1936d38d9.js @@ -0,0 +1 @@ +({3() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/b25057b11104844d.js b/compiler/tests-js-parser/pass-explicit/b25057b11104844d.js new file mode 100644 index 000000000..c20659079 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b25057b11104844d.js @@ -0,0 +1,2 @@ +var a = ({a: 1}); +a({a: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/b29070859dbeaf08.js b/compiler/tests-js-parser/pass-explicit/b29070859dbeaf08.js new file mode 100644 index 000000000..f8ee4ddd3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b29070859dbeaf08.js @@ -0,0 +1 @@ +[a, b = 1, [c, ...a[2]] = {}] = (3); diff --git a/compiler/tests-js-parser/pass-explicit/b2a13c2c2c795427.js b/compiler/tests-js-parser/pass-explicit/b2a13c2c2c795427.js new file mode 100644 index 000000000..6f540d223 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b2a13c2c2c795427.js @@ -0,0 +1 @@ +for (;;) ; diff --git a/compiler/tests-js-parser/pass-explicit/b2a567473d09b770.js b/compiler/tests-js-parser/pass-explicit/b2a567473d09b770.js new file mode 100644 index 000000000..a6d3d78ef --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b2a567473d09b770.js @@ -0,0 +1,4 @@ +function a() { + debugger; + return; +} diff --git a/compiler/tests-js-parser/pass-explicit/b2e6c124e2822117.js b/compiler/tests-js-parser/pass-explicit/b2e6c124e2822117.js new file mode 100644 index 000000000..777638568 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b2e6c124e2822117.js @@ -0,0 +1 @@ +({__proto__: null, get __proto__() {}, set __proto__ (a) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/b3093945d65d33d5.js b/compiler/tests-js-parser/pass-explicit/b3093945d65d33d5.js new file mode 100644 index 000000000..5e864c110 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b3093945d65d33d5.js @@ -0,0 +1 @@ +for (var a = (1);;) ; diff --git a/compiler/tests-js-parser/pass-explicit/b32aa0e4195927c1.js b/compiler/tests-js-parser/pass-explicit/b32aa0e4195927c1.js new file mode 100644 index 000000000..2e035d847 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b32aa0e4195927c1.js @@ -0,0 +1 @@ +(1) / (2); diff --git a/compiler/tests-js-parser/pass-explicit/b363a70923be42c8.js b/compiler/tests-js-parser/pass-explicit/b363a70923be42c8.js new file mode 100644 index 000000000..3199f0871 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b363a70923be42c8.js @@ -0,0 +1 @@ +for (;;) {} diff --git a/compiler/tests-js-parser/pass-explicit/b3717dd9314332d2.js b/compiler/tests-js-parser/pass-explicit/b3717dd9314332d2.js new file mode 100644 index 000000000..b6d7dd5e3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b3717dd9314332d2.js @@ -0,0 +1 @@ +/(?!.){0,}?/; diff --git a/compiler/tests-js-parser/pass-explicit/b376d3924d77aa8a.js b/compiler/tests-js-parser/pass-explicit/b376d3924d77aa8a.js new file mode 100644 index 000000000..27f5cdc0b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b376d3924d77aa8a.js @@ -0,0 +1 @@ ++({"\\": 1}); diff --git a/compiler/tests-js-parser/pass-explicit/b3e783194b210cc3.js b/compiler/tests-js-parser/pass-explicit/b3e783194b210cc3.js new file mode 100644 index 000000000..d4104f074 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b3e783194b210cc3.js @@ -0,0 +1,29 @@ +var a; +a = ((true) || b); +a = ((1) || ((c.d)("a"))); +a = (((2) * (3)) || ((4) * b)); +a = (((5) == (6)) || (b + (7))); +a = (("e") || ((8) - b)); +a = (((9) + ("")) || (b / (10))); +a = ((-(4.5)) || ((11) << b)); +a = ((12) || (13)); +a = ((false) || b); +a = ((14) || ((c.d)("f"))); +a = (NaN || ((c.d)("g"))); +a = (h || ((15) * b)); +a = ((null) || (b + (16))); +a = ((((17) * (18)) - (19)) || ((20) - b)); +a = (((21) == (22)) || (b / (23))); +a = ((!("e")) || ((24) % b)); +a = ((null) || (25)); +a = ((c.d)((h && b) || (null))); +a = ((c.d)(h || (b && (null)))); +a = (b || (true)); +a = (((c.d)("a")) || (26)); +a = (((27) - b) || ("e")); +a = (((28) << b) || (-(4.5))); +a = (b || (false)); +a = (((c.d)("f")) || NaN); +a = (((c.d)("g")) || (29)); +a = (((30) * b) || h); +a = ((b + (31)) || (null)); diff --git a/compiler/tests-js-parser/pass-explicit/b41dad3363eaab20.js b/compiler/tests-js-parser/pass-explicit/b41dad3363eaab20.js new file mode 100644 index 000000000..4b5f73198 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b41dad3363eaab20.js @@ -0,0 +1 @@ +while (1) ; diff --git a/compiler/tests-js-parser/pass-explicit/b42377ca7015e7d4.js b/compiler/tests-js-parser/pass-explicit/b42377ca7015e7d4.js new file mode 100644 index 000000000..6ddce0dfd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b42377ca7015e7d4.js @@ -0,0 +1 @@ +const {a} = ({}); diff --git a/compiler/tests-js-parser/pass-explicit/b433b0cfef2a3cd1.js b/compiler/tests-js-parser/pass-explicit/b433b0cfef2a3cd1.js new file mode 100644 index 000000000..d133035ec --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b433b0cfef2a3cd1.js @@ -0,0 +1 @@ +({[a]: function () {}}); diff --git a/compiler/tests-js-parser/pass-explicit/b43b759f208e1afb.js b/compiler/tests-js-parser/pass-explicit/b43b759f208e1afb.js new file mode 100644 index 000000000..a04408bb0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b43b759f208e1afb.js @@ -0,0 +1,4 @@ +while (true) { + break; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/b4546b664cc70c58.js b/compiler/tests-js-parser/pass-explicit/b4546b664cc70c58.js new file mode 100644 index 000000000..415d3befa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b4546b664cc70c58.js @@ -0,0 +1,4 @@ +b: while (1) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/b45d869ab09c7b00.js b/compiler/tests-js-parser/pass-explicit/b45d869ab09c7b00.js new file mode 100644 index 000000000..9fd41adf4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b45d869ab09c7b00.js @@ -0,0 +1 @@ +for (let [a] of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/b46a2c1b5d9a97cd.js b/compiler/tests-js-parser/pass-explicit/b46a2c1b5d9a97cd.js new file mode 100644 index 000000000..0b2c1c2ea --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b46a2c1b5d9a97cd.js @@ -0,0 +1 @@ +`42`; diff --git a/compiler/tests-js-parser/pass-explicit/b471292fedf2f813.js b/compiler/tests-js-parser/pass-explicit/b471292fedf2f813.js new file mode 100644 index 000000000..92db3a6a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b471292fedf2f813.js @@ -0,0 +1,4 @@ +function a() { + b(); + function c() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/b49ca42695798691.js b/compiler/tests-js-parser/pass-explicit/b49ca42695798691.js new file mode 100644 index 000000000..3df500cc7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b49ca42695798691.js @@ -0,0 +1,4 @@ +((function () { + var a; + if (a) return; else return; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/b4a54642589bc396.js b/compiler/tests-js-parser/pass-explicit/b4a54642589bc396.js new file mode 100644 index 000000000..b13a17c1d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b4a54642589bc396.js @@ -0,0 +1 @@ +((a.$).b).c; diff --git a/compiler/tests-js-parser/pass-explicit/b4bc5f201c297bca.module.js b/compiler/tests-js-parser/pass-explicit/b4bc5f201c297bca.module.js new file mode 100644 index 000000000..51f26d6c5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b4bc5f201c297bca.module.js @@ -0,0 +1 @@ +import a, * as b from "baz"; diff --git a/compiler/tests-js-parser/pass-explicit/b506e9cc13c4ad2e.js b/compiler/tests-js-parser/pass-explicit/b506e9cc13c4ad2e.js new file mode 100644 index 000000000..29e3fe9c9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b506e9cc13c4ad2e.js @@ -0,0 +1 @@ +({0: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/b549d045fc8e93bf.js b/compiler/tests-js-parser/pass-explicit/b549d045fc8e93bf.js new file mode 100644 index 000000000..e4119d4cf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b549d045fc8e93bf.js @@ -0,0 +1,2 @@ +"use strict"; +try {} catch (a) {} diff --git a/compiler/tests-js-parser/pass-explicit/b563460c1031daf2.js b/compiler/tests-js-parser/pass-explicit/b563460c1031daf2.js new file mode 100644 index 000000000..023b7f5be --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b563460c1031daf2.js @@ -0,0 +1,3 @@ +({a() { + (super.b)(); +}}); diff --git a/compiler/tests-js-parser/pass-explicit/b5755ec32b9418af.js b/compiler/tests-js-parser/pass-explicit/b5755ec32b9418af.js new file mode 100644 index 000000000..f5c20fdcc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b5755ec32b9418af.js @@ -0,0 +1 @@ +({a, b} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/b5a1e1a3679f81ba.js b/compiler/tests-js-parser/pass-explicit/b5a1e1a3679f81ba.js new file mode 100644 index 000000000..6b9e64063 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b5a1e1a3679f81ba.js @@ -0,0 +1 @@ +({a}, ...b) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/b5bc1ffd90912fb1.js b/compiler/tests-js-parser/pass-explicit/b5bc1ffd90912fb1.js new file mode 100644 index 000000000..24d6994bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b5bc1ffd90912fb1.js @@ -0,0 +1 @@ +a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/b5cf21a87ec272d1.js b/compiler/tests-js-parser/pass-explicit/b5cf21a87ec272d1.js new file mode 100644 index 000000000..3574128a7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b5cf21a87ec272d1.js @@ -0,0 +1 @@ +(""); diff --git a/compiler/tests-js-parser/pass-explicit/b5d302467c6f2f16.js b/compiler/tests-js-parser/pass-explicit/b5d302467c6f2f16.js new file mode 100644 index 000000000..d5b4abbc6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b5d302467c6f2f16.js @@ -0,0 +1,5 @@ +(class { + a(b) { + "use strict"; + } +}); diff --git a/compiler/tests-js-parser/pass-explicit/b6145fa4a8cb8c35.js b/compiler/tests-js-parser/pass-explicit/b6145fa4a8cb8c35.js new file mode 100644 index 000000000..0714b3179 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b6145fa4a8cb8c35.js @@ -0,0 +1 @@ +a => (b => (1)); diff --git a/compiler/tests-js-parser/pass-explicit/b62c6dd890bef675.js b/compiler/tests-js-parser/pass-explicit/b62c6dd890bef675.js new file mode 100644 index 000000000..664f2937f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b62c6dd890bef675.js @@ -0,0 +1 @@ +var a = ({10: 1, 0: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/b644c9f68254c85d.js b/compiler/tests-js-parser/pass-explicit/b644c9f68254c85d.js new file mode 100644 index 000000000..31142aabf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b644c9f68254c85d.js @@ -0,0 +1 @@ +a; diff --git a/compiler/tests-js-parser/pass-explicit/b6b5e49c97cedebb.js b/compiler/tests-js-parser/pass-explicit/b6b5e49c97cedebb.js new file mode 100644 index 000000000..3cdb43250 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b6b5e49c97cedebb.js @@ -0,0 +1,3 @@ +{ + "use strict"; +} diff --git a/compiler/tests-js-parser/pass-explicit/b6e396c8cdf28f95.js b/compiler/tests-js-parser/pass-explicit/b6e396c8cdf28f95.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b6e396c8cdf28f95.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/b6efc88be898bda8.js b/compiler/tests-js-parser/pass-explicit/b6efc88be898bda8.js new file mode 100644 index 000000000..8289949f1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b6efc88be898bda8.js @@ -0,0 +1,3 @@ +((function a() { + var b = (1); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/b756b64f0eef72db.js b/compiler/tests-js-parser/pass-explicit/b756b64f0eef72db.js new file mode 100644 index 000000000..e2e67b73e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b756b64f0eef72db.js @@ -0,0 +1,3 @@ +function a() { + if ((!b) || (c())) ; +} diff --git a/compiler/tests-js-parser/pass-explicit/b75a0b610a41c000.js b/compiler/tests-js-parser/pass-explicit/b75a0b610a41c000.js new file mode 100644 index 000000000..e3dd8e42c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b75a0b610a41c000.js @@ -0,0 +1,3 @@ +((function () { + if (a) return 1; else return 2; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/b77549e54bfef0f9.js b/compiler/tests-js-parser/pass-explicit/b77549e54bfef0f9.js new file mode 100644 index 000000000..1cd8c6626 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b77549e54bfef0f9.js @@ -0,0 +1 @@ +var {a: b} = ({}); diff --git a/compiler/tests-js-parser/pass-explicit/b79d2c4df1141981.js b/compiler/tests-js-parser/pass-explicit/b79d2c4df1141981.js new file mode 100644 index 000000000..f75c6ef06 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b79d2c4df1141981.js @@ -0,0 +1,5 @@ +function a([b]) { + c(); + var d; + var b; +} diff --git a/compiler/tests-js-parser/pass-explicit/b7a5cd294201221b.js b/compiler/tests-js-parser/pass-explicit/b7a5cd294201221b.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b7a5cd294201221b.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/b7a6a807ae6db312.js b/compiler/tests-js-parser/pass-explicit/b7a6a807ae6db312.js new file mode 100644 index 000000000..4c90ac627 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b7a6a807ae6db312.js @@ -0,0 +1 @@ +({set a (b) {}, a: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/b7c2a3690011dd5e.js b/compiler/tests-js-parser/pass-explicit/b7c2a3690011dd5e.js new file mode 100644 index 000000000..11c96fa09 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b7c2a3690011dd5e.js @@ -0,0 +1 @@ +for (var a in b) ; diff --git a/compiler/tests-js-parser/pass-explicit/b7cd8df8dc875529.js b/compiler/tests-js-parser/pass-explicit/b7cd8df8dc875529.js new file mode 100644 index 000000000..b2f46c800 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b7cd8df8dc875529.js @@ -0,0 +1,10 @@ +while (!((a && b) || (c + ("0")))) { + (d.e)("f"); + var a; + function b() {} +} +for (var c = (1), g; (c && (g || c)) && (!(typeof c)); ++c) { + h(); + a(); + var i; +} diff --git a/compiler/tests-js-parser/pass-explicit/b7d99c0034be0ce1.js b/compiler/tests-js-parser/pass-explicit/b7d99c0034be0ce1.js new file mode 100644 index 000000000..3f72a7cfa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b7d99c0034be0ce1.js @@ -0,0 +1 @@ +function a(b, b) {} diff --git a/compiler/tests-js-parser/pass-explicit/b8403938b1ddd626.js b/compiler/tests-js-parser/pass-explicit/b8403938b1ddd626.js new file mode 100644 index 000000000..21dbf1598 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b8403938b1ddd626.js @@ -0,0 +1 @@ +(((a.b), (a.Infinity)), (a.true)), (a.false); diff --git a/compiler/tests-js-parser/pass-explicit/b86b0122e80c330e.js b/compiler/tests-js-parser/pass-explicit/b86b0122e80c330e.js new file mode 100644 index 000000000..745a2d1bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b86b0122e80c330e.js @@ -0,0 +1,3 @@ +function* a() { + ({*[(yield)]() {}}); +} diff --git a/compiler/tests-js-parser/pass-explicit/b8705496c9c1ff60.js b/compiler/tests-js-parser/pass-explicit/b8705496c9c1ff60.js new file mode 100644 index 000000000..f403d60ad --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b8705496c9c1ff60.js @@ -0,0 +1,6 @@ +((function () { + var a = ({}); + with (a) { + ((1), b)(); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/b885e6a35c04d915.js b/compiler/tests-js-parser/pass-explicit/b885e6a35c04d915.js new file mode 100644 index 000000000..5204cb6d5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b885e6a35c04d915.js @@ -0,0 +1,2 @@ +for (let a;;) ; +let a; diff --git a/compiler/tests-js-parser/pass-explicit/b88624492a2c81d3.js b/compiler/tests-js-parser/pass-explicit/b88624492a2c81d3.js new file mode 100644 index 000000000..b84baf210 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b88624492a2c81d3.js @@ -0,0 +1 @@ +(a, b, ...c) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/b89aef8a4690aa20.js b/compiler/tests-js-parser/pass-explicit/b89aef8a4690aa20.js new file mode 100644 index 000000000..166a9bfa8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b89aef8a4690aa20.js @@ -0,0 +1,4 @@ +while (true) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/b8ad1bd2ff50021f.js b/compiler/tests-js-parser/pass-explicit/b8ad1bd2ff50021f.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b8ad1bd2ff50021f.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/b8bf39a3e60568ab.js b/compiler/tests-js-parser/pass-explicit/b8bf39a3e60568ab.js new file mode 100644 index 000000000..721d9790d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b8bf39a3e60568ab.js @@ -0,0 +1 @@ +(eval, a) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/b8c98b5cd38f2bd9.js b/compiler/tests-js-parser/pass-explicit/b8c98b5cd38f2bd9.js new file mode 100644 index 000000000..c1deb17cd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b8c98b5cd38f2bd9.js @@ -0,0 +1 @@ +({a: let} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/b8f8dfc41df97add.js b/compiler/tests-js-parser/pass-explicit/b8f8dfc41df97add.js new file mode 100644 index 000000000..ef0b89142 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b8f8dfc41df97add.js @@ -0,0 +1,6 @@ +(((function () { + return true; +})()) ? ((a.b)(true)) : ((a.b)(false))); +((function () { + (a.b)("c"); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/b926f0fefd69158a.js b/compiler/tests-js-parser/pass-explicit/b926f0fefd69158a.js new file mode 100644 index 000000000..1897af78c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b926f0fefd69158a.js @@ -0,0 +1,7 @@ +switch (a) { + case 1: + b(); + break; + default: + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/b92bdcf6c2591e5c.js b/compiler/tests-js-parser/pass-explicit/b92bdcf6c2591e5c.js new file mode 100644 index 000000000..637421006 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b92bdcf6c2591e5c.js @@ -0,0 +1 @@ +(class extends (a, b) {}); diff --git a/compiler/tests-js-parser/pass-explicit/b92dd0bc25eaebe3.js b/compiler/tests-js-parser/pass-explicit/b92dd0bc25eaebe3.js new file mode 100644 index 000000000..4bd9fc4ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b92dd0bc25eaebe3.js @@ -0,0 +1 @@ +d: for (var a in b) for (var c in b) continue d; diff --git a/compiler/tests-js-parser/pass-explicit/b93d116fd0409637.js b/compiler/tests-js-parser/pass-explicit/b93d116fd0409637.js new file mode 100644 index 000000000..3390e2272 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b93d116fd0409637.js @@ -0,0 +1 @@ +({get false() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/b96ba7cdf0b42ca9.js b/compiler/tests-js-parser/pass-explicit/b96ba7cdf0b42ca9.js new file mode 100644 index 000000000..090973670 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b96ba7cdf0b42ca9.js @@ -0,0 +1 @@ +((function (a) {})(b())); diff --git a/compiler/tests-js-parser/pass-explicit/b9a0cb6df76a73d2.js b/compiler/tests-js-parser/pass-explicit/b9a0cb6df76a73d2.js new file mode 100644 index 000000000..64144365b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b9a0cb6df76a73d2.js @@ -0,0 +1,3 @@ +a = ({set 10 (b) { + c = b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/b9a4f9232146d4d9.js b/compiler/tests-js-parser/pass-explicit/b9a4f9232146d4d9.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b9a4f9232146d4d9.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/b9a5f5c8c12525c7.js b/compiler/tests-js-parser/pass-explicit/b9a5f5c8c12525c7.js new file mode 100644 index 000000000..aba28eeac --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b9a5f5c8c12525c7.js @@ -0,0 +1 @@ +(/0/g).a; diff --git a/compiler/tests-js-parser/pass-explicit/b9b8fb218e1990af.js b/compiler/tests-js-parser/pass-explicit/b9b8fb218e1990af.js new file mode 100644 index 000000000..1a772ebba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b9b8fb218e1990af.js @@ -0,0 +1 @@ +(a && (b = c)) && (d = e); diff --git a/compiler/tests-js-parser/pass-explicit/b9e1124424a35ad1.js b/compiler/tests-js-parser/pass-explicit/b9e1124424a35ad1.js new file mode 100644 index 000000000..cf8597451 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/b9e1124424a35ad1.js @@ -0,0 +1,6 @@ +function a() { + if (false) { + var b = (1); + } + c(b); +} diff --git a/compiler/tests-js-parser/pass-explicit/ba00173ff473e7da.js b/compiler/tests-js-parser/pass-explicit/ba00173ff473e7da.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/ba21e63736d8fd46.js b/compiler/tests-js-parser/pass-explicit/ba21e63736d8fd46.js new file mode 100644 index 000000000..2629aabd8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ba21e63736d8fd46.js @@ -0,0 +1 @@ +a: function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/ba4cc699857f41f2.js b/compiler/tests-js-parser/pass-explicit/ba4cc699857f41f2.js new file mode 100644 index 000000000..70cd186be --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ba4cc699857f41f2.js @@ -0,0 +1,4 @@ +function a() { + function* a() {} + function a() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/ba620e120a809888.js b/compiler/tests-js-parser/pass-explicit/ba620e120a809888.js new file mode 100644 index 000000000..23d9b2b88 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ba620e120a809888.js @@ -0,0 +1,3 @@ +function a() { + (new (new.target))(); +} diff --git a/compiler/tests-js-parser/pass-explicit/ba6624f5f448dfe4.js b/compiler/tests-js-parser/pass-explicit/ba6624f5f448dfe4.js new file mode 100644 index 000000000..8b77b45e8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ba6624f5f448dfe4.js @@ -0,0 +1 @@ +for (a; a < (1); a++) ; diff --git a/compiler/tests-js-parser/pass-explicit/ba6dd18da17dbc10.js b/compiler/tests-js-parser/pass-explicit/ba6dd18da17dbc10.js new file mode 100644 index 000000000..50e109391 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ba6dd18da17dbc10.js @@ -0,0 +1,7 @@ +for (;;) { + if (a) { + if (b) { + continue; + } + } +} diff --git a/compiler/tests-js-parser/pass-explicit/ba9a047839eb4682.js b/compiler/tests-js-parser/pass-explicit/ba9a047839eb4682.js new file mode 100644 index 000000000..f0ce848e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ba9a047839eb4682.js @@ -0,0 +1 @@ +a = ({b() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/bad55fbc19618df8.js b/compiler/tests-js-parser/pass-explicit/bad55fbc19618df8.js new file mode 100644 index 000000000..769e81909 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bad55fbc19618df8.js @@ -0,0 +1 @@ +a = ((typeof (b.c)) != ("d")); diff --git a/compiler/tests-js-parser/pass-explicit/bb402b98f5398890.js b/compiler/tests-js-parser/pass-explicit/bb402b98f5398890.js new file mode 100644 index 000000000..9ebb85bbe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bb402b98f5398890.js @@ -0,0 +1 @@ +a || (b ^ c); diff --git a/compiler/tests-js-parser/pass-explicit/bb41f0778f00f131.js b/compiler/tests-js-parser/pass-explicit/bb41f0778f00f131.js new file mode 100644 index 000000000..e9b9cc475 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bb41f0778f00f131.js @@ -0,0 +1 @@ +let eval = (1), arguments = (2); diff --git a/compiler/tests-js-parser/pass-explicit/bb447d4ed988a1cb.js b/compiler/tests-js-parser/pass-explicit/bb447d4ed988a1cb.js new file mode 100644 index 000000000..cb6596ea0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bb447d4ed988a1cb.js @@ -0,0 +1 @@ ++({}); diff --git a/compiler/tests-js-parser/pass-explicit/bb7db120ad2fe995.js b/compiler/tests-js-parser/pass-explicit/bb7db120ad2fe995.js new file mode 100644 index 000000000..560840fee --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bb7db120ad2fe995.js @@ -0,0 +1 @@ +({a: function ({b} = {b: 1}) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/bb87b410a1170cf0.js b/compiler/tests-js-parser/pass-explicit/bb87b410a1170cf0.js new file mode 100644 index 000000000..0f065674c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bb87b410a1170cf0.js @@ -0,0 +1 @@ +for (let a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/bb8b546cf9db5996.js b/compiler/tests-js-parser/pass-explicit/bb8b546cf9db5996.js new file mode 100644 index 000000000..1fc68fef4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bb8b546cf9db5996.js @@ -0,0 +1,5 @@ +({get a() { + return a; +}, set a (a) { + return a; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/bbff5671643cc2ea.js b/compiler/tests-js-parser/pass-explicit/bbff5671643cc2ea.js new file mode 100644 index 000000000..a56b547be --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bbff5671643cc2ea.js @@ -0,0 +1,3 @@ +(class { + set a (b) {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/bbffb851469a3f0e.js b/compiler/tests-js-parser/pass-explicit/bbffb851469a3f0e.js new file mode 100644 index 000000000..fce09e3c3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bbffb851469a3f0e.js @@ -0,0 +1,3 @@ +try {} catch (a) { + let b; +} diff --git a/compiler/tests-js-parser/pass-explicit/bc10e230c13b6c02.js b/compiler/tests-js-parser/pass-explicit/bc10e230c13b6c02.js new file mode 100644 index 000000000..046b74593 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bc10e230c13b6c02.js @@ -0,0 +1,3 @@ +function a() { + new (new.target); +} diff --git a/compiler/tests-js-parser/pass-explicit/bc302492d441d561.js b/compiler/tests-js-parser/pass-explicit/bc302492d441d561.js new file mode 100644 index 000000000..7138894c1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bc302492d441d561.js @@ -0,0 +1,3 @@ +(((function () { + var a = (1); +}).b)(this)); diff --git a/compiler/tests-js-parser/pass-explicit/bc89b2b2f1e19f9e.js b/compiler/tests-js-parser/pass-explicit/bc89b2b2f1e19f9e.js new file mode 100644 index 000000000..0d302b653 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bc89b2b2f1e19f9e.js @@ -0,0 +1,2 @@ +{} +/foo/; diff --git a/compiler/tests-js-parser/pass-explicit/bcd690cfb709ffe8.js b/compiler/tests-js-parser/pass-explicit/bcd690cfb709ffe8.js new file mode 100644 index 000000000..c1e5c5037 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bcd690cfb709ffe8.js @@ -0,0 +1 @@ +for ({a = 1} in b) ; diff --git a/compiler/tests-js-parser/pass-explicit/bce83ece0ba80598.js b/compiler/tests-js-parser/pass-explicit/bce83ece0ba80598.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/bd160eed5626ae7d.js b/compiler/tests-js-parser/pass-explicit/bd160eed5626ae7d.js new file mode 100644 index 000000000..073f31a54 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bd160eed5626ae7d.js @@ -0,0 +1,7 @@ +d: while (a) { + b(); + c(); + continue d; + e(); + f(); +} diff --git a/compiler/tests-js-parser/pass-explicit/bd28a7d19ac0d50b.js b/compiler/tests-js-parser/pass-explicit/bd28a7d19ac0d50b.js new file mode 100644 index 000000000..99f7d76fe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bd28a7d19ac0d50b.js @@ -0,0 +1,2 @@ +"use strict"; +var a = ({b: 1, get b() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/bd697f0fda948394.js b/compiler/tests-js-parser/pass-explicit/bd697f0fda948394.js new file mode 100644 index 000000000..324a2e08e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bd697f0fda948394.js @@ -0,0 +1,6 @@ +((function () { + try { + throw "a"; + } catch (b) {} + c(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/bd7b54d5e0ce444b.js b/compiler/tests-js-parser/pass-explicit/bd7b54d5e0ce444b.js new file mode 100644 index 000000000..56cf1b0d4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bd7b54d5e0ce444b.js @@ -0,0 +1,15 @@ +((function () { + b: { + if (a) break b; + c: { + if (a) break c; + if (a) break c; + if (a) break c; + } + c: { + if (a) break c; + if (a) break c; + if (a) break c; + } + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/bd883e5fd1f09b69.js b/compiler/tests-js-parser/pass-explicit/bd883e5fd1f09b69.js new file mode 100644 index 000000000..a1608ef9a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bd883e5fd1f09b69.js @@ -0,0 +1 @@ +with (a) b = c; diff --git a/compiler/tests-js-parser/pass-explicit/bd9b563f02b80dae.js b/compiler/tests-js-parser/pass-explicit/bd9b563f02b80dae.js new file mode 100644 index 000000000..d9abcfeca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bd9b563f02b80dae.js @@ -0,0 +1 @@ +("use strict") + (1); diff --git a/compiler/tests-js-parser/pass-explicit/bdc4accd07049034.js b/compiler/tests-js-parser/pass-explicit/bdc4accd07049034.js new file mode 100644 index 000000000..57290381a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bdc4accd07049034.js @@ -0,0 +1,4 @@ +(class { + a() {} + b() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/bde1a5ea9aebf9d2.js b/compiler/tests-js-parser/pass-explicit/bde1a5ea9aebf9d2.js new file mode 100644 index 000000000..ab32984f9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bde1a5ea9aebf9d2.js @@ -0,0 +1 @@ +function arguments() {} diff --git a/compiler/tests-js-parser/pass-explicit/bdfc6c05edd19925.js b/compiler/tests-js-parser/pass-explicit/bdfc6c05edd19925.js new file mode 100644 index 000000000..6535636ef --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bdfc6c05edd19925.js @@ -0,0 +1 @@ +/{}/; diff --git a/compiler/tests-js-parser/pass-explicit/be2c3fff6426873e.js b/compiler/tests-js-parser/pass-explicit/be2c3fff6426873e.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/be2c3fff6426873e.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/be2fd5888f434cbd.js b/compiler/tests-js-parser/pass-explicit/be2fd5888f434cbd.js new file mode 100644 index 000000000..7e5f5e16b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/be2fd5888f434cbd.js @@ -0,0 +1,4 @@ +(function () { + "use\nstrict"; + with (a) ; +}); diff --git a/compiler/tests-js-parser/pass-explicit/be6eb70d9330c165.js b/compiler/tests-js-parser/pass-explicit/be6eb70d9330c165.js new file mode 100644 index 000000000..427038f8a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/be6eb70d9330c165.js @@ -0,0 +1 @@ +256; diff --git a/compiler/tests-js-parser/pass-explicit/be879445c87d7e72.js b/compiler/tests-js-parser/pass-explicit/be879445c87d7e72.js new file mode 100644 index 000000000..ff11539ba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/be879445c87d7e72.js @@ -0,0 +1 @@ +var a; diff --git a/compiler/tests-js-parser/pass-explicit/be9d538d5041fd5f.js b/compiler/tests-js-parser/pass-explicit/be9d538d5041fd5f.js new file mode 100644 index 000000000..d368a5f62 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/be9d538d5041fd5f.js @@ -0,0 +1 @@ +(...[a, b]) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/beb4cc5812ec1eed.js b/compiler/tests-js-parser/pass-explicit/beb4cc5812ec1eed.js new file mode 100644 index 000000000..85061a414 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/beb4cc5812ec1eed.js @@ -0,0 +1,3 @@ +function* a() { + ({[yield]: a} = (1)); +} diff --git a/compiler/tests-js-parser/pass-explicit/beb5335e463d92c1.js b/compiler/tests-js-parser/pass-explicit/beb5335e463d92c1.js new file mode 100644 index 000000000..31142aabf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/beb5335e463d92c1.js @@ -0,0 +1 @@ +a; diff --git a/compiler/tests-js-parser/pass-explicit/bedf5be599c82fe8.js b/compiler/tests-js-parser/pass-explicit/bedf5be599c82fe8.js new file mode 100644 index 000000000..4faa7b721 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bedf5be599c82fe8.js @@ -0,0 +1,3 @@ +({*a() { + yield (1); +}}); diff --git a/compiler/tests-js-parser/pass-explicit/bf1db420b006027f.js b/compiler/tests-js-parser/pass-explicit/bf1db420b006027f.js new file mode 100644 index 000000000..0f9ecf6d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bf1db420b006027f.js @@ -0,0 +1,4 @@ +{ + do ; while (false); + false; +} diff --git a/compiler/tests-js-parser/pass-explicit/bf210a4f0cf9e352.js b/compiler/tests-js-parser/pass-explicit/bf210a4f0cf9e352.js new file mode 100644 index 000000000..e7855af6e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bf210a4f0cf9e352.js @@ -0,0 +1,4 @@ +class a { + static get b() {} + get b() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/bf65e886047db371.js b/compiler/tests-js-parser/pass-explicit/bf65e886047db371.js new file mode 100644 index 000000000..7a2c629ed --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bf65e886047db371.js @@ -0,0 +1,3 @@ +var a = (function (...b) { + c(); +}); diff --git a/compiler/tests-js-parser/pass-explicit/bf6aaaab7c143ca1.js b/compiler/tests-js-parser/pass-explicit/bf6aaaab7c143ca1.js new file mode 100644 index 000000000..187cb3e3e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bf6aaaab7c143ca1.js @@ -0,0 +1 @@ +10; diff --git a/compiler/tests-js-parser/pass-explicit/bf8ffad512a5f568.js b/compiler/tests-js-parser/pass-explicit/bf8ffad512a5f568.js new file mode 100644 index 000000000..5b1d6fe29 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bf8ffad512a5f568.js @@ -0,0 +1,6 @@ +class a { + static get b() {} + static set b (c) {} + get b() {} + set b (c) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/bf9c4d8ecd728018.js b/compiler/tests-js-parser/pass-explicit/bf9c4d8ecd728018.js new file mode 100644 index 000000000..a3b06747a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bf9c4d8ecd728018.js @@ -0,0 +1 @@ +16; diff --git a/compiler/tests-js-parser/pass-explicit/bf9e8bd90d8537c3.js b/compiler/tests-js-parser/pass-explicit/bf9e8bd90d8537c3.js new file mode 100644 index 000000000..430acb720 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bf9e8bd90d8537c3.js @@ -0,0 +1 @@ +throw {a: "b"}; diff --git a/compiler/tests-js-parser/pass-explicit/bfb61863d3b10adf.js b/compiler/tests-js-parser/pass-explicit/bfb61863d3b10adf.js new file mode 100644 index 000000000..2e035d847 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/bfb61863d3b10adf.js @@ -0,0 +1 @@ +(1) / (2); diff --git a/compiler/tests-js-parser/pass-explicit/c06df922631aeabc.js b/compiler/tests-js-parser/pass-explicit/c06df922631aeabc.js new file mode 100644 index 000000000..9fd723ac3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c06df922631aeabc.js @@ -0,0 +1 @@ +if (1) ; else function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/c0740dd25c9de39b.js b/compiler/tests-js-parser/pass-explicit/c0740dd25c9de39b.js new file mode 100644 index 000000000..6c7c0013f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c0740dd25c9de39b.js @@ -0,0 +1 @@ +3.14159; diff --git a/compiler/tests-js-parser/pass-explicit/c086a8a5c8ef2bb9.js b/compiler/tests-js-parser/pass-explicit/c086a8a5c8ef2bb9.js new file mode 100644 index 000000000..a76c4e654 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c086a8a5c8ef2bb9.js @@ -0,0 +1 @@ +let yield = (1); diff --git a/compiler/tests-js-parser/pass-explicit/c0f5f3f7db69c5a0.js b/compiler/tests-js-parser/pass-explicit/c0f5f3f7db69c5a0.js new file mode 100644 index 000000000..c7ba3bc62 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c0f5f3f7db69c5a0.js @@ -0,0 +1 @@ +a = ({get() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c1319833fc139cf8.js b/compiler/tests-js-parser/pass-explicit/c1319833fc139cf8.js new file mode 100644 index 000000000..de64ebd75 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c1319833fc139cf8.js @@ -0,0 +1 @@ +var a = ({0: "b"}); diff --git a/compiler/tests-js-parser/pass-explicit/c162248ee699b68f.js b/compiler/tests-js-parser/pass-explicit/c162248ee699b68f.js new file mode 100644 index 000000000..813257942 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c162248ee699b68f.js @@ -0,0 +1,3 @@ +var a; +var b; +var c; diff --git a/compiler/tests-js-parser/pass-explicit/c16d7f2993152b6b.module.js b/compiler/tests-js-parser/pass-explicit/c16d7f2993152b6b.module.js new file mode 100644 index 000000000..01a018cc1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c16d7f2993152b6b.module.js @@ -0,0 +1 @@ +import {b as a} from "c"; diff --git a/compiler/tests-js-parser/pass-explicit/c17fd07fc9b5bf7e.js b/compiler/tests-js-parser/pass-explicit/c17fd07fc9b5bf7e.js new file mode 100644 index 000000000..3d889edea --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c17fd07fc9b5bf7e.js @@ -0,0 +1,7 @@ +new a(1); +(new a(2))(3); +((new a(4))(5))(6); +new (new a(7)); +new (new a(8))(9); +new (new a(10))(11); +(new (new a(12)))(13); diff --git a/compiler/tests-js-parser/pass-explicit/c18d547cafb43e30.js b/compiler/tests-js-parser/pass-explicit/c18d547cafb43e30.js new file mode 100644 index 000000000..b251f26b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c18d547cafb43e30.js @@ -0,0 +1 @@ +this; diff --git a/compiler/tests-js-parser/pass-explicit/c1914072e996ddbe.js b/compiler/tests-js-parser/pass-explicit/c1914072e996ddbe.js new file mode 100644 index 000000000..6d75159db --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c1914072e996ddbe.js @@ -0,0 +1 @@ +/\uDF06/u; diff --git a/compiler/tests-js-parser/pass-explicit/c1967c44c4179fb4.js b/compiler/tests-js-parser/pass-explicit/c1967c44c4179fb4.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/c1c5c5d42a32aac1.js b/compiler/tests-js-parser/pass-explicit/c1c5c5d42a32aac1.js new file mode 100644 index 000000000..468a70552 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c1c5c5d42a32aac1.js @@ -0,0 +1,3 @@ +(class { + a({b} = {b: 1}) {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/c1c8f5c6abfc1d72.js b/compiler/tests-js-parser/pass-explicit/c1c8f5c6abfc1d72.js new file mode 100644 index 000000000..2736d727a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c1c8f5c6abfc1d72.js @@ -0,0 +1 @@ +({var: a} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/c1dd2285cd8a959d.js b/compiler/tests-js-parser/pass-explicit/c1dd2285cd8a959d.js new file mode 100644 index 000000000..93906c6fc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c1dd2285cd8a959d.js @@ -0,0 +1 @@ +for (a of b) c(a); diff --git a/compiler/tests-js-parser/pass-explicit/c1e396cb7871b175.js b/compiler/tests-js-parser/pass-explicit/c1e396cb7871b175.js new file mode 100644 index 000000000..8535fa260 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c1e396cb7871b175.js @@ -0,0 +1 @@ +(({a: [1]}) + ([])) / (2); diff --git a/compiler/tests-js-parser/pass-explicit/c2116aecaac68db9.js b/compiler/tests-js-parser/pass-explicit/c2116aecaac68db9.js new file mode 100644 index 000000000..8e3008600 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c2116aecaac68db9.js @@ -0,0 +1,3 @@ +function* a() { + yield* (yield); +} diff --git a/compiler/tests-js-parser/pass-explicit/c2203cb9e7bfe40f.js b/compiler/tests-js-parser/pass-explicit/c2203cb9e7bfe40f.js new file mode 100644 index 000000000..807fae416 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c2203cb9e7bfe40f.js @@ -0,0 +1 @@ +a--; diff --git a/compiler/tests-js-parser/pass-explicit/c247dcc00119f19c.js b/compiler/tests-js-parser/pass-explicit/c247dcc00119f19c.js new file mode 100644 index 000000000..d36fd1985 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c247dcc00119f19c.js @@ -0,0 +1 @@ +for (var a in [1, 2]) 3; diff --git a/compiler/tests-js-parser/pass-explicit/c24da2ce6761a80a.js b/compiler/tests-js-parser/pass-explicit/c24da2ce6761a80a.js new file mode 100644 index 000000000..7f038e24f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c24da2ce6761a80a.js @@ -0,0 +1 @@ +(a + b) - c; diff --git a/compiler/tests-js-parser/pass-explicit/c2558dc20a45b0a8.js b/compiler/tests-js-parser/pass-explicit/c2558dc20a45b0a8.js new file mode 100644 index 000000000..ec2595cb1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c2558dc20a45b0a8.js @@ -0,0 +1 @@ +({[(1) + (2)]() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c25bf945aaff8fe1.js b/compiler/tests-js-parser/pass-explicit/c25bf945aaff8fe1.js new file mode 100644 index 000000000..3bb521641 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c25bf945aaff8fe1.js @@ -0,0 +1 @@ +"Hello"; diff --git a/compiler/tests-js-parser/pass-explicit/c269a2a601c495f1.js b/compiler/tests-js-parser/pass-explicit/c269a2a601c495f1.js new file mode 100644 index 000000000..b22e25b0e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c269a2a601c495f1.js @@ -0,0 +1,4 @@ +((function () { + a = (1); + for (;;) ; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/c274891790345c56.js b/compiler/tests-js-parser/pass-explicit/c274891790345c56.js new file mode 100644 index 000000000..ef6b507e3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c274891790345c56.js @@ -0,0 +1 @@ +-a; diff --git a/compiler/tests-js-parser/pass-explicit/c27ded6ec20ea305.js b/compiler/tests-js-parser/pass-explicit/c27ded6ec20ea305.js new file mode 100644 index 000000000..ddc8e948d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c27ded6ec20ea305.js @@ -0,0 +1,3 @@ +while (true) { + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/c2d90d623b0f4c2e.js b/compiler/tests-js-parser/pass-explicit/c2d90d623b0f4c2e.js new file mode 100644 index 000000000..0618c093d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c2d90d623b0f4c2e.js @@ -0,0 +1 @@ +a += (1); diff --git a/compiler/tests-js-parser/pass-explicit/c2f12d66ce17d5ab.js b/compiler/tests-js-parser/pass-explicit/c2f12d66ce17d5ab.js new file mode 100644 index 000000000..fd903c164 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c2f12d66ce17d5ab.js @@ -0,0 +1 @@ +({get null() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c2fe8f120b796831.js b/compiler/tests-js-parser/pass-explicit/c2fe8f120b796831.js new file mode 100644 index 000000000..5154b71cb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c2fe8f120b796831.js @@ -0,0 +1 @@ +for (a in b) ; diff --git a/compiler/tests-js-parser/pass-explicit/c30eafd82f40470b.js b/compiler/tests-js-parser/pass-explicit/c30eafd82f40470b.js new file mode 100644 index 000000000..0005715a8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c30eafd82f40470b.js @@ -0,0 +1 @@ +((1) + (2)) * (3); diff --git a/compiler/tests-js-parser/pass-explicit/c3172ad30aed99c8.js b/compiler/tests-js-parser/pass-explicit/c3172ad30aed99c8.js new file mode 100644 index 000000000..45ab81b11 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c3172ad30aed99c8.js @@ -0,0 +1 @@ +const [a] = (b); diff --git a/compiler/tests-js-parser/pass-explicit/c35304fa99a2c331.js b/compiler/tests-js-parser/pass-explicit/c35304fa99a2c331.js new file mode 100644 index 000000000..da4b47b56 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c35304fa99a2c331.js @@ -0,0 +1,3 @@ +((function () { + if (a) return; else return 1; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/c35dcf99291ec6be.js b/compiler/tests-js-parser/pass-explicit/c35dcf99291ec6be.js new file mode 100644 index 000000000..3836fbb95 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c35dcf99291ec6be.js @@ -0,0 +1 @@ +({__proto__: null, __proto__() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c3699b982b33926b.js b/compiler/tests-js-parser/pass-explicit/c3699b982b33926b.js new file mode 100644 index 000000000..7fe9c90bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c3699b982b33926b.js @@ -0,0 +1 @@ +a | (b & c); diff --git a/compiler/tests-js-parser/pass-explicit/c3799cf68cbac258.js b/compiler/tests-js-parser/pass-explicit/c3799cf68cbac258.js new file mode 100644 index 000000000..4368d116c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c3799cf68cbac258.js @@ -0,0 +1 @@ +({0: a} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/c38644033565f7b9.js b/compiler/tests-js-parser/pass-explicit/c38644033565f7b9.js new file mode 100644 index 000000000..dcc855f23 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c38644033565f7b9.js @@ -0,0 +1 @@ +() => (1); diff --git a/compiler/tests-js-parser/pass-explicit/c3ce623096553057.js b/compiler/tests-js-parser/pass-explicit/c3ce623096553057.js new file mode 100644 index 000000000..e9236d966 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c3ce623096553057.js @@ -0,0 +1 @@ +(a + (b < (c * d))) + e; diff --git a/compiler/tests-js-parser/pass-explicit/c3dc60d438666700.js b/compiler/tests-js-parser/pass-explicit/c3dc60d438666700.js new file mode 100644 index 000000000..bd3e9b097 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c3dc60d438666700.js @@ -0,0 +1 @@ +(new a)``; diff --git a/compiler/tests-js-parser/pass-explicit/c3fc8ace42f3fb44.js b/compiler/tests-js-parser/pass-explicit/c3fc8ace42f3fb44.js new file mode 100644 index 000000000..6f247b683 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c3fc8ace42f3fb44.js @@ -0,0 +1 @@ +a.if; diff --git a/compiler/tests-js-parser/pass-explicit/c412905e229d6f2b.js b/compiler/tests-js-parser/pass-explicit/c412905e229d6f2b.js new file mode 100644 index 000000000..416a86d8f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c412905e229d6f2b.js @@ -0,0 +1 @@ +delete a; diff --git a/compiler/tests-js-parser/pass-explicit/c4336e0b6801c42c.js b/compiler/tests-js-parser/pass-explicit/c4336e0b6801c42c.js new file mode 100644 index 000000000..21481d7a4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c4336e0b6801c42c.js @@ -0,0 +1,4 @@ +({*a() { + yield; + 1; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/c442dc81201e2b55.js b/compiler/tests-js-parser/pass-explicit/c442dc81201e2b55.js new file mode 100644 index 000000000..341118939 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c442dc81201e2b55.js @@ -0,0 +1 @@ +for (let;;) ; diff --git a/compiler/tests-js-parser/pass-explicit/c4627eaa56f73949.js b/compiler/tests-js-parser/pass-explicit/c4627eaa56f73949.js new file mode 100644 index 000000000..e1028b372 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c4627eaa56f73949.js @@ -0,0 +1 @@ +(1) % (2); diff --git a/compiler/tests-js-parser/pass-explicit/c4a57a72e25e042c.js b/compiler/tests-js-parser/pass-explicit/c4a57a72e25e042c.js new file mode 100644 index 000000000..e186523df --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c4a57a72e25e042c.js @@ -0,0 +1 @@ +a = ({get b() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c4c51e5c6d4012ef.js b/compiler/tests-js-parser/pass-explicit/c4c51e5c6d4012ef.js new file mode 100644 index 000000000..ac2394c13 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c4c51e5c6d4012ef.js @@ -0,0 +1,3 @@ +a: while (true) { + break a; +} diff --git a/compiler/tests-js-parser/pass-explicit/c4f2243c81525bbd.js b/compiler/tests-js-parser/pass-explicit/c4f2243c81525bbd.js new file mode 100644 index 000000000..f1847b954 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c4f2243c81525bbd.js @@ -0,0 +1 @@ +var a = ((1) + (2)); diff --git a/compiler/tests-js-parser/pass-explicit/c52db35cba7fdbc0.js b/compiler/tests-js-parser/pass-explicit/c52db35cba7fdbc0.js new file mode 100644 index 000000000..16c46af4b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c52db35cba7fdbc0.js @@ -0,0 +1,8 @@ +((function () { + try { + throw "a"; + } finally { + b(); + } + c(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/c5328483d3ccadd0.js b/compiler/tests-js-parser/pass-explicit/c5328483d3ccadd0.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c5328483d3ccadd0.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/c532e126a986c1d4.js b/compiler/tests-js-parser/pass-explicit/c532e126a986c1d4.js new file mode 100644 index 000000000..092bc2b04 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c532e126a986c1d4.js @@ -0,0 +1 @@ +; diff --git a/compiler/tests-js-parser/pass-explicit/c546a199e87abaad.js b/compiler/tests-js-parser/pass-explicit/c546a199e87abaad.js new file mode 100644 index 000000000..5e5a7ef73 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c546a199e87abaad.js @@ -0,0 +1 @@ +for (let [a = (b in c)] in null) ; diff --git a/compiler/tests-js-parser/pass-explicit/c5823f1dccaf9787.js b/compiler/tests-js-parser/pass-explicit/c5823f1dccaf9787.js new file mode 100644 index 000000000..f5bae6bd8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c5823f1dccaf9787.js @@ -0,0 +1 @@ +for (var a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/c58e9029f1fd3d1b.js b/compiler/tests-js-parser/pass-explicit/c58e9029f1fd3d1b.js new file mode 100644 index 000000000..d24aabf2e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c58e9029f1fd3d1b.js @@ -0,0 +1 @@ +let a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/c5957fd3a6d258df.js b/compiler/tests-js-parser/pass-explicit/c5957fd3a6d258df.js new file mode 100644 index 000000000..a2691dbb6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c5957fd3a6d258df.js @@ -0,0 +1,3 @@ +b: { + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/c5b2ea7da55d24c1.js b/compiler/tests-js-parser/pass-explicit/c5b2ea7da55d24c1.js new file mode 100644 index 000000000..da627eb55 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c5b2ea7da55d24c1.js @@ -0,0 +1,4 @@ +function a() { + function a() {} + function a() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/c5bd72f618d7cade.js b/compiler/tests-js-parser/pass-explicit/c5bd72f618d7cade.js new file mode 100644 index 000000000..4df46943d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c5bd72f618d7cade.js @@ -0,0 +1 @@ +function* a() {} diff --git a/compiler/tests-js-parser/pass-explicit/c6827eb9dd7b3dc6.js b/compiler/tests-js-parser/pass-explicit/c6827eb9dd7b3dc6.js new file mode 100644 index 000000000..3cadf079f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c6827eb9dd7b3dc6.js @@ -0,0 +1 @@ +({a = 1} = b); diff --git a/compiler/tests-js-parser/pass-explicit/c6ea3404ea5c6c91.js b/compiler/tests-js-parser/pass-explicit/c6ea3404ea5c6c91.js new file mode 100644 index 000000000..62eaf6a00 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c6ea3404ea5c6c91.js @@ -0,0 +1 @@ +a(...b, c); diff --git a/compiler/tests-js-parser/pass-explicit/c6ff61d189c5cbee.js b/compiler/tests-js-parser/pass-explicit/c6ff61d189c5cbee.js new file mode 100644 index 000000000..abac23f62 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c6ff61d189c5cbee.js @@ -0,0 +1 @@ +(a[b]) || (c[d] = e); diff --git a/compiler/tests-js-parser/pass-explicit/c756f39dca1f7423.js b/compiler/tests-js-parser/pass-explicit/c756f39dca1f7423.js new file mode 100644 index 000000000..0b216931a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c756f39dca1f7423.js @@ -0,0 +1 @@ +a = (function (b, ...c) {}); diff --git a/compiler/tests-js-parser/pass-explicit/c767fa4d683aa3ce.js b/compiler/tests-js-parser/pass-explicit/c767fa4d683aa3ce.js new file mode 100644 index 000000000..5c698f62b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c767fa4d683aa3ce.js @@ -0,0 +1,3 @@ +({get a() { + new.target; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/c771490bbb3dd6e9.js b/compiler/tests-js-parser/pass-explicit/c771490bbb3dd6e9.js new file mode 100644 index 000000000..6baa174bf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c771490bbb3dd6e9.js @@ -0,0 +1,3 @@ +class a { + *static() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/c78c8fbfbd3e779e.js b/compiler/tests-js-parser/pass-explicit/c78c8fbfbd3e779e.js new file mode 100644 index 000000000..86e8bb535 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c78c8fbfbd3e779e.js @@ -0,0 +1 @@ +while (1) /foo/; diff --git a/compiler/tests-js-parser/pass-explicit/c7dd4bc60ffb40e9.js b/compiler/tests-js-parser/pass-explicit/c7dd4bc60ffb40e9.js new file mode 100644 index 000000000..9d1430b90 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c7dd4bc60ffb40e9.js @@ -0,0 +1 @@ +var {} = (1); diff --git a/compiler/tests-js-parser/pass-explicit/c7e5fba8bf3854cd.js b/compiler/tests-js-parser/pass-explicit/c7e5fba8bf3854cd.js new file mode 100644 index 000000000..c609f0ce9 Binary files /dev/null and b/compiler/tests-js-parser/pass-explicit/c7e5fba8bf3854cd.js differ diff --git a/compiler/tests-js-parser/pass-explicit/c80d9415dde647cd.js b/compiler/tests-js-parser/pass-explicit/c80d9415dde647cd.js new file mode 100644 index 000000000..8ba3826ad --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c80d9415dde647cd.js @@ -0,0 +1,3 @@ +a = ({set if (b) { + c = b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/c83a2dcf75fa419a.js b/compiler/tests-js-parser/pass-explicit/c83a2dcf75fa419a.js new file mode 100644 index 000000000..c032891c9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c83a2dcf75fa419a.js @@ -0,0 +1 @@ +/[\]/]/; diff --git a/compiler/tests-js-parser/pass-explicit/c844c5ec9f6dbf86.js b/compiler/tests-js-parser/pass-explicit/c844c5ec9f6dbf86.js new file mode 100644 index 000000000..1cc28370b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c844c5ec9f6dbf86.js @@ -0,0 +1 @@ +a = (("b") != (typeof (c.d))); diff --git a/compiler/tests-js-parser/pass-explicit/c8513472857eae9c.js b/compiler/tests-js-parser/pass-explicit/c8513472857eae9c.js new file mode 100644 index 000000000..c5f996be1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c8513472857eae9c.js @@ -0,0 +1 @@ +({set a (b = new.target) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c8565124aee75c69.js b/compiler/tests-js-parser/pass-explicit/c8565124aee75c69.js new file mode 100644 index 000000000..e225a26b0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c8565124aee75c69.js @@ -0,0 +1 @@ +for (a of let) {} diff --git a/compiler/tests-js-parser/pass-explicit/c85bc4de504befc7.js b/compiler/tests-js-parser/pass-explicit/c85bc4de504befc7.js new file mode 100644 index 000000000..44a06cc57 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c85bc4de504befc7.js @@ -0,0 +1,3 @@ +a = ({get b() { + return c; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/c85fbdb8c97e0534.js b/compiler/tests-js-parser/pass-explicit/c85fbdb8c97e0534.js new file mode 100644 index 000000000..56b958c01 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c85fbdb8c97e0534.js @@ -0,0 +1 @@ +let a, x󠇕; diff --git a/compiler/tests-js-parser/pass-explicit/c8689b6da6fd227a.js b/compiler/tests-js-parser/pass-explicit/c8689b6da6fd227a.js new file mode 100644 index 000000000..e186523df --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c8689b6da6fd227a.js @@ -0,0 +1 @@ +a = ({get b() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c87859666bd18c8c.js b/compiler/tests-js-parser/pass-explicit/c87859666bd18c8c.js new file mode 100644 index 000000000..0be713e3a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c87859666bd18c8c.js @@ -0,0 +1,2 @@ +while (1) {} +/foo/; diff --git a/compiler/tests-js-parser/pass-explicit/c88c5d1e7e9574b6.js b/compiler/tests-js-parser/pass-explicit/c88c5d1e7e9574b6.js new file mode 100644 index 000000000..a9d22c88a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c88c5d1e7e9574b6.js @@ -0,0 +1 @@ +var a = (/[a-c]/i); diff --git a/compiler/tests-js-parser/pass-explicit/c8b9a4d186ec2eb8.js b/compiler/tests-js-parser/pass-explicit/c8b9a4d186ec2eb8.js new file mode 100644 index 000000000..0e579fcfc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c8b9a4d186ec2eb8.js @@ -0,0 +1 @@ +a: do continue a; while (1); diff --git a/compiler/tests-js-parser/pass-explicit/c8dbdecbde2c1869.js b/compiler/tests-js-parser/pass-explicit/c8dbdecbde2c1869.js new file mode 100644 index 000000000..5995d2fef --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c8dbdecbde2c1869.js @@ -0,0 +1,4 @@ +((function () { + throw "a"; + a(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/c92dc954a0ce196d.module.js b/compiler/tests-js-parser/pass-explicit/c92dc954a0ce196d.module.js new file mode 100644 index 000000000..c0205b436 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c92dc954a0ce196d.module.js @@ -0,0 +1,2 @@ +export default function a() {} +false; diff --git a/compiler/tests-js-parser/pass-explicit/c963ac653b30699b.js b/compiler/tests-js-parser/pass-explicit/c963ac653b30699b.js new file mode 100644 index 000000000..f0ce848e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c963ac653b30699b.js @@ -0,0 +1 @@ +a = ({b() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/c964ed7bc2373c54.js b/compiler/tests-js-parser/pass-explicit/c964ed7bc2373c54.js new file mode 100644 index 000000000..ac4638c92 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c964ed7bc2373c54.js @@ -0,0 +1,4 @@ +function a({a = 1, b}) {} +function b([b, c = 2]) {} +var {d = 3, e} = (d); +var [d, e = 4] = (d); diff --git a/compiler/tests-js-parser/pass-explicit/c98889d7d94a0a63.js b/compiler/tests-js-parser/pass-explicit/c98889d7d94a0a63.js new file mode 100644 index 000000000..aa3e6bed2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c98889d7d94a0a63.js @@ -0,0 +1 @@ +[a, ...[b, c]] = d; diff --git a/compiler/tests-js-parser/pass-explicit/c98eba310f5568b1.js b/compiler/tests-js-parser/pass-explicit/c98eba310f5568b1.js new file mode 100644 index 000000000..c43200a15 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c98eba310f5568b1.js @@ -0,0 +1 @@ +for (;;) if (a()) break; diff --git a/compiler/tests-js-parser/pass-explicit/c9b780fb91a9db4e.js b/compiler/tests-js-parser/pass-explicit/c9b780fb91a9db4e.js new file mode 100644 index 000000000..7ab819663 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c9b780fb91a9db4e.js @@ -0,0 +1,3 @@ +var a = (function (b) { + return b; +}); diff --git a/compiler/tests-js-parser/pass-explicit/c9d32e4fc1687f5d.js b/compiler/tests-js-parser/pass-explicit/c9d32e4fc1687f5d.js new file mode 100644 index 000000000..ce121ee2e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/c9d32e4fc1687f5d.js @@ -0,0 +1,10 @@ +c: switch (1) { + case 2: + a(); + for (;;) if (b) break c; + d(); + case (3) + (4): + e(); + default: + f(); +} diff --git a/compiler/tests-js-parser/pass-explicit/ca20c15b39c87033.js b/compiler/tests-js-parser/pass-explicit/ca20c15b39c87033.js new file mode 100644 index 000000000..03ceb306b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ca20c15b39c87033.js @@ -0,0 +1,3 @@ +class a { + static() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/ca34a796e624adaf.js b/compiler/tests-js-parser/pass-explicit/ca34a796e624adaf.js new file mode 100644 index 000000000..e8215aab6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ca34a796e624adaf.js @@ -0,0 +1,11 @@ +switch (1) { + case 2: + a(); + case (3) + (4): + b(); + break; + case ((5) + (6)) + (7): + c(); + default: + d(); +} diff --git a/compiler/tests-js-parser/pass-explicit/ca39d991b4f07bf1.js b/compiler/tests-js-parser/pass-explicit/ca39d991b4f07bf1.js new file mode 100644 index 000000000..02d888e81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ca39d991b4f07bf1.js @@ -0,0 +1,2 @@ +var a, b, c; +d(a(e), b(e, e), c(e)); diff --git a/compiler/tests-js-parser/pass-explicit/ca450ebe11a7e7c9.module.js b/compiler/tests-js-parser/pass-explicit/ca450ebe11a7e7c9.module.js new file mode 100644 index 000000000..a5a084f16 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ca450ebe11a7e7c9.module.js @@ -0,0 +1 @@ +import "a"; diff --git a/compiler/tests-js-parser/pass-explicit/ca452a778322112a.js b/compiler/tests-js-parser/pass-explicit/ca452a778322112a.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/ca4f13a64e35195f.js b/compiler/tests-js-parser/pass-explicit/ca4f13a64e35195f.js new file mode 100644 index 000000000..5bdef3cf9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ca4f13a64e35195f.js @@ -0,0 +1 @@ +a = ({null: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/ca7a0ca0d22f30f8.js b/compiler/tests-js-parser/pass-explicit/ca7a0ca0d22f30f8.js new file mode 100644 index 000000000..25ba13e38 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ca7a0ca0d22f30f8.js @@ -0,0 +1,3 @@ +(class { + [(1) + (2)]() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/ca978112ca1bbdca.js b/compiler/tests-js-parser/pass-explicit/ca978112ca1bbdca.js new file mode 100644 index 000000000..31142aabf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ca978112ca1bbdca.js @@ -0,0 +1 @@ +a; diff --git a/compiler/tests-js-parser/pass-explicit/caa0719b52a1409d.js b/compiler/tests-js-parser/pass-explicit/caa0719b52a1409d.js new file mode 100644 index 000000000..235aeeda2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/caa0719b52a1409d.js @@ -0,0 +1 @@ +a``; diff --git a/compiler/tests-js-parser/pass-explicit/caaa9f06dd52e5a5.module.js b/compiler/tests-js-parser/pass-explicit/caaa9f06dd52e5a5.module.js new file mode 100644 index 000000000..66cb88f54 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/caaa9f06dd52e5a5.module.js @@ -0,0 +1 @@ +import {null as a} from "b"; diff --git a/compiler/tests-js-parser/pass-explicit/caf6539007d41b5e.js b/compiler/tests-js-parser/pass-explicit/caf6539007d41b5e.js new file mode 100644 index 000000000..84dc1138d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/caf6539007d41b5e.js @@ -0,0 +1 @@ +[/q/]; diff --git a/compiler/tests-js-parser/pass-explicit/cb05f3c30f5f88c0.js b/compiler/tests-js-parser/pass-explicit/cb05f3c30f5f88c0.js new file mode 100644 index 000000000..5b4e169eb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb05f3c30f5f88c0.js @@ -0,0 +1 @@ +new a(...b, ...c); diff --git a/compiler/tests-js-parser/pass-explicit/cb095c303f88cd0b.js b/compiler/tests-js-parser/pass-explicit/cb095c303f88cd0b.js new file mode 100644 index 000000000..46548b6d9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb095c303f88cd0b.js @@ -0,0 +1 @@ +("‰1"); diff --git a/compiler/tests-js-parser/pass-explicit/cb211fadccb029c7.js b/compiler/tests-js-parser/pass-explicit/cb211fadccb029c7.js new file mode 100644 index 000000000..91f2372cd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb211fadccb029c7.js @@ -0,0 +1,3 @@ +function* a() { + yield (delete (0)); +} diff --git a/compiler/tests-js-parser/pass-explicit/cb23f6635a581786.js b/compiler/tests-js-parser/pass-explicit/cb23f6635a581786.js new file mode 100644 index 000000000..fe199772f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb23f6635a581786.js @@ -0,0 +1 @@ +a + b; diff --git a/compiler/tests-js-parser/pass-explicit/cb2d573836b1e204.js b/compiler/tests-js-parser/pass-explicit/cb2d573836b1e204.js new file mode 100644 index 000000000..4258cb5bc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb2d573836b1e204.js @@ -0,0 +1,3 @@ +function a() { + (new.target)(); +} diff --git a/compiler/tests-js-parser/pass-explicit/cb3316f2b008bec3.js b/compiler/tests-js-parser/pass-explicit/cb3316f2b008bec3.js new file mode 100644 index 000000000..0e73df40e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb3316f2b008bec3.js @@ -0,0 +1,3 @@ +({*a() { + yield* (1); +}}); diff --git a/compiler/tests-js-parser/pass-explicit/cb4b35cf4cd815d8.js b/compiler/tests-js-parser/pass-explicit/cb4b35cf4cd815d8.js new file mode 100644 index 000000000..90f9b1c25 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb4b35cf4cd815d8.js @@ -0,0 +1 @@ +({[a]: a} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/cb625ce2970fe52a.js b/compiler/tests-js-parser/pass-explicit/cb625ce2970fe52a.js new file mode 100644 index 000000000..a0af287fc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb625ce2970fe52a.js @@ -0,0 +1,4 @@ +(function () { + "use\x20strict"; + with (a) ; +}); diff --git a/compiler/tests-js-parser/pass-explicit/cb898749d76e51fd.js b/compiler/tests-js-parser/pass-explicit/cb898749d76e51fd.js new file mode 100644 index 000000000..67356ccfe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cb898749d76e51fd.js @@ -0,0 +1 @@ +(1) + (2); diff --git a/compiler/tests-js-parser/pass-explicit/cbc644a20893a549.js b/compiler/tests-js-parser/pass-explicit/cbc644a20893a549.js new file mode 100644 index 000000000..b8c52c096 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cbc644a20893a549.js @@ -0,0 +1 @@ +a & b; diff --git a/compiler/tests-js-parser/pass-explicit/cbc7fdab53161051.js b/compiler/tests-js-parser/pass-explicit/cbc7fdab53161051.js new file mode 100644 index 000000000..d7c1bb627 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cbc7fdab53161051.js @@ -0,0 +1,2 @@ +debugger; +if (a) debugger; diff --git a/compiler/tests-js-parser/pass-explicit/cbccdb75b22a522c.js b/compiler/tests-js-parser/pass-explicit/cbccdb75b22a522c.js new file mode 100644 index 000000000..645fed8a4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cbccdb75b22a522c.js @@ -0,0 +1,3 @@ +function* a() { + yield (-(1)); +} diff --git a/compiler/tests-js-parser/pass-explicit/cbf9e832efe61a2e.js b/compiler/tests-js-parser/pass-explicit/cbf9e832efe61a2e.js new file mode 100644 index 000000000..ac1e9a3d9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cbf9e832efe61a2e.js @@ -0,0 +1 @@ +for (let {} in 1) ; diff --git a/compiler/tests-js-parser/pass-explicit/cc561e319220c789.js b/compiler/tests-js-parser/pass-explicit/cc561e319220c789.js new file mode 100644 index 000000000..6091796f1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cc561e319220c789.js @@ -0,0 +1 @@ +do /x/; while (false); diff --git a/compiler/tests-js-parser/pass-explicit/cc6ea8664124953a.js b/compiler/tests-js-parser/pass-explicit/cc6ea8664124953a.js new file mode 100644 index 000000000..6b9141839 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cc6ea8664124953a.js @@ -0,0 +1 @@ +a.true; diff --git a/compiler/tests-js-parser/pass-explicit/cc793d44a11617e7.js b/compiler/tests-js-parser/pass-explicit/cc793d44a11617e7.js new file mode 100644 index 000000000..51071efc7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cc793d44a11617e7.js @@ -0,0 +1,5 @@ +try { + a(); +} catch (b) { + c(b); +} diff --git a/compiler/tests-js-parser/pass-explicit/cc7b1f054147aa5c.js b/compiler/tests-js-parser/pass-explicit/cc7b1f054147aa5c.js new file mode 100644 index 000000000..a48955eea --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cc7b1f054147aa5c.js @@ -0,0 +1,4 @@ +switch (a) { + case 1: + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/ccd1f89a0344e04e.js b/compiler/tests-js-parser/pass-explicit/ccd1f89a0344e04e.js new file mode 100644 index 000000000..af4002d37 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ccd1f89a0344e04e.js @@ -0,0 +1 @@ +(a = 1) => (a * a); diff --git a/compiler/tests-js-parser/pass-explicit/cd136009983641b5.js b/compiler/tests-js-parser/pass-explicit/cd136009983641b5.js new file mode 100644 index 000000000..0a1ba76f5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cd136009983641b5.js @@ -0,0 +1,4 @@ +((function () { + if (a) return b; + if (b) return c; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/cd2f5476a739c80a.js b/compiler/tests-js-parser/pass-explicit/cd2f5476a739c80a.js new file mode 100644 index 000000000..da41a2be4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cd2f5476a739c80a.js @@ -0,0 +1 @@ +new (a in b); diff --git a/compiler/tests-js-parser/pass-explicit/cda499c521ff60c7.js b/compiler/tests-js-parser/pass-explicit/cda499c521ff60c7.js new file mode 100644 index 000000000..b35e78fdb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cda499c521ff60c7.js @@ -0,0 +1,8 @@ +a = (class { + static b() {} + static get c() {} + static set d (a) {} + static() {} + get() {} + set() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/cdb9bd6096e2732c.js b/compiler/tests-js-parser/pass-explicit/cdb9bd6096e2732c.js new file mode 100644 index 000000000..362a4ff52 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cdb9bd6096e2732c.js @@ -0,0 +1 @@ +++arguments; diff --git a/compiler/tests-js-parser/pass-explicit/cdbd7fe30e1c7321.js b/compiler/tests-js-parser/pass-explicit/cdbd7fe30e1c7321.js new file mode 100644 index 000000000..0b851c5df --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cdbd7fe30e1c7321.js @@ -0,0 +1,3 @@ +((function () { + var a = (1); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/cdca52810bbe4532.js b/compiler/tests-js-parser/pass-explicit/cdca52810bbe4532.js new file mode 100644 index 000000000..676d77ea3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cdca52810bbe4532.js @@ -0,0 +1,8 @@ +function a() { + (b.c)("d"); +} +a(); +{} +function a() { + (b.c)("e"); +} diff --git a/compiler/tests-js-parser/pass-explicit/cdee1bf4a6391af8.js b/compiler/tests-js-parser/pass-explicit/cdee1bf4a6391af8.js new file mode 100644 index 000000000..80362dd5d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cdee1bf4a6391af8.js @@ -0,0 +1 @@ +++a; diff --git a/compiler/tests-js-parser/pass-explicit/cdf411040ab4b29b.js b/compiler/tests-js-parser/pass-explicit/cdf411040ab4b29b.js new file mode 100644 index 000000000..1ebec8919 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cdf411040ab4b29b.js @@ -0,0 +1 @@ +(() => {})(); diff --git a/compiler/tests-js-parser/pass-explicit/cdf43a987840ece8.js b/compiler/tests-js-parser/pass-explicit/cdf43a987840ece8.js new file mode 100644 index 000000000..d5a3ebcc7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cdf43a987840ece8.js @@ -0,0 +1 @@ +/[]/; diff --git a/compiler/tests-js-parser/pass-explicit/ce0aaec02d5d4465.js b/compiler/tests-js-parser/pass-explicit/ce0aaec02d5d4465.js new file mode 100644 index 000000000..39cd12bdd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce0aaec02d5d4465.js @@ -0,0 +1,3 @@ +class a { + static get [b]() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/ce349e20cf388e87.js b/compiler/tests-js-parser/pass-explicit/ce349e20cf388e87.js new file mode 100644 index 000000000..4fb7af20a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce349e20cf388e87.js @@ -0,0 +1 @@ +var a = ({b: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/ce3d1f8d346bb92d.js b/compiler/tests-js-parser/pass-explicit/ce3d1f8d346bb92d.js new file mode 100644 index 000000000..a210f3553 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce3d1f8d346bb92d.js @@ -0,0 +1 @@ +class a {} diff --git a/compiler/tests-js-parser/pass-explicit/ce52f1c3d90b194a.js b/compiler/tests-js-parser/pass-explicit/ce52f1c3d90b194a.js new file mode 100644 index 000000000..17152dbbe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce52f1c3d90b194a.js @@ -0,0 +1 @@ +a: for (;;) for (;;) continue a; diff --git a/compiler/tests-js-parser/pass-explicit/ce569e89a005c02a.js b/compiler/tests-js-parser/pass-explicit/ce569e89a005c02a.js new file mode 100644 index 000000000..14e17a211 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce569e89a005c02a.js @@ -0,0 +1,2 @@ +"use strict"; +arguments[1] = (2); diff --git a/compiler/tests-js-parser/pass-explicit/ce5f3bc27d5ccaac.js b/compiler/tests-js-parser/pass-explicit/ce5f3bc27d5ccaac.js new file mode 100644 index 000000000..b28c592a0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce5f3bc27d5ccaac.js @@ -0,0 +1,3 @@ +function* a() { + b => (b * yield); +} diff --git a/compiler/tests-js-parser/pass-explicit/ce6a4854c1f79924.js b/compiler/tests-js-parser/pass-explicit/ce6a4854c1f79924.js new file mode 100644 index 000000000..97c6f3f69 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce6a4854c1f79924.js @@ -0,0 +1,9 @@ +for (;;) { + if (a) { + if (b) { + continue; + } else { + ; + } + } +} diff --git a/compiler/tests-js-parser/pass-explicit/ce8c443eb361e1a2.js b/compiler/tests-js-parser/pass-explicit/ce8c443eb361e1a2.js new file mode 100644 index 000000000..147f87c56 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce8c443eb361e1a2.js @@ -0,0 +1 @@ +(function ([]) {}); diff --git a/compiler/tests-js-parser/pass-explicit/ce968fcdf3a1987c.js b/compiler/tests-js-parser/pass-explicit/ce968fcdf3a1987c.js new file mode 100644 index 000000000..d100e7262 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ce968fcdf3a1987c.js @@ -0,0 +1,3 @@ +function* a() { + yield (typeof (0)); +} diff --git a/compiler/tests-js-parser/pass-explicit/cea8816bffe4238c.js b/compiler/tests-js-parser/pass-explicit/cea8816bffe4238c.js new file mode 100644 index 000000000..fcebe5497 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cea8816bffe4238c.js @@ -0,0 +1,5 @@ +function a() { + if (void (b())) { + c(); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/cec2d94dc09a6a71.js b/compiler/tests-js-parser/pass-explicit/cec2d94dc09a6a71.js new file mode 100644 index 000000000..6ab912dd2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cec2d94dc09a6a71.js @@ -0,0 +1 @@ +a = ({catch() {}, throw() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/cefd0dd07bfa670f.js b/compiler/tests-js-parser/pass-explicit/cefd0dd07bfa670f.js new file mode 100644 index 000000000..283144e01 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cefd0dd07bfa670f.js @@ -0,0 +1 @@ +const a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/cf0eb6e6c4317c33.js b/compiler/tests-js-parser/pass-explicit/cf0eb6e6c4317c33.js new file mode 100644 index 000000000..27f0a0d45 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cf0eb6e6c4317c33.js @@ -0,0 +1 @@ +("ø"); diff --git a/compiler/tests-js-parser/pass-explicit/cf0fb26afd0eaaf1.js b/compiler/tests-js-parser/pass-explicit/cf0fb26afd0eaaf1.js new file mode 100644 index 000000000..a5c708c2d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cf0fb26afd0eaaf1.js @@ -0,0 +1 @@ +new a(...(b = c)); diff --git a/compiler/tests-js-parser/pass-explicit/cf939dae739eacf6.js b/compiler/tests-js-parser/pass-explicit/cf939dae739eacf6.js new file mode 100644 index 000000000..bb9ac3684 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cf939dae739eacf6.js @@ -0,0 +1,3 @@ +with (a) { + b = c; +} diff --git a/compiler/tests-js-parser/pass-explicit/cfca620b63dd98b8.js b/compiler/tests-js-parser/pass-explicit/cfca620b63dd98b8.js new file mode 100644 index 000000000..2f633105c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cfca620b63dd98b8.js @@ -0,0 +1,2 @@ +(a.b)`foo`; +c`bar`; diff --git a/compiler/tests-js-parser/pass-explicit/cfebdd6b58e65e90.js b/compiler/tests-js-parser/pass-explicit/cfebdd6b58e65e90.js new file mode 100644 index 000000000..f4d6e53b3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/cfebdd6b58e65e90.js @@ -0,0 +1,4 @@ +function* a() { + yield; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/d010d377bcfd5565.js b/compiler/tests-js-parser/pass-explicit/d010d377bcfd5565.js new file mode 100644 index 000000000..777638568 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d010d377bcfd5565.js @@ -0,0 +1 @@ +({__proto__: null, get __proto__() {}, set __proto__ (a) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/d038789ad15922ff.js b/compiler/tests-js-parser/pass-explicit/d038789ad15922ff.js new file mode 100644 index 000000000..1b692d881 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d038789ad15922ff.js @@ -0,0 +1,3 @@ +((function () { + var a = ({Infinity: 1}); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d043d114b966415b.js b/compiler/tests-js-parser/pass-explicit/d043d114b966415b.js new file mode 100644 index 000000000..46d38be84 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d043d114b966415b.js @@ -0,0 +1,3 @@ +function* a() { + yield (--a); +} diff --git a/compiler/tests-js-parser/pass-explicit/d0724a029fb7e4b1.js b/compiler/tests-js-parser/pass-explicit/d0724a029fb7e4b1.js new file mode 100644 index 000000000..ff11539ba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d0724a029fb7e4b1.js @@ -0,0 +1 @@ +var a; diff --git a/compiler/tests-js-parser/pass-explicit/d082f8d1c2eec454.js b/compiler/tests-js-parser/pass-explicit/d082f8d1c2eec454.js new file mode 100644 index 000000000..e70785168 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d082f8d1c2eec454.js @@ -0,0 +1 @@ +[a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/d09117cbf60bd18f.js b/compiler/tests-js-parser/pass-explicit/d09117cbf60bd18f.js new file mode 100644 index 000000000..10db2ad30 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d09117cbf60bd18f.js @@ -0,0 +1 @@ +aa; diff --git a/compiler/tests-js-parser/pass-explicit/d09dbe1357abd967.js b/compiler/tests-js-parser/pass-explicit/d09dbe1357abd967.js new file mode 100644 index 000000000..dd610acac --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d09dbe1357abd967.js @@ -0,0 +1,5 @@ +((function () { + ((function () { + a("b"); + })()); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d0dba4e03608ad64.js b/compiler/tests-js-parser/pass-explicit/d0dba4e03608ad64.js new file mode 100644 index 000000000..b9607269d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d0dba4e03608ad64.js @@ -0,0 +1 @@ +`${a}`; diff --git a/compiler/tests-js-parser/pass-explicit/d126aa10835287e6.js b/compiler/tests-js-parser/pass-explicit/d126aa10835287e6.js new file mode 100644 index 000000000..a210f3553 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d126aa10835287e6.js @@ -0,0 +1 @@ +class a {} diff --git a/compiler/tests-js-parser/pass-explicit/d198e0d3a33b7b61.js b/compiler/tests-js-parser/pass-explicit/d198e0d3a33b7b61.js new file mode 100644 index 000000000..808407f7f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d198e0d3a33b7b61.js @@ -0,0 +1,3 @@ +var a = ({*[b]() { + yield* c; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/d1eafbc6bda219a7.js b/compiler/tests-js-parser/pass-explicit/d1eafbc6bda219a7.js new file mode 100644 index 000000000..a210f3553 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d1eafbc6bda219a7.js @@ -0,0 +1 @@ +class a {} diff --git a/compiler/tests-js-parser/pass-explicit/d1fea0e461717b09.js b/compiler/tests-js-parser/pass-explicit/d1fea0e461717b09.js new file mode 100644 index 000000000..4c331aa9e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d1fea0e461717b09.js @@ -0,0 +1 @@ +`\``; diff --git a/compiler/tests-js-parser/pass-explicit/d22f8660531e1c1a.js b/compiler/tests-js-parser/pass-explicit/d22f8660531e1c1a.js new file mode 100644 index 000000000..ecd5bf050 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d22f8660531e1c1a.js @@ -0,0 +1 @@ +var static; diff --git a/compiler/tests-js-parser/pass-explicit/d2332f9187c6a20a.module.js b/compiler/tests-js-parser/pass-explicit/d2332f9187c6a20a.module.js new file mode 100644 index 000000000..a6e68e983 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d2332f9187c6a20a.module.js @@ -0,0 +1 @@ +export default class {} diff --git a/compiler/tests-js-parser/pass-explicit/d24d5f53dc15bcc7.module.js b/compiler/tests-js-parser/pass-explicit/d24d5f53dc15bcc7.module.js new file mode 100644 index 000000000..f41639e85 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d24d5f53dc15bcc7.module.js @@ -0,0 +1 @@ +export var a; diff --git a/compiler/tests-js-parser/pass-explicit/d2ae1c7b6e55143f.js b/compiler/tests-js-parser/pass-explicit/d2ae1c7b6e55143f.js new file mode 100644 index 000000000..3a822d93b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d2ae1c7b6e55143f.js @@ -0,0 +1,3 @@ +({set a (b) { + b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/d2af344779cc1f26.js b/compiler/tests-js-parser/pass-explicit/d2af344779cc1f26.js new file mode 100644 index 000000000..1217f2b33 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d2af344779cc1f26.js @@ -0,0 +1 @@ +a => (0); diff --git a/compiler/tests-js-parser/pass-explicit/d2c9ab6dc14dc774.js b/compiler/tests-js-parser/pass-explicit/d2c9ab6dc14dc774.js new file mode 100644 index 000000000..790c2bb95 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d2c9ab6dc14dc774.js @@ -0,0 +1 @@ +for ({a = 1} of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/d2d8885e0c00ad51.js b/compiler/tests-js-parser/pass-explicit/d2d8885e0c00ad51.js new file mode 100644 index 000000000..7543d4412 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d2d8885e0c00ad51.js @@ -0,0 +1 @@ +('\\"'); diff --git a/compiler/tests-js-parser/pass-explicit/d2fe67b1990df65c.js b/compiler/tests-js-parser/pass-explicit/d2fe67b1990df65c.js new file mode 100644 index 000000000..a25600605 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d2fe67b1990df65c.js @@ -0,0 +1,3 @@ +((function () { + a ? (!b) : (!c); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d33efc20e46c3961.js b/compiler/tests-js-parser/pass-explicit/d33efc20e46c3961.js new file mode 100644 index 000000000..007503322 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d33efc20e46c3961.js @@ -0,0 +1 @@ +(...a) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/d368a7bc70ca3120.js b/compiler/tests-js-parser/pass-explicit/d368a7bc70ca3120.js new file mode 100644 index 000000000..77ba35eac --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d368a7bc70ca3120.js @@ -0,0 +1,3 @@ +({a(b, c) { + let d; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/d3762fcf2ad7d285.js b/compiler/tests-js-parser/pass-explicit/d3762fcf2ad7d285.js new file mode 100644 index 000000000..201aaa85e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d3762fcf2ad7d285.js @@ -0,0 +1 @@ +(class extends (1) {}); diff --git a/compiler/tests-js-parser/pass-explicit/d37653c5aedf3d46.js b/compiler/tests-js-parser/pass-explicit/d37653c5aedf3d46.js new file mode 100644 index 000000000..287f08b92 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d37653c5aedf3d46.js @@ -0,0 +1 @@ +({a(b, c, d) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/d38771967621cb8e.js b/compiler/tests-js-parser/pass-explicit/d38771967621cb8e.js new file mode 100644 index 000000000..e0144a6e3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d38771967621cb8e.js @@ -0,0 +1 @@ +(")11"); diff --git a/compiler/tests-js-parser/pass-explicit/d3ac25ddc7ba9779.js b/compiler/tests-js-parser/pass-explicit/d3ac25ddc7ba9779.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/d3bc8cc2c239b25f.js b/compiler/tests-js-parser/pass-explicit/d3bc8cc2c239b25f.js new file mode 100644 index 000000000..47b8e2062 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d3bc8cc2c239b25f.js @@ -0,0 +1 @@ +a * b; diff --git a/compiler/tests-js-parser/pass-explicit/d3c1ea553fea8944.js b/compiler/tests-js-parser/pass-explicit/d3c1ea553fea8944.js new file mode 100644 index 000000000..b8b828460 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d3c1ea553fea8944.js @@ -0,0 +1,3 @@ +class a { + static set(b) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/d3d6ca7932414eed.js b/compiler/tests-js-parser/pass-explicit/d3d6ca7932414eed.js new file mode 100644 index 000000000..eb35714c0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d3d6ca7932414eed.js @@ -0,0 +1,3 @@ +function a(b = 1) {} +function c(b = (2) + (3)) {} +function d({e} = {}, [f] = [4]) {} diff --git a/compiler/tests-js-parser/pass-explicit/d3f70f4410bb8346.js b/compiler/tests-js-parser/pass-explicit/d3f70f4410bb8346.js new file mode 100644 index 000000000..51bea8d0a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d3f70f4410bb8346.js @@ -0,0 +1 @@ +/}/; diff --git a/compiler/tests-js-parser/pass-explicit/d4104d0ed6a07c28.js b/compiler/tests-js-parser/pass-explicit/d4104d0ed6a07c28.js new file mode 100644 index 000000000..317ab0f09 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d4104d0ed6a07c28.js @@ -0,0 +1,9 @@ +e: { + d: { + a("b"); + if (c) { + break d; + } + break e; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/d42cf386ef394628.js b/compiler/tests-js-parser/pass-explicit/d42cf386ef394628.js new file mode 100644 index 000000000..61431d2c3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d42cf386ef394628.js @@ -0,0 +1 @@ +(((a(1)).b)(2, 3, 4)).c; diff --git a/compiler/tests-js-parser/pass-explicit/d45f1126ef89120b.js b/compiler/tests-js-parser/pass-explicit/d45f1126ef89120b.js new file mode 100644 index 000000000..4de81a7e3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d45f1126ef89120b.js @@ -0,0 +1 @@ +let [] = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/d45fa56c26ed4a4e.js b/compiler/tests-js-parser/pass-explicit/d45fa56c26ed4a4e.js new file mode 100644 index 000000000..850eb0051 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d45fa56c26ed4a4e.js @@ -0,0 +1 @@ +class a extends (1) {} diff --git a/compiler/tests-js-parser/pass-explicit/d483926898410cae.js b/compiler/tests-js-parser/pass-explicit/d483926898410cae.js new file mode 100644 index 000000000..d46806263 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d483926898410cae.js @@ -0,0 +1 @@ +"Hello\0122World"; diff --git a/compiler/tests-js-parser/pass-explicit/d487300b8deff2ff.module.js b/compiler/tests-js-parser/pass-explicit/d487300b8deff2ff.module.js new file mode 100644 index 000000000..a5a084f16 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d487300b8deff2ff.module.js @@ -0,0 +1 @@ +import "a"; diff --git a/compiler/tests-js-parser/pass-explicit/d4b898b45172a637.js b/compiler/tests-js-parser/pass-explicit/d4b898b45172a637.js new file mode 100644 index 000000000..9cd9eb1f2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d4b898b45172a637.js @@ -0,0 +1,2 @@ +"use strict"; +var a = ({get b() {}, get b() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/d4c979f1a92a8cac.js b/compiler/tests-js-parser/pass-explicit/d4c979f1a92a8cac.js new file mode 100644 index 000000000..0f3c080dd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d4c979f1a92a8cac.js @@ -0,0 +1 @@ +(((a()), (b())), (c())) + (d()); diff --git a/compiler/tests-js-parser/pass-explicit/d4e81043d808dc31.js b/compiler/tests-js-parser/pass-explicit/d4e81043d808dc31.js new file mode 100644 index 000000000..8b7b73e98 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d4e81043d808dc31.js @@ -0,0 +1,3 @@ +function* a() { + yield (b.yield); +} diff --git a/compiler/tests-js-parser/pass-explicit/d515f6ce0c47a609.js b/compiler/tests-js-parser/pass-explicit/d515f6ce0c47a609.js new file mode 100644 index 000000000..391d24264 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d515f6ce0c47a609.js @@ -0,0 +1 @@ +(a, b, ...c) => ((1) + (2)); diff --git a/compiler/tests-js-parser/pass-explicit/d51711f888aeeac9.js b/compiler/tests-js-parser/pass-explicit/d51711f888aeeac9.js new file mode 100644 index 000000000..f565eb3ac --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d51711f888aeeac9.js @@ -0,0 +1 @@ +while (true) continue; diff --git a/compiler/tests-js-parser/pass-explicit/d53aef16fe683218.js b/compiler/tests-js-parser/pass-explicit/d53aef16fe683218.js new file mode 100644 index 000000000..a8c30c861 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d53aef16fe683218.js @@ -0,0 +1,5 @@ +switch (a) { + case 1: + {} + /foo/; +} diff --git a/compiler/tests-js-parser/pass-explicit/d54bfed43597e9ac.js b/compiler/tests-js-parser/pass-explicit/d54bfed43597e9ac.js new file mode 100644 index 000000000..af4e487e1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d54bfed43597e9ac.js @@ -0,0 +1 @@ +void (void a); diff --git a/compiler/tests-js-parser/pass-explicit/d55a93310a309c43.js b/compiler/tests-js-parser/pass-explicit/d55a93310a309c43.js new file mode 100644 index 000000000..c0d918a81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d55a93310a309c43.js @@ -0,0 +1 @@ +/a/i; diff --git a/compiler/tests-js-parser/pass-explicit/d57a361bc638f38c.js b/compiler/tests-js-parser/pass-explicit/d57a361bc638f38c.js new file mode 100644 index 000000000..ea857e491 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d57a361bc638f38c.js @@ -0,0 +1,2 @@ +var a, b, c, d; +a = ((b, c), d); diff --git a/compiler/tests-js-parser/pass-explicit/d57d9e2865e43807.js b/compiler/tests-js-parser/pass-explicit/d57d9e2865e43807.js new file mode 100644 index 000000000..a6b869fdc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d57d9e2865e43807.js @@ -0,0 +1,7 @@ +switch (a) { + case "b": + c(); + default: + d(); + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/d58831cddf9cbd99.js b/compiler/tests-js-parser/pass-explicit/d58831cddf9cbd99.js new file mode 100644 index 000000000..22c524b11 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d58831cddf9cbd99.js @@ -0,0 +1,9 @@ +function a() { + b(); + c(); + d = (1); + return; + if (d) { + e(); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/d59a168fe5b7c787.js b/compiler/tests-js-parser/pass-explicit/d59a168fe5b7c787.js new file mode 100644 index 000000000..7a526aa16 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d59a168fe5b7c787.js @@ -0,0 +1 @@ +var a = ((/42/g).b); diff --git a/compiler/tests-js-parser/pass-explicit/d59a6667e160c0b3.js b/compiler/tests-js-parser/pass-explicit/d59a6667e160c0b3.js new file mode 100644 index 000000000..775671955 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d59a6667e160c0b3.js @@ -0,0 +1 @@ +/\uD834/u; diff --git a/compiler/tests-js-parser/pass-explicit/d60426fd0160fb91.js b/compiler/tests-js-parser/pass-explicit/d60426fd0160fb91.js new file mode 100644 index 000000000..cbb39ee39 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d60426fd0160fb91.js @@ -0,0 +1,5 @@ +((function () { + (1) + ((function () { + return 2; + })()); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d61d161a9c36fa45.js b/compiler/tests-js-parser/pass-explicit/d61d161a9c36fa45.js new file mode 100644 index 000000000..35bb19453 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d61d161a9c36fa45.js @@ -0,0 +1,3 @@ +((function () { + ((1), eval)(""); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d6aed84ca98bee95.js b/compiler/tests-js-parser/pass-explicit/d6aed84ca98bee95.js new file mode 100644 index 000000000..b1059ea84 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d6aed84ca98bee95.js @@ -0,0 +1 @@ +({a, b}); diff --git a/compiler/tests-js-parser/pass-explicit/d6b2fd3884a06d56.js b/compiler/tests-js-parser/pass-explicit/d6b2fd3884a06d56.js new file mode 100644 index 000000000..ffea2adaa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d6b2fd3884a06d56.js @@ -0,0 +1 @@ +var {get} = (a); diff --git a/compiler/tests-js-parser/pass-explicit/d6bb7d557971a15f.js b/compiler/tests-js-parser/pass-explicit/d6bb7d557971a15f.js new file mode 100644 index 000000000..2549fb32d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d6bb7d557971a15f.js @@ -0,0 +1 @@ +new (a`42`); diff --git a/compiler/tests-js-parser/pass-explicit/d7076912d1c9786c.module.js b/compiler/tests-js-parser/pass-explicit/d7076912d1c9786c.module.js new file mode 100644 index 000000000..d6d1738de --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d7076912d1c9786c.module.js @@ -0,0 +1 @@ +export default []; diff --git a/compiler/tests-js-parser/pass-explicit/d7284aa68a87bb97.js b/compiler/tests-js-parser/pass-explicit/d7284aa68a87bb97.js new file mode 100644 index 000000000..7e52ab934 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d7284aa68a87bb97.js @@ -0,0 +1 @@ +let [a] = ([1]); diff --git a/compiler/tests-js-parser/pass-explicit/d759838042f0bf78.js b/compiler/tests-js-parser/pass-explicit/d759838042f0bf78.js new file mode 100644 index 000000000..bc3c72469 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d759838042f0bf78.js @@ -0,0 +1 @@ +a = ([1, 2, 3]); diff --git a/compiler/tests-js-parser/pass-explicit/d767138e133ad239.js b/compiler/tests-js-parser/pass-explicit/d767138e133ad239.js new file mode 100644 index 000000000..9c2b9ec89 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d767138e133ad239.js @@ -0,0 +1 @@ +({__proto__: null, get __proto__() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/d79a08ea5cc1e2f6.js b/compiler/tests-js-parser/pass-explicit/d79a08ea5cc1e2f6.js new file mode 100644 index 000000000..cf5b01b54 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d79a08ea5cc1e2f6.js @@ -0,0 +1 @@ +const eval = (1), arguments = (2); diff --git a/compiler/tests-js-parser/pass-explicit/d7c7ff252e84e81d.js b/compiler/tests-js-parser/pass-explicit/d7c7ff252e84e81d.js new file mode 100644 index 000000000..4193f1d0f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d7c7ff252e84e81d.js @@ -0,0 +1,7 @@ +try { + a(); +} catch (b) { + c(b); +} finally { + d(e); +} diff --git a/compiler/tests-js-parser/pass-explicit/d7da7ccd42af2c4b.js b/compiler/tests-js-parser/pass-explicit/d7da7ccd42af2c4b.js new file mode 100644 index 000000000..2f571c2cc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d7da7ccd42af2c4b.js @@ -0,0 +1 @@ +a.a *= (1); diff --git a/compiler/tests-js-parser/pass-explicit/d7e461a3aa2cd9bc.module.js b/compiler/tests-js-parser/pass-explicit/d7e461a3aa2cd9bc.module.js new file mode 100644 index 000000000..7a0f605c3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d7e461a3aa2cd9bc.module.js @@ -0,0 +1 @@ +export let a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/d80edd7fb074b51d.js b/compiler/tests-js-parser/pass-explicit/d80edd7fb074b51d.js new file mode 100644 index 000000000..f75e10d7c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d80edd7fb074b51d.js @@ -0,0 +1 @@ +6; diff --git a/compiler/tests-js-parser/pass-explicit/d818deffd07a5c3a.js b/compiler/tests-js-parser/pass-explicit/d818deffd07a5c3a.js new file mode 100644 index 000000000..ffa82bf09 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d818deffd07a5c3a.js @@ -0,0 +1 @@ +for (var a in b) continue; diff --git a/compiler/tests-js-parser/pass-explicit/d81d71f4121e3193.js b/compiler/tests-js-parser/pass-explicit/d81d71f4121e3193.js new file mode 100644 index 000000000..31c4a8b66 Binary files /dev/null and b/compiler/tests-js-parser/pass-explicit/d81d71f4121e3193.js differ diff --git a/compiler/tests-js-parser/pass-explicit/d82ae3dbc61808f8.js b/compiler/tests-js-parser/pass-explicit/d82ae3dbc61808f8.js new file mode 100644 index 000000000..6b3a35498 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d82ae3dbc61808f8.js @@ -0,0 +1 @@ +function a(...yield) {} diff --git a/compiler/tests-js-parser/pass-explicit/d843ddb6cde8c408.js b/compiler/tests-js-parser/pass-explicit/d843ddb6cde8c408.js new file mode 100644 index 000000000..3215d8518 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d843ddb6cde8c408.js @@ -0,0 +1,3 @@ +((function () { + return (typeof (a())) !== ("b"); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d8882ceedce6eae0.js b/compiler/tests-js-parser/pass-explicit/d8882ceedce6eae0.js new file mode 100644 index 000000000..02d19eb95 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d8882ceedce6eae0.js @@ -0,0 +1 @@ +c: for (var a in b) continue c; diff --git a/compiler/tests-js-parser/pass-explicit/d88992e07614f506.js b/compiler/tests-js-parser/pass-explicit/d88992e07614f506.js new file mode 100644 index 000000000..730f75240 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d88992e07614f506.js @@ -0,0 +1,6 @@ +((function () { + var a = (1); + with (b) { + a + (((c()), (d())), (e())); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d8aff43ba7b44ef3.js b/compiler/tests-js-parser/pass-explicit/d8aff43ba7b44ef3.js new file mode 100644 index 000000000..9039b1304 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d8aff43ba7b44ef3.js @@ -0,0 +1,8 @@ +((function () { + if ((true) != a) { + b(); + } + if ((false) != a) { + b(); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d8b6a56583bdefab.js b/compiler/tests-js-parser/pass-explicit/d8b6a56583bdefab.js new file mode 100644 index 000000000..b9c9cfe0b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d8b6a56583bdefab.js @@ -0,0 +1 @@ +++eval; diff --git a/compiler/tests-js-parser/pass-explicit/d8db2079f10d30ff.js b/compiler/tests-js-parser/pass-explicit/d8db2079f10d30ff.js new file mode 100644 index 000000000..d936c3375 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d8db2079f10d30ff.js @@ -0,0 +1 @@ +while (true) a(); diff --git a/compiler/tests-js-parser/pass-explicit/d917a549d3f308d8.js b/compiler/tests-js-parser/pass-explicit/d917a549d3f308d8.js new file mode 100644 index 000000000..6231f1bf1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d917a549d3f308d8.js @@ -0,0 +1 @@ +a / b; diff --git a/compiler/tests-js-parser/pass-explicit/d93ec22aea12336a.js b/compiler/tests-js-parser/pass-explicit/d93ec22aea12336a.js new file mode 100644 index 000000000..8f7f88b58 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d93ec22aea12336a.js @@ -0,0 +1,5 @@ +function a() { + class b {} + var c = (b); + var d = (class e {}); +} diff --git a/compiler/tests-js-parser/pass-explicit/d94d38d65e8b715f.js b/compiler/tests-js-parser/pass-explicit/d94d38d65e8b715f.js new file mode 100644 index 000000000..491121ee1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d94d38d65e8b715f.js @@ -0,0 +1,3 @@ +function a() { + return null; +} diff --git a/compiler/tests-js-parser/pass-explicit/d95b0608f939e81a.js b/compiler/tests-js-parser/pass-explicit/d95b0608f939e81a.js new file mode 100644 index 000000000..148410eb7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d95b0608f939e81a.js @@ -0,0 +1 @@ +for (var a = (1); b; c) ; diff --git a/compiler/tests-js-parser/pass-explicit/d95e9ad32d562722.js b/compiler/tests-js-parser/pass-explicit/d95e9ad32d562722.js new file mode 100644 index 000000000..91e2a75ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d95e9ad32d562722.js @@ -0,0 +1,6 @@ +((function () { + var a; + return function () { + return (typeof a) === ("b"); + }; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d96153b59454dddd.js b/compiler/tests-js-parser/pass-explicit/d96153b59454dddd.js new file mode 100644 index 000000000..cd42d7876 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d96153b59454dddd.js @@ -0,0 +1 @@ +([1]).a = (2); diff --git a/compiler/tests-js-parser/pass-explicit/d97144839fbdca91.js b/compiler/tests-js-parser/pass-explicit/d97144839fbdca91.js new file mode 100644 index 000000000..d26f9187a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d97144839fbdca91.js @@ -0,0 +1 @@ +(""); diff --git a/compiler/tests-js-parser/pass-explicit/d99414900a405295.js b/compiler/tests-js-parser/pass-explicit/d99414900a405295.js new file mode 100644 index 000000000..c692558ec --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d99414900a405295.js @@ -0,0 +1,3 @@ +a = ((function () { + return 1; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d99714b3c4e81b56.js b/compiler/tests-js-parser/pass-explicit/d99714b3c4e81b56.js new file mode 100644 index 000000000..a27db18a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d99714b3c4e81b56.js @@ -0,0 +1,3 @@ +for (; a();) { + if (b()) c(); else break; +} diff --git a/compiler/tests-js-parser/pass-explicit/d9a0d4f0a35dc04e.js b/compiler/tests-js-parser/pass-explicit/d9a0d4f0a35dc04e.js new file mode 100644 index 000000000..fa43b3e8f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d9a0d4f0a35dc04e.js @@ -0,0 +1 @@ +(0).a; diff --git a/compiler/tests-js-parser/pass-explicit/d9d0b115106f376c.js b/compiler/tests-js-parser/pass-explicit/d9d0b115106f376c.js new file mode 100644 index 000000000..1ffff418b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d9d0b115106f376c.js @@ -0,0 +1,7 @@ +((function () { + switch (a) { + case 1: + b("c"); + default: + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/d9eb39b11bc766f4.js b/compiler/tests-js-parser/pass-explicit/d9eb39b11bc766f4.js new file mode 100644 index 000000000..4635f249b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/d9eb39b11bc766f4.js @@ -0,0 +1 @@ +[, , 1, , , 2, 3, , ]; diff --git a/compiler/tests-js-parser/pass-explicit/da3756d1f8acb3c5.js b/compiler/tests-js-parser/pass-explicit/da3756d1f8acb3c5.js new file mode 100644 index 000000000..51a06d261 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/da3756d1f8acb3c5.js @@ -0,0 +1 @@ +({a}) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/da4c5dd50fbdda83.js b/compiler/tests-js-parser/pass-explicit/da4c5dd50fbdda83.js new file mode 100644 index 000000000..edb1d45a2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/da4c5dd50fbdda83.js @@ -0,0 +1 @@ +new (a``); diff --git a/compiler/tests-js-parser/pass-explicit/da671a25e498bcac.module.js b/compiler/tests-js-parser/pass-explicit/da671a25e498bcac.module.js new file mode 100644 index 000000000..c33f5633d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/da671a25e498bcac.module.js @@ -0,0 +1 @@ +export default function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/da96599b89265d75.js b/compiler/tests-js-parser/pass-explicit/da96599b89265d75.js new file mode 100644 index 000000000..582290fd1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/da96599b89265d75.js @@ -0,0 +1 @@ +ⅣⅡ; diff --git a/compiler/tests-js-parser/pass-explicit/da9e16ac9fd5b61d.js b/compiler/tests-js-parser/pass-explicit/da9e16ac9fd5b61d.js new file mode 100644 index 000000000..fdc51ec87 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/da9e16ac9fd5b61d.js @@ -0,0 +1 @@ +var 𞸀; diff --git a/compiler/tests-js-parser/pass-explicit/da9fdc3a2d7f9452.js b/compiler/tests-js-parser/pass-explicit/da9fdc3a2d7f9452.js new file mode 100644 index 000000000..55050c1fe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/da9fdc3a2d7f9452.js @@ -0,0 +1 @@ +function a(b, c = 1) {} diff --git a/compiler/tests-js-parser/pass-explicit/dad51383642e0d27.js b/compiler/tests-js-parser/pass-explicit/dad51383642e0d27.js new file mode 100644 index 000000000..e8a728913 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dad51383642e0d27.js @@ -0,0 +1 @@ +/{/; diff --git a/compiler/tests-js-parser/pass-explicit/dadae97bf343020d.js b/compiler/tests-js-parser/pass-explicit/dadae97bf343020d.js new file mode 100644 index 000000000..9faa5d72a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dadae97bf343020d.js @@ -0,0 +1,3 @@ +function* a() { + yield (true); +} diff --git a/compiler/tests-js-parser/pass-explicit/dadccefeaae19dbf.js b/compiler/tests-js-parser/pass-explicit/dadccefeaae19dbf.js new file mode 100644 index 000000000..bff4f0d95 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dadccefeaae19dbf.js @@ -0,0 +1 @@ +/[-\-]/u; diff --git a/compiler/tests-js-parser/pass-explicit/dafb7abe5b9b44f5.js b/compiler/tests-js-parser/pass-explicit/dafb7abe5b9b44f5.js new file mode 100644 index 000000000..6356ce72d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dafb7abe5b9b44f5.js @@ -0,0 +1 @@ +var _ð’¦ = (1); diff --git a/compiler/tests-js-parser/pass-explicit/db1fd3f76ebc6554.js b/compiler/tests-js-parser/pass-explicit/db1fd3f76ebc6554.js new file mode 100644 index 000000000..89e2ac6c4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/db1fd3f76ebc6554.js @@ -0,0 +1 @@ +a(b, ...c, d); diff --git a/compiler/tests-js-parser/pass-explicit/db3c01738aaf0b92.js b/compiler/tests-js-parser/pass-explicit/db3c01738aaf0b92.js new file mode 100644 index 000000000..6ec3a3dde --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/db3c01738aaf0b92.js @@ -0,0 +1 @@ +x **= (0); diff --git a/compiler/tests-js-parser/pass-explicit/db456532eea62941.js b/compiler/tests-js-parser/pass-explicit/db456532eea62941.js new file mode 100644 index 000000000..72a2d177f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/db456532eea62941.js @@ -0,0 +1 @@ +if (a) b(); else c(); diff --git a/compiler/tests-js-parser/pass-explicit/db66e1e8f3f1faef.js b/compiler/tests-js-parser/pass-explicit/db66e1e8f3f1faef.js new file mode 100644 index 000000000..415d3befa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/db66e1e8f3f1faef.js @@ -0,0 +1,4 @@ +b: while (1) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/db8fe6c7579e6ead.js b/compiler/tests-js-parser/pass-explicit/db8fe6c7579e6ead.js new file mode 100644 index 000000000..4989e81d1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/db8fe6c7579e6ead.js @@ -0,0 +1,4 @@ +{ + throw a; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/dbbf129d7ae91ac3.js b/compiler/tests-js-parser/pass-explicit/dbbf129d7ae91ac3.js new file mode 100644 index 000000000..ebacc5c0a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dbbf129d7ae91ac3.js @@ -0,0 +1,3 @@ +var a = (function () { + new.target; +}); diff --git a/compiler/tests-js-parser/pass-explicit/dc1acc240053a397.js b/compiler/tests-js-parser/pass-explicit/dc1acc240053a397.js new file mode 100644 index 000000000..0ca5d95af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dc1acc240053a397.js @@ -0,0 +1 @@ +({a() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/dc2b756c7828d827.module.js b/compiler/tests-js-parser/pass-explicit/dc2b756c7828d827.module.js new file mode 100644 index 000000000..fa1736f9f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dc2b756c7828d827.module.js @@ -0,0 +1 @@ +export function a() {} diff --git a/compiler/tests-js-parser/pass-explicit/dc3afa2f13259ae0.js b/compiler/tests-js-parser/pass-explicit/dc3afa2f13259ae0.js new file mode 100644 index 000000000..d26f9187a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dc3afa2f13259ae0.js @@ -0,0 +1 @@ +(""); diff --git a/compiler/tests-js-parser/pass-explicit/dc3e1097a489e009.js b/compiler/tests-js-parser/pass-explicit/dc3e1097a489e009.js new file mode 100644 index 000000000..6dbc3994c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dc3e1097a489e009.js @@ -0,0 +1 @@ +throw 1; diff --git a/compiler/tests-js-parser/pass-explicit/dc43022b3729abd1.js b/compiler/tests-js-parser/pass-explicit/dc43022b3729abd1.js new file mode 100644 index 000000000..187cb3e3e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dc43022b3729abd1.js @@ -0,0 +1 @@ +10; diff --git a/compiler/tests-js-parser/pass-explicit/dc6037a43bed9588.js b/compiler/tests-js-parser/pass-explicit/dc6037a43bed9588.js new file mode 100644 index 000000000..1a70fdb40 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dc6037a43bed9588.js @@ -0,0 +1 @@ +var 𞸆_$; diff --git a/compiler/tests-js-parser/pass-explicit/dc9d42142b4ada05.js b/compiler/tests-js-parser/pass-explicit/dc9d42142b4ada05.js new file mode 100644 index 000000000..9384d369f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dc9d42142b4ada05.js @@ -0,0 +1,4 @@ +if (a) { + b = (1); + for (var c;;) ; +} diff --git a/compiler/tests-js-parser/pass-explicit/dcc5609dcc043200.js b/compiler/tests-js-parser/pass-explicit/dcc5609dcc043200.js new file mode 100644 index 000000000..f1a385b04 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dcc5609dcc043200.js @@ -0,0 +1,3 @@ +(class { + static constructor() {} +}); diff --git a/compiler/tests-js-parser/pass-explicit/dcc634c173bc704f.js b/compiler/tests-js-parser/pass-explicit/dcc634c173bc704f.js new file mode 100644 index 000000000..6cd1b345f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dcc634c173bc704f.js @@ -0,0 +1 @@ +var a = ((((((!a) || (!b)) || (!c)) || (!d)) || (!e)) || (!f)); diff --git a/compiler/tests-js-parser/pass-explicit/dcc9c2ff46392f30.js b/compiler/tests-js-parser/pass-explicit/dcc9c2ff46392f30.js new file mode 100644 index 000000000..eb2fec3af --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dcc9c2ff46392f30.js @@ -0,0 +1 @@ +a = ({b: function (c = 1) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/dcdf666e16667f4c.js b/compiler/tests-js-parser/pass-explicit/dcdf666e16667f4c.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dcdf666e16667f4c.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/dcfaa5f359400cf2.js b/compiler/tests-js-parser/pass-explicit/dcfaa5f359400cf2.js new file mode 100644 index 000000000..61f9badb4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dcfaa5f359400cf2.js @@ -0,0 +1,3 @@ +for (;;) { + if (a) continue; +} diff --git a/compiler/tests-js-parser/pass-explicit/dcfb11abc780d6d9.js b/compiler/tests-js-parser/pass-explicit/dcfb11abc780d6d9.js new file mode 100644 index 000000000..ecc0a6b56 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dcfb11abc780d6d9.js @@ -0,0 +1,4 @@ +{ + do {} while (false); + false; +} diff --git a/compiler/tests-js-parser/pass-explicit/dd0e8f971ab4d6ab.js b/compiler/tests-js-parser/pass-explicit/dd0e8f971ab4d6ab.js new file mode 100644 index 000000000..3fa14a2a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dd0e8f971ab4d6ab.js @@ -0,0 +1,3 @@ +((function a() { + b((typeof (a())) === ("c")); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/dd3c63403db5c06e.js b/compiler/tests-js-parser/pass-explicit/dd3c63403db5c06e.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dd3c63403db5c06e.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/dd500055335127b3.js b/compiler/tests-js-parser/pass-explicit/dd500055335127b3.js new file mode 100644 index 000000000..2d072c52a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dd500055335127b3.js @@ -0,0 +1,2 @@ +var a = (1); +(this).b = (2); diff --git a/compiler/tests-js-parser/pass-explicit/dd67e8365153c4fb.js b/compiler/tests-js-parser/pass-explicit/dd67e8365153c4fb.js new file mode 100644 index 000000000..19b43528c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dd67e8365153c4fb.js @@ -0,0 +1,5 @@ +(class extends a { + constructor() { + super(); + } +}); diff --git a/compiler/tests-js-parser/pass-explicit/dd80c278722f97e9.js b/compiler/tests-js-parser/pass-explicit/dd80c278722f97e9.js new file mode 100644 index 000000000..6a711a1aa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dd80c278722f97e9.js @@ -0,0 +1,3 @@ +function a(b) { + return b; +} diff --git a/compiler/tests-js-parser/pass-explicit/ddcd0bf839779a45.js b/compiler/tests-js-parser/pass-explicit/ddcd0bf839779a45.js new file mode 100644 index 000000000..0d294635f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ddcd0bf839779a45.js @@ -0,0 +1,6 @@ +switch (a) { + case 1: + ((function () { + b("c"); + })()); +} diff --git a/compiler/tests-js-parser/pass-explicit/ddd3c540fa087867.js b/compiler/tests-js-parser/pass-explicit/ddd3c540fa087867.js new file mode 100644 index 000000000..cd5393bc9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ddd3c540fa087867.js @@ -0,0 +1 @@ +((a()), (b.b))(); diff --git a/compiler/tests-js-parser/pass-explicit/ddef0827f7a75499.js b/compiler/tests-js-parser/pass-explicit/ddef0827f7a75499.js new file mode 100644 index 000000000..ff11539ba --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ddef0827f7a75499.js @@ -0,0 +1 @@ +var a; diff --git a/compiler/tests-js-parser/pass-explicit/de24062f6e293cf0.js b/compiler/tests-js-parser/pass-explicit/de24062f6e293cf0.js new file mode 100644 index 000000000..3d8fab811 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/de24062f6e293cf0.js @@ -0,0 +1 @@ +[[[[[[[[[[[[[[[[[[[[{a = b[1]}]]]]]]]]]]]]]]]]]]]] = (2); diff --git a/compiler/tests-js-parser/pass-explicit/de25059a9dd7b618.js b/compiler/tests-js-parser/pass-explicit/de25059a9dd7b618.js new file mode 100644 index 000000000..237109ae4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/de25059a9dd7b618.js @@ -0,0 +1,3 @@ +((function () { + (null) != (a ? (void (1)) : (void (2))); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/de6b6c9002d2d43e.js b/compiler/tests-js-parser/pass-explicit/de6b6c9002d2d43e.js new file mode 100644 index 000000000..ea4eeb913 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/de6b6c9002d2d43e.js @@ -0,0 +1,4 @@ +new (function () { + var a = (1); + b((((this).constructor).arguments).c); +}); diff --git a/compiler/tests-js-parser/pass-explicit/de6dd6b2ec971861.js b/compiler/tests-js-parser/pass-explicit/de6dd6b2ec971861.js new file mode 100644 index 000000000..92b83e8f6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/de6dd6b2ec971861.js @@ -0,0 +1,3 @@ +class a { + get() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/dec1ae80150e1664.js b/compiler/tests-js-parser/pass-explicit/dec1ae80150e1664.js new file mode 100644 index 000000000..90708f1a4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dec1ae80150e1664.js @@ -0,0 +1,2 @@ +{} +/=/; diff --git a/compiler/tests-js-parser/pass-explicit/dec6aac10ea17f7f.js b/compiler/tests-js-parser/pass-explicit/dec6aac10ea17f7f.js new file mode 100644 index 000000000..a9a9c08b8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dec6aac10ea17f7f.js @@ -0,0 +1,12 @@ +function a() { + while (b) { + { + c(); + c(); + var d = (1); + } + { + c(); + } + } +} diff --git a/compiler/tests-js-parser/pass-explicit/decdfa7f961d283c.js b/compiler/tests-js-parser/pass-explicit/decdfa7f961d283c.js new file mode 100644 index 000000000..570745250 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/decdfa7f961d283c.js @@ -0,0 +1 @@ +if (a) b; else c; diff --git a/compiler/tests-js-parser/pass-explicit/df20c9b7a7d534cb.js b/compiler/tests-js-parser/pass-explicit/df20c9b7a7d534cb.js new file mode 100644 index 000000000..255cdc9a7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/df20c9b7a7d534cb.js @@ -0,0 +1,5 @@ +a = ({get b() { + return c; +}, set b (b) { + c = b; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/df4eb225b4ba9ae2.js b/compiler/tests-js-parser/pass-explicit/df4eb225b4ba9ae2.js new file mode 100644 index 000000000..e0555370c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/df4eb225b4ba9ae2.js @@ -0,0 +1 @@ +a ? b : c; diff --git a/compiler/tests-js-parser/pass-explicit/df5fee9e52377ab9.module.js b/compiler/tests-js-parser/pass-explicit/df5fee9e52377ab9.module.js new file mode 100644 index 000000000..636ea6b41 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/df5fee9e52377ab9.module.js @@ -0,0 +1 @@ +export class a {} diff --git a/compiler/tests-js-parser/pass-explicit/df696c501125c86f.js b/compiler/tests-js-parser/pass-explicit/df696c501125c86f.js new file mode 100644 index 000000000..07bbcf62c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/df696c501125c86f.js @@ -0,0 +1 @@ +for (let.let in 1) ; diff --git a/compiler/tests-js-parser/pass-explicit/df7e8c48ed8d9e6f.js b/compiler/tests-js-parser/pass-explicit/df7e8c48ed8d9e6f.js new file mode 100644 index 000000000..e299edd35 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/df7e8c48ed8d9e6f.js @@ -0,0 +1,4 @@ +((function () { + return 1; + a(); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/df9c60e4ff82b9d9.js b/compiler/tests-js-parser/pass-explicit/df9c60e4ff82b9d9.js new file mode 100644 index 000000000..700af3188 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/df9c60e4ff82b9d9.js @@ -0,0 +1 @@ +new (new a); diff --git a/compiler/tests-js-parser/pass-explicit/dfa22e3eac3cd26e.js b/compiler/tests-js-parser/pass-explicit/dfa22e3eac3cd26e.js new file mode 100644 index 000000000..69ddfd2ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dfa22e3eac3cd26e.js @@ -0,0 +1,3 @@ +class a { + static b() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/dfbd1b07bd57a08d.js b/compiler/tests-js-parser/pass-explicit/dfbd1b07bd57a08d.js new file mode 100644 index 000000000..7b129501f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/dfbd1b07bd57a08d.js @@ -0,0 +1 @@ +function a(...b) {} diff --git a/compiler/tests-js-parser/pass-explicit/e01c7172cf204b92.js b/compiler/tests-js-parser/pass-explicit/e01c7172cf204b92.js new file mode 100644 index 000000000..d0f096858 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e01c7172cf204b92.js @@ -0,0 +1 @@ +(function a(b = new.target) {}); diff --git a/compiler/tests-js-parser/pass-explicit/e0204155218e1d42.js b/compiler/tests-js-parser/pass-explicit/e0204155218e1d42.js new file mode 100644 index 000000000..65cd99f1f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e0204155218e1d42.js @@ -0,0 +1 @@ +((123).a)(1); diff --git a/compiler/tests-js-parser/pass-explicit/e03ae54743348d7d.js b/compiler/tests-js-parser/pass-explicit/e03ae54743348d7d.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/e05209211a87a606.js b/compiler/tests-js-parser/pass-explicit/e05209211a87a606.js new file mode 100644 index 000000000..eab746921 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e05209211a87a606.js @@ -0,0 +1 @@ +debugger; diff --git a/compiler/tests-js-parser/pass-explicit/e08112a34cfea369.js b/compiler/tests-js-parser/pass-explicit/e08112a34cfea369.js new file mode 100644 index 000000000..957dee13a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e08112a34cfea369.js @@ -0,0 +1,3 @@ +for (var [a, b] in c) ; +for (var [d] = (1);;) ; +for (var {e} of f) ; diff --git a/compiler/tests-js-parser/pass-explicit/e08e181172bad2b1.js b/compiler/tests-js-parser/pass-explicit/e08e181172bad2b1.js new file mode 100644 index 000000000..e1171c755 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e08e181172bad2b1.js @@ -0,0 +1 @@ +({get [(1) + (2)]() {}, set [(3) / (4)] (a) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/e0b98eaceaaeaf9b.js b/compiler/tests-js-parser/pass-explicit/e0b98eaceaaeaf9b.js new file mode 100644 index 000000000..c3c966ba7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e0b98eaceaaeaf9b.js @@ -0,0 +1 @@ +--a; diff --git a/compiler/tests-js-parser/pass-explicit/e0c3f07a142a589d.js b/compiler/tests-js-parser/pass-explicit/e0c3f07a142a589d.js new file mode 100644 index 000000000..e924742f8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e0c3f07a142a589d.js @@ -0,0 +1,5 @@ +function a() { + if (b) {} else { + c(); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/e0f831f2b08fd35c.js b/compiler/tests-js-parser/pass-explicit/e0f831f2b08fd35c.js new file mode 100644 index 000000000..eb6e4b2ed --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e0f831f2b08fd35c.js @@ -0,0 +1,4 @@ +9; +9; +9; +9; diff --git a/compiler/tests-js-parser/pass-explicit/e0fc2148b455a6be.js b/compiler/tests-js-parser/pass-explicit/e0fc2148b455a6be.js new file mode 100644 index 000000000..87514cee6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e0fc2148b455a6be.js @@ -0,0 +1 @@ +(function ({a: b, a: c}) {}); diff --git a/compiler/tests-js-parser/pass-explicit/e1237566c1f89d8e.js b/compiler/tests-js-parser/pass-explicit/e1237566c1f89d8e.js new file mode 100644 index 000000000..c533eba13 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e1237566c1f89d8e.js @@ -0,0 +1 @@ +if (a) b(); diff --git a/compiler/tests-js-parser/pass-explicit/e12aa6994333466f.js b/compiler/tests-js-parser/pass-explicit/e12aa6994333466f.js new file mode 100644 index 000000000..77294a409 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e12aa6994333466f.js @@ -0,0 +1,6 @@ +var a; +if (b()) { + a(c); +} else { + a(d); +} diff --git a/compiler/tests-js-parser/pass-explicit/e1387fe892984e2b.js b/compiler/tests-js-parser/pass-explicit/e1387fe892984e2b.js new file mode 100644 index 000000000..568041953 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e1387fe892984e2b.js @@ -0,0 +1 @@ +function x({a: {w, x}, b: [y, z]}, ...[a, b, c]) {} diff --git a/compiler/tests-js-parser/pass-explicit/e1820bdb79ebe44b.js b/compiler/tests-js-parser/pass-explicit/e1820bdb79ebe44b.js new file mode 100644 index 000000000..34b771f43 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e1820bdb79ebe44b.js @@ -0,0 +1 @@ +[...[a]] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/e18c297bf29c4b6b.js b/compiler/tests-js-parser/pass-explicit/e18c297bf29c4b6b.js new file mode 100644 index 000000000..091f66849 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e18c297bf29c4b6b.js @@ -0,0 +1 @@ +var a, {b: {c: a}} = (1); diff --git a/compiler/tests-js-parser/pass-explicit/e18f80fa1699a0fd.js b/compiler/tests-js-parser/pass-explicit/e18f80fa1699a0fd.js new file mode 100644 index 000000000..10db2ad30 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e18f80fa1699a0fd.js @@ -0,0 +1 @@ +aa; diff --git a/compiler/tests-js-parser/pass-explicit/e1939e7cb50f65b4.js b/compiler/tests-js-parser/pass-explicit/e1939e7cb50f65b4.js new file mode 100644 index 000000000..32f317d9a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e1939e7cb50f65b4.js @@ -0,0 +1,3 @@ +(function* () { + [...{a = yield}] = (1); +}); diff --git a/compiler/tests-js-parser/pass-explicit/e1d373aa5d926fde.module.js b/compiler/tests-js-parser/pass-explicit/e1d373aa5d926fde.module.js new file mode 100644 index 000000000..95ca8eef8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e1d373aa5d926fde.module.js @@ -0,0 +1 @@ +export var a = ({}); diff --git a/compiler/tests-js-parser/pass-explicit/e1dd1979a86a5f1d.js b/compiler/tests-js-parser/pass-explicit/e1dd1979a86a5f1d.js new file mode 100644 index 000000000..c33eb8793 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e1dd1979a86a5f1d.js @@ -0,0 +1 @@ +try {} catch ([a, b, {c, d: e = 1, [f]: g = 2, h = i}]) {} diff --git a/compiler/tests-js-parser/pass-explicit/e23748bdbb0713dc.js b/compiler/tests-js-parser/pass-explicit/e23748bdbb0713dc.js new file mode 100644 index 000000000..e30b04392 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e23748bdbb0713dc.js @@ -0,0 +1,10 @@ +((function () { + function a() { + (b.c)("d"); + } + { + function a() { + (b.c)("e"); + } + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/e23f481ffc072aee.js b/compiler/tests-js-parser/pass-explicit/e23f481ffc072aee.js new file mode 100644 index 000000000..0e2067f16 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e23f481ffc072aee.js @@ -0,0 +1,4 @@ +if (a) b(); +if (!a) ; else b(); +if (a) ; else b(); +if (a) ; else ; diff --git a/compiler/tests-js-parser/pass-explicit/e2470430b235b9bb.module.js b/compiler/tests-js-parser/pass-explicit/e2470430b235b9bb.module.js new file mode 100644 index 000000000..c567021d2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e2470430b235b9bb.module.js @@ -0,0 +1,3 @@ +export default function a() {} +let b; +export {b as a}; diff --git a/compiler/tests-js-parser/pass-explicit/e290a32637ffdcb7.js b/compiler/tests-js-parser/pass-explicit/e290a32637ffdcb7.js new file mode 100644 index 000000000..aa1956dd0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e290a32637ffdcb7.js @@ -0,0 +1,3 @@ +((function () { + a["Infinity"] = (1); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/e2ac0bea41202dc9.js b/compiler/tests-js-parser/pass-explicit/e2ac0bea41202dc9.js new file mode 100644 index 000000000..b6853c363 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e2ac0bea41202dc9.js @@ -0,0 +1,3 @@ +({get __proto__() { + return 1; +}, __proto__: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/e2c7f7c0da23bc45.js b/compiler/tests-js-parser/pass-explicit/e2c7f7c0da23bc45.js new file mode 100644 index 000000000..c5534f142 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e2c7f7c0da23bc45.js @@ -0,0 +1,7 @@ +((function () { + switch (a) { + default: + case 1: + b("c"); + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/e2c80df1960433a3.js b/compiler/tests-js-parser/pass-explicit/e2c80df1960433a3.js new file mode 100644 index 000000000..1aa5a123f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e2c80df1960433a3.js @@ -0,0 +1 @@ +var yield = (1); diff --git a/compiler/tests-js-parser/pass-explicit/e349023df8e12f2d.js b/compiler/tests-js-parser/pass-explicit/e349023df8e12f2d.js new file mode 100644 index 000000000..7a527a272 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e349023df8e12f2d.js @@ -0,0 +1 @@ +(1) in (2); diff --git a/compiler/tests-js-parser/pass-explicit/e374d329af31c20a.js b/compiler/tests-js-parser/pass-explicit/e374d329af31c20a.js new file mode 100644 index 000000000..1dfe82673 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e374d329af31c20a.js @@ -0,0 +1 @@ +"\'"; diff --git a/compiler/tests-js-parser/pass-explicit/e3b0c44298fc1c14.js b/compiler/tests-js-parser/pass-explicit/e3b0c44298fc1c14.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/e42f306327c0f578.js b/compiler/tests-js-parser/pass-explicit/e42f306327c0f578.js new file mode 100644 index 000000000..01b2794b8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e42f306327c0f578.js @@ -0,0 +1,2 @@ +"use strict"; +var a = ({set b (a) {}, b: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/e463265266cee73e.js b/compiler/tests-js-parser/pass-explicit/e463265266cee73e.js new file mode 100644 index 000000000..2a0ef6a05 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e463265266cee73e.js @@ -0,0 +1,3 @@ +function* a() { + yield* b; +} diff --git a/compiler/tests-js-parser/pass-explicit/e46381af137ed2e2.js b/compiler/tests-js-parser/pass-explicit/e46381af137ed2e2.js new file mode 100644 index 000000000..e16dc0cc2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e46381af137ed2e2.js @@ -0,0 +1 @@ +(a(1)).b; diff --git a/compiler/tests-js-parser/pass-explicit/e46f7944dd0d4eb4.js b/compiler/tests-js-parser/pass-explicit/e46f7944dd0d4eb4.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e46f7944dd0d4eb4.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/e4bd395227b4ee8e.js b/compiler/tests-js-parser/pass-explicit/e4bd395227b4ee8e.js new file mode 100644 index 000000000..0d7b57aeb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e4bd395227b4ee8e.js @@ -0,0 +1 @@ +([a]) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/e4c6c19e4b214180.js b/compiler/tests-js-parser/pass-explicit/e4c6c19e4b214180.js new file mode 100644 index 000000000..f4c81d615 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e4c6c19e4b214180.js @@ -0,0 +1,3 @@ +function* a() { + yield (+(1)); +} diff --git a/compiler/tests-js-parser/pass-explicit/e4cef19dab44335a.js b/compiler/tests-js-parser/pass-explicit/e4cef19dab44335a.js new file mode 100644 index 000000000..de7eae737 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e4cef19dab44335a.js @@ -0,0 +1 @@ +[1, , 2]; diff --git a/compiler/tests-js-parser/pass-explicit/e512276dcfe241c1.js b/compiler/tests-js-parser/pass-explicit/e512276dcfe241c1.js new file mode 100644 index 000000000..2390c2b28 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e512276dcfe241c1.js @@ -0,0 +1,4 @@ +{ + a; + ++b; +} diff --git a/compiler/tests-js-parser/pass-explicit/e5204d6e30f296a8.js b/compiler/tests-js-parser/pass-explicit/e5204d6e30f296a8.js new file mode 100644 index 000000000..440631ac0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e5204d6e30f296a8.js @@ -0,0 +1,4 @@ +switch (a) { + default: + case 1: +} diff --git a/compiler/tests-js-parser/pass-explicit/e5393f15b0e8585d.js b/compiler/tests-js-parser/pass-explicit/e5393f15b0e8585d.js new file mode 100644 index 000000000..c51b55f81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e5393f15b0e8585d.js @@ -0,0 +1 @@ +({let} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/e54c1a2fc15cd4b8.js b/compiler/tests-js-parser/pass-explicit/e54c1a2fc15cd4b8.js new file mode 100644 index 000000000..4461838c3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e54c1a2fc15cd4b8.js @@ -0,0 +1,5 @@ +class a { + static b() {} + static get b() {} + static set b (c) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/e5570b178254bfb9.js b/compiler/tests-js-parser/pass-explicit/e5570b178254bfb9.js new file mode 100644 index 000000000..5eb8cd637 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e5570b178254bfb9.js @@ -0,0 +1 @@ +a: do continue a; while (true); diff --git a/compiler/tests-js-parser/pass-explicit/e577d5b725159d71.js b/compiler/tests-js-parser/pass-explicit/e577d5b725159d71.js new file mode 100644 index 000000000..fa43b3e8f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e577d5b725159d71.js @@ -0,0 +1 @@ +(0).a; diff --git a/compiler/tests-js-parser/pass-explicit/e5951efaf0b0c5b3.js b/compiler/tests-js-parser/pass-explicit/e5951efaf0b0c5b3.js new file mode 100644 index 000000000..a0244869d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e5951efaf0b0c5b3.js @@ -0,0 +1,3 @@ +function* a() { + yield (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/e5a7d56b798ec7e6.js b/compiler/tests-js-parser/pass-explicit/e5a7d56b798ec7e6.js new file mode 100644 index 000000000..de396f9b3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e5a7d56b798ec7e6.js @@ -0,0 +1 @@ +a("\v"); diff --git a/compiler/tests-js-parser/pass-explicit/e5fbf9e911ec36cd.js b/compiler/tests-js-parser/pass-explicit/e5fbf9e911ec36cd.js new file mode 100644 index 000000000..11ef681f8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e5fbf9e911ec36cd.js @@ -0,0 +1 @@ +a => (1); diff --git a/compiler/tests-js-parser/pass-explicit/e65f3cca9a4637c3.js b/compiler/tests-js-parser/pass-explicit/e65f3cca9a4637c3.js new file mode 100644 index 000000000..3918c74e4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e65f3cca9a4637c3.js @@ -0,0 +1 @@ +"use strict"; diff --git a/compiler/tests-js-parser/pass-explicit/e6643a557fe93de0.js b/compiler/tests-js-parser/pass-explicit/e6643a557fe93de0.js new file mode 100644 index 000000000..f4a0143df --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e6643a557fe93de0.js @@ -0,0 +1 @@ +({yield} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/e6714aac10964792.js b/compiler/tests-js-parser/pass-explicit/e6714aac10964792.js new file mode 100644 index 000000000..7b729b100 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e6714aac10964792.js @@ -0,0 +1 @@ +ⅣⅡ = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/e686d016100a7a08.js b/compiler/tests-js-parser/pass-explicit/e686d016100a7a08.js new file mode 100644 index 000000000..c824b86c9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e686d016100a7a08.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + new (super.d); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/e6ac25f6aa73a2be.js b/compiler/tests-js-parser/pass-explicit/e6ac25f6aa73a2be.js new file mode 100644 index 000000000..dc7ae485c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e6ac25f6aa73a2be.js @@ -0,0 +1 @@ +(/test/) || (1); diff --git a/compiler/tests-js-parser/pass-explicit/e6b424d430520bf2.js b/compiler/tests-js-parser/pass-explicit/e6b424d430520bf2.js new file mode 100644 index 000000000..3e7ae2f41 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e6b424d430520bf2.js @@ -0,0 +1,3 @@ +function a(b) { + if (c) for (var d = (1), e = ((b.f)());; d++) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/e6e24cfdc6d308a2.js b/compiler/tests-js-parser/pass-explicit/e6e24cfdc6d308a2.js new file mode 100644 index 000000000..78d39330b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e6e24cfdc6d308a2.js @@ -0,0 +1,3 @@ +{ + const a = (1), b = (2), c = (3); +} diff --git a/compiler/tests-js-parser/pass-explicit/e71a91c61343cdb1.js b/compiler/tests-js-parser/pass-explicit/e71a91c61343cdb1.js new file mode 100644 index 000000000..b6a8b1738 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e71a91c61343cdb1.js @@ -0,0 +1 @@ +a = ({get 10() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/e71c1d5f0b6b833c.js b/compiler/tests-js-parser/pass-explicit/e71c1d5f0b6b833c.js new file mode 100644 index 000000000..238a8bb73 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e71c1d5f0b6b833c.js @@ -0,0 +1 @@ +[a] = (0); diff --git a/compiler/tests-js-parser/pass-explicit/e720d4faf2b41f42.js b/compiler/tests-js-parser/pass-explicit/e720d4faf2b41f42.js new file mode 100644 index 000000000..0fedeed82 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e720d4faf2b41f42.js @@ -0,0 +1,3 @@ +function a() { + return; +} diff --git a/compiler/tests-js-parser/pass-explicit/e748a1e428ccdf69.js b/compiler/tests-js-parser/pass-explicit/e748a1e428ccdf69.js new file mode 100644 index 000000000..6ae74303e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e748a1e428ccdf69.js @@ -0,0 +1 @@ +new a(b, c); diff --git a/compiler/tests-js-parser/pass-explicit/e74a8d269a6abdb7.js b/compiler/tests-js-parser/pass-explicit/e74a8d269a6abdb7.js new file mode 100644 index 000000000..26677d49e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e74a8d269a6abdb7.js @@ -0,0 +1 @@ +var private, protected, public; diff --git a/compiler/tests-js-parser/pass-explicit/e75df8aea1749780.js b/compiler/tests-js-parser/pass-explicit/e75df8aea1749780.js new file mode 100644 index 000000000..c464e276b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e75df8aea1749780.js @@ -0,0 +1 @@ +a *= (1); diff --git a/compiler/tests-js-parser/pass-explicit/e78c7b54fc87d08c.js b/compiler/tests-js-parser/pass-explicit/e78c7b54fc87d08c.js new file mode 100644 index 000000000..45825ffb9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e78c7b54fc87d08c.js @@ -0,0 +1 @@ +function* a(b, c, d) {} diff --git a/compiler/tests-js-parser/pass-explicit/e7c1f6f0913c4a95.js b/compiler/tests-js-parser/pass-explicit/e7c1f6f0913c4a95.js new file mode 100644 index 000000000..d209b516a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e7c1f6f0913c4a95.js @@ -0,0 +1,3 @@ +function a() { + yield * a; +} diff --git a/compiler/tests-js-parser/pass-explicit/e7c444fc9aed1257.js b/compiler/tests-js-parser/pass-explicit/e7c444fc9aed1257.js new file mode 100644 index 000000000..fc8d390a5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e7c444fc9aed1257.js @@ -0,0 +1 @@ +for (const a in b) ; diff --git a/compiler/tests-js-parser/pass-explicit/e7fa87b10d5136a0.js b/compiler/tests-js-parser/pass-explicit/e7fa87b10d5136a0.js new file mode 100644 index 000000000..4199ae2a6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e7fa87b10d5136a0.js @@ -0,0 +1,4 @@ +class a { + get b() {} + set c (d) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/e815494eb50fa42f.js b/compiler/tests-js-parser/pass-explicit/e815494eb50fa42f.js new file mode 100644 index 000000000..71c470974 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e815494eb50fa42f.js @@ -0,0 +1,3 @@ +function a() { + var b; +} diff --git a/compiler/tests-js-parser/pass-explicit/e84ef669246313d2.js b/compiler/tests-js-parser/pass-explicit/e84ef669246313d2.js new file mode 100644 index 000000000..27865f154 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e84ef669246313d2.js @@ -0,0 +1,2 @@ +("("); +a(")"); diff --git a/compiler/tests-js-parser/pass-explicit/e877f5e6753dc7e4.js b/compiler/tests-js-parser/pass-explicit/e877f5e6753dc7e4.js new file mode 100644 index 000000000..6bd2dfc38 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e877f5e6753dc7e4.js @@ -0,0 +1 @@ +(((a, b), c), d) ? e : f; diff --git a/compiler/tests-js-parser/pass-explicit/e899a2594bd5311c.js b/compiler/tests-js-parser/pass-explicit/e899a2594bd5311c.js new file mode 100644 index 000000000..dcc855f23 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e899a2594bd5311c.js @@ -0,0 +1 @@ +() => (1); diff --git a/compiler/tests-js-parser/pass-explicit/e8de5af87dc0004c.js b/compiler/tests-js-parser/pass-explicit/e8de5af87dc0004c.js new file mode 100644 index 000000000..f7dc1b7b7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e8de5af87dc0004c.js @@ -0,0 +1 @@ +a /= (1); diff --git a/compiler/tests-js-parser/pass-explicit/e8ea384458526db0.js b/compiler/tests-js-parser/pass-explicit/e8ea384458526db0.js new file mode 100644 index 000000000..0613bbac7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e8ea384458526db0.js @@ -0,0 +1 @@ +var {[a]: b} = ({y}); diff --git a/compiler/tests-js-parser/pass-explicit/e8ef6188865f9def.js b/compiler/tests-js-parser/pass-explicit/e8ef6188865f9def.js new file mode 100644 index 000000000..9f0cd31ed --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e8ef6188865f9def.js @@ -0,0 +1,4 @@ +d: { + if (a) b("c"); else break d; + (e.f)("g"); +} diff --git a/compiler/tests-js-parser/pass-explicit/e8ef944fd2c2e7fa.js b/compiler/tests-js-parser/pass-explicit/e8ef944fd2c2e7fa.js new file mode 100644 index 000000000..fccc253f3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e8ef944fd2c2e7fa.js @@ -0,0 +1 @@ +a`42`; diff --git a/compiler/tests-js-parser/pass-explicit/e95b9364e90a4b5c.js b/compiler/tests-js-parser/pass-explicit/e95b9364e90a4b5c.js new file mode 100644 index 000000000..5b6fd731d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e95b9364e90a4b5c.js @@ -0,0 +1 @@ +`$$$${a}`; diff --git a/compiler/tests-js-parser/pass-explicit/e9682c37a1a959e1.js b/compiler/tests-js-parser/pass-explicit/e9682c37a1a959e1.js new file mode 100644 index 000000000..48090185e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e9682c37a1a959e1.js @@ -0,0 +1 @@ +"\u{20BB7}\u{91CE}\u{5BB6}"; diff --git a/compiler/tests-js-parser/pass-explicit/e99d260ec2ea47be.js b/compiler/tests-js-parser/pass-explicit/e99d260ec2ea47be.js new file mode 100644 index 000000000..c99e1ec44 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e99d260ec2ea47be.js @@ -0,0 +1 @@ +let a = (1), b = (2), c = (3); diff --git a/compiler/tests-js-parser/pass-explicit/e9a24a964ace5330.js b/compiler/tests-js-parser/pass-explicit/e9a24a964ace5330.js new file mode 100644 index 000000000..957042523 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e9a24a964ace5330.js @@ -0,0 +1,5 @@ +if (a) { + b; +} else { + b; +} diff --git a/compiler/tests-js-parser/pass-explicit/e9a74729daea9b84.js b/compiler/tests-js-parser/pass-explicit/e9a74729daea9b84.js new file mode 100644 index 000000000..11a60ac66 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e9a74729daea9b84.js @@ -0,0 +1 @@ +a + (b * c); diff --git a/compiler/tests-js-parser/pass-explicit/e9d44e4cbaf92011.js b/compiler/tests-js-parser/pass-explicit/e9d44e4cbaf92011.js new file mode 100644 index 000000000..c290d0a1c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/e9d44e4cbaf92011.js @@ -0,0 +1 @@ +({[a]() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/ea2e883b50b24651.js b/compiler/tests-js-parser/pass-explicit/ea2e883b50b24651.js new file mode 100644 index 000000000..c24c56886 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ea2e883b50b24651.js @@ -0,0 +1,11 @@ +b: switch (1) { + case 2: + a(); + for (;;) break b; + c(); + break; + case (3) + (4): + d(); + default: + e(); +} diff --git a/compiler/tests-js-parser/pass-explicit/ea3fcad439ac905f.js b/compiler/tests-js-parser/pass-explicit/ea3fcad439ac905f.js new file mode 100644 index 000000000..74c2db45d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ea3fcad439ac905f.js @@ -0,0 +1 @@ +({a: 1, a: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/ea54fe11ef8702f7.js b/compiler/tests-js-parser/pass-explicit/ea54fe11ef8702f7.js new file mode 100644 index 000000000..a0244869d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ea54fe11ef8702f7.js @@ -0,0 +1,3 @@ +function* a() { + yield (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/eabc983d82222f2a.js b/compiler/tests-js-parser/pass-explicit/eabc983d82222f2a.js new file mode 100644 index 000000000..e7f59db9a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eabc983d82222f2a.js @@ -0,0 +1 @@ +for (let a of b) c(a); diff --git a/compiler/tests-js-parser/pass-explicit/eaee2c64dfc46b6a.js b/compiler/tests-js-parser/pass-explicit/eaee2c64dfc46b6a.js new file mode 100644 index 000000000..fd0e83675 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eaee2c64dfc46b6a.js @@ -0,0 +1 @@ +let xÇ•, x󠇕; diff --git a/compiler/tests-js-parser/pass-explicit/eb4b9e8905923468.js b/compiler/tests-js-parser/pass-explicit/eb4b9e8905923468.js new file mode 100644 index 000000000..99f2945ca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eb4b9e8905923468.js @@ -0,0 +1 @@ +2748; diff --git a/compiler/tests-js-parser/pass-explicit/eb7bb0c4a0ced2a8.js b/compiler/tests-js-parser/pass-explicit/eb7bb0c4a0ced2a8.js new file mode 100644 index 000000000..a9e8d4254 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eb7bb0c4a0ced2a8.js @@ -0,0 +1 @@ +(a || b) || c; diff --git a/compiler/tests-js-parser/pass-explicit/ebbc09d90157cb5b.js b/compiler/tests-js-parser/pass-explicit/ebbc09d90157cb5b.js new file mode 100644 index 000000000..6251f1389 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ebbc09d90157cb5b.js @@ -0,0 +1,4 @@ +function a() { + var {b, c} = (a); + var d = (a); +} diff --git a/compiler/tests-js-parser/pass-explicit/ebd6534f7bb01a7a.js b/compiler/tests-js-parser/pass-explicit/ebd6534f7bb01a7a.js new file mode 100644 index 000000000..4efa63b79 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ebd6534f7bb01a7a.js @@ -0,0 +1 @@ +({true: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/ec05d8a5722be86c.js b/compiler/tests-js-parser/pass-explicit/ec05d8a5722be86c.js new file mode 100644 index 000000000..6aded6bf2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ec05d8a5722be86c.js @@ -0,0 +1,4 @@ +((function () { + var a = (1); + a = (a += (2)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/ec782937135d4f32.js b/compiler/tests-js-parser/pass-explicit/ec782937135d4f32.js new file mode 100644 index 000000000..c0d918a81 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ec782937135d4f32.js @@ -0,0 +1 @@ +/a/i; diff --git a/compiler/tests-js-parser/pass-explicit/ec79f9c27c045b00.js b/compiler/tests-js-parser/pass-explicit/ec79f9c27c045b00.js new file mode 100644 index 000000000..415d3befa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ec79f9c27c045b00.js @@ -0,0 +1,4 @@ +b: while (1) { + continue; + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/ec97990c2cc5e0e8.js b/compiler/tests-js-parser/pass-explicit/ec97990c2cc5e0e8.js new file mode 100644 index 000000000..980612b0a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ec97990c2cc5e0e8.js @@ -0,0 +1 @@ +a || (b && (c | (d ^ (e & (f == (g < (h >>> (i + (j * k))))))))); diff --git a/compiler/tests-js-parser/pass-explicit/ec99a663d6f3983d.js b/compiler/tests-js-parser/pass-explicit/ec99a663d6f3983d.js new file mode 100644 index 000000000..267b7bc18 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ec99a663d6f3983d.js @@ -0,0 +1,3 @@ +function a() { + ({*[yield]() {}}); +} diff --git a/compiler/tests-js-parser/pass-explicit/ecba8fb326c2c985.js b/compiler/tests-js-parser/pass-explicit/ecba8fb326c2c985.js new file mode 100644 index 000000000..e830115b5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ecba8fb326c2c985.js @@ -0,0 +1,30 @@ +var a, b, c, d, e; +if (b) { + a = ((1) + (2)); +} else { + a = (3); +} +if (b) { + a = ((4) + (5)); +} else if (c) { + a = (6); +} else { + a = ((7) - (8)); +} +a = (b ? ("f") : (("g") + ("h"))); +a = (b ? ("f") : (b ? ("f") : (("g") + ("h")))); +if (i()) { + a = ((9) + (10)); +} else { + a = (11); +} +if (c) { + a = ("j"); +} else if (i()) { + a = (("k") + ("l")); +} else { + a = ("j"); +} +a = ((i()) ? ("m") : (("f") + ("n"))); +a = (b ? d : e); +a = (b ? ("f") : ("g")); diff --git a/compiler/tests-js-parser/pass-explicit/ed0783c35e43032b.js b/compiler/tests-js-parser/pass-explicit/ed0783c35e43032b.js new file mode 100644 index 000000000..129755bfb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ed0783c35e43032b.js @@ -0,0 +1,6 @@ +a["b"] = ("c"); +a["if"] = ("if"); +a["*"] = ("d"); +a["ຳ"] = ("e"); +a[""] = ("f"); +a["1_1"] = ("b"); diff --git a/compiler/tests-js-parser/pass-explicit/ed085cb2fd0dc355.js b/compiler/tests-js-parser/pass-explicit/ed085cb2fd0dc355.js new file mode 100644 index 000000000..ab70513fb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ed085cb2fd0dc355.js @@ -0,0 +1,6 @@ +var a; +if ((((!b) && (!c)) && (!d)) && (!e)) { + a = (1); +} else { + a = (2); +} diff --git a/compiler/tests-js-parser/pass-explicit/ed32642380a6e603.js b/compiler/tests-js-parser/pass-explicit/ed32642380a6e603.js new file mode 100644 index 000000000..f2d8cba7c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ed32642380a6e603.js @@ -0,0 +1 @@ +var _𞸃; diff --git a/compiler/tests-js-parser/pass-explicit/ed49ee70d6eabf4a.js b/compiler/tests-js-parser/pass-explicit/ed49ee70d6eabf4a.js new file mode 100644 index 000000000..680545813 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ed49ee70d6eabf4a.js @@ -0,0 +1 @@ +arguments = (1); diff --git a/compiler/tests-js-parser/pass-explicit/ed65dd575be2b4ab.js b/compiler/tests-js-parser/pass-explicit/ed65dd575be2b4ab.js new file mode 100644 index 000000000..24c3a95ad --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ed65dd575be2b4ab.js @@ -0,0 +1,7 @@ +function a() { + (b.c)("d"); +} +function a() { + (b.c)("e"); +} +a(); diff --git a/compiler/tests-js-parser/pass-explicit/ed6981438ac1918b.js b/compiler/tests-js-parser/pass-explicit/ed6981438ac1918b.js new file mode 100644 index 000000000..937c57722 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ed6981438ac1918b.js @@ -0,0 +1 @@ +a |= (1); diff --git a/compiler/tests-js-parser/pass-explicit/ed894bd570d47113.js b/compiler/tests-js-parser/pass-explicit/ed894bd570d47113.js new file mode 100644 index 000000000..c0aa71e69 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ed894bd570d47113.js @@ -0,0 +1 @@ +throw a * b; diff --git a/compiler/tests-js-parser/pass-explicit/eda5026c194f7279.js b/compiler/tests-js-parser/pass-explicit/eda5026c194f7279.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eda5026c194f7279.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/edbdeeb1761675a7.js b/compiler/tests-js-parser/pass-explicit/edbdeeb1761675a7.js new file mode 100644 index 000000000..bacf7a371 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/edbdeeb1761675a7.js @@ -0,0 +1 @@ +({"[": 1}); diff --git a/compiler/tests-js-parser/pass-explicit/edd1f39f90576180.js b/compiler/tests-js-parser/pass-explicit/edd1f39f90576180.js new file mode 100644 index 000000000..ab99e38d6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/edd1f39f90576180.js @@ -0,0 +1,3 @@ +try {} catch (a) { + b(a); +} diff --git a/compiler/tests-js-parser/pass-explicit/edfe04e832b81a82.js b/compiler/tests-js-parser/pass-explicit/edfe04e832b81a82.js new file mode 100644 index 000000000..e5ae50766 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/edfe04e832b81a82.js @@ -0,0 +1 @@ +new a(b); diff --git a/compiler/tests-js-parser/pass-explicit/ee2342b2715c3bf0.js b/compiler/tests-js-parser/pass-explicit/ee2342b2715c3bf0.js new file mode 100644 index 000000000..3d94c8215 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ee2342b2715c3bf0.js @@ -0,0 +1,4 @@ +do { + a++; + b--; +} while (a < (1)); diff --git a/compiler/tests-js-parser/pass-explicit/ee4e8fa6257d810a.js b/compiler/tests-js-parser/pass-explicit/ee4e8fa6257d810a.js new file mode 100644 index 000000000..ae3ec591a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ee4e8fa6257d810a.js @@ -0,0 +1 @@ +let++; diff --git a/compiler/tests-js-parser/pass-explicit/eea2875eacf36279.js b/compiler/tests-js-parser/pass-explicit/eea2875eacf36279.js new file mode 100644 index 000000000..b3bc3ce59 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eea2875eacf36279.js @@ -0,0 +1,5 @@ +if (a) { + b = (c()); + d = (e()); + for (; b < d; ++b) (f.g)(b); +} diff --git a/compiler/tests-js-parser/pass-explicit/eebefa78eec0af44.js b/compiler/tests-js-parser/pass-explicit/eebefa78eec0af44.js new file mode 100644 index 000000000..592d58e3a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eebefa78eec0af44.js @@ -0,0 +1,3 @@ +((function () { + -(a ? b : (1)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/eed97872dd924560.js b/compiler/tests-js-parser/pass-explicit/eed97872dd924560.js new file mode 100644 index 000000000..7dd1d8eeb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eed97872dd924560.js @@ -0,0 +1,3 @@ +`outer${{a: {b: 1}}}bar${`nested${function () { + return 2; +}}endnest`}end`; diff --git a/compiler/tests-js-parser/pass-explicit/eef60d36274e4ed8.js b/compiler/tests-js-parser/pass-explicit/eef60d36274e4ed8.js new file mode 100644 index 000000000..6ea39f9d3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/eef60d36274e4ed8.js @@ -0,0 +1,3 @@ +new (a, b); +new (a || b); +new (c ? a : b); diff --git a/compiler/tests-js-parser/pass-explicit/ef086346e9707e91.js b/compiler/tests-js-parser/pass-explicit/ef086346e9707e91.js new file mode 100644 index 000000000..6162804c3 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ef086346e9707e91.js @@ -0,0 +1,3 @@ +class a { + [b]() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/ef15294c7bc4675e.js b/compiler/tests-js-parser/pass-explicit/ef15294c7bc4675e.js new file mode 100644 index 000000000..5c1e02f3f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ef15294c7bc4675e.js @@ -0,0 +1,4 @@ +function a() { + var b = (1); + ++b; +} diff --git a/compiler/tests-js-parser/pass-explicit/ef61944dbb440b60.js b/compiler/tests-js-parser/pass-explicit/ef61944dbb440b60.js new file mode 100644 index 000000000..874b78dee --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ef61944dbb440b60.js @@ -0,0 +1 @@ +class a extends (class b extends c {}) {} diff --git a/compiler/tests-js-parser/pass-explicit/ef7843986fabc25d.module.js b/compiler/tests-js-parser/pass-explicit/ef7843986fabc25d.module.js new file mode 100644 index 000000000..369765733 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ef7843986fabc25d.module.js @@ -0,0 +1 @@ +export default a; diff --git a/compiler/tests-js-parser/pass-explicit/ef812b85ce5fbc44.js b/compiler/tests-js-parser/pass-explicit/ef812b85ce5fbc44.js new file mode 100644 index 000000000..ef3077da2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ef812b85ce5fbc44.js @@ -0,0 +1,3 @@ +var Infinity, NaN; +(Infinity.a)(); +(NaN.a)(); diff --git a/compiler/tests-js-parser/pass-explicit/efb88a0b6e2e170e.js b/compiler/tests-js-parser/pass-explicit/efb88a0b6e2e170e.js new file mode 100644 index 000000000..0f44326d2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/efb88a0b6e2e170e.js @@ -0,0 +1,3 @@ +` + +`; diff --git a/compiler/tests-js-parser/pass-explicit/efe1e5c7656bf0ba.js b/compiler/tests-js-parser/pass-explicit/efe1e5c7656bf0ba.js new file mode 100644 index 000000000..5e9300a72 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/efe1e5c7656bf0ba.js @@ -0,0 +1 @@ +a < b; diff --git a/compiler/tests-js-parser/pass-explicit/efef19e06f58fdd9.js b/compiler/tests-js-parser/pass-explicit/efef19e06f58fdd9.js new file mode 100644 index 000000000..8e9721026 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/efef19e06f58fdd9.js @@ -0,0 +1 @@ +({__proto__: null, set __proto__ (a) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/f01d9f3c7b2b2717.js b/compiler/tests-js-parser/pass-explicit/f01d9f3c7b2b2717.js new file mode 100644 index 000000000..d84bb6bcf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f01d9f3c7b2b2717.js @@ -0,0 +1 @@ +a = ({get if() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/f062a3f543a622f8.module.js b/compiler/tests-js-parser/pass-explicit/f062a3f543a622f8.module.js new file mode 100644 index 000000000..a46af3e32 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f062a3f543a622f8.module.js @@ -0,0 +1 @@ +import a from "foo"; diff --git a/compiler/tests-js-parser/pass-explicit/f0a5cf41bdef6532.js b/compiler/tests-js-parser/pass-explicit/f0a5cf41bdef6532.js new file mode 100644 index 000000000..9db05d8c2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f0a5cf41bdef6532.js @@ -0,0 +1 @@ +do a(); while (true); diff --git a/compiler/tests-js-parser/pass-explicit/f0bf9ec665d85fa1.js b/compiler/tests-js-parser/pass-explicit/f0bf9ec665d85fa1.js new file mode 100644 index 000000000..4572682ce --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f0bf9ec665d85fa1.js @@ -0,0 +1,5 @@ +class a { + b() { + () => (super.c); + } +} diff --git a/compiler/tests-js-parser/pass-explicit/f0d9a7a2f5d42210.js b/compiler/tests-js-parser/pass-explicit/f0d9a7a2f5d42210.js new file mode 100644 index 000000000..bd5685576 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f0d9a7a2f5d42210.js @@ -0,0 +1 @@ +let + (1); diff --git a/compiler/tests-js-parser/pass-explicit/f0f2ab32e7f42314.js b/compiler/tests-js-parser/pass-explicit/f0f2ab32e7f42314.js new file mode 100644 index 000000000..1f371e92d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f0f2ab32e7f42314.js @@ -0,0 +1 @@ +for (var a of [1, 2]) 3; diff --git a/compiler/tests-js-parser/pass-explicit/f0f9e218a70eba5c.js b/compiler/tests-js-parser/pass-explicit/f0f9e218a70eba5c.js new file mode 100644 index 000000000..720c0b109 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f0f9e218a70eba5c.js @@ -0,0 +1 @@ +/[\w-\s]/; diff --git a/compiler/tests-js-parser/pass-explicit/f0fbbdabdaca2146.js b/compiler/tests-js-parser/pass-explicit/f0fbbdabdaca2146.js new file mode 100644 index 000000000..a7aa97561 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f0fbbdabdaca2146.js @@ -0,0 +1 @@ +var let; diff --git a/compiler/tests-js-parser/pass-explicit/f108a85d36ec9afc.js b/compiler/tests-js-parser/pass-explicit/f108a85d36ec9afc.js new file mode 100644 index 000000000..532685f12 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f108a85d36ec9afc.js @@ -0,0 +1,3 @@ +({*a() { + yield ((super.a)()); +}}); diff --git a/compiler/tests-js-parser/pass-explicit/f1218947a6a17e65.js b/compiler/tests-js-parser/pass-explicit/f1218947a6a17e65.js new file mode 100644 index 000000000..fbf32e79c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f1218947a6a17e65.js @@ -0,0 +1,6 @@ +((function () { + var a = (1); + ((function () { + eval(""); + })()); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/f139fd88bd0ad9d0.js b/compiler/tests-js-parser/pass-explicit/f139fd88bd0ad9d0.js new file mode 100644 index 000000000..0d5a8a811 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f139fd88bd0ad9d0.js @@ -0,0 +1 @@ +(`{${a}}`), (`}`); diff --git a/compiler/tests-js-parser/pass-explicit/f13a130829aa77c5.js b/compiler/tests-js-parser/pass-explicit/f13a130829aa77c5.js new file mode 100644 index 000000000..4c1e6e07b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f13a130829aa77c5.js @@ -0,0 +1,3 @@ +class a { + static *b() {} +} diff --git a/compiler/tests-js-parser/pass-explicit/f1534392279bddbf.js b/compiler/tests-js-parser/pass-explicit/f1534392279bddbf.js new file mode 100644 index 000000000..0f57817f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f1534392279bddbf.js @@ -0,0 +1 @@ +0; diff --git a/compiler/tests-js-parser/pass-explicit/f15772354efa5ecf.js b/compiler/tests-js-parser/pass-explicit/f15772354efa5ecf.js new file mode 100644 index 000000000..8980ea657 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f15772354efa5ecf.js @@ -0,0 +1,4 @@ +(function () { + "use strict"; + return 1; +}); diff --git a/compiler/tests-js-parser/pass-explicit/f1643d0e6c7fde9a.js b/compiler/tests-js-parser/pass-explicit/f1643d0e6c7fde9a.js new file mode 100644 index 000000000..8d6d1f43b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f1643d0e6c7fde9a.js @@ -0,0 +1 @@ +var a = (/=([^=\s])+/g); diff --git a/compiler/tests-js-parser/pass-explicit/f17ec9517a3339d9.js b/compiler/tests-js-parser/pass-explicit/f17ec9517a3339d9.js new file mode 100644 index 000000000..8e7230c41 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f17ec9517a3339d9.js @@ -0,0 +1,3 @@ +({set if (a) { + a; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/f1bf02f18fa71ba7.js b/compiler/tests-js-parser/pass-explicit/f1bf02f18fa71ba7.js new file mode 100644 index 000000000..bbdc0bca5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f1bf02f18fa71ba7.js @@ -0,0 +1 @@ +([]) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/f1d7e3cc86ffc02b.js b/compiler/tests-js-parser/pass-explicit/f1d7e3cc86ffc02b.js new file mode 100644 index 000000000..839ad129e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f1d7e3cc86ffc02b.js @@ -0,0 +1,10 @@ +function a() { + b(); + var c; + var d; +} +function e(f) { + b(); + var c; + var f; +} diff --git a/compiler/tests-js-parser/pass-explicit/f2113065d9111e6d.js b/compiler/tests-js-parser/pass-explicit/f2113065d9111e6d.js new file mode 100644 index 000000000..419b3ec22 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f2113065d9111e6d.js @@ -0,0 +1 @@ +(() => (null))(); diff --git a/compiler/tests-js-parser/pass-explicit/f2142c1dabd961c1.js b/compiler/tests-js-parser/pass-explicit/f2142c1dabd961c1.js new file mode 100644 index 000000000..e8c6569a4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f2142c1dabd961c1.js @@ -0,0 +1,2 @@ +; +(a--) > (1); diff --git a/compiler/tests-js-parser/pass-explicit/f2aa3da994da03a7.js b/compiler/tests-js-parser/pass-explicit/f2aa3da994da03a7.js new file mode 100644 index 000000000..a13239e29 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f2aa3da994da03a7.js @@ -0,0 +1 @@ +var {a = b} = (c); diff --git a/compiler/tests-js-parser/pass-explicit/f2d394b74219a023.js b/compiler/tests-js-parser/pass-explicit/f2d394b74219a023.js new file mode 100644 index 000000000..7f621168b --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f2d394b74219a023.js @@ -0,0 +1 @@ +(typeof (/test/)) + (" RegExp"); diff --git a/compiler/tests-js-parser/pass-explicit/f2e0a415d88b3451.js b/compiler/tests-js-parser/pass-explicit/f2e0a415d88b3451.js new file mode 100644 index 000000000..aa65ec3f9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f2e0a415d88b3451.js @@ -0,0 +1,3 @@ +if (a) { + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/f2e41488e95243a8.js b/compiler/tests-js-parser/pass-explicit/f2e41488e95243a8.js new file mode 100644 index 000000000..99e5ac68a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f2e41488e95243a8.js @@ -0,0 +1 @@ +var [let] = (a); diff --git a/compiler/tests-js-parser/pass-explicit/f2ed650f15f224fa.module.js b/compiler/tests-js-parser/pass-explicit/f2ed650f15f224fa.module.js new file mode 100644 index 000000000..aef22247d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f2ed650f15f224fa.module.js @@ -0,0 +1 @@ +export default 1; diff --git a/compiler/tests-js-parser/pass-explicit/f30d88a123e11b55.js b/compiler/tests-js-parser/pass-explicit/f30d88a123e11b55.js new file mode 100644 index 000000000..ed53c6899 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f30d88a123e11b55.js @@ -0,0 +1 @@ +for (var [a, b] of c) ; diff --git a/compiler/tests-js-parser/pass-explicit/f3219596b50bb381.js b/compiler/tests-js-parser/pass-explicit/f3219596b50bb381.js new file mode 100644 index 000000000..5fd8eeeb0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f3219596b50bb381.js @@ -0,0 +1,4 @@ +{ + [1]; +} +/foo/; diff --git a/compiler/tests-js-parser/pass-explicit/f3260491590325af.js b/compiler/tests-js-parser/pass-explicit/f3260491590325af.js new file mode 100644 index 000000000..e1b3072a2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f3260491590325af.js @@ -0,0 +1,3 @@ +(((function () { + return true; +})()) ? ((a.b)(true)) : ((a.b)(false))); diff --git a/compiler/tests-js-parser/pass-explicit/f355802cb6d444e1.js b/compiler/tests-js-parser/pass-explicit/f355802cb6d444e1.js new file mode 100644 index 000000000..e9b43e86f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f355802cb6d444e1.js @@ -0,0 +1 @@ +let a; diff --git a/compiler/tests-js-parser/pass-explicit/f3d3a0f30115de54.js b/compiler/tests-js-parser/pass-explicit/f3d3a0f30115de54.js new file mode 100644 index 000000000..7c36f359d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f3d3a0f30115de54.js @@ -0,0 +1 @@ +(a < b) < c; diff --git a/compiler/tests-js-parser/pass-explicit/f404f7ff29ba5d1a.module.js b/compiler/tests-js-parser/pass-explicit/f404f7ff29ba5d1a.module.js new file mode 100644 index 000000000..ea9b101e1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f404f7ff29ba5d1a.module.js @@ -0,0 +1 @@ +export default function () {} diff --git a/compiler/tests-js-parser/pass-explicit/f407a3693faf595b.js b/compiler/tests-js-parser/pass-explicit/f407a3693faf595b.js new file mode 100644 index 000000000..581b0e5d5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f407a3693faf595b.js @@ -0,0 +1 @@ +([a = 1], []) => (2); diff --git a/compiler/tests-js-parser/pass-explicit/f43f922cccf5b9af.js b/compiler/tests-js-parser/pass-explicit/f43f922cccf5b9af.js new file mode 100644 index 000000000..155a4ca10 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f43f922cccf5b9af.js @@ -0,0 +1,3 @@ +((function () { + a = (a += (1)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/f471327b3e9b8933.js b/compiler/tests-js-parser/pass-explicit/f471327b3e9b8933.js new file mode 100644 index 000000000..15810b17d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f471327b3e9b8933.js @@ -0,0 +1 @@ +a = ({a: 1, a: 2}); diff --git a/compiler/tests-js-parser/pass-explicit/f4864ec70dd99c21.js b/compiler/tests-js-parser/pass-explicit/f4864ec70dd99c21.js new file mode 100644 index 000000000..ec19010d2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f4864ec70dd99c21.js @@ -0,0 +1 @@ +a.false; diff --git a/compiler/tests-js-parser/pass-explicit/f4a61fcdefebb9d4.js b/compiler/tests-js-parser/pass-explicit/f4a61fcdefebb9d4.js new file mode 100644 index 000000000..73f3a3a6e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f4a61fcdefebb9d4.js @@ -0,0 +1 @@ +var private, protected, public, static; diff --git a/compiler/tests-js-parser/pass-explicit/f4b2d8937ec13ab0.js b/compiler/tests-js-parser/pass-explicit/f4b2d8937ec13ab0.js new file mode 100644 index 000000000..862f53b20 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f4b2d8937ec13ab0.js @@ -0,0 +1 @@ +for (var a = (("b") in c), d = (1); d < (2); ++d) ; diff --git a/compiler/tests-js-parser/pass-explicit/f50f858c3ef003f4.js b/compiler/tests-js-parser/pass-explicit/f50f858c3ef003f4.js new file mode 100644 index 000000000..64d4fcfca --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f50f858c3ef003f4.js @@ -0,0 +1 @@ +a && (b && c); diff --git a/compiler/tests-js-parser/pass-explicit/f552daf299e1c6e5.js b/compiler/tests-js-parser/pass-explicit/f552daf299e1c6e5.js new file mode 100644 index 000000000..f467c5336 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f552daf299e1c6e5.js @@ -0,0 +1,3 @@ +({a() { + let a; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/f597b0312e2b678c.js b/compiler/tests-js-parser/pass-explicit/f597b0312e2b678c.js new file mode 100644 index 000000000..8f18289c4 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f597b0312e2b678c.js @@ -0,0 +1,3 @@ +if (a) { + b(); +} else {} diff --git a/compiler/tests-js-parser/pass-explicit/f5b89028dfa29f27.js b/compiler/tests-js-parser/pass-explicit/f5b89028dfa29f27.js new file mode 100644 index 000000000..1a70fdb40 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f5b89028dfa29f27.js @@ -0,0 +1 @@ +var 𞸆_$; diff --git a/compiler/tests-js-parser/pass-explicit/f5ba9f1b21487d3b.js b/compiler/tests-js-parser/pass-explicit/f5ba9f1b21487d3b.js new file mode 100644 index 000000000..f7f8419c7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f5ba9f1b21487d3b.js @@ -0,0 +1,3 @@ +function a() { + var b = (1); +} diff --git a/compiler/tests-js-parser/pass-explicit/f601e7dd0235d423.js b/compiler/tests-js-parser/pass-explicit/f601e7dd0235d423.js new file mode 100644 index 000000000..694e9b0da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f601e7dd0235d423.js @@ -0,0 +1 @@ +var {a: b = c} = (d); diff --git a/compiler/tests-js-parser/pass-explicit/f658dbaa20c36388.js b/compiler/tests-js-parser/pass-explicit/f658dbaa20c36388.js new file mode 100644 index 000000000..93e68fe56 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f658dbaa20c36388.js @@ -0,0 +1,5 @@ +((function () { + if ((!(!a)) && (b())) { + with (b) {} + } +})()); diff --git a/compiler/tests-js-parser/pass-explicit/f69b27444afab042.js b/compiler/tests-js-parser/pass-explicit/f69b27444afab042.js new file mode 100644 index 000000000..92e8b95da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f69b27444afab042.js @@ -0,0 +1,9 @@ +((function () { + b: { + if (a) break b; + if (a) break b; + if (a) break b; + if (a) break b; + } + eval(c); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/f6d11d1e4dcb1ded.js b/compiler/tests-js-parser/pass-explicit/f6d11d1e4dcb1ded.js new file mode 100644 index 000000000..d043f7519 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f6d11d1e4dcb1ded.js @@ -0,0 +1,3 @@ +function a() { + let b = (new.target); +} diff --git a/compiler/tests-js-parser/pass-explicit/f6d42525cd87339b.js b/compiler/tests-js-parser/pass-explicit/f6d42525cd87339b.js new file mode 100644 index 000000000..ac8818a68 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f6d42525cd87339b.js @@ -0,0 +1,3 @@ +((function () { + var a, b, c; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/f7291c5ec70a4152.js b/compiler/tests-js-parser/pass-explicit/f7291c5ec70a4152.js new file mode 100644 index 000000000..798c7c0f7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f7291c5ec70a4152.js @@ -0,0 +1 @@ +({a: b, c}, [d, e], ...f) => {}; diff --git a/compiler/tests-js-parser/pass-explicit/f78abc3cba581cdd.js b/compiler/tests-js-parser/pass-explicit/f78abc3cba581cdd.js new file mode 100644 index 000000000..a9d595fd8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f78abc3cba581cdd.js @@ -0,0 +1,5 @@ +class a { + *b(c) { + yield c; + } +} diff --git a/compiler/tests-js-parser/pass-explicit/f7af1a6b02dbd440.js b/compiler/tests-js-parser/pass-explicit/f7af1a6b02dbd440.js new file mode 100644 index 000000000..d94ed2257 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f7af1a6b02dbd440.js @@ -0,0 +1,3 @@ +for (;;) { + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/f7e2edf1ccb61303.js b/compiler/tests-js-parser/pass-explicit/f7e2edf1ccb61303.js new file mode 100644 index 000000000..b2feb3a54 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f7e2edf1ccb61303.js @@ -0,0 +1 @@ +var [[a]] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/f7f611e6fdb5b9fc.js b/compiler/tests-js-parser/pass-explicit/f7f611e6fdb5b9fc.js new file mode 100644 index 000000000..b1f924647 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f7f611e6fdb5b9fc.js @@ -0,0 +1 @@ +var 𞸊𞸋; diff --git a/compiler/tests-js-parser/pass-explicit/f80f30fbdd7e7b19.js b/compiler/tests-js-parser/pass-explicit/f80f30fbdd7e7b19.js new file mode 100644 index 000000000..8264f0016 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f80f30fbdd7e7b19.js @@ -0,0 +1 @@ +/.{.}/; diff --git a/compiler/tests-js-parser/pass-explicit/f8323b3c45bd107a.js b/compiler/tests-js-parser/pass-explicit/f8323b3c45bd107a.js new file mode 100644 index 000000000..f7da62abe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f8323b3c45bd107a.js @@ -0,0 +1 @@ +(a ^ b) ^ c; diff --git a/compiler/tests-js-parser/pass-explicit/f89bf797c3b1dda4.js b/compiler/tests-js-parser/pass-explicit/f89bf797c3b1dda4.js new file mode 100644 index 000000000..31142aabf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f89bf797c3b1dda4.js @@ -0,0 +1 @@ +a; diff --git a/compiler/tests-js-parser/pass-explicit/f8a07bd5ab703d4b.js b/compiler/tests-js-parser/pass-explicit/f8a07bd5ab703d4b.js new file mode 100644 index 000000000..430cc5367 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f8a07bd5ab703d4b.js @@ -0,0 +1,6 @@ +for (;;) { + if (a) { + continue; + } + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/f8cf06a0d5699319.js b/compiler/tests-js-parser/pass-explicit/f8cf06a0d5699319.js new file mode 100644 index 000000000..8d8ea7999 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f8cf06a0d5699319.js @@ -0,0 +1 @@ +function a(b, ...c) {} diff --git a/compiler/tests-js-parser/pass-explicit/f8d843a30c73377a.js b/compiler/tests-js-parser/pass-explicit/f8d843a30c73377a.js new file mode 100644 index 000000000..4a6488c60 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f8d843a30c73377a.js @@ -0,0 +1 @@ +(class a {}); diff --git a/compiler/tests-js-parser/pass-explicit/f8dc2e8bbddcdfbe.js b/compiler/tests-js-parser/pass-explicit/f8dc2e8bbddcdfbe.js new file mode 100644 index 000000000..3db4312f0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f8dc2e8bbddcdfbe.js @@ -0,0 +1 @@ +a || b; diff --git a/compiler/tests-js-parser/pass-explicit/f94e47b7b5cfda74.js b/compiler/tests-js-parser/pass-explicit/f94e47b7b5cfda74.js new file mode 100644 index 000000000..a9e247507 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f94e47b7b5cfda74.js @@ -0,0 +1 @@ +(1) << (2); diff --git a/compiler/tests-js-parser/pass-explicit/f96c694c5a2f2be9.js b/compiler/tests-js-parser/pass-explicit/f96c694c5a2f2be9.js new file mode 100644 index 000000000..ce6ef1f9d --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f96c694c5a2f2be9.js @@ -0,0 +1,3 @@ +function a(b, c, d, e) { + return (b < (!(--c))) && ((d--) > e); +} diff --git a/compiler/tests-js-parser/pass-explicit/f974f2619b25b027.js b/compiler/tests-js-parser/pass-explicit/f974f2619b25b027.js new file mode 100644 index 000000000..1dddceca5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f974f2619b25b027.js @@ -0,0 +1 @@ +({a: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/f9888fa1a1e366e7.js b/compiler/tests-js-parser/pass-explicit/f9888fa1a1e366e7.js new file mode 100644 index 000000000..52a99fda6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f9888fa1a1e366e7.js @@ -0,0 +1 @@ +a = ([, , 1]); diff --git a/compiler/tests-js-parser/pass-explicit/f990e76e7fcb0dd9.js b/compiler/tests-js-parser/pass-explicit/f990e76e7fcb0dd9.js new file mode 100644 index 000000000..f50c99402 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f990e76e7fcb0dd9.js @@ -0,0 +1 @@ +const [a] = ([]); diff --git a/compiler/tests-js-parser/pass-explicit/f9b92700d0e68f49.js b/compiler/tests-js-parser/pass-explicit/f9b92700d0e68f49.js new file mode 100644 index 000000000..f3977cd42 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f9b92700d0e68f49.js @@ -0,0 +1 @@ +({a} = (1)); diff --git a/compiler/tests-js-parser/pass-explicit/f9c201250f225ab9.js b/compiler/tests-js-parser/pass-explicit/f9c201250f225ab9.js new file mode 100644 index 000000000..a666df8cf --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f9c201250f225ab9.js @@ -0,0 +1 @@ +delete ((1), a); diff --git a/compiler/tests-js-parser/pass-explicit/f9d67ab9db16c4d5.js b/compiler/tests-js-parser/pass-explicit/f9d67ab9db16c4d5.js new file mode 100644 index 000000000..5913de950 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/f9d67ab9db16c4d5.js @@ -0,0 +1 @@ +var a = (1); diff --git a/compiler/tests-js-parser/pass-explicit/fa58aa963031f8df.js b/compiler/tests-js-parser/pass-explicit/fa58aa963031f8df.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/fa59ac4c41d26c14.js b/compiler/tests-js-parser/pass-explicit/fa59ac4c41d26c14.js new file mode 100644 index 000000000..b0ec251fd --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fa59ac4c41d26c14.js @@ -0,0 +1 @@ +({let}); diff --git a/compiler/tests-js-parser/pass-explicit/fa5b398eeef697a6.js b/compiler/tests-js-parser/pass-explicit/fa5b398eeef697a6.js new file mode 100644 index 000000000..272b488bb --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fa5b398eeef697a6.js @@ -0,0 +1 @@ +({set a (eval) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/fa6c17d9a188d0bb.js b/compiler/tests-js-parser/pass-explicit/fa6c17d9a188d0bb.js new file mode 100644 index 000000000..e2cc9fef1 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fa6c17d9a188d0bb.js @@ -0,0 +1,3 @@ +((function () { + if ((!a) || (b())) ; +})()); diff --git a/compiler/tests-js-parser/pass-explicit/fa736f4b0cf19c0c.js b/compiler/tests-js-parser/pass-explicit/fa736f4b0cf19c0c.js new file mode 100644 index 000000000..d4b0b8c9e --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fa736f4b0cf19c0c.js @@ -0,0 +1 @@ +"Hello\1World"; diff --git a/compiler/tests-js-parser/pass-explicit/fa9eaf58f51d6926.js b/compiler/tests-js-parser/pass-explicit/fa9eaf58f51d6926.js new file mode 100644 index 000000000..58c3a80b8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fa9eaf58f51d6926.js @@ -0,0 +1 @@ +(function () {}); diff --git a/compiler/tests-js-parser/pass-explicit/faa4a026e1e86145.js b/compiler/tests-js-parser/pass-explicit/faa4a026e1e86145.js new file mode 100644 index 000000000..1ebec8919 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/faa4a026e1e86145.js @@ -0,0 +1 @@ +(() => {})(); diff --git a/compiler/tests-js-parser/pass-explicit/fada2c7bbfabe14a.js b/compiler/tests-js-parser/pass-explicit/fada2c7bbfabe14a.js new file mode 100644 index 000000000..f7721b696 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fada2c7bbfabe14a.js @@ -0,0 +1 @@ +(function arguments() {}); diff --git a/compiler/tests-js-parser/pass-explicit/fae42f5a2ab85c1d.js b/compiler/tests-js-parser/pass-explicit/fae42f5a2ab85c1d.js new file mode 100644 index 000000000..6ef831bcc --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fae42f5a2ab85c1d.js @@ -0,0 +1 @@ +a %= (1); diff --git a/compiler/tests-js-parser/pass-explicit/fb50400b4c9cf740.js b/compiler/tests-js-parser/pass-explicit/fb50400b4c9cf740.js new file mode 100644 index 000000000..387d28868 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fb50400b4c9cf740.js @@ -0,0 +1,3 @@ +({*a() { + yield; +}}); diff --git a/compiler/tests-js-parser/pass-explicit/fb69459d7628ace1.js b/compiler/tests-js-parser/pass-explicit/fb69459d7628ace1.js new file mode 100644 index 000000000..d23637571 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fb69459d7628ace1.js @@ -0,0 +1 @@ +({set: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/fb7c5656640f6ec7.js b/compiler/tests-js-parser/pass-explicit/fb7c5656640f6ec7.js new file mode 100644 index 000000000..c9f6ff155 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fb7c5656640f6ec7.js @@ -0,0 +1 @@ +`${(((/\d/).a)("1"))[1]}`; diff --git a/compiler/tests-js-parser/pass-explicit/fb8d437ce90b1178.js b/compiler/tests-js-parser/pass-explicit/fb8d437ce90b1178.js new file mode 100644 index 000000000..e70785168 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fb8d437ce90b1178.js @@ -0,0 +1 @@ +[a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/fb8db7a71f3755fc.js b/compiler/tests-js-parser/pass-explicit/fb8db7a71f3755fc.js new file mode 100644 index 000000000..72c7fad89 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fb8db7a71f3755fc.js @@ -0,0 +1,3 @@ +class a { + set b (c) {} +} diff --git a/compiler/tests-js-parser/pass-explicit/fba24e17d16fd0c4.js b/compiler/tests-js-parser/pass-explicit/fba24e17d16fd0c4.js new file mode 100644 index 000000000..48a462532 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fba24e17d16fd0c4.js @@ -0,0 +1 @@ +"\x61"; diff --git a/compiler/tests-js-parser/pass-explicit/fbacebe72fb15fed.module.js b/compiler/tests-js-parser/pass-explicit/fbacebe72fb15fed.module.js new file mode 100644 index 000000000..f39c8fe6c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fbacebe72fb15fed.module.js @@ -0,0 +1,3 @@ +export class a {} +; +1; diff --git a/compiler/tests-js-parser/pass-explicit/fbb6b30b41732026.js b/compiler/tests-js-parser/pass-explicit/fbb6b30b41732026.js new file mode 100644 index 000000000..08e66effe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fbb6b30b41732026.js @@ -0,0 +1 @@ +new a; diff --git a/compiler/tests-js-parser/pass-explicit/fbcd793ec7c82779.js b/compiler/tests-js-parser/pass-explicit/fbcd793ec7c82779.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass-explicit/fbde237f11796df9.js b/compiler/tests-js-parser/pass-explicit/fbde237f11796df9.js new file mode 100644 index 000000000..d2107bda7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fbde237f11796df9.js @@ -0,0 +1 @@ +({a: 1, set a (b) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/fc020c065098cbd5.js b/compiler/tests-js-parser/pass-explicit/fc020c065098cbd5.js new file mode 100644 index 000000000..9d85063d2 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fc020c065098cbd5.js @@ -0,0 +1 @@ +var a = (/[\u{61}-b][\u0061-b][a-\u{62}][a-\u0062]\u{1ffff}/u); diff --git a/compiler/tests-js-parser/pass-explicit/fc035551a2a4c15c.js b/compiler/tests-js-parser/pass-explicit/fc035551a2a4c15c.js new file mode 100644 index 000000000..16439d75c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fc035551a2a4c15c.js @@ -0,0 +1 @@ +while ((a--) > (1)) {} diff --git a/compiler/tests-js-parser/pass-explicit/fc063bfba795ad91.js b/compiler/tests-js-parser/pass-explicit/fc063bfba795ad91.js new file mode 100644 index 000000000..dd4bbdebe --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fc063bfba795ad91.js @@ -0,0 +1 @@ +({a(b = new.target) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/fc1ba7d289fb1af1.js b/compiler/tests-js-parser/pass-explicit/fc1ba7d289fb1af1.js new file mode 100644 index 000000000..712547f10 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fc1ba7d289fb1af1.js @@ -0,0 +1 @@ +a = ({b: function (c, ...d) {}}); diff --git a/compiler/tests-js-parser/pass-explicit/fc286bf26373db8d.js b/compiler/tests-js-parser/pass-explicit/fc286bf26373db8d.js new file mode 100644 index 000000000..993fad380 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fc286bf26373db8d.js @@ -0,0 +1,5 @@ +switch (a) { + case "b": + c(); + default: +} diff --git a/compiler/tests-js-parser/pass-explicit/fc5c8d6f6bf16121.js b/compiler/tests-js-parser/pass-explicit/fc5c8d6f6bf16121.js new file mode 100644 index 000000000..12c208942 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fc5c8d6f6bf16121.js @@ -0,0 +1,4 @@ +{ + a(); + b(); +} diff --git a/compiler/tests-js-parser/pass-explicit/fc9f000aa3e4bd79.js b/compiler/tests-js-parser/pass-explicit/fc9f000aa3e4bd79.js new file mode 100644 index 000000000..bd38feb89 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fc9f000aa3e4bd79.js @@ -0,0 +1 @@ +for (let a;;) ; diff --git a/compiler/tests-js-parser/pass-explicit/fcb318e400b44257.js b/compiler/tests-js-parser/pass-explicit/fcb318e400b44257.js new file mode 100644 index 000000000..6e6c10ac7 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fcb318e400b44257.js @@ -0,0 +1 @@ +a ? (1) : (2); diff --git a/compiler/tests-js-parser/pass-explicit/fcd33c00916dd6ad.js b/compiler/tests-js-parser/pass-explicit/fcd33c00916dd6ad.js new file mode 100644 index 000000000..f5e773795 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fcd33c00916dd6ad.js @@ -0,0 +1 @@ +((a.b).c)(1); diff --git a/compiler/tests-js-parser/pass-explicit/fcf3738a49a5f358.js b/compiler/tests-js-parser/pass-explicit/fcf3738a49a5f358.js new file mode 100644 index 000000000..1fa180e56 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fcf3738a49a5f358.js @@ -0,0 +1 @@ +while (true) {} diff --git a/compiler/tests-js-parser/pass-explicit/fd0ad9026eee596b.js b/compiler/tests-js-parser/pass-explicit/fd0ad9026eee596b.js new file mode 100644 index 000000000..0afc6045c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fd0ad9026eee596b.js @@ -0,0 +1 @@ +1; diff --git a/compiler/tests-js-parser/pass-explicit/fd0e7b0f778f8a3b.js b/compiler/tests-js-parser/pass-explicit/fd0e7b0f778f8a3b.js new file mode 100644 index 000000000..d3bd3524a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fd0e7b0f778f8a3b.js @@ -0,0 +1,3 @@ +if (a) { + a; +} diff --git a/compiler/tests-js-parser/pass-explicit/fd167642d02f2c66.js b/compiler/tests-js-parser/pass-explicit/fd167642d02f2c66.js new file mode 100644 index 000000000..fe1342fad --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fd167642d02f2c66.js @@ -0,0 +1 @@ +({*[yield]() {}}); diff --git a/compiler/tests-js-parser/pass-explicit/fd29828f68a7634e.js b/compiler/tests-js-parser/pass-explicit/fd29828f68a7634e.js new file mode 100644 index 000000000..942685c39 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fd29828f68a7634e.js @@ -0,0 +1,5 @@ +for (; a();) { + if (b()) break; + c(); + d(); +} diff --git a/compiler/tests-js-parser/pass-explicit/fd34477284c96cbf.js b/compiler/tests-js-parser/pass-explicit/fd34477284c96cbf.js new file mode 100644 index 000000000..1e8f484a0 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fd34477284c96cbf.js @@ -0,0 +1 @@ +var [a, a] = (1); diff --git a/compiler/tests-js-parser/pass-explicit/fd5ea844fcc07d3d.js b/compiler/tests-js-parser/pass-explicit/fd5ea844fcc07d3d.js new file mode 100644 index 000000000..256d46746 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fd5ea844fcc07d3d.js @@ -0,0 +1,3 @@ +a => { + 1; +}; diff --git a/compiler/tests-js-parser/pass-explicit/fd889a4ef6e361f1.js b/compiler/tests-js-parser/pass-explicit/fd889a4ef6e361f1.js new file mode 100644 index 000000000..aedaeb45f --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fd889a4ef6e361f1.js @@ -0,0 +1,3 @@ +function a(b, c) { + d(); +} diff --git a/compiler/tests-js-parser/pass-explicit/fdb05dfd469c46c4.js b/compiler/tests-js-parser/pass-explicit/fdb05dfd469c46c4.js new file mode 100644 index 000000000..c8c029c39 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fdb05dfd469c46c4.js @@ -0,0 +1,4 @@ +var a = ({}); +a.你好 = (1); +var ↂωↂ = (2); +var l০ = (3); diff --git a/compiler/tests-js-parser/pass-explicit/fdb684acf63f6274.js b/compiler/tests-js-parser/pass-explicit/fdb684acf63f6274.js new file mode 100644 index 000000000..765da1143 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fdb684acf63f6274.js @@ -0,0 +1 @@ +2; diff --git a/compiler/tests-js-parser/pass-explicit/fe03ba1b818c762e.js b/compiler/tests-js-parser/pass-explicit/fe03ba1b818c762e.js new file mode 100644 index 000000000..6648703fa --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fe03ba1b818c762e.js @@ -0,0 +1,3 @@ +((function () { + (null) != (a, (1)); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/fe24fc72de1ef7cc.js b/compiler/tests-js-parser/pass-explicit/fe24fc72de1ef7cc.js new file mode 100644 index 000000000..a8e216448 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fe24fc72de1ef7cc.js @@ -0,0 +1 @@ +([a, b]) => (1); diff --git a/compiler/tests-js-parser/pass-explicit/fe2d3b945530c806.js b/compiler/tests-js-parser/pass-explicit/fe2d3b945530c806.js new file mode 100644 index 000000000..26da0afab --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fe2d3b945530c806.js @@ -0,0 +1,2 @@ +a; +b; diff --git a/compiler/tests-js-parser/pass-explicit/fe5ae04c8d239b26.js b/compiler/tests-js-parser/pass-explicit/fe5ae04c8d239b26.js new file mode 100644 index 000000000..0b71e57e9 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fe5ae04c8d239b26.js @@ -0,0 +1,5 @@ +function a() { + var b = (1); + c(); + var d = (2); +} diff --git a/compiler/tests-js-parser/pass-explicit/fe5f0dcb8e902857.js b/compiler/tests-js-parser/pass-explicit/fe5f0dcb8e902857.js new file mode 100644 index 000000000..ac9bb5da8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fe5f0dcb8e902857.js @@ -0,0 +1,6 @@ +while (a) ((function () { + b("c"); +})()); +try {} catch (d) { + b("e"); +} diff --git a/compiler/tests-js-parser/pass-explicit/fe7c2a6e1efe2cf4.js b/compiler/tests-js-parser/pass-explicit/fe7c2a6e1efe2cf4.js new file mode 100644 index 000000000..af4367de5 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fe7c2a6e1efe2cf4.js @@ -0,0 +1 @@ +let [a] = (b); diff --git a/compiler/tests-js-parser/pass-explicit/fec4c4ff229d3fc2.js b/compiler/tests-js-parser/pass-explicit/fec4c4ff229d3fc2.js new file mode 100644 index 000000000..71dc06048 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fec4c4ff229d3fc2.js @@ -0,0 +1,7 @@ +a((((b()) + (1)) + ("c")) + ("d")); +a(((b()) + ((2) + ("c"))) + ("d")); +a((((b()) + (3)) + ("c")) + ("d")); +a(((((b()) + (4)) + ("c")) + ("d")) + (("e") + ("f"))); +a((((((("e") + ("f")) + (b())) + (5)) + ("c")) + ("d")) + (("e") + ("f"))); +a(((("c") + (b())) + (6)) + ("d")); +a(((b()) + ("e")) + ((7) + (g("10")))); diff --git a/compiler/tests-js-parser/pass-explicit/fee1cb654a489f02.js b/compiler/tests-js-parser/pass-explicit/fee1cb654a489f02.js new file mode 100644 index 000000000..f4accfa55 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fee1cb654a489f02.js @@ -0,0 +1 @@ +a - (b % c); diff --git a/compiler/tests-js-parser/pass-explicit/fee3f54aa720263f.js b/compiler/tests-js-parser/pass-explicit/fee3f54aa720263f.js new file mode 100644 index 000000000..dd6b3194a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fee3f54aa720263f.js @@ -0,0 +1 @@ +(a ? b : c) ? d : e; diff --git a/compiler/tests-js-parser/pass-explicit/fef4facb0b8479bf.js b/compiler/tests-js-parser/pass-explicit/fef4facb0b8479bf.js new file mode 100644 index 000000000..fab24eb27 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fef4facb0b8479bf.js @@ -0,0 +1,3 @@ +function a() { + return (1) ? (2) : (3); +} diff --git a/compiler/tests-js-parser/pass-explicit/ff03d6d14c3f4007.js b/compiler/tests-js-parser/pass-explicit/ff03d6d14c3f4007.js new file mode 100644 index 000000000..8197f304c --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ff03d6d14c3f4007.js @@ -0,0 +1,3 @@ +((function () { + var a = ({NaN: 1}); +})()); diff --git a/compiler/tests-js-parser/pass-explicit/ff215f966bed2b85.js b/compiler/tests-js-parser/pass-explicit/ff215f966bed2b85.js new file mode 100644 index 000000000..72156b0a6 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ff215f966bed2b85.js @@ -0,0 +1 @@ +({__proto__: 1}); diff --git a/compiler/tests-js-parser/pass-explicit/ff488aae349cc02d.js b/compiler/tests-js-parser/pass-explicit/ff488aae349cc02d.js new file mode 100644 index 000000000..0b7cb2835 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ff488aae349cc02d.js @@ -0,0 +1 @@ +for (const a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/ff4b8762733080cb.js b/compiler/tests-js-parser/pass-explicit/ff4b8762733080cb.js new file mode 100644 index 000000000..b6739703a --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ff4b8762733080cb.js @@ -0,0 +1,3 @@ +while (true) { + continue; +} diff --git a/compiler/tests-js-parser/pass-explicit/ff902593b25092d1.js b/compiler/tests-js-parser/pass-explicit/ff902593b25092d1.js new file mode 100644 index 000000000..59260af91 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ff902593b25092d1.js @@ -0,0 +1 @@ +/[P QR]/i; diff --git a/compiler/tests-js-parser/pass-explicit/ffaf5b9d3140465b.js b/compiler/tests-js-parser/pass-explicit/ffaf5b9d3140465b.js new file mode 100644 index 000000000..fae9cadc8 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ffaf5b9d3140465b.js @@ -0,0 +1 @@ +let(); diff --git a/compiler/tests-js-parser/pass-explicit/ffbba9592c03baa6.js b/compiler/tests-js-parser/pass-explicit/ffbba9592c03baa6.js new file mode 100644 index 000000000..8aedf9b46 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ffbba9592c03baa6.js @@ -0,0 +1,5 @@ +switch (a) { + case 1: + b(); + break; +} diff --git a/compiler/tests-js-parser/pass-explicit/ffc32056a146cc9b.js b/compiler/tests-js-parser/pass-explicit/ffc32056a146cc9b.js new file mode 100644 index 000000000..ef4a390da --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ffc32056a146cc9b.js @@ -0,0 +1 @@ +for (a of b) ; diff --git a/compiler/tests-js-parser/pass-explicit/ffcf0064736d41e7.js b/compiler/tests-js-parser/pass-explicit/ffcf0064736d41e7.js new file mode 100644 index 000000000..1042cfb13 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/ffcf0064736d41e7.js @@ -0,0 +1,3 @@ +(function* () { + (function yield() {}); +}); diff --git a/compiler/tests-js-parser/pass-explicit/fffe7e78a7ce9f9a.js b/compiler/tests-js-parser/pass-explicit/fffe7e78a7ce9f9a.js new file mode 100644 index 000000000..aa6a72253 --- /dev/null +++ b/compiler/tests-js-parser/pass-explicit/fffe7e78a7ce9f9a.js @@ -0,0 +1 @@ +/foobar/; diff --git a/compiler/tests-js-parser/pass/005dc7dff71d4b97.js b/compiler/tests-js-parser/pass/005dc7dff71d4b97.js new file mode 100644 index 000000000..404b10d49 --- /dev/null +++ b/compiler/tests-js-parser/pass/005dc7dff71d4b97.js @@ -0,0 +1 @@ +[ 1 ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/006949a4f1471866.js b/compiler/tests-js-parser/pass/006949a4f1471866.js new file mode 100644 index 000000000..1e58192f6 --- /dev/null +++ b/compiler/tests-js-parser/pass/006949a4f1471866.js @@ -0,0 +1,2 @@ +if (a) { +} diff --git a/compiler/tests-js-parser/pass/00b851b06af02cc0.js b/compiler/tests-js-parser/pass/00b851b06af02cc0.js new file mode 100644 index 000000000..042a0c477 --- /dev/null +++ b/compiler/tests-js-parser/pass/00b851b06af02cc0.js @@ -0,0 +1,11 @@ +a.b('c'). + d('e', + /*@ngInject*/ + function(f) { + return f; + }). + g('h', + /*@ngInject*/ + function(i) { + return i; + }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/00bd68a9d0203f10.js b/compiler/tests-js-parser/pass/00bd68a9d0203f10.js new file mode 100644 index 000000000..490b37932 --- /dev/null +++ b/compiler/tests-js-parser/pass/00bd68a9d0203f10.js @@ -0,0 +1,9 @@ +if (a) { + b(); + c(); + d(); +} else { + e(); + f(); + g(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/00c79d09c52df3ec.js b/compiler/tests-js-parser/pass/00c79d09c52df3ec.js new file mode 100644 index 000000000..484f4042b --- /dev/null +++ b/compiler/tests-js-parser/pass/00c79d09c52df3ec.js @@ -0,0 +1 @@ +for([a,b[a],{c,d=e,[f]:[g,h().a,(1).i,...j[2]]}] in 3); diff --git a/compiler/tests-js-parser/pass/0140c25a4177e5f7.module.js b/compiler/tests-js-parser/pass/0140c25a4177e5f7.module.js new file mode 100644 index 000000000..f30c184a1 --- /dev/null +++ b/compiler/tests-js-parser/pass/0140c25a4177e5f7.module.js @@ -0,0 +1 @@ +export default (1 + 2); diff --git a/compiler/tests-js-parser/pass/01533b37d1d9ede8.js b/compiler/tests-js-parser/pass/01533b37d1d9ede8.js new file mode 100644 index 000000000..095076294 --- /dev/null +++ b/compiler/tests-js-parser/pass/01533b37d1d9ede8.js @@ -0,0 +1 @@ +1 - 2 diff --git a/compiler/tests-js-parser/pass/017a45a1919f4006.js b/compiler/tests-js-parser/pass/017a45a1919f4006.js new file mode 100644 index 000000000..f4fc662c2 --- /dev/null +++ b/compiler/tests-js-parser/pass/017a45a1919f4006.js @@ -0,0 +1 @@ +a: while (true) { continue a } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/01f27ee3c1bb68e5.js b/compiler/tests-js-parser/pass/01f27ee3c1bb68e5.js new file mode 100644 index 000000000..94121a461 --- /dev/null +++ b/compiler/tests-js-parser/pass/01f27ee3c1bb68e5.js @@ -0,0 +1 @@ +a >>= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/01fd8e8a0a42307b.js b/compiler/tests-js-parser/pass/01fd8e8a0a42307b.js new file mode 100644 index 000000000..d096987ec --- /dev/null +++ b/compiler/tests-js-parser/pass/01fd8e8a0a42307b.js @@ -0,0 +1 @@ +(function* () { yield *a }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/02028e3b961bfee0.js b/compiler/tests-js-parser/pass/02028e3b961bfee0.js new file mode 100644 index 000000000..477b3e1b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/02028e3b961bfee0.js @@ -0,0 +1 @@ +({ get: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0228be549a7706e7.js b/compiler/tests-js-parser/pass/0228be549a7706e7.js new file mode 100644 index 000000000..5a4c67a27 --- /dev/null +++ b/compiler/tests-js-parser/pass/0228be549a7706e7.js @@ -0,0 +1 @@ +(class {prototype() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/023e4178e1ad1a82.module.js b/compiler/tests-js-parser/pass/023e4178e1ad1a82.module.js new file mode 100644 index 000000000..bd8698b08 --- /dev/null +++ b/compiler/tests-js-parser/pass/023e4178e1ad1a82.module.js @@ -0,0 +1 @@ +import * as a from "a" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/024f7b95336f7fad.js b/compiler/tests-js-parser/pass/024f7b95336f7fad.js new file mode 100644 index 000000000..a213c9f02 --- /dev/null +++ b/compiler/tests-js-parser/pass/024f7b95336f7fad.js @@ -0,0 +1 @@ +a = (b, c) diff --git a/compiler/tests-js-parser/pass/0262c247b28885e2.js b/compiler/tests-js-parser/pass/0262c247b28885e2.js new file mode 100644 index 000000000..0884e8ecc --- /dev/null +++ b/compiler/tests-js-parser/pass/0262c247b28885e2.js @@ -0,0 +1 @@ +({ if: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0266b93cf3014995.js b/compiler/tests-js-parser/pass/0266b93cf3014995.js new file mode 100644 index 000000000..fa7cdb18c --- /dev/null +++ b/compiler/tests-js-parser/pass/0266b93cf3014995.js @@ -0,0 +1 @@ +!a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/027abe815032df72.js b/compiler/tests-js-parser/pass/027abe815032df72.js new file mode 100644 index 000000000..abc222ef6 --- /dev/null +++ b/compiler/tests-js-parser/pass/027abe815032df72.js @@ -0,0 +1 @@ +/p/; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/028846a58c67687f.js b/compiler/tests-js-parser/pass/028846a58c67687f.js new file mode 100644 index 000000000..d5587f47c --- /dev/null +++ b/compiler/tests-js-parser/pass/028846a58c67687f.js @@ -0,0 +1,8 @@ +{;} +a(); +{}; +{ + {}; +}; +b(); +{} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/02b924339f85fe00.js b/compiler/tests-js-parser/pass/02b924339f85fe00.js new file mode 100644 index 000000000..b028925fc --- /dev/null +++ b/compiler/tests-js-parser/pass/02b924339f85fe00.js @@ -0,0 +1 @@ +for (var {a, b} in c); diff --git a/compiler/tests-js-parser/pass/02cf1a37af2403fe.js b/compiler/tests-js-parser/pass/02cf1a37af2403fe.js new file mode 100644 index 000000000..baae057eb --- /dev/null +++ b/compiler/tests-js-parser/pass/02cf1a37af2403fe.js @@ -0,0 +1 @@ +a: for (;;) break a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/02dad3c9ec38d3c7.js b/compiler/tests-js-parser/pass/02dad3c9ec38d3c7.js new file mode 100644 index 000000000..cc947f2af --- /dev/null +++ b/compiler/tests-js-parser/pass/02dad3c9ec38d3c7.js @@ -0,0 +1 @@ +({a: b = c = 1} = 2) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0339fa95c78c11bd.js b/compiler/tests-js-parser/pass/0339fa95c78c11bd.js new file mode 100644 index 000000000..3d9d82658 --- /dev/null +++ b/compiler/tests-js-parser/pass/0339fa95c78c11bd.js @@ -0,0 +1 @@ +(a, ...[]) => 1 diff --git a/compiler/tests-js-parser/pass/034ded949b5c2fa3.js b/compiler/tests-js-parser/pass/034ded949b5c2fa3.js new file mode 100644 index 000000000..659184d71 --- /dev/null +++ b/compiler/tests-js-parser/pass/034ded949b5c2fa3.js @@ -0,0 +1 @@ +function *a(){yield ++a;} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/03608b6e222ae700.js b/compiler/tests-js-parser/pass/03608b6e222ae700.js new file mode 100644 index 000000000..630e30212 --- /dev/null +++ b/compiler/tests-js-parser/pass/03608b6e222ae700.js @@ -0,0 +1 @@ +a && (() => {}); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0371eb8b8c28569d.js b/compiler/tests-js-parser/pass/0371eb8b8c28569d.js new file mode 100644 index 000000000..5ac2cef42 --- /dev/null +++ b/compiler/tests-js-parser/pass/0371eb8b8c28569d.js @@ -0,0 +1 @@ +`$$$` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/037ecd1db38c230c.module.js b/compiler/tests-js-parser/pass/037ecd1db38c230c.module.js new file mode 100644 index 000000000..cc798ff50 --- /dev/null +++ b/compiler/tests-js-parser/pass/037ecd1db38c230c.module.js @@ -0,0 +1 @@ +export const a = 1; diff --git a/compiler/tests-js-parser/pass/03d1cf071a76d061.js b/compiler/tests-js-parser/pass/03d1cf071a76d061.js new file mode 100644 index 000000000..d131becfc --- /dev/null +++ b/compiler/tests-js-parser/pass/03d1cf071a76d061.js @@ -0,0 +1 @@ +[...a[1]] = 2; diff --git a/compiler/tests-js-parser/pass/040001f3b0eb3bde.js b/compiler/tests-js-parser/pass/040001f3b0eb3bde.js new file mode 100644 index 000000000..e52e48bc8 --- /dev/null +++ b/compiler/tests-js-parser/pass/040001f3b0eb3bde.js @@ -0,0 +1 @@ +function eval() { function a() { "use strict" } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0426f15dac46e92d.js b/compiler/tests-js-parser/pass/0426f15dac46e92d.js new file mode 100644 index 000000000..00f2469b0 --- /dev/null +++ b/compiler/tests-js-parser/pass/0426f15dac46e92d.js @@ -0,0 +1,5 @@ +(function () { + var a = { + '1e2000': 1 + }; +}()); diff --git a/compiler/tests-js-parser/pass/0453974dd98e662d.js b/compiler/tests-js-parser/pass/0453974dd98e662d.js new file mode 100644 index 000000000..8e7263ad0 --- /dev/null +++ b/compiler/tests-js-parser/pass/0453974dd98e662d.js @@ -0,0 +1 @@ +a = { get: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0458e0c30e8e6fb0.module.js b/compiler/tests-js-parser/pass/0458e0c30e8e6fb0.module.js new file mode 100644 index 000000000..97a9b580f --- /dev/null +++ b/compiler/tests-js-parser/pass/0458e0c30e8e6fb0.module.js @@ -0,0 +1 @@ +import a, * as b from "foo"; diff --git a/compiler/tests-js-parser/pass/0466764f0fb9af62.js b/compiler/tests-js-parser/pass/0466764f0fb9af62.js new file mode 100644 index 000000000..8d5f5cc78 --- /dev/null +++ b/compiler/tests-js-parser/pass/0466764f0fb9af62.js @@ -0,0 +1 @@ +function* a(){yield} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/046a0bb70d03d0cc.js b/compiler/tests-js-parser/pass/046a0bb70d03d0cc.js new file mode 100644 index 000000000..1777c8525 --- /dev/null +++ b/compiler/tests-js-parser/pass/046a0bb70d03d0cc.js @@ -0,0 +1 @@ +T‌ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/046b1012ef9b0e26.js b/compiler/tests-js-parser/pass/046b1012ef9b0e26.js new file mode 100644 index 000000000..8a95f3942 --- /dev/null +++ b/compiler/tests-js-parser/pass/046b1012ef9b0e26.js @@ -0,0 +1 @@ +/[a-c]/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/04b26d042948d474.js b/compiler/tests-js-parser/pass/04b26d042948d474.js new file mode 100644 index 000000000..ec0492c54 --- /dev/null +++ b/compiler/tests-js-parser/pass/04b26d042948d474.js @@ -0,0 +1,3 @@ +(function() { + a(), 1, 2; +}()); diff --git a/compiler/tests-js-parser/pass/04df09188055748a.js b/compiler/tests-js-parser/pass/04df09188055748a.js new file mode 100644 index 000000000..e10846f56 --- /dev/null +++ b/compiler/tests-js-parser/pass/04df09188055748a.js @@ -0,0 +1,17 @@ +if (a) { + b(); +} else if (c) { + d(); +} else if (e) { + f(); +} + +if (a) { + b(); +} else if (c) { + d(); +} else if (e) { + f(); +} else { + g(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0507b18e39d58a9f.js b/compiler/tests-js-parser/pass/0507b18e39d58a9f.js new file mode 100644 index 000000000..11068f305 --- /dev/null +++ b/compiler/tests-js-parser/pass/0507b18e39d58a9f.js @@ -0,0 +1 @@ +var a = class b extends 1{} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/05089e6cc717523e.js b/compiler/tests-js-parser/pass/05089e6cc717523e.js new file mode 100644 index 000000000..ab337dfd4 --- /dev/null +++ b/compiler/tests-js-parser/pass/05089e6cc717523e.js @@ -0,0 +1,2 @@ +(function () { +}(1,2,3)) diff --git a/compiler/tests-js-parser/pass/051696d4c46ad99b.js b/compiler/tests-js-parser/pass/051696d4c46ad99b.js new file mode 100644 index 000000000..1eba3a988 --- /dev/null +++ b/compiler/tests-js-parser/pass/051696d4c46ad99b.js @@ -0,0 +1 @@ +a: while (true) { break a } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/053480e541f54faf.js b/compiler/tests-js-parser/pass/053480e541f54faf.js new file mode 100644 index 000000000..430fe011a --- /dev/null +++ b/compiler/tests-js-parser/pass/053480e541f54faf.js @@ -0,0 +1,2 @@ +/*a +b*/ 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/053c0475e49bd36b.js b/compiler/tests-js-parser/pass/053c0475e49bd36b.js new file mode 100644 index 000000000..d7a922100 --- /dev/null +++ b/compiler/tests-js-parser/pass/053c0475e49bd36b.js @@ -0,0 +1 @@ +for (const a in b) c(a); diff --git a/compiler/tests-js-parser/pass/05448bc107f9b759.js b/compiler/tests-js-parser/pass/05448bc107f9b759.js new file mode 100644 index 000000000..bb2a89666 --- /dev/null +++ b/compiler/tests-js-parser/pass/05448bc107f9b759.js @@ -0,0 +1 @@ +class a {b(){};c(){};} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/054620d2d7fbe8fb.js b/compiler/tests-js-parser/pass/054620d2d7fbe8fb.js new file mode 100644 index 000000000..31376b892 --- /dev/null +++ b/compiler/tests-js-parser/pass/054620d2d7fbe8fb.js @@ -0,0 +1,6 @@ +function a() { + if (false) { + // because test is not referenced + var a = 1; + } +} diff --git a/compiler/tests-js-parser/pass/058c33e92f0d37a5.js b/compiler/tests-js-parser/pass/058c33e92f0d37a5.js new file mode 100644 index 000000000..76da161de --- /dev/null +++ b/compiler/tests-js-parser/pass/058c33e92f0d37a5.js @@ -0,0 +1,6 @@ +var a; +if (b()) { + new a(1); +} else { + a(2); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/059b850298ae3352.js b/compiler/tests-js-parser/pass/059b850298ae3352.js new file mode 100644 index 000000000..935e6d840 --- /dev/null +++ b/compiler/tests-js-parser/pass/059b850298ae3352.js @@ -0,0 +1 @@ +`` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/05b849122b429743.js b/compiler/tests-js-parser/pass/05b849122b429743.js new file mode 100644 index 000000000..43a8b9585 --- /dev/null +++ b/compiler/tests-js-parser/pass/05b849122b429743.js @@ -0,0 +1 @@ +var _á©áªá«á¬á­á®á¯á°á± diff --git a/compiler/tests-js-parser/pass/05b9c5f007cbaa56.js b/compiler/tests-js-parser/pass/05b9c5f007cbaa56.js new file mode 100644 index 000000000..79e707c7d --- /dev/null +++ b/compiler/tests-js-parser/pass/05b9c5f007cbaa56.js @@ -0,0 +1 @@ +a >= b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/05d268921a1f6899.js b/compiler/tests-js-parser/pass/05d268921a1f6899.js new file mode 100644 index 000000000..c76c9749f --- /dev/null +++ b/compiler/tests-js-parser/pass/05d268921a1f6899.js @@ -0,0 +1 @@ +do continue; while (true) // should be empty statement diff --git a/compiler/tests-js-parser/pass/05d5195f0d388d98.js b/compiler/tests-js-parser/pass/05d5195f0d388d98.js new file mode 100644 index 000000000..6f2d330a7 --- /dev/null +++ b/compiler/tests-js-parser/pass/05d5195f0d388d98.js @@ -0,0 +1 @@ +var A\u{42}C; diff --git a/compiler/tests-js-parser/pass/05d93894463f57ca.js b/compiler/tests-js-parser/pass/05d93894463f57ca.js new file mode 100644 index 000000000..5fb3996f5 --- /dev/null +++ b/compiler/tests-js-parser/pass/05d93894463f57ca.js @@ -0,0 +1,3 @@ +// ContinueStatement should be removed. +// And label is not used, then label also should be removed. +a: for(;;) continue a; diff --git a/compiler/tests-js-parser/pass/05fcc31bfd8d3e60.js b/compiler/tests-js-parser/pass/05fcc31bfd8d3e60.js new file mode 100644 index 000000000..39b0a7aec --- /dev/null +++ b/compiler/tests-js-parser/pass/05fcc31bfd8d3e60.js @@ -0,0 +1 @@ +function a({ b, c }){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/066b76285ce79182.js b/compiler/tests-js-parser/pass/066b76285ce79182.js new file mode 100644 index 000000000..bb638d005 --- /dev/null +++ b/compiler/tests-js-parser/pass/066b76285ce79182.js @@ -0,0 +1 @@ +class a { set b(c) {} get b() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/066e2ec2de8a7c6e.js b/compiler/tests-js-parser/pass/066e2ec2de8a7c6e.js new file mode 100644 index 000000000..698251117 --- /dev/null +++ b/compiler/tests-js-parser/pass/066e2ec2de8a7c6e.js @@ -0,0 +1,14 @@ +c: { + a(); + switch (1) { + case 2: + b(); + if (a) break c; + d(); + case 3+4: + e(); + break; + default: + f(); + } +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0671ec3d0b8ded79.js b/compiler/tests-js-parser/pass/0671ec3d0b8ded79.js new file mode 100644 index 000000000..1b7ccdfb6 --- /dev/null +++ b/compiler/tests-js-parser/pass/0671ec3d0b8ded79.js @@ -0,0 +1,2 @@ +(1, a)(); +(2, b.a)(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/068fd501eb381dba.js b/compiler/tests-js-parser/pass/068fd501eb381dba.js new file mode 100644 index 000000000..b00077061 --- /dev/null +++ b/compiler/tests-js-parser/pass/068fd501eb381dba.js @@ -0,0 +1 @@ +(a) => b; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/06981f39d0844079.js b/compiler/tests-js-parser/pass/06981f39d0844079.js new file mode 100644 index 000000000..fd66f7f0c --- /dev/null +++ b/compiler/tests-js-parser/pass/06981f39d0844079.js @@ -0,0 +1 @@ +function *a(){yield/=3/} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/06c7efc128ce74a0.js b/compiler/tests-js-parser/pass/06c7efc128ce74a0.js new file mode 100644 index 000000000..c3e07f612 --- /dev/null +++ b/compiler/tests-js-parser/pass/06c7efc128ce74a0.js @@ -0,0 +1 @@ +(function(){ a() })(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/06d84c003dc8a3af.js b/compiler/tests-js-parser/pass/06d84c003dc8a3af.js new file mode 100644 index 000000000..4125c0904 --- /dev/null +++ b/compiler/tests-js-parser/pass/06d84c003dc8a3af.js @@ -0,0 +1 @@ +"use strict";a={b:1,b:2} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/06f0deb843fbf358.js b/compiler/tests-js-parser/pass/06f0deb843fbf358.js new file mode 100644 index 000000000..d6d2fd367 --- /dev/null +++ b/compiler/tests-js-parser/pass/06f0deb843fbf358.js @@ -0,0 +1 @@ +'use\x20strict'; with (a) b = c; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/06f7278423cef571.js b/compiler/tests-js-parser/pass/06f7278423cef571.js new file mode 100644 index 000000000..9eb66363b --- /dev/null +++ b/compiler/tests-js-parser/pass/06f7278423cef571.js @@ -0,0 +1 @@ +({2e308:1}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/070d82d1b3b3a975.js b/compiler/tests-js-parser/pass/070d82d1b3b3a975.js new file mode 100644 index 000000000..6012f981e --- /dev/null +++ b/compiler/tests-js-parser/pass/070d82d1b3b3a975.js @@ -0,0 +1,7 @@ +(function () { + var a; + eval('a'); + function b() { + a = a += 1; // eval makes dynamic + } +}()); diff --git a/compiler/tests-js-parser/pass/071f05b40ea0163f.js b/compiler/tests-js-parser/pass/071f05b40ea0163f.js new file mode 100644 index 000000000..ceece40b7 --- /dev/null +++ b/compiler/tests-js-parser/pass/071f05b40ea0163f.js @@ -0,0 +1,3 @@ +new a("aa, [bb]", 'return aa;'); +new a("aa, {bb}", 'return aa;'); +new a("[[aa]], [{bb}]", 'return aa;'); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/075c7204d0b0af60.js b/compiler/tests-js-parser/pass/075c7204d0b0af60.js new file mode 100644 index 000000000..87ac0928c --- /dev/null +++ b/compiler/tests-js-parser/pass/075c7204d0b0af60.js @@ -0,0 +1 @@ +({ get a() {} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/079b7b699d0cacab.js b/compiler/tests-js-parser/pass/079b7b699d0cacab.js new file mode 100644 index 000000000..3c1d48b56 --- /dev/null +++ b/compiler/tests-js-parser/pass/079b7b699d0cacab.js @@ -0,0 +1,4 @@ +(function () { + arguments[1] = 2; + var a =3; // should not hoist to parameter +}()); diff --git a/compiler/tests-js-parser/pass/07a74deab99e85eb.js b/compiler/tests-js-parser/pass/07a74deab99e85eb.js new file mode 100644 index 000000000..e121b117c --- /dev/null +++ b/compiler/tests-js-parser/pass/07a74deab99e85eb.js @@ -0,0 +1 @@ +var a = class extends b {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/07bce073a241288b.js b/compiler/tests-js-parser/pass/07bce073a241288b.js new file mode 100644 index 000000000..2404c6f0a --- /dev/null +++ b/compiler/tests-js-parser/pass/07bce073a241288b.js @@ -0,0 +1,4 @@ +``; +`xx\`x`; +`${ a + 1 }`; +` foo ${ b + `baz ${ c }` }`; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/07cfd31162dc117a.js b/compiler/tests-js-parser/pass/07cfd31162dc117a.js new file mode 100644 index 000000000..781bb99f2 --- /dev/null +++ b/compiler/tests-js-parser/pass/07cfd31162dc117a.js @@ -0,0 +1 @@ +let {a,b=1,c:d,e:f=2,[g]:[h]}=3 diff --git a/compiler/tests-js-parser/pass/07d4bedb35fb60b6.js b/compiler/tests-js-parser/pass/07d4bedb35fb60b6.js new file mode 100644 index 000000000..cab5909ac --- /dev/null +++ b/compiler/tests-js-parser/pass/07d4bedb35fb60b6.js @@ -0,0 +1 @@ +(1, a.a)(); diff --git a/compiler/tests-js-parser/pass/0813adc754c82a98.js b/compiler/tests-js-parser/pass/0813adc754c82a98.js new file mode 100644 index 000000000..82a24eb5e --- /dev/null +++ b/compiler/tests-js-parser/pass/0813adc754c82a98.js @@ -0,0 +1 @@ +class a {'constructor'() {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0821d3a84023aca2.js b/compiler/tests-js-parser/pass/0821d3a84023aca2.js new file mode 100644 index 000000000..5f3c576ae --- /dev/null +++ b/compiler/tests-js-parser/pass/0821d3a84023aca2.js @@ -0,0 +1 @@ +var [{a},b] = c; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0827a8316cca777a.js b/compiler/tests-js-parser/pass/0827a8316cca777a.js new file mode 100644 index 000000000..813b0015e --- /dev/null +++ b/compiler/tests-js-parser/pass/0827a8316cca777a.js @@ -0,0 +1 @@ +(class {get a() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/08358cb4732d8ce1.js b/compiler/tests-js-parser/pass/08358cb4732d8ce1.js new file mode 100644 index 000000000..e1ad50f51 --- /dev/null +++ b/compiler/tests-js-parser/pass/08358cb4732d8ce1.js @@ -0,0 +1 @@ +var 𞸊𞸋 diff --git a/compiler/tests-js-parser/pass/0860caf88460e363.js b/compiler/tests-js-parser/pass/0860caf88460e363.js new file mode 100644 index 000000000..7d3a884ce --- /dev/null +++ b/compiler/tests-js-parser/pass/0860caf88460e363.js @@ -0,0 +1 @@ +((a,a),(a,a)) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0889a34434e586e9.js b/compiler/tests-js-parser/pass/0889a34434e586e9.js new file mode 100644 index 000000000..691261564 --- /dev/null +++ b/compiler/tests-js-parser/pass/0889a34434e586e9.js @@ -0,0 +1 @@ +1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/08a39e4289b0c3f3.js b/compiler/tests-js-parser/pass/08a39e4289b0c3f3.js new file mode 100644 index 000000000..db6746937 --- /dev/null +++ b/compiler/tests-js-parser/pass/08a39e4289b0c3f3.js @@ -0,0 +1 @@ +T†\ No newline at end of file diff --git a/compiler/tests-js-parser/pass/08ba81b9af0132ea.js b/compiler/tests-js-parser/pass/08ba81b9af0132ea.js new file mode 100644 index 000000000..597b4e96b --- /dev/null +++ b/compiler/tests-js-parser/pass/08ba81b9af0132ea.js @@ -0,0 +1,3 @@ +(function () { + for (var a; a < 1; ++a); +}()); diff --git a/compiler/tests-js-parser/pass/08c3105bb3f7ccb7.js b/compiler/tests-js-parser/pass/08c3105bb3f7ccb7.js new file mode 100644 index 000000000..ae74ee042 --- /dev/null +++ b/compiler/tests-js-parser/pass/08c3105bb3f7ccb7.js @@ -0,0 +1 @@ +function *a() { var b = function(yield) {} } diff --git a/compiler/tests-js-parser/pass/091d00847cbf8a9d.js b/compiler/tests-js-parser/pass/091d00847cbf8a9d.js new file mode 100644 index 000000000..523440c04 --- /dev/null +++ b/compiler/tests-js-parser/pass/091d00847cbf8a9d.js @@ -0,0 +1 @@ +var {a, b} = {a:1, b:2}; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/09245ed873c9e7ea.js b/compiler/tests-js-parser/pass/09245ed873c9e7ea.js new file mode 100644 index 000000000..ceb77057e --- /dev/null +++ b/compiler/tests-js-parser/pass/09245ed873c9e7ea.js @@ -0,0 +1 @@ +a(...b) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0986e63317738f46.js b/compiler/tests-js-parser/pass/0986e63317738f46.js new file mode 100644 index 000000000..f516f81e2 --- /dev/null +++ b/compiler/tests-js-parser/pass/0986e63317738f46.js @@ -0,0 +1,14 @@ +var a, b; +if (a && !(a + "1") && b) { // 1 + var c; + d(); +} else { + e(); +} + +if (a || !!(a + "1") || b) { // 2 + d(); +} else { + var f; + e(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/098e1fe1335e222b.js b/compiler/tests-js-parser/pass/098e1fe1335e222b.js new file mode 100644 index 000000000..75d3935d1 --- /dev/null +++ b/compiler/tests-js-parser/pass/098e1fe1335e222b.js @@ -0,0 +1 @@ +[a, ...{0: b}] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/09be3a3198b40536.js b/compiler/tests-js-parser/pass/09be3a3198b40536.js new file mode 100644 index 000000000..61b45b94b --- /dev/null +++ b/compiler/tests-js-parser/pass/09be3a3198b40536.js @@ -0,0 +1 @@ +function a([]) {} diff --git a/compiler/tests-js-parser/pass/09c1c4b95bf0df77.js b/compiler/tests-js-parser/pass/09c1c4b95bf0df77.js new file mode 100644 index 000000000..dd1e53abb --- /dev/null +++ b/compiler/tests-js-parser/pass/09c1c4b95bf0df77.js @@ -0,0 +1 @@ +({ __proto__, __proto__: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/09e84f25af85b836.js b/compiler/tests-js-parser/pass/09e84f25af85b836.js new file mode 100644 index 000000000..ae6762d07 --- /dev/null +++ b/compiler/tests-js-parser/pass/09e84f25af85b836.js @@ -0,0 +1 @@ +({set a(yield){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0a068bc70fe14c94.js b/compiler/tests-js-parser/pass/0a068bc70fe14c94.js new file mode 100644 index 000000000..e89d5f4b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/0a068bc70fe14c94.js @@ -0,0 +1 @@ +("a") \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0a2fc93b6a63bbd3.js b/compiler/tests-js-parser/pass/0a2fc93b6a63bbd3.js new file mode 100644 index 000000000..c82dcf828 --- /dev/null +++ b/compiler/tests-js-parser/pass/0a2fc93b6a63bbd3.js @@ -0,0 +1 @@ +[...a] = b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0a38bb9fff27bc21.js b/compiler/tests-js-parser/pass/0a38bb9fff27bc21.js new file mode 100644 index 000000000..cbfb49061 --- /dev/null +++ b/compiler/tests-js-parser/pass/0a38bb9fff27bc21.js @@ -0,0 +1,6 @@ +(function () { + var a; + function b() { + a = a += 1; + } +}()); diff --git a/compiler/tests-js-parser/pass/0a616ee6dd067bc6.js b/compiler/tests-js-parser/pass/0a616ee6dd067bc6.js new file mode 100644 index 000000000..acd98f188 --- /dev/null +++ b/compiler/tests-js-parser/pass/0a616ee6dd067bc6.js @@ -0,0 +1,4 @@ +// global, do not optimize +(function () { + a("b"); +}()); diff --git a/compiler/tests-js-parser/pass/0a9e4cbb36d95f7c.js b/compiler/tests-js-parser/pass/0a9e4cbb36d95f7c.js new file mode 100644 index 000000000..5e3460a87 --- /dev/null +++ b/compiler/tests-js-parser/pass/0a9e4cbb36d95f7c.js @@ -0,0 +1,8 @@ +function a() { + var b = 1; + c(); + { + c(); + c(); + } +} diff --git a/compiler/tests-js-parser/pass/0aa6aab640155051.js b/compiler/tests-js-parser/pass/0aa6aab640155051.js new file mode 100644 index 000000000..9bf67ab32 --- /dev/null +++ b/compiler/tests-js-parser/pass/0aa6aab640155051.js @@ -0,0 +1 @@ +class a extends b { constructor() { () => { super(); } } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0aa9242278e1393b.js b/compiler/tests-js-parser/pass/0aa9242278e1393b.js new file mode 100644 index 000000000..67e1f7deb --- /dev/null +++ b/compiler/tests-js-parser/pass/0aa9242278e1393b.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + return super.d + } +} diff --git a/compiler/tests-js-parser/pass/0aeb95f62766e684.js b/compiler/tests-js-parser/pass/0aeb95f62766e684.js new file mode 100644 index 000000000..024114bc0 --- /dev/null +++ b/compiler/tests-js-parser/pass/0aeb95f62766e684.js @@ -0,0 +1 @@ +"\u0061" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0b1fc7208759253b.js b/compiler/tests-js-parser/pass/0b1fc7208759253b.js new file mode 100644 index 000000000..e49bcb0db --- /dev/null +++ b/compiler/tests-js-parser/pass/0b1fc7208759253b.js @@ -0,0 +1 @@ +'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\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' + a diff --git a/compiler/tests-js-parser/pass/0b2804600405dbf6.js b/compiler/tests-js-parser/pass/0b2804600405dbf6.js new file mode 100644 index 000000000..0788a4d21 --- /dev/null +++ b/compiler/tests-js-parser/pass/0b2804600405dbf6.js @@ -0,0 +1,2 @@ +var a, b, c, d; +a = (b(), c(), d()) ? 1 : 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0b281915a3227177.js b/compiler/tests-js-parser/pass/0b281915a3227177.js new file mode 100644 index 000000000..b0f991045 --- /dev/null +++ b/compiler/tests-js-parser/pass/0b281915a3227177.js @@ -0,0 +1 @@ +"Hello\012World" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0b4d61559ccce0f9.js b/compiler/tests-js-parser/pass/0b4d61559ccce0f9.js new file mode 100644 index 000000000..474f5a935 --- /dev/null +++ b/compiler/tests-js-parser/pass/0b4d61559ccce0f9.js @@ -0,0 +1 @@ +({a:(b.c)} = 1) diff --git a/compiler/tests-js-parser/pass/0b4e932ec15cdae4.js b/compiler/tests-js-parser/pass/0b4e932ec15cdae4.js new file mode 100644 index 000000000..597aa93b3 --- /dev/null +++ b/compiler/tests-js-parser/pass/0b4e932ec15cdae4.js @@ -0,0 +1 @@ +for(var a = 1;;) { let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0b50309b4112013e.js b/compiler/tests-js-parser/pass/0b50309b4112013e.js new file mode 100644 index 000000000..a167209d7 --- /dev/null +++ b/compiler/tests-js-parser/pass/0b50309b4112013e.js @@ -0,0 +1 @@ +var a; (a); diff --git a/compiler/tests-js-parser/pass/0b5f023129f23abf.js b/compiler/tests-js-parser/pass/0b5f023129f23abf.js new file mode 100644 index 000000000..6f8334966 --- /dev/null +++ b/compiler/tests-js-parser/pass/0b5f023129f23abf.js @@ -0,0 +1 @@ +a = [ 1 ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0b6dfcd5427a43a6.js b/compiler/tests-js-parser/pass/0b6dfcd5427a43a6.js new file mode 100644 index 000000000..63e484e2e --- /dev/null +++ b/compiler/tests-js-parser/pass/0b6dfcd5427a43a6.js @@ -0,0 +1 @@ +0008 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0b881b80b7220fad.js b/compiler/tests-js-parser/pass/0b881b80b7220fad.js new file mode 100644 index 000000000..090b618ac --- /dev/null +++ b/compiler/tests-js-parser/pass/0b881b80b7220fad.js @@ -0,0 +1 @@ +a = { b(...c) { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0ba326a76aa2a0ae.js b/compiler/tests-js-parser/pass/0ba326a76aa2a0ae.js new file mode 100644 index 000000000..996aef314 --- /dev/null +++ b/compiler/tests-js-parser/pass/0ba326a76aa2a0ae.js @@ -0,0 +1 @@ +let {a:{}} = 1 diff --git a/compiler/tests-js-parser/pass/0bbda5d7d8ae8990.js b/compiler/tests-js-parser/pass/0bbda5d7d8ae8990.js new file mode 100644 index 000000000..e2a1d07ab --- /dev/null +++ b/compiler/tests-js-parser/pass/0bbda5d7d8ae8990.js @@ -0,0 +1 @@ +function a() { /* infinite */ while (true) { } /* bar */ var b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0bef54f61acccbe5.js b/compiler/tests-js-parser/pass/0bef54f61acccbe5.js new file mode 100644 index 000000000..5f813bf6f --- /dev/null +++ b/compiler/tests-js-parser/pass/0bef54f61acccbe5.js @@ -0,0 +1,4 @@ +(function() { + return 1; + var a = 2; +}()); diff --git a/compiler/tests-js-parser/pass/0c44152a1a3e2f90.js b/compiler/tests-js-parser/pass/0c44152a1a3e2f90.js new file mode 100644 index 000000000..79b155d7c --- /dev/null +++ b/compiler/tests-js-parser/pass/0c44152a1a3e2f90.js @@ -0,0 +1 @@ +- (1 - 2 - 3) diff --git a/compiler/tests-js-parser/pass/0c7719169ed21a87.js b/compiler/tests-js-parser/pass/0c7719169ed21a87.js new file mode 100644 index 000000000..05786bec0 --- /dev/null +++ b/compiler/tests-js-parser/pass/0c7719169ed21a87.js @@ -0,0 +1 @@ +class a { b() { new super.c(); } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0c8a07486c1ff18e.js b/compiler/tests-js-parser/pass/0c8a07486c1ff18e.js new file mode 100644 index 000000000..96fc4fc0e --- /dev/null +++ b/compiler/tests-js-parser/pass/0c8a07486c1ff18e.js @@ -0,0 +1 @@ +(a) => b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0cd7b76d7d1431d6.js b/compiler/tests-js-parser/pass/0cd7b76d7d1431d6.js new file mode 100644 index 000000000..f66d11395 --- /dev/null +++ b/compiler/tests-js-parser/pass/0cd7b76d7d1431d6.js @@ -0,0 +1 @@ +function a(b, c) { return b-- >= c; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0ce4fa8fdf700065.js b/compiler/tests-js-parser/pass/0ce4fa8fdf700065.js new file mode 100644 index 000000000..bfdf15bb8 --- /dev/null +++ b/compiler/tests-js-parser/pass/0ce4fa8fdf700065.js @@ -0,0 +1,3 @@ +new (function () { + var a = 1; +}); diff --git a/compiler/tests-js-parser/pass/0cf1df0ef867a7f4.js b/compiler/tests-js-parser/pass/0cf1df0ef867a7f4.js new file mode 100644 index 000000000..9ad92329d --- /dev/null +++ b/compiler/tests-js-parser/pass/0cf1df0ef867a7f4.js @@ -0,0 +1 @@ +({yield}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0d137e8a97ffe083.js b/compiler/tests-js-parser/pass/0d137e8a97ffe083.js new file mode 100644 index 000000000..c741caff9 --- /dev/null +++ b/compiler/tests-js-parser/pass/0d137e8a97ffe083.js @@ -0,0 +1 @@ +function *a(){({get b(){yield}})} diff --git a/compiler/tests-js-parser/pass/0d6e503c739611e2.js b/compiler/tests-js-parser/pass/0d6e503c739611e2.js new file mode 100644 index 000000000..09556b60a --- /dev/null +++ b/compiler/tests-js-parser/pass/0d6e503c739611e2.js @@ -0,0 +1 @@ +a\u0061 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0d7e3e1647af9ba6.js b/compiler/tests-js-parser/pass/0d7e3e1647af9ba6.js new file mode 100644 index 000000000..b57bb0510 --- /dev/null +++ b/compiler/tests-js-parser/pass/0d7e3e1647af9ba6.js @@ -0,0 +1 @@ +do {} while (true) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0d9f26fe4d91ad07.js b/compiler/tests-js-parser/pass/0d9f26fe4d91ad07.js new file mode 100644 index 000000000..9d01e70a1 --- /dev/null +++ b/compiler/tests-js-parser/pass/0d9f26fe4d91ad07.js @@ -0,0 +1 @@ +[{a=1},{a=2}] = 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0da4b57d03d33129.js b/compiler/tests-js-parser/pass/0da4b57d03d33129.js new file mode 100644 index 000000000..70933fc7b --- /dev/null +++ b/compiler/tests-js-parser/pass/0da4b57d03d33129.js @@ -0,0 +1 @@ +typeof (1, a, 2) diff --git a/compiler/tests-js-parser/pass/0da6496ed75822b1.module.js b/compiler/tests-js-parser/pass/0da6496ed75822b1.module.js new file mode 100644 index 000000000..1a22fde9a --- /dev/null +++ b/compiler/tests-js-parser/pass/0da6496ed75822b1.module.js @@ -0,0 +1 @@ +export function a () {} false diff --git a/compiler/tests-js-parser/pass/0de4ef1344cbb907.js b/compiler/tests-js-parser/pass/0de4ef1344cbb907.js new file mode 100644 index 000000000..17c23b062 --- /dev/null +++ b/compiler/tests-js-parser/pass/0de4ef1344cbb907.js @@ -0,0 +1 @@ +function a(){return {} / 1} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0de707242475664c.js b/compiler/tests-js-parser/pass/0de707242475664c.js new file mode 100644 index 000000000..21c4b177a --- /dev/null +++ b/compiler/tests-js-parser/pass/0de707242475664c.js @@ -0,0 +1,7 @@ +for (;a();) { + b(); + c(); + if (d()) break; + e(); + f(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0de805d0c921e235.js b/compiler/tests-js-parser/pass/0de805d0c921e235.js new file mode 100644 index 000000000..82effd52f --- /dev/null +++ b/compiler/tests-js-parser/pass/0de805d0c921e235.js @@ -0,0 +1 @@ +a <<= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0def12c63f682470.js b/compiler/tests-js-parser/pass/0def12c63f682470.js new file mode 100644 index 000000000..4054e8b04 --- /dev/null +++ b/compiler/tests-js-parser/pass/0def12c63f682470.js @@ -0,0 +1 @@ +[] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0e22e969622bf137.js b/compiler/tests-js-parser/pass/0e22e969622bf137.js new file mode 100644 index 000000000..898015ece --- /dev/null +++ b/compiler/tests-js-parser/pass/0e22e969622bf137.js @@ -0,0 +1 @@ +({ *a() {} }) diff --git a/compiler/tests-js-parser/pass/0e3ca454ddfb4729.js b/compiler/tests-js-parser/pass/0e3ca454ddfb4729.js new file mode 100644 index 000000000..ad46536e7 --- /dev/null +++ b/compiler/tests-js-parser/pass/0e3ca454ddfb4729.js @@ -0,0 +1 @@ +for (a[b in c] in d); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0eb53d0e06cd5417.js b/compiler/tests-js-parser/pass/0eb53d0e06cd5417.js new file mode 100644 index 000000000..0b26bb32a --- /dev/null +++ b/compiler/tests-js-parser/pass/0eb53d0e06cd5417.js @@ -0,0 +1 @@ +function *a() { yield b=c, yield* d=e, f } diff --git a/compiler/tests-js-parser/pass/0f18951fd55b8c07.js b/compiler/tests-js-parser/pass/0f18951fd55b8c07.js new file mode 100644 index 000000000..b7a230ccc --- /dev/null +++ b/compiler/tests-js-parser/pass/0f18951fd55b8c07.js @@ -0,0 +1,5 @@ +switch (a) { + case b: { + c; + } +} diff --git a/compiler/tests-js-parser/pass/0f59aedfe2c7682c.js b/compiler/tests-js-parser/pass/0f59aedfe2c7682c.js new file mode 100644 index 000000000..f19760a54 --- /dev/null +++ b/compiler/tests-js-parser/pass/0f59aedfe2c7682c.js @@ -0,0 +1 @@ +({ null: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0f630e67e4542867.js b/compiler/tests-js-parser/pass/0f630e67e4542867.js new file mode 100644 index 000000000..3266b763a --- /dev/null +++ b/compiler/tests-js-parser/pass/0f630e67e4542867.js @@ -0,0 +1 @@ +var [a]=[1]; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0f809258920b3469.js b/compiler/tests-js-parser/pass/0f809258920b3469.js new file mode 100644 index 000000000..0781bd4fd --- /dev/null +++ b/compiler/tests-js-parser/pass/0f809258920b3469.js @@ -0,0 +1,19 @@ +c: { + a(); + switch (1) { + case 2: + b(); + if (a) break c; + for (var b = 3; b < 4; b++) { + if (b > 5) break; // this break refers to the for, not to the switch; thus it + // shouldn't ruin our optimization + d.e(b); + } + f(); + case 6+7: + g(); + break; + default: + h(); + } +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0f88c334715d2489.js b/compiler/tests-js-parser/pass/0f88c334715d2489.js new file mode 100644 index 000000000..31827e21f --- /dev/null +++ b/compiler/tests-js-parser/pass/0f88c334715d2489.js @@ -0,0 +1 @@ +function *a(){yield void 1} diff --git a/compiler/tests-js-parser/pass/0f9f10c894a7d811.js b/compiler/tests-js-parser/pass/0f9f10c894a7d811.js new file mode 100644 index 000000000..707c37a8a --- /dev/null +++ b/compiler/tests-js-parser/pass/0f9f10c894a7d811.js @@ -0,0 +1 @@ +(0o0) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0fa2102f53acd283.js b/compiler/tests-js-parser/pass/0fa2102f53acd283.js new file mode 100644 index 000000000..9c4e28e73 --- /dev/null +++ b/compiler/tests-js-parser/pass/0fa2102f53acd283.js @@ -0,0 +1 @@ +(a)++ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0fc7d5705a324efb.js b/compiler/tests-js-parser/pass/0fc7d5705a324efb.js new file mode 100644 index 000000000..d1febfdba --- /dev/null +++ b/compiler/tests-js-parser/pass/0fc7d5705a324efb.js @@ -0,0 +1,4 @@ +(function () { + a = 1; + for (b = 2;;); +}()); diff --git a/compiler/tests-js-parser/pass/0fe1f55610641156.js b/compiler/tests-js-parser/pass/0fe1f55610641156.js new file mode 100644 index 000000000..acb7310e8 --- /dev/null +++ b/compiler/tests-js-parser/pass/0fe1f55610641156.js @@ -0,0 +1 @@ +a["b"] = "c"; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/0fe2654034a20f6b.module.js b/compiler/tests-js-parser/pass/0fe2654034a20f6b.module.js new file mode 100644 index 000000000..b198c0910 --- /dev/null +++ b/compiler/tests-js-parser/pass/0fe2654034a20f6b.module.js @@ -0,0 +1 @@ +import {a, b} from "foo"; diff --git a/compiler/tests-js-parser/pass/0ffdc03e2ffcb5dc.js b/compiler/tests-js-parser/pass/0ffdc03e2ffcb5dc.js new file mode 100644 index 000000000..473f0da2c --- /dev/null +++ b/compiler/tests-js-parser/pass/0ffdc03e2ffcb5dc.js @@ -0,0 +1 @@ +void /test/ diff --git a/compiler/tests-js-parser/pass/10786cdac00d0c02.module.js b/compiler/tests-js-parser/pass/10786cdac00d0c02.module.js new file mode 100644 index 000000000..be84b178d --- /dev/null +++ b/compiler/tests-js-parser/pass/10786cdac00d0c02.module.js @@ -0,0 +1 @@ +import { a, b } from "c" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/10857a84ed2962f1.js b/compiler/tests-js-parser/pass/10857a84ed2962f1.js new file mode 100644 index 000000000..568d0c2d7 --- /dev/null +++ b/compiler/tests-js-parser/pass/10857a84ed2962f1.js @@ -0,0 +1 @@ +class a { get b() {} set b(c) {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/1093d98f5fc0758d.js b/compiler/tests-js-parser/pass/1093d98f5fc0758d.js new file mode 100644 index 000000000..fa95c4b3b --- /dev/null +++ b/compiler/tests-js-parser/pass/1093d98f5fc0758d.js @@ -0,0 +1 @@ +(function a({ b: { c, a }, d: [e, f] }, ...[b, d, g]){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/10a21e1cf65c5afb.js b/compiler/tests-js-parser/pass/10a21e1cf65c5afb.js new file mode 100644 index 000000000..782bd78f1 --- /dev/null +++ b/compiler/tests-js-parser/pass/10a21e1cf65c5afb.js @@ -0,0 +1 @@ +[, a,,] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/10d6486502949e74.js b/compiler/tests-js-parser/pass/10d6486502949e74.js new file mode 100644 index 000000000..b98cb5a0c --- /dev/null +++ b/compiler/tests-js-parser/pass/10d6486502949e74.js @@ -0,0 +1 @@ +({ __proto__: null, get __proto__(){} }) diff --git a/compiler/tests-js-parser/pass/10f0ef998c05c611.js b/compiler/tests-js-parser/pass/10f0ef998c05c611.js new file mode 100644 index 000000000..33ea15883 --- /dev/null +++ b/compiler/tests-js-parser/pass/10f0ef998c05c611.js @@ -0,0 +1 @@ +do {} while (false) a(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/10fda5cd119b39a5.js b/compiler/tests-js-parser/pass/10fda5cd119b39a5.js new file mode 100644 index 000000000..2728b79d3 --- /dev/null +++ b/compiler/tests-js-parser/pass/10fda5cd119b39a5.js @@ -0,0 +1 @@ +[...eval] = a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/110fa1efdd0868b8.js b/compiler/tests-js-parser/pass/110fa1efdd0868b8.js new file mode 100644 index 000000000..f9ac49bca --- /dev/null +++ b/compiler/tests-js-parser/pass/110fa1efdd0868b8.js @@ -0,0 +1,2 @@ +"Hello\ +world" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/111668493e3e0823.js b/compiler/tests-js-parser/pass/111668493e3e0823.js new file mode 100644 index 000000000..068ff0f7f --- /dev/null +++ b/compiler/tests-js-parser/pass/111668493e3e0823.js @@ -0,0 +1 @@ +/[a-z]/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/1145e94ad27e7ba6.js b/compiler/tests-js-parser/pass/1145e94ad27e7ba6.js new file mode 100644 index 000000000..a409cedb2 --- /dev/null +++ b/compiler/tests-js-parser/pass/1145e94ad27e7ba6.js @@ -0,0 +1,6 @@ +function a() { + b(); +} +if (a() || true) { + c(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/11611f2a3d32994e.js b/compiler/tests-js-parser/pass/11611f2a3d32994e.js new file mode 100644 index 000000000..bdd02b661 --- /dev/null +++ b/compiler/tests-js-parser/pass/11611f2a3d32994e.js @@ -0,0 +1 @@ +function a() { new.target; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/116cacc3c80a5a3e.js b/compiler/tests-js-parser/pass/116cacc3c80a5a3e.js new file mode 100644 index 000000000..6a8525e13 --- /dev/null +++ b/compiler/tests-js-parser/pass/116cacc3c80a5a3e.js @@ -0,0 +1,3 @@ +do { + a(); +} while (false)b() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/119e9dce4feae643.js b/compiler/tests-js-parser/pass/119e9dce4feae643.js new file mode 100644 index 000000000..508665428 --- /dev/null +++ b/compiler/tests-js-parser/pass/119e9dce4feae643.js @@ -0,0 +1,8 @@ +var a = { + b: null, + set c(d) { + }, + get c() { + return this.b; + } +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/11a021c9efe0e432.js b/compiler/tests-js-parser/pass/11a021c9efe0e432.js new file mode 100644 index 000000000..2d4178c9f --- /dev/null +++ b/compiler/tests-js-parser/pass/11a021c9efe0e432.js @@ -0,0 +1 @@ +--eval \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/121491a690a13543.js b/compiler/tests-js-parser/pass/121491a690a13543.js new file mode 100644 index 000000000..e1c1b5a92 --- /dev/null +++ b/compiler/tests-js-parser/pass/121491a690a13543.js @@ -0,0 +1 @@ +a(() => {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/1223609b0f7a2129.js b/compiler/tests-js-parser/pass/1223609b0f7a2129.js new file mode 100644 index 000000000..f528f662d --- /dev/null +++ b/compiler/tests-js-parser/pass/1223609b0f7a2129.js @@ -0,0 +1 @@ +!function(){a()}(),!function(){b()}(),c()+1 diff --git a/compiler/tests-js-parser/pass/123285734ee7f954.js b/compiler/tests-js-parser/pass/123285734ee7f954.js new file mode 100644 index 000000000..4bb62ffe2 --- /dev/null +++ b/compiler/tests-js-parser/pass/123285734ee7f954.js @@ -0,0 +1 @@ +with (a) b = c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/123bfcc3f6cf379f.js b/compiler/tests-js-parser/pass/123bfcc3f6cf379f.js new file mode 100644 index 000000000..1c8561480 --- /dev/null +++ b/compiler/tests-js-parser/pass/123bfcc3f6cf379f.js @@ -0,0 +1 @@ +function a(b, ...c) { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/123f89c06747ced2.js b/compiler/tests-js-parser/pass/123f89c06747ced2.js new file mode 100644 index 000000000..38520a7a6 --- /dev/null +++ b/compiler/tests-js-parser/pass/123f89c06747ced2.js @@ -0,0 +1 @@ +`\u{000042}\u0042\x42u0\A` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/124490e0f2dbbac7.js b/compiler/tests-js-parser/pass/124490e0f2dbbac7.js new file mode 100644 index 000000000..3f3c87ba2 --- /dev/null +++ b/compiler/tests-js-parser/pass/124490e0f2dbbac7.js @@ -0,0 +1 @@ +a % b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/12556d5e39db1cea.js b/compiler/tests-js-parser/pass/12556d5e39db1cea.js new file mode 100644 index 000000000..169c6a6dc --- /dev/null +++ b/compiler/tests-js-parser/pass/12556d5e39db1cea.js @@ -0,0 +1 @@ +function* yield(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/126a6455f0f721fe.js b/compiler/tests-js-parser/pass/126a6455f0f721fe.js new file mode 100644 index 000000000..ddf29aed6 --- /dev/null +++ b/compiler/tests-js-parser/pass/126a6455f0f721fe.js @@ -0,0 +1 @@ +({a(b){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/1270d541e0fd6af8.js b/compiler/tests-js-parser/pass/1270d541e0fd6af8.js new file mode 100644 index 000000000..61946f4f0 --- /dev/null +++ b/compiler/tests-js-parser/pass/1270d541e0fd6af8.js @@ -0,0 +1 @@ +comment in"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/2e371094f1b1ac51.js b/compiler/tests-js-parser/pass/2e371094f1b1ac51.js new file mode 100644 index 000000000..00c29f619 --- /dev/null +++ b/compiler/tests-js-parser/pass/2e371094f1b1ac51.js @@ -0,0 +1 @@ +('\1111') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/2e5fbf7b1685fa1b.js b/compiler/tests-js-parser/pass/2e5fbf7b1685fa1b.js new file mode 100644 index 000000000..7e642528c --- /dev/null +++ b/compiler/tests-js-parser/pass/2e5fbf7b1685fa1b.js @@ -0,0 +1,7 @@ +(function () { + var a = 1; // should not hoist this + arguments[2] = 3; + (function () { + eval(''); + }()); +}()); diff --git a/compiler/tests-js-parser/pass/2e7336dc8eba87ef.js b/compiler/tests-js-parser/pass/2e7336dc8eba87ef.js new file mode 100644 index 000000000..f6f28df96 --- /dev/null +++ b/compiler/tests-js-parser/pass/2e7336dc8eba87ef.js @@ -0,0 +1 @@ +a.b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/2e75e3bd39e6df05.js b/compiler/tests-js-parser/pass/2e75e3bd39e6df05.js new file mode 100644 index 000000000..52d60437a --- /dev/null +++ b/compiler/tests-js-parser/pass/2e75e3bd39e6df05.js @@ -0,0 +1,4 @@ +a = "b".c; +a = ("b" + "d")["e" + "f"]; +a = g.c; +a = ("b" + g).c; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/2e7f443b2f555bc5.js b/compiler/tests-js-parser/pass/2e7f443b2f555bc5.js new file mode 100644 index 000000000..795049a9f --- /dev/null +++ b/compiler/tests-js-parser/pass/2e7f443b2f555bc5.js @@ -0,0 +1 @@ +/**/ function a() {function b() {}} diff --git a/compiler/tests-js-parser/pass/2e8a88da875f40c7.js b/compiler/tests-js-parser/pass/2e8a88da875f40c7.js new file mode 100644 index 000000000..32ed463d9 --- /dev/null +++ b/compiler/tests-js-parser/pass/2e8a88da875f40c7.js @@ -0,0 +1 @@ +delete /test/ diff --git a/compiler/tests-js-parser/pass/2ef5ba0343d739dc.js b/compiler/tests-js-parser/pass/2ef5ba0343d739dc.js new file mode 100644 index 000000000..6977bf4da --- /dev/null +++ b/compiler/tests-js-parser/pass/2ef5ba0343d739dc.js @@ -0,0 +1 @@ +let.let \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/2f6d8a2215407ae3.js b/compiler/tests-js-parser/pass/2f6d8a2215407ae3.js new file mode 100644 index 000000000..65d3afbdc --- /dev/null +++ b/compiler/tests-js-parser/pass/2f6d8a2215407ae3.js @@ -0,0 +1,4 @@ +function a() { + for (var b = 1, c = 2; b < 3; ++b) { + } +} diff --git a/compiler/tests-js-parser/pass/2f84859abd5a242c.js b/compiler/tests-js-parser/pass/2f84859abd5a242c.js new file mode 100644 index 000000000..df0e0e2b4 --- /dev/null +++ b/compiler/tests-js-parser/pass/2f84859abd5a242c.js @@ -0,0 +1,5 @@ +(function () { + do { + a(); + } while (false); +}()); diff --git a/compiler/tests-js-parser/pass/300a638d978d0f2c.js b/compiler/tests-js-parser/pass/300a638d978d0f2c.js new file mode 100644 index 000000000..d206225c9 --- /dev/null +++ b/compiler/tests-js-parser/pass/300a638d978d0f2c.js @@ -0,0 +1 @@ +T†= [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/30142c5b79e4eea9.js b/compiler/tests-js-parser/pass/30142c5b79e4eea9.js new file mode 100644 index 000000000..8d1eeb4ab --- /dev/null +++ b/compiler/tests-js-parser/pass/30142c5b79e4eea9.js @@ -0,0 +1,2 @@ +// line comment +1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3085290028dd33e1.js b/compiler/tests-js-parser/pass/3085290028dd33e1.js new file mode 100644 index 000000000..9176f2711 --- /dev/null +++ b/compiler/tests-js-parser/pass/3085290028dd33e1.js @@ -0,0 +1,6 @@ +function a(b, c) { + function d() { + e(); + } + return b + c; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3097f73926c93640.js b/compiler/tests-js-parser/pass/3097f73926c93640.js new file mode 100644 index 000000000..7619e9fc5 --- /dev/null +++ b/compiler/tests-js-parser/pass/3097f73926c93640.js @@ -0,0 +1 @@ +(function(){ return }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3098b57020860587.js b/compiler/tests-js-parser/pass/3098b57020860587.js new file mode 100644 index 000000000..f40bd765e --- /dev/null +++ b/compiler/tests-js-parser/pass/3098b57020860587.js @@ -0,0 +1,4 @@ +(function () { + var a = 1; // should not hoist to parameter + eval(''); +}()); diff --git a/compiler/tests-js-parser/pass/30aee1020fc69090.js b/compiler/tests-js-parser/pass/30aee1020fc69090.js new file mode 100644 index 000000000..9dd1dc90a --- /dev/null +++ b/compiler/tests-js-parser/pass/30aee1020fc69090.js @@ -0,0 +1 @@ +(class {set a(b) {'use strict';}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/30c2911c05100e92.js b/compiler/tests-js-parser/pass/30c2911c05100e92.js new file mode 100644 index 000000000..fc610e858 --- /dev/null +++ b/compiler/tests-js-parser/pass/30c2911c05100e92.js @@ -0,0 +1 @@ +// line comment \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/31232b72db0fd24f.js b/compiler/tests-js-parser/pass/31232b72db0fd24f.js new file mode 100644 index 000000000..3ba6e6b96 --- /dev/null +++ b/compiler/tests-js-parser/pass/31232b72db0fd24f.js @@ -0,0 +1,5 @@ +a( + b(c, c), + d(c, c), + e(c, c) +); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/31237b174ba6047a.js b/compiler/tests-js-parser/pass/31237b174ba6047a.js new file mode 100644 index 000000000..048fe9ab7 --- /dev/null +++ b/compiler/tests-js-parser/pass/31237b174ba6047a.js @@ -0,0 +1 @@ +ð€€ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/312f85fecc352681.js b/compiler/tests-js-parser/pass/312f85fecc352681.js new file mode 100644 index 000000000..61a4e4813 --- /dev/null +++ b/compiler/tests-js-parser/pass/312f85fecc352681.js @@ -0,0 +1 @@ +(function a() { b; c() }); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/315692af7fe2aad3.js b/compiler/tests-js-parser/pass/315692af7fe2aad3.js new file mode 100644 index 000000000..c00c566d6 --- /dev/null +++ b/compiler/tests-js-parser/pass/315692af7fe2aad3.js @@ -0,0 +1,4 @@ +var a = {}; +a.b = 1; +a.c = 2; +d.e(a.c); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3156a92ca5319b8b.js b/compiler/tests-js-parser/pass/3156a92ca5319b8b.js new file mode 100644 index 000000000..e538940ef --- /dev/null +++ b/compiler/tests-js-parser/pass/3156a92ca5319b8b.js @@ -0,0 +1,2 @@ +throw 'a'; +b(); diff --git a/compiler/tests-js-parser/pass/317532451c2ce8ff.js b/compiler/tests-js-parser/pass/317532451c2ce8ff.js new file mode 100644 index 000000000..7890dbc3f --- /dev/null +++ b/compiler/tests-js-parser/pass/317532451c2ce8ff.js @@ -0,0 +1 @@ +'use strict';var a = function(){}(b()) diff --git a/compiler/tests-js-parser/pass/318c169a25ee42c5.js b/compiler/tests-js-parser/pass/318c169a25ee42c5.js new file mode 100644 index 000000000..4ca2d6166 --- /dev/null +++ b/compiler/tests-js-parser/pass/318c169a25ee42c5.js @@ -0,0 +1 @@ +new a(....5); diff --git a/compiler/tests-js-parser/pass/31ad88cae27258b7.js b/compiler/tests-js-parser/pass/31ad88cae27258b7.js new file mode 100644 index 000000000..8f81232b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/31ad88cae27258b7.js @@ -0,0 +1 @@ +var a = /[\]/]/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/31cca30ad2bf696d.js b/compiler/tests-js-parser/pass/31cca30ad2bf696d.js new file mode 100644 index 000000000..8bb65af15 --- /dev/null +++ b/compiler/tests-js-parser/pass/31cca30ad2bf696d.js @@ -0,0 +1,4 @@ +(function () { + (function () { + }()); +}()); diff --git a/compiler/tests-js-parser/pass/323783be9a53a31e.js b/compiler/tests-js-parser/pass/323783be9a53a31e.js new file mode 100644 index 000000000..7d4defd63 --- /dev/null +++ b/compiler/tests-js-parser/pass/323783be9a53a31e.js @@ -0,0 +1 @@ +08 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/329bc0e532da6227.js b/compiler/tests-js-parser/pass/329bc0e532da6227.js new file mode 100644 index 000000000..ade6c4143 --- /dev/null +++ b/compiler/tests-js-parser/pass/329bc0e532da6227.js @@ -0,0 +1 @@ +```` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/32a9af0615bf7618.js b/compiler/tests-js-parser/pass/32a9af0615bf7618.js new file mode 100644 index 000000000..097cca50d --- /dev/null +++ b/compiler/tests-js-parser/pass/32a9af0615bf7618.js @@ -0,0 +1,6 @@ +(function () { + var a = 1; + with (b) { + a += a += 2; // 'i' lookup can be observed by obj's getter. + } +}()); diff --git a/compiler/tests-js-parser/pass/32b4780ad9c4292a.js b/compiler/tests-js-parser/pass/32b4780ad9c4292a.js new file mode 100644 index 000000000..632468b09 --- /dev/null +++ b/compiler/tests-js-parser/pass/32b4780ad9c4292a.js @@ -0,0 +1 @@ +a: 1; a: 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/32b635a9667a9fb1.js b/compiler/tests-js-parser/pass/32b635a9667a9fb1.js new file mode 100644 index 000000000..9bcf22119 --- /dev/null +++ b/compiler/tests-js-parser/pass/32b635a9667a9fb1.js @@ -0,0 +1 @@ +/* header */ (function(){ var a = 1; }).b(this) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/32b6854d07aefbda.js b/compiler/tests-js-parser/pass/32b6854d07aefbda.js new file mode 100644 index 000000000..e7c3f3794 --- /dev/null +++ b/compiler/tests-js-parser/pass/32b6854d07aefbda.js @@ -0,0 +1 @@ +0B0 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/32efa0efd255748a.js b/compiler/tests-js-parser/pass/32efa0efd255748a.js new file mode 100644 index 000000000..9fb190ec0 --- /dev/null +++ b/compiler/tests-js-parser/pass/32efa0efd255748a.js @@ -0,0 +1 @@ +class a { static *[b]() {} } diff --git a/compiler/tests-js-parser/pass/32f782a4b16306aa.js b/compiler/tests-js-parser/pass/32f782a4b16306aa.js new file mode 100644 index 000000000..2fce5fcd9 --- /dev/null +++ b/compiler/tests-js-parser/pass/32f782a4b16306aa.js @@ -0,0 +1 @@ +a << b << c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3315c524a740fe55.js b/compiler/tests-js-parser/pass/3315c524a740fe55.js new file mode 100644 index 000000000..0c08bcfa6 --- /dev/null +++ b/compiler/tests-js-parser/pass/3315c524a740fe55.js @@ -0,0 +1 @@ +('\\\'') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/332f0bc46d28db25.js b/compiler/tests-js-parser/pass/332f0bc46d28db25.js new file mode 100644 index 000000000..3b2f6cb14 --- /dev/null +++ b/compiler/tests-js-parser/pass/332f0bc46d28db25.js @@ -0,0 +1 @@ +({a}) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3348741c8bdd4f3c.js b/compiler/tests-js-parser/pass/3348741c8bdd4f3c.js new file mode 100644 index 000000000..8613e61ae --- /dev/null +++ b/compiler/tests-js-parser/pass/3348741c8bdd4f3c.js @@ -0,0 +1 @@ +for (const a of b) c(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/33720cee3dabde0d.js b/compiler/tests-js-parser/pass/33720cee3dabde0d.js new file mode 100644 index 000000000..943526e1d --- /dev/null +++ b/compiler/tests-js-parser/pass/33720cee3dabde0d.js @@ -0,0 +1 @@ +a || b && c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/338762eadb13a2f0.js b/compiler/tests-js-parser/pass/338762eadb13a2f0.js new file mode 100644 index 000000000..4e6743c0b --- /dev/null +++ b/compiler/tests-js-parser/pass/338762eadb13a2f0.js @@ -0,0 +1 @@ +a ^= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/341bc3f1b434f6d1.js b/compiler/tests-js-parser/pass/341bc3f1b434f6d1.js new file mode 100644 index 000000000..92f9187ed --- /dev/null +++ b/compiler/tests-js-parser/pass/341bc3f1b434f6d1.js @@ -0,0 +1 @@ +`````` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/345713fe7f52524a.js b/compiler/tests-js-parser/pass/345713fe7f52524a.js new file mode 100644 index 000000000..6e368715c --- /dev/null +++ b/compiler/tests-js-parser/pass/345713fe7f52524a.js @@ -0,0 +1 @@ +({a,b,} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/347e9a5443e4cd3c.js b/compiler/tests-js-parser/pass/347e9a5443e4cd3c.js new file mode 100644 index 000000000..3cb6900ed --- /dev/null +++ b/compiler/tests-js-parser/pass/347e9a5443e4cd3c.js @@ -0,0 +1 @@ +{ let a } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/34d5455824302935.js b/compiler/tests-js-parser/pass/34d5455824302935.js new file mode 100644 index 000000000..738e279dc --- /dev/null +++ b/compiler/tests-js-parser/pass/34d5455824302935.js @@ -0,0 +1 @@ +function *a() { yield* 1; } diff --git a/compiler/tests-js-parser/pass/350a7ec7041c079f.js b/compiler/tests-js-parser/pass/350a7ec7041c079f.js new file mode 100644 index 000000000..485ea78eb --- /dev/null +++ b/compiler/tests-js-parser/pass/350a7ec7041c079f.js @@ -0,0 +1 @@ +a = { set: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3514acf61732f662.js b/compiler/tests-js-parser/pass/3514acf61732f662.js new file mode 100644 index 000000000..aa2f0b269 --- /dev/null +++ b/compiler/tests-js-parser/pass/3514acf61732f662.js @@ -0,0 +1 @@ +09 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/35bf182594dc08ac.js b/compiler/tests-js-parser/pass/35bf182594dc08ac.js new file mode 100644 index 000000000..ef3e2ca34 --- /dev/null +++ b/compiler/tests-js-parser/pass/35bf182594dc08ac.js @@ -0,0 +1,3 @@ +function a(b, c, d, e, f) { + return b + c; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/35e730121a5e6326.js b/compiler/tests-js-parser/pass/35e730121a5e6326.js new file mode 100644 index 000000000..ecc45ff08 --- /dev/null +++ b/compiler/tests-js-parser/pass/35e730121a5e6326.js @@ -0,0 +1 @@ +for (;;) if (a()) b(); else break; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/35eb2e229858a6c7.js b/compiler/tests-js-parser/pass/35eb2e229858a6c7.js new file mode 100644 index 000000000..72f393a5b --- /dev/null +++ b/compiler/tests-js-parser/pass/35eb2e229858a6c7.js @@ -0,0 +1 @@ +a => "b" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3610e596404818d6.js b/compiler/tests-js-parser/pass/3610e596404818d6.js new file mode 100644 index 000000000..753e78791 --- /dev/null +++ b/compiler/tests-js-parser/pass/3610e596404818d6.js @@ -0,0 +1 @@ +with(1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/36224cf8215ad8e4.js b/compiler/tests-js-parser/pass/36224cf8215ad8e4.js new file mode 100644 index 000000000..a56b2d2d2 --- /dev/null +++ b/compiler/tests-js-parser/pass/36224cf8215ad8e4.js @@ -0,0 +1,2 @@ +(function (a, ...b){}); +(function (...c){}); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/366585381e4610b4.js b/compiler/tests-js-parser/pass/366585381e4610b4.js new file mode 100644 index 000000000..401dcba4b --- /dev/null +++ b/compiler/tests-js-parser/pass/366585381e4610b4.js @@ -0,0 +1 @@ +a+(b(), c(), d()) // do not transform because of global getter diff --git a/compiler/tests-js-parser/pass/369b56fe359d52fc.js b/compiler/tests-js-parser/pass/369b56fe359d52fc.js new file mode 100644 index 000000000..7144b03a2 --- /dev/null +++ b/compiler/tests-js-parser/pass/369b56fe359d52fc.js @@ -0,0 +1 @@ +a()`` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/369fd0a1e40030d8.js b/compiler/tests-js-parser/pass/369fd0a1e40030d8.js new file mode 100644 index 000000000..4571596b2 --- /dev/null +++ b/compiler/tests-js-parser/pass/369fd0a1e40030d8.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + return super[1] + } +} diff --git a/compiler/tests-js-parser/pass/36a9e7f1c95b82ff.js b/compiler/tests-js-parser/pass/36a9e7f1c95b82ff.js new file mode 100644 index 000000000..0519ecba6 --- /dev/null +++ b/compiler/tests-js-parser/pass/36a9e7f1c95b82ff.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/36fb3e9c8cedf764.js b/compiler/tests-js-parser/pass/36fb3e9c8cedf764.js new file mode 100644 index 000000000..d261dd73f --- /dev/null +++ b/compiler/tests-js-parser/pass/36fb3e9c8cedf764.js @@ -0,0 +1 @@ +class a {set(b) {};} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/36ff120198eea816.js b/compiler/tests-js-parser/pass/36ff120198eea816.js new file mode 100644 index 000000000..0b415b3ab --- /dev/null +++ b/compiler/tests-js-parser/pass/36ff120198eea816.js @@ -0,0 +1 @@ +var { yield: a } = b; diff --git a/compiler/tests-js-parser/pass/370a2bd1387fd440.js b/compiler/tests-js-parser/pass/370a2bd1387fd440.js new file mode 100644 index 000000000..984334761 --- /dev/null +++ b/compiler/tests-js-parser/pass/370a2bd1387fd440.js @@ -0,0 +1 @@ +for ({a, b} of c); diff --git a/compiler/tests-js-parser/pass/372097a44c33daf2.js b/compiler/tests-js-parser/pass/372097a44c33daf2.js new file mode 100644 index 000000000..78ded5484 --- /dev/null +++ b/compiler/tests-js-parser/pass/372097a44c33daf2.js @@ -0,0 +1 @@ +eval => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/373e35460ecaccc6.js b/compiler/tests-js-parser/pass/373e35460ecaccc6.js new file mode 100644 index 000000000..76ed586cf --- /dev/null +++ b/compiler/tests-js-parser/pass/373e35460ecaccc6.js @@ -0,0 +1 @@ +1.492417830e-10 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3793ec99f844de1c.js b/compiler/tests-js-parser/pass/3793ec99f844de1c.js new file mode 100644 index 000000000..e9668d38d --- /dev/null +++ b/compiler/tests-js-parser/pass/3793ec99f844de1c.js @@ -0,0 +1,4 @@ +'use strict'; +var a = { + 'b': 1 +}; diff --git a/compiler/tests-js-parser/pass/37ac3bcee6fa89f9.js b/compiler/tests-js-parser/pass/37ac3bcee6fa89f9.js new file mode 100644 index 000000000..43ed937ce --- /dev/null +++ b/compiler/tests-js-parser/pass/37ac3bcee6fa89f9.js @@ -0,0 +1 @@ +0b10 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/37c0f5275362d1c9.js b/compiler/tests-js-parser/pass/37c0f5275362d1c9.js new file mode 100644 index 000000000..3e24862db --- /dev/null +++ b/compiler/tests-js-parser/pass/37c0f5275362d1c9.js @@ -0,0 +1 @@ +"\u{00000000034}" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/37d26e3bec6d9a0f.js b/compiler/tests-js-parser/pass/37d26e3bec6d9a0f.js new file mode 100644 index 000000000..10f9b7fe9 --- /dev/null +++ b/compiler/tests-js-parser/pass/37d26e3bec6d9a0f.js @@ -0,0 +1,7 @@ +switch (a) { +default: + // do not optimize it + (function () { + b('c'); + }()); +} diff --git a/compiler/tests-js-parser/pass/37e4a6eca1ece7e5.js b/compiler/tests-js-parser/pass/37e4a6eca1ece7e5.js new file mode 100644 index 000000000..68f0200b5 --- /dev/null +++ b/compiler/tests-js-parser/pass/37e4a6eca1ece7e5.js @@ -0,0 +1 @@ +(function a([ b, c ]){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/37e845e0d8283fb3.js b/compiler/tests-js-parser/pass/37e845e0d8283fb3.js new file mode 100644 index 000000000..56cd1fa4f --- /dev/null +++ b/compiler/tests-js-parser/pass/37e845e0d8283fb3.js @@ -0,0 +1,3 @@ +(function () { + null!=(a?void 1:b) +}()); diff --git a/compiler/tests-js-parser/pass/380e999de8f31c7d.js b/compiler/tests-js-parser/pass/380e999de8f31c7d.js new file mode 100644 index 000000000..70f5d15d3 --- /dev/null +++ b/compiler/tests-js-parser/pass/380e999de8f31c7d.js @@ -0,0 +1 @@ +function a([ b, c ]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3812dc38bcdc97db.js b/compiler/tests-js-parser/pass/3812dc38bcdc97db.js new file mode 100644 index 000000000..2e072c653 --- /dev/null +++ b/compiler/tests-js-parser/pass/3812dc38bcdc97db.js @@ -0,0 +1,4 @@ +b: for (var a = 1; a < 2; ++a) { + if (a < 3) continue b; + c.d(a); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/38284ea2d9914d86.js b/compiler/tests-js-parser/pass/38284ea2d9914d86.js new file mode 100644 index 000000000..2ffcfa010 --- /dev/null +++ b/compiler/tests-js-parser/pass/38284ea2d9914d86.js @@ -0,0 +1 @@ +({ get a() { }, get a() { } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3852fb3ffb8fd8d5.js b/compiler/tests-js-parser/pass/3852fb3ffb8fd8d5.js new file mode 100644 index 000000000..f1eb90767 --- /dev/null +++ b/compiler/tests-js-parser/pass/3852fb3ffb8fd8d5.js @@ -0,0 +1 @@ +if (true) a(); else; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/38594572e7bb32f4.js b/compiler/tests-js-parser/pass/38594572e7bb32f4.js new file mode 100644 index 000000000..7e1da7c44 --- /dev/null +++ b/compiler/tests-js-parser/pass/38594572e7bb32f4.js @@ -0,0 +1,6 @@ +(function () { + function arguments() { + a(arguments); + } + a(arguments); +}()); diff --git a/compiler/tests-js-parser/pass/389adf81b76d8b25.js b/compiler/tests-js-parser/pass/389adf81b76d8b25.js new file mode 100644 index 000000000..945a93f9a --- /dev/null +++ b/compiler/tests-js-parser/pass/389adf81b76d8b25.js @@ -0,0 +1 @@ +T‿ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/38befc89fcf92e25.js b/compiler/tests-js-parser/pass/38befc89fcf92e25.js new file mode 100644 index 000000000..b65899bb8 --- /dev/null +++ b/compiler/tests-js-parser/pass/38befc89fcf92e25.js @@ -0,0 +1 @@ ++{} / 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/38c0e030050edb57.js b/compiler/tests-js-parser/pass/38c0e030050edb57.js new file mode 100644 index 000000000..596ccb4ff --- /dev/null +++ b/compiler/tests-js-parser/pass/38c0e030050edb57.js @@ -0,0 +1,3 @@ +(function () { + -1; +}()); diff --git a/compiler/tests-js-parser/pass/38e0b9de817f645c.js b/compiler/tests-js-parser/pass/38e0b9de817f645c.js new file mode 100644 index 000000000..19765bd50 --- /dev/null +++ b/compiler/tests-js-parser/pass/38e0b9de817f645c.js @@ -0,0 +1 @@ +null diff --git a/compiler/tests-js-parser/pass/38fefd37caf6f8bb.js b/compiler/tests-js-parser/pass/38fefd37caf6f8bb.js new file mode 100644 index 000000000..f3f806f05 --- /dev/null +++ b/compiler/tests-js-parser/pass/38fefd37caf6f8bb.js @@ -0,0 +1 @@ +a | b | c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3990bb94b19b1071.js b/compiler/tests-js-parser/pass/3990bb94b19b1071.js new file mode 100644 index 000000000..32a4537cd --- /dev/null +++ b/compiler/tests-js-parser/pass/3990bb94b19b1071.js @@ -0,0 +1 @@ +('\1') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/39bd53b0c3dcd639.js b/compiler/tests-js-parser/pass/39bd53b0c3dcd639.js new file mode 100644 index 000000000..d9573f9f3 --- /dev/null +++ b/compiler/tests-js-parser/pass/39bd53b0c3dcd639.js @@ -0,0 +1 @@ +let {a} = b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3a1ccd915e97ed68.js b/compiler/tests-js-parser/pass/3a1ccd915e97ed68.js new file mode 100644 index 000000000..32e79e39c --- /dev/null +++ b/compiler/tests-js-parser/pass/3a1ccd915e97ed68.js @@ -0,0 +1,2 @@ +// +1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3a1f039e533d1543.js b/compiler/tests-js-parser/pass/3a1f039e533d1543.js new file mode 100644 index 000000000..d7275810a --- /dev/null +++ b/compiler/tests-js-parser/pass/3a1f039e533d1543.js @@ -0,0 +1,2 @@ +'use strict'; +a.static(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3a50539d66e7fb07.js b/compiler/tests-js-parser/pass/3a50539d66e7fb07.js new file mode 100644 index 000000000..fb5f104b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/3a50539d66e7fb07.js @@ -0,0 +1,8 @@ +{ + var a = 1; + b(); + { + b(); + b(); + } +} diff --git a/compiler/tests-js-parser/pass/3a5a7699f0631c6f.js b/compiler/tests-js-parser/pass/3a5a7699f0631c6f.js new file mode 100644 index 000000000..de266ed54 --- /dev/null +++ b/compiler/tests-js-parser/pass/3a5a7699f0631c6f.js @@ -0,0 +1,2 @@ +with({}) { +}; diff --git a/compiler/tests-js-parser/pass/3a707c56867f396c.js b/compiler/tests-js-parser/pass/3a707c56867f396c.js new file mode 100644 index 000000000..7cf7bc792 --- /dev/null +++ b/compiler/tests-js-parser/pass/3a707c56867f396c.js @@ -0,0 +1,7 @@ +d: while (a) { + b(); + c(); + break d; + e(); + f(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3aa600e48cbd8a5c.js b/compiler/tests-js-parser/pass/3aa600e48cbd8a5c.js new file mode 100644 index 000000000..c0db50251 --- /dev/null +++ b/compiler/tests-js-parser/pass/3aa600e48cbd8a5c.js @@ -0,0 +1 @@ +class a {static [b](){};} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3ae4f46daa688c58.js b/compiler/tests-js-parser/pass/3ae4f46daa688c58.js new file mode 100644 index 000000000..2c8bf2820 --- /dev/null +++ b/compiler/tests-js-parser/pass/3ae4f46daa688c58.js @@ -0,0 +1 @@ +'use strict'; ('\0') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3b1ab093f7ebeb51.module.js b/compiler/tests-js-parser/pass/3b1ab093f7ebeb51.module.js new file mode 100644 index 000000000..f41639e85 --- /dev/null +++ b/compiler/tests-js-parser/pass/3b1ab093f7ebeb51.module.js @@ -0,0 +1 @@ +export var a; diff --git a/compiler/tests-js-parser/pass/3b1fca65828182ab.js b/compiler/tests-js-parser/pass/3b1fca65828182ab.js new file mode 100644 index 000000000..fbd9d090a --- /dev/null +++ b/compiler/tests-js-parser/pass/3b1fca65828182ab.js @@ -0,0 +1 @@ +/(?=.)*/; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3b36d546985cd9cb.js b/compiler/tests-js-parser/pass/3b36d546985cd9cb.js new file mode 100644 index 000000000..7e5e4d198 --- /dev/null +++ b/compiler/tests-js-parser/pass/3b36d546985cd9cb.js @@ -0,0 +1,2 @@ +"Hello\ +world" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3b57183c81070eec.js b/compiler/tests-js-parser/pass/3b57183c81070eec.js new file mode 100644 index 000000000..6fc7f28a1 --- /dev/null +++ b/compiler/tests-js-parser/pass/3b57183c81070eec.js @@ -0,0 +1 @@ +a = { set null(b) { c = b } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3b5d1fb0e093dab8.js b/compiler/tests-js-parser/pass/3b5d1fb0e093dab8.js new file mode 100644 index 000000000..d372e4de0 --- /dev/null +++ b/compiler/tests-js-parser/pass/3b5d1fb0e093dab8.js @@ -0,0 +1 @@ +(a) => ((b, c) => (a, b, c)) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3b9779d2e19376a1.js b/compiler/tests-js-parser/pass/3b9779d2e19376a1.js new file mode 100644 index 000000000..82220cf45 --- /dev/null +++ b/compiler/tests-js-parser/pass/3b9779d2e19376a1.js @@ -0,0 +1 @@ +0o2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3b9e8797aacce77f.js b/compiler/tests-js-parser/pass/3b9e8797aacce77f.js new file mode 100644 index 000000000..2a8870bac --- /dev/null +++ b/compiler/tests-js-parser/pass/3b9e8797aacce77f.js @@ -0,0 +1,2 @@ +1 +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3bac973df7480fe9.js b/compiler/tests-js-parser/pass/3bac973df7480fe9.js new file mode 100644 index 000000000..42a763649 --- /dev/null +++ b/compiler/tests-js-parser/pass/3bac973df7480fe9.js @@ -0,0 +1 @@ +(class {3() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3bbd75d597d54fe6.js b/compiler/tests-js-parser/pass/3bbd75d597d54fe6.js new file mode 100644 index 000000000..d8d03fa6d --- /dev/null +++ b/compiler/tests-js-parser/pass/3bbd75d597d54fe6.js @@ -0,0 +1 @@ +(function yield(){}) diff --git a/compiler/tests-js-parser/pass/3bc21b350f65c8f2.js b/compiler/tests-js-parser/pass/3bc21b350f65c8f2.js new file mode 100644 index 000000000..0c23999ed --- /dev/null +++ b/compiler/tests-js-parser/pass/3bc21b350f65c8f2.js @@ -0,0 +1 @@ +if (a) { b() /* Some comment */ } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3c0c251ad455218d.js b/compiler/tests-js-parser/pass/3c0c251ad455218d.js new file mode 100644 index 000000000..912d1e323 --- /dev/null +++ b/compiler/tests-js-parser/pass/3c0c251ad455218d.js @@ -0,0 +1,2 @@ +do a() +;while (true) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3c1e2ada0ac2b8e3.js b/compiler/tests-js-parser/pass/3c1e2ada0ac2b8e3.js new file mode 100644 index 000000000..a3778aa06 --- /dev/null +++ b/compiler/tests-js-parser/pass/3c1e2ada0ac2b8e3.js @@ -0,0 +1 @@ +(function*(a, b, c) { yield* a; }) diff --git a/compiler/tests-js-parser/pass/3c6b557b1aa9cc05.js b/compiler/tests-js-parser/pass/3c6b557b1aa9cc05.js new file mode 100644 index 000000000..5fdd8b1c5 --- /dev/null +++ b/compiler/tests-js-parser/pass/3c6b557b1aa9cc05.js @@ -0,0 +1,4 @@ +for (var a = 1; a < 2; ++a) { + if (a < 3) continue; + b.c(a); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3c895971bd50ea01.js b/compiler/tests-js-parser/pass/3c895971bd50ea01.js new file mode 100644 index 000000000..c2c83ebc8 --- /dev/null +++ b/compiler/tests-js-parser/pass/3c895971bd50ea01.js @@ -0,0 +1 @@ +for({a=1} in b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3caf07d66e4f7b5a.js b/compiler/tests-js-parser/pass/3caf07d66e4f7b5a.js new file mode 100644 index 000000000..7bcd89c7c --- /dev/null +++ b/compiler/tests-js-parser/pass/3caf07d66e4f7b5a.js @@ -0,0 +1 @@ +({ __proto__() { return 1 }, __proto__: 2 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3cbf0138d2dc0686.js b/compiler/tests-js-parser/pass/3cbf0138d2dc0686.js new file mode 100644 index 000000000..bfa875305 --- /dev/null +++ b/compiler/tests-js-parser/pass/3cbf0138d2dc0686.js @@ -0,0 +1,8 @@ +(function() { + // https://github.com/Constellation/esmangle/issues/65 + var a = 1; + var b = 2; + var c = 3; + var d = [].e.f(arguments); + return [a, b, c, g]; +}()); diff --git a/compiler/tests-js-parser/pass/3cf11f8790169c3f.js b/compiler/tests-js-parser/pass/3cf11f8790169c3f.js new file mode 100644 index 000000000..acd006279 --- /dev/null +++ b/compiler/tests-js-parser/pass/3cf11f8790169c3f.js @@ -0,0 +1 @@ +a !== b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3cf53efb53099596.js b/compiler/tests-js-parser/pass/3cf53efb53099596.js new file mode 100644 index 000000000..b6a86d2e2 --- /dev/null +++ b/compiler/tests-js-parser/pass/3cf53efb53099596.js @@ -0,0 +1,6 @@ +for (;a();) { + if (b()) c(); + else break; + d(); + e(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3d0c4eda96e0412b.js b/compiler/tests-js-parser/pass/3d0c4eda96e0412b.js new file mode 100644 index 000000000..0b02b73e3 --- /dev/null +++ b/compiler/tests-js-parser/pass/3d0c4eda96e0412b.js @@ -0,0 +1 @@ +a ^ b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3d137e7b0cb6c8bc.js b/compiler/tests-js-parser/pass/3d137e7b0cb6c8bc.js new file mode 100644 index 000000000..c5bc8e845 --- /dev/null +++ b/compiler/tests-js-parser/pass/3d137e7b0cb6c8bc.js @@ -0,0 +1,9 @@ +(function() { + if (a) { + b(); + } else { + return 1; + c(); + } + return 2; +}()); diff --git a/compiler/tests-js-parser/pass/3d2ab39608730a47.js b/compiler/tests-js-parser/pass/3d2ab39608730a47.js new file mode 100644 index 000000000..1cbaa9ff7 --- /dev/null +++ b/compiler/tests-js-parser/pass/3d2ab39608730a47.js @@ -0,0 +1 @@ +'use strict'; ('\0x') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3d3ddc63a85b13a0.js b/compiler/tests-js-parser/pass/3d3ddc63a85b13a0.js new file mode 100644 index 000000000..e5c168337 --- /dev/null +++ b/compiler/tests-js-parser/pass/3d3ddc63a85b13a0.js @@ -0,0 +1 @@ +let {a,} = 1 diff --git a/compiler/tests-js-parser/pass/3d9c76216b0a9d4b.js b/compiler/tests-js-parser/pass/3d9c76216b0a9d4b.js new file mode 100644 index 000000000..6cc689e75 --- /dev/null +++ b/compiler/tests-js-parser/pass/3d9c76216b0a9d4b.js @@ -0,0 +1 @@ +for(a; a < 1; a++) b(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3dabeca76119d501.js b/compiler/tests-js-parser/pass/3dabeca76119d501.js new file mode 100644 index 000000000..7366f21d1 --- /dev/null +++ b/compiler/tests-js-parser/pass/3dabeca76119d501.js @@ -0,0 +1 @@ +try {} catch (a) { if(1) function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3df03e7e138b7760.js b/compiler/tests-js-parser/pass/3df03e7e138b7760.js new file mode 100644 index 000000000..0e95aa465 --- /dev/null +++ b/compiler/tests-js-parser/pass/3df03e7e138b7760.js @@ -0,0 +1 @@ +function a() { new["b"]; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3e1a6f702041b599.js b/compiler/tests-js-parser/pass/3e1a6f702041b599.js new file mode 100644 index 000000000..f3d38dfea --- /dev/null +++ b/compiler/tests-js-parser/pass/3e1a6f702041b599.js @@ -0,0 +1 @@ +b: while (1) { continue /*
*/ a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3e3a99768a4a1502.js b/compiler/tests-js-parser/pass/3e3a99768a4a1502.js new file mode 100644 index 000000000..3aa272464 --- /dev/null +++ b/compiler/tests-js-parser/pass/3e3a99768a4a1502.js @@ -0,0 +1 @@ +a => ({ b: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3e48826018d23c85.js b/compiler/tests-js-parser/pass/3e48826018d23c85.js new file mode 100644 index 000000000..3fa72134c --- /dev/null +++ b/compiler/tests-js-parser/pass/3e48826018d23c85.js @@ -0,0 +1 @@ +('\5a') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3e665d875e0049a3.js b/compiler/tests-js-parser/pass/3e665d875e0049a3.js new file mode 100644 index 000000000..50a93eb4a --- /dev/null +++ b/compiler/tests-js-parser/pass/3e665d875e0049a3.js @@ -0,0 +1 @@ +function a() { b(); } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3e69c5cc1a7ac103.js b/compiler/tests-js-parser/pass/3e69c5cc1a7ac103.js new file mode 100644 index 000000000..98ea45f6a --- /dev/null +++ b/compiler/tests-js-parser/pass/3e69c5cc1a7ac103.js @@ -0,0 +1 @@ +try {} catch ([a, ...b]) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3ea15e86885d3c1a.js b/compiler/tests-js-parser/pass/3ea15e86885d3c1a.js new file mode 100644 index 000000000..6b2b191b8 --- /dev/null +++ b/compiler/tests-js-parser/pass/3ea15e86885d3c1a.js @@ -0,0 +1,2 @@ +// ContinueStatement should not be removed. +a: while (true) while (true) continue a; diff --git a/compiler/tests-js-parser/pass/3eac36e29398cdc5.js b/compiler/tests-js-parser/pass/3eac36e29398cdc5.js new file mode 100644 index 000000000..7bb61f5d1 --- /dev/null +++ b/compiler/tests-js-parser/pass/3eac36e29398cdc5.js @@ -0,0 +1 @@ +try {} catch ([a]) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3eb2c2bf585c0916.js b/compiler/tests-js-parser/pass/3eb2c2bf585c0916.js new file mode 100644 index 000000000..5b2d42e5f --- /dev/null +++ b/compiler/tests-js-parser/pass/3eb2c2bf585c0916.js @@ -0,0 +1 @@ +void ('a' + 'a') diff --git a/compiler/tests-js-parser/pass/3ec1e9982b5f4a45.js b/compiler/tests-js-parser/pass/3ec1e9982b5f4a45.js new file mode 100644 index 000000000..df68a9b3e --- /dev/null +++ b/compiler/tests-js-parser/pass/3ec1e9982b5f4a45.js @@ -0,0 +1 @@ +a && b ? 1 : 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3ee117e37bd3bcea.js b/compiler/tests-js-parser/pass/3ee117e37bd3bcea.js new file mode 100644 index 000000000..7540a1315 --- /dev/null +++ b/compiler/tests-js-parser/pass/3ee117e37bd3bcea.js @@ -0,0 +1 @@ +1e100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/compiler/tests-js-parser/pass/3f34ca3add7bcb9b.js b/compiler/tests-js-parser/pass/3f34ca3add7bcb9b.js new file mode 100644 index 000000000..433ba71cf --- /dev/null +++ b/compiler/tests-js-parser/pass/3f34ca3add7bcb9b.js @@ -0,0 +1 @@ +let [{a}] = 1 diff --git a/compiler/tests-js-parser/pass/3f39e406df3080dc.js b/compiler/tests-js-parser/pass/3f39e406df3080dc.js new file mode 100644 index 000000000..d268fdb8b --- /dev/null +++ b/compiler/tests-js-parser/pass/3f39e406df3080dc.js @@ -0,0 +1 @@ +a(...b, c, d); diff --git a/compiler/tests-js-parser/pass/3f44c09167d5753d.js b/compiler/tests-js-parser/pass/3f44c09167d5753d.js new file mode 100644 index 000000000..5349d5bcf --- /dev/null +++ b/compiler/tests-js-parser/pass/3f44c09167d5753d.js @@ -0,0 +1 @@ +let â„® diff --git a/compiler/tests-js-parser/pass/3f46ee1db509d55d.js b/compiler/tests-js-parser/pass/3f46ee1db509d55d.js new file mode 100644 index 000000000..0c0aff1ee --- /dev/null +++ b/compiler/tests-js-parser/pass/3f46ee1db509d55d.js @@ -0,0 +1 @@ +(1, a['a'])() diff --git a/compiler/tests-js-parser/pass/3f6fd744861ee7c3.js b/compiler/tests-js-parser/pass/3f6fd744861ee7c3.js new file mode 100644 index 000000000..8b1113a52 --- /dev/null +++ b/compiler/tests-js-parser/pass/3f6fd744861ee7c3.js @@ -0,0 +1 @@ +arguments-- \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3f8b15109761ea65.js b/compiler/tests-js-parser/pass/3f8b15109761ea65.js new file mode 100644 index 000000000..202385164 --- /dev/null +++ b/compiler/tests-js-parser/pass/3f8b15109761ea65.js @@ -0,0 +1 @@ +var a = /[a-z]/u \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3f9b0dd207c09990.js b/compiler/tests-js-parser/pass/3f9b0dd207c09990.js new file mode 100644 index 000000000..98b43cc58 --- /dev/null +++ b/compiler/tests-js-parser/pass/3f9b0dd207c09990.js @@ -0,0 +1,5 @@ +switch (1+2) { + case 3: a(); break; + case 4+5: b(); break; + case 6+7+8: c(); break; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3fb07536eb5aea8d.js b/compiler/tests-js-parser/pass/3fb07536eb5aea8d.js new file mode 100644 index 000000000..271e2deda --- /dev/null +++ b/compiler/tests-js-parser/pass/3fb07536eb5aea8d.js @@ -0,0 +1 @@ +"Hello\412World" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/3ff52d86c77678bd.js b/compiler/tests-js-parser/pass/3ff52d86c77678bd.js new file mode 100644 index 000000000..8f19ee6f5 --- /dev/null +++ b/compiler/tests-js-parser/pass/3ff52d86c77678bd.js @@ -0,0 +1 @@ +(function(...a){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/4014ec6c7931de54.js b/compiler/tests-js-parser/pass/4014ec6c7931de54.js new file mode 100644 index 000000000..5dce968dd --- /dev/null +++ b/compiler/tests-js-parser/pass/4014ec6c7931de54.js @@ -0,0 +1 @@ +a = { "b": 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/401544b8abe9d656.js b/compiler/tests-js-parser/pass/401544b8abe9d656.js new file mode 100644 index 000000000..1b8186406 --- /dev/null +++ b/compiler/tests-js-parser/pass/401544b8abe9d656.js @@ -0,0 +1 @@ +var [{ a, b }, ...c] = d \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/40215319424a8227.js b/compiler/tests-js-parser/pass/40215319424a8227.js new file mode 100644 index 000000000..759aee12f --- /dev/null +++ b/compiler/tests-js-parser/pass/40215319424a8227.js @@ -0,0 +1 @@ +a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/4f60d8fbb4be1120.js b/compiler/tests-js-parser/pass/4f60d8fbb4be1120.js new file mode 100644 index 000000000..21c113180 --- /dev/null +++ b/compiler/tests-js-parser/pass/4f60d8fbb4be1120.js @@ -0,0 +1 @@ +09.0 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/4f731d62a74ab666.js b/compiler/tests-js-parser/pass/4f731d62a74ab666.js new file mode 100644 index 000000000..500c98c12 --- /dev/null +++ b/compiler/tests-js-parser/pass/4f731d62a74ab666.js @@ -0,0 +1 @@ +(let[a]=b) diff --git a/compiler/tests-js-parser/pass/4f805a43cc2e8854.js b/compiler/tests-js-parser/pass/4f805a43cc2e8854.js new file mode 100644 index 000000000..580f3bdc0 --- /dev/null +++ b/compiler/tests-js-parser/pass/4f805a43cc2e8854.js @@ -0,0 +1 @@ +/[x-z]/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/4fa08a62c2d8c495.js b/compiler/tests-js-parser/pass/4fa08a62c2d8c495.js new file mode 100644 index 000000000..c09b261ca --- /dev/null +++ b/compiler/tests-js-parser/pass/4fa08a62c2d8c495.js @@ -0,0 +1 @@ +(a = b('100')) == a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/4fa4f9e47503bc5f.js b/compiler/tests-js-parser/pass/4fa4f9e47503bc5f.js new file mode 100644 index 000000000..05699ce25 --- /dev/null +++ b/compiler/tests-js-parser/pass/4fa4f9e47503bc5f.js @@ -0,0 +1 @@ +var a = 1, b = 2, c = 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/4fdc22a42fa0d040.js b/compiler/tests-js-parser/pass/4fdc22a42fa0d040.js new file mode 100644 index 000000000..dc89d0265 --- /dev/null +++ b/compiler/tests-js-parser/pass/4fdc22a42fa0d040.js @@ -0,0 +1 @@ +a - b + c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/4fee4ac53bdfd7f7.js b/compiler/tests-js-parser/pass/4fee4ac53bdfd7f7.js new file mode 100644 index 000000000..8e8574da0 --- /dev/null +++ b/compiler/tests-js-parser/pass/4fee4ac53bdfd7f7.js @@ -0,0 +1 @@ +"Hello\0World" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/500804fd29695dac.js b/compiler/tests-js-parser/pass/500804fd29695dac.js new file mode 100644 index 000000000..64239bc1d --- /dev/null +++ b/compiler/tests-js-parser/pass/500804fd29695dac.js @@ -0,0 +1 @@ +0X1A \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5021396f85a70480.js b/compiler/tests-js-parser/pass/5021396f85a70480.js new file mode 100644 index 000000000..8efc815eb --- /dev/null +++ b/compiler/tests-js-parser/pass/5021396f85a70480.js @@ -0,0 +1 @@ +switch(a){case 1:} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/503cf49b200abf64.js b/compiler/tests-js-parser/pass/503cf49b200abf64.js new file mode 100644 index 000000000..89160f71f --- /dev/null +++ b/compiler/tests-js-parser/pass/503cf49b200abf64.js @@ -0,0 +1,2 @@ +(1) +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/50ac15a08f7c812f.js b/compiler/tests-js-parser/pass/50ac15a08f7c812f.js new file mode 100644 index 000000000..99829d3ad --- /dev/null +++ b/compiler/tests-js-parser/pass/50ac15a08f7c812f.js @@ -0,0 +1 @@ +({get __proto__() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/50bc1f24c865c57a.js b/compiler/tests-js-parser/pass/50bc1f24c865c57a.js new file mode 100644 index 000000000..8c4d7f7db --- /dev/null +++ b/compiler/tests-js-parser/pass/50bc1f24c865c57a.js @@ -0,0 +1 @@ +a(b,c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/50c6ab935ccb020a.module.js b/compiler/tests-js-parser/pass/50c6ab935ccb020a.module.js new file mode 100644 index 000000000..82dc667be --- /dev/null +++ b/compiler/tests-js-parser/pass/50c6ab935ccb020a.module.js @@ -0,0 +1 @@ +export default (class{}); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/50cea0e25b2b707d.js b/compiler/tests-js-parser/pass/50cea0e25b2b707d.js new file mode 100644 index 000000000..6e3779329 --- /dev/null +++ b/compiler/tests-js-parser/pass/50cea0e25b2b707d.js @@ -0,0 +1,4 @@ +function a(b, c) { + var d = 1, e = f, f = d + e, g = h(); + return b + c; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/50e04108598730ff.js b/compiler/tests-js-parser/pass/50e04108598730ff.js new file mode 100644 index 000000000..a38b71391 --- /dev/null +++ b/compiler/tests-js-parser/pass/50e04108598730ff.js @@ -0,0 +1 @@ +({a = 1,} = 2) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/511a2a5fd8cac64d.js b/compiler/tests-js-parser/pass/511a2a5fd8cac64d.js new file mode 100644 index 000000000..1d4874810 --- /dev/null +++ b/compiler/tests-js-parser/pass/511a2a5fd8cac64d.js @@ -0,0 +1,9 @@ +d: { + // this 'test2' to 'a' + b: { + if (a) break b; + if (a) break b; + if (a) break b; + } + if (c) break d; +} diff --git a/compiler/tests-js-parser/pass/513275ce0e3c7ef3.js b/compiler/tests-js-parser/pass/513275ce0e3c7ef3.js new file mode 100644 index 000000000..3e90d1b7b --- /dev/null +++ b/compiler/tests-js-parser/pass/513275ce0e3c7ef3.js @@ -0,0 +1,5 @@ +'use strict'; +var a = { + 'arguments': 1, + 'eval': 2 +}; diff --git a/compiler/tests-js-parser/pass/5147bda197f961c1.js b/compiler/tests-js-parser/pass/5147bda197f961c1.js new file mode 100644 index 000000000..4a8af709f --- /dev/null +++ b/compiler/tests-js-parser/pass/5147bda197f961c1.js @@ -0,0 +1 @@ +({["a"+1]:"b"}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/515825915b8d1cd8.js b/compiler/tests-js-parser/pass/515825915b8d1cd8.js new file mode 100644 index 000000000..2597fa96d --- /dev/null +++ b/compiler/tests-js-parser/pass/515825915b8d1cd8.js @@ -0,0 +1,7 @@ +while (a) { + try { } catch (b) { } + // do not optimize it + (function () { + c('d'); + }()); +} diff --git a/compiler/tests-js-parser/pass/5171e99c2d9d3e5a.js b/compiler/tests-js-parser/pass/5171e99c2d9d3e5a.js new file mode 100644 index 000000000..4139569ea --- /dev/null +++ b/compiler/tests-js-parser/pass/5171e99c2d9d3e5a.js @@ -0,0 +1,6 @@ +// Do not remove first if consequent block +if (a) { + if (b) { true; } +} else { + false; +} diff --git a/compiler/tests-js-parser/pass/5183eafe6b4cd6e0.js b/compiler/tests-js-parser/pass/5183eafe6b4cd6e0.js new file mode 100644 index 000000000..9169d8638 --- /dev/null +++ b/compiler/tests-js-parser/pass/5183eafe6b4cd6e0.js @@ -0,0 +1 @@ +for(var a;b;c); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/51a3505b43223a9f.js b/compiler/tests-js-parser/pass/51a3505b43223a9f.js new file mode 100644 index 000000000..824138f00 --- /dev/null +++ b/compiler/tests-js-parser/pass/51a3505b43223a9f.js @@ -0,0 +1,3 @@ +if (a) { +} else { +} diff --git a/compiler/tests-js-parser/pass/51b243bb5076b692.js b/compiler/tests-js-parser/pass/51b243bb5076b692.js new file mode 100644 index 000000000..37d099e84 --- /dev/null +++ b/compiler/tests-js-parser/pass/51b243bb5076b692.js @@ -0,0 +1 @@ +(...a) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/51b58dc84e1fab89.js b/compiler/tests-js-parser/pass/51b58dc84e1fab89.js new file mode 100644 index 000000000..0c023f510 --- /dev/null +++ b/compiler/tests-js-parser/pass/51b58dc84e1fab89.js @@ -0,0 +1 @@ +0X04 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/51ea4e18429c02e4.js b/compiler/tests-js-parser/pass/51ea4e18429c02e4.js new file mode 100644 index 000000000..f8ec0c665 --- /dev/null +++ b/compiler/tests-js-parser/pass/51ea4e18429c02e4.js @@ -0,0 +1 @@ +if (a) var b = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/51fd2b53ad7e1581.js b/compiler/tests-js-parser/pass/51fd2b53ad7e1581.js new file mode 100644 index 000000000..72f26c53f --- /dev/null +++ b/compiler/tests-js-parser/pass/51fd2b53ad7e1581.js @@ -0,0 +1 @@ +class a {b(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5203633f36fbe544.js b/compiler/tests-js-parser/pass/5203633f36fbe544.js new file mode 100644 index 000000000..e8b61bed8 --- /dev/null +++ b/compiler/tests-js-parser/pass/5203633f36fbe544.js @@ -0,0 +1 @@ +"use strict"; var { yield: a } = b; diff --git a/compiler/tests-js-parser/pass/5212ddf4e4b70261.js b/compiler/tests-js-parser/pass/5212ddf4e4b70261.js new file mode 100644 index 000000000..18dac8c2c --- /dev/null +++ b/compiler/tests-js-parser/pass/5212ddf4e4b70261.js @@ -0,0 +1 @@ +a = b; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/521479b987ae2d7f.js b/compiler/tests-js-parser/pass/521479b987ae2d7f.js new file mode 100644 index 000000000..f524d5da1 --- /dev/null +++ b/compiler/tests-js-parser/pass/521479b987ae2d7f.js @@ -0,0 +1,10 @@ +while (a) { + if (b) { + switch (true) { + case c(): + d(); + } + continue; + } + e(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/521b6dfff0a28aa1.js b/compiler/tests-js-parser/pass/521b6dfff0a28aa1.js new file mode 100644 index 000000000..353c5ec31 --- /dev/null +++ b/compiler/tests-js-parser/pass/521b6dfff0a28aa1.js @@ -0,0 +1 @@ +function a([a=1]) {} diff --git a/compiler/tests-js-parser/pass/523950fa023d7305.js b/compiler/tests-js-parser/pass/523950fa023d7305.js new file mode 100644 index 000000000..d417d304a --- /dev/null +++ b/compiler/tests-js-parser/pass/523950fa023d7305.js @@ -0,0 +1 @@ +{ let a = 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5239dd0fc0effb71.js b/compiler/tests-js-parser/pass/5239dd0fc0effb71.js new file mode 100644 index 000000000..de8971988 --- /dev/null +++ b/compiler/tests-js-parser/pass/5239dd0fc0effb71.js @@ -0,0 +1,7 @@ +// DO NOT DROP i +function a() { + var b; + with (c) { + b; + } +} diff --git a/compiler/tests-js-parser/pass/524172bf792ef97e.js b/compiler/tests-js-parser/pass/524172bf792ef97e.js new file mode 100644 index 000000000..8264c8ad1 --- /dev/null +++ b/compiler/tests-js-parser/pass/524172bf792ef97e.js @@ -0,0 +1 @@ +for(a of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/52aeec7b8da212a2.js b/compiler/tests-js-parser/pass/52aeec7b8da212a2.js new file mode 100644 index 000000000..7a7a446a6 --- /dev/null +++ b/compiler/tests-js-parser/pass/52aeec7b8da212a2.js @@ -0,0 +1 @@ +if (1) function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/52ce5853ea953f0f.js b/compiler/tests-js-parser/pass/52ce5853ea953f0f.js new file mode 100644 index 000000000..7d4e0b617 --- /dev/null +++ b/compiler/tests-js-parser/pass/52ce5853ea953f0f.js @@ -0,0 +1 @@ ++{} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/52f2f30356750b9b.js b/compiler/tests-js-parser/pass/52f2f30356750b9b.js new file mode 100644 index 000000000..d72051a69 --- /dev/null +++ b/compiler/tests-js-parser/pass/52f2f30356750b9b.js @@ -0,0 +1 @@ +var a = /[P QR]/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/52f9245e7cd97f6a.js b/compiler/tests-js-parser/pass/52f9245e7cd97f6a.js new file mode 100644 index 000000000..d7ee26fa7 --- /dev/null +++ b/compiler/tests-js-parser/pass/52f9245e7cd97f6a.js @@ -0,0 +1 @@ +a: break a; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5317b960ad78bbfe.js b/compiler/tests-js-parser/pass/5317b960ad78bbfe.js new file mode 100644 index 000000000..15b5f5080 --- /dev/null +++ b/compiler/tests-js-parser/pass/5317b960ad78bbfe.js @@ -0,0 +1,10 @@ +function a(b, c) { + // circular reference + function d() { + return e(); + } + function e() { + return d(); + } + return b + c; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5333f04581124314.js b/compiler/tests-js-parser/pass/5333f04581124314.js new file mode 100644 index 000000000..94e2cbd75 --- /dev/null +++ b/compiler/tests-js-parser/pass/5333f04581124314.js @@ -0,0 +1,14 @@ +// Do not generate like this +// if(cond)with(cond2)if(cond3)debugger;else ok(); +// +// +// See https://github.com/Constellation/escodegen/issues/49 +if (a) { + with (b) { + if (c) { + debugger; + } + } +} else { + d(); +} diff --git a/compiler/tests-js-parser/pass/53645d3765e5f67f.js b/compiler/tests-js-parser/pass/53645d3765e5f67f.js new file mode 100644 index 000000000..4349cee39 --- /dev/null +++ b/compiler/tests-js-parser/pass/53645d3765e5f67f.js @@ -0,0 +1,4 @@ +(function() { + if (a) return b; + return c; +}()); diff --git a/compiler/tests-js-parser/pass/54032532b8655caf.js b/compiler/tests-js-parser/pass/54032532b8655caf.js new file mode 100644 index 000000000..454dd3551 --- /dev/null +++ b/compiler/tests-js-parser/pass/54032532b8655caf.js @@ -0,0 +1 @@ +({a: b,} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5406bea2982a6e13.module.js b/compiler/tests-js-parser/pass/5406bea2982a6e13.module.js new file mode 100644 index 000000000..c0748305d --- /dev/null +++ b/compiler/tests-js-parser/pass/5406bea2982a6e13.module.js @@ -0,0 +1 @@ +import "foo"; diff --git a/compiler/tests-js-parser/pass/54190cc5a11a0233.js b/compiler/tests-js-parser/pass/54190cc5a11a0233.js new file mode 100644 index 000000000..664105dc8 --- /dev/null +++ b/compiler/tests-js-parser/pass/54190cc5a11a0233.js @@ -0,0 +1,3 @@ +(function () { + ((a) ? 1 : 2) != null; +}()); diff --git a/compiler/tests-js-parser/pass/541ee533b54ae664.js b/compiler/tests-js-parser/pass/541ee533b54ae664.js new file mode 100644 index 000000000..330d56626 --- /dev/null +++ b/compiler/tests-js-parser/pass/541ee533b54ae664.js @@ -0,0 +1 @@ +function a(__proto__) { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/54257d53a8fffe8c.js b/compiler/tests-js-parser/pass/54257d53a8fffe8c.js new file mode 100644 index 000000000..c3f4017f1 --- /dev/null +++ b/compiler/tests-js-parser/pass/54257d53a8fffe8c.js @@ -0,0 +1 @@ +class a extends b { c() { [super.d] = e } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/547fa50af16beca7.js b/compiler/tests-js-parser/pass/547fa50af16beca7.js new file mode 100644 index 000000000..4c9adb961 --- /dev/null +++ b/compiler/tests-js-parser/pass/547fa50af16beca7.js @@ -0,0 +1 @@ +let [a,,b]=1 diff --git a/compiler/tests-js-parser/pass/5495e25325fdd364.js b/compiler/tests-js-parser/pass/5495e25325fdd364.js new file mode 100644 index 000000000..4008e692f --- /dev/null +++ b/compiler/tests-js-parser/pass/5495e25325fdd364.js @@ -0,0 +1 @@ +function a(b = c) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/54e70df597a4f9a3.js b/compiler/tests-js-parser/pass/54e70df597a4f9a3.js new file mode 100644 index 000000000..9f28761f4 --- /dev/null +++ b/compiler/tests-js-parser/pass/54e70df597a4f9a3.js @@ -0,0 +1 @@ +try { } catch (eval) { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/54fb77cb2384a86b.js b/compiler/tests-js-parser/pass/54fb77cb2384a86b.js new file mode 100644 index 000000000..317471b95 --- /dev/null +++ b/compiler/tests-js-parser/pass/54fb77cb2384a86b.js @@ -0,0 +1,9 @@ +'use strict'; +{ + var a = 1; + b(); + { + b(); + b(); + } +} diff --git a/compiler/tests-js-parser/pass/551af1dc1686e912.module.js b/compiler/tests-js-parser/pass/551af1dc1686e912.module.js new file mode 100644 index 000000000..9132d49f1 --- /dev/null +++ b/compiler/tests-js-parser/pass/551af1dc1686e912.module.js @@ -0,0 +1 @@ +export {a} from "foo"; diff --git a/compiler/tests-js-parser/pass/5526c98fdf9150c1.js b/compiler/tests-js-parser/pass/5526c98fdf9150c1.js new file mode 100644 index 000000000..fde93bec5 --- /dev/null +++ b/compiler/tests-js-parser/pass/5526c98fdf9150c1.js @@ -0,0 +1,9 @@ +(function() { + try { + throw 'a'; + } catch (b) { + } finally { + return 1; + } + c(); // This should be removed. +}()); diff --git a/compiler/tests-js-parser/pass/55b74de671f60184.js b/compiler/tests-js-parser/pass/55b74de671f60184.js new file mode 100644 index 000000000..5e8aebc83 --- /dev/null +++ b/compiler/tests-js-parser/pass/55b74de671f60184.js @@ -0,0 +1 @@ +class a {"constructor"(){} ["constructor"](){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/55c15fe174790fb2.js b/compiler/tests-js-parser/pass/55c15fe174790fb2.js new file mode 100644 index 000000000..1ab9e23a4 --- /dev/null +++ b/compiler/tests-js-parser/pass/55c15fe174790fb2.js @@ -0,0 +1,6 @@ +(function() { + var a = 1; + with (b) { + a, 2, 3; // 'i' should remain + } +}()); diff --git a/compiler/tests-js-parser/pass/55c27b3727ba1165.js b/compiler/tests-js-parser/pass/55c27b3727ba1165.js new file mode 100644 index 000000000..a8965f6b6 --- /dev/null +++ b/compiler/tests-js-parser/pass/55c27b3727ba1165.js @@ -0,0 +1 @@ +(a, ...b) => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/55d1482dc2d95e91.js b/compiler/tests-js-parser/pass/55d1482dc2d95e91.js new file mode 100644 index 000000000..99bba8b7b --- /dev/null +++ b/compiler/tests-js-parser/pass/55d1482dc2d95e91.js @@ -0,0 +1 @@ +1 + 2 << (3) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/55d721b105cc1780.js b/compiler/tests-js-parser/pass/55d721b105cc1780.js new file mode 100644 index 000000000..f68967897 --- /dev/null +++ b/compiler/tests-js-parser/pass/55d721b105cc1780.js @@ -0,0 +1,3 @@ +a(); +b(); +c(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/560c364700fdb6b2.js b/compiler/tests-js-parser/pass/560c364700fdb6b2.js new file mode 100644 index 000000000..ec9072007 --- /dev/null +++ b/compiler/tests-js-parser/pass/560c364700fdb6b2.js @@ -0,0 +1,8 @@ +(function() { + var a = 1; + a; + var b = 2; + with (c) { + b; + } +}()); diff --git a/compiler/tests-js-parser/pass/561ccbf2e5091865.js b/compiler/tests-js-parser/pass/561ccbf2e5091865.js new file mode 100644 index 000000000..9e63ec9b8 --- /dev/null +++ b/compiler/tests-js-parser/pass/561ccbf2e5091865.js @@ -0,0 +1 @@ +!(a=b) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5641ad33abcd1752.js b/compiler/tests-js-parser/pass/5641ad33abcd1752.js new file mode 100644 index 000000000..6b155f555 --- /dev/null +++ b/compiler/tests-js-parser/pass/5641ad33abcd1752.js @@ -0,0 +1 @@ +a = { get true() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5654d4106d7025c2.js b/compiler/tests-js-parser/pass/5654d4106d7025c2.js new file mode 100644 index 000000000..33ae002d8 --- /dev/null +++ b/compiler/tests-js-parser/pass/5654d4106d7025c2.js @@ -0,0 +1 @@ +let \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5665da18579dd006.js b/compiler/tests-js-parser/pass/5665da18579dd006.js new file mode 100644 index 000000000..0c298329e --- /dev/null +++ b/compiler/tests-js-parser/pass/5665da18579dd006.js @@ -0,0 +1 @@ +1 + (a(), b(), c()) diff --git a/compiler/tests-js-parser/pass/569a2c1bad3beeb2.js b/compiler/tests-js-parser/pass/569a2c1bad3beeb2.js new file mode 100644 index 000000000..77352f8f8 --- /dev/null +++ b/compiler/tests-js-parser/pass/569a2c1bad3beeb2.js @@ -0,0 +1 @@ +({a,...b}) => 0; diff --git a/compiler/tests-js-parser/pass/56dcd0733a23aa26.js b/compiler/tests-js-parser/pass/56dcd0733a23aa26.js new file mode 100644 index 000000000..ad363e3e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/56dcd0733a23aa26.js @@ -0,0 +1,13 @@ +if (a) { + try { } catch (b) { } + // do not optimize it + (function () { + c('d'); + }()); +} else { + try { } catch (b) { } + // do not optimize it + (function () { + c('d'); + }()); +} diff --git a/compiler/tests-js-parser/pass/56debc26cbc2e077.js b/compiler/tests-js-parser/pass/56debc26cbc2e077.js new file mode 100644 index 000000000..4f5d4b574 --- /dev/null +++ b/compiler/tests-js-parser/pass/56debc26cbc2e077.js @@ -0,0 +1 @@ +a = [ ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/56e2ba90e05f5659.js b/compiler/tests-js-parser/pass/56e2ba90e05f5659.js new file mode 100644 index 000000000..03912eb93 --- /dev/null +++ b/compiler/tests-js-parser/pass/56e2ba90e05f5659.js @@ -0,0 +1 @@ +let; diff --git a/compiler/tests-js-parser/pass/56ec311ffc030121.module.js b/compiler/tests-js-parser/pass/56ec311ffc030121.module.js new file mode 100644 index 000000000..c8f853246 --- /dev/null +++ b/compiler/tests-js-parser/pass/56ec311ffc030121.module.js @@ -0,0 +1 @@ +export let a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/56fd564979894636.js b/compiler/tests-js-parser/pass/56fd564979894636.js new file mode 100644 index 000000000..8aa2ca27e --- /dev/null +++ b/compiler/tests-js-parser/pass/56fd564979894636.js @@ -0,0 +1 @@ +/\.\/\\/u \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/571bb9d1fdd6fcc0.js b/compiler/tests-js-parser/pass/571bb9d1fdd6fcc0.js new file mode 100644 index 000000000..6cc7c978d --- /dev/null +++ b/compiler/tests-js-parser/pass/571bb9d1fdd6fcc0.js @@ -0,0 +1 @@ +a: !function(){ a:; }; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5727b1080ddcd68e.js b/compiler/tests-js-parser/pass/5727b1080ddcd68e.js new file mode 100644 index 000000000..16e202fe2 --- /dev/null +++ b/compiler/tests-js-parser/pass/5727b1080ddcd68e.js @@ -0,0 +1 @@ +日本語 = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/575306c08cc44b10.js b/compiler/tests-js-parser/pass/575306c08cc44b10.js new file mode 100644 index 000000000..3080f7855 --- /dev/null +++ b/compiler/tests-js-parser/pass/575306c08cc44b10.js @@ -0,0 +1,3 @@ +(function () { + a['NaN'] = 1; +}()); diff --git a/compiler/tests-js-parser/pass/578ebe526f02ab34.js b/compiler/tests-js-parser/pass/578ebe526f02ab34.js new file mode 100644 index 000000000..1594aae16 --- /dev/null +++ b/compiler/tests-js-parser/pass/578ebe526f02ab34.js @@ -0,0 +1,2 @@ +{ var a = 1, b = 2 +c; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/57971b49e239c0ff.js b/compiler/tests-js-parser/pass/57971b49e239c0ff.js new file mode 100644 index 000000000..cf7e1a666 --- /dev/null +++ b/compiler/tests-js-parser/pass/57971b49e239c0ff.js @@ -0,0 +1 @@ +function a(a) { 'use strict'; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/57ad28ff7d96f031.js b/compiler/tests-js-parser/pass/57ad28ff7d96f031.js new file mode 100644 index 000000000..9748d90e4 --- /dev/null +++ b/compiler/tests-js-parser/pass/57ad28ff7d96f031.js @@ -0,0 +1,3 @@ +for (var a in b) { + c; +} diff --git a/compiler/tests-js-parser/pass/5829d742ab805866.js b/compiler/tests-js-parser/pass/5829d742ab805866.js new file mode 100644 index 000000000..bc61d8f94 --- /dev/null +++ b/compiler/tests-js-parser/pass/5829d742ab805866.js @@ -0,0 +1 @@ +({a:(b)} = 1) diff --git a/compiler/tests-js-parser/pass/585130f356b0729f.js b/compiler/tests-js-parser/pass/585130f356b0729f.js new file mode 100644 index 000000000..2e8838b8b --- /dev/null +++ b/compiler/tests-js-parser/pass/585130f356b0729f.js @@ -0,0 +1 @@ +let [a,] = 1; diff --git a/compiler/tests-js-parser/pass/5856de37689f8db9.js b/compiler/tests-js-parser/pass/5856de37689f8db9.js new file mode 100644 index 000000000..fe12f9c2e --- /dev/null +++ b/compiler/tests-js-parser/pass/5856de37689f8db9.js @@ -0,0 +1 @@ +(a) => a * yield; diff --git a/compiler/tests-js-parser/pass/585b857c11763bad.js b/compiler/tests-js-parser/pass/585b857c11763bad.js new file mode 100644 index 000000000..d5194433e --- /dev/null +++ b/compiler/tests-js-parser/pass/585b857c11763bad.js @@ -0,0 +1 @@ +([[[[[[[[[[[[[[[[[[[[{a=b}]]]]]]]]]]]]]]]]]]]])=>1; diff --git a/compiler/tests-js-parser/pass/587400d1c019785a.js b/compiler/tests-js-parser/pass/587400d1c019785a.js new file mode 100644 index 000000000..ba3824036 --- /dev/null +++ b/compiler/tests-js-parser/pass/587400d1c019785a.js @@ -0,0 +1 @@ +try { } finally { a(b) } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/589dc8ad3b9aa28f.js b/compiler/tests-js-parser/pass/589dc8ad3b9aa28f.js new file mode 100644 index 000000000..2e3f01671 --- /dev/null +++ b/compiler/tests-js-parser/pass/589dc8ad3b9aa28f.js @@ -0,0 +1,3 @@ +(function() { + a((1, 2, 3)); +}()); diff --git a/compiler/tests-js-parser/pass/58a52091eaa8746c.js b/compiler/tests-js-parser/pass/58a52091eaa8746c.js new file mode 100644 index 000000000..c391b7bbd --- /dev/null +++ b/compiler/tests-js-parser/pass/58a52091eaa8746c.js @@ -0,0 +1 @@ +(function(){a()}(),b()+1) diff --git a/compiler/tests-js-parser/pass/58cb05d17f7ec010.js b/compiler/tests-js-parser/pass/58cb05d17f7ec010.js new file mode 100644 index 000000000..d4a9c923e --- /dev/null +++ b/compiler/tests-js-parser/pass/58cb05d17f7ec010.js @@ -0,0 +1 @@ +var _ð’¦ = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/58cf2c5c0cecdf0e.js b/compiler/tests-js-parser/pass/58cf2c5c0cecdf0e.js new file mode 100644 index 000000000..7c1813af7 --- /dev/null +++ b/compiler/tests-js-parser/pass/58cf2c5c0cecdf0e.js @@ -0,0 +1 @@ +class a {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/58d72762ccb4d31f.js b/compiler/tests-js-parser/pass/58d72762ccb4d31f.js new file mode 100644 index 000000000..6f220e2ff --- /dev/null +++ b/compiler/tests-js-parser/pass/58d72762ccb4d31f.js @@ -0,0 +1 @@ +typeof a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/58ed6ffb30191684.js b/compiler/tests-js-parser/pass/58ed6ffb30191684.js new file mode 100644 index 000000000..8b58d7aea --- /dev/null +++ b/compiler/tests-js-parser/pass/58ed6ffb30191684.js @@ -0,0 +1 @@ +({ set false(a) { a } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/596746323492fbfd.js b/compiler/tests-js-parser/pass/596746323492fbfd.js new file mode 100644 index 000000000..dfeaf3553 --- /dev/null +++ b/compiler/tests-js-parser/pass/596746323492fbfd.js @@ -0,0 +1 @@ +var _\u{1EE03} diff --git a/compiler/tests-js-parser/pass/597108fd45a6e79b.js b/compiler/tests-js-parser/pass/597108fd45a6e79b.js new file mode 100644 index 000000000..fadb5bb3f --- /dev/null +++ b/compiler/tests-js-parser/pass/597108fd45a6e79b.js @@ -0,0 +1 @@ +class a extends b { constructor() { ({c: super()}); } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/597b9759467727fc.js b/compiler/tests-js-parser/pass/597b9759467727fc.js new file mode 100644 index 000000000..0b0d0f911 --- /dev/null +++ b/compiler/tests-js-parser/pass/597b9759467727fc.js @@ -0,0 +1 @@ +({a} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5984eac0c5c6d947.js b/compiler/tests-js-parser/pass/5984eac0c5c6d947.js new file mode 100644 index 000000000..8878e547a --- /dev/null +++ b/compiler/tests-js-parser/pass/5984eac0c5c6d947.js @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/598a5cedba92154d.js b/compiler/tests-js-parser/pass/598a5cedba92154d.js new file mode 100644 index 000000000..27b7ce6b8 --- /dev/null +++ b/compiler/tests-js-parser/pass/598a5cedba92154d.js @@ -0,0 +1 @@ +[(a) = 1] = 2 diff --git a/compiler/tests-js-parser/pass/599dff255c5ec792.js b/compiler/tests-js-parser/pass/599dff255c5ec792.js new file mode 100644 index 000000000..418f25201 --- /dev/null +++ b/compiler/tests-js-parser/pass/599dff255c5ec792.js @@ -0,0 +1 @@ +eval => 'use strict' \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/59ae0289778b80cd.js b/compiler/tests-js-parser/pass/59ae0289778b80cd.js new file mode 100644 index 000000000..5d5764462 --- /dev/null +++ b/compiler/tests-js-parser/pass/59ae0289778b80cd.js @@ -0,0 +1 @@ +if (1) function a(){} else; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5a06dab3e9fd0f65.js b/compiler/tests-js-parser/pass/5a06dab3e9fd0f65.js new file mode 100644 index 000000000..d5b7a2113 --- /dev/null +++ b/compiler/tests-js-parser/pass/5a06dab3e9fd0f65.js @@ -0,0 +1,7 @@ +(function() { + for (;;) { + break; + a(); // This should be removed. + } + b(); +}()); diff --git a/compiler/tests-js-parser/pass/5a079debdfff12da.js b/compiler/tests-js-parser/pass/5a079debdfff12da.js new file mode 100644 index 000000000..f76d71bf0 --- /dev/null +++ b/compiler/tests-js-parser/pass/5a079debdfff12da.js @@ -0,0 +1 @@ +a - b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5a0dcc9e43fed2c2.js b/compiler/tests-js-parser/pass/5a0dcc9e43fed2c2.js new file mode 100644 index 000000000..51fa74446 --- /dev/null +++ b/compiler/tests-js-parser/pass/5a0dcc9e43fed2c2.js @@ -0,0 +1,4 @@ +(/* comment */{ + a: null, + b: null +}) diff --git a/compiler/tests-js-parser/pass/5a2a8e992fa4fe37.js b/compiler/tests-js-parser/pass/5a2a8e992fa4fe37.js new file mode 100644 index 000000000..30d936c84 --- /dev/null +++ b/compiler/tests-js-parser/pass/5a2a8e992fa4fe37.js @@ -0,0 +1 @@ + --> comment \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5a51417e1ceb294f.js b/compiler/tests-js-parser/pass/5a51417e1ceb294f.js new file mode 100644 index 000000000..80319e4c0 --- /dev/null +++ b/compiler/tests-js-parser/pass/5a51417e1ceb294f.js @@ -0,0 +1,5 @@ +for (;;) { + while (true) { + continue; + } +} diff --git a/compiler/tests-js-parser/pass/5a54ee2c0b326b18.js b/compiler/tests-js-parser/pass/5a54ee2c0b326b18.js new file mode 100644 index 000000000..a658dbf9f --- /dev/null +++ b/compiler/tests-js-parser/pass/5a54ee2c0b326b18.js @@ -0,0 +1,3 @@ +function a(b) { + for (var c = 1, d = b.e(); ; c++) {} +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5a7812b78a03b937.js b/compiler/tests-js-parser/pass/5a7812b78a03b937.js new file mode 100644 index 000000000..492884e89 --- /dev/null +++ b/compiler/tests-js-parser/pass/5a7812b78a03b937.js @@ -0,0 +1 @@ +new a() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5aca2791ab698851.js b/compiler/tests-js-parser/pass/5aca2791ab698851.js new file mode 100644 index 000000000..8af5c7cbe --- /dev/null +++ b/compiler/tests-js-parser/pass/5aca2791ab698851.js @@ -0,0 +1,5 @@ +(function () { + with (a) { + b = (c(), 1); // getter is not observable after f() + } +}()); diff --git a/compiler/tests-js-parser/pass/5b146261dda66d63.js b/compiler/tests-js-parser/pass/5b146261dda66d63.js new file mode 100644 index 000000000..f208ed764 --- /dev/null +++ b/compiler/tests-js-parser/pass/5b146261dda66d63.js @@ -0,0 +1 @@ +('‪') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5b39aca97d9006f4.js b/compiler/tests-js-parser/pass/5b39aca97d9006f4.js new file mode 100644 index 000000000..57e9ba03c --- /dev/null +++ b/compiler/tests-js-parser/pass/5b39aca97d9006f4.js @@ -0,0 +1 @@ +a`token ${`nested ${`deeply` + {}} blah`}` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5b4cef6792d9462f.js b/compiler/tests-js-parser/pass/5b4cef6792d9462f.js new file mode 100644 index 000000000..b00b0d9d1 --- /dev/null +++ b/compiler/tests-js-parser/pass/5b4cef6792d9462f.js @@ -0,0 +1 @@ +void a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5b683275df4548d1.js b/compiler/tests-js-parser/pass/5b683275df4548d1.js new file mode 100644 index 000000000..26e791026 --- /dev/null +++ b/compiler/tests-js-parser/pass/5b683275df4548d1.js @@ -0,0 +1,5 @@ +(function() { + var a = 1; + a; // 'i' should remain (dynamic) + eval(''); +}()); diff --git a/compiler/tests-js-parser/pass/5b8d2b991d2c1f5b.js b/compiler/tests-js-parser/pass/5b8d2b991d2c1f5b.js new file mode 100644 index 000000000..8d0a0994d --- /dev/null +++ b/compiler/tests-js-parser/pass/5b8d2b991d2c1f5b.js @@ -0,0 +1 @@ +({}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5b8fad162f489b3b.js b/compiler/tests-js-parser/pass/5b8fad162f489b3b.js new file mode 100644 index 000000000..ce6765fa5 --- /dev/null +++ b/compiler/tests-js-parser/pass/5b8fad162f489b3b.js @@ -0,0 +1 @@ +(a)-- \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5b9f113c3bdd0c49.js b/compiler/tests-js-parser/pass/5b9f113c3bdd0c49.js new file mode 100644 index 000000000..1c53629bf --- /dev/null +++ b/compiler/tests-js-parser/pass/5b9f113c3bdd0c49.js @@ -0,0 +1,18 @@ + function a() { + b(); + c = 1; + throw "d"; + // completely discarding the `if` would introduce some + // bugs. UglifyJS v1 doesn't deal with this issue; in v2 + // we copy any declarations to the upper scope. + if (c) { + e(); + var c; + function b(){}; + // but nested declarations should not be kept. + (function(){ + var f; + function e(){}; + })(); + } + } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5bae374be95382c6.js b/compiler/tests-js-parser/pass/5bae374be95382c6.js new file mode 100644 index 000000000..8fac9bc91 --- /dev/null +++ b/compiler/tests-js-parser/pass/5bae374be95382c6.js @@ -0,0 +1,3 @@ +function a(){return +{} +/foo/} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5bb4c1e68b0925d1.js b/compiler/tests-js-parser/pass/5bb4c1e68b0925d1.js new file mode 100644 index 000000000..1e37b58fe --- /dev/null +++ b/compiler/tests-js-parser/pass/5bb4c1e68b0925d1.js @@ -0,0 +1,2 @@ +// global getter to o +a.b = (c(), 1) diff --git a/compiler/tests-js-parser/pass/5beffd72ddb47f13.js b/compiler/tests-js-parser/pass/5beffd72ddb47f13.js new file mode 100644 index 000000000..b63910fd9 --- /dev/null +++ b/compiler/tests-js-parser/pass/5beffd72ddb47f13.js @@ -0,0 +1 @@ +('\a') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5c3d125ce5f032aa.js b/compiler/tests-js-parser/pass/5c3d125ce5f032aa.js new file mode 100644 index 000000000..cfba1a991 --- /dev/null +++ b/compiler/tests-js-parser/pass/5c3d125ce5f032aa.js @@ -0,0 +1,2 @@ +var \u{1EE00} + diff --git a/compiler/tests-js-parser/pass/5c57eec29a019ebb.js b/compiler/tests-js-parser/pass/5c57eec29a019ebb.js new file mode 100644 index 000000000..5e28ec02a --- /dev/null +++ b/compiler/tests-js-parser/pass/5c57eec29a019ebb.js @@ -0,0 +1 @@ +class a {static[b](){}; static[c](){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5c587adcfe50a8c6.js b/compiler/tests-js-parser/pass/5c587adcfe50a8c6.js new file mode 100644 index 000000000..a30b8cbed --- /dev/null +++ b/compiler/tests-js-parser/pass/5c587adcfe50a8c6.js @@ -0,0 +1 @@ +switch(a){case 1:default:case 2:} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5c5ef7a4bdc3e081.js b/compiler/tests-js-parser/pass/5c5ef7a4bdc3e081.js new file mode 100644 index 000000000..0149b39a6 --- /dev/null +++ b/compiler/tests-js-parser/pass/5c5ef7a4bdc3e081.js @@ -0,0 +1,7 @@ +var a; +// access to global should be assumed to have side effects +if (b) { + a = 1+2; +} else { + a = 3; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5cc7ceeebdccb6d4.js b/compiler/tests-js-parser/pass/5cc7ceeebdccb6d4.js new file mode 100644 index 000000000..3f32e8385 --- /dev/null +++ b/compiler/tests-js-parser/pass/5cc7ceeebdccb6d4.js @@ -0,0 +1 @@ +for(const a = 1;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5cf0dc4259e98c15.js b/compiler/tests-js-parser/pass/5cf0dc4259e98c15.js new file mode 100644 index 000000000..d66166d0c --- /dev/null +++ b/compiler/tests-js-parser/pass/5cf0dc4259e98c15.js @@ -0,0 +1,3 @@ +var a, b; +a.c = (a = {}, 1); +b = (b = {}, 2); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5d0cbb3fb27c21b7.js b/compiler/tests-js-parser/pass/5d0cbb3fb27c21b7.js new file mode 100644 index 000000000..034e536b7 --- /dev/null +++ b/compiler/tests-js-parser/pass/5d0cbb3fb27c21b7.js @@ -0,0 +1,8 @@ +for (;;) { + if (a) { + if (b) { + continue; + } + c() // This should not removed and translation should not occur. + } +} diff --git a/compiler/tests-js-parser/pass/5d1a7c61bf135457.js b/compiler/tests-js-parser/pass/5d1a7c61bf135457.js new file mode 100644 index 000000000..5383132c4 --- /dev/null +++ b/compiler/tests-js-parser/pass/5d1a7c61bf135457.js @@ -0,0 +1 @@ +((a)) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5d3e89c83953788e.js b/compiler/tests-js-parser/pass/5d3e89c83953788e.js new file mode 100644 index 000000000..6a28163cf --- /dev/null +++ b/compiler/tests-js-parser/pass/5d3e89c83953788e.js @@ -0,0 +1,4 @@ +function a() { + // Do not remove this i + for (var b in c); +} diff --git a/compiler/tests-js-parser/pass/5d5b9de6d9b95f3e.js b/compiler/tests-js-parser/pass/5d5b9de6d9b95f3e.js new file mode 100644 index 000000000..172d7582d --- /dev/null +++ b/compiler/tests-js-parser/pass/5d5b9de6d9b95f3e.js @@ -0,0 +1 @@ +--> \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5d687a45c607ea42.js b/compiler/tests-js-parser/pass/5d687a45c607ea42.js new file mode 100644 index 000000000..939bce0b4 --- /dev/null +++ b/compiler/tests-js-parser/pass/5d687a45c607ea42.js @@ -0,0 +1,8 @@ +{ + { + a; + } +} +{ + b; +} diff --git a/compiler/tests-js-parser/pass/5d8ab2c35c7eb883.js b/compiler/tests-js-parser/pass/5d8ab2c35c7eb883.js new file mode 100644 index 000000000..662429477 --- /dev/null +++ b/compiler/tests-js-parser/pass/5d8ab2c35c7eb883.js @@ -0,0 +1,6 @@ +var a; +if (b()) { + a(); +} else { + a(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5d9d30af901ba176.js b/compiler/tests-js-parser/pass/5d9d30af901ba176.js new file mode 100644 index 000000000..3eee92f8a --- /dev/null +++ b/compiler/tests-js-parser/pass/5d9d30af901ba176.js @@ -0,0 +1,5 @@ +for (;;) { + with (a) { + continue; + } +} diff --git a/compiler/tests-js-parser/pass/5dd65055dace49bc.js b/compiler/tests-js-parser/pass/5dd65055dace49bc.js new file mode 100644 index 000000000..7ddd57625 --- /dev/null +++ b/compiler/tests-js-parser/pass/5dd65055dace49bc.js @@ -0,0 +1 @@ +({a,b=b,a:c,[a]:[d]})=>1; diff --git a/compiler/tests-js-parser/pass/5e0cab2e2e36274c.js b/compiler/tests-js-parser/pass/5e0cab2e2e36274c.js new file mode 100644 index 000000000..82568d14b --- /dev/null +++ b/compiler/tests-js-parser/pass/5e0cab2e2e36274c.js @@ -0,0 +1 @@ +a(....0) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5e1cbe1737b1bbc6.js b/compiler/tests-js-parser/pass/5e1cbe1737b1bbc6.js new file mode 100644 index 000000000..a0d1cc398 --- /dev/null +++ b/compiler/tests-js-parser/pass/5e1cbe1737b1bbc6.js @@ -0,0 +1 @@ +(eval, a = 1) => 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5e6d5c3edf519b99.js b/compiler/tests-js-parser/pass/5e6d5c3edf519b99.js new file mode 100644 index 000000000..ff516167f --- /dev/null +++ b/compiler/tests-js-parser/pass/5e6d5c3edf519b99.js @@ -0,0 +1 @@ +a = function({b} = {b: 1}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5e7ca8611aaa4d53.js b/compiler/tests-js-parser/pass/5e7ca8611aaa4d53.js new file mode 100644 index 000000000..fb65fde72 --- /dev/null +++ b/compiler/tests-js-parser/pass/5e7ca8611aaa4d53.js @@ -0,0 +1 @@ +let [a,,]=1 diff --git a/compiler/tests-js-parser/pass/5ec03710bd21b933.js b/compiler/tests-js-parser/pass/5ec03710bd21b933.js new file mode 100644 index 000000000..1cba3df3b --- /dev/null +++ b/compiler/tests-js-parser/pass/5ec03710bd21b933.js @@ -0,0 +1,2 @@ +b: while (1) { continue /* +*/ a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5ecbbdc097bee212.js b/compiler/tests-js-parser/pass/5ecbbdc097bee212.js new file mode 100644 index 000000000..36682d215 --- /dev/null +++ b/compiler/tests-js-parser/pass/5ecbbdc097bee212.js @@ -0,0 +1 @@ +for (a in let) {} diff --git a/compiler/tests-js-parser/pass/5ecf2f4d83e6260d.module.js b/compiler/tests-js-parser/pass/5ecf2f4d83e6260d.module.js new file mode 100644 index 000000000..9a390c31f --- /dev/null +++ b/compiler/tests-js-parser/pass/5ecf2f4d83e6260d.module.js @@ -0,0 +1 @@ +"use strict"; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5ed18bdbe48cc4c3.js b/compiler/tests-js-parser/pass/5ed18bdbe48cc4c3.js new file mode 100644 index 000000000..828416aab --- /dev/null +++ b/compiler/tests-js-parser/pass/5ed18bdbe48cc4c3.js @@ -0,0 +1 @@ +function *a(){ var b = function yield(){}; } diff --git a/compiler/tests-js-parser/pass/5f1e0eff7ac775ee.js b/compiler/tests-js-parser/pass/5f1e0eff7ac775ee.js new file mode 100644 index 000000000..f99138ae8 --- /dev/null +++ b/compiler/tests-js-parser/pass/5f1e0eff7ac775ee.js @@ -0,0 +1 @@ +delete (1, a, 2) diff --git a/compiler/tests-js-parser/pass/5f2834246274eccc.js b/compiler/tests-js-parser/pass/5f2834246274eccc.js new file mode 100644 index 000000000..e844fb683 --- /dev/null +++ b/compiler/tests-js-parser/pass/5f2834246274eccc.js @@ -0,0 +1 @@ +(void a) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5f5e1d12ad68e832.js b/compiler/tests-js-parser/pass/5f5e1d12ad68e832.js new file mode 100644 index 000000000..19715cb6e --- /dev/null +++ b/compiler/tests-js-parser/pass/5f5e1d12ad68e832.js @@ -0,0 +1,4 @@ +if (a && b) { + c(a)[1].b.d = e(); +} else + c(a)[2].b.d = f(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5f730961df66e8e8.js b/compiler/tests-js-parser/pass/5f730961df66e8e8.js new file mode 100644 index 000000000..ebbb22987 --- /dev/null +++ b/compiler/tests-js-parser/pass/5f730961df66e8e8.js @@ -0,0 +1 @@ +a = { get false() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5f85b0b6828b081b.js b/compiler/tests-js-parser/pass/5f85b0b6828b081b.js new file mode 100644 index 000000000..6750a72ef --- /dev/null +++ b/compiler/tests-js-parser/pass/5f85b0b6828b081b.js @@ -0,0 +1 @@ +(a, ...[b]) => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5f9eeac7b076f34b.js b/compiler/tests-js-parser/pass/5f9eeac7b076f34b.js new file mode 100644 index 000000000..fa67dbf27 --- /dev/null +++ b/compiler/tests-js-parser/pass/5f9eeac7b076f34b.js @@ -0,0 +1 @@ +(a, {b = 1})=>2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5fa8c711247d70f5.js b/compiler/tests-js-parser/pass/5fa8c711247d70f5.js new file mode 100644 index 000000000..616771e60 --- /dev/null +++ b/compiler/tests-js-parser/pass/5fa8c711247d70f5.js @@ -0,0 +1 @@ +() => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/5fcc16142185c87c.js b/compiler/tests-js-parser/pass/5fcc16142185c87c.js new file mode 100644 index 000000000..c08e77e7d --- /dev/null +++ b/compiler/tests-js-parser/pass/5fcc16142185c87c.js @@ -0,0 +1 @@ +var [] = 1; diff --git a/compiler/tests-js-parser/pass/600327b79f60606c.js b/compiler/tests-js-parser/pass/600327b79f60606c.js new file mode 100644 index 000000000..4fedb6bb2 --- /dev/null +++ b/compiler/tests-js-parser/pass/600327b79f60606c.js @@ -0,0 +1,3 @@ +(function () { + ((a) ? 1 : b) != null; +}()); diff --git a/compiler/tests-js-parser/pass/600fd3c4d9f2ca42.js b/compiler/tests-js-parser/pass/600fd3c4d9f2ca42.js new file mode 100644 index 000000000..e8c22a3ac --- /dev/null +++ b/compiler/tests-js-parser/pass/600fd3c4d9f2ca42.js @@ -0,0 +1 @@ +a -= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/60a1991953372b97.js b/compiler/tests-js-parser/pass/60a1991953372b97.js new file mode 100644 index 000000000..448507d92 --- /dev/null +++ b/compiler/tests-js-parser/pass/60a1991953372b97.js @@ -0,0 +1,7 @@ +(function() { + for (;;) { + continue; + a(); // This should be removed. + } + b(); +}()); diff --git a/compiler/tests-js-parser/pass/60bb345d725fe68b.js b/compiler/tests-js-parser/pass/60bb345d725fe68b.js new file mode 100644 index 000000000..4699c8755 --- /dev/null +++ b/compiler/tests-js-parser/pass/60bb345d725fe68b.js @@ -0,0 +1,10 @@ +(function() { + if (a) { + b(); + return 1; + } else { + b(); + return 2; + } + c(); +}()); diff --git a/compiler/tests-js-parser/pass/60c092cb83b525f2.js b/compiler/tests-js-parser/pass/60c092cb83b525f2.js new file mode 100644 index 000000000..73586c519 --- /dev/null +++ b/compiler/tests-js-parser/pass/60c092cb83b525f2.js @@ -0,0 +1 @@ +a &= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/60dcd48a3f6af44f.js b/compiler/tests-js-parser/pass/60dcd48a3f6af44f.js new file mode 100644 index 000000000..a79aa46ff --- /dev/null +++ b/compiler/tests-js-parser/pass/60dcd48a3f6af44f.js @@ -0,0 +1 @@ +try {} catch(a) { var a = 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/610b397691988417.module.js b/compiler/tests-js-parser/pass/610b397691988417.module.js new file mode 100644 index 000000000..92e9831d7 --- /dev/null +++ b/compiler/tests-js-parser/pass/610b397691988417.module.js @@ -0,0 +1 @@ +import {b as a} from "foo"; diff --git a/compiler/tests-js-parser/pass/612fed84b89e42a8.js b/compiler/tests-js-parser/pass/612fed84b89e42a8.js new file mode 100644 index 000000000..2554f283a --- /dev/null +++ b/compiler/tests-js-parser/pass/612fed84b89e42a8.js @@ -0,0 +1 @@ +1 instanceof 2 diff --git a/compiler/tests-js-parser/pass/6196b3f969486455.js b/compiler/tests-js-parser/pass/6196b3f969486455.js new file mode 100644 index 000000000..6d1dc7325 --- /dev/null +++ b/compiler/tests-js-parser/pass/6196b3f969486455.js @@ -0,0 +1 @@ +yield => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/61ceb5809404ee85.js b/compiler/tests-js-parser/pass/61ceb5809404ee85.js new file mode 100644 index 000000000..41926851c --- /dev/null +++ b/compiler/tests-js-parser/pass/61ceb5809404ee85.js @@ -0,0 +1 @@ +(a) + (b) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/61d8a7e497b6db72.js b/compiler/tests-js-parser/pass/61d8a7e497b6db72.js new file mode 100644 index 000000000..b5902481a --- /dev/null +++ b/compiler/tests-js-parser/pass/61d8a7e497b6db72.js @@ -0,0 +1,8 @@ +(function () { + function a() { + (function () { + b('c'); + }()); + } + a(); +}()); diff --git a/compiler/tests-js-parser/pass/61f55d9f22cc8426.js b/compiler/tests-js-parser/pass/61f55d9f22cc8426.js new file mode 100644 index 000000000..71a9ad27c --- /dev/null +++ b/compiler/tests-js-parser/pass/61f55d9f22cc8426.js @@ -0,0 +1 @@ +class a {static static(){};} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/623cec03370f088a.js b/compiler/tests-js-parser/pass/623cec03370f088a.js new file mode 100644 index 000000000..a87a7cb81 --- /dev/null +++ b/compiler/tests-js-parser/pass/623cec03370f088a.js @@ -0,0 +1 @@ +a(...b, ...c, ...d); diff --git a/compiler/tests-js-parser/pass/624bc7f99260037f.js b/compiler/tests-js-parser/pass/624bc7f99260037f.js new file mode 100644 index 000000000..f2c0badab --- /dev/null +++ b/compiler/tests-js-parser/pass/624bc7f99260037f.js @@ -0,0 +1 @@ +function a(b = 1) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/62541961bcef8d79.js b/compiler/tests-js-parser/pass/62541961bcef8d79.js new file mode 100644 index 000000000..b06a29867 --- /dev/null +++ b/compiler/tests-js-parser/pass/62541961bcef8d79.js @@ -0,0 +1 @@ +0b0 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/627fede559e0bcac.js b/compiler/tests-js-parser/pass/627fede559e0bcac.js new file mode 100644 index 000000000..341fb46ee --- /dev/null +++ b/compiler/tests-js-parser/pass/627fede559e0bcac.js @@ -0,0 +1 @@ +(a = b('100')) != a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/62ab44289ebbba49.js b/compiler/tests-js-parser/pass/62ab44289ebbba49.js new file mode 100644 index 000000000..3ccd0e44f --- /dev/null +++ b/compiler/tests-js-parser/pass/62ab44289ebbba49.js @@ -0,0 +1,5 @@ +(function() { + return 1; + function a() { + } +}()); diff --git a/compiler/tests-js-parser/pass/62c217b2844680ab.js b/compiler/tests-js-parser/pass/62c217b2844680ab.js new file mode 100644 index 000000000..d56448ed1 --- /dev/null +++ b/compiler/tests-js-parser/pass/62c217b2844680ab.js @@ -0,0 +1 @@ +a + b / c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/62d0da6771d5317d.js b/compiler/tests-js-parser/pass/62d0da6771d5317d.js new file mode 100644 index 000000000..1c1881602 --- /dev/null +++ b/compiler/tests-js-parser/pass/62d0da6771d5317d.js @@ -0,0 +1 @@ +function* a(){yield a} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/62d7c1ee4e1626c4.js b/compiler/tests-js-parser/pass/62d7c1ee4e1626c4.js new file mode 100644 index 000000000..08098fc52 --- /dev/null +++ b/compiler/tests-js-parser/pass/62d7c1ee4e1626c4.js @@ -0,0 +1,2 @@ +(function(){ return +a; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/63208a19ffb4baeb.js b/compiler/tests-js-parser/pass/63208a19ffb4baeb.js new file mode 100644 index 000000000..38f901a9a --- /dev/null +++ b/compiler/tests-js-parser/pass/63208a19ffb4baeb.js @@ -0,0 +1 @@ +({["a" + "b"]: 1}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/633fac25082a90af.js b/compiler/tests-js-parser/pass/633fac25082a90af.js new file mode 100644 index 000000000..f94d12d0d --- /dev/null +++ b/compiler/tests-js-parser/pass/633fac25082a90af.js @@ -0,0 +1 @@ +var [{a = 1}] = 2; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/63586de6fec2e3cf.js b/compiler/tests-js-parser/pass/63586de6fec2e3cf.js new file mode 100644 index 000000000..f7ead1112 --- /dev/null +++ b/compiler/tests-js-parser/pass/63586de6fec2e3cf.js @@ -0,0 +1 @@ +({[a]: 1}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/639b9076cc56e57c.js b/compiler/tests-js-parser/pass/639b9076cc56e57c.js new file mode 100644 index 000000000..efe4eb9dc --- /dev/null +++ b/compiler/tests-js-parser/pass/639b9076cc56e57c.js @@ -0,0 +1,5 @@ +while (true) { + if (a) break + ; + else b; +} diff --git a/compiler/tests-js-parser/pass/63c92209eb77315a.js b/compiler/tests-js-parser/pass/63c92209eb77315a.js new file mode 100644 index 000000000..8bca80819 --- /dev/null +++ b/compiler/tests-js-parser/pass/63c92209eb77315a.js @@ -0,0 +1 @@ +var let \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/63ee9cd383dc68a3.js b/compiler/tests-js-parser/pass/63ee9cd383dc68a3.js new file mode 100644 index 000000000..3a56cb522 --- /dev/null +++ b/compiler/tests-js-parser/pass/63ee9cd383dc68a3.js @@ -0,0 +1,11 @@ +switch (1) { + case 2: + a(); + if (b) break; + c(); + break; + case 3+4: + d(); + default: + e(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/64117d5c682ec505.js b/compiler/tests-js-parser/pass/64117d5c682ec505.js new file mode 100644 index 000000000..67e9ce30c --- /dev/null +++ b/compiler/tests-js-parser/pass/64117d5c682ec505.js @@ -0,0 +1,5 @@ +while (a) { + b(); + c(); + continue; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/641ac9060a206183.js b/compiler/tests-js-parser/pass/641ac9060a206183.js new file mode 100644 index 000000000..22a3c1158 --- /dev/null +++ b/compiler/tests-js-parser/pass/641ac9060a206183.js @@ -0,0 +1 @@ +([a, , b]) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/645e8cce491528cd.js b/compiler/tests-js-parser/pass/645e8cce491528cd.js new file mode 100644 index 000000000..2076ae4bb --- /dev/null +++ b/compiler/tests-js-parser/pass/645e8cce491528cd.js @@ -0,0 +1 @@ +typeof /test/ diff --git a/compiler/tests-js-parser/pass/646c2391c11102b5.js b/compiler/tests-js-parser/pass/646c2391c11102b5.js new file mode 100644 index 000000000..19acbdc1f --- /dev/null +++ b/compiler/tests-js-parser/pass/646c2391c11102b5.js @@ -0,0 +1 @@ +(a,a) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/647e21f8f157c338.js b/compiler/tests-js-parser/pass/647e21f8f157c338.js new file mode 100644 index 000000000..a5ddeb9b0 --- /dev/null +++ b/compiler/tests-js-parser/pass/647e21f8f157c338.js @@ -0,0 +1 @@ +('
') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6498dcc494193cb4.js b/compiler/tests-js-parser/pass/6498dcc494193cb4.js new file mode 100644 index 000000000..f76120ed0 --- /dev/null +++ b/compiler/tests-js-parser/pass/6498dcc494193cb4.js @@ -0,0 +1,2 @@ +{1 +2 3
4
5} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/64cc57f82a54b7fb.js b/compiler/tests-js-parser/pass/64cc57f82a54b7fb.js new file mode 100644 index 000000000..20a6fe827 --- /dev/null +++ b/compiler/tests-js-parser/pass/64cc57f82a54b7fb.js @@ -0,0 +1 @@ +({ get 10() {} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/64ff3b3ee7f636c5.js b/compiler/tests-js-parser/pass/64ff3b3ee7f636c5.js new file mode 100644 index 000000000..00b627709 --- /dev/null +++ b/compiler/tests-js-parser/pass/64ff3b3ee7f636c5.js @@ -0,0 +1 @@ +(function a({ b, c }){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/65047600233c760c.js b/compiler/tests-js-parser/pass/65047600233c760c.js new file mode 100644 index 000000000..04c50efb6 --- /dev/null +++ b/compiler/tests-js-parser/pass/65047600233c760c.js @@ -0,0 +1 @@ +a = false; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/65228d6a31a06406.js b/compiler/tests-js-parser/pass/65228d6a31a06406.js new file mode 100644 index 000000000..b793185f9 --- /dev/null +++ b/compiler/tests-js-parser/pass/65228d6a31a06406.js @@ -0,0 +1,34 @@ +var a; +// compress these + +a = true && b; +a = 1 && c.d("a"); +a = 2 * 3 && 4 * b; +a = 5 == 6 && b + 7; +a = "e" && 8 - b; +a = 9 + "" && b / 10; +a = -4.5 && 11 << b; +a = 12 && 13; + +a = false && b; +a = NaN && c.d("f"); +a = 14 && c.d("g"); +a = h && 15 * b; +a = null && b + 16; +a = 17 * 18 - 19 && 20 - b; +a = 21 == 22 && b / 23; +a = !"e" && 24 % b; +a = 25 && 26; + +// don't compress these + +a = b && true; +a = c.d("a") && 27; +a = 28 - b && "e"; +a = 29 << b && -4.5; + +a = b && false; +a = c.d("f") && NaN; +a = c.d("g") && 30; +a = 31 * b && h; +a = b + 32 && null; diff --git a/compiler/tests-js-parser/pass/65401ed8dc152370.js b/compiler/tests-js-parser/pass/65401ed8dc152370.js new file mode 100644 index 000000000..84b4d4d9a --- /dev/null +++ b/compiler/tests-js-parser/pass/65401ed8dc152370.js @@ -0,0 +1 @@ +var let = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/655eab0815e0567e.js b/compiler/tests-js-parser/pass/655eab0815e0567e.js new file mode 100644 index 000000000..8d206aa5f --- /dev/null +++ b/compiler/tests-js-parser/pass/655eab0815e0567e.js @@ -0,0 +1 @@ +/**/ function a() {} diff --git a/compiler/tests-js-parser/pass/65fcb1f93f1684ef.js b/compiler/tests-js-parser/pass/65fcb1f93f1684ef.js new file mode 100644 index 000000000..de7dd60b5 --- /dev/null +++ b/compiler/tests-js-parser/pass/65fcb1f93f1684ef.js @@ -0,0 +1 @@ +// Hallo, world! diff --git a/compiler/tests-js-parser/pass/660f5a175a2d46ac.js b/compiler/tests-js-parser/pass/660f5a175a2d46ac.js new file mode 100644 index 000000000..d35601e03 --- /dev/null +++ b/compiler/tests-js-parser/pass/660f5a175a2d46ac.js @@ -0,0 +1 @@ +(let[a]) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/664b0da1dd015106.js b/compiler/tests-js-parser/pass/664b0da1dd015106.js new file mode 100644 index 000000000..16da1c247 --- /dev/null +++ b/compiler/tests-js-parser/pass/664b0da1dd015106.js @@ -0,0 +1,5 @@ +a["b"] = "c"; +a["if"] = "if"; +a["*"] = "d"; +a["\u0EB3"] = "e"; +a[""] = "f"; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/665f4940c7cf30c9.js b/compiler/tests-js-parser/pass/665f4940c7cf30c9.js new file mode 100644 index 000000000..1a2219d70 --- /dev/null +++ b/compiler/tests-js-parser/pass/665f4940c7cf30c9.js @@ -0,0 +1 @@ +(function(){ return; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/668ab87597363d53.js b/compiler/tests-js-parser/pass/668ab87597363d53.js new file mode 100644 index 000000000..114743358 --- /dev/null +++ b/compiler/tests-js-parser/pass/668ab87597363d53.js @@ -0,0 +1,3 @@ +// ContinueStatement should be removed. +// And label is not used, then label also should be removed. +a: while(true) continue a; diff --git a/compiler/tests-js-parser/pass/66aabbb5b00fb1ae.js b/compiler/tests-js-parser/pass/66aabbb5b00fb1ae.js new file mode 100644 index 000000000..3eef585bf --- /dev/null +++ b/compiler/tests-js-parser/pass/66aabbb5b00fb1ae.js @@ -0,0 +1,5 @@ +(function () { + var a = 1; + a; + eval(''); +}()); diff --git a/compiler/tests-js-parser/pass/66bd9903ea05f8cc.js b/compiler/tests-js-parser/pass/66bd9903ea05f8cc.js new file mode 100644 index 000000000..a5c76f9d6 --- /dev/null +++ b/compiler/tests-js-parser/pass/66bd9903ea05f8cc.js @@ -0,0 +1 @@ +function a() {} function a() {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/66d2dbcb692491ec.module.js b/compiler/tests-js-parser/pass/66d2dbcb692491ec.module.js new file mode 100644 index 000000000..380a13857 --- /dev/null +++ b/compiler/tests-js-parser/pass/66d2dbcb692491ec.module.js @@ -0,0 +1,2 @@ +export * from "a" +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/66ea15f7de78add7.module.js b/compiler/tests-js-parser/pass/66ea15f7de78add7.module.js new file mode 100644 index 000000000..243788704 --- /dev/null +++ b/compiler/tests-js-parser/pass/66ea15f7de78add7.module.js @@ -0,0 +1 @@ +export var a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/671c914df5da04df.js b/compiler/tests-js-parser/pass/671c914df5da04df.js new file mode 100644 index 000000000..3ba5fe297 --- /dev/null +++ b/compiler/tests-js-parser/pass/671c914df5da04df.js @@ -0,0 +1,3 @@ +(/* comment */{ + a: null +}) diff --git a/compiler/tests-js-parser/pass/6733f491913ccff2.js b/compiler/tests-js-parser/pass/6733f491913ccff2.js new file mode 100644 index 000000000..ce2a4d081 --- /dev/null +++ b/compiler/tests-js-parser/pass/6733f491913ccff2.js @@ -0,0 +1 @@ +class a {constructor(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/673e6f2765ef3cb3.js b/compiler/tests-js-parser/pass/673e6f2765ef3cb3.js new file mode 100644 index 000000000..3b6ec13ea --- /dev/null +++ b/compiler/tests-js-parser/pass/673e6f2765ef3cb3.js @@ -0,0 +1 @@ +a = { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/67711cbb84083749.js b/compiler/tests-js-parser/pass/67711cbb84083749.js new file mode 100644 index 000000000..56ad154e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/67711cbb84083749.js @@ -0,0 +1,9 @@ +a( + b(c), + d(c), + e(c), + + b(), + d(), + e() +); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6776e2c88e03f1a2.js b/compiler/tests-js-parser/pass/6776e2c88e03f1a2.js new file mode 100644 index 000000000..be10f1b19 --- /dev/null +++ b/compiler/tests-js-parser/pass/6776e2c88e03f1a2.js @@ -0,0 +1 @@ +function *yield(){} diff --git a/compiler/tests-js-parser/pass/680880af107834e8.js b/compiler/tests-js-parser/pass/680880af107834e8.js new file mode 100644 index 000000000..754c0aff4 --- /dev/null +++ b/compiler/tests-js-parser/pass/680880af107834e8.js @@ -0,0 +1 @@ +/test/ && /test/ diff --git a/compiler/tests-js-parser/pass/68125aef6f5cc46f.js b/compiler/tests-js-parser/pass/68125aef6f5cc46f.js new file mode 100644 index 000000000..b124955be --- /dev/null +++ b/compiler/tests-js-parser/pass/68125aef6f5cc46f.js @@ -0,0 +1 @@ +'use strict'; 0b0 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6815ab22de966de8.js b/compiler/tests-js-parser/pass/6815ab22de966de8.js new file mode 100644 index 000000000..31c23025a --- /dev/null +++ b/compiler/tests-js-parser/pass/6815ab22de966de8.js @@ -0,0 +1 @@ +for(let();;); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/681f352b7356594c.js b/compiler/tests-js-parser/pass/681f352b7356594c.js new file mode 100644 index 000000000..ac6f534f6 --- /dev/null +++ b/compiler/tests-js-parser/pass/681f352b7356594c.js @@ -0,0 +1 @@ +a => { return 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6823058797ddd563.js b/compiler/tests-js-parser/pass/6823058797ddd563.js new file mode 100644 index 000000000..b139c7226 --- /dev/null +++ b/compiler/tests-js-parser/pass/6823058797ddd563.js @@ -0,0 +1 @@ +/[a-z]/gim \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/684237281767d41d.js b/compiler/tests-js-parser/pass/684237281767d41d.js new file mode 100644 index 000000000..ef6a7f3e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/684237281767d41d.js @@ -0,0 +1 @@ +{do ; while(false); false} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6861bb23b186f65a.js b/compiler/tests-js-parser/pass/6861bb23b186f65a.js new file mode 100644 index 000000000..fc159be8e --- /dev/null +++ b/compiler/tests-js-parser/pass/6861bb23b186f65a.js @@ -0,0 +1 @@ +/=([^=\s])+/g \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/687b7b904904fcfd.js b/compiler/tests-js-parser/pass/687b7b904904fcfd.js new file mode 100644 index 000000000..a9e5c7952 --- /dev/null +++ b/compiler/tests-js-parser/pass/687b7b904904fcfd.js @@ -0,0 +1 @@ +class a {prototype(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/687f678cde900411.js b/compiler/tests-js-parser/pass/687f678cde900411.js new file mode 100644 index 000000000..d7e0681fe --- /dev/null +++ b/compiler/tests-js-parser/pass/687f678cde900411.js @@ -0,0 +1 @@ +([1].a) = 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/69063bc9496ea6e5.js b/compiler/tests-js-parser/pass/69063bc9496ea6e5.js new file mode 100644 index 000000000..97a9729e7 --- /dev/null +++ b/compiler/tests-js-parser/pass/69063bc9496ea6e5.js @@ -0,0 +1 @@ +a`hello ${b}` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/691e1d9954f3e6e2.js b/compiler/tests-js-parser/pass/691e1d9954f3e6e2.js new file mode 100644 index 000000000..029b028d7 --- /dev/null +++ b/compiler/tests-js-parser/pass/691e1d9954f3e6e2.js @@ -0,0 +1 @@ +a = { __proto__: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/697b3d30c1d06918.js b/compiler/tests-js-parser/pass/697b3d30c1d06918.js new file mode 100644 index 000000000..78fe8bad7 --- /dev/null +++ b/compiler/tests-js-parser/pass/697b3d30c1d06918.js @@ -0,0 +1 @@ +function a() {'use strict'; ({ b: 1, b: 2 }) } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/698a8cfb0705c277.js b/compiler/tests-js-parser/pass/698a8cfb0705c277.js new file mode 100644 index 000000000..77a0d8048 --- /dev/null +++ b/compiler/tests-js-parser/pass/698a8cfb0705c277.js @@ -0,0 +1 @@ +({ a: 1, get a() { } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/69bbdc7c34ed23cc.js b/compiler/tests-js-parser/pass/69bbdc7c34ed23cc.js new file mode 100644 index 000000000..ff717c077 --- /dev/null +++ b/compiler/tests-js-parser/pass/69bbdc7c34ed23cc.js @@ -0,0 +1 @@ +({ get a() { }, a: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/69bdc785b6e244ff.js b/compiler/tests-js-parser/pass/69bdc785b6e244ff.js new file mode 100644 index 000000000..2bc3a6cec --- /dev/null +++ b/compiler/tests-js-parser/pass/69bdc785b6e244ff.js @@ -0,0 +1 @@ +a||(b||(c||(d||(e||f)))) diff --git a/compiler/tests-js-parser/pass/69cbe8ec2f64382d.js b/compiler/tests-js-parser/pass/69cbe8ec2f64382d.js new file mode 100644 index 000000000..08792af0e --- /dev/null +++ b/compiler/tests-js-parser/pass/69cbe8ec2f64382d.js @@ -0,0 +1 @@ +var a, b; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6a218750a221c68b.module.js b/compiler/tests-js-parser/pass/6a218750a221c68b.module.js new file mode 100644 index 000000000..490d87433 --- /dev/null +++ b/compiler/tests-js-parser/pass/6a218750a221c68b.module.js @@ -0,0 +1,2 @@ +import * as a from "a" +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6a220df693ce521c.js b/compiler/tests-js-parser/pass/6a220df693ce521c.js new file mode 100644 index 000000000..8161244c6 --- /dev/null +++ b/compiler/tests-js-parser/pass/6a220df693ce521c.js @@ -0,0 +1 @@ +for (a(b in c)[1] in d); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6a240463b40550d2.js b/compiler/tests-js-parser/pass/6a240463b40550d2.js new file mode 100644 index 000000000..263bb106d --- /dev/null +++ b/compiler/tests-js-parser/pass/6a240463b40550d2.js @@ -0,0 +1 @@ +// This test is ported from uglify-js 1e20,1e21 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6a323491fe75918a.js b/compiler/tests-js-parser/pass/6a323491fe75918a.js new file mode 100644 index 000000000..0f975e445 --- /dev/null +++ b/compiler/tests-js-parser/pass/6a323491fe75918a.js @@ -0,0 +1 @@ +(function*() { yield 1; }) diff --git a/compiler/tests-js-parser/pass/6a735105a5e79722.js b/compiler/tests-js-parser/pass/6a735105a5e79722.js new file mode 100644 index 000000000..e465cc274 --- /dev/null +++ b/compiler/tests-js-parser/pass/6a735105a5e79722.js @@ -0,0 +1,3 @@ +(function () { + for (var a = 1; a < 2; ++a); +}()); diff --git a/compiler/tests-js-parser/pass/6a7ed6cb99ea0b81.js b/compiler/tests-js-parser/pass/6a7ed6cb99ea0b81.js new file mode 100644 index 000000000..e6e39081b --- /dev/null +++ b/compiler/tests-js-parser/pass/6a7ed6cb99ea0b81.js @@ -0,0 +1,2 @@ +// because `with` can observe i lookup +a = a += 1 diff --git a/compiler/tests-js-parser/pass/6b0e8bbdc3dca1c5.js b/compiler/tests-js-parser/pass/6b0e8bbdc3dca1c5.js new file mode 100644 index 000000000..34dfc236b --- /dev/null +++ b/compiler/tests-js-parser/pass/6b0e8bbdc3dca1c5.js @@ -0,0 +1,9 @@ +if (a) { + with (b) { + if (c) { + d(); + } + } +} else { + d(); +} diff --git a/compiler/tests-js-parser/pass/6b36b5ad4f3ad84d.js b/compiler/tests-js-parser/pass/6b36b5ad4f3ad84d.js new file mode 100644 index 000000000..08ea221bc --- /dev/null +++ b/compiler/tests-js-parser/pass/6b36b5ad4f3ad84d.js @@ -0,0 +1 @@ +let.let = a diff --git a/compiler/tests-js-parser/pass/6b5e7e125097d439.js b/compiler/tests-js-parser/pass/6b5e7e125097d439.js new file mode 100644 index 000000000..215e8b8c9 --- /dev/null +++ b/compiler/tests-js-parser/pass/6b5e7e125097d439.js @@ -0,0 +1 @@ +((((((((((((((((((((((((((((((((((((((((a.a)))))))))))))))))))))))))))))))))))))))) = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6b63d36394b0ffb3.js b/compiler/tests-js-parser/pass/6b63d36394b0ffb3.js new file mode 100644 index 000000000..86ac35751 --- /dev/null +++ b/compiler/tests-js-parser/pass/6b63d36394b0ffb3.js @@ -0,0 +1 @@ +() => "a" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6b68aefbfbf0beb9.js b/compiler/tests-js-parser/pass/6b68aefbfbf0beb9.js new file mode 100644 index 000000000..6d915ef3c --- /dev/null +++ b/compiler/tests-js-parser/pass/6b68aefbfbf0beb9.js @@ -0,0 +1 @@ +a = { set() { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6b76b8761a049c19.js b/compiler/tests-js-parser/pass/6b76b8761a049c19.js new file mode 100644 index 000000000..77976f0a9 --- /dev/null +++ b/compiler/tests-js-parser/pass/6b76b8761a049c19.js @@ -0,0 +1 @@ +function *a(){({set b(yield){}})} diff --git a/compiler/tests-js-parser/pass/6b86b273ff34fce1.js b/compiler/tests-js-parser/pass/6b86b273ff34fce1.js new file mode 100644 index 000000000..56a6051ca --- /dev/null +++ b/compiler/tests-js-parser/pass/6b86b273ff34fce1.js @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6bb2a138b9eb0088.js b/compiler/tests-js-parser/pass/6bb2a138b9eb0088.js new file mode 100644 index 000000000..096ec022d --- /dev/null +++ b/compiler/tests-js-parser/pass/6bb2a138b9eb0088.js @@ -0,0 +1 @@ +1 * 2 diff --git a/compiler/tests-js-parser/pass/6c27d048b07ca7e0.js b/compiler/tests-js-parser/pass/6c27d048b07ca7e0.js new file mode 100644 index 000000000..b2618b489 --- /dev/null +++ b/compiler/tests-js-parser/pass/6c27d048b07ca7e0.js @@ -0,0 +1,13 @@ +class a { + constructor() { + }; + b() {}; +}; +class c { + constructor(...d) { + } + b() {} +}; +class e extends a {}; +var f = class g {}; +var h = class {}; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6c42024bfadac21f.js b/compiler/tests-js-parser/pass/6c42024bfadac21f.js new file mode 100644 index 000000000..deea2453d --- /dev/null +++ b/compiler/tests-js-parser/pass/6c42024bfadac21f.js @@ -0,0 +1 @@ +a = { if: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6c5f0dd83c417a5a.js b/compiler/tests-js-parser/pass/6c5f0dd83c417a5a.js new file mode 100644 index 000000000..61790cf3d --- /dev/null +++ b/compiler/tests-js-parser/pass/6c5f0dd83c417a5a.js @@ -0,0 +1,8 @@ +function a() { + try { + a(); + } catch(b) { + var c = 1; + } + return c; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6c688efe01b3631e.js b/compiler/tests-js-parser/pass/6c688efe01b3631e.js new file mode 100644 index 000000000..565bf0675 --- /dev/null +++ b/compiler/tests-js-parser/pass/6c688efe01b3631e.js @@ -0,0 +1 @@ +function*a(){yield*a} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6cfcfc99afcb6e1a.js b/compiler/tests-js-parser/pass/6cfcfc99afcb6e1a.js new file mode 100644 index 000000000..d91d2d403 --- /dev/null +++ b/compiler/tests-js-parser/pass/6cfcfc99afcb6e1a.js @@ -0,0 +1 @@ +for(let a of [1,2]) 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6d1bf4c3db76b489.js b/compiler/tests-js-parser/pass/6d1bf4c3db76b489.js new file mode 100644 index 000000000..f52a51eac --- /dev/null +++ b/compiler/tests-js-parser/pass/6d1bf4c3db76b489.js @@ -0,0 +1 @@ +0xdef \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6d707802519c7158.js b/compiler/tests-js-parser/pass/6d707802519c7158.js new file mode 100644 index 000000000..1d131dba5 --- /dev/null +++ b/compiler/tests-js-parser/pass/6d707802519c7158.js @@ -0,0 +1 @@ +a(`${b} + ${c} = ${b + c}`) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6d79220c64963dad.js b/compiler/tests-js-parser/pass/6d79220c64963dad.js new file mode 100644 index 000000000..18990228f --- /dev/null +++ b/compiler/tests-js-parser/pass/6d79220c64963dad.js @@ -0,0 +1 @@ +do ; while (true) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6d8728cbc7bfe6b5.js b/compiler/tests-js-parser/pass/6d8728cbc7bfe6b5.js new file mode 100644 index 000000000..24a8417ea --- /dev/null +++ b/compiler/tests-js-parser/pass/6d8728cbc7bfe6b5.js @@ -0,0 +1 @@ +({})=>1; diff --git a/compiler/tests-js-parser/pass/6d8c97119162ad95.js b/compiler/tests-js-parser/pass/6d8c97119162ad95.js new file mode 100644 index 000000000..52349ad64 --- /dev/null +++ b/compiler/tests-js-parser/pass/6d8c97119162ad95.js @@ -0,0 +1,3 @@ +` + +` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6d981ff8b6a3faec.js b/compiler/tests-js-parser/pass/6d981ff8b6a3faec.js new file mode 100644 index 000000000..4ba169958 --- /dev/null +++ b/compiler/tests-js-parser/pass/6d981ff8b6a3faec.js @@ -0,0 +1 @@ +var a = { *b () { yield *c } }; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6db6e4c3ba0299b7.js b/compiler/tests-js-parser/pass/6db6e4c3ba0299b7.js new file mode 100644 index 000000000..48558f459 --- /dev/null +++ b/compiler/tests-js-parser/pass/6db6e4c3ba0299b7.js @@ -0,0 +1 @@ +a instanceof b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6db7dbc9b1365dfa.module.js b/compiler/tests-js-parser/pass/6db7dbc9b1365dfa.module.js new file mode 100644 index 000000000..07bc60bc0 --- /dev/null +++ b/compiler/tests-js-parser/pass/6db7dbc9b1365dfa.module.js @@ -0,0 +1 @@ +export default /foo/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6dcd76e9be7c3d00.js b/compiler/tests-js-parser/pass/6dcd76e9be7c3d00.js new file mode 100644 index 000000000..260b19701 --- /dev/null +++ b/compiler/tests-js-parser/pass/6dcd76e9be7c3d00.js @@ -0,0 +1,4 @@ +b: { + if (a) break b; + c.d("e"); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6e5fe0c2bb20b016.js b/compiler/tests-js-parser/pass/6e5fe0c2bb20b016.js new file mode 100644 index 000000000..993fb3fa1 --- /dev/null +++ b/compiler/tests-js-parser/pass/6e5fe0c2bb20b016.js @@ -0,0 +1 @@ +({ "a": 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6ec818aa7f27cdbf.js b/compiler/tests-js-parser/pass/6ec818aa7f27cdbf.js new file mode 100644 index 000000000..6779cd775 --- /dev/null +++ b/compiler/tests-js-parser/pass/6ec818aa7f27cdbf.js @@ -0,0 +1 @@ +const a = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6edc155d463535cb.js b/compiler/tests-js-parser/pass/6edc155d463535cb.js new file mode 100644 index 000000000..ee68ffe19 --- /dev/null +++ b/compiler/tests-js-parser/pass/6edc155d463535cb.js @@ -0,0 +1,7 @@ +(function () { + 'use strict'; + + a = 1; + function b() { + } +}); diff --git a/compiler/tests-js-parser/pass/6f256be2ef45a7d6.js b/compiler/tests-js-parser/pass/6f256be2ef45a7d6.js new file mode 100644 index 000000000..4e03cfae1 --- /dev/null +++ b/compiler/tests-js-parser/pass/6f256be2ef45a7d6.js @@ -0,0 +1 @@ +__proto__: while (true) { break __proto__; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6f6e870785069487.js b/compiler/tests-js-parser/pass/6f6e870785069487.js new file mode 100644 index 000000000..f46c27c34 --- /dev/null +++ b/compiler/tests-js-parser/pass/6f6e870785069487.js @@ -0,0 +1 @@ +/((((((((((((.))))))))))))\12/; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6f824ec22e22a198.js b/compiler/tests-js-parser/pass/6f824ec22e22a198.js new file mode 100644 index 000000000..b32bca0aa --- /dev/null +++ b/compiler/tests-js-parser/pass/6f824ec22e22a198.js @@ -0,0 +1 @@ +({a(b,...c){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6ffb11115fcefb96.js b/compiler/tests-js-parser/pass/6ffb11115fcefb96.js new file mode 100644 index 000000000..e17bf4842 --- /dev/null +++ b/compiler/tests-js-parser/pass/6ffb11115fcefb96.js @@ -0,0 +1,9 @@ +// mangle to the same name 'a' +c: { + a("b"); + break c; +} +c: { + a("b"); + break c; +} diff --git a/compiler/tests-js-parser/pass/6ffb1fb47c2dd12f.js b/compiler/tests-js-parser/pass/6ffb1fb47c2dd12f.js new file mode 100644 index 000000000..e35d3ab82 --- /dev/null +++ b/compiler/tests-js-parser/pass/6ffb1fb47c2dd12f.js @@ -0,0 +1,8 @@ +({ + a, + a:a, + a:a=a, + [a]:{a}, + a:b()[a], + a:this.a +} = 1); diff --git a/compiler/tests-js-parser/pass/6ffc173d4e1e5158.js b/compiler/tests-js-parser/pass/6ffc173d4e1e5158.js new file mode 100644 index 000000000..6e07163b7 --- /dev/null +++ b/compiler/tests-js-parser/pass/6ffc173d4e1e5158.js @@ -0,0 +1,3 @@ +(class {;;; +; +}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/6ffd0afb19f0a92c.js b/compiler/tests-js-parser/pass/6ffd0afb19f0a92c.js new file mode 100644 index 000000000..9ec7c342c --- /dev/null +++ b/compiler/tests-js-parser/pass/6ffd0afb19f0a92c.js @@ -0,0 +1 @@ +var a = class extends (b,c) {}; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/702e4ee53d26635a.module.js b/compiler/tests-js-parser/pass/702e4ee53d26635a.module.js new file mode 100644 index 000000000..b991863a1 --- /dev/null +++ b/compiler/tests-js-parser/pass/702e4ee53d26635a.module.js @@ -0,0 +1,2 @@ +import a from "a" +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7055b45fe7f74d94.js b/compiler/tests-js-parser/pass/7055b45fe7f74d94.js new file mode 100644 index 000000000..e2957d20f --- /dev/null +++ b/compiler/tests-js-parser/pass/7055b45fe7f74d94.js @@ -0,0 +1 @@ +class a extends b { "constructor"() { super() } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/70ad5a19a1b2a4b6.js b/compiler/tests-js-parser/pass/70ad5a19a1b2a4b6.js new file mode 100644 index 000000000..48d473304 --- /dev/null +++ b/compiler/tests-js-parser/pass/70ad5a19a1b2a4b6.js @@ -0,0 +1,8 @@ +(function() { + a: for(;;) { + for (;;) { + break a; + b(); // This should be removed. + } + } +}()); diff --git a/compiler/tests-js-parser/pass/70b701c0eb7d36fd.js b/compiler/tests-js-parser/pass/70b701c0eb7d36fd.js new file mode 100644 index 000000000..d7273f387 --- /dev/null +++ b/compiler/tests-js-parser/pass/70b701c0eb7d36fd.js @@ -0,0 +1 @@ +if (!a) debugger; diff --git a/compiler/tests-js-parser/pass/70bf2c409480ae10.js b/compiler/tests-js-parser/pass/70bf2c409480ae10.js new file mode 100644 index 000000000..d28a405df --- /dev/null +++ b/compiler/tests-js-parser/pass/70bf2c409480ae10.js @@ -0,0 +1 @@ +({ get true() {} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/70c2ced6bad143f1.js b/compiler/tests-js-parser/pass/70c2ced6bad143f1.js new file mode 100644 index 000000000..cbd5e8fc5 --- /dev/null +++ b/compiler/tests-js-parser/pass/70c2ced6bad143f1.js @@ -0,0 +1 @@ +new a.b() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/70da848e355cdfd2.js b/compiler/tests-js-parser/pass/70da848e355cdfd2.js new file mode 100644 index 000000000..ad6fec7e5 --- /dev/null +++ b/compiler/tests-js-parser/pass/70da848e355cdfd2.js @@ -0,0 +1 @@ +new a(); diff --git a/compiler/tests-js-parser/pass/7148f242d6770f89.js b/compiler/tests-js-parser/pass/7148f242d6770f89.js new file mode 100644 index 000000000..a0e4c40a5 --- /dev/null +++ b/compiler/tests-js-parser/pass/7148f242d6770f89.js @@ -0,0 +1,3 @@ +while (a) { + b; +} diff --git a/compiler/tests-js-parser/pass/714be6d28082eaa7.js b/compiler/tests-js-parser/pass/714be6d28082eaa7.js new file mode 100644 index 000000000..91174dce9 --- /dev/null +++ b/compiler/tests-js-parser/pass/714be6d28082eaa7.js @@ -0,0 +1 @@ +((((((((((((((((((((((((((((((((((((((((a)))))))))))))))))))))))))))))))))))))))) = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/717b2f65b69e809e.js b/compiler/tests-js-parser/pass/717b2f65b69e809e.js new file mode 100644 index 000000000..e5dd22ddd --- /dev/null +++ b/compiler/tests-js-parser/pass/717b2f65b69e809e.js @@ -0,0 +1 @@ +'use strict';(a)=>1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/717def9f9459b4e1.module.js b/compiler/tests-js-parser/pass/717def9f9459b4e1.module.js new file mode 100644 index 000000000..cbf008c7c --- /dev/null +++ b/compiler/tests-js-parser/pass/717def9f9459b4e1.module.js @@ -0,0 +1,2 @@ +export {} from "a" +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7188bf4c56d2ffc8.js b/compiler/tests-js-parser/pass/7188bf4c56d2ffc8.js new file mode 100644 index 000000000..918581760 --- /dev/null +++ b/compiler/tests-js-parser/pass/7188bf4c56d2ffc8.js @@ -0,0 +1 @@ +var \u{41}\u{42}\u{43}; diff --git a/compiler/tests-js-parser/pass/71a2d3e7d606a959.js b/compiler/tests-js-parser/pass/71a2d3e7d606a959.js new file mode 100644 index 000000000..9ff1def4e --- /dev/null +++ b/compiler/tests-js-parser/pass/71a2d3e7d606a959.js @@ -0,0 +1 @@ +1 >> 2 diff --git a/compiler/tests-js-parser/pass/71bcb4b846c22c58.js b/compiler/tests-js-parser/pass/71bcb4b846c22c58.js new file mode 100644 index 000000000..cb9449498 --- /dev/null +++ b/compiler/tests-js-parser/pass/71bcb4b846c22c58.js @@ -0,0 +1,4 @@ +a['0']; +a['1']; +a['00']; +a['0x20']; diff --git a/compiler/tests-js-parser/pass/71e066a0fa01825b.js b/compiler/tests-js-parser/pass/71e066a0fa01825b.js new file mode 100644 index 000000000..abfa75189 --- /dev/null +++ b/compiler/tests-js-parser/pass/71e066a0fa01825b.js @@ -0,0 +1 @@ +('\11') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/72286da2cadacba6.js b/compiler/tests-js-parser/pass/72286da2cadacba6.js new file mode 100644 index 000000000..53342f87c --- /dev/null +++ b/compiler/tests-js-parser/pass/72286da2cadacba6.js @@ -0,0 +1 @@ +let [a] = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/726ee28a1b50ff13.module.js b/compiler/tests-js-parser/pass/726ee28a1b50ff13.module.js new file mode 100644 index 000000000..053c094ea --- /dev/null +++ b/compiler/tests-js-parser/pass/726ee28a1b50ff13.module.js @@ -0,0 +1 @@ +export default { a: 1 }; diff --git a/compiler/tests-js-parser/pass/729212ece9234c48.js b/compiler/tests-js-parser/pass/729212ece9234c48.js new file mode 100644 index 000000000..c9fe8edfb --- /dev/null +++ b/compiler/tests-js-parser/pass/729212ece9234c48.js @@ -0,0 +1 @@ +a[1].b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/72d79750e81ef03d.js b/compiler/tests-js-parser/pass/72d79750e81ef03d.js new file mode 100644 index 000000000..fd9ef63c4 --- /dev/null +++ b/compiler/tests-js-parser/pass/72d79750e81ef03d.js @@ -0,0 +1 @@ +a ** b diff --git a/compiler/tests-js-parser/pass/72e4f3f9f66a40b8.js b/compiler/tests-js-parser/pass/72e4f3f9f66a40b8.js new file mode 100644 index 000000000..7cae98089 --- /dev/null +++ b/compiler/tests-js-parser/pass/72e4f3f9f66a40b8.js @@ -0,0 +1 @@ +function *a(){yield 1} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7305be27a0713dfa.js b/compiler/tests-js-parser/pass/7305be27a0713dfa.js new file mode 100644 index 000000000..ac52b3619 --- /dev/null +++ b/compiler/tests-js-parser/pass/7305be27a0713dfa.js @@ -0,0 +1,6 @@ +do { + // do not optimize it + (function () { + a('b'); + }()); +} while (c); diff --git a/compiler/tests-js-parser/pass/73298cb8636154f2.js b/compiler/tests-js-parser/pass/73298cb8636154f2.js new file mode 100644 index 000000000..775195caf --- /dev/null +++ b/compiler/tests-js-parser/pass/73298cb8636154f2.js @@ -0,0 +1 @@ +var a = function eval() { }; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/739bef73b11c87de.js b/compiler/tests-js-parser/pass/739bef73b11c87de.js new file mode 100644 index 000000000..487761a20 --- /dev/null +++ b/compiler/tests-js-parser/pass/739bef73b11c87de.js @@ -0,0 +1 @@ +/[--]/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/74234e98afe7498f.js b/compiler/tests-js-parser/pass/74234e98afe7498f.js new file mode 100644 index 000000000..ec747fa47 --- /dev/null +++ b/compiler/tests-js-parser/pass/74234e98afe7498f.js @@ -0,0 +1 @@ +null \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/748a60621d2abe2b.js b/compiler/tests-js-parser/pass/748a60621d2abe2b.js new file mode 100644 index 000000000..9f9842b26 --- /dev/null +++ b/compiler/tests-js-parser/pass/748a60621d2abe2b.js @@ -0,0 +1 @@ +__proto__: a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/74c5ebda713c8bd7.js b/compiler/tests-js-parser/pass/74c5ebda713c8bd7.js new file mode 100644 index 000000000..5b8caae76 --- /dev/null +++ b/compiler/tests-js-parser/pass/74c5ebda713c8bd7.js @@ -0,0 +1 @@ +a = { set false(b) { c = b } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/74cfbae1c9639338.js b/compiler/tests-js-parser/pass/74cfbae1c9639338.js new file mode 100644 index 000000000..a86cc8c7c --- /dev/null +++ b/compiler/tests-js-parser/pass/74cfbae1c9639338.js @@ -0,0 +1 @@ +var [a, ...a] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/75172741c27c7703.js b/compiler/tests-js-parser/pass/75172741c27c7703.js new file mode 100644 index 000000000..0f2ffa39c --- /dev/null +++ b/compiler/tests-js-parser/pass/75172741c27c7703.js @@ -0,0 +1 @@ +(function(yield) {}) diff --git a/compiler/tests-js-parser/pass/753341b6f22ec11f.js b/compiler/tests-js-parser/pass/753341b6f22ec11f.js new file mode 100644 index 000000000..56e192145 --- /dev/null +++ b/compiler/tests-js-parser/pass/753341b6f22ec11f.js @@ -0,0 +1 @@ +function* a(){ (function yield(){}); } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/753a8b016a700975.js b/compiler/tests-js-parser/pass/753a8b016a700975.js new file mode 100644 index 000000000..7d1e40f00 --- /dev/null +++ b/compiler/tests-js-parser/pass/753a8b016a700975.js @@ -0,0 +1 @@ +(function(a = b){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/756579211447db0b.js b/compiler/tests-js-parser/pass/756579211447db0b.js new file mode 100644 index 000000000..a13f6a7cd --- /dev/null +++ b/compiler/tests-js-parser/pass/756579211447db0b.js @@ -0,0 +1 @@ +0O2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/756e3fe0ef87b136.js b/compiler/tests-js-parser/pass/756e3fe0ef87b136.js new file mode 100644 index 000000000..fbb5fb528 --- /dev/null +++ b/compiler/tests-js-parser/pass/756e3fe0ef87b136.js @@ -0,0 +1,10 @@ +function a() { + b(); + c(); + return d(); +} +function e() { + b(); + c(); + throw new f(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/757fc3fbe38b4ecb.js b/compiler/tests-js-parser/pass/757fc3fbe38b4ecb.js new file mode 100644 index 000000000..446c96f1f --- /dev/null +++ b/compiler/tests-js-parser/pass/757fc3fbe38b4ecb.js @@ -0,0 +1 @@ +a(...b); diff --git a/compiler/tests-js-parser/pass/75969544af546abc.js b/compiler/tests-js-parser/pass/75969544af546abc.js new file mode 100644 index 000000000..fb44362dc --- /dev/null +++ b/compiler/tests-js-parser/pass/75969544af546abc.js @@ -0,0 +1 @@ +new a(...b, ...c, ...d); diff --git a/compiler/tests-js-parser/pass/75ad6a8ee6579761.js b/compiler/tests-js-parser/pass/75ad6a8ee6579761.js new file mode 100644 index 000000000..6e13ff6bf --- /dev/null +++ b/compiler/tests-js-parser/pass/75ad6a8ee6579761.js @@ -0,0 +1,3 @@ +function a() { + new.target; +} diff --git a/compiler/tests-js-parser/pass/75b0eeaf3aa61e74.js b/compiler/tests-js-parser/pass/75b0eeaf3aa61e74.js new file mode 100644 index 000000000..a8b734120 --- /dev/null +++ b/compiler/tests-js-parser/pass/75b0eeaf3aa61e74.js @@ -0,0 +1,13 @@ +function a() { + if (b) return; + c(); + d(); +} +function e() { + if (b) return; + if (c) return; + if (d) return; + if (f) return; + g(); + h(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/75bb6594d6ad253f.module.js b/compiler/tests-js-parser/pass/75bb6594d6ad253f.module.js new file mode 100644 index 000000000..42f619aee --- /dev/null +++ b/compiler/tests-js-parser/pass/75bb6594d6ad253f.module.js @@ -0,0 +1 @@ +export let a = { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/75e16348fe9e6213.js b/compiler/tests-js-parser/pass/75e16348fe9e6213.js new file mode 100644 index 000000000..970e393b8 --- /dev/null +++ b/compiler/tests-js-parser/pass/75e16348fe9e6213.js @@ -0,0 +1,8 @@ +var a = "b" + "c" + d() + "e" + "b" + f() + "d" + "f" + "g" + h(); +var i = "b" + 1 + d() + 2 + "j"; +var k = 3 + d() + 4 + "j"; + +// this CAN'T safely be shortened to 1 + x() + "5boo" +var l = 5 + d() + 6 + 7 + "j"; + +var m = 8 + d() + 9 + "n" + 10 + "j"; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/764e72657e7321b5.js b/compiler/tests-js-parser/pass/764e72657e7321b5.js new file mode 100644 index 000000000..f6e33a75a --- /dev/null +++ b/compiler/tests-js-parser/pass/764e72657e7321b5.js @@ -0,0 +1,4 @@ +/** + * @type {number} + */ +var a = 1; diff --git a/compiler/tests-js-parser/pass/765a7a823aa1b070.js b/compiler/tests-js-parser/pass/765a7a823aa1b070.js new file mode 100644 index 000000000..05d765150 --- /dev/null +++ b/compiler/tests-js-parser/pass/765a7a823aa1b070.js @@ -0,0 +1,3 @@ +(function () { + 1/2; +}()); diff --git a/compiler/tests-js-parser/pass/76703c4b987330fb.js b/compiler/tests-js-parser/pass/76703c4b987330fb.js new file mode 100644 index 000000000..1ee311b34 --- /dev/null +++ b/compiler/tests-js-parser/pass/76703c4b987330fb.js @@ -0,0 +1 @@ +a => { b: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/76a46be6c2f09fa3.js b/compiler/tests-js-parser/pass/76a46be6c2f09fa3.js new file mode 100644 index 000000000..68ae46e04 --- /dev/null +++ b/compiler/tests-js-parser/pass/76a46be6c2f09fa3.js @@ -0,0 +1 @@ +function a() {'use strict';return 1;}; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/76d4858e4a60be95.js b/compiler/tests-js-parser/pass/76d4858e4a60be95.js new file mode 100644 index 000000000..251d5104a --- /dev/null +++ b/compiler/tests-js-parser/pass/76d4858e4a60be95.js @@ -0,0 +1 @@ +// one\n \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/771467ccdae93157.js b/compiler/tests-js-parser/pass/771467ccdae93157.js new file mode 100644 index 000000000..3460dab37 --- /dev/null +++ b/compiler/tests-js-parser/pass/771467ccdae93157.js @@ -0,0 +1 @@ +1 /*the*/ /*answer*/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7716587c3d80e9ab.js b/compiler/tests-js-parser/pass/7716587c3d80e9ab.js new file mode 100644 index 000000000..089ae86fc --- /dev/null +++ b/compiler/tests-js-parser/pass/7716587c3d80e9ab.js @@ -0,0 +1 @@ +(class { constructor() { super.a } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7733ab7955652851.js b/compiler/tests-js-parser/pass/7733ab7955652851.js new file mode 100644 index 000000000..4c75bf17e --- /dev/null +++ b/compiler/tests-js-parser/pass/7733ab7955652851.js @@ -0,0 +1 @@ +({a=1}, {})=>2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/776076cb09759e40.js b/compiler/tests-js-parser/pass/776076cb09759e40.js new file mode 100644 index 000000000..07cb5d546 --- /dev/null +++ b/compiler/tests-js-parser/pass/776076cb09759e40.js @@ -0,0 +1 @@ +1 /*The*/ /*Answer*/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/77710aedc74ecfa3.js b/compiler/tests-js-parser/pass/77710aedc74ecfa3.js new file mode 100644 index 000000000..1bead7a01 --- /dev/null +++ b/compiler/tests-js-parser/pass/77710aedc74ecfa3.js @@ -0,0 +1 @@ +日本語 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7779cfcd717e97d3.js b/compiler/tests-js-parser/pass/7779cfcd717e97d3.js new file mode 100644 index 000000000..1d9502b28 --- /dev/null +++ b/compiler/tests-js-parser/pass/7779cfcd717e97d3.js @@ -0,0 +1,2 @@ +while(true) { continue +; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7788d3c1e1247da9.js b/compiler/tests-js-parser/pass/7788d3c1e1247da9.js new file mode 100644 index 000000000..6587cb179 --- /dev/null +++ b/compiler/tests-js-parser/pass/7788d3c1e1247da9.js @@ -0,0 +1 @@ +[(a.b)] = 1 diff --git a/compiler/tests-js-parser/pass/779e65d6349f1616.js b/compiler/tests-js-parser/pass/779e65d6349f1616.js new file mode 100644 index 000000000..eea14a521 --- /dev/null +++ b/compiler/tests-js-parser/pass/779e65d6349f1616.js @@ -0,0 +1,8 @@ +a = typeof 1; +b = typeof 'c'; +d = typeof []; +e = typeof {}; +f = typeof /./; +g = typeof false; +h = typeof function(){}; +i = typeof j; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/77a541b0502d0bde.js b/compiler/tests-js-parser/pass/77a541b0502d0bde.js new file mode 100644 index 000000000..40d577211 --- /dev/null +++ b/compiler/tests-js-parser/pass/77a541b0502d0bde.js @@ -0,0 +1,2 @@ +('\ +') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/77c661b2fbe3dd3a.js b/compiler/tests-js-parser/pass/77c661b2fbe3dd3a.js new file mode 100644 index 000000000..4940cb089 --- /dev/null +++ b/compiler/tests-js-parser/pass/77c661b2fbe3dd3a.js @@ -0,0 +1 @@ +(a, b) => { 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/77db52b103913973.js b/compiler/tests-js-parser/pass/77db52b103913973.js new file mode 100644 index 000000000..36df24927 --- /dev/null +++ b/compiler/tests-js-parser/pass/77db52b103913973.js @@ -0,0 +1 @@ +[a, ...(b=c)] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/78435241f6c87ece.js b/compiler/tests-js-parser/pass/78435241f6c87ece.js new file mode 100644 index 000000000..5bd91e9d1 --- /dev/null +++ b/compiler/tests-js-parser/pass/78435241f6c87ece.js @@ -0,0 +1 @@ +123.+1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/784a059faa166072.js b/compiler/tests-js-parser/pass/784a059faa166072.js new file mode 100644 index 000000000..ab35e234c --- /dev/null +++ b/compiler/tests-js-parser/pass/784a059faa166072.js @@ -0,0 +1 @@ +(function a(b, b) { }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/784cbc06d5ade346.js b/compiler/tests-js-parser/pass/784cbc06d5ade346.js new file mode 100644 index 000000000..e9e807e37 --- /dev/null +++ b/compiler/tests-js-parser/pass/784cbc06d5ade346.js @@ -0,0 +1 @@ +/[-a-b-]/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7855fbf5ea10e622.js b/compiler/tests-js-parser/pass/7855fbf5ea10e622.js new file mode 100644 index 000000000..49398c39f --- /dev/null +++ b/compiler/tests-js-parser/pass/7855fbf5ea10e622.js @@ -0,0 +1 @@ +if (a) (function(){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/787170711cb8abd6.js b/compiler/tests-js-parser/pass/787170711cb8abd6.js new file mode 100644 index 000000000..02850be19 --- /dev/null +++ b/compiler/tests-js-parser/pass/787170711cb8abd6.js @@ -0,0 +1 @@ +((a))((a)) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/789af9b27c832306.js b/compiler/tests-js-parser/pass/789af9b27c832306.js new file mode 100644 index 000000000..e57b08b49 --- /dev/null +++ b/compiler/tests-js-parser/pass/789af9b27c832306.js @@ -0,0 +1 @@ +;;;; diff --git a/compiler/tests-js-parser/pass/78cf02220fb0937c.js b/compiler/tests-js-parser/pass/78cf02220fb0937c.js new file mode 100644 index 000000000..0c07d8de0 --- /dev/null +++ b/compiler/tests-js-parser/pass/78cf02220fb0937c.js @@ -0,0 +1 @@ +[a,a,,...a]=1; diff --git a/compiler/tests-js-parser/pass/78e1b8a4f3318967.js b/compiler/tests-js-parser/pass/78e1b8a4f3318967.js new file mode 100644 index 000000000..7d79ce5a4 --- /dev/null +++ b/compiler/tests-js-parser/pass/78e1b8a4f3318967.js @@ -0,0 +1 @@ +"\u{714E}\u{8336}" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/78ea6e4e98c18f91.js b/compiler/tests-js-parser/pass/78ea6e4e98c18f91.js new file mode 100644 index 000000000..2e0e99bce --- /dev/null +++ b/compiler/tests-js-parser/pass/78ea6e4e98c18f91.js @@ -0,0 +1 @@ +function a() {} / 1 / \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/78eb22badc114b6f.js b/compiler/tests-js-parser/pass/78eb22badc114b6f.js new file mode 100644 index 000000000..4aa8d546a --- /dev/null +++ b/compiler/tests-js-parser/pass/78eb22badc114b6f.js @@ -0,0 +1,7 @@ +function a() { + try { + a(); + } catch(b) { + var c = 1; + } +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/78ecd285b8b44e99.js b/compiler/tests-js-parser/pass/78ecd285b8b44e99.js new file mode 100644 index 000000000..b064b458e --- /dev/null +++ b/compiler/tests-js-parser/pass/78ecd285b8b44e99.js @@ -0,0 +1 @@ +var {a} = {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/78fa04077cf1950c.js b/compiler/tests-js-parser/pass/78fa04077cf1950c.js new file mode 100644 index 000000000..6b787e020 --- /dev/null +++ b/compiler/tests-js-parser/pass/78fa04077cf1950c.js @@ -0,0 +1 @@ +({ set a([{b = 1}]){}, }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/790a34467d7d9d58.js b/compiler/tests-js-parser/pass/790a34467d7d9d58.js new file mode 100644 index 000000000..e2ecc80e0 --- /dev/null +++ b/compiler/tests-js-parser/pass/790a34467d7d9d58.js @@ -0,0 +1 @@ +function eval() { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7912cf1671c75406.js b/compiler/tests-js-parser/pass/7912cf1671c75406.js new file mode 100644 index 000000000..a62b26a81 --- /dev/null +++ b/compiler/tests-js-parser/pass/7912cf1671c75406.js @@ -0,0 +1,2 @@ +/*a +c*/ 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/791ee64772f0ea45.js b/compiler/tests-js-parser/pass/791ee64772f0ea45.js new file mode 100644 index 000000000..3150c1981 --- /dev/null +++ b/compiler/tests-js-parser/pass/791ee64772f0ea45.js @@ -0,0 +1,3 @@ +function a() { + var b = function c() { } +} diff --git a/compiler/tests-js-parser/pass/7993945fc0f58feb.js b/compiler/tests-js-parser/pass/7993945fc0f58feb.js new file mode 100644 index 000000000..05506d77d --- /dev/null +++ b/compiler/tests-js-parser/pass/7993945fc0f58feb.js @@ -0,0 +1 @@ +(a) => { yield + a }; diff --git a/compiler/tests-js-parser/pass/799fad61dcd88f30.js b/compiler/tests-js-parser/pass/799fad61dcd88f30.js new file mode 100644 index 000000000..afd5a57e0 --- /dev/null +++ b/compiler/tests-js-parser/pass/799fad61dcd88f30.js @@ -0,0 +1 @@ +({a = 1} = 2) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/79a4d1fdd55febec.js b/compiler/tests-js-parser/pass/79a4d1fdd55febec.js new file mode 100644 index 000000000..5db28a9fd --- /dev/null +++ b/compiler/tests-js-parser/pass/79a4d1fdd55febec.js @@ -0,0 +1,4 @@ +var a = !b && // should not touch this one + (!c || d) && + (!e || f) && + g(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/79b7f48e8a6d401c.js b/compiler/tests-js-parser/pass/79b7f48e8a6d401c.js new file mode 100644 index 000000000..25baf6aa5 --- /dev/null +++ b/compiler/tests-js-parser/pass/79b7f48e8a6d401c.js @@ -0,0 +1 @@ +a - b - c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/79ea421b940c3474.js b/compiler/tests-js-parser/pass/79ea421b940c3474.js new file mode 100644 index 000000000..12af6bc29 --- /dev/null +++ b/compiler/tests-js-parser/pass/79ea421b940c3474.js @@ -0,0 +1 @@ +a << b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/79f7d5d83decb768.js b/compiler/tests-js-parser/pass/79f7d5d83decb768.js new file mode 100644 index 000000000..7d4b42946 --- /dev/null +++ b/compiler/tests-js-parser/pass/79f7d5d83decb768.js @@ -0,0 +1,8 @@ +(function() { + a: for(;;) { + for (;;) { + continue a; + b(); // This should be removed. + } + } +}()); diff --git a/compiler/tests-js-parser/pass/7a405ea1fdb6a26e.js b/compiler/tests-js-parser/pass/7a405ea1fdb6a26e.js new file mode 100644 index 000000000..b8d10ba71 --- /dev/null +++ b/compiler/tests-js-parser/pass/7a405ea1fdb6a26e.js @@ -0,0 +1 @@ +a: b: while (true) { continue a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7a71c5f849677cd1.js b/compiler/tests-js-parser/pass/7a71c5f849677cd1.js new file mode 100644 index 000000000..4ee551bc3 --- /dev/null +++ b/compiler/tests-js-parser/pass/7a71c5f849677cd1.js @@ -0,0 +1 @@ +do a();while (true) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7a815cb480c3cac2.js b/compiler/tests-js-parser/pass/7a815cb480c3cac2.js new file mode 100644 index 000000000..779c0e5b2 --- /dev/null +++ b/compiler/tests-js-parser/pass/7a815cb480c3cac2.js @@ -0,0 +1 @@ +({} = 1); diff --git a/compiler/tests-js-parser/pass/7a964712d5220b79.js b/compiler/tests-js-parser/pass/7a964712d5220b79.js new file mode 100644 index 000000000..6727d2510 --- /dev/null +++ b/compiler/tests-js-parser/pass/7a964712d5220b79.js @@ -0,0 +1 @@ +eval = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7ab6a1dd47c6bc1f.js b/compiler/tests-js-parser/pass/7ab6a1dd47c6bc1f.js new file mode 100644 index 000000000..e84c0ec6b --- /dev/null +++ b/compiler/tests-js-parser/pass/7ab6a1dd47c6bc1f.js @@ -0,0 +1 @@ ++a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7ac0063e99bc8720.js b/compiler/tests-js-parser/pass/7ac0063e99bc8720.js new file mode 100644 index 000000000..0b3f21bff --- /dev/null +++ b/compiler/tests-js-parser/pass/7ac0063e99bc8720.js @@ -0,0 +1 @@ +for (var a of b) c(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7ae57d0c2d30db3a.js b/compiler/tests-js-parser/pass/7ae57d0c2d30db3a.js new file mode 100644 index 000000000..4d7d5d4c5 --- /dev/null +++ b/compiler/tests-js-parser/pass/7ae57d0c2d30db3a.js @@ -0,0 +1 @@ +a >> b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7afd38d79e6795a8.js b/compiler/tests-js-parser/pass/7afd38d79e6795a8.js new file mode 100644 index 000000000..f78176c18 --- /dev/null +++ b/compiler/tests-js-parser/pass/7afd38d79e6795a8.js @@ -0,0 +1,5 @@ +(function () { + void 1; + "not a directive"; + a(); +})(); diff --git a/compiler/tests-js-parser/pass/7b0a9215ec756496.js b/compiler/tests-js-parser/pass/7b0a9215ec756496.js new file mode 100644 index 000000000..1a893e657 --- /dev/null +++ b/compiler/tests-js-parser/pass/7b0a9215ec756496.js @@ -0,0 +1,2 @@ +{ throw a/* Multiline +Comment */a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7b514406528ff126.js b/compiler/tests-js-parser/pass/7b514406528ff126.js new file mode 100644 index 000000000..09a19f43f --- /dev/null +++ b/compiler/tests-js-parser/pass/7b514406528ff126.js @@ -0,0 +1 @@ +"Hello\02World" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7b71bc250036251c.js b/compiler/tests-js-parser/pass/7b71bc250036251c.js new file mode 100644 index 000000000..15de42ef4 --- /dev/null +++ b/compiler/tests-js-parser/pass/7b71bc250036251c.js @@ -0,0 +1 @@ +do continue; while(1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7b72d7b43bedc895.js b/compiler/tests-js-parser/pass/7b72d7b43bedc895.js new file mode 100644 index 000000000..45740d682 --- /dev/null +++ b/compiler/tests-js-parser/pass/7b72d7b43bedc895.js @@ -0,0 +1,5 @@ +'use strict'; +var a = { + '10': 1, + '0x20': 2 +}; diff --git a/compiler/tests-js-parser/pass/7b8a8232be18df90.js b/compiler/tests-js-parser/pass/7b8a8232be18df90.js new file mode 100644 index 000000000..6dd90ed3c --- /dev/null +++ b/compiler/tests-js-parser/pass/7b8a8232be18df90.js @@ -0,0 +1,5 @@ +(function () { + if (true) { + a(); + } +}()); diff --git a/compiler/tests-js-parser/pass/7bc8dc445fc0f1c3.js b/compiler/tests-js-parser/pass/7bc8dc445fc0f1c3.js new file mode 100644 index 000000000..445422f3e --- /dev/null +++ b/compiler/tests-js-parser/pass/7bc8dc445fc0f1c3.js @@ -0,0 +1 @@ +for(;;) { continue; } diff --git a/compiler/tests-js-parser/pass/7bdcce70c382a9a4.js b/compiler/tests-js-parser/pass/7bdcce70c382a9a4.js new file mode 100644 index 000000000..576f9f298 --- /dev/null +++ b/compiler/tests-js-parser/pass/7bdcce70c382a9a4.js @@ -0,0 +1,4 @@ +(function () { + var a = {}; + a.b + (c(), d(), e()); // do not transform +}()); diff --git a/compiler/tests-js-parser/pass/7be9be4918d25634.js b/compiler/tests-js-parser/pass/7be9be4918d25634.js new file mode 100644 index 000000000..f4b69ca89 --- /dev/null +++ b/compiler/tests-js-parser/pass/7be9be4918d25634.js @@ -0,0 +1 @@ +--arguments \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7c027cdbc7f493b2.js b/compiler/tests-js-parser/pass/7c027cdbc7f493b2.js new file mode 100644 index 000000000..b3ae08ae9 --- /dev/null +++ b/compiler/tests-js-parser/pass/7c027cdbc7f493b2.js @@ -0,0 +1 @@ +var a = /[a-z]/y \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7c03e5eb6a9f6f1a.js b/compiler/tests-js-parser/pass/7c03e5eb6a9f6f1a.js new file mode 100644 index 000000000..e175221f3 --- /dev/null +++ b/compiler/tests-js-parser/pass/7c03e5eb6a9f6f1a.js @@ -0,0 +1 @@ +function a() { 'use strict'; "\0"; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7c3fc6d2a783ecd9.js b/compiler/tests-js-parser/pass/7c3fc6d2a783ecd9.js new file mode 100644 index 000000000..f3f5c2c16 --- /dev/null +++ b/compiler/tests-js-parser/pass/7c3fc6d2a783ecd9.js @@ -0,0 +1,2 @@ +/*a +b*/ 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7c46ecc8f111b567.js b/compiler/tests-js-parser/pass/7c46ecc8f111b567.js new file mode 100644 index 000000000..6f8b3f1e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/7c46ecc8f111b567.js @@ -0,0 +1 @@ +do a(); while (true) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7c508ad20a5ecbce.js b/compiler/tests-js-parser/pass/7c508ad20a5ecbce.js new file mode 100644 index 000000000..cc4005694 --- /dev/null +++ b/compiler/tests-js-parser/pass/7c508ad20a5ecbce.js @@ -0,0 +1 @@ +class a extends b { c() { ({d: super[e]} = f) } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7c6d13458e08e1f4.js b/compiler/tests-js-parser/pass/7c6d13458e08e1f4.js new file mode 100644 index 000000000..5d56b4003 --- /dev/null +++ b/compiler/tests-js-parser/pass/7c6d13458e08e1f4.js @@ -0,0 +1 @@ +01.a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7c9c0cce695bc705.js b/compiler/tests-js-parser/pass/7c9c0cce695bc705.js new file mode 100644 index 000000000..883cd28a2 --- /dev/null +++ b/compiler/tests-js-parser/pass/7c9c0cce695bc705.js @@ -0,0 +1,9 @@ +(function () { + a(); + function a() { + b.c('d'); + } + function a() { + b.c('e'); + } +}()); diff --git a/compiler/tests-js-parser/pass/7cbf77c14b9c89bc.js b/compiler/tests-js-parser/pass/7cbf77c14b9c89bc.js new file mode 100644 index 000000000..466388c71 --- /dev/null +++ b/compiler/tests-js-parser/pass/7cbf77c14b9c89bc.js @@ -0,0 +1 @@ +function a(b, c) { return b-- > c; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7cd7c68a6131f816.js b/compiler/tests-js-parser/pass/7cd7c68a6131f816.js new file mode 100644 index 000000000..0c4ec648f --- /dev/null +++ b/compiler/tests-js-parser/pass/7cd7c68a6131f816.js @@ -0,0 +1 @@ +a = { set true(b) { c = b } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7d029e0be60dc821.module.js b/compiler/tests-js-parser/pass/7d029e0be60dc821.module.js new file mode 100644 index 000000000..2c8362824 --- /dev/null +++ b/compiler/tests-js-parser/pass/7d029e0be60dc821.module.js @@ -0,0 +1 @@ +import a from "b" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7d7dd05015778d56.js b/compiler/tests-js-parser/pass/7d7dd05015778d56.js new file mode 100644 index 000000000..f5be3c869 --- /dev/null +++ b/compiler/tests-js-parser/pass/7d7dd05015778d56.js @@ -0,0 +1 @@ +(a,b) => 1 + 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7d8b61ba2a3a275c.js b/compiler/tests-js-parser/pass/7d8b61ba2a3a275c.js new file mode 100644 index 000000000..e65d61533 --- /dev/null +++ b/compiler/tests-js-parser/pass/7d8b61ba2a3a275c.js @@ -0,0 +1,5 @@ +with (a) + // do not optimize it + (function () { + b('c'); + }()); diff --git a/compiler/tests-js-parser/pass/7da12349ac9f51f2.js b/compiler/tests-js-parser/pass/7da12349ac9f51f2.js new file mode 100644 index 000000000..fe530d786 --- /dev/null +++ b/compiler/tests-js-parser/pass/7da12349ac9f51f2.js @@ -0,0 +1 @@ +(a, b, c && d) && e; diff --git a/compiler/tests-js-parser/pass/7dab6e55461806c9.js b/compiler/tests-js-parser/pass/7dab6e55461806c9.js new file mode 100644 index 000000000..20aef01c0 --- /dev/null +++ b/compiler/tests-js-parser/pass/7dab6e55461806c9.js @@ -0,0 +1 @@ +function *a(){yield ~1} diff --git a/compiler/tests-js-parser/pass/7dde401422530d6b.js b/compiler/tests-js-parser/pass/7dde401422530d6b.js new file mode 100644 index 000000000..c0cb4c9f3 --- /dev/null +++ b/compiler/tests-js-parser/pass/7dde401422530d6b.js @@ -0,0 +1 @@ +/*42*/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7dea677261fc5dd8.module.js b/compiler/tests-js-parser/pass/7dea677261fc5dd8.module.js new file mode 100644 index 000000000..04a3c4bfc --- /dev/null +++ b/compiler/tests-js-parser/pass/7dea677261fc5dd8.module.js @@ -0,0 +1 @@ +export var a = function () {}; diff --git a/compiler/tests-js-parser/pass/7df2a606ecc6cd84.js b/compiler/tests-js-parser/pass/7df2a606ecc6cd84.js new file mode 100644 index 000000000..f5e712a6d --- /dev/null +++ b/compiler/tests-js-parser/pass/7df2a606ecc6cd84.js @@ -0,0 +1,2 @@ +(function(){ return // Comment +a; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7dfb625b91c5c879.js b/compiler/tests-js-parser/pass/7dfb625b91c5c879.js new file mode 100644 index 000000000..faf4e963e --- /dev/null +++ b/compiler/tests-js-parser/pass/7dfb625b91c5c879.js @@ -0,0 +1 @@ +(function a() {'use strict';return 1;}); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7e094109208fc749.js b/compiler/tests-js-parser/pass/7e094109208fc749.js new file mode 100644 index 000000000..830ebe598 --- /dev/null +++ b/compiler/tests-js-parser/pass/7e094109208fc749.js @@ -0,0 +1 @@ +/[a-z]/g \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7e28d9664deeef8a.js b/compiler/tests-js-parser/pass/7e28d9664deeef8a.js new file mode 100644 index 000000000..956e35e33 --- /dev/null +++ b/compiler/tests-js-parser/pass/7e28d9664deeef8a.js @@ -0,0 +1 @@ +[{a=b}=1] diff --git a/compiler/tests-js-parser/pass/7e50a0527f791c52.js b/compiler/tests-js-parser/pass/7e50a0527f791c52.js new file mode 100644 index 000000000..76cdb539f --- /dev/null +++ b/compiler/tests-js-parser/pass/7e50a0527f791c52.js @@ -0,0 +1 @@ +2e308 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7e6e3b4c766a4d33.js b/compiler/tests-js-parser/pass/7e6e3b4c766a4d33.js new file mode 100644 index 000000000..4b289843d --- /dev/null +++ b/compiler/tests-js-parser/pass/7e6e3b4c766a4d33.js @@ -0,0 +1 @@ +(a = b('100')) <= a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7e6eac5fdc429608.js b/compiler/tests-js-parser/pass/7e6eac5fdc429608.js new file mode 100644 index 000000000..8981172c4 --- /dev/null +++ b/compiler/tests-js-parser/pass/7e6eac5fdc429608.js @@ -0,0 +1 @@ +for(a; a < 1;); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7e88047a36603238.js b/compiler/tests-js-parser/pass/7e88047a36603238.js new file mode 100644 index 000000000..d40d18795 --- /dev/null +++ b/compiler/tests-js-parser/pass/7e88047a36603238.js @@ -0,0 +1 @@ +a != b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7e8f17e7be305a2a.js b/compiler/tests-js-parser/pass/7e8f17e7be305a2a.js new file mode 100644 index 000000000..bd0ce6d84 --- /dev/null +++ b/compiler/tests-js-parser/pass/7e8f17e7be305a2a.js @@ -0,0 +1 @@ +var [a = b] = c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7e99cc8b7ce365fb.js b/compiler/tests-js-parser/pass/7e99cc8b7ce365fb.js new file mode 100644 index 000000000..c678c4a6c --- /dev/null +++ b/compiler/tests-js-parser/pass/7e99cc8b7ce365fb.js @@ -0,0 +1,4 @@ +var a = {}; +a.b = 1; +a.c = 2; +d.e(a.b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7ebaa39b4a9b5b5b.js b/compiler/tests-js-parser/pass/7ebaa39b4a9b5b5b.js new file mode 100644 index 000000000..664ffbcac --- /dev/null +++ b/compiler/tests-js-parser/pass/7ebaa39b4a9b5b5b.js @@ -0,0 +1,2 @@ +var a, b, c, d; +a = !(b(), c(), d()); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7f4c40906c3ebe2b.js b/compiler/tests-js-parser/pass/7f4c40906c3ebe2b.js new file mode 100644 index 000000000..50399d816 --- /dev/null +++ b/compiler/tests-js-parser/pass/7f4c40906c3ebe2b.js @@ -0,0 +1 @@ +var {a} = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7f88f149f16fe97a.js b/compiler/tests-js-parser/pass/7f88f149f16fe97a.js new file mode 100644 index 000000000..93d878693 --- /dev/null +++ b/compiler/tests-js-parser/pass/7f88f149f16fe97a.js @@ -0,0 +1,4 @@ +var a = { + 'arguments': 1, + 'eval': 2 +}; diff --git a/compiler/tests-js-parser/pass/7fac17daa2bd5186.js b/compiler/tests-js-parser/pass/7fac17daa2bd5186.js new file mode 100644 index 000000000..2d7b70c37 --- /dev/null +++ b/compiler/tests-js-parser/pass/7fac17daa2bd5186.js @@ -0,0 +1 @@ +for(a = 1; a < 2;); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7fbe94acda67721e.js b/compiler/tests-js-parser/pass/7fbe94acda67721e.js new file mode 100644 index 000000000..127f3f617 --- /dev/null +++ b/compiler/tests-js-parser/pass/7fbe94acda67721e.js @@ -0,0 +1 @@ +({*yield(){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7fdf990c6f42edcd.module.js b/compiler/tests-js-parser/pass/7fdf990c6f42edcd.module.js new file mode 100644 index 000000000..848bdd00b --- /dev/null +++ b/compiler/tests-js-parser/pass/7fdf990c6f42edcd.module.js @@ -0,0 +1 @@ +export * from "a" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/7fe89d8edf6e778a.js b/compiler/tests-js-parser/pass/7fe89d8edf6e778a.js new file mode 100644 index 000000000..5d518f255 --- /dev/null +++ b/compiler/tests-js-parser/pass/7fe89d8edf6e778a.js @@ -0,0 +1 @@ +'a\u0026b' \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/801ac33e4c34efb8.js b/compiler/tests-js-parser/pass/801ac33e4c34efb8.js new file mode 100644 index 000000000..2c9f67599 --- /dev/null +++ b/compiler/tests-js-parser/pass/801ac33e4c34efb8.js @@ -0,0 +1 @@ +({ false: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/802658d6ef9a83ec.js b/compiler/tests-js-parser/pass/802658d6ef9a83ec.js new file mode 100644 index 000000000..345e1b096 --- /dev/null +++ b/compiler/tests-js-parser/pass/802658d6ef9a83ec.js @@ -0,0 +1 @@ +({ ['__proto__']: 1, __proto__: 2 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/804e022cd08b4ae1.js b/compiler/tests-js-parser/pass/804e022cd08b4ae1.js new file mode 100644 index 000000000..d83bc0afd --- /dev/null +++ b/compiler/tests-js-parser/pass/804e022cd08b4ae1.js @@ -0,0 +1 @@ +[a] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/807dfc91f4ed4394.js b/compiler/tests-js-parser/pass/807dfc91f4ed4394.js new file mode 100644 index 000000000..fbacb10e9 --- /dev/null +++ b/compiler/tests-js-parser/pass/807dfc91f4ed4394.js @@ -0,0 +1 @@ +function *a(){yield 2e308} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/80950061e291542b.js b/compiler/tests-js-parser/pass/80950061e291542b.js new file mode 100644 index 000000000..47bf4082a --- /dev/null +++ b/compiler/tests-js-parser/pass/80950061e291542b.js @@ -0,0 +1 @@ +(function(){ return a * b }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/80c6bda5cad0fbc5.js b/compiler/tests-js-parser/pass/80c6bda5cad0fbc5.js new file mode 100644 index 000000000..2527a7f32 --- /dev/null +++ b/compiler/tests-js-parser/pass/80c6bda5cad0fbc5.js @@ -0,0 +1 @@ +var a, [a] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/80d2351a5ae68524.js b/compiler/tests-js-parser/pass/80d2351a5ae68524.js new file mode 100644 index 000000000..4ede2e448 --- /dev/null +++ b/compiler/tests-js-parser/pass/80d2351a5ae68524.js @@ -0,0 +1 @@ +a = { set b (c) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/80f60039028189e4.js b/compiler/tests-js-parser/pass/80f60039028189e4.js new file mode 100644 index 000000000..cfc06b013 --- /dev/null +++ b/compiler/tests-js-parser/pass/80f60039028189e4.js @@ -0,0 +1 @@ +a(.0) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/811b309b010a36ce.js b/compiler/tests-js-parser/pass/811b309b010a36ce.js new file mode 100644 index 000000000..0349e4b3d --- /dev/null +++ b/compiler/tests-js-parser/pass/811b309b010a36ce.js @@ -0,0 +1 @@ +({[1*2]:3}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8152f05423c90f61.js b/compiler/tests-js-parser/pass/8152f05423c90f61.js new file mode 100644 index 000000000..de48a63d7 --- /dev/null +++ b/compiler/tests-js-parser/pass/8152f05423c90f61.js @@ -0,0 +1 @@ +a >>>= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8179659ef4fd0965.js b/compiler/tests-js-parser/pass/8179659ef4fd0965.js new file mode 100644 index 000000000..a86b2f5ad --- /dev/null +++ b/compiler/tests-js-parser/pass/8179659ef4fd0965.js @@ -0,0 +1 @@ +({a: b} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/818ea8eaeef8b3da.js b/compiler/tests-js-parser/pass/818ea8eaeef8b3da.js new file mode 100644 index 000000000..fc154389e --- /dev/null +++ b/compiler/tests-js-parser/pass/818ea8eaeef8b3da.js @@ -0,0 +1 @@ +(let[let]) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/81a0322e554af8da.js b/compiler/tests-js-parser/pass/81a0322e554af8da.js new file mode 100644 index 000000000..1bf555efd --- /dev/null +++ b/compiler/tests-js-parser/pass/81a0322e554af8da.js @@ -0,0 +1,3 @@ +(function () { + a(typeof b === 'c'); +}()); diff --git a/compiler/tests-js-parser/pass/81a6472df96f185f.js b/compiler/tests-js-parser/pass/81a6472df96f185f.js new file mode 100644 index 000000000..e827e6e36 --- /dev/null +++ b/compiler/tests-js-parser/pass/81a6472df96f185f.js @@ -0,0 +1 @@ +a = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/81b986948b58ffda.js b/compiler/tests-js-parser/pass/81b986948b58ffda.js new file mode 100644 index 000000000..6990ea1e8 --- /dev/null +++ b/compiler/tests-js-parser/pass/81b986948b58ffda.js @@ -0,0 +1,5 @@ +(function () { + while (!a || b()) { + c(); + } +}()); diff --git a/compiler/tests-js-parser/pass/81be1572d1eebdf2.js b/compiler/tests-js-parser/pass/81be1572d1eebdf2.js new file mode 100644 index 000000000..fe17eef51 --- /dev/null +++ b/compiler/tests-js-parser/pass/81be1572d1eebdf2.js @@ -0,0 +1 @@ +a = { b(c=1) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/81be47a15713178e.js b/compiler/tests-js-parser/pass/81be47a15713178e.js new file mode 100644 index 000000000..bf83daab9 --- /dev/null +++ b/compiler/tests-js-parser/pass/81be47a15713178e.js @@ -0,0 +1 @@ +a + b + c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/820521ef532dce18.js b/compiler/tests-js-parser/pass/820521ef532dce18.js new file mode 100644 index 000000000..8f90865be --- /dev/null +++ b/compiler/tests-js-parser/pass/820521ef532dce18.js @@ -0,0 +1 @@ +function a([b] = [1]) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8286caaa8e0196bb.js b/compiler/tests-js-parser/pass/8286caaa8e0196bb.js new file mode 100644 index 000000000..3a6d0f8b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/8286caaa8e0196bb.js @@ -0,0 +1 @@ +{ function a(){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8290412f79ac2bb6.js b/compiler/tests-js-parser/pass/8290412f79ac2bb6.js new file mode 100644 index 000000000..5f0e8e484 --- /dev/null +++ b/compiler/tests-js-parser/pass/8290412f79ac2bb6.js @@ -0,0 +1 @@ +/a/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/82a730bd109206bb.js b/compiler/tests-js-parser/pass/82a730bd109206bb.js new file mode 100644 index 000000000..e11bf2dae --- /dev/null +++ b/compiler/tests-js-parser/pass/82a730bd109206bb.js @@ -0,0 +1 @@ +ⅣⅡ = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/82c827ccaecbe22b.js b/compiler/tests-js-parser/pass/82c827ccaecbe22b.js new file mode 100644 index 000000000..f5de3e858 --- /dev/null +++ b/compiler/tests-js-parser/pass/82c827ccaecbe22b.js @@ -0,0 +1 @@ +[a = (b = c)] = 1 diff --git a/compiler/tests-js-parser/pass/832ad002639ce202.js b/compiler/tests-js-parser/pass/832ad002639ce202.js new file mode 100644 index 000000000..83a265d25 --- /dev/null +++ b/compiler/tests-js-parser/pass/832ad002639ce202.js @@ -0,0 +1 @@ +const a = 1, b = 2, c = 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8340cdb8653046bb.js b/compiler/tests-js-parser/pass/8340cdb8653046bb.js new file mode 100644 index 000000000..3dcbe2815 --- /dev/null +++ b/compiler/tests-js-parser/pass/8340cdb8653046bb.js @@ -0,0 +1 @@ +for (var [a, b] in c) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/836158118a07b45d.js b/compiler/tests-js-parser/pass/836158118a07b45d.js new file mode 100644 index 000000000..c04984964 --- /dev/null +++ b/compiler/tests-js-parser/pass/836158118a07b45d.js @@ -0,0 +1 @@ +var {a, b: {c: a}} = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8386fbff927a9e0e.js b/compiler/tests-js-parser/pass/8386fbff927a9e0e.js new file mode 100644 index 000000000..4c06fdcbe --- /dev/null +++ b/compiler/tests-js-parser/pass/8386fbff927a9e0e.js @@ -0,0 +1 @@ +1000000000000000000000000000000 diff --git a/compiler/tests-js-parser/pass/838d87085df03a6d.js b/compiler/tests-js-parser/pass/838d87085df03a6d.js new file mode 100644 index 000000000..0b0d9763b --- /dev/null +++ b/compiler/tests-js-parser/pass/838d87085df03a6d.js @@ -0,0 +1 @@ +"Hello\nworld" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/83cea3f2e14d1e23.js b/compiler/tests-js-parser/pass/83cea3f2e14d1e23.js new file mode 100644 index 000000000..bdd985fa7 --- /dev/null +++ b/compiler/tests-js-parser/pass/83cea3f2e14d1e23.js @@ -0,0 +1 @@ +(class a extends 1{}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/83f083525ae5a0e0.js b/compiler/tests-js-parser/pass/83f083525ae5a0e0.js new file mode 100644 index 000000000..187fab24d --- /dev/null +++ b/compiler/tests-js-parser/pass/83f083525ae5a0e0.js @@ -0,0 +1,5 @@ +(function () { + if (!!a) { + b(); + } +}()); diff --git a/compiler/tests-js-parser/pass/83fc5b5bbdb601ef.js b/compiler/tests-js-parser/pass/83fc5b5bbdb601ef.js new file mode 100644 index 000000000..a5ac76ee6 --- /dev/null +++ b/compiler/tests-js-parser/pass/83fc5b5bbdb601ef.js @@ -0,0 +1,8 @@ +(function () { + function a() { + } + function b() { + } + function c() { + } +}()); diff --git a/compiler/tests-js-parser/pass/8411f3c15e3e8529.js b/compiler/tests-js-parser/pass/8411f3c15e3e8529.js new file mode 100644 index 000000000..7230d15cc --- /dev/null +++ b/compiler/tests-js-parser/pass/8411f3c15e3e8529.js @@ -0,0 +1,2 @@ +{{} +/foo/} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/84250e15785d8a9e.js b/compiler/tests-js-parser/pass/84250e15785d8a9e.js new file mode 100644 index 000000000..f5efde89e --- /dev/null +++ b/compiler/tests-js-parser/pass/84250e15785d8a9e.js @@ -0,0 +1 @@ +({ set true(a) { a } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/842fe071562c1a9e.js b/compiler/tests-js-parser/pass/842fe071562c1a9e.js new file mode 100644 index 000000000..24896735b --- /dev/null +++ b/compiler/tests-js-parser/pass/842fe071562c1a9e.js @@ -0,0 +1,2 @@ +function* a() { yield +; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/845368e466d341f5.js b/compiler/tests-js-parser/pass/845368e466d341f5.js new file mode 100644 index 000000000..06e26a86d --- /dev/null +++ b/compiler/tests-js-parser/pass/845368e466d341f5.js @@ -0,0 +1 @@ +[{ a, b }, ...c] = d \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/845631d1a33b3409.js b/compiler/tests-js-parser/pass/845631d1a33b3409.js new file mode 100644 index 000000000..938b53371 --- /dev/null +++ b/compiler/tests-js-parser/pass/845631d1a33b3409.js @@ -0,0 +1 @@ +class a { b() {} get b() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/845e30448809e2bc.js b/compiler/tests-js-parser/pass/845e30448809e2bc.js new file mode 100644 index 000000000..1be087a74 --- /dev/null +++ b/compiler/tests-js-parser/pass/845e30448809e2bc.js @@ -0,0 +1 @@ +a.b.c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8462f068b299bca2.js b/compiler/tests-js-parser/pass/8462f068b299bca2.js new file mode 100644 index 000000000..0d315b2d2 --- /dev/null +++ b/compiler/tests-js-parser/pass/8462f068b299bca2.js @@ -0,0 +1 @@ +var {let, yield} = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/849e112b480fda30.js b/compiler/tests-js-parser/pass/849e112b480fda30.js new file mode 100644 index 000000000..51ea1e3e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/849e112b480fda30.js @@ -0,0 +1 @@ +void (a) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/84b2a5d834daee2f.js b/compiler/tests-js-parser/pass/84b2a5d834daee2f.js new file mode 100644 index 000000000..58aba0736 --- /dev/null +++ b/compiler/tests-js-parser/pass/84b2a5d834daee2f.js @@ -0,0 +1 @@ +0012 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/84eaae502ca93891.js b/compiler/tests-js-parser/pass/84eaae502ca93891.js new file mode 100644 index 000000000..68bf8e127 --- /dev/null +++ b/compiler/tests-js-parser/pass/84eaae502ca93891.js @@ -0,0 +1 @@ +class a { b() { new super.c; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/84f901eb37273117.js b/compiler/tests-js-parser/pass/84f901eb37273117.js new file mode 100644 index 000000000..a6805fa1a --- /dev/null +++ b/compiler/tests-js-parser/pass/84f901eb37273117.js @@ -0,0 +1 @@ +('\0') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/850a60daa178d3b6.js b/compiler/tests-js-parser/pass/850a60daa178d3b6.js new file mode 100644 index 000000000..360804aba --- /dev/null +++ b/compiler/tests-js-parser/pass/850a60daa178d3b6.js @@ -0,0 +1 @@ +() => 1 + 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/85263ecacc7a4dc5.js b/compiler/tests-js-parser/pass/85263ecacc7a4dc5.js new file mode 100644 index 000000000..f6578972e --- /dev/null +++ b/compiler/tests-js-parser/pass/85263ecacc7a4dc5.js @@ -0,0 +1,5 @@ +(function () { + 'use strict'; + function a() { + } +}); diff --git a/compiler/tests-js-parser/pass/8543b43f3c48c975.module.js b/compiler/tests-js-parser/pass/8543b43f3c48c975.module.js new file mode 100644 index 000000000..bffd605ae --- /dev/null +++ b/compiler/tests-js-parser/pass/8543b43f3c48c975.module.js @@ -0,0 +1 @@ +export { default } from "a" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/855b8dea36c841ed.js b/compiler/tests-js-parser/pass/855b8dea36c841ed.js new file mode 100644 index 000000000..e257fd005 --- /dev/null +++ b/compiler/tests-js-parser/pass/855b8dea36c841ed.js @@ -0,0 +1 @@ +(function () { 'use\x20strict'; with (a); }()) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/858d6a756ff641f3.js b/compiler/tests-js-parser/pass/858d6a756ff641f3.js new file mode 100644 index 000000000..020534957 --- /dev/null +++ b/compiler/tests-js-parser/pass/858d6a756ff641f3.js @@ -0,0 +1 @@ +function a(b) { c(); } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8597768c0fe519eb.js b/compiler/tests-js-parser/pass/8597768c0fe519eb.js new file mode 100644 index 000000000..bc8cc70a8 --- /dev/null +++ b/compiler/tests-js-parser/pass/8597768c0fe519eb.js @@ -0,0 +1 @@ +`${a}$` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/85d2d93264f2672d.module.js b/compiler/tests-js-parser/pass/85d2d93264f2672d.module.js new file mode 100644 index 000000000..ddcbace8f --- /dev/null +++ b/compiler/tests-js-parser/pass/85d2d93264f2672d.module.js @@ -0,0 +1 @@ +import a, {b} from "foo"; diff --git a/compiler/tests-js-parser/pass/85d6723f13f33101.js b/compiler/tests-js-parser/pass/85d6723f13f33101.js new file mode 100644 index 000000000..594d757d9 --- /dev/null +++ b/compiler/tests-js-parser/pass/85d6723f13f33101.js @@ -0,0 +1 @@ +({'a': b} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/85e4314fa8f0661f.js b/compiler/tests-js-parser/pass/85e4314fa8f0661f.js new file mode 100644 index 000000000..2a20aec26 --- /dev/null +++ b/compiler/tests-js-parser/pass/85e4314fa8f0661f.js @@ -0,0 +1 @@ +a(b, ...c = d); diff --git a/compiler/tests-js-parser/pass/8628cd459b39ffe8.js b/compiler/tests-js-parser/pass/8628cd459b39ffe8.js new file mode 100644 index 000000000..41a099093 --- /dev/null +++ b/compiler/tests-js-parser/pass/8628cd459b39ffe8.js @@ -0,0 +1 @@ +try { } catch ([a = 1]) { } diff --git a/compiler/tests-js-parser/pass/8664d1a4e7a73078.js b/compiler/tests-js-parser/pass/8664d1a4e7a73078.js new file mode 100644 index 000000000..6187f10ea --- /dev/null +++ b/compiler/tests-js-parser/pass/8664d1a4e7a73078.js @@ -0,0 +1 @@ +function a({[b]: c}) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/86a25a2a0e393ed6.js b/compiler/tests-js-parser/pass/86a25a2a0e393ed6.js new file mode 100644 index 000000000..b5a43ac06 --- /dev/null +++ b/compiler/tests-js-parser/pass/86a25a2a0e393ed6.js @@ -0,0 +1 @@ +switch (a) { case 1: let b = 2; break; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/86b0ffc811e713ec.js b/compiler/tests-js-parser/pass/86b0ffc811e713ec.js new file mode 100644 index 000000000..90432525e --- /dev/null +++ b/compiler/tests-js-parser/pass/86b0ffc811e713ec.js @@ -0,0 +1 @@ +({ __proto__: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/86d8f1465e745b44.js b/compiler/tests-js-parser/pass/86d8f1465e745b44.js new file mode 100644 index 000000000..81e24bfaa --- /dev/null +++ b/compiler/tests-js-parser/pass/86d8f1465e745b44.js @@ -0,0 +1 @@ +[a[b]=b] = c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/86f68610fcefaeae.js b/compiler/tests-js-parser/pass/86f68610fcefaeae.js new file mode 100644 index 000000000..239ff0290 --- /dev/null +++ b/compiler/tests-js-parser/pass/86f68610fcefaeae.js @@ -0,0 +1 @@ +class a {b() {} static c() {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/870a0b8d891753e9.js b/compiler/tests-js-parser/pass/870a0b8d891753e9.js new file mode 100644 index 000000000..e73e72408 --- /dev/null +++ b/compiler/tests-js-parser/pass/870a0b8d891753e9.js @@ -0,0 +1 @@ +(function(a, ...b){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8751eb24f903c279.js b/compiler/tests-js-parser/pass/8751eb24f903c279.js new file mode 100644 index 000000000..eabcd4209 --- /dev/null +++ b/compiler/tests-js-parser/pass/8751eb24f903c279.js @@ -0,0 +1 @@ +var a = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/87844be2334fba9e.js b/compiler/tests-js-parser/pass/87844be2334fba9e.js new file mode 100644 index 000000000..e34d75579 --- /dev/null +++ b/compiler/tests-js-parser/pass/87844be2334fba9e.js @@ -0,0 +1,2 @@ +function a() { "use strict" + + 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/87a9b0d1d80812cc.js b/compiler/tests-js-parser/pass/87a9b0d1d80812cc.js new file mode 100644 index 000000000..73f813af4 --- /dev/null +++ b/compiler/tests-js-parser/pass/87a9b0d1d80812cc.js @@ -0,0 +1,3 @@ +(function() { + a((b(), 1, 2)); +}()); diff --git a/compiler/tests-js-parser/pass/87cb789c4ed2b97a.js b/compiler/tests-js-parser/pass/87cb789c4ed2b97a.js new file mode 100644 index 000000000..5f2d95e29 --- /dev/null +++ b/compiler/tests-js-parser/pass/87cb789c4ed2b97a.js @@ -0,0 +1 @@ +a: while (true) { continue a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/87e1d3eab9d05339.js b/compiler/tests-js-parser/pass/87e1d3eab9d05339.js new file mode 100644 index 000000000..e149f651c --- /dev/null +++ b/compiler/tests-js-parser/pass/87e1d3eab9d05339.js @@ -0,0 +1 @@ +while (a()) b(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/88127d108648d05b.js b/compiler/tests-js-parser/pass/88127d108648d05b.js new file mode 100644 index 000000000..a519e0b8a --- /dev/null +++ b/compiler/tests-js-parser/pass/88127d108648d05b.js @@ -0,0 +1,2 @@ +while (true) { continue /* Multiline +Comment */a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/881a7a3d4e17e621.js b/compiler/tests-js-parser/pass/881a7a3d4e17e621.js new file mode 100644 index 000000000..b2683310b --- /dev/null +++ b/compiler/tests-js-parser/pass/881a7a3d4e17e621.js @@ -0,0 +1,5 @@ +function a(b, c) { + var d = function() { return e() }; + var e = function() { return d() }; + return b + c; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/882910de7dd1aef9.js b/compiler/tests-js-parser/pass/882910de7dd1aef9.js new file mode 100644 index 000000000..029b051b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/882910de7dd1aef9.js @@ -0,0 +1 @@ +((((((((((((((((((((((((((((((((((((((((a)))))))))))))))))))))))))))))))))))))))) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/884e5c2703ce95f3.js b/compiler/tests-js-parser/pass/884e5c2703ce95f3.js new file mode 100644 index 000000000..8bae08100 --- /dev/null +++ b/compiler/tests-js-parser/pass/884e5c2703ce95f3.js @@ -0,0 +1 @@ +({ *a() { super.b = 1; } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8854cac4acddd510.js b/compiler/tests-js-parser/pass/8854cac4acddd510.js new file mode 100644 index 000000000..50d1ecb78 --- /dev/null +++ b/compiler/tests-js-parser/pass/8854cac4acddd510.js @@ -0,0 +1 @@ +null && (a += null) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/88561e211e862344.js b/compiler/tests-js-parser/pass/88561e211e862344.js new file mode 100644 index 000000000..381696fc6 --- /dev/null +++ b/compiler/tests-js-parser/pass/88561e211e862344.js @@ -0,0 +1 @@ +null; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/88827d8021b5b3ab.js b/compiler/tests-js-parser/pass/88827d8021b5b3ab.js new file mode 100644 index 000000000..73f04e1b2 --- /dev/null +++ b/compiler/tests-js-parser/pass/88827d8021b5b3ab.js @@ -0,0 +1 @@ +new a("aa, bb", 'return aa;'); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/88af07b3dc006159.js b/compiler/tests-js-parser/pass/88af07b3dc006159.js new file mode 100644 index 000000000..6d2f69293 --- /dev/null +++ b/compiler/tests-js-parser/pass/88af07b3dc006159.js @@ -0,0 +1 @@ +a | b ^ c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/88c21621e3e8bba0.js b/compiler/tests-js-parser/pass/88c21621e3e8bba0.js new file mode 100644 index 000000000..37e0ffe55 --- /dev/null +++ b/compiler/tests-js-parser/pass/88c21621e3e8bba0.js @@ -0,0 +1 @@ +('a') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/88d42455ac933ef5.js b/compiler/tests-js-parser/pass/88d42455ac933ef5.js new file mode 100644 index 000000000..a111303df --- /dev/null +++ b/compiler/tests-js-parser/pass/88d42455ac933ef5.js @@ -0,0 +1 @@ +class a {static constructor(){} static constructor(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/88e99d6cd8e8d87f.js b/compiler/tests-js-parser/pass/88e99d6cd8e8d87f.js new file mode 100644 index 000000000..5b0f0455d --- /dev/null +++ b/compiler/tests-js-parser/pass/88e99d6cd8e8d87f.js @@ -0,0 +1 @@ +function *a() {} diff --git a/compiler/tests-js-parser/pass/891fc3470b618587.js b/compiler/tests-js-parser/pass/891fc3470b618587.js new file mode 100644 index 000000000..313cf3a92 --- /dev/null +++ b/compiler/tests-js-parser/pass/891fc3470b618587.js @@ -0,0 +1 @@ +a((b, c) => {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/892f6e09c02c35b5.js b/compiler/tests-js-parser/pass/892f6e09c02c35b5.js new file mode 100644 index 000000000..1ba5237e8 --- /dev/null +++ b/compiler/tests-js-parser/pass/892f6e09c02c35b5.js @@ -0,0 +1 @@ +0. \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8996d3eb07c6f7cd.js b/compiler/tests-js-parser/pass/8996d3eb07c6f7cd.js new file mode 100644 index 000000000..e9056b956 --- /dev/null +++ b/compiler/tests-js-parser/pass/8996d3eb07c6f7cd.js @@ -0,0 +1 @@ +for(let a of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/89a31837e6736b2a.js b/compiler/tests-js-parser/pass/89a31837e6736b2a.js new file mode 100644 index 000000000..93c1826f2 --- /dev/null +++ b/compiler/tests-js-parser/pass/89a31837e6736b2a.js @@ -0,0 +1 @@ +{a: 1} diff --git a/compiler/tests-js-parser/pass/89c872e56d527908.js b/compiler/tests-js-parser/pass/89c872e56d527908.js new file mode 100644 index 000000000..9f438a85b --- /dev/null +++ b/compiler/tests-js-parser/pass/89c872e56d527908.js @@ -0,0 +1 @@ +1+2; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8a0fc8ea31727188.module.js b/compiler/tests-js-parser/pass/8a0fc8ea31727188.module.js new file mode 100644 index 000000000..9ec8f63ab --- /dev/null +++ b/compiler/tests-js-parser/pass/8a0fc8ea31727188.module.js @@ -0,0 +1 @@ +export * from "foo"; diff --git a/compiler/tests-js-parser/pass/8a40542f1f53c4f0.js b/compiler/tests-js-parser/pass/8a40542f1f53c4f0.js new file mode 100644 index 000000000..ced2f36b3 --- /dev/null +++ b/compiler/tests-js-parser/pass/8a40542f1f53c4f0.js @@ -0,0 +1 @@ +for(const a of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8aa3cd2609b4f278.js b/compiler/tests-js-parser/pass/8aa3cd2609b4f278.js new file mode 100644 index 000000000..c65005050 --- /dev/null +++ b/compiler/tests-js-parser/pass/8aa3cd2609b4f278.js @@ -0,0 +1 @@ +a = { b: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8ad4edbe9317df28.js b/compiler/tests-js-parser/pass/8ad4edbe9317df28.js new file mode 100644 index 000000000..89531461a --- /dev/null +++ b/compiler/tests-js-parser/pass/8ad4edbe9317df28.js @@ -0,0 +1 @@ +a(...b, ...c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8ae0c86bd7897b7b.js b/compiler/tests-js-parser/pass/8ae0c86bd7897b7b.js new file mode 100644 index 000000000..6d6544c36 --- /dev/null +++ b/compiler/tests-js-parser/pass/8ae0c86bd7897b7b.js @@ -0,0 +1 @@ +a(...b = c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8af69d8f15295ed2.js b/compiler/tests-js-parser/pass/8af69d8f15295ed2.js new file mode 100644 index 000000000..a89912b3b --- /dev/null +++ b/compiler/tests-js-parser/pass/8af69d8f15295ed2.js @@ -0,0 +1 @@ +('
') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8b4ff58f416e17b5.js b/compiler/tests-js-parser/pass/8b4ff58f416e17b5.js new file mode 100644 index 000000000..34a5e493b --- /dev/null +++ b/compiler/tests-js-parser/pass/8b4ff58f416e17b5.js @@ -0,0 +1 @@ +(a++) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8b6bded4f89f89f6.js b/compiler/tests-js-parser/pass/8b6bded4f89f89f6.js new file mode 100644 index 000000000..1e09fa134 --- /dev/null +++ b/compiler/tests-js-parser/pass/8b6bded4f89f89f6.js @@ -0,0 +1,8 @@ +if ((function(){ return true })()) { + a(true); +} else { + b(false); +} +(function(){ + c.d("e"); +})(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8b8edcb36909900b.js b/compiler/tests-js-parser/pass/8b8edcb36909900b.js new file mode 100644 index 000000000..6c5fa22af --- /dev/null +++ b/compiler/tests-js-parser/pass/8b8edcb36909900b.js @@ -0,0 +1 @@ +new    â€â€‚         âŸã€€ï»¿a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8b9cd46352285386.js b/compiler/tests-js-parser/pass/8b9cd46352285386.js new file mode 100644 index 000000000..35ad4ec03 --- /dev/null +++ b/compiler/tests-js-parser/pass/8b9cd46352285386.js @@ -0,0 +1 @@ +new a[b] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8bd57faa6bcca5e2.js b/compiler/tests-js-parser/pass/8bd57faa6bcca5e2.js new file mode 100644 index 000000000..c45b5d24c --- /dev/null +++ b/compiler/tests-js-parser/pass/8bd57faa6bcca5e2.js @@ -0,0 +1 @@ + // diff --git a/compiler/tests-js-parser/pass/8be0df708b9e56ca.js b/compiler/tests-js-parser/pass/8be0df708b9e56ca.js new file mode 100644 index 000000000..3dce2e74b --- /dev/null +++ b/compiler/tests-js-parser/pass/8be0df708b9e56ca.js @@ -0,0 +1 @@ +a = [ 1, ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8bf3ec35c55ed3c0.js b/compiler/tests-js-parser/pass/8bf3ec35c55ed3c0.js new file mode 100644 index 000000000..75b966fa7 --- /dev/null +++ b/compiler/tests-js-parser/pass/8bf3ec35c55ed3c0.js @@ -0,0 +1 @@ +(class extends a {}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8c27fb7ef1e3ca3d.js b/compiler/tests-js-parser/pass/8c27fb7ef1e3ca3d.js new file mode 100644 index 000000000..f46cac491 --- /dev/null +++ b/compiler/tests-js-parser/pass/8c27fb7ef1e3ca3d.js @@ -0,0 +1,4 @@ +(function() { +if (a) return b; +else return c; +}()); diff --git a/compiler/tests-js-parser/pass/8c56513a6ac3cdff.js b/compiler/tests-js-parser/pass/8c56513a6ac3cdff.js new file mode 100644 index 000000000..d57e5cb88 --- /dev/null +++ b/compiler/tests-js-parser/pass/8c56513a6ac3cdff.js @@ -0,0 +1,4 @@ +(/* comment */{ + /* comment 2 */ + a: null +}) diff --git a/compiler/tests-js-parser/pass/8c56cf12f007a392.js b/compiler/tests-js-parser/pass/8c56cf12f007a392.js new file mode 100644 index 000000000..7c3778508 --- /dev/null +++ b/compiler/tests-js-parser/pass/8c56cf12f007a392.js @@ -0,0 +1,2 @@ +a 1; + --> nothing \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8ecaef2617d8c6a7.js b/compiler/tests-js-parser/pass/8ecaef2617d8c6a7.js new file mode 100644 index 000000000..3966c7758 --- /dev/null +++ b/compiler/tests-js-parser/pass/8ecaef2617d8c6a7.js @@ -0,0 +1 @@ +try{}catch(a){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8ed2a171ab34c301.js b/compiler/tests-js-parser/pass/8ed2a171ab34c301.js new file mode 100644 index 000000000..b28918441 --- /dev/null +++ b/compiler/tests-js-parser/pass/8ed2a171ab34c301.js @@ -0,0 +1 @@ +eval++ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8ed2fce2b9b43fb7.js b/compiler/tests-js-parser/pass/8ed2fce2b9b43fb7.js new file mode 100644 index 000000000..e413f6f00 --- /dev/null +++ b/compiler/tests-js-parser/pass/8ed2fce2b9b43fb7.js @@ -0,0 +1 @@ +a(b, ...c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8ef08a335a7f5966.js b/compiler/tests-js-parser/pass/8ef08a335a7f5966.js new file mode 100644 index 000000000..bfa3e287f --- /dev/null +++ b/compiler/tests-js-parser/pass/8ef08a335a7f5966.js @@ -0,0 +1,2 @@ + a.b('c'); + a.b.d(a, arguments); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8f0084b1073e1877.js b/compiler/tests-js-parser/pass/8f0084b1073e1877.js new file mode 100644 index 000000000..76db7e46e --- /dev/null +++ b/compiler/tests-js-parser/pass/8f0084b1073e1877.js @@ -0,0 +1 @@ +(a, 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8f4f97274dea4723.js b/compiler/tests-js-parser/pass/8f4f97274dea4723.js new file mode 100644 index 000000000..30067aba6 --- /dev/null +++ b/compiler/tests-js-parser/pass/8f4f97274dea4723.js @@ -0,0 +1,7 @@ +(function() { + a: { + break a; + b(); // This should be removed. + } + c(); +}()); diff --git a/compiler/tests-js-parser/pass/8f659ed872554f99.js b/compiler/tests-js-parser/pass/8f659ed872554f99.js new file mode 100644 index 000000000..088e5f0af --- /dev/null +++ b/compiler/tests-js-parser/pass/8f659ed872554f99.js @@ -0,0 +1 @@ +class a { static get() {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8f8a9f6ca890939e.js b/compiler/tests-js-parser/pass/8f8a9f6ca890939e.js new file mode 100644 index 000000000..8e105b3b2 --- /dev/null +++ b/compiler/tests-js-parser/pass/8f8a9f6ca890939e.js @@ -0,0 +1 @@ +({__proto__:1}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8f8bfb27569ac008.js b/compiler/tests-js-parser/pass/8f8bfb27569ac008.js new file mode 100644 index 000000000..addac7172 --- /dev/null +++ b/compiler/tests-js-parser/pass/8f8bfb27569ac008.js @@ -0,0 +1 @@ +'use strict'; eval[1] = 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8f9e8be5a6c50e77.js b/compiler/tests-js-parser/pass/8f9e8be5a6c50e77.js new file mode 100644 index 000000000..6caea0055 --- /dev/null +++ b/compiler/tests-js-parser/pass/8f9e8be5a6c50e77.js @@ -0,0 +1,3 @@ +function a() { + return function b(c) {}; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/8fcaa7f3f8926a5e.js b/compiler/tests-js-parser/pass/8fcaa7f3f8926a5e.js new file mode 100644 index 000000000..1dc8b282e --- /dev/null +++ b/compiler/tests-js-parser/pass/8fcaa7f3f8926a5e.js @@ -0,0 +1 @@ +0B1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9013f39c33dc8416.js b/compiler/tests-js-parser/pass/9013f39c33dc8416.js new file mode 100644 index 000000000..ddea062b4 --- /dev/null +++ b/compiler/tests-js-parser/pass/9013f39c33dc8416.js @@ -0,0 +1 @@ +throw a; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/901fca17189cd709.js b/compiler/tests-js-parser/pass/901fca17189cd709.js new file mode 100644 index 000000000..73828aea2 --- /dev/null +++ b/compiler/tests-js-parser/pass/901fca17189cd709.js @@ -0,0 +1 @@ +function* a(){(class {[yield](){}})}; diff --git a/compiler/tests-js-parser/pass/9027dae72a91a9ed.js b/compiler/tests-js-parser/pass/9027dae72a91a9ed.js new file mode 100644 index 000000000..5ad5c7774 --- /dev/null +++ b/compiler/tests-js-parser/pass/9027dae72a91a9ed.js @@ -0,0 +1 @@ +((a)) = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9036914be00c0dc7.js b/compiler/tests-js-parser/pass/9036914be00c0dc7.js new file mode 100644 index 000000000..e5ef4005d --- /dev/null +++ b/compiler/tests-js-parser/pass/9036914be00c0dc7.js @@ -0,0 +1 @@ +(a, b, [c]) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/903dd05bf49c8fac.js b/compiler/tests-js-parser/pass/903dd05bf49c8fac.js new file mode 100644 index 000000000..2d9cced35 --- /dev/null +++ b/compiler/tests-js-parser/pass/903dd05bf49c8fac.js @@ -0,0 +1,2 @@ +a(b, ...c); +a(...d); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/906e545ceef0fcfd.js b/compiler/tests-js-parser/pass/906e545ceef0fcfd.js new file mode 100644 index 000000000..ebe5efc4e --- /dev/null +++ b/compiler/tests-js-parser/pass/906e545ceef0fcfd.js @@ -0,0 +1,4 @@ +(function() { +if (a) throw b; +else throw c; +}()); diff --git a/compiler/tests-js-parser/pass/90919cd6fd06c4d8.js b/compiler/tests-js-parser/pass/90919cd6fd06c4d8.js new file mode 100644 index 000000000..0447b3429 --- /dev/null +++ b/compiler/tests-js-parser/pass/90919cd6fd06c4d8.js @@ -0,0 +1 @@ +function *a(){yield a} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/90abe26c46af6975.js b/compiler/tests-js-parser/pass/90abe26c46af6975.js new file mode 100644 index 000000000..fe8a313f2 --- /dev/null +++ b/compiler/tests-js-parser/pass/90abe26c46af6975.js @@ -0,0 +1 @@ +function yield(){} diff --git a/compiler/tests-js-parser/pass/90ad0135b905a622.js b/compiler/tests-js-parser/pass/90ad0135b905a622.js new file mode 100644 index 000000000..33715a22c --- /dev/null +++ b/compiler/tests-js-parser/pass/90ad0135b905a622.js @@ -0,0 +1,4 @@ +function a() { + var b = 1; + c && (2, 3, d, b); +} diff --git a/compiler/tests-js-parser/pass/90fa9751ab71ce28.js b/compiler/tests-js-parser/pass/90fa9751ab71ce28.js new file mode 100644 index 000000000..31019ce50 --- /dev/null +++ b/compiler/tests-js-parser/pass/90fa9751ab71ce28.js @@ -0,0 +1,7 @@ +(function () { + var a; + with (b) { + a; + } + a = a += 1; // This should be reduce +}()); diff --git a/compiler/tests-js-parser/pass/914ae3168da48965.js b/compiler/tests-js-parser/pass/914ae3168da48965.js new file mode 100644 index 000000000..8f964f4d2 --- /dev/null +++ b/compiler/tests-js-parser/pass/914ae3168da48965.js @@ -0,0 +1 @@ +throw {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9159ea4175a5a021.js b/compiler/tests-js-parser/pass/9159ea4175a5a021.js new file mode 100644 index 000000000..3554e7782 --- /dev/null +++ b/compiler/tests-js-parser/pass/9159ea4175a5a021.js @@ -0,0 +1 @@ +for(a = 1; a < 2; a++); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/918e105a2ff6c64a.js b/compiler/tests-js-parser/pass/918e105a2ff6c64a.js new file mode 100644 index 000000000..339cc6f99 --- /dev/null +++ b/compiler/tests-js-parser/pass/918e105a2ff6c64a.js @@ -0,0 +1 @@ +class a extends b {get c() {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/91cbb6971c86509e.js b/compiler/tests-js-parser/pass/91cbb6971c86509e.js new file mode 100644 index 000000000..8c9c5d60e --- /dev/null +++ b/compiler/tests-js-parser/pass/91cbb6971c86509e.js @@ -0,0 +1 @@ +({a = 1}, {b = 2}, {c = 3})=>4 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/91f2fa0b11550b30.js b/compiler/tests-js-parser/pass/91f2fa0b11550b30.js new file mode 100644 index 000000000..5f26a7256 --- /dev/null +++ b/compiler/tests-js-parser/pass/91f2fa0b11550b30.js @@ -0,0 +1 @@ +function *a(){yield "a"} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9203cb34e9b091dc.js b/compiler/tests-js-parser/pass/9203cb34e9b091dc.js new file mode 100644 index 000000000..bbd819ea6 --- /dev/null +++ b/compiler/tests-js-parser/pass/9203cb34e9b091dc.js @@ -0,0 +1 @@ +a: if (true) break a; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9208254b5f8a8481.js b/compiler/tests-js-parser/pass/9208254b5f8a8481.js new file mode 100644 index 000000000..e4bd773f2 --- /dev/null +++ b/compiler/tests-js-parser/pass/9208254b5f8a8481.js @@ -0,0 +1 @@ +a == b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/923c99b441ab5a26.js b/compiler/tests-js-parser/pass/923c99b441ab5a26.js new file mode 100644 index 000000000..b363b67d5 --- /dev/null +++ b/compiler/tests-js-parser/pass/923c99b441ab5a26.js @@ -0,0 +1,10 @@ +var a = [ "b", "c", "d" ].e(""); +var f = [ "b", "c", "d" ].e(); +var g = [ "b", 1, 2, 3, "c" ].e(""); +var h = [ i(), "b", 4, 5, 6, "c", c() ].e(""); +var j = [ i(), c(), "b", 7, 8, 9, "c", c() ].e(""); +var k = [ 10, 11, "b", "c", d() ].e(""); +var l = [ "b", 12 + 13 + "c", "d" ].e("m"); +var n = [].e(b + c); +var o = [].e(""); +var p = [].e("b"); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/925443c6cf79aa88.js b/compiler/tests-js-parser/pass/925443c6cf79aa88.js new file mode 100644 index 000000000..f1c4965ac --- /dev/null +++ b/compiler/tests-js-parser/pass/925443c6cf79aa88.js @@ -0,0 +1,2 @@ +// ContinueStatement should not be removed. +a: do do continue a; while(true); while(true); diff --git a/compiler/tests-js-parser/pass/927b1e0dd52248a6.js b/compiler/tests-js-parser/pass/927b1e0dd52248a6.js new file mode 100644 index 000000000..3be1a6133 --- /dev/null +++ b/compiler/tests-js-parser/pass/927b1e0dd52248a6.js @@ -0,0 +1,3 @@ +with (a) { + b; +} diff --git a/compiler/tests-js-parser/pass/927efb51d4882ccb.js b/compiler/tests-js-parser/pass/927efb51d4882ccb.js new file mode 100644 index 000000000..d8eadd41b --- /dev/null +++ b/compiler/tests-js-parser/pass/927efb51d4882ccb.js @@ -0,0 +1,3 @@ +(function() { + 1/-2; +}()); diff --git a/compiler/tests-js-parser/pass/92a997b1ba17876e.js b/compiler/tests-js-parser/pass/92a997b1ba17876e.js new file mode 100644 index 000000000..588971232 --- /dev/null +++ b/compiler/tests-js-parser/pass/92a997b1ba17876e.js @@ -0,0 +1 @@ +({a = 1}) => a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/92dd079c741d2a95.js b/compiler/tests-js-parser/pass/92dd079c741d2a95.js new file mode 100644 index 000000000..8d0a32a20 --- /dev/null +++ b/compiler/tests-js-parser/pass/92dd079c741d2a95.js @@ -0,0 +1 @@ +a <= b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/92fd8e24864fde0a.js b/compiler/tests-js-parser/pass/92fd8e24864fde0a.js new file mode 100644 index 000000000..3c11654b6 --- /dev/null +++ b/compiler/tests-js-parser/pass/92fd8e24864fde0a.js @@ -0,0 +1 @@ +(function eval() { }); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/93108a695e5ff29d.js b/compiler/tests-js-parser/pass/93108a695e5ff29d.js new file mode 100644 index 000000000..cba41a556 --- /dev/null +++ b/compiler/tests-js-parser/pass/93108a695e5ff29d.js @@ -0,0 +1,25 @@ +(function () { + var a + if (b) return /* I would + insert something + there, but I'm sort + of lazy so whatever. + */ a = new c() + return a +})() + +(function () { + var a + if (b) return /* I would insert something there, */ /* + but I'm sort of lazy so + */ /* whatever. */ a = new c() + return a +})() + +(function () { + var a + if (b) return // I would insert something there, but I'm sort of lazy so whatever. + a = new c() + return a +})() + diff --git a/compiler/tests-js-parser/pass/9312a1adbbf0a4c0.js b/compiler/tests-js-parser/pass/9312a1adbbf0a4c0.js new file mode 100644 index 000000000..9f5fb105a --- /dev/null +++ b/compiler/tests-js-parser/pass/9312a1adbbf0a4c0.js @@ -0,0 +1 @@ +debugger; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9331c78bb0fc6a55.js b/compiler/tests-js-parser/pass/9331c78bb0fc6a55.js new file mode 100644 index 000000000..48abbc906 --- /dev/null +++ b/compiler/tests-js-parser/pass/9331c78bb0fc6a55.js @@ -0,0 +1,2 @@ +// do not transform to 0 +-1 diff --git a/compiler/tests-js-parser/pass/9349f48a456341b8.js b/compiler/tests-js-parser/pass/9349f48a456341b8.js new file mode 100644 index 000000000..65c6acbc3 --- /dev/null +++ b/compiler/tests-js-parser/pass/9349f48a456341b8.js @@ -0,0 +1 @@ +new a().b() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/937059a5e53177e5.js b/compiler/tests-js-parser/pass/937059a5e53177e5.js new file mode 100644 index 000000000..9848b0a2b --- /dev/null +++ b/compiler/tests-js-parser/pass/937059a5e53177e5.js @@ -0,0 +1 @@ +[...[...a[b]]] = c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/939479d60d564ccd.js b/compiler/tests-js-parser/pass/939479d60d564ccd.js new file mode 100644 index 000000000..d0544dbf0 --- /dev/null +++ b/compiler/tests-js-parser/pass/939479d60d564ccd.js @@ -0,0 +1 @@ +({ *a(b, c, d) {} }) diff --git a/compiler/tests-js-parser/pass/93bd9d668ac308a0.js b/compiler/tests-js-parser/pass/93bd9d668ac308a0.js new file mode 100644 index 000000000..2dfab5550 --- /dev/null +++ b/compiler/tests-js-parser/pass/93bd9d668ac308a0.js @@ -0,0 +1,4 @@ +var a = function(b) { + b(); + a() +} diff --git a/compiler/tests-js-parser/pass/93c32bb0a4bad388.module.js b/compiler/tests-js-parser/pass/93c32bb0a4bad388.module.js new file mode 100644 index 000000000..54fcb4dba --- /dev/null +++ b/compiler/tests-js-parser/pass/93c32bb0a4bad388.module.js @@ -0,0 +1 @@ +import {default as a} from "foo"; diff --git a/compiler/tests-js-parser/pass/93c75264893587a5.js b/compiler/tests-js-parser/pass/93c75264893587a5.js new file mode 100644 index 000000000..09daccad9 --- /dev/null +++ b/compiler/tests-js-parser/pass/93c75264893587a5.js @@ -0,0 +1 @@ +({ *yield() {} }) diff --git a/compiler/tests-js-parser/pass/93cac77bbf2242ab.js b/compiler/tests-js-parser/pass/93cac77bbf2242ab.js new file mode 100644 index 000000000..6775a0def --- /dev/null +++ b/compiler/tests-js-parser/pass/93cac77bbf2242ab.js @@ -0,0 +1 @@ +(a(),b(),c()) + (d(),e(),f()); diff --git a/compiler/tests-js-parser/pass/93d4c5dfbddf859d.js b/compiler/tests-js-parser/pass/93d4c5dfbddf859d.js new file mode 100644 index 000000000..aa16c6467 --- /dev/null +++ b/compiler/tests-js-parser/pass/93d4c5dfbddf859d.js @@ -0,0 +1,4 @@ +if (a) { if (b) c; } else d; +if (a) { if (b) throw c; } else d; +if (a) { with (a) if (b) throw c; } else d; +if (a) { do if (b) throw c; while (a) } else d; diff --git a/compiler/tests-js-parser/pass/9427da8abb4e7c67.js b/compiler/tests-js-parser/pass/9427da8abb4e7c67.js new file mode 100644 index 000000000..90bdacdf4 --- /dev/null +++ b/compiler/tests-js-parser/pass/9427da8abb4e7c67.js @@ -0,0 +1 @@ +ⅣⅡ  \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/946bee37652a31fa.js b/compiler/tests-js-parser/pass/946bee37652a31fa.js new file mode 100644 index 000000000..a0848a231 --- /dev/null +++ b/compiler/tests-js-parser/pass/946bee37652a31fa.js @@ -0,0 +1 @@ +/* block comment */--> comment \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/94846b0ae1cac1a2.js b/compiler/tests-js-parser/pass/94846b0ae1cac1a2.js new file mode 100644 index 000000000..559b28930 --- /dev/null +++ b/compiler/tests-js-parser/pass/94846b0ae1cac1a2.js @@ -0,0 +1 @@ +void void void /test/ diff --git a/compiler/tests-js-parser/pass/9495a0dcecf5713c.js b/compiler/tests-js-parser/pass/9495a0dcecf5713c.js new file mode 100644 index 000000000..1f56c40c6 --- /dev/null +++ b/compiler/tests-js-parser/pass/9495a0dcecf5713c.js @@ -0,0 +1 @@ +({[a]:()=>{}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/94b8a654a87039b9.js b/compiler/tests-js-parser/pass/94b8a654a87039b9.js new file mode 100644 index 000000000..f5843d784 --- /dev/null +++ b/compiler/tests-js-parser/pass/94b8a654a87039b9.js @@ -0,0 +1 @@ +(function*(a, b, c) {}) diff --git a/compiler/tests-js-parser/pass/94be09b126b946b8.js b/compiler/tests-js-parser/pass/94be09b126b946b8.js new file mode 100644 index 000000000..7dbba96ac --- /dev/null +++ b/compiler/tests-js-parser/pass/94be09b126b946b8.js @@ -0,0 +1,3 @@ +` + + ` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/94c72b68d8726b07.js b/compiler/tests-js-parser/pass/94c72b68d8726b07.js new file mode 100644 index 000000000..05d8d5805 --- /dev/null +++ b/compiler/tests-js-parser/pass/94c72b68d8726b07.js @@ -0,0 +1 @@ +(1, a) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/94cb828d5dcfd136.js b/compiler/tests-js-parser/pass/94cb828d5dcfd136.js new file mode 100644 index 000000000..4a6beaf12 --- /dev/null +++ b/compiler/tests-js-parser/pass/94cb828d5dcfd136.js @@ -0,0 +1 @@ +try { } catch (arguments) { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/951e1b875db534f9.js b/compiler/tests-js-parser/pass/951e1b875db534f9.js new file mode 100644 index 000000000..7d0842b57 --- /dev/null +++ b/compiler/tests-js-parser/pass/951e1b875db534f9.js @@ -0,0 +1 @@ +a = (1) ? 2 : 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/95408309cc3a1d30.js b/compiler/tests-js-parser/pass/95408309cc3a1d30.js new file mode 100644 index 000000000..bfa874c11 --- /dev/null +++ b/compiler/tests-js-parser/pass/95408309cc3a1d30.js @@ -0,0 +1,8 @@ +function a() { + if (void 1) { + var b = 2; + } else { + c(a); + } + c(b); +} diff --git a/compiler/tests-js-parser/pass/954a896471379dc8.js b/compiler/tests-js-parser/pass/954a896471379dc8.js new file mode 100644 index 000000000..4655c4761 --- /dev/null +++ b/compiler/tests-js-parser/pass/954a896471379dc8.js @@ -0,0 +1 @@ +[a, ...a] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/95520bedf0fdd4c9.js b/compiler/tests-js-parser/pass/95520bedf0fdd4c9.js new file mode 100644 index 000000000..aba90da2d --- /dev/null +++ b/compiler/tests-js-parser/pass/95520bedf0fdd4c9.js @@ -0,0 +1,6 @@ +function a() { + b,c,d; + if (e) { + throw 'f' + } +} diff --git a/compiler/tests-js-parser/pass/955c5fedb3931500.js b/compiler/tests-js-parser/pass/955c5fedb3931500.js new file mode 100644 index 000000000..e1d0efb86 --- /dev/null +++ b/compiler/tests-js-parser/pass/955c5fedb3931500.js @@ -0,0 +1 @@ +'a' + 'a' diff --git a/compiler/tests-js-parser/pass/95ab0d795c04ff38.js b/compiler/tests-js-parser/pass/95ab0d795c04ff38.js new file mode 100644 index 000000000..a825b22e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/95ab0d795c04ff38.js @@ -0,0 +1 @@ +('\111') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/96059002704b3ac3.js b/compiler/tests-js-parser/pass/96059002704b3ac3.js new file mode 100644 index 000000000..1ae7d1477 --- /dev/null +++ b/compiler/tests-js-parser/pass/96059002704b3ac3.js @@ -0,0 +1,8 @@ +for (;a();) { + b(); + c(); + if (d()) e(); + else break; + f(); + g(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9677a7160d769b1a.js b/compiler/tests-js-parser/pass/9677a7160d769b1a.js new file mode 100644 index 000000000..5d3cda87a --- /dev/null +++ b/compiler/tests-js-parser/pass/9677a7160d769b1a.js @@ -0,0 +1,3 @@ +var a = { + delete: 1 +}; diff --git a/compiler/tests-js-parser/pass/9681f5d844d7acd0.js b/compiler/tests-js-parser/pass/9681f5d844d7acd0.js new file mode 100644 index 000000000..9ed326fed --- /dev/null +++ b/compiler/tests-js-parser/pass/9681f5d844d7acd0.js @@ -0,0 +1,8 @@ +(a) => b; // 1 args +(a, b) => c; // n args +() => b; // 0 args +(a) => (b) => c; // func returns func returns func +(a) => ((b) => c); // So these parens are dropped +() => (b,c) => d; // func returns func returns func +a=>{return b;} +a => 'e'; // Dropping the parens \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/96909e1dce85ca53.module.js b/compiler/tests-js-parser/pass/96909e1dce85ca53.module.js new file mode 100644 index 000000000..aef22247d --- /dev/null +++ b/compiler/tests-js-parser/pass/96909e1dce85ca53.module.js @@ -0,0 +1 @@ +export default 1; diff --git a/compiler/tests-js-parser/pass/96941f16c2d7cec4.js b/compiler/tests-js-parser/pass/96941f16c2d7cec4.js new file mode 100644 index 000000000..fb1d9db6a --- /dev/null +++ b/compiler/tests-js-parser/pass/96941f16c2d7cec4.js @@ -0,0 +1 @@ +(a)=(1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/96e1b294d19a101d.js b/compiler/tests-js-parser/pass/96e1b294d19a101d.js new file mode 100644 index 000000000..c0679a91b --- /dev/null +++ b/compiler/tests-js-parser/pass/96e1b294d19a101d.js @@ -0,0 +1 @@ +(a) => "b" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/96ea36bc180f25d5.js b/compiler/tests-js-parser/pass/96ea36bc180f25d5.js new file mode 100644 index 000000000..79c28a61e --- /dev/null +++ b/compiler/tests-js-parser/pass/96ea36bc180f25d5.js @@ -0,0 +1 @@ +with (a) b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/96f5d93be9a54573.js b/compiler/tests-js-parser/pass/96f5d93be9a54573.js new file mode 100644 index 000000000..c1a6b847b --- /dev/null +++ b/compiler/tests-js-parser/pass/96f5d93be9a54573.js @@ -0,0 +1,3 @@ +({a, b}); +[{a}]; +a({c}); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/970fb35ce6ce89bb.js b/compiler/tests-js-parser/pass/970fb35ce6ce89bb.js new file mode 100644 index 000000000..b6542bbd7 --- /dev/null +++ b/compiler/tests-js-parser/pass/970fb35ce6ce89bb.js @@ -0,0 +1,6 @@ +function a() { + var a = 1; + function b() { + var c = a; + } +} diff --git a/compiler/tests-js-parser/pass/973cbc9ece13acbc.js b/compiler/tests-js-parser/pass/973cbc9ece13acbc.js new file mode 100644 index 000000000..3a0bac93f --- /dev/null +++ b/compiler/tests-js-parser/pass/973cbc9ece13acbc.js @@ -0,0 +1 @@ +function* a() {} function a() {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/974e7275fdedce49.js b/compiler/tests-js-parser/pass/974e7275fdedce49.js new file mode 100644 index 000000000..82865119a --- /dev/null +++ b/compiler/tests-js-parser/pass/974e7275fdedce49.js @@ -0,0 +1 @@ +1 .a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/97593deb177d09ae.js b/compiler/tests-js-parser/pass/97593deb177d09ae.js new file mode 100644 index 000000000..b014b939d --- /dev/null +++ b/compiler/tests-js-parser/pass/97593deb177d09ae.js @@ -0,0 +1 @@ +function a(b, c) { return b-- >>> c; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/976afd9ae5f5d71a.module.js b/compiler/tests-js-parser/pass/976afd9ae5f5d71a.module.js new file mode 100644 index 000000000..70963b44d --- /dev/null +++ b/compiler/tests-js-parser/pass/976afd9ae5f5d71a.module.js @@ -0,0 +1,2 @@ +export function a(){} +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/979b36a2c530f286.js b/compiler/tests-js-parser/pass/979b36a2c530f286.js new file mode 100644 index 000000000..6bebae432 --- /dev/null +++ b/compiler/tests-js-parser/pass/979b36a2c530f286.js @@ -0,0 +1 @@ +var { a: yield } = b; diff --git a/compiler/tests-js-parser/pass/97e246302dfe8616.js b/compiler/tests-js-parser/pass/97e246302dfe8616.js new file mode 100644 index 000000000..00d71d21d --- /dev/null +++ b/compiler/tests-js-parser/pass/97e246302dfe8616.js @@ -0,0 +1 @@ +function a(b, c) { return b << !--c; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/982595e2af9d9703.js b/compiler/tests-js-parser/pass/982595e2af9d9703.js new file mode 100644 index 000000000..7b1f89720 --- /dev/null +++ b/compiler/tests-js-parser/pass/982595e2af9d9703.js @@ -0,0 +1 @@ +for(a = 1; a < 2; a++) b(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/982835d8c977075c.js b/compiler/tests-js-parser/pass/982835d8c977075c.js new file mode 100644 index 000000000..62ad76193 --- /dev/null +++ b/compiler/tests-js-parser/pass/982835d8c977075c.js @@ -0,0 +1 @@ +/a/; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/988e362ed9ddcac5.js b/compiler/tests-js-parser/pass/988e362ed9ddcac5.js new file mode 100644 index 000000000..22e354988 --- /dev/null +++ b/compiler/tests-js-parser/pass/988e362ed9ddcac5.js @@ -0,0 +1 @@ +(a**b).c=1 diff --git a/compiler/tests-js-parser/pass/988f8a06b68457ef.js b/compiler/tests-js-parser/pass/988f8a06b68457ef.js new file mode 100644 index 000000000..e8ddfa4b2 --- /dev/null +++ b/compiler/tests-js-parser/pass/988f8a06b68457ef.js @@ -0,0 +1 @@ +T‿ = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/98c7fb7947f7eae4.js b/compiler/tests-js-parser/pass/98c7fb7947f7eae4.js new file mode 100644 index 000000000..319fb3881 --- /dev/null +++ b/compiler/tests-js-parser/pass/98c7fb7947f7eae4.js @@ -0,0 +1 @@ +eval-- \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/98df58b0c40fac90.js b/compiler/tests-js-parser/pass/98df58b0c40fac90.js new file mode 100644 index 000000000..6493ec1ca --- /dev/null +++ b/compiler/tests-js-parser/pass/98df58b0c40fac90.js @@ -0,0 +1 @@ +a = function(){}(b()) diff --git a/compiler/tests-js-parser/pass/993584ec37388320.js b/compiler/tests-js-parser/pass/993584ec37388320.js new file mode 100644 index 000000000..414f2cec6 --- /dev/null +++ b/compiler/tests-js-parser/pass/993584ec37388320.js @@ -0,0 +1 @@ +0b1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9949a2e1a6844836.module.js b/compiler/tests-js-parser/pass/9949a2e1a6844836.module.js new file mode 100644 index 000000000..252af86dd --- /dev/null +++ b/compiler/tests-js-parser/pass/9949a2e1a6844836.module.js @@ -0,0 +1 @@ +(function* () { yield a }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/996001e00a0c575b.js b/compiler/tests-js-parser/pass/996001e00a0c575b.js new file mode 100644 index 000000000..ca296b443 --- /dev/null +++ b/compiler/tests-js-parser/pass/996001e00a0c575b.js @@ -0,0 +1 @@ +({a}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9974571a855d4447.js b/compiler/tests-js-parser/pass/9974571a855d4447.js new file mode 100644 index 000000000..1caa742a4 --- /dev/null +++ b/compiler/tests-js-parser/pass/9974571a855d4447.js @@ -0,0 +1 @@ +function *a(){yield false} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9975820eb10bc0ff.js b/compiler/tests-js-parser/pass/9975820eb10bc0ff.js new file mode 100644 index 000000000..23edb9cd2 --- /dev/null +++ b/compiler/tests-js-parser/pass/9975820eb10bc0ff.js @@ -0,0 +1 @@ +for (;;) { a(); continue; b(); } diff --git a/compiler/tests-js-parser/pass/999c1001e3761320.js b/compiler/tests-js-parser/pass/999c1001e3761320.js new file mode 100644 index 000000000..6eb52a6cf --- /dev/null +++ b/compiler/tests-js-parser/pass/999c1001e3761320.js @@ -0,0 +1 @@ +`abc` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/99cdfc40e20af6f5.js b/compiler/tests-js-parser/pass/99cdfc40e20af6f5.js new file mode 100644 index 000000000..b32bc253d --- /dev/null +++ b/compiler/tests-js-parser/pass/99cdfc40e20af6f5.js @@ -0,0 +1 @@ +var a = function(){}(b()) diff --git a/compiler/tests-js-parser/pass/99fceed987b8ec3d.js b/compiler/tests-js-parser/pass/99fceed987b8ec3d.js new file mode 100644 index 000000000..6c86edb03 --- /dev/null +++ b/compiler/tests-js-parser/pass/99fceed987b8ec3d.js @@ -0,0 +1 @@ +function a(...[]) { } diff --git a/compiler/tests-js-parser/pass/9a5b92dfd9d19f60.js b/compiler/tests-js-parser/pass/9a5b92dfd9d19f60.js new file mode 100644 index 000000000..a6c02f115 --- /dev/null +++ b/compiler/tests-js-parser/pass/9a5b92dfd9d19f60.js @@ -0,0 +1,2 @@ + 1 + diff --git a/compiler/tests-js-parser/pass/9a666205cafd530f.js b/compiler/tests-js-parser/pass/9a666205cafd530f.js new file mode 100644 index 000000000..99acd4f4f --- /dev/null +++ b/compiler/tests-js-parser/pass/9a666205cafd530f.js @@ -0,0 +1 @@ +function *a(){({b(){yield}})} diff --git a/compiler/tests-js-parser/pass/9a6711e879a99536.js b/compiler/tests-js-parser/pass/9a6711e879a99536.js new file mode 100644 index 000000000..0cdc700ff --- /dev/null +++ b/compiler/tests-js-parser/pass/9a6711e879a99536.js @@ -0,0 +1 @@ +{ let a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9a7f06880ce32bbc.js b/compiler/tests-js-parser/pass/9a7f06880ce32bbc.js new file mode 100644 index 000000000..166293021 --- /dev/null +++ b/compiler/tests-js-parser/pass/9a7f06880ce32bbc.js @@ -0,0 +1 @@ +a=1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9a9cb616daadf90a.js b/compiler/tests-js-parser/pass/9a9cb616daadf90a.js new file mode 100644 index 000000000..06e0e35b3 --- /dev/null +++ b/compiler/tests-js-parser/pass/9a9cb616daadf90a.js @@ -0,0 +1 @@ +(function(){ return a; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9aa93e1e417ce8e3.js b/compiler/tests-js-parser/pass/9aa93e1e417ce8e3.js new file mode 100644 index 000000000..4479fddca --- /dev/null +++ b/compiler/tests-js-parser/pass/9aa93e1e417ce8e3.js @@ -0,0 +1 @@ +for (let in a) {} diff --git a/compiler/tests-js-parser/pass/9b9d0e250e01155d.js b/compiler/tests-js-parser/pass/9b9d0e250e01155d.js new file mode 100644 index 000000000..5b29037f0 --- /dev/null +++ b/compiler/tests-js-parser/pass/9b9d0e250e01155d.js @@ -0,0 +1,6 @@ +var a, b; +if (c()) { + a = new b(1); +} else { + a = new b(2); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9bcae7c7f00b4e3c.js b/compiler/tests-js-parser/pass/9bcae7c7f00b4e3c.js new file mode 100644 index 000000000..6553564dd --- /dev/null +++ b/compiler/tests-js-parser/pass/9bcae7c7f00b4e3c.js @@ -0,0 +1 @@ +(function a(...[ b, c ]){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9c30b0817f412a30.js b/compiler/tests-js-parser/pass/9c30b0817f412a30.js new file mode 100644 index 000000000..daba46482 --- /dev/null +++ b/compiler/tests-js-parser/pass/9c30b0817f412a30.js @@ -0,0 +1 @@ +(function(){ return {} })().a = 1; // should not transform this one \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9cf32425f04fd865.js b/compiler/tests-js-parser/pass/9cf32425f04fd865.js new file mode 100644 index 000000000..d92871ecd --- /dev/null +++ b/compiler/tests-js-parser/pass/9cf32425f04fd865.js @@ -0,0 +1 @@ +`${a}${b}` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9d0fd95dd43f59ec.js b/compiler/tests-js-parser/pass/9d0fd95dd43f59ec.js new file mode 100644 index 000000000..90b67cec0 --- /dev/null +++ b/compiler/tests-js-parser/pass/9d0fd95dd43f59ec.js @@ -0,0 +1 @@ +1 /* The * answer */ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9d1320f0185b1586.js b/compiler/tests-js-parser/pass/9d1320f0185b1586.js new file mode 100644 index 000000000..c0f8695a5 --- /dev/null +++ b/compiler/tests-js-parser/pass/9d1320f0185b1586.js @@ -0,0 +1 @@ +a[b](b,c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9d3d960e32528788.js b/compiler/tests-js-parser/pass/9d3d960e32528788.js new file mode 100644 index 000000000..f4e954b13 --- /dev/null +++ b/compiler/tests-js-parser/pass/9d3d960e32528788.js @@ -0,0 +1 @@ +(function () {} / 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9d935d1b787ed251.js b/compiler/tests-js-parser/pass/9d935d1b787ed251.js new file mode 100644 index 000000000..731e83b05 --- /dev/null +++ b/compiler/tests-js-parser/pass/9d935d1b787ed251.js @@ -0,0 +1,2 @@ +// +;a; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9db4dccf1122bfc4.js b/compiler/tests-js-parser/pass/9db4dccf1122bfc4.js new file mode 100644 index 000000000..ed2994434 --- /dev/null +++ b/compiler/tests-js-parser/pass/9db4dccf1122bfc4.js @@ -0,0 +1 @@ +new new a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9db573299f02bf36.js b/compiler/tests-js-parser/pass/9db573299f02bf36.js new file mode 100644 index 000000000..3c97d1bf4 --- /dev/null +++ b/compiler/tests-js-parser/pass/9db573299f02bf36.js @@ -0,0 +1,10 @@ +var a = [ "b", "c", d(), "e", "f", "g" ].h(""); +var i = [ "b", "c", d(), "e", "f", "g" ].h("j"); +var k = [ "b", "c", d(), "e", "f", "g" ].h("l"); +var m = [ "b", "c", d(), + [ "b", 1, 2, 3, "c" ].h("+"), + "e", "f", "g" ].h("j"); +var n = [ "b", "c", d(), + [ "b", 4, 5, 6, "c" ].h("+"), + "e", "f", "g" ].h("l"); +var o = [ "p", "p" + q, "b", "c", "r" + b ].h(""); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9dc20e081005fba4.js b/compiler/tests-js-parser/pass/9dc20e081005fba4.js new file mode 100644 index 000000000..994a19a16 --- /dev/null +++ b/compiler/tests-js-parser/pass/9dc20e081005fba4.js @@ -0,0 +1,11 @@ +a = { + b(c, d) { + return a; + } +} +e = { + b([{c}]) { + return c; + }, + f(){} +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9dfa08b5b7ad82a9.js b/compiler/tests-js-parser/pass/9dfa08b5b7ad82a9.js new file mode 100644 index 000000000..964cfa868 --- /dev/null +++ b/compiler/tests-js-parser/pass/9dfa08b5b7ad82a9.js @@ -0,0 +1 @@ +var [a, ...b] = c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9e3e46891aaf13de.js b/compiler/tests-js-parser/pass/9e3e46891aaf13de.js new file mode 100644 index 000000000..b9a5a147e --- /dev/null +++ b/compiler/tests-js-parser/pass/9e3e46891aaf13de.js @@ -0,0 +1 @@ +let {a:b} = {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9e98dbfde77e3dfe.js b/compiler/tests-js-parser/pass/9e98dbfde77e3dfe.js new file mode 100644 index 000000000..fed93946d --- /dev/null +++ b/compiler/tests-js-parser/pass/9e98dbfde77e3dfe.js @@ -0,0 +1 @@ +[ ,, 1 ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9ec644dbf797e95c.js b/compiler/tests-js-parser/pass/9ec644dbf797e95c.js new file mode 100644 index 000000000..87d25dc33 --- /dev/null +++ b/compiler/tests-js-parser/pass/9ec644dbf797e95c.js @@ -0,0 +1 @@ +('\`') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9ed0369295348e76.js b/compiler/tests-js-parser/pass/9ed0369295348e76.js new file mode 100644 index 000000000..41de3baa5 --- /dev/null +++ b/compiler/tests-js-parser/pass/9ed0369295348e76.js @@ -0,0 +1,6 @@ +(function() { + return 1; + { + var a = 2; + } +}()); diff --git a/compiler/tests-js-parser/pass/9f0d8eb6f7ab8180.js b/compiler/tests-js-parser/pass/9f0d8eb6f7ab8180.js new file mode 100644 index 000000000..3f3e68ee9 --- /dev/null +++ b/compiler/tests-js-parser/pass/9f0d8eb6f7ab8180.js @@ -0,0 +1,2 @@ +/* +*/--> \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9f23d57c37e238cb.js b/compiler/tests-js-parser/pass/9f23d57c37e238cb.js new file mode 100644 index 000000000..2ba3226e8 --- /dev/null +++ b/compiler/tests-js-parser/pass/9f23d57c37e238cb.js @@ -0,0 +1,8 @@ +/** + * @type {number} + */ +var a = 1, + /** + * @type {number} + */ + b = 2; diff --git a/compiler/tests-js-parser/pass/9f272d23fc62842a.js b/compiler/tests-js-parser/pass/9f272d23fc62842a.js new file mode 100644 index 000000000..843a45fb1 --- /dev/null +++ b/compiler/tests-js-parser/pass/9f272d23fc62842a.js @@ -0,0 +1 @@ +a || (b || c) diff --git a/compiler/tests-js-parser/pass/9fd584806e085e35.js b/compiler/tests-js-parser/pass/9fd584806e085e35.js new file mode 100644 index 000000000..e8e6cace7 --- /dev/null +++ b/compiler/tests-js-parser/pass/9fd584806e085e35.js @@ -0,0 +1 @@ +class a { b() {} c() {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/9fe1d41db318afba.js b/compiler/tests-js-parser/pass/9fe1d41db318afba.js new file mode 100644 index 000000000..29541d066 --- /dev/null +++ b/compiler/tests-js-parser/pass/9fe1d41db318afba.js @@ -0,0 +1 @@ +for(let in 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a0079146ab045c26.js b/compiler/tests-js-parser/pass/a0079146ab045c26.js new file mode 100644 index 000000000..d73b76c5a --- /dev/null +++ b/compiler/tests-js-parser/pass/a0079146ab045c26.js @@ -0,0 +1 @@ +/[-a-]/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a022debc42a58f0c.js b/compiler/tests-js-parser/pass/a022debc42a58f0c.js new file mode 100644 index 000000000..700de1332 --- /dev/null +++ b/compiler/tests-js-parser/pass/a022debc42a58f0c.js @@ -0,0 +1 @@ +([a]) => [1]; diff --git a/compiler/tests-js-parser/pass/a03475b02913e16a.js b/compiler/tests-js-parser/pass/a03475b02913e16a.js new file mode 100644 index 000000000..5f37db2bf --- /dev/null +++ b/compiler/tests-js-parser/pass/a03475b02913e16a.js @@ -0,0 +1,2 @@ +for (;a();) + if (b()) break; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a08ed291f78352a0.js b/compiler/tests-js-parser/pass/a08ed291f78352a0.js new file mode 100644 index 000000000..b9f7dcc7e --- /dev/null +++ b/compiler/tests-js-parser/pass/a08ed291f78352a0.js @@ -0,0 +1,7 @@ +a(function() { + function b() {} + if (b()) { + b(); + return void 1; + } +}); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a0af29e4dd6d3845.js b/compiler/tests-js-parser/pass/a0af29e4dd6d3845.js new file mode 100644 index 000000000..bffa85cb2 --- /dev/null +++ b/compiler/tests-js-parser/pass/a0af29e4dd6d3845.js @@ -0,0 +1,6 @@ +(function () { + while (false) { + a(); + } + b(); +}()); diff --git a/compiler/tests-js-parser/pass/a0b7bf790311b763.js b/compiler/tests-js-parser/pass/a0b7bf790311b763.js new file mode 100644 index 000000000..b17e5a8b9 --- /dev/null +++ b/compiler/tests-js-parser/pass/a0b7bf790311b763.js @@ -0,0 +1 @@ +/[a-z]/u \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a0fba75a10c21ac9.js b/compiler/tests-js-parser/pass/a0fba75a10c21ac9.js new file mode 100644 index 000000000..db52bd419 --- /dev/null +++ b/compiler/tests-js-parser/pass/a0fba75a10c21ac9.js @@ -0,0 +1 @@ +(!a)?1:2 diff --git a/compiler/tests-js-parser/pass/a10929d2c1b0d792.js b/compiler/tests-js-parser/pass/a10929d2c1b0d792.js new file mode 100644 index 000000000..87004b890 --- /dev/null +++ b/compiler/tests-js-parser/pass/a10929d2c1b0d792.js @@ -0,0 +1 @@ +with (a) { b } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a11e875c4dd100af.js b/compiler/tests-js-parser/pass/a11e875c4dd100af.js new file mode 100644 index 000000000..cee7e8e6b --- /dev/null +++ b/compiler/tests-js-parser/pass/a11e875c4dd100af.js @@ -0,0 +1,5 @@ +for (var a = 1; a < 2; ++a) + // do not optimize it + (function () { + b('c'); + }()); diff --git a/compiler/tests-js-parser/pass/a150e917230aa57d.js b/compiler/tests-js-parser/pass/a150e917230aa57d.js new file mode 100644 index 000000000..4571759d7 --- /dev/null +++ b/compiler/tests-js-parser/pass/a150e917230aa57d.js @@ -0,0 +1,8 @@ +(function () { + if (true == a) { + b(); + } + if (false == a) { + b(); + } +}()); diff --git a/compiler/tests-js-parser/pass/a157424306915066.js b/compiler/tests-js-parser/pass/a157424306915066.js new file mode 100644 index 000000000..fbdb6ad6e --- /dev/null +++ b/compiler/tests-js-parser/pass/a157424306915066.js @@ -0,0 +1 @@ +function *a() { (b) => { yield + b }; } diff --git a/compiler/tests-js-parser/pass/a1594a4d0c0ee99a.js b/compiler/tests-js-parser/pass/a1594a4d0c0ee99a.js new file mode 100644 index 000000000..63b90ac2a --- /dev/null +++ b/compiler/tests-js-parser/pass/a1594a4d0c0ee99a.js @@ -0,0 +1 @@ +for (let a = let;;) {} diff --git a/compiler/tests-js-parser/pass/a15c90cc56980c41.js b/compiler/tests-js-parser/pass/a15c90cc56980c41.js new file mode 100644 index 000000000..128489d20 --- /dev/null +++ b/compiler/tests-js-parser/pass/a15c90cc56980c41.js @@ -0,0 +1 @@ +a: while (true) { break a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a18a8865e65d4bdd.js b/compiler/tests-js-parser/pass/a18a8865e65d4bdd.js new file mode 100644 index 000000000..86959bc54 --- /dev/null +++ b/compiler/tests-js-parser/pass/a18a8865e65d4bdd.js @@ -0,0 +1 @@ +({[a]() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a194909bf50b1467.js b/compiler/tests-js-parser/pass/a194909bf50b1467.js new file mode 100644 index 000000000..4389d4b26 --- /dev/null +++ b/compiler/tests-js-parser/pass/a194909bf50b1467.js @@ -0,0 +1 @@ +function *a() { yield yield } diff --git a/compiler/tests-js-parser/pass/a1ab463999957845.js b/compiler/tests-js-parser/pass/a1ab463999957845.js new file mode 100644 index 000000000..950fa670a --- /dev/null +++ b/compiler/tests-js-parser/pass/a1ab463999957845.js @@ -0,0 +1 @@ +( a )() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a1cd0d76806cef90.js b/compiler/tests-js-parser/pass/a1cd0d76806cef90.js new file mode 100644 index 000000000..e7cd2eb93 --- /dev/null +++ b/compiler/tests-js-parser/pass/a1cd0d76806cef90.js @@ -0,0 +1,3 @@ +(function(){ + return typeof a() != "b"; +}()) diff --git a/compiler/tests-js-parser/pass/a1dde88d8a87b573.module.js b/compiler/tests-js-parser/pass/a1dde88d8a87b573.module.js new file mode 100644 index 000000000..8f19f10e3 --- /dev/null +++ b/compiler/tests-js-parser/pass/a1dde88d8a87b573.module.js @@ -0,0 +1 @@ +import {a} from "foo"; diff --git a/compiler/tests-js-parser/pass/a2042d86c592dd55.js b/compiler/tests-js-parser/pass/a2042d86c592dd55.js new file mode 100644 index 000000000..9f54351e0 --- /dev/null +++ b/compiler/tests-js-parser/pass/a2042d86c592dd55.js @@ -0,0 +1,2 @@ +// NaN => 0/0 +'a' - 1 diff --git a/compiler/tests-js-parser/pass/a248ef84a404262c.js b/compiler/tests-js-parser/pass/a248ef84a404262c.js new file mode 100644 index 000000000..5b92d5042 --- /dev/null +++ b/compiler/tests-js-parser/pass/a248ef84a404262c.js @@ -0,0 +1 @@ +`$` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a2781f8227f7f1e6.js b/compiler/tests-js-parser/pass/a2781f8227f7f1e6.js new file mode 100644 index 000000000..4c46bfef3 --- /dev/null +++ b/compiler/tests-js-parser/pass/a2781f8227f7f1e6.js @@ -0,0 +1 @@ +[...{ a }] = b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a2798917405b080b.js b/compiler/tests-js-parser/pass/a2798917405b080b.js new file mode 100644 index 000000000..14d2f32e5 --- /dev/null +++ b/compiler/tests-js-parser/pass/a2798917405b080b.js @@ -0,0 +1 @@ +try { } catch ({}) {} diff --git a/compiler/tests-js-parser/pass/a29b007e8fb9d020.js b/compiler/tests-js-parser/pass/a29b007e8fb9d020.js new file mode 100644 index 000000000..6104fd423 --- /dev/null +++ b/compiler/tests-js-parser/pass/a29b007e8fb9d020.js @@ -0,0 +1 @@ +[a, b, ...c] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a2c2339691fc48fb.js b/compiler/tests-js-parser/pass/a2c2339691fc48fb.js new file mode 100644 index 000000000..ab0c01417 --- /dev/null +++ b/compiler/tests-js-parser/pass/a2c2339691fc48fb.js @@ -0,0 +1 @@ +// \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a2cb5a14559c6a50.js b/compiler/tests-js-parser/pass/a2cb5a14559c6a50.js new file mode 100644 index 000000000..42c9869dc --- /dev/null +++ b/compiler/tests-js-parser/pass/a2cb5a14559c6a50.js @@ -0,0 +1 @@ +try {} catch (yield) {} diff --git a/compiler/tests-js-parser/pass/a2f26b79b01628f9.js b/compiler/tests-js-parser/pass/a2f26b79b01628f9.js new file mode 100644 index 000000000..d55d646eb --- /dev/null +++ b/compiler/tests-js-parser/pass/a2f26b79b01628f9.js @@ -0,0 +1,5 @@ +(function () { + var a = 1; // should not hoist to parameter + with (b) + arguments = 2; +}()); diff --git a/compiler/tests-js-parser/pass/a33250f92a2f000e.js b/compiler/tests-js-parser/pass/a33250f92a2f000e.js new file mode 100644 index 000000000..1790de3c2 --- /dev/null +++ b/compiler/tests-js-parser/pass/a33250f92a2f000e.js @@ -0,0 +1 @@ +function a(b, c) { return b-- >> c; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a353c62d8ed56d6f.js b/compiler/tests-js-parser/pass/a353c62d8ed56d6f.js new file mode 100644 index 000000000..b4a3e7cc9 --- /dev/null +++ b/compiler/tests-js-parser/pass/a353c62d8ed56d6f.js @@ -0,0 +1,2 @@ +{ throw a// Comment +a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a378fc25898cf05b.js b/compiler/tests-js-parser/pass/a378fc25898cf05b.js new file mode 100644 index 000000000..01d19ad12 --- /dev/null +++ b/compiler/tests-js-parser/pass/a378fc25898cf05b.js @@ -0,0 +1 @@ +( new a).b() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a3b497c58f78b243.js b/compiler/tests-js-parser/pass/a3b497c58f78b243.js new file mode 100644 index 000000000..a3ed1d80b --- /dev/null +++ b/compiler/tests-js-parser/pass/a3b497c58f78b243.js @@ -0,0 +1,3 @@ +(function () { + function a() { } +}()); diff --git a/compiler/tests-js-parser/pass/a41e5072dd6dda98.js b/compiler/tests-js-parser/pass/a41e5072dd6dda98.js new file mode 100644 index 000000000..5098a8a4e --- /dev/null +++ b/compiler/tests-js-parser/pass/a41e5072dd6dda98.js @@ -0,0 +1 @@ +with (a) b; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a42a93f3af33bbc5.js b/compiler/tests-js-parser/pass/a42a93f3af33bbc5.js new file mode 100644 index 000000000..3edcae0ad --- /dev/null +++ b/compiler/tests-js-parser/pass/a42a93f3af33bbc5.js @@ -0,0 +1,14 @@ +a = 1; +if (b) c(); + +a = 2; +for (d = 3; d < 4; d++) e.f(d); + +a = 5; +for (; d < 6; d++) e.f(d); + +a = 7; +switch (b) {} + +a = 8; +with (g) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a43df1aea659fab8.js b/compiler/tests-js-parser/pass/a43df1aea659fab8.js new file mode 100644 index 000000000..dfb7db2bf --- /dev/null +++ b/compiler/tests-js-parser/pass/a43df1aea659fab8.js @@ -0,0 +1 @@ +a & b & c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a445a478b4ce0c58.js b/compiler/tests-js-parser/pass/a445a478b4ce0c58.js new file mode 100644 index 000000000..370053798 --- /dev/null +++ b/compiler/tests-js-parser/pass/a445a478b4ce0c58.js @@ -0,0 +1 @@ +({ get a() { return b } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a454d2e2ab3484e6.js b/compiler/tests-js-parser/pass/a454d2e2ab3484e6.js new file mode 100644 index 000000000..daa6bf5b2 --- /dev/null +++ b/compiler/tests-js-parser/pass/a454d2e2ab3484e6.js @@ -0,0 +1 @@ +(function*() {}) diff --git a/compiler/tests-js-parser/pass/a487d6498ec0efbf.module.js b/compiler/tests-js-parser/pass/a487d6498ec0efbf.module.js new file mode 100644 index 000000000..ed7fce33e --- /dev/null +++ b/compiler/tests-js-parser/pass/a487d6498ec0efbf.module.js @@ -0,0 +1,2 @@ +import a, {} from "a" +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a4931f8127e03c4e.js b/compiler/tests-js-parser/pass/a4931f8127e03c4e.js new file mode 100644 index 000000000..e8c901f6a --- /dev/null +++ b/compiler/tests-js-parser/pass/a4931f8127e03c4e.js @@ -0,0 +1 @@ +a.null \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a4b3402765acaa0e.js b/compiler/tests-js-parser/pass/a4b3402765acaa0e.js new file mode 100644 index 000000000..68efbb21c --- /dev/null +++ b/compiler/tests-js-parser/pass/a4b3402765acaa0e.js @@ -0,0 +1 @@ +(a) ? (b) : (c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a4d62a651f69d815.js b/compiler/tests-js-parser/pass/a4d62a651f69d815.js new file mode 100644 index 000000000..0b303640a --- /dev/null +++ b/compiler/tests-js-parser/pass/a4d62a651f69d815.js @@ -0,0 +1 @@ +if (a) function b(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a515d7aaea7b816f.js b/compiler/tests-js-parser/pass/a515d7aaea7b816f.js new file mode 100644 index 000000000..b86f5e207 --- /dev/null +++ b/compiler/tests-js-parser/pass/a515d7aaea7b816f.js @@ -0,0 +1,4 @@ +(function () { + if (a) return 1; + else return; +}()); diff --git a/compiler/tests-js-parser/pass/a54cca69085ad35a.js b/compiler/tests-js-parser/pass/a54cca69085ad35a.js new file mode 100644 index 000000000..2f11f1da6 --- /dev/null +++ b/compiler/tests-js-parser/pass/a54cca69085ad35a.js @@ -0,0 +1 @@ +class a { static set b(c) {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a54ce6036e646e24.js b/compiler/tests-js-parser/pass/a54ce6036e646e24.js new file mode 100644 index 000000000..ca13c74d7 --- /dev/null +++ b/compiler/tests-js-parser/pass/a54ce6036e646e24.js @@ -0,0 +1,2 @@ +a = b % c / c * d * 1; +a = b % c * 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a59e0d0b4d3e1b7d.js b/compiler/tests-js-parser/pass/a59e0d0b4d3e1b7d.js new file mode 100644 index 000000000..c49b1bd06 --- /dev/null +++ b/compiler/tests-js-parser/pass/a59e0d0b4d3e1b7d.js @@ -0,0 +1,5 @@ +/* multiline +comment +should +be +ignored */ 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a5a01023fef4d506.js b/compiler/tests-js-parser/pass/a5a01023fef4d506.js new file mode 100644 index 000000000..d7edc9bf2 --- /dev/null +++ b/compiler/tests-js-parser/pass/a5a01023fef4d506.js @@ -0,0 +1,4 @@ +a['b']; +a['in']; +a['eval']; +a['arguments']; diff --git a/compiler/tests-js-parser/pass/a5a7eb83bf27418b.js b/compiler/tests-js-parser/pass/a5a7eb83bf27418b.js new file mode 100644 index 000000000..4b710a14e --- /dev/null +++ b/compiler/tests-js-parser/pass/a5a7eb83bf27418b.js @@ -0,0 +1 @@ +for(a in b) c(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a5aaa3992025795a.js b/compiler/tests-js-parser/pass/a5aaa3992025795a.js new file mode 100644 index 000000000..02c1a629f --- /dev/null +++ b/compiler/tests-js-parser/pass/a5aaa3992025795a.js @@ -0,0 +1 @@ +({yield = 1} = 2); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a5b30a03e9c774af.js b/compiler/tests-js-parser/pass/a5b30a03e9c774af.js new file mode 100644 index 000000000..080607d73 --- /dev/null +++ b/compiler/tests-js-parser/pass/a5b30a03e9c774af.js @@ -0,0 +1,16 @@ +try { + // do not optimize it + (function () { + a('b'); + }()); +} catch (c) { + // do not optimize it + (function () { + a('b'); + }()); +} finally { + // do not optimize it + (function () { + a('b'); + }()); +} diff --git a/compiler/tests-js-parser/pass/a62c6323a3696fa8.js b/compiler/tests-js-parser/pass/a62c6323a3696fa8.js new file mode 100644 index 000000000..f2b521a5e --- /dev/null +++ b/compiler/tests-js-parser/pass/a62c6323a3696fa8.js @@ -0,0 +1,2 @@ +('\ +') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a6806d6fedbf6759.js b/compiler/tests-js-parser/pass/a6806d6fedbf6759.js new file mode 100644 index 000000000..8ced8c480 --- /dev/null +++ b/compiler/tests-js-parser/pass/a6806d6fedbf6759.js @@ -0,0 +1 @@ +[ 1, 2,, 3, ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a68bf27df978135d.module.js b/compiler/tests-js-parser/pass/a68bf27df978135d.module.js new file mode 100644 index 000000000..e2dc11c27 --- /dev/null +++ b/compiler/tests-js-parser/pass/a68bf27df978135d.module.js @@ -0,0 +1 @@ +export default 1;2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a6b7dab7088e5269.js b/compiler/tests-js-parser/pass/a6b7dab7088e5269.js new file mode 100644 index 000000000..b16406b92 --- /dev/null +++ b/compiler/tests-js-parser/pass/a6b7dab7088e5269.js @@ -0,0 +1 @@ +var a = /[a-z]/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a6cb605b66ef0eb5.js b/compiler/tests-js-parser/pass/a6cb605b66ef0eb5.js new file mode 100644 index 000000000..6c99e53c6 --- /dev/null +++ b/compiler/tests-js-parser/pass/a6cb605b66ef0eb5.js @@ -0,0 +1,3 @@ +(function () { + (!!a, !b, 1) +}()); diff --git a/compiler/tests-js-parser/pass/a7964b1dcfd2dc21.js b/compiler/tests-js-parser/pass/a7964b1dcfd2dc21.js new file mode 100644 index 000000000..2a25de5a9 --- /dev/null +++ b/compiler/tests-js-parser/pass/a7964b1dcfd2dc21.js @@ -0,0 +1 @@ +() => 1, 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a7b8ce1d4c0f0bc2.js b/compiler/tests-js-parser/pass/a7b8ce1d4c0f0bc2.js new file mode 100644 index 000000000..a96802785 --- /dev/null +++ b/compiler/tests-js-parser/pass/a7b8ce1d4c0f0bc2.js @@ -0,0 +1 @@ +b: while (1) { continue a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a7c8ad2a73ed00d0.js b/compiler/tests-js-parser/pass/a7c8ad2a73ed00d0.js new file mode 100644 index 000000000..a262847fb --- /dev/null +++ b/compiler/tests-js-parser/pass/a7c8ad2a73ed00d0.js @@ -0,0 +1 @@ +for (let [a, b] of c); diff --git a/compiler/tests-js-parser/pass/a830df7cf2e74c9f.js b/compiler/tests-js-parser/pass/a830df7cf2e74c9f.js new file mode 100644 index 000000000..a8484afbb --- /dev/null +++ b/compiler/tests-js-parser/pass/a830df7cf2e74c9f.js @@ -0,0 +1 @@ +({ get a() { super[1] = 2; } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a8535eac4c7c9c3a.js b/compiler/tests-js-parser/pass/a8535eac4c7c9c3a.js new file mode 100644 index 000000000..283d011e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/a8535eac4c7c9c3a.js @@ -0,0 +1 @@ +class a { static() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a86a29773d1168d3.js b/compiler/tests-js-parser/pass/a86a29773d1168d3.js new file mode 100644 index 000000000..5d4f5ddda --- /dev/null +++ b/compiler/tests-js-parser/pass/a86a29773d1168d3.js @@ -0,0 +1 @@ +try { } catch ([]) {} diff --git a/compiler/tests-js-parser/pass/a871e54c3956acd9.js b/compiler/tests-js-parser/pass/a871e54c3956acd9.js new file mode 100644 index 000000000..64a3b9c96 --- /dev/null +++ b/compiler/tests-js-parser/pass/a871e54c3956acd9.js @@ -0,0 +1,2 @@ +a: while(true) { continue a +; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a885d88fb046dea5.js b/compiler/tests-js-parser/pass/a885d88fb046dea5.js new file mode 100644 index 000000000..bb7f142b5 --- /dev/null +++ b/compiler/tests-js-parser/pass/a885d88fb046dea5.js @@ -0,0 +1,3 @@ +(function () { + for (var a in []); +}()); diff --git a/compiler/tests-js-parser/pass/a8a03a88237c4e8f.js b/compiler/tests-js-parser/pass/a8a03a88237c4e8f.js new file mode 100644 index 000000000..7ba72c2e8 --- /dev/null +++ b/compiler/tests-js-parser/pass/a8a03a88237c4e8f.js @@ -0,0 +1 @@ +({a:(b = 1)}) diff --git a/compiler/tests-js-parser/pass/a8b6c3139974f6e1.js b/compiler/tests-js-parser/pass/a8b6c3139974f6e1.js new file mode 100644 index 000000000..6d01a4e36 --- /dev/null +++ b/compiler/tests-js-parser/pass/a8b6c3139974f6e1.js @@ -0,0 +1 @@ +({ set "null"(a) { a } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a8b832d61af9cdc4.js b/compiler/tests-js-parser/pass/a8b832d61af9cdc4.js new file mode 100644 index 000000000..55997d200 --- /dev/null +++ b/compiler/tests-js-parser/pass/a8b832d61af9cdc4.js @@ -0,0 +1 @@ +/[a-z]/y \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a8fea31fe6aa588e.js b/compiler/tests-js-parser/pass/a8fea31fe6aa588e.js new file mode 100644 index 000000000..9bbbd1673 --- /dev/null +++ b/compiler/tests-js-parser/pass/a8fea31fe6aa588e.js @@ -0,0 +1 @@ +0o1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a91ad31c88855e59.js b/compiler/tests-js-parser/pass/a91ad31c88855e59.js new file mode 100644 index 000000000..179e8b5ca --- /dev/null +++ b/compiler/tests-js-parser/pass/a91ad31c88855e59.js @@ -0,0 +1 @@ +var implements, interface, package \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a93f6b22796d4868.js b/compiler/tests-js-parser/pass/a93f6b22796d4868.js new file mode 100644 index 000000000..e191e5340 --- /dev/null +++ b/compiler/tests-js-parser/pass/a93f6b22796d4868.js @@ -0,0 +1 @@ +function* a(){ () => yield; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a953f09a1b6b6725.js b/compiler/tests-js-parser/pass/a953f09a1b6b6725.js new file mode 100644 index 000000000..b08e32771 --- /dev/null +++ b/compiler/tests-js-parser/pass/a953f09a1b6b6725.js @@ -0,0 +1 @@ +02 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a955c7a892679016.js b/compiler/tests-js-parser/pass/a955c7a892679016.js new file mode 100644 index 000000000..75e5e82f4 --- /dev/null +++ b/compiler/tests-js-parser/pass/a955c7a892679016.js @@ -0,0 +1 @@ +for (var a in b) c(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a9b0aedbd9f25ec9.js b/compiler/tests-js-parser/pass/a9b0aedbd9f25ec9.js new file mode 100644 index 000000000..07981ce08 --- /dev/null +++ b/compiler/tests-js-parser/pass/a9b0aedbd9f25ec9.js @@ -0,0 +1 @@ +var a = function() { b() }; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a9e054dbd43d4b86.js b/compiler/tests-js-parser/pass/a9e054dbd43d4b86.js new file mode 100644 index 000000000..33b31da8a --- /dev/null +++ b/compiler/tests-js-parser/pass/a9e054dbd43d4b86.js @@ -0,0 +1 @@ +a * b / c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a9e4ff39f145a1fd.js b/compiler/tests-js-parser/pass/a9e4ff39f145a1fd.js new file mode 100644 index 000000000..dfe68a798 --- /dev/null +++ b/compiler/tests-js-parser/pass/a9e4ff39f145a1fd.js @@ -0,0 +1 @@ +({a({b} = {b: 1}) {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/a9f99e657441a735.js b/compiler/tests-js-parser/pass/a9f99e657441a735.js new file mode 100644 index 000000000..fe3730e8f --- /dev/null +++ b/compiler/tests-js-parser/pass/a9f99e657441a735.js @@ -0,0 +1 @@ +(class {static(){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/aa06ccdc7ff9e10d.js b/compiler/tests-js-parser/pass/aa06ccdc7ff9e10d.js new file mode 100644 index 000000000..844d884d6 --- /dev/null +++ b/compiler/tests-js-parser/pass/aa06ccdc7ff9e10d.js @@ -0,0 +1 @@ +({a: [b] = 1} = 2) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/aa3b466be5c7f7e3.js b/compiler/tests-js-parser/pass/aa3b466be5c7f7e3.js new file mode 100644 index 000000000..822bea077 --- /dev/null +++ b/compiler/tests-js-parser/pass/aa3b466be5c7f7e3.js @@ -0,0 +1,4 @@ +for (;;) { + if (a) continue; + continue; +} diff --git a/compiler/tests-js-parser/pass/aa3d1fa7a22e6460.js b/compiler/tests-js-parser/pass/aa3d1fa7a22e6460.js new file mode 100644 index 000000000..e6927caf9 --- /dev/null +++ b/compiler/tests-js-parser/pass/aa3d1fa7a22e6460.js @@ -0,0 +1 @@ +while(true) var a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/aa7e721756949024.js b/compiler/tests-js-parser/pass/aa7e721756949024.js new file mode 100644 index 000000000..0b781c1dd --- /dev/null +++ b/compiler/tests-js-parser/pass/aa7e721756949024.js @@ -0,0 +1 @@ +({ set a(b) { super.c[1] = 2; } }); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/aaa0bc7fa72df5e4.js b/compiler/tests-js-parser/pass/aaa0bc7fa72df5e4.js new file mode 100644 index 000000000..e5ae1271a --- /dev/null +++ b/compiler/tests-js-parser/pass/aaa0bc7fa72df5e4.js @@ -0,0 +1,2 @@ +// Hello, world! +1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/aab08ba9fd01cbb8.js b/compiler/tests-js-parser/pass/aab08ba9fd01cbb8.js new file mode 100644 index 000000000..a9b295231 --- /dev/null +++ b/compiler/tests-js-parser/pass/aab08ba9fd01cbb8.js @@ -0,0 +1 @@ +a.b.c.d(1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/aab51bc524d9c623.js b/compiler/tests-js-parser/pass/aab51bc524d9c623.js new file mode 100644 index 000000000..ccac39cb2 --- /dev/null +++ b/compiler/tests-js-parser/pass/aab51bc524d9c623.js @@ -0,0 +1,3 @@ +(function () { + a(null!=(b?c:void 1)); +}()); diff --git a/compiler/tests-js-parser/pass/aac70baa56299267.js b/compiler/tests-js-parser/pass/aac70baa56299267.js new file mode 100644 index 000000000..520af0aa7 --- /dev/null +++ b/compiler/tests-js-parser/pass/aac70baa56299267.js @@ -0,0 +1,3 @@ +function a() { + return (void 1, void 2, a, void 3); +} diff --git a/compiler/tests-js-parser/pass/aaf1be6cd60a9ac9.js b/compiler/tests-js-parser/pass/aaf1be6cd60a9ac9.js new file mode 100644 index 000000000..75f059489 --- /dev/null +++ b/compiler/tests-js-parser/pass/aaf1be6cd60a9ac9.js @@ -0,0 +1 @@ +({"a"() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ab23ca0a6e356883.js b/compiler/tests-js-parser/pass/ab23ca0a6e356883.js new file mode 100644 index 000000000..dc5ea153b --- /dev/null +++ b/compiler/tests-js-parser/pass/ab23ca0a6e356883.js @@ -0,0 +1,3 @@ +do { + a(); +} while (false);b() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ab452fc45813857a.js b/compiler/tests-js-parser/pass/ab452fc45813857a.js new file mode 100644 index 000000000..f3a8ac2a0 --- /dev/null +++ b/compiler/tests-js-parser/pass/ab452fc45813857a.js @@ -0,0 +1,7 @@ +if (a) { + try { b('try'); } catch (c) {} + // do not optimize it + (function () { + b('d'); + }()); +} diff --git a/compiler/tests-js-parser/pass/ab4734949243c00a.js b/compiler/tests-js-parser/pass/ab4734949243c00a.js new file mode 100644 index 000000000..2bd7e0011 --- /dev/null +++ b/compiler/tests-js-parser/pass/ab4734949243c00a.js @@ -0,0 +1 @@ +new a(b, ...c = d); diff --git a/compiler/tests-js-parser/pass/ab7ea8d738da7043.js b/compiler/tests-js-parser/pass/ab7ea8d738da7043.js new file mode 100644 index 000000000..41cea78b9 --- /dev/null +++ b/compiler/tests-js-parser/pass/ab7ea8d738da7043.js @@ -0,0 +1,2 @@ +function a() { return +; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/abcfae2381708c43.module.js b/compiler/tests-js-parser/pass/abcfae2381708c43.module.js new file mode 100644 index 000000000..2c7930d92 --- /dev/null +++ b/compiler/tests-js-parser/pass/abcfae2381708c43.module.js @@ -0,0 +1 @@ +export {default} from "foo"; diff --git a/compiler/tests-js-parser/pass/abd5e4aa1a9f99ba.js b/compiler/tests-js-parser/pass/abd5e4aa1a9f99ba.js new file mode 100644 index 000000000..45a074c8f --- /dev/null +++ b/compiler/tests-js-parser/pass/abd5e4aa1a9f99ba.js @@ -0,0 +1 @@ +let a, x󠇕; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ac09566949f0db57.js b/compiler/tests-js-parser/pass/ac09566949f0db57.js new file mode 100644 index 000000000..785c71bcb --- /dev/null +++ b/compiler/tests-js-parser/pass/ac09566949f0db57.js @@ -0,0 +1 @@ +{ do { } while (false) false } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ac112e0c69fe603e.js b/compiler/tests-js-parser/pass/ac112e0c69fe603e.js new file mode 100644 index 000000000..4fbd20c9b --- /dev/null +++ b/compiler/tests-js-parser/pass/ac112e0c69fe603e.js @@ -0,0 +1 @@ +(a, b) => "c" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ac1bc6b81949c063.module.js b/compiler/tests-js-parser/pass/ac1bc6b81949c063.module.js new file mode 100644 index 000000000..da394efcc --- /dev/null +++ b/compiler/tests-js-parser/pass/ac1bc6b81949c063.module.js @@ -0,0 +1 @@ +let a diff --git a/compiler/tests-js-parser/pass/ac6bbe8465f70ebd.module.js b/compiler/tests-js-parser/pass/ac6bbe8465f70ebd.module.js new file mode 100644 index 000000000..078130b60 --- /dev/null +++ b/compiler/tests-js-parser/pass/ac6bbe8465f70ebd.module.js @@ -0,0 +1,2 @@ +export {} +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ac73bc36bbc48890.js b/compiler/tests-js-parser/pass/ac73bc36bbc48890.js new file mode 100644 index 000000000..d2dcc9efd --- /dev/null +++ b/compiler/tests-js-parser/pass/ac73bc36bbc48890.js @@ -0,0 +1 @@ +"use\x20strict"; with (a) b = c; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ad06370e34811a6a.js b/compiler/tests-js-parser/pass/ad06370e34811a6a.js new file mode 100644 index 000000000..c12e9a88d --- /dev/null +++ b/compiler/tests-js-parser/pass/ad06370e34811a6a.js @@ -0,0 +1 @@ +({a:(b) = 1} = 2) diff --git a/compiler/tests-js-parser/pass/ad0fd65944942eee.js b/compiler/tests-js-parser/pass/ad0fd65944942eee.js new file mode 100644 index 000000000..fc205a7af --- /dev/null +++ b/compiler/tests-js-parser/pass/ad0fd65944942eee.js @@ -0,0 +1 @@ +0e+100 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ad410fec8c09f67b.js b/compiler/tests-js-parser/pass/ad410fec8c09f67b.js new file mode 100644 index 000000000..26e8108c5 --- /dev/null +++ b/compiler/tests-js-parser/pass/ad410fec8c09f67b.js @@ -0,0 +1 @@ +for ([a, b] of c); diff --git a/compiler/tests-js-parser/pass/ad4414fcaaa6abb7.js b/compiler/tests-js-parser/pass/ad4414fcaaa6abb7.js new file mode 100644 index 000000000..424ac8977 --- /dev/null +++ b/compiler/tests-js-parser/pass/ad4414fcaaa6abb7.js @@ -0,0 +1 @@ +if(a)b; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ad6bf12aa7eda975.js b/compiler/tests-js-parser/pass/ad6bf12aa7eda975.js new file mode 100644 index 000000000..0f311861e --- /dev/null +++ b/compiler/tests-js-parser/pass/ad6bf12aa7eda975.js @@ -0,0 +1 @@ +(function([a]){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ad6bfcbfca5afde1.js b/compiler/tests-js-parser/pass/ad6bfcbfca5afde1.js new file mode 100644 index 000000000..be03e1f60 --- /dev/null +++ b/compiler/tests-js-parser/pass/ad6bfcbfca5afde1.js @@ -0,0 +1 @@ +.14 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ad7d61a732903cd8.js b/compiler/tests-js-parser/pass/ad7d61a732903cd8.js new file mode 100644 index 000000000..cfc8d2fe5 --- /dev/null +++ b/compiler/tests-js-parser/pass/ad7d61a732903cd8.js @@ -0,0 +1 @@ +({ a([ b, c ]){} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/adad54e09949b0e9.js b/compiler/tests-js-parser/pass/adad54e09949b0e9.js new file mode 100644 index 000000000..4e0afff1f --- /dev/null +++ b/compiler/tests-js-parser/pass/adad54e09949b0e9.js @@ -0,0 +1 @@ +a && b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ade301f0d871c610.js b/compiler/tests-js-parser/pass/ade301f0d871c610.js new file mode 100644 index 000000000..a0768cd43 --- /dev/null +++ b/compiler/tests-js-parser/pass/ade301f0d871c610.js @@ -0,0 +1 @@ +"Hello\122World" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ae204e41bacd8237.js b/compiler/tests-js-parser/pass/ae204e41bacd8237.js new file mode 100644 index 000000000..8e4fdb9bc --- /dev/null +++ b/compiler/tests-js-parser/pass/ae204e41bacd8237.js @@ -0,0 +1 @@ +class a extends b { c() { super.yield } } diff --git a/compiler/tests-js-parser/pass/ae4bbee73a0f80a5.js b/compiler/tests-js-parser/pass/ae4bbee73a0f80a5.js new file mode 100644 index 000000000..4cd91b48d --- /dev/null +++ b/compiler/tests-js-parser/pass/ae4bbee73a0f80a5.js @@ -0,0 +1 @@ +[ 1, ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ae700e3f8ff82c6c.js b/compiler/tests-js-parser/pass/ae700e3f8ff82c6c.js new file mode 100644 index 000000000..2378c57a1 --- /dev/null +++ b/compiler/tests-js-parser/pass/ae700e3f8ff82c6c.js @@ -0,0 +1 @@ +a()+(b(),c(),d(),e()) // do not transform diff --git a/compiler/tests-js-parser/pass/ae89d08bdd65b56b.js b/compiler/tests-js-parser/pass/ae89d08bdd65b56b.js new file mode 100644 index 000000000..7a4512421 --- /dev/null +++ b/compiler/tests-js-parser/pass/ae89d08bdd65b56b.js @@ -0,0 +1 @@ +class a {b(){}c(){}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ae9667ad0d837abc.js b/compiler/tests-js-parser/pass/ae9667ad0d837abc.js new file mode 100644 index 000000000..2d303989f --- /dev/null +++ b/compiler/tests-js-parser/pass/ae9667ad0d837abc.js @@ -0,0 +1,2 @@ +(1, 2, a)(); +(3, 4, b.a)(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ae97d36bd01b43b2.js b/compiler/tests-js-parser/pass/ae97d36bd01b43b2.js new file mode 100644 index 000000000..15d324d94 --- /dev/null +++ b/compiler/tests-js-parser/pass/ae97d36bd01b43b2.js @@ -0,0 +1 @@ +let [...a] = 1; diff --git a/compiler/tests-js-parser/pass/ae9a8ca09473df05.js b/compiler/tests-js-parser/pass/ae9a8ca09473df05.js new file mode 100644 index 000000000..fb5506fe4 --- /dev/null +++ b/compiler/tests-js-parser/pass/ae9a8ca09473df05.js @@ -0,0 +1,3 @@ +(function () { + void ((a) ? 1 : 2); +}()); diff --git a/compiler/tests-js-parser/pass/aec65a9745669870.js b/compiler/tests-js-parser/pass/aec65a9745669870.js new file mode 100644 index 000000000..51a77e5a9 --- /dev/null +++ b/compiler/tests-js-parser/pass/aec65a9745669870.js @@ -0,0 +1,4 @@ +(function () { + var a,b,c,d,e,f; + (a,b,c()) + (d,e,f()); +}()); diff --git a/compiler/tests-js-parser/pass/aeca992c7be882ba.js b/compiler/tests-js-parser/pass/aeca992c7be882ba.js new file mode 100644 index 000000000..ce6abf596 --- /dev/null +++ b/compiler/tests-js-parser/pass/aeca992c7be882ba.js @@ -0,0 +1,3 @@ +(function() { + a, 1, 2; // 'i' should remain (global variable) +}()); diff --git a/compiler/tests-js-parser/pass/af17707f71e402a7.module.js b/compiler/tests-js-parser/pass/af17707f71e402a7.module.js new file mode 100644 index 000000000..f1d9f194d --- /dev/null +++ b/compiler/tests-js-parser/pass/af17707f71e402a7.module.js @@ -0,0 +1 @@ +import {a, b,} from "foo"; diff --git a/compiler/tests-js-parser/pass/af1d905ed056724f.js b/compiler/tests-js-parser/pass/af1d905ed056724f.js new file mode 100644 index 000000000..4d1408638 --- /dev/null +++ b/compiler/tests-js-parser/pass/af1d905ed056724f.js @@ -0,0 +1 @@ +var a = function arguments() { }; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/af4bbcea9802b120.js b/compiler/tests-js-parser/pass/af4bbcea9802b120.js new file mode 100644 index 000000000..f3fc6da36 --- /dev/null +++ b/compiler/tests-js-parser/pass/af4bbcea9802b120.js @@ -0,0 +1 @@ +(class {a() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/af5766d06630bbc5.js b/compiler/tests-js-parser/pass/af5766d06630bbc5.js new file mode 100644 index 000000000..483dcc44a --- /dev/null +++ b/compiler/tests-js-parser/pass/af5766d06630bbc5.js @@ -0,0 +1 @@ +[[a]] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/af97a3752e579223.js b/compiler/tests-js-parser/pass/af97a3752e579223.js new file mode 100644 index 000000000..588985c2c --- /dev/null +++ b/compiler/tests-js-parser/pass/af97a3752e579223.js @@ -0,0 +1 @@ +(function () { yield* 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/afa63b136c835723.js b/compiler/tests-js-parser/pass/afa63b136c835723.js new file mode 100644 index 000000000..2d72c1d1f --- /dev/null +++ b/compiler/tests-js-parser/pass/afa63b136c835723.js @@ -0,0 +1 @@ +({a:1, get 'b'(){}, set 3(c){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/afcf8bace3839da2.js b/compiler/tests-js-parser/pass/afcf8bace3839da2.js new file mode 100644 index 000000000..38f8e83fa --- /dev/null +++ b/compiler/tests-js-parser/pass/afcf8bace3839da2.js @@ -0,0 +1,6 @@ +for (;;) { + with (a) { + continue; + } + b(); // This should be removed. +} diff --git a/compiler/tests-js-parser/pass/affd557fd820e1f2.js b/compiler/tests-js-parser/pass/affd557fd820e1f2.js new file mode 100644 index 000000000..1ab0d905f --- /dev/null +++ b/compiler/tests-js-parser/pass/affd557fd820e1f2.js @@ -0,0 +1 @@ +({get [a]() {}, set [a](b) {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/afffb6d317e53b92.js b/compiler/tests-js-parser/pass/afffb6d317e53b92.js new file mode 100644 index 000000000..e21aea6b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/afffb6d317e53b92.js @@ -0,0 +1 @@ +('\
') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b030378ad6e36751.js b/compiler/tests-js-parser/pass/b030378ad6e36751.js new file mode 100644 index 000000000..b9c536296 --- /dev/null +++ b/compiler/tests-js-parser/pass/b030378ad6e36751.js @@ -0,0 +1 @@ +class a { static [b]() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b0423be1317c7b69.js b/compiler/tests-js-parser/pass/b0423be1317c7b69.js new file mode 100644 index 000000000..2881a8ff4 --- /dev/null +++ b/compiler/tests-js-parser/pass/b0423be1317c7b69.js @@ -0,0 +1 @@ +(1) + (2 ) + 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b05d4355cc5e2802.js b/compiler/tests-js-parser/pass/b05d4355cc5e2802.js new file mode 100644 index 000000000..22d1d4a8d --- /dev/null +++ b/compiler/tests-js-parser/pass/b05d4355cc5e2802.js @@ -0,0 +1 @@ +a => b => c => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b0659cf9cb6793a2.js b/compiler/tests-js-parser/pass/b0659cf9cb6793a2.js new file mode 100644 index 000000000..33942e12e --- /dev/null +++ b/compiler/tests-js-parser/pass/b0659cf9cb6793a2.js @@ -0,0 +1 @@ +class a extends b { constructor(c = super()){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b06e2c3814e46579.js b/compiler/tests-js-parser/pass/b06e2c3814e46579.js new file mode 100644 index 000000000..b06a71d89 --- /dev/null +++ b/compiler/tests-js-parser/pass/b06e2c3814e46579.js @@ -0,0 +1 @@ +function *a(){yield class{}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b07c5fdc1003316b.js b/compiler/tests-js-parser/pass/b07c5fdc1003316b.js new file mode 100644 index 000000000..eb27ea442 --- /dev/null +++ b/compiler/tests-js-parser/pass/b07c5fdc1003316b.js @@ -0,0 +1,5 @@ +switch (a) { + case 'b': c(); break; + default: + break; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b0a834e1180ccd73.js b/compiler/tests-js-parser/pass/b0a834e1180ccd73.js new file mode 100644 index 000000000..85b4d7b0b --- /dev/null +++ b/compiler/tests-js-parser/pass/b0a834e1180ccd73.js @@ -0,0 +1 @@ +1 / 2 diff --git a/compiler/tests-js-parser/pass/b0c6752e1db068ed.js b/compiler/tests-js-parser/pass/b0c6752e1db068ed.js new file mode 100644 index 000000000..1ee20cd4e --- /dev/null +++ b/compiler/tests-js-parser/pass/b0c6752e1db068ed.js @@ -0,0 +1 @@ +(a = yield) => {} diff --git a/compiler/tests-js-parser/pass/b0d44fd20353fd82.js b/compiler/tests-js-parser/pass/b0d44fd20353fd82.js new file mode 100644 index 000000000..84e6cc4f8 --- /dev/null +++ b/compiler/tests-js-parser/pass/b0d44fd20353fd82.js @@ -0,0 +1 @@ +for(let yield in 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b0fdc038ee292aba.js b/compiler/tests-js-parser/pass/b0fdc038ee292aba.js new file mode 100644 index 000000000..54bb538e8 --- /dev/null +++ b/compiler/tests-js-parser/pass/b0fdc038ee292aba.js @@ -0,0 +1 @@ +09.5 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b1072e92becf06a9.js b/compiler/tests-js-parser/pass/b1072e92becf06a9.js new file mode 100644 index 000000000..45bf8c386 --- /dev/null +++ b/compiler/tests-js-parser/pass/b1072e92becf06a9.js @@ -0,0 +1,3 @@ +(function () { + a(typeof b === 'function'); +}()); diff --git a/compiler/tests-js-parser/pass/b13e700d2613a5a7.js b/compiler/tests-js-parser/pass/b13e700d2613a5a7.js new file mode 100644 index 000000000..684b7ff54 --- /dev/null +++ b/compiler/tests-js-parser/pass/b13e700d2613a5a7.js @@ -0,0 +1,5 @@ +while (a) { + b(); + c(); + break; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/b15ab152f8531a9f.js b/compiler/tests-js-parser/pass/b15ab152f8531a9f.js new file mode 100644 index 000000000..bf723fdb8 --- /dev/null +++ b/compiler/tests-js-parser/pass/b15ab152f8531a9f.js @@ -0,0 +1 @@ + comment \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ba21e63736d8fd46.js b/compiler/tests-js-parser/pass/ba21e63736d8fd46.js new file mode 100644 index 000000000..da2a2496f --- /dev/null +++ b/compiler/tests-js-parser/pass/ba21e63736d8fd46.js @@ -0,0 +1 @@ +a: function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ba4cc699857f41f2.js b/compiler/tests-js-parser/pass/ba4cc699857f41f2.js new file mode 100644 index 000000000..720741ec2 --- /dev/null +++ b/compiler/tests-js-parser/pass/ba4cc699857f41f2.js @@ -0,0 +1 @@ +function a() { function* a() {} function a() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ba620e120a809888.js b/compiler/tests-js-parser/pass/ba620e120a809888.js new file mode 100644 index 000000000..ba5e0e16d --- /dev/null +++ b/compiler/tests-js-parser/pass/ba620e120a809888.js @@ -0,0 +1,3 @@ +function a() { + new new.target()(); +} diff --git a/compiler/tests-js-parser/pass/ba6624f5f448dfe4.js b/compiler/tests-js-parser/pass/ba6624f5f448dfe4.js new file mode 100644 index 000000000..b4bb66abc --- /dev/null +++ b/compiler/tests-js-parser/pass/ba6624f5f448dfe4.js @@ -0,0 +1 @@ +for(a; a < 1; a++); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ba6dd18da17dbc10.js b/compiler/tests-js-parser/pass/ba6dd18da17dbc10.js new file mode 100644 index 000000000..cd0778e48 --- /dev/null +++ b/compiler/tests-js-parser/pass/ba6dd18da17dbc10.js @@ -0,0 +1,7 @@ +for (;;) { + if (a) { + if (b) { + continue; + } + } +} diff --git a/compiler/tests-js-parser/pass/ba9a047839eb4682.js b/compiler/tests-js-parser/pass/ba9a047839eb4682.js new file mode 100644 index 000000000..91778c300 --- /dev/null +++ b/compiler/tests-js-parser/pass/ba9a047839eb4682.js @@ -0,0 +1 @@ +a = { b() { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bad55fbc19618df8.js b/compiler/tests-js-parser/pass/bad55fbc19618df8.js new file mode 100644 index 000000000..7b107e11d --- /dev/null +++ b/compiler/tests-js-parser/pass/bad55fbc19618df8.js @@ -0,0 +1 @@ +a = typeof b.c != "d" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bb402b98f5398890.js b/compiler/tests-js-parser/pass/bb402b98f5398890.js new file mode 100644 index 000000000..864231c9d --- /dev/null +++ b/compiler/tests-js-parser/pass/bb402b98f5398890.js @@ -0,0 +1 @@ +a || b ^ c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bb41f0778f00f131.js b/compiler/tests-js-parser/pass/bb41f0778f00f131.js new file mode 100644 index 000000000..ecd504b05 --- /dev/null +++ b/compiler/tests-js-parser/pass/bb41f0778f00f131.js @@ -0,0 +1 @@ +let eval = 1, arguments = 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bb447d4ed988a1cb.js b/compiler/tests-js-parser/pass/bb447d4ed988a1cb.js new file mode 100644 index 000000000..2b826b903 --- /dev/null +++ b/compiler/tests-js-parser/pass/bb447d4ed988a1cb.js @@ -0,0 +1 @@ ++{ } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bb7db120ad2fe995.js b/compiler/tests-js-parser/pass/bb7db120ad2fe995.js new file mode 100644 index 000000000..252035e67 --- /dev/null +++ b/compiler/tests-js-parser/pass/bb7db120ad2fe995.js @@ -0,0 +1 @@ +({a: function({b} = {b: 1}) {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bb87b410a1170cf0.js b/compiler/tests-js-parser/pass/bb87b410a1170cf0.js new file mode 100644 index 000000000..9f6660a25 --- /dev/null +++ b/compiler/tests-js-parser/pass/bb87b410a1170cf0.js @@ -0,0 +1 @@ +for (let a of b); diff --git a/compiler/tests-js-parser/pass/bb8b546cf9db5996.js b/compiler/tests-js-parser/pass/bb8b546cf9db5996.js new file mode 100644 index 000000000..d644026a4 --- /dev/null +++ b/compiler/tests-js-parser/pass/bb8b546cf9db5996.js @@ -0,0 +1 @@ +({ get a() { return a }, set a(a) { return a; } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bbff5671643cc2ea.js b/compiler/tests-js-parser/pass/bbff5671643cc2ea.js new file mode 100644 index 000000000..840ca0538 --- /dev/null +++ b/compiler/tests-js-parser/pass/bbff5671643cc2ea.js @@ -0,0 +1 @@ +(class {set a(b) {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bbffb851469a3f0e.js b/compiler/tests-js-parser/pass/bbffb851469a3f0e.js new file mode 100644 index 000000000..f64eb17f4 --- /dev/null +++ b/compiler/tests-js-parser/pass/bbffb851469a3f0e.js @@ -0,0 +1 @@ +try { } catch (a) { let b; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bc10e230c13b6c02.js b/compiler/tests-js-parser/pass/bc10e230c13b6c02.js new file mode 100644 index 000000000..a7afd476f --- /dev/null +++ b/compiler/tests-js-parser/pass/bc10e230c13b6c02.js @@ -0,0 +1,3 @@ +function a() { + new new.target; +} diff --git a/compiler/tests-js-parser/pass/bc302492d441d561.js b/compiler/tests-js-parser/pass/bc302492d441d561.js new file mode 100644 index 000000000..80516b763 --- /dev/null +++ b/compiler/tests-js-parser/pass/bc302492d441d561.js @@ -0,0 +1 @@ +(function(){ var a = 1; /* sync */ }).b(this) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bc89b2b2f1e19f9e.js b/compiler/tests-js-parser/pass/bc89b2b2f1e19f9e.js new file mode 100644 index 000000000..51a1c56d5 --- /dev/null +++ b/compiler/tests-js-parser/pass/bc89b2b2f1e19f9e.js @@ -0,0 +1,2 @@ +{} +/foo/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bcd690cfb709ffe8.js b/compiler/tests-js-parser/pass/bcd690cfb709ffe8.js new file mode 100644 index 000000000..e776295cb --- /dev/null +++ b/compiler/tests-js-parser/pass/bcd690cfb709ffe8.js @@ -0,0 +1 @@ +for ({a = 1} in b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bce83ece0ba80598.js b/compiler/tests-js-parser/pass/bce83ece0ba80598.js new file mode 100644 index 000000000..9dafbd734 --- /dev/null +++ b/compiler/tests-js-parser/pass/bce83ece0ba80598.js @@ -0,0 +1 @@ +// Hello, world! diff --git a/compiler/tests-js-parser/pass/bd160eed5626ae7d.js b/compiler/tests-js-parser/pass/bd160eed5626ae7d.js new file mode 100644 index 000000000..5ff63c71c --- /dev/null +++ b/compiler/tests-js-parser/pass/bd160eed5626ae7d.js @@ -0,0 +1,7 @@ +d: while (a) { + b(); + c(); + continue d; + e(); + f(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bd28a7d19ac0d50b.js b/compiler/tests-js-parser/pass/bd28a7d19ac0d50b.js new file mode 100644 index 000000000..28d04055f --- /dev/null +++ b/compiler/tests-js-parser/pass/bd28a7d19ac0d50b.js @@ -0,0 +1 @@ +"use strict"; var a = { b: 1, get b() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bd697f0fda948394.js b/compiler/tests-js-parser/pass/bd697f0fda948394.js new file mode 100644 index 000000000..f163114c5 --- /dev/null +++ b/compiler/tests-js-parser/pass/bd697f0fda948394.js @@ -0,0 +1,7 @@ +(function() { + try { + throw 'a'; + } catch (b) { + } + c(); // This must not be removed. +}()); diff --git a/compiler/tests-js-parser/pass/bd7b54d5e0ce444b.js b/compiler/tests-js-parser/pass/bd7b54d5e0ce444b.js new file mode 100644 index 000000000..22c933575 --- /dev/null +++ b/compiler/tests-js-parser/pass/bd7b54d5e0ce444b.js @@ -0,0 +1,19 @@ +(function () { + // 'b' + b: { + if (a) break b; + // 'a' + c: { + if (a) break c; + if (a) break c; + if (a) break c; + } + // 'a' + c: { + if (a) break c; + if (a) break c; + if (a) break c; + } + + } +}()); diff --git a/compiler/tests-js-parser/pass/bd883e5fd1f09b69.js b/compiler/tests-js-parser/pass/bd883e5fd1f09b69.js new file mode 100644 index 000000000..f955c718d --- /dev/null +++ b/compiler/tests-js-parser/pass/bd883e5fd1f09b69.js @@ -0,0 +1 @@ +with (a) b = c; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bd9b563f02b80dae.js b/compiler/tests-js-parser/pass/bd9b563f02b80dae.js new file mode 100644 index 000000000..50ab6c300 --- /dev/null +++ b/compiler/tests-js-parser/pass/bd9b563f02b80dae.js @@ -0,0 +1 @@ +"use strict" + 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bdc4accd07049034.js b/compiler/tests-js-parser/pass/bdc4accd07049034.js new file mode 100644 index 000000000..f0543e110 --- /dev/null +++ b/compiler/tests-js-parser/pass/bdc4accd07049034.js @@ -0,0 +1,2 @@ +(class {;;; +;a(){}b(){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bde1a5ea9aebf9d2.js b/compiler/tests-js-parser/pass/bde1a5ea9aebf9d2.js new file mode 100644 index 000000000..705459a13 --- /dev/null +++ b/compiler/tests-js-parser/pass/bde1a5ea9aebf9d2.js @@ -0,0 +1 @@ +function arguments() { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bdfc6c05edd19925.js b/compiler/tests-js-parser/pass/bdfc6c05edd19925.js new file mode 100644 index 000000000..11fb678fb --- /dev/null +++ b/compiler/tests-js-parser/pass/bdfc6c05edd19925.js @@ -0,0 +1 @@ +/{}/; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/be2c3fff6426873e.js b/compiler/tests-js-parser/pass/be2c3fff6426873e.js new file mode 100644 index 000000000..82b987042 --- /dev/null +++ b/compiler/tests-js-parser/pass/be2c3fff6426873e.js @@ -0,0 +1 @@ +/*a b*/ 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/be2fd5888f434cbd.js b/compiler/tests-js-parser/pass/be2fd5888f434cbd.js new file mode 100644 index 000000000..ad7d86fdd --- /dev/null +++ b/compiler/tests-js-parser/pass/be2fd5888f434cbd.js @@ -0,0 +1 @@ +(function () { 'use\nstrict'; with (a); }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/be6eb70d9330c165.js b/compiler/tests-js-parser/pass/be6eb70d9330c165.js new file mode 100644 index 000000000..b4df9e41e --- /dev/null +++ b/compiler/tests-js-parser/pass/be6eb70d9330c165.js @@ -0,0 +1 @@ +0x100 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/be879445c87d7e72.js b/compiler/tests-js-parser/pass/be879445c87d7e72.js new file mode 100644 index 000000000..3e62046fe --- /dev/null +++ b/compiler/tests-js-parser/pass/be879445c87d7e72.js @@ -0,0 +1 @@ +var a; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/be9d538d5041fd5f.js b/compiler/tests-js-parser/pass/be9d538d5041fd5f.js new file mode 100644 index 000000000..587c773f7 --- /dev/null +++ b/compiler/tests-js-parser/pass/be9d538d5041fd5f.js @@ -0,0 +1 @@ +(...[a, b]) => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/beb4cc5812ec1eed.js b/compiler/tests-js-parser/pass/beb4cc5812ec1eed.js new file mode 100644 index 000000000..48235daa4 --- /dev/null +++ b/compiler/tests-js-parser/pass/beb4cc5812ec1eed.js @@ -0,0 +1 @@ +function* a(){({[yield]:a}=1)} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/beb5335e463d92c1.js b/compiler/tests-js-parser/pass/beb5335e463d92c1.js new file mode 100644 index 000000000..540925e56 --- /dev/null +++ b/compiler/tests-js-parser/pass/beb5335e463d92c1.js @@ -0,0 +1 @@ +a; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bedf5be599c82fe8.js b/compiler/tests-js-parser/pass/bedf5be599c82fe8.js new file mode 100644 index 000000000..7b6e55b35 --- /dev/null +++ b/compiler/tests-js-parser/pass/bedf5be599c82fe8.js @@ -0,0 +1 @@ +({ *a() { yield 1; } }) diff --git a/compiler/tests-js-parser/pass/bf1db420b006027f.js b/compiler/tests-js-parser/pass/bf1db420b006027f.js new file mode 100644 index 000000000..2746e0b61 --- /dev/null +++ b/compiler/tests-js-parser/pass/bf1db420b006027f.js @@ -0,0 +1 @@ +{do ; while(false) false} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bf210a4f0cf9e352.js b/compiler/tests-js-parser/pass/bf210a4f0cf9e352.js new file mode 100644 index 000000000..9081fb8d9 --- /dev/null +++ b/compiler/tests-js-parser/pass/bf210a4f0cf9e352.js @@ -0,0 +1 @@ +class a { static get b() {} get b() {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bf65e886047db371.js b/compiler/tests-js-parser/pass/bf65e886047db371.js new file mode 100644 index 000000000..4038e53ad --- /dev/null +++ b/compiler/tests-js-parser/pass/bf65e886047db371.js @@ -0,0 +1 @@ +var a = function (...b) { c() }; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bf6aaaab7c143ca1.js b/compiler/tests-js-parser/pass/bf6aaaab7c143ca1.js new file mode 100644 index 000000000..108d4a6ef --- /dev/null +++ b/compiler/tests-js-parser/pass/bf6aaaab7c143ca1.js @@ -0,0 +1 @@ +012 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bf8ffad512a5f568.js b/compiler/tests-js-parser/pass/bf8ffad512a5f568.js new file mode 100644 index 000000000..e3b829abb --- /dev/null +++ b/compiler/tests-js-parser/pass/bf8ffad512a5f568.js @@ -0,0 +1 @@ +class a { static get b() {} static set b(c) {} get b() {} set b(c) {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bf9c4d8ecd728018.js b/compiler/tests-js-parser/pass/bf9c4d8ecd728018.js new file mode 100644 index 000000000..1543d4081 --- /dev/null +++ b/compiler/tests-js-parser/pass/bf9c4d8ecd728018.js @@ -0,0 +1 @@ +0x10 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bf9e8bd90d8537c3.js b/compiler/tests-js-parser/pass/bf9e8bd90d8537c3.js new file mode 100644 index 000000000..6b37fdc89 --- /dev/null +++ b/compiler/tests-js-parser/pass/bf9e8bd90d8537c3.js @@ -0,0 +1 @@ +throw { a: "b" } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/bfb61863d3b10adf.js b/compiler/tests-js-parser/pass/bfb61863d3b10adf.js new file mode 100644 index 000000000..350b35d79 --- /dev/null +++ b/compiler/tests-js-parser/pass/bfb61863d3b10adf.js @@ -0,0 +1,2 @@ +// Infinity => 1/0 +1 / 2 diff --git a/compiler/tests-js-parser/pass/c06df922631aeabc.js b/compiler/tests-js-parser/pass/c06df922631aeabc.js new file mode 100644 index 000000000..4980fc89f --- /dev/null +++ b/compiler/tests-js-parser/pass/c06df922631aeabc.js @@ -0,0 +1 @@ +if (1); else function a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c0740dd25c9de39b.js b/compiler/tests-js-parser/pass/c0740dd25c9de39b.js new file mode 100644 index 000000000..2c0cac55e --- /dev/null +++ b/compiler/tests-js-parser/pass/c0740dd25c9de39b.js @@ -0,0 +1 @@ +3.14159 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c086a8a5c8ef2bb9.js b/compiler/tests-js-parser/pass/c086a8a5c8ef2bb9.js new file mode 100644 index 000000000..6f2defcde --- /dev/null +++ b/compiler/tests-js-parser/pass/c086a8a5c8ef2bb9.js @@ -0,0 +1 @@ +let yield = 1; diff --git a/compiler/tests-js-parser/pass/c0f5f3f7db69c5a0.js b/compiler/tests-js-parser/pass/c0f5f3f7db69c5a0.js new file mode 100644 index 000000000..e8054b1db --- /dev/null +++ b/compiler/tests-js-parser/pass/c0f5f3f7db69c5a0.js @@ -0,0 +1 @@ +a = { get() { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c1319833fc139cf8.js b/compiler/tests-js-parser/pass/c1319833fc139cf8.js new file mode 100644 index 000000000..16329f52f --- /dev/null +++ b/compiler/tests-js-parser/pass/c1319833fc139cf8.js @@ -0,0 +1,3 @@ +var a = { + '0': 'b' +}; diff --git a/compiler/tests-js-parser/pass/c162248ee699b68f.js b/compiler/tests-js-parser/pass/c162248ee699b68f.js new file mode 100644 index 000000000..4a3685f88 --- /dev/null +++ b/compiler/tests-js-parser/pass/c162248ee699b68f.js @@ -0,0 +1 @@ +var a; var b; var c; diff --git a/compiler/tests-js-parser/pass/c16d7f2993152b6b.module.js b/compiler/tests-js-parser/pass/c16d7f2993152b6b.module.js new file mode 100644 index 000000000..947f34ad6 --- /dev/null +++ b/compiler/tests-js-parser/pass/c16d7f2993152b6b.module.js @@ -0,0 +1 @@ +import { b as a } from "c" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c17fd07fc9b5bf7e.js b/compiler/tests-js-parser/pass/c17fd07fc9b5bf7e.js new file mode 100644 index 000000000..c35735f95 --- /dev/null +++ b/compiler/tests-js-parser/pass/c17fd07fc9b5bf7e.js @@ -0,0 +1,7 @@ +new a(1); +new a(2)(3); +new a(4)(5)(6); +new new a(7); +new new a(8)(9); +new (new a(10))(11); +(new new a(12))(13); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c18d547cafb43e30.js b/compiler/tests-js-parser/pass/c18d547cafb43e30.js new file mode 100644 index 000000000..9ecf3cf1d --- /dev/null +++ b/compiler/tests-js-parser/pass/c18d547cafb43e30.js @@ -0,0 +1 @@ +this diff --git a/compiler/tests-js-parser/pass/c1914072e996ddbe.js b/compiler/tests-js-parser/pass/c1914072e996ddbe.js new file mode 100644 index 000000000..0067d442e --- /dev/null +++ b/compiler/tests-js-parser/pass/c1914072e996ddbe.js @@ -0,0 +1 @@ +/\uDF06/u \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c1967c44c4179fb4.js b/compiler/tests-js-parser/pass/c1967c44c4179fb4.js new file mode 100644 index 000000000..3f09b75b4 --- /dev/null +++ b/compiler/tests-js-parser/pass/c1967c44c4179fb4.js @@ -0,0 +1 @@ + /**/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c1c5c5d42a32aac1.js b/compiler/tests-js-parser/pass/c1c5c5d42a32aac1.js new file mode 100644 index 000000000..d993bee9a --- /dev/null +++ b/compiler/tests-js-parser/pass/c1c5c5d42a32aac1.js @@ -0,0 +1 @@ +(class {a({b} = {b: 1}) {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c1c8f5c6abfc1d72.js b/compiler/tests-js-parser/pass/c1c8f5c6abfc1d72.js new file mode 100644 index 000000000..4ecde4acb --- /dev/null +++ b/compiler/tests-js-parser/pass/c1c8f5c6abfc1d72.js @@ -0,0 +1 @@ +({var: a} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c1dd2285cd8a959d.js b/compiler/tests-js-parser/pass/c1dd2285cd8a959d.js new file mode 100644 index 000000000..d52143b74 --- /dev/null +++ b/compiler/tests-js-parser/pass/c1dd2285cd8a959d.js @@ -0,0 +1 @@ +for(a of b) c(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c1e396cb7871b175.js b/compiler/tests-js-parser/pass/c1e396cb7871b175.js new file mode 100644 index 000000000..d708d3cc3 --- /dev/null +++ b/compiler/tests-js-parser/pass/c1e396cb7871b175.js @@ -0,0 +1 @@ +({a: [1]}+[]) / 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c2116aecaac68db9.js b/compiler/tests-js-parser/pass/c2116aecaac68db9.js new file mode 100644 index 000000000..6d423149d --- /dev/null +++ b/compiler/tests-js-parser/pass/c2116aecaac68db9.js @@ -0,0 +1 @@ +function *a() { yield *yield } diff --git a/compiler/tests-js-parser/pass/c2203cb9e7bfe40f.js b/compiler/tests-js-parser/pass/c2203cb9e7bfe40f.js new file mode 100644 index 000000000..e686bce9e --- /dev/null +++ b/compiler/tests-js-parser/pass/c2203cb9e7bfe40f.js @@ -0,0 +1 @@ +a-- \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c247dcc00119f19c.js b/compiler/tests-js-parser/pass/c247dcc00119f19c.js new file mode 100644 index 000000000..e4f382922 --- /dev/null +++ b/compiler/tests-js-parser/pass/c247dcc00119f19c.js @@ -0,0 +1 @@ +for(var a in [1,2]) 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c24da2ce6761a80a.js b/compiler/tests-js-parser/pass/c24da2ce6761a80a.js new file mode 100644 index 000000000..73d162416 --- /dev/null +++ b/compiler/tests-js-parser/pass/c24da2ce6761a80a.js @@ -0,0 +1 @@ +a + b - c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c2558dc20a45b0a8.js b/compiler/tests-js-parser/pass/c2558dc20a45b0a8.js new file mode 100644 index 000000000..4cdf245de --- /dev/null +++ b/compiler/tests-js-parser/pass/c2558dc20a45b0a8.js @@ -0,0 +1 @@ +({[1+2]() {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c25bf945aaff8fe1.js b/compiler/tests-js-parser/pass/c25bf945aaff8fe1.js new file mode 100644 index 000000000..5638d8ba2 --- /dev/null +++ b/compiler/tests-js-parser/pass/c25bf945aaff8fe1.js @@ -0,0 +1 @@ +"Hello" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c269a2a601c495f1.js b/compiler/tests-js-parser/pass/c269a2a601c495f1.js new file mode 100644 index 000000000..937ead3cd --- /dev/null +++ b/compiler/tests-js-parser/pass/c269a2a601c495f1.js @@ -0,0 +1,4 @@ +(function () { + a = 1; + for (;;); +}()); diff --git a/compiler/tests-js-parser/pass/c274891790345c56.js b/compiler/tests-js-parser/pass/c274891790345c56.js new file mode 100644 index 000000000..603f0d667 --- /dev/null +++ b/compiler/tests-js-parser/pass/c274891790345c56.js @@ -0,0 +1 @@ +-a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c27ded6ec20ea305.js b/compiler/tests-js-parser/pass/c27ded6ec20ea305.js new file mode 100644 index 000000000..933c36c84 --- /dev/null +++ b/compiler/tests-js-parser/pass/c27ded6ec20ea305.js @@ -0,0 +1,2 @@ +while(true) { break +; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c2d90d623b0f4c2e.js b/compiler/tests-js-parser/pass/c2d90d623b0f4c2e.js new file mode 100644 index 000000000..e27c7eaad --- /dev/null +++ b/compiler/tests-js-parser/pass/c2d90d623b0f4c2e.js @@ -0,0 +1 @@ +a += 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c2f12d66ce17d5ab.js b/compiler/tests-js-parser/pass/c2f12d66ce17d5ab.js new file mode 100644 index 000000000..1e655558e --- /dev/null +++ b/compiler/tests-js-parser/pass/c2f12d66ce17d5ab.js @@ -0,0 +1 @@ +({ get null() {} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c2fe8f120b796831.js b/compiler/tests-js-parser/pass/c2fe8f120b796831.js new file mode 100644 index 000000000..e2b6d4ac4 --- /dev/null +++ b/compiler/tests-js-parser/pass/c2fe8f120b796831.js @@ -0,0 +1 @@ +for(a in b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c30eafd82f40470b.js b/compiler/tests-js-parser/pass/c30eafd82f40470b.js new file mode 100644 index 000000000..7000f9b76 --- /dev/null +++ b/compiler/tests-js-parser/pass/c30eafd82f40470b.js @@ -0,0 +1 @@ +(1 + 2 ) * 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c3172ad30aed99c8.js b/compiler/tests-js-parser/pass/c3172ad30aed99c8.js new file mode 100644 index 000000000..be91e2573 --- /dev/null +++ b/compiler/tests-js-parser/pass/c3172ad30aed99c8.js @@ -0,0 +1 @@ +const[a] = b; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c35304fa99a2c331.js b/compiler/tests-js-parser/pass/c35304fa99a2c331.js new file mode 100644 index 000000000..46ed657e7 --- /dev/null +++ b/compiler/tests-js-parser/pass/c35304fa99a2c331.js @@ -0,0 +1,4 @@ +(function () { + if (a) return; + else return 1; +}()); diff --git a/compiler/tests-js-parser/pass/c35dcf99291ec6be.js b/compiler/tests-js-parser/pass/c35dcf99291ec6be.js new file mode 100644 index 000000000..b886d6e18 --- /dev/null +++ b/compiler/tests-js-parser/pass/c35dcf99291ec6be.js @@ -0,0 +1 @@ +({ __proto__: null, __proto__(){}, }) diff --git a/compiler/tests-js-parser/pass/c3699b982b33926b.js b/compiler/tests-js-parser/pass/c3699b982b33926b.js new file mode 100644 index 000000000..250c62fed --- /dev/null +++ b/compiler/tests-js-parser/pass/c3699b982b33926b.js @@ -0,0 +1 @@ +a | b & c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c3799cf68cbac258.js b/compiler/tests-js-parser/pass/c3799cf68cbac258.js new file mode 100644 index 000000000..68e64c4d3 --- /dev/null +++ b/compiler/tests-js-parser/pass/c3799cf68cbac258.js @@ -0,0 +1 @@ +({0: a} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c38644033565f7b9.js b/compiler/tests-js-parser/pass/c38644033565f7b9.js new file mode 100644 index 000000000..648e4bf51 --- /dev/null +++ b/compiler/tests-js-parser/pass/c38644033565f7b9.js @@ -0,0 +1 @@ +(()=>1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c3ce623096553057.js b/compiler/tests-js-parser/pass/c3ce623096553057.js new file mode 100644 index 000000000..5ed08c0a9 --- /dev/null +++ b/compiler/tests-js-parser/pass/c3ce623096553057.js @@ -0,0 +1 @@ +a + (b < (c * d)) + e \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c3dc60d438666700.js b/compiler/tests-js-parser/pass/c3dc60d438666700.js new file mode 100644 index 000000000..6c19565f8 --- /dev/null +++ b/compiler/tests-js-parser/pass/c3dc60d438666700.js @@ -0,0 +1 @@ +new a()`` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c3fc8ace42f3fb44.js b/compiler/tests-js-parser/pass/c3fc8ace42f3fb44.js new file mode 100644 index 000000000..d0a58a1b7 --- /dev/null +++ b/compiler/tests-js-parser/pass/c3fc8ace42f3fb44.js @@ -0,0 +1 @@ +a.if \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c412905e229d6f2b.js b/compiler/tests-js-parser/pass/c412905e229d6f2b.js new file mode 100644 index 000000000..f1926ddd9 --- /dev/null +++ b/compiler/tests-js-parser/pass/c412905e229d6f2b.js @@ -0,0 +1 @@ +delete a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c4336e0b6801c42c.js b/compiler/tests-js-parser/pass/c4336e0b6801c42c.js new file mode 100644 index 000000000..4ea7c61b2 --- /dev/null +++ b/compiler/tests-js-parser/pass/c4336e0b6801c42c.js @@ -0,0 +1,4 @@ +({ *a() { + yield + 1 +} }) diff --git a/compiler/tests-js-parser/pass/c442dc81201e2b55.js b/compiler/tests-js-parser/pass/c442dc81201e2b55.js new file mode 100644 index 000000000..a00071d51 --- /dev/null +++ b/compiler/tests-js-parser/pass/c442dc81201e2b55.js @@ -0,0 +1 @@ +for(let;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c4627eaa56f73949.js b/compiler/tests-js-parser/pass/c4627eaa56f73949.js new file mode 100644 index 000000000..1a2bbb600 --- /dev/null +++ b/compiler/tests-js-parser/pass/c4627eaa56f73949.js @@ -0,0 +1 @@ +1 % 2 diff --git a/compiler/tests-js-parser/pass/c4a57a72e25e042c.js b/compiler/tests-js-parser/pass/c4a57a72e25e042c.js new file mode 100644 index 000000000..525edc07d --- /dev/null +++ b/compiler/tests-js-parser/pass/c4a57a72e25e042c.js @@ -0,0 +1 @@ +a = { get "b"() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c4c51e5c6d4012ef.js b/compiler/tests-js-parser/pass/c4c51e5c6d4012ef.js new file mode 100644 index 000000000..75af87fdb --- /dev/null +++ b/compiler/tests-js-parser/pass/c4c51e5c6d4012ef.js @@ -0,0 +1,2 @@ +a: while(true) { break a +; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c4f2243c81525bbd.js b/compiler/tests-js-parser/pass/c4f2243c81525bbd.js new file mode 100644 index 000000000..629c1d191 --- /dev/null +++ b/compiler/tests-js-parser/pass/c4f2243c81525bbd.js @@ -0,0 +1 @@ +var a = (1 + 2) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c52db35cba7fdbc0.js b/compiler/tests-js-parser/pass/c52db35cba7fdbc0.js new file mode 100644 index 000000000..45464a2e4 --- /dev/null +++ b/compiler/tests-js-parser/pass/c52db35cba7fdbc0.js @@ -0,0 +1,8 @@ +(function() { + try { + throw 'a'; + } finally { + b(); + } + c(); // This should be removed. +}()); diff --git a/compiler/tests-js-parser/pass/c5328483d3ccadd0.js b/compiler/tests-js-parser/pass/c5328483d3ccadd0.js new file mode 100644 index 000000000..e265ec428 --- /dev/null +++ b/compiler/tests-js-parser/pass/c5328483d3ccadd0.js @@ -0,0 +1 @@ +0o0 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c532e126a986c1d4.js b/compiler/tests-js-parser/pass/c532e126a986c1d4.js new file mode 100644 index 000000000..5c6c292cd --- /dev/null +++ b/compiler/tests-js-parser/pass/c532e126a986c1d4.js @@ -0,0 +1,2 @@ +; +--> HTML comment \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c546a199e87abaad.js b/compiler/tests-js-parser/pass/c546a199e87abaad.js new file mode 100644 index 000000000..6f7a3fe2e --- /dev/null +++ b/compiler/tests-js-parser/pass/c546a199e87abaad.js @@ -0,0 +1 @@ +for(let [a=b in c] in null); diff --git a/compiler/tests-js-parser/pass/c5823f1dccaf9787.js b/compiler/tests-js-parser/pass/c5823f1dccaf9787.js new file mode 100644 index 000000000..bd3963c09 --- /dev/null +++ b/compiler/tests-js-parser/pass/c5823f1dccaf9787.js @@ -0,0 +1 @@ +for(var a of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c58e9029f1fd3d1b.js b/compiler/tests-js-parser/pass/c58e9029f1fd3d1b.js new file mode 100644 index 000000000..cf3afc384 --- /dev/null +++ b/compiler/tests-js-parser/pass/c58e9029f1fd3d1b.js @@ -0,0 +1 @@ +let a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c5957fd3a6d258df.js b/compiler/tests-js-parser/pass/c5957fd3a6d258df.js new file mode 100644 index 000000000..a2691dbb6 --- /dev/null +++ b/compiler/tests-js-parser/pass/c5957fd3a6d258df.js @@ -0,0 +1,3 @@ +b: { + a; +} diff --git a/compiler/tests-js-parser/pass/c5b2ea7da55d24c1.js b/compiler/tests-js-parser/pass/c5b2ea7da55d24c1.js new file mode 100644 index 000000000..ecf691171 --- /dev/null +++ b/compiler/tests-js-parser/pass/c5b2ea7da55d24c1.js @@ -0,0 +1 @@ +function a() { function a() {} function a() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c5bd72f618d7cade.js b/compiler/tests-js-parser/pass/c5bd72f618d7cade.js new file mode 100644 index 000000000..40b980b1b --- /dev/null +++ b/compiler/tests-js-parser/pass/c5bd72f618d7cade.js @@ -0,0 +1 @@ +function* a(){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c6827eb9dd7b3dc6.js b/compiler/tests-js-parser/pass/c6827eb9dd7b3dc6.js new file mode 100644 index 000000000..eacf1137f --- /dev/null +++ b/compiler/tests-js-parser/pass/c6827eb9dd7b3dc6.js @@ -0,0 +1 @@ +({a = 1} = b) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c6ea3404ea5c6c91.js b/compiler/tests-js-parser/pass/c6ea3404ea5c6c91.js new file mode 100644 index 000000000..125c50ddf --- /dev/null +++ b/compiler/tests-js-parser/pass/c6ea3404ea5c6c91.js @@ -0,0 +1 @@ +a(...b, c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c6ff61d189c5cbee.js b/compiler/tests-js-parser/pass/c6ff61d189c5cbee.js new file mode 100644 index 000000000..fbf2c0c42 --- /dev/null +++ b/compiler/tests-js-parser/pass/c6ff61d189c5cbee.js @@ -0,0 +1 @@ +(a[b]||(c[d]=e)) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c756f39dca1f7423.js b/compiler/tests-js-parser/pass/c756f39dca1f7423.js new file mode 100644 index 000000000..8fa29d181 --- /dev/null +++ b/compiler/tests-js-parser/pass/c756f39dca1f7423.js @@ -0,0 +1 @@ +a = function(b, ...c) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c767fa4d683aa3ce.js b/compiler/tests-js-parser/pass/c767fa4d683aa3ce.js new file mode 100644 index 000000000..3de0b7cd0 --- /dev/null +++ b/compiler/tests-js-parser/pass/c767fa4d683aa3ce.js @@ -0,0 +1 @@ +({ get a(){ new.target } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c771490bbb3dd6e9.js b/compiler/tests-js-parser/pass/c771490bbb3dd6e9.js new file mode 100644 index 000000000..5d4144390 --- /dev/null +++ b/compiler/tests-js-parser/pass/c771490bbb3dd6e9.js @@ -0,0 +1 @@ +class a { *static() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c78c8fbfbd3e779e.js b/compiler/tests-js-parser/pass/c78c8fbfbd3e779e.js new file mode 100644 index 000000000..609fe2c97 --- /dev/null +++ b/compiler/tests-js-parser/pass/c78c8fbfbd3e779e.js @@ -0,0 +1 @@ +while (1) /foo/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c7dd4bc60ffb40e9.js b/compiler/tests-js-parser/pass/c7dd4bc60ffb40e9.js new file mode 100644 index 000000000..d53fabc33 --- /dev/null +++ b/compiler/tests-js-parser/pass/c7dd4bc60ffb40e9.js @@ -0,0 +1 @@ +var {} = 1 diff --git a/compiler/tests-js-parser/pass/c7e5fba8bf3854cd.js b/compiler/tests-js-parser/pass/c7e5fba8bf3854cd.js new file mode 100644 index 000000000..56dc3180f Binary files /dev/null and b/compiler/tests-js-parser/pass/c7e5fba8bf3854cd.js differ diff --git a/compiler/tests-js-parser/pass/c80d9415dde647cd.js b/compiler/tests-js-parser/pass/c80d9415dde647cd.js new file mode 100644 index 000000000..d4ed3f4aa --- /dev/null +++ b/compiler/tests-js-parser/pass/c80d9415dde647cd.js @@ -0,0 +1 @@ +a = { set if(b) { c = b } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c83a2dcf75fa419a.js b/compiler/tests-js-parser/pass/c83a2dcf75fa419a.js new file mode 100644 index 000000000..ee5e5adff --- /dev/null +++ b/compiler/tests-js-parser/pass/c83a2dcf75fa419a.js @@ -0,0 +1 @@ +/[\]/]/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c844c5ec9f6dbf86.js b/compiler/tests-js-parser/pass/c844c5ec9f6dbf86.js new file mode 100644 index 000000000..3bf89887d --- /dev/null +++ b/compiler/tests-js-parser/pass/c844c5ec9f6dbf86.js @@ -0,0 +1 @@ +a = "b" != typeof c.d \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c8513472857eae9c.js b/compiler/tests-js-parser/pass/c8513472857eae9c.js new file mode 100644 index 000000000..5def1626d --- /dev/null +++ b/compiler/tests-js-parser/pass/c8513472857eae9c.js @@ -0,0 +1 @@ +({ set a(b = new.target){} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c8565124aee75c69.js b/compiler/tests-js-parser/pass/c8565124aee75c69.js new file mode 100644 index 000000000..e225a26b0 --- /dev/null +++ b/compiler/tests-js-parser/pass/c8565124aee75c69.js @@ -0,0 +1 @@ +for (a of let) {} diff --git a/compiler/tests-js-parser/pass/c85bc4de504befc7.js b/compiler/tests-js-parser/pass/c85bc4de504befc7.js new file mode 100644 index 000000000..179889aa1 --- /dev/null +++ b/compiler/tests-js-parser/pass/c85bc4de504befc7.js @@ -0,0 +1 @@ +a = { get b() { return c } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c85fbdb8c97e0534.js b/compiler/tests-js-parser/pass/c85fbdb8c97e0534.js new file mode 100644 index 000000000..41e76e10c --- /dev/null +++ b/compiler/tests-js-parser/pass/c85fbdb8c97e0534.js @@ -0,0 +1 @@ +let a, x\u{E01D5} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c8689b6da6fd227a.js b/compiler/tests-js-parser/pass/c8689b6da6fd227a.js new file mode 100644 index 000000000..90ac4bd8c --- /dev/null +++ b/compiler/tests-js-parser/pass/c8689b6da6fd227a.js @@ -0,0 +1 @@ +a = { get b() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c87859666bd18c8c.js b/compiler/tests-js-parser/pass/c87859666bd18c8c.js new file mode 100644 index 000000000..0ffb11ddb --- /dev/null +++ b/compiler/tests-js-parser/pass/c87859666bd18c8c.js @@ -0,0 +1 @@ +while (1) {} /foo/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c88c5d1e7e9574b6.js b/compiler/tests-js-parser/pass/c88c5d1e7e9574b6.js new file mode 100644 index 000000000..24a733382 --- /dev/null +++ b/compiler/tests-js-parser/pass/c88c5d1e7e9574b6.js @@ -0,0 +1 @@ +var a = /[a-c]/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c8b9a4d186ec2eb8.js b/compiler/tests-js-parser/pass/c8b9a4d186ec2eb8.js new file mode 100644 index 000000000..0530f4ce5 --- /dev/null +++ b/compiler/tests-js-parser/pass/c8b9a4d186ec2eb8.js @@ -0,0 +1 @@ +a: do continue a; while(1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c8dbdecbde2c1869.js b/compiler/tests-js-parser/pass/c8dbdecbde2c1869.js new file mode 100644 index 000000000..666f64b28 --- /dev/null +++ b/compiler/tests-js-parser/pass/c8dbdecbde2c1869.js @@ -0,0 +1,4 @@ +(function() { + throw 'a'; + a(); +}()); diff --git a/compiler/tests-js-parser/pass/c92dc954a0ce196d.module.js b/compiler/tests-js-parser/pass/c92dc954a0ce196d.module.js new file mode 100644 index 000000000..b3a4e2234 --- /dev/null +++ b/compiler/tests-js-parser/pass/c92dc954a0ce196d.module.js @@ -0,0 +1 @@ +export default function a() {} false \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c963ac653b30699b.js b/compiler/tests-js-parser/pass/c963ac653b30699b.js new file mode 100644 index 000000000..29737f8b4 --- /dev/null +++ b/compiler/tests-js-parser/pass/c963ac653b30699b.js @@ -0,0 +1 @@ +a = { 'b'() { } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c964ed7bc2373c54.js b/compiler/tests-js-parser/pass/c964ed7bc2373c54.js new file mode 100644 index 000000000..4ba8eb343 --- /dev/null +++ b/compiler/tests-js-parser/pass/c964ed7bc2373c54.js @@ -0,0 +1,4 @@ +function a({a=(1), b}) {} +function b([b, c=(2)]) {} +var { d = (3), e } = d; +var [ d, e = (4) ] = d; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c98889d7d94a0a63.js b/compiler/tests-js-parser/pass/c98889d7d94a0a63.js new file mode 100644 index 000000000..8bbda32e6 --- /dev/null +++ b/compiler/tests-js-parser/pass/c98889d7d94a0a63.js @@ -0,0 +1 @@ +[a, ...[b, c]] = d \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c98eba310f5568b1.js b/compiler/tests-js-parser/pass/c98eba310f5568b1.js new file mode 100644 index 000000000..c34d6289c --- /dev/null +++ b/compiler/tests-js-parser/pass/c98eba310f5568b1.js @@ -0,0 +1,2 @@ +for (;;) + if (a()) break; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c9b780fb91a9db4e.js b/compiler/tests-js-parser/pass/c9b780fb91a9db4e.js new file mode 100644 index 000000000..7803140a1 --- /dev/null +++ b/compiler/tests-js-parser/pass/c9b780fb91a9db4e.js @@ -0,0 +1,4 @@ +/*@ngInject*/ +var a = function(b) { + return b; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/c9d32e4fc1687f5d.js b/compiler/tests-js-parser/pass/c9d32e4fc1687f5d.js new file mode 100644 index 000000000..34baf68f0 --- /dev/null +++ b/compiler/tests-js-parser/pass/c9d32e4fc1687f5d.js @@ -0,0 +1,10 @@ +c: switch (1) { + case 2: + a(); + for (;;) if (b) break c; + d(); + case 3+4: + e(); + default: + f(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca20c15b39c87033.js b/compiler/tests-js-parser/pass/ca20c15b39c87033.js new file mode 100644 index 000000000..6990017f3 --- /dev/null +++ b/compiler/tests-js-parser/pass/ca20c15b39c87033.js @@ -0,0 +1 @@ +class a {static(){};} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca34a796e624adaf.js b/compiler/tests-js-parser/pass/ca34a796e624adaf.js new file mode 100644 index 000000000..4023fc13d --- /dev/null +++ b/compiler/tests-js-parser/pass/ca34a796e624adaf.js @@ -0,0 +1,7 @@ +switch (1) { + case 2: a(); + case 3+4: b(); break; + case 5+6+7: c(); + default: + d(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca39d991b4f07bf1.js b/compiler/tests-js-parser/pass/ca39d991b4f07bf1.js new file mode 100644 index 000000000..76f5654e9 --- /dev/null +++ b/compiler/tests-js-parser/pass/ca39d991b4f07bf1.js @@ -0,0 +1,6 @@ +var a, b, c; +d( + a(e), + b(e, e), + c(e) +); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca450ebe11a7e7c9.module.js b/compiler/tests-js-parser/pass/ca450ebe11a7e7c9.module.js new file mode 100644 index 000000000..b5ba4728f --- /dev/null +++ b/compiler/tests-js-parser/pass/ca450ebe11a7e7c9.module.js @@ -0,0 +1 @@ +import "a" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca452a778322112a.js b/compiler/tests-js-parser/pass/ca452a778322112a.js new file mode 100644 index 000000000..078426a60 --- /dev/null +++ b/compiler/tests-js-parser/pass/ca452a778322112a.js @@ -0,0 +1 @@ +// \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca4f13a64e35195f.js b/compiler/tests-js-parser/pass/ca4f13a64e35195f.js new file mode 100644 index 000000000..2407009e0 --- /dev/null +++ b/compiler/tests-js-parser/pass/ca4f13a64e35195f.js @@ -0,0 +1 @@ +a = { null: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca7a0ca0d22f30f8.js b/compiler/tests-js-parser/pass/ca7a0ca0d22f30f8.js new file mode 100644 index 000000000..d66d2606c --- /dev/null +++ b/compiler/tests-js-parser/pass/ca7a0ca0d22f30f8.js @@ -0,0 +1 @@ +(class{[1+2](){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ca978112ca1bbdca.js b/compiler/tests-js-parser/pass/ca978112ca1bbdca.js new file mode 100644 index 000000000..2e65efe2a --- /dev/null +++ b/compiler/tests-js-parser/pass/ca978112ca1bbdca.js @@ -0,0 +1 @@ +a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/caa0719b52a1409d.js b/compiler/tests-js-parser/pass/caa0719b52a1409d.js new file mode 100644 index 000000000..e98c81e89 --- /dev/null +++ b/compiler/tests-js-parser/pass/caa0719b52a1409d.js @@ -0,0 +1 @@ +a`` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/caaa9f06dd52e5a5.module.js b/compiler/tests-js-parser/pass/caaa9f06dd52e5a5.module.js new file mode 100644 index 000000000..fa3f51588 --- /dev/null +++ b/compiler/tests-js-parser/pass/caaa9f06dd52e5a5.module.js @@ -0,0 +1 @@ +import { null as a } from "b" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/caf6539007d41b5e.js b/compiler/tests-js-parser/pass/caf6539007d41b5e.js new file mode 100644 index 000000000..3252cdd9a --- /dev/null +++ b/compiler/tests-js-parser/pass/caf6539007d41b5e.js @@ -0,0 +1 @@ +[/q/] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cb05f3c30f5f88c0.js b/compiler/tests-js-parser/pass/cb05f3c30f5f88c0.js new file mode 100644 index 000000000..7c1ae87dd --- /dev/null +++ b/compiler/tests-js-parser/pass/cb05f3c30f5f88c0.js @@ -0,0 +1 @@ +new a(...b, ...c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cb095c303f88cd0b.js b/compiler/tests-js-parser/pass/cb095c303f88cd0b.js new file mode 100644 index 000000000..5a489dbd0 --- /dev/null +++ b/compiler/tests-js-parser/pass/cb095c303f88cd0b.js @@ -0,0 +1 @@ +('\2111') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cb211fadccb029c7.js b/compiler/tests-js-parser/pass/cb211fadccb029c7.js new file mode 100644 index 000000000..cd4eabce8 --- /dev/null +++ b/compiler/tests-js-parser/pass/cb211fadccb029c7.js @@ -0,0 +1 @@ +function *a(){yield delete 1} diff --git a/compiler/tests-js-parser/pass/cb23f6635a581786.js b/compiler/tests-js-parser/pass/cb23f6635a581786.js new file mode 100644 index 000000000..2fdfd51e8 --- /dev/null +++ b/compiler/tests-js-parser/pass/cb23f6635a581786.js @@ -0,0 +1 @@ +a + b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cb2d573836b1e204.js b/compiler/tests-js-parser/pass/cb2d573836b1e204.js new file mode 100644 index 000000000..052cf5d99 --- /dev/null +++ b/compiler/tests-js-parser/pass/cb2d573836b1e204.js @@ -0,0 +1,3 @@ +function a() { + new.target(); +} diff --git a/compiler/tests-js-parser/pass/cb3316f2b008bec3.js b/compiler/tests-js-parser/pass/cb3316f2b008bec3.js new file mode 100644 index 000000000..f4563cfce --- /dev/null +++ b/compiler/tests-js-parser/pass/cb3316f2b008bec3.js @@ -0,0 +1 @@ +({ *a() { yield* 1; } }) diff --git a/compiler/tests-js-parser/pass/cb4b35cf4cd815d8.js b/compiler/tests-js-parser/pass/cb4b35cf4cd815d8.js new file mode 100644 index 000000000..70853cbd3 --- /dev/null +++ b/compiler/tests-js-parser/pass/cb4b35cf4cd815d8.js @@ -0,0 +1 @@ +({[a]: a} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cb625ce2970fe52a.js b/compiler/tests-js-parser/pass/cb625ce2970fe52a.js new file mode 100644 index 000000000..3afc25c60 --- /dev/null +++ b/compiler/tests-js-parser/pass/cb625ce2970fe52a.js @@ -0,0 +1 @@ +(function () { 'use\x20strict'; with (a); }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cb898749d76e51fd.js b/compiler/tests-js-parser/pass/cb898749d76e51fd.js new file mode 100644 index 000000000..e0ef58402 --- /dev/null +++ b/compiler/tests-js-parser/pass/cb898749d76e51fd.js @@ -0,0 +1 @@ +1 + 2 diff --git a/compiler/tests-js-parser/pass/cbc644a20893a549.js b/compiler/tests-js-parser/pass/cbc644a20893a549.js new file mode 100644 index 000000000..dd0f82162 --- /dev/null +++ b/compiler/tests-js-parser/pass/cbc644a20893a549.js @@ -0,0 +1 @@ +a & b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cbc7fdab53161051.js b/compiler/tests-js-parser/pass/cbc7fdab53161051.js new file mode 100644 index 000000000..04c5e8411 --- /dev/null +++ b/compiler/tests-js-parser/pass/cbc7fdab53161051.js @@ -0,0 +1,2 @@ +debugger; +if (a) debugger; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cbccdb75b22a522c.js b/compiler/tests-js-parser/pass/cbccdb75b22a522c.js new file mode 100644 index 000000000..595b5eb0e --- /dev/null +++ b/compiler/tests-js-parser/pass/cbccdb75b22a522c.js @@ -0,0 +1 @@ +function *a(){yield-1} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cbf9e832efe61a2e.js b/compiler/tests-js-parser/pass/cbf9e832efe61a2e.js new file mode 100644 index 000000000..728dff334 --- /dev/null +++ b/compiler/tests-js-parser/pass/cbf9e832efe61a2e.js @@ -0,0 +1 @@ +for (let {} in 1); diff --git a/compiler/tests-js-parser/pass/cc561e319220c789.js b/compiler/tests-js-parser/pass/cc561e319220c789.js new file mode 100644 index 000000000..a6c196b35 --- /dev/null +++ b/compiler/tests-js-parser/pass/cc561e319220c789.js @@ -0,0 +1 @@ +do /x/; while (false); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cc6ea8664124953a.js b/compiler/tests-js-parser/pass/cc6ea8664124953a.js new file mode 100644 index 000000000..b03319d48 --- /dev/null +++ b/compiler/tests-js-parser/pass/cc6ea8664124953a.js @@ -0,0 +1 @@ +a.true \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cc793d44a11617e7.js b/compiler/tests-js-parser/pass/cc793d44a11617e7.js new file mode 100644 index 000000000..7632481c4 --- /dev/null +++ b/compiler/tests-js-parser/pass/cc793d44a11617e7.js @@ -0,0 +1 @@ +try { a(); } catch (b) { c(b) } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cc7b1f054147aa5c.js b/compiler/tests-js-parser/pass/cc7b1f054147aa5c.js new file mode 100644 index 000000000..62aa3d198 --- /dev/null +++ b/compiler/tests-js-parser/pass/cc7b1f054147aa5c.js @@ -0,0 +1 @@ +switch (a) { case 1: b() /* perfect */ } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ccd1f89a0344e04e.js b/compiler/tests-js-parser/pass/ccd1f89a0344e04e.js new file mode 100644 index 000000000..218510eb8 --- /dev/null +++ b/compiler/tests-js-parser/pass/ccd1f89a0344e04e.js @@ -0,0 +1 @@ +(a=1) => a * a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cd136009983641b5.js b/compiler/tests-js-parser/pass/cd136009983641b5.js new file mode 100644 index 000000000..1521101f5 --- /dev/null +++ b/compiler/tests-js-parser/pass/cd136009983641b5.js @@ -0,0 +1,4 @@ +(function(){ + if(a) return b; + if(b) return c; +}()) diff --git a/compiler/tests-js-parser/pass/cd2f5476a739c80a.js b/compiler/tests-js-parser/pass/cd2f5476a739c80a.js new file mode 100644 index 000000000..f9a2308f5 --- /dev/null +++ b/compiler/tests-js-parser/pass/cd2f5476a739c80a.js @@ -0,0 +1 @@ +new(a in b) diff --git a/compiler/tests-js-parser/pass/cda499c521ff60c7.js b/compiler/tests-js-parser/pass/cda499c521ff60c7.js new file mode 100644 index 000000000..f498112b3 --- /dev/null +++ b/compiler/tests-js-parser/pass/cda499c521ff60c7.js @@ -0,0 +1,8 @@ +a = class { + static b() {} + static get c() {} + static set d(a) {} + static() { /* "static" can be a method name! */ } + get() { /* "get" can be a method name! */ } + set() { /* "set" can be a method name! */ } +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cdb9bd6096e2732c.js b/compiler/tests-js-parser/pass/cdb9bd6096e2732c.js new file mode 100644 index 000000000..df35d14f2 --- /dev/null +++ b/compiler/tests-js-parser/pass/cdb9bd6096e2732c.js @@ -0,0 +1 @@ +++arguments \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cdbd7fe30e1c7321.js b/compiler/tests-js-parser/pass/cdbd7fe30e1c7321.js new file mode 100644 index 000000000..1b4ffd055 --- /dev/null +++ b/compiler/tests-js-parser/pass/cdbd7fe30e1c7321.js @@ -0,0 +1,3 @@ +(function () { + var a =1; // should hoist to parameter +}()); diff --git a/compiler/tests-js-parser/pass/cdca52810bbe4532.js b/compiler/tests-js-parser/pass/cdca52810bbe4532.js new file mode 100644 index 000000000..dcac72a10 --- /dev/null +++ b/compiler/tests-js-parser/pass/cdca52810bbe4532.js @@ -0,0 +1,9 @@ +function a() { + b.c('d'); +} +a(); +{ +} +function a() { + b.c('e'); +} diff --git a/compiler/tests-js-parser/pass/cdee1bf4a6391af8.js b/compiler/tests-js-parser/pass/cdee1bf4a6391af8.js new file mode 100644 index 000000000..437081658 --- /dev/null +++ b/compiler/tests-js-parser/pass/cdee1bf4a6391af8.js @@ -0,0 +1 @@ +++a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cdf411040ab4b29b.js b/compiler/tests-js-parser/pass/cdf411040ab4b29b.js new file mode 100644 index 000000000..b60d340f5 --- /dev/null +++ b/compiler/tests-js-parser/pass/cdf411040ab4b29b.js @@ -0,0 +1 @@ +((() => {}))() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cdf43a987840ece8.js b/compiler/tests-js-parser/pass/cdf43a987840ece8.js new file mode 100644 index 000000000..7285e36a3 --- /dev/null +++ b/compiler/tests-js-parser/pass/cdf43a987840ece8.js @@ -0,0 +1 @@ +/[]/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ce0aaec02d5d4465.js b/compiler/tests-js-parser/pass/ce0aaec02d5d4465.js new file mode 100644 index 000000000..2d187d9a4 --- /dev/null +++ b/compiler/tests-js-parser/pass/ce0aaec02d5d4465.js @@ -0,0 +1 @@ +class a { static get [b]() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ce349e20cf388e87.js b/compiler/tests-js-parser/pass/ce349e20cf388e87.js new file mode 100644 index 000000000..05627da80 --- /dev/null +++ b/compiler/tests-js-parser/pass/ce349e20cf388e87.js @@ -0,0 +1,3 @@ +var a = { + 'b': 1 +}; diff --git a/compiler/tests-js-parser/pass/ce3d1f8d346bb92d.js b/compiler/tests-js-parser/pass/ce3d1f8d346bb92d.js new file mode 100644 index 000000000..2e0279b94 --- /dev/null +++ b/compiler/tests-js-parser/pass/ce3d1f8d346bb92d.js @@ -0,0 +1 @@ +class a {;;} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ce52f1c3d90b194a.js b/compiler/tests-js-parser/pass/ce52f1c3d90b194a.js new file mode 100644 index 000000000..90fe59f7e --- /dev/null +++ b/compiler/tests-js-parser/pass/ce52f1c3d90b194a.js @@ -0,0 +1,2 @@ +// ContinueStatement should not be removed. +a: for(;;) for (;;) continue a; diff --git a/compiler/tests-js-parser/pass/ce569e89a005c02a.js b/compiler/tests-js-parser/pass/ce569e89a005c02a.js new file mode 100644 index 000000000..6a17ff81a --- /dev/null +++ b/compiler/tests-js-parser/pass/ce569e89a005c02a.js @@ -0,0 +1 @@ +'use strict'; arguments[1] = 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ce5f3bc27d5ccaac.js b/compiler/tests-js-parser/pass/ce5f3bc27d5ccaac.js new file mode 100644 index 000000000..5ff8ef0ff --- /dev/null +++ b/compiler/tests-js-parser/pass/ce5f3bc27d5ccaac.js @@ -0,0 +1 @@ +function *a() { (b) => b * yield; } diff --git a/compiler/tests-js-parser/pass/ce6a4854c1f79924.js b/compiler/tests-js-parser/pass/ce6a4854c1f79924.js new file mode 100644 index 000000000..0941e562f --- /dev/null +++ b/compiler/tests-js-parser/pass/ce6a4854c1f79924.js @@ -0,0 +1,10 @@ +// Surpress reducing because of alternate +for (;;) { + if (a) { + if (b) { + continue; + } else { + ; + } + } +} diff --git a/compiler/tests-js-parser/pass/ce8c443eb361e1a2.js b/compiler/tests-js-parser/pass/ce8c443eb361e1a2.js new file mode 100644 index 000000000..16b5ef4d4 --- /dev/null +++ b/compiler/tests-js-parser/pass/ce8c443eb361e1a2.js @@ -0,0 +1 @@ +(function([]){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ce968fcdf3a1987c.js b/compiler/tests-js-parser/pass/ce968fcdf3a1987c.js new file mode 100644 index 000000000..02adfb5f5 --- /dev/null +++ b/compiler/tests-js-parser/pass/ce968fcdf3a1987c.js @@ -0,0 +1 @@ +function *a(){yield typeof 1} diff --git a/compiler/tests-js-parser/pass/cea8816bffe4238c.js b/compiler/tests-js-parser/pass/cea8816bffe4238c.js new file mode 100644 index 000000000..a28dea98d --- /dev/null +++ b/compiler/tests-js-parser/pass/cea8816bffe4238c.js @@ -0,0 +1,5 @@ +function a() { + if (void b()) { + c(); + } +} diff --git a/compiler/tests-js-parser/pass/cec2d94dc09a6a71.js b/compiler/tests-js-parser/pass/cec2d94dc09a6a71.js new file mode 100644 index 000000000..e941883a5 --- /dev/null +++ b/compiler/tests-js-parser/pass/cec2d94dc09a6a71.js @@ -0,0 +1,4 @@ +a = { + catch() {}, + throw() {} +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cefd0dd07bfa670f.js b/compiler/tests-js-parser/pass/cefd0dd07bfa670f.js new file mode 100644 index 000000000..6d3cec7ee --- /dev/null +++ b/compiler/tests-js-parser/pass/cefd0dd07bfa670f.js @@ -0,0 +1 @@ +const a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cf0eb6e6c4317c33.js b/compiler/tests-js-parser/pass/cf0eb6e6c4317c33.js new file mode 100644 index 000000000..63b947d74 --- /dev/null +++ b/compiler/tests-js-parser/pass/cf0eb6e6c4317c33.js @@ -0,0 +1 @@ +('\u{00F8}') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cf0fb26afd0eaaf1.js b/compiler/tests-js-parser/pass/cf0fb26afd0eaaf1.js new file mode 100644 index 000000000..5c9c8dd71 --- /dev/null +++ b/compiler/tests-js-parser/pass/cf0fb26afd0eaaf1.js @@ -0,0 +1 @@ +new a(...b = c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cf939dae739eacf6.js b/compiler/tests-js-parser/pass/cf939dae739eacf6.js new file mode 100644 index 000000000..506acc506 --- /dev/null +++ b/compiler/tests-js-parser/pass/cf939dae739eacf6.js @@ -0,0 +1 @@ +with (a) { b = c } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cfca620b63dd98b8.js b/compiler/tests-js-parser/pass/cfca620b63dd98b8.js new file mode 100644 index 000000000..8b72b5783 --- /dev/null +++ b/compiler/tests-js-parser/pass/cfca620b63dd98b8.js @@ -0,0 +1,2 @@ +a.b`foo`; +c `bar`; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/cfebdd6b58e65e90.js b/compiler/tests-js-parser/pass/cfebdd6b58e65e90.js new file mode 100644 index 000000000..bbfccaf01 --- /dev/null +++ b/compiler/tests-js-parser/pass/cfebdd6b58e65e90.js @@ -0,0 +1,2 @@ +function*a(){yield +a} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d010d377bcfd5565.js b/compiler/tests-js-parser/pass/d010d377bcfd5565.js new file mode 100644 index 000000000..5b84305f4 --- /dev/null +++ b/compiler/tests-js-parser/pass/d010d377bcfd5565.js @@ -0,0 +1 @@ +({ __proto__: null, get __proto__(){}, set __proto__(a){} }) diff --git a/compiler/tests-js-parser/pass/d038789ad15922ff.js b/compiler/tests-js-parser/pass/d038789ad15922ff.js new file mode 100644 index 000000000..d20f2ffae --- /dev/null +++ b/compiler/tests-js-parser/pass/d038789ad15922ff.js @@ -0,0 +1,5 @@ +(function () { + var a = { + 'Infinity': 1 + }; +}()); diff --git a/compiler/tests-js-parser/pass/d043d114b966415b.js b/compiler/tests-js-parser/pass/d043d114b966415b.js new file mode 100644 index 000000000..39a6cb54a --- /dev/null +++ b/compiler/tests-js-parser/pass/d043d114b966415b.js @@ -0,0 +1 @@ +function *a(){yield --a;} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d0724a029fb7e4b1.js b/compiler/tests-js-parser/pass/d0724a029fb7e4b1.js new file mode 100644 index 000000000..a505e949b --- /dev/null +++ b/compiler/tests-js-parser/pass/d0724a029fb7e4b1.js @@ -0,0 +1 @@ +var a;/* block comment 1 */ /* block comment 2 */ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d082f8d1c2eec454.js b/compiler/tests-js-parser/pass/d082f8d1c2eec454.js new file mode 100644 index 000000000..3684627c1 --- /dev/null +++ b/compiler/tests-js-parser/pass/d082f8d1c2eec454.js @@ -0,0 +1 @@ +[a,] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d09117cbf60bd18f.js b/compiler/tests-js-parser/pass/d09117cbf60bd18f.js new file mode 100644 index 000000000..1b57bf68d --- /dev/null +++ b/compiler/tests-js-parser/pass/d09117cbf60bd18f.js @@ -0,0 +1 @@ +\u0061a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d09dbe1357abd967.js b/compiler/tests-js-parser/pass/d09dbe1357abd967.js new file mode 100644 index 000000000..2d5710020 --- /dev/null +++ b/compiler/tests-js-parser/pass/d09dbe1357abd967.js @@ -0,0 +1,5 @@ +(function () { + (function () { + a("b"); + }()); +}()); diff --git a/compiler/tests-js-parser/pass/d0dba4e03608ad64.js b/compiler/tests-js-parser/pass/d0dba4e03608ad64.js new file mode 100644 index 000000000..44295bc5c --- /dev/null +++ b/compiler/tests-js-parser/pass/d0dba4e03608ad64.js @@ -0,0 +1 @@ +`${a}` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d126aa10835287e6.js b/compiler/tests-js-parser/pass/d126aa10835287e6.js new file mode 100644 index 000000000..82fd8aff3 --- /dev/null +++ b/compiler/tests-js-parser/pass/d126aa10835287e6.js @@ -0,0 +1 @@ +class a {;} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d198e0d3a33b7b61.js b/compiler/tests-js-parser/pass/d198e0d3a33b7b61.js new file mode 100644 index 000000000..76bd19a57 --- /dev/null +++ b/compiler/tests-js-parser/pass/d198e0d3a33b7b61.js @@ -0,0 +1 @@ +var a = {*[b]() { yield *c; }} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d1eafbc6bda219a7.js b/compiler/tests-js-parser/pass/d1eafbc6bda219a7.js new file mode 100644 index 000000000..852f54f57 --- /dev/null +++ b/compiler/tests-js-parser/pass/d1eafbc6bda219a7.js @@ -0,0 +1 @@ +class a{} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d1fea0e461717b09.js b/compiler/tests-js-parser/pass/d1fea0e461717b09.js new file mode 100644 index 000000000..44d5b0404 --- /dev/null +++ b/compiler/tests-js-parser/pass/d1fea0e461717b09.js @@ -0,0 +1 @@ +`\`` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d22f8660531e1c1a.js b/compiler/tests-js-parser/pass/d22f8660531e1c1a.js new file mode 100644 index 000000000..bee87b471 --- /dev/null +++ b/compiler/tests-js-parser/pass/d22f8660531e1c1a.js @@ -0,0 +1 @@ +var static; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d2332f9187c6a20a.module.js b/compiler/tests-js-parser/pass/d2332f9187c6a20a.module.js new file mode 100644 index 000000000..458d1222a --- /dev/null +++ b/compiler/tests-js-parser/pass/d2332f9187c6a20a.module.js @@ -0,0 +1 @@ +export default class {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d24d5f53dc15bcc7.module.js b/compiler/tests-js-parser/pass/d24d5f53dc15bcc7.module.js new file mode 100644 index 000000000..47bd46aaa --- /dev/null +++ b/compiler/tests-js-parser/pass/d24d5f53dc15bcc7.module.js @@ -0,0 +1,2 @@ +export var a +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d2ae1c7b6e55143f.js b/compiler/tests-js-parser/pass/d2ae1c7b6e55143f.js new file mode 100644 index 000000000..dc20f86bb --- /dev/null +++ b/compiler/tests-js-parser/pass/d2ae1c7b6e55143f.js @@ -0,0 +1 @@ +({ set a(b) { b } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d2af344779cc1f26.js b/compiler/tests-js-parser/pass/d2af344779cc1f26.js new file mode 100644 index 000000000..4c35828b1 --- /dev/null +++ b/compiler/tests-js-parser/pass/d2af344779cc1f26.js @@ -0,0 +1 @@ +(a) => 00 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d2c9ab6dc14dc774.js b/compiler/tests-js-parser/pass/d2c9ab6dc14dc774.js new file mode 100644 index 000000000..8e1733f03 --- /dev/null +++ b/compiler/tests-js-parser/pass/d2c9ab6dc14dc774.js @@ -0,0 +1 @@ +for({a=1} of b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d2d8885e0c00ad51.js b/compiler/tests-js-parser/pass/d2d8885e0c00ad51.js new file mode 100644 index 000000000..4c350b5a5 --- /dev/null +++ b/compiler/tests-js-parser/pass/d2d8885e0c00ad51.js @@ -0,0 +1 @@ +("\\\"") \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d2fe67b1990df65c.js b/compiler/tests-js-parser/pass/d2fe67b1990df65c.js new file mode 100644 index 000000000..41379ffe0 --- /dev/null +++ b/compiler/tests-js-parser/pass/d2fe67b1990df65c.js @@ -0,0 +1,3 @@ +(function () { + a ? !b : !c; +}()); diff --git a/compiler/tests-js-parser/pass/d33efc20e46c3961.js b/compiler/tests-js-parser/pass/d33efc20e46c3961.js new file mode 100644 index 000000000..ffa2b9557 --- /dev/null +++ b/compiler/tests-js-parser/pass/d33efc20e46c3961.js @@ -0,0 +1 @@ +(...a) => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d368a7bc70ca3120.js b/compiler/tests-js-parser/pass/d368a7bc70ca3120.js new file mode 100644 index 000000000..435cab794 --- /dev/null +++ b/compiler/tests-js-parser/pass/d368a7bc70ca3120.js @@ -0,0 +1 @@ +({a(b,c){let d;}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d3762fcf2ad7d285.js b/compiler/tests-js-parser/pass/d3762fcf2ad7d285.js new file mode 100644 index 000000000..b2dc41eff --- /dev/null +++ b/compiler/tests-js-parser/pass/d3762fcf2ad7d285.js @@ -0,0 +1 @@ +(class extends 1{}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d37653c5aedf3d46.js b/compiler/tests-js-parser/pass/d37653c5aedf3d46.js new file mode 100644 index 000000000..37ea40b50 --- /dev/null +++ b/compiler/tests-js-parser/pass/d37653c5aedf3d46.js @@ -0,0 +1 @@ +({"a"(b, c, d) {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d38771967621cb8e.js b/compiler/tests-js-parser/pass/d38771967621cb8e.js new file mode 100644 index 000000000..0d7c4a497 --- /dev/null +++ b/compiler/tests-js-parser/pass/d38771967621cb8e.js @@ -0,0 +1 @@ +('\5111') \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/d3ac25ddc7ba9779.js b/compiler/tests-js-parser/pass/d3ac25ddc7ba9779.js new file mode 100644 index 000000000..3e4e3d6ed --- /dev/null +++ b/compiler/tests-js-parser/pass/d3ac25ddc7ba9779.js @@ -0,0 +1 @@ + comment \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e05209211a87a606.js b/compiler/tests-js-parser/pass/e05209211a87a606.js new file mode 100644 index 000000000..8b314339c --- /dev/null +++ b/compiler/tests-js-parser/pass/e05209211a87a606.js @@ -0,0 +1,2 @@ +debugger +; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e08112a34cfea369.js b/compiler/tests-js-parser/pass/e08112a34cfea369.js new file mode 100644 index 000000000..9f465f349 --- /dev/null +++ b/compiler/tests-js-parser/pass/e08112a34cfea369.js @@ -0,0 +1,3 @@ +for (var [a,b] in c); +for (var [d] = 1;;); +for (var {e} of f); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e08e181172bad2b1.js b/compiler/tests-js-parser/pass/e08e181172bad2b1.js new file mode 100644 index 000000000..7b8ef552f --- /dev/null +++ b/compiler/tests-js-parser/pass/e08e181172bad2b1.js @@ -0,0 +1 @@ +({get [1+2]() {}, set [3/4](a) {}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e0b98eaceaaeaf9b.js b/compiler/tests-js-parser/pass/e0b98eaceaaeaf9b.js new file mode 100644 index 000000000..ca014e81c --- /dev/null +++ b/compiler/tests-js-parser/pass/e0b98eaceaaeaf9b.js @@ -0,0 +1 @@ +--a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e0c3f07a142a589d.js b/compiler/tests-js-parser/pass/e0c3f07a142a589d.js new file mode 100644 index 000000000..bd9b163d6 --- /dev/null +++ b/compiler/tests-js-parser/pass/e0c3f07a142a589d.js @@ -0,0 +1,6 @@ +function a() { + if (b) { + } else { + c(); + } +} diff --git a/compiler/tests-js-parser/pass/e0f831f2b08fd35c.js b/compiler/tests-js-parser/pass/e0f831f2b08fd35c.js new file mode 100644 index 000000000..b414e2164 --- /dev/null +++ b/compiler/tests-js-parser/pass/e0f831f2b08fd35c.js @@ -0,0 +1,4 @@ +0b1001; +0B1001; +0o11; +0O11; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e0fc2148b455a6be.js b/compiler/tests-js-parser/pass/e0fc2148b455a6be.js new file mode 100644 index 000000000..30fb86c8e --- /dev/null +++ b/compiler/tests-js-parser/pass/e0fc2148b455a6be.js @@ -0,0 +1 @@ +(function({a: b, a: c}){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e1237566c1f89d8e.js b/compiler/tests-js-parser/pass/e1237566c1f89d8e.js new file mode 100644 index 000000000..2be0e92c1 --- /dev/null +++ b/compiler/tests-js-parser/pass/e1237566c1f89d8e.js @@ -0,0 +1 @@ +if (a) b() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e12aa6994333466f.js b/compiler/tests-js-parser/pass/e12aa6994333466f.js new file mode 100644 index 000000000..afa77d01e --- /dev/null +++ b/compiler/tests-js-parser/pass/e12aa6994333466f.js @@ -0,0 +1,6 @@ +var a; // if undeclared it's assumed to have side-effects +if (b()) { + a(c); +} else { + a(d); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e1387fe892984e2b.js b/compiler/tests-js-parser/pass/e1387fe892984e2b.js new file mode 100644 index 000000000..d33fc336a --- /dev/null +++ b/compiler/tests-js-parser/pass/e1387fe892984e2b.js @@ -0,0 +1 @@ +function a({ b: { c, a }, d: [e, f] }, ...[b, d, g]){} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e1820bdb79ebe44b.js b/compiler/tests-js-parser/pass/e1820bdb79ebe44b.js new file mode 100644 index 000000000..25c9496c3 --- /dev/null +++ b/compiler/tests-js-parser/pass/e1820bdb79ebe44b.js @@ -0,0 +1 @@ +[...[a]] = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e18c297bf29c4b6b.js b/compiler/tests-js-parser/pass/e18c297bf29c4b6b.js new file mode 100644 index 000000000..1abced98f --- /dev/null +++ b/compiler/tests-js-parser/pass/e18c297bf29c4b6b.js @@ -0,0 +1 @@ +var a, {b: {c: a}} = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e18f80fa1699a0fd.js b/compiler/tests-js-parser/pass/e18f80fa1699a0fd.js new file mode 100644 index 000000000..9bdcb7bb6 --- /dev/null +++ b/compiler/tests-js-parser/pass/e18f80fa1699a0fd.js @@ -0,0 +1 @@ +\u0061a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e1939e7cb50f65b4.js b/compiler/tests-js-parser/pass/e1939e7cb50f65b4.js new file mode 100644 index 000000000..4a5333f56 --- /dev/null +++ b/compiler/tests-js-parser/pass/e1939e7cb50f65b4.js @@ -0,0 +1 @@ +(function*() { [...{ a = yield }] = 1; }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e1d373aa5d926fde.module.js b/compiler/tests-js-parser/pass/e1d373aa5d926fde.module.js new file mode 100644 index 000000000..6fc837cf1 --- /dev/null +++ b/compiler/tests-js-parser/pass/e1d373aa5d926fde.module.js @@ -0,0 +1 @@ +export var a = { } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e1dd1979a86a5f1d.js b/compiler/tests-js-parser/pass/e1dd1979a86a5f1d.js new file mode 100644 index 000000000..776885860 --- /dev/null +++ b/compiler/tests-js-parser/pass/e1dd1979a86a5f1d.js @@ -0,0 +1 @@ +try {} catch ([a,b, {c, d:e=1, [f]:g=2, h=i}]) {} diff --git a/compiler/tests-js-parser/pass/e23748bdbb0713dc.js b/compiler/tests-js-parser/pass/e23748bdbb0713dc.js new file mode 100644 index 000000000..cd49c921f --- /dev/null +++ b/compiler/tests-js-parser/pass/e23748bdbb0713dc.js @@ -0,0 +1,10 @@ +(function () { + function a() { + b.c('d'); + } + { + function a() { + b.c('e'); + } + } +}()); diff --git a/compiler/tests-js-parser/pass/e23f481ffc072aee.js b/compiler/tests-js-parser/pass/e23f481ffc072aee.js new file mode 100644 index 000000000..366b20673 --- /dev/null +++ b/compiler/tests-js-parser/pass/e23f481ffc072aee.js @@ -0,0 +1,4 @@ +if (a) b(); +if (!a); else b(); +if (a); else b(); +if (a); else; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e2470430b235b9bb.module.js b/compiler/tests-js-parser/pass/e2470430b235b9bb.module.js new file mode 100644 index 000000000..2c03c0ffa --- /dev/null +++ b/compiler/tests-js-parser/pass/e2470430b235b9bb.module.js @@ -0,0 +1 @@ +export default function a(){} let b; export {b as a}; diff --git a/compiler/tests-js-parser/pass/e290a32637ffdcb7.js b/compiler/tests-js-parser/pass/e290a32637ffdcb7.js new file mode 100644 index 000000000..09b9872dc --- /dev/null +++ b/compiler/tests-js-parser/pass/e290a32637ffdcb7.js @@ -0,0 +1,3 @@ +(function () { + a['Infinity'] = 1; +}()); diff --git a/compiler/tests-js-parser/pass/e2ac0bea41202dc9.js b/compiler/tests-js-parser/pass/e2ac0bea41202dc9.js new file mode 100644 index 000000000..7666d664f --- /dev/null +++ b/compiler/tests-js-parser/pass/e2ac0bea41202dc9.js @@ -0,0 +1 @@ +({ get __proto__() { return 1 }, __proto__: 2 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e2c7f7c0da23bc45.js b/compiler/tests-js-parser/pass/e2c7f7c0da23bc45.js new file mode 100644 index 000000000..28dc42f94 --- /dev/null +++ b/compiler/tests-js-parser/pass/e2c7f7c0da23bc45.js @@ -0,0 +1,7 @@ +(function () { + switch (a) { + default: + case 1: + b("c"); + } +}()); diff --git a/compiler/tests-js-parser/pass/e2c80df1960433a3.js b/compiler/tests-js-parser/pass/e2c80df1960433a3.js new file mode 100644 index 000000000..a48871d4a --- /dev/null +++ b/compiler/tests-js-parser/pass/e2c80df1960433a3.js @@ -0,0 +1 @@ +var yield = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e349023df8e12f2d.js b/compiler/tests-js-parser/pass/e349023df8e12f2d.js new file mode 100644 index 000000000..75cda9a55 --- /dev/null +++ b/compiler/tests-js-parser/pass/e349023df8e12f2d.js @@ -0,0 +1 @@ +1 in 2 diff --git a/compiler/tests-js-parser/pass/e374d329af31c20a.js b/compiler/tests-js-parser/pass/e374d329af31c20a.js new file mode 100644 index 000000000..f75f3a86f --- /dev/null +++ b/compiler/tests-js-parser/pass/e374d329af31c20a.js @@ -0,0 +1 @@ +'\'' diff --git a/compiler/tests-js-parser/pass/e3b0c44298fc1c14.js b/compiler/tests-js-parser/pass/e3b0c44298fc1c14.js new file mode 100644 index 000000000..e69de29bb diff --git a/compiler/tests-js-parser/pass/e42f306327c0f578.js b/compiler/tests-js-parser/pass/e42f306327c0f578.js new file mode 100644 index 000000000..fba07e330 --- /dev/null +++ b/compiler/tests-js-parser/pass/e42f306327c0f578.js @@ -0,0 +1 @@ +"use strict"; var a = { set b(a) {}, b: 1 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e463265266cee73e.js b/compiler/tests-js-parser/pass/e463265266cee73e.js new file mode 100644 index 000000000..91ac4ec1a --- /dev/null +++ b/compiler/tests-js-parser/pass/e463265266cee73e.js @@ -0,0 +1 @@ +function* a () { yield *b } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e46381af137ed2e2.js b/compiler/tests-js-parser/pass/e46381af137ed2e2.js new file mode 100644 index 000000000..26ce5407f --- /dev/null +++ b/compiler/tests-js-parser/pass/e46381af137ed2e2.js @@ -0,0 +1 @@ +a(1).b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e46f7944dd0d4eb4.js b/compiler/tests-js-parser/pass/e46f7944dd0d4eb4.js new file mode 100644 index 000000000..ef949a1f3 --- /dev/null +++ b/compiler/tests-js-parser/pass/e46f7944dd0d4eb4.js @@ -0,0 +1 @@ +1 /* block comment 1 */ /* block comment 2 */ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e4bd395227b4ee8e.js b/compiler/tests-js-parser/pass/e4bd395227b4ee8e.js new file mode 100644 index 000000000..1faad7dc3 --- /dev/null +++ b/compiler/tests-js-parser/pass/e4bd395227b4ee8e.js @@ -0,0 +1 @@ +([a]) => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e4c6c19e4b214180.js b/compiler/tests-js-parser/pass/e4c6c19e4b214180.js new file mode 100644 index 000000000..8c3fa856f --- /dev/null +++ b/compiler/tests-js-parser/pass/e4c6c19e4b214180.js @@ -0,0 +1 @@ +function *a(){yield+1} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e4cef19dab44335a.js b/compiler/tests-js-parser/pass/e4cef19dab44335a.js new file mode 100644 index 000000000..723bfc3d2 --- /dev/null +++ b/compiler/tests-js-parser/pass/e4cef19dab44335a.js @@ -0,0 +1 @@ +[1,,2] diff --git a/compiler/tests-js-parser/pass/e512276dcfe241c1.js b/compiler/tests-js-parser/pass/e512276dcfe241c1.js new file mode 100644 index 000000000..66ff1e34c --- /dev/null +++ b/compiler/tests-js-parser/pass/e512276dcfe241c1.js @@ -0,0 +1,2 @@ +{ a +++b } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e5204d6e30f296a8.js b/compiler/tests-js-parser/pass/e5204d6e30f296a8.js new file mode 100644 index 000000000..5161e52f2 --- /dev/null +++ b/compiler/tests-js-parser/pass/e5204d6e30f296a8.js @@ -0,0 +1 @@ +switch(a){default:case 1:} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e5393f15b0e8585d.js b/compiler/tests-js-parser/pass/e5393f15b0e8585d.js new file mode 100644 index 000000000..9b0308e9a --- /dev/null +++ b/compiler/tests-js-parser/pass/e5393f15b0e8585d.js @@ -0,0 +1 @@ +({let} = 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e54c1a2fc15cd4b8.js b/compiler/tests-js-parser/pass/e54c1a2fc15cd4b8.js new file mode 100644 index 000000000..0894bbc0a --- /dev/null +++ b/compiler/tests-js-parser/pass/e54c1a2fc15cd4b8.js @@ -0,0 +1 @@ +class a {static b(){} static get b(){} static set b(c){} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e5570b178254bfb9.js b/compiler/tests-js-parser/pass/e5570b178254bfb9.js new file mode 100644 index 000000000..9b8629aca --- /dev/null +++ b/compiler/tests-js-parser/pass/e5570b178254bfb9.js @@ -0,0 +1,3 @@ +// ContinueStatement should be removed. +// And label is not used, then label also should be removed. +a: do continue a; while (true); diff --git a/compiler/tests-js-parser/pass/e577d5b725159d71.js b/compiler/tests-js-parser/pass/e577d5b725159d71.js new file mode 100644 index 000000000..a2ad2f4f5 --- /dev/null +++ b/compiler/tests-js-parser/pass/e577d5b725159d71.js @@ -0,0 +1 @@ +0..a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e5951efaf0b0c5b3.js b/compiler/tests-js-parser/pass/e5951efaf0b0c5b3.js new file mode 100644 index 000000000..3af1a916f --- /dev/null +++ b/compiler/tests-js-parser/pass/e5951efaf0b0c5b3.js @@ -0,0 +1 @@ +function *a(){yield(1)} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e5a7d56b798ec7e6.js b/compiler/tests-js-parser/pass/e5a7d56b798ec7e6.js new file mode 100644 index 000000000..aef268dab --- /dev/null +++ b/compiler/tests-js-parser/pass/e5a7d56b798ec7e6.js @@ -0,0 +1 @@ +a("\v"); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e5fbf9e911ec36cd.js b/compiler/tests-js-parser/pass/e5fbf9e911ec36cd.js new file mode 100644 index 000000000..6f67679d6 --- /dev/null +++ b/compiler/tests-js-parser/pass/e5fbf9e911ec36cd.js @@ -0,0 +1 @@ +a => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e65f3cca9a4637c3.js b/compiler/tests-js-parser/pass/e65f3cca9a4637c3.js new file mode 100644 index 000000000..ad9a93a7c --- /dev/null +++ b/compiler/tests-js-parser/pass/e65f3cca9a4637c3.js @@ -0,0 +1 @@ +'use strict'; diff --git a/compiler/tests-js-parser/pass/e6643a557fe93de0.js b/compiler/tests-js-parser/pass/e6643a557fe93de0.js new file mode 100644 index 000000000..7d99a0a00 --- /dev/null +++ b/compiler/tests-js-parser/pass/e6643a557fe93de0.js @@ -0,0 +1 @@ +({yield} = 1); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e6714aac10964792.js b/compiler/tests-js-parser/pass/e6714aac10964792.js new file mode 100644 index 000000000..c955ab715 --- /dev/null +++ b/compiler/tests-js-parser/pass/e6714aac10964792.js @@ -0,0 +1 @@ +ⅣⅡ = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e686d016100a7a08.js b/compiler/tests-js-parser/pass/e686d016100a7a08.js new file mode 100644 index 000000000..74a838550 --- /dev/null +++ b/compiler/tests-js-parser/pass/e686d016100a7a08.js @@ -0,0 +1,5 @@ +class a extends b { + c() { + new super.d() + } +} diff --git a/compiler/tests-js-parser/pass/e6ac25f6aa73a2be.js b/compiler/tests-js-parser/pass/e6ac25f6aa73a2be.js new file mode 100644 index 000000000..780f5f6e3 --- /dev/null +++ b/compiler/tests-js-parser/pass/e6ac25f6aa73a2be.js @@ -0,0 +1 @@ +/test/||1 diff --git a/compiler/tests-js-parser/pass/e6b424d430520bf2.js b/compiler/tests-js-parser/pass/e6b424d430520bf2.js new file mode 100644 index 000000000..d3c3ce89a --- /dev/null +++ b/compiler/tests-js-parser/pass/e6b424d430520bf2.js @@ -0,0 +1,3 @@ +function a(b) { + if (c) for (var d = 1, e = b.f(); ; d++) {} +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e6e24cfdc6d308a2.js b/compiler/tests-js-parser/pass/e6e24cfdc6d308a2.js new file mode 100644 index 000000000..751f80736 --- /dev/null +++ b/compiler/tests-js-parser/pass/e6e24cfdc6d308a2.js @@ -0,0 +1 @@ +{ const a = 1, b = 2, c = 3 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e71a91c61343cdb1.js b/compiler/tests-js-parser/pass/e71a91c61343cdb1.js new file mode 100644 index 000000000..02d91b8fe --- /dev/null +++ b/compiler/tests-js-parser/pass/e71a91c61343cdb1.js @@ -0,0 +1 @@ +a = { get 10() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e71c1d5f0b6b833c.js b/compiler/tests-js-parser/pass/e71c1d5f0b6b833c.js new file mode 100644 index 000000000..8bdaeddb6 --- /dev/null +++ b/compiler/tests-js-parser/pass/e71c1d5f0b6b833c.js @@ -0,0 +1 @@ +[(a)] = 1 diff --git a/compiler/tests-js-parser/pass/e720d4faf2b41f42.js b/compiler/tests-js-parser/pass/e720d4faf2b41f42.js new file mode 100644 index 000000000..c85963e5a --- /dev/null +++ b/compiler/tests-js-parser/pass/e720d4faf2b41f42.js @@ -0,0 +1 @@ +function a(){ /*Jupiter*/ return; /*Saturn*/} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e748a1e428ccdf69.js b/compiler/tests-js-parser/pass/e748a1e428ccdf69.js new file mode 100644 index 000000000..53a91b0fe --- /dev/null +++ b/compiler/tests-js-parser/pass/e748a1e428ccdf69.js @@ -0,0 +1 @@ +new a(b,c) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e74a8d269a6abdb7.js b/compiler/tests-js-parser/pass/e74a8d269a6abdb7.js new file mode 100644 index 000000000..1ed2bb6bd --- /dev/null +++ b/compiler/tests-js-parser/pass/e74a8d269a6abdb7.js @@ -0,0 +1 @@ +var private, protected, public \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e75df8aea1749780.js b/compiler/tests-js-parser/pass/e75df8aea1749780.js new file mode 100644 index 000000000..bc964dfd7 --- /dev/null +++ b/compiler/tests-js-parser/pass/e75df8aea1749780.js @@ -0,0 +1 @@ +a *= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e78c7b54fc87d08c.js b/compiler/tests-js-parser/pass/e78c7b54fc87d08c.js new file mode 100644 index 000000000..d2e9fb632 --- /dev/null +++ b/compiler/tests-js-parser/pass/e78c7b54fc87d08c.js @@ -0,0 +1 @@ +function *a(b, c, d) {} diff --git a/compiler/tests-js-parser/pass/e7c1f6f0913c4a95.js b/compiler/tests-js-parser/pass/e7c1f6f0913c4a95.js new file mode 100644 index 000000000..4bfe40cfc --- /dev/null +++ b/compiler/tests-js-parser/pass/e7c1f6f0913c4a95.js @@ -0,0 +1 @@ +function a(){yield*a} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e7c444fc9aed1257.js b/compiler/tests-js-parser/pass/e7c444fc9aed1257.js new file mode 100644 index 000000000..761553353 --- /dev/null +++ b/compiler/tests-js-parser/pass/e7c444fc9aed1257.js @@ -0,0 +1 @@ +for(const a in b); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e7fa87b10d5136a0.js b/compiler/tests-js-parser/pass/e7fa87b10d5136a0.js new file mode 100644 index 000000000..9ef7d6fda --- /dev/null +++ b/compiler/tests-js-parser/pass/e7fa87b10d5136a0.js @@ -0,0 +1 @@ +class a {get b(){} set c(d){};} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e815494eb50fa42f.js b/compiler/tests-js-parser/pass/e815494eb50fa42f.js new file mode 100644 index 000000000..51a133b12 --- /dev/null +++ b/compiler/tests-js-parser/pass/e815494eb50fa42f.js @@ -0,0 +1,3 @@ +function a() { + var b; +} diff --git a/compiler/tests-js-parser/pass/e84ef669246313d2.js b/compiler/tests-js-parser/pass/e84ef669246313d2.js new file mode 100644 index 000000000..9d2f90b99 --- /dev/null +++ b/compiler/tests-js-parser/pass/e84ef669246313d2.js @@ -0,0 +1,2 @@ +('('); +a(')'); diff --git a/compiler/tests-js-parser/pass/e877f5e6753dc7e4.js b/compiler/tests-js-parser/pass/e877f5e6753dc7e4.js new file mode 100644 index 000000000..2be01f380 --- /dev/null +++ b/compiler/tests-js-parser/pass/e877f5e6753dc7e4.js @@ -0,0 +1 @@ +(a,b,c,d) ? e : f diff --git a/compiler/tests-js-parser/pass/e899a2594bd5311c.js b/compiler/tests-js-parser/pass/e899a2594bd5311c.js new file mode 100644 index 000000000..f1c340077 --- /dev/null +++ b/compiler/tests-js-parser/pass/e899a2594bd5311c.js @@ -0,0 +1 @@ +() => 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e8de5af87dc0004c.js b/compiler/tests-js-parser/pass/e8de5af87dc0004c.js new file mode 100644 index 000000000..b14bf5d35 --- /dev/null +++ b/compiler/tests-js-parser/pass/e8de5af87dc0004c.js @@ -0,0 +1 @@ +a /= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e8ea384458526db0.js b/compiler/tests-js-parser/pass/e8ea384458526db0.js new file mode 100644 index 000000000..ffc1f686d --- /dev/null +++ b/compiler/tests-js-parser/pass/e8ea384458526db0.js @@ -0,0 +1 @@ +var {[a]: b} = {c} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e8ef6188865f9def.js b/compiler/tests-js-parser/pass/e8ef6188865f9def.js new file mode 100644 index 000000000..bda9c94a7 --- /dev/null +++ b/compiler/tests-js-parser/pass/e8ef6188865f9def.js @@ -0,0 +1,5 @@ +d: { + if (a) b("c"); + else break d; + e.f("g"); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e8ef944fd2c2e7fa.js b/compiler/tests-js-parser/pass/e8ef944fd2c2e7fa.js new file mode 100644 index 000000000..d7c3c914a --- /dev/null +++ b/compiler/tests-js-parser/pass/e8ef944fd2c2e7fa.js @@ -0,0 +1 @@ +a`42` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e95b9364e90a4b5c.js b/compiler/tests-js-parser/pass/e95b9364e90a4b5c.js new file mode 100644 index 000000000..dff5f0ce7 --- /dev/null +++ b/compiler/tests-js-parser/pass/e95b9364e90a4b5c.js @@ -0,0 +1 @@ +`$$$${a}` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e9682c37a1a959e1.js b/compiler/tests-js-parser/pass/e9682c37a1a959e1.js new file mode 100644 index 000000000..883aad2d5 --- /dev/null +++ b/compiler/tests-js-parser/pass/e9682c37a1a959e1.js @@ -0,0 +1 @@ +"\u{20BB7}\u{91CE}\u{5BB6}" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e99d260ec2ea47be.js b/compiler/tests-js-parser/pass/e99d260ec2ea47be.js new file mode 100644 index 000000000..850d0e243 --- /dev/null +++ b/compiler/tests-js-parser/pass/e99d260ec2ea47be.js @@ -0,0 +1 @@ +let a = 1, b = 2, c = 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e9a24a964ace5330.js b/compiler/tests-js-parser/pass/e9a24a964ace5330.js new file mode 100644 index 000000000..957042523 --- /dev/null +++ b/compiler/tests-js-parser/pass/e9a24a964ace5330.js @@ -0,0 +1,5 @@ +if (a) { + b; +} else { + b; +} diff --git a/compiler/tests-js-parser/pass/e9a74729daea9b84.js b/compiler/tests-js-parser/pass/e9a74729daea9b84.js new file mode 100644 index 000000000..0afff6a1d --- /dev/null +++ b/compiler/tests-js-parser/pass/e9a74729daea9b84.js @@ -0,0 +1 @@ +a + b * c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/e9d44e4cbaf92011.js b/compiler/tests-js-parser/pass/e9d44e4cbaf92011.js new file mode 100644 index 000000000..dc29fd9df --- /dev/null +++ b/compiler/tests-js-parser/pass/e9d44e4cbaf92011.js @@ -0,0 +1 @@ +({[a](){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ea2e883b50b24651.js b/compiler/tests-js-parser/pass/ea2e883b50b24651.js new file mode 100644 index 000000000..f91352f3c --- /dev/null +++ b/compiler/tests-js-parser/pass/ea2e883b50b24651.js @@ -0,0 +1,11 @@ +b: switch (1) { + case 2: + a(); + for (;;) break b; + c(); + break; + case 3+4: + d(); + default: + e(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ea3fcad439ac905f.js b/compiler/tests-js-parser/pass/ea3fcad439ac905f.js new file mode 100644 index 000000000..4e192facb --- /dev/null +++ b/compiler/tests-js-parser/pass/ea3fcad439ac905f.js @@ -0,0 +1 @@ +({ a: 1, a: 2 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ea54fe11ef8702f7.js b/compiler/tests-js-parser/pass/ea54fe11ef8702f7.js new file mode 100644 index 000000000..5e2fff25d --- /dev/null +++ b/compiler/tests-js-parser/pass/ea54fe11ef8702f7.js @@ -0,0 +1 @@ +function *a() { yield 1; } diff --git a/compiler/tests-js-parser/pass/eabc983d82222f2a.js b/compiler/tests-js-parser/pass/eabc983d82222f2a.js new file mode 100644 index 000000000..f1139ee23 --- /dev/null +++ b/compiler/tests-js-parser/pass/eabc983d82222f2a.js @@ -0,0 +1 @@ +for (let a of b) c(a); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/eaee2c64dfc46b6a.js b/compiler/tests-js-parser/pass/eaee2c64dfc46b6a.js new file mode 100644 index 000000000..feaf4ab4a --- /dev/null +++ b/compiler/tests-js-parser/pass/eaee2c64dfc46b6a.js @@ -0,0 +1 @@ +let xÇ•, x\u{E01D5} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/eb4b9e8905923468.js b/compiler/tests-js-parser/pass/eb4b9e8905923468.js new file mode 100644 index 000000000..2638b7954 --- /dev/null +++ b/compiler/tests-js-parser/pass/eb4b9e8905923468.js @@ -0,0 +1 @@ +0xabc \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/eb7bb0c4a0ced2a8.js b/compiler/tests-js-parser/pass/eb7bb0c4a0ced2a8.js new file mode 100644 index 000000000..1b21730a0 --- /dev/null +++ b/compiler/tests-js-parser/pass/eb7bb0c4a0ced2a8.js @@ -0,0 +1 @@ +a || b || c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ebbc09d90157cb5b.js b/compiler/tests-js-parser/pass/ebbc09d90157cb5b.js new file mode 100644 index 000000000..8f2a1c94b --- /dev/null +++ b/compiler/tests-js-parser/pass/ebbc09d90157cb5b.js @@ -0,0 +1,4 @@ +function a() { + var {b, c} = a; + var d = a; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ebd6534f7bb01a7a.js b/compiler/tests-js-parser/pass/ebd6534f7bb01a7a.js new file mode 100644 index 000000000..c41d8b97d --- /dev/null +++ b/compiler/tests-js-parser/pass/ebd6534f7bb01a7a.js @@ -0,0 +1 @@ +({ true: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ec05d8a5722be86c.js b/compiler/tests-js-parser/pass/ec05d8a5722be86c.js new file mode 100644 index 000000000..6933da5d5 --- /dev/null +++ b/compiler/tests-js-parser/pass/ec05d8a5722be86c.js @@ -0,0 +1,4 @@ +(function () { + var a = 1; + a = a += 2; +}()); diff --git a/compiler/tests-js-parser/pass/ec782937135d4f32.js b/compiler/tests-js-parser/pass/ec782937135d4f32.js new file mode 100644 index 000000000..bfb2e01b8 --- /dev/null +++ b/compiler/tests-js-parser/pass/ec782937135d4f32.js @@ -0,0 +1 @@ +/a/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ec79f9c27c045b00.js b/compiler/tests-js-parser/pass/ec79f9c27c045b00.js new file mode 100644 index 000000000..36712ce8b --- /dev/null +++ b/compiler/tests-js-parser/pass/ec79f9c27c045b00.js @@ -0,0 +1,2 @@ +b: while (1) { continue /* +*/ a; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ec97990c2cc5e0e8.js b/compiler/tests-js-parser/pass/ec97990c2cc5e0e8.js new file mode 100644 index 000000000..732797b00 --- /dev/null +++ b/compiler/tests-js-parser/pass/ec97990c2cc5e0e8.js @@ -0,0 +1 @@ +a || b && c | d ^ e & f == g < h >>> i + j * k \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ec99a663d6f3983d.js b/compiler/tests-js-parser/pass/ec99a663d6f3983d.js new file mode 100644 index 000000000..0b05bfaa1 --- /dev/null +++ b/compiler/tests-js-parser/pass/ec99a663d6f3983d.js @@ -0,0 +1 @@ +function a(){({*[yield](){}})} diff --git a/compiler/tests-js-parser/pass/ecba8fb326c2c985.js b/compiler/tests-js-parser/pass/ecba8fb326c2c985.js new file mode 100644 index 000000000..cf30bdfcd --- /dev/null +++ b/compiler/tests-js-parser/pass/ecba8fb326c2c985.js @@ -0,0 +1,41 @@ +var a, b, c, d, e; +// compress these +if (b) { + a = 1+2; +} else { + a = 3; +} + +if (b) { + a = 4+5; +} else if (c) { + a = 6; +} else { + a = 7-8; +} + +a = b ? 'f' : 'g'+'h'; + +a = b ? 'f' : b ? 'f' : 'g'+'h'; + +// Compress conditions that have side effects +if (i()) { + a = 9+10; +} else { + a = 11; +} + +if (c) { + a = 'j'; +} else if (i()) { + a = 'k'+'l'; +} else { + a = 'j'; +} + +a = i() ? 'm' : 'f'+'n'; + +// don't compress these +a = b ? d : e; + +a = b ? 'f' : 'g'; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ed0783c35e43032b.js b/compiler/tests-js-parser/pass/ed0783c35e43032b.js new file mode 100644 index 000000000..92ba325d6 --- /dev/null +++ b/compiler/tests-js-parser/pass/ed0783c35e43032b.js @@ -0,0 +1,6 @@ +a["b"] = "c"; +a["if"] = "if"; +a["*"] = "d"; +a["\u0EB3"] = "e"; +a[""] = "f"; +a["1_1"] = "b"; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ed085cb2fd0dc355.js b/compiler/tests-js-parser/pass/ed085cb2fd0dc355.js new file mode 100644 index 000000000..d89d43347 --- /dev/null +++ b/compiler/tests-js-parser/pass/ed085cb2fd0dc355.js @@ -0,0 +1,6 @@ +var a; +if (!b && !c && !d && !e) { + a = 1; +} else { + a = 2; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ed32642380a6e603.js b/compiler/tests-js-parser/pass/ed32642380a6e603.js new file mode 100644 index 000000000..2291df983 --- /dev/null +++ b/compiler/tests-js-parser/pass/ed32642380a6e603.js @@ -0,0 +1 @@ +var _𞸃 diff --git a/compiler/tests-js-parser/pass/ed49ee70d6eabf4a.js b/compiler/tests-js-parser/pass/ed49ee70d6eabf4a.js new file mode 100644 index 000000000..e2c625d53 --- /dev/null +++ b/compiler/tests-js-parser/pass/ed49ee70d6eabf4a.js @@ -0,0 +1 @@ +arguments = 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ed65dd575be2b4ab.js b/compiler/tests-js-parser/pass/ed65dd575be2b4ab.js new file mode 100644 index 000000000..d65f418c8 --- /dev/null +++ b/compiler/tests-js-parser/pass/ed65dd575be2b4ab.js @@ -0,0 +1,8 @@ +// Don't apply transformation to global code +function a() { + b.c('d'); +} +function a() { + b.c('e'); +} +a(); diff --git a/compiler/tests-js-parser/pass/ed6981438ac1918b.js b/compiler/tests-js-parser/pass/ed6981438ac1918b.js new file mode 100644 index 000000000..c86ed5ed3 --- /dev/null +++ b/compiler/tests-js-parser/pass/ed6981438ac1918b.js @@ -0,0 +1 @@ +a |= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ed894bd570d47113.js b/compiler/tests-js-parser/pass/ed894bd570d47113.js new file mode 100644 index 000000000..117a6005a --- /dev/null +++ b/compiler/tests-js-parser/pass/ed894bd570d47113.js @@ -0,0 +1 @@ +throw a * b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/eda5026c194f7279.js b/compiler/tests-js-parser/pass/eda5026c194f7279.js new file mode 100644 index 000000000..920f1df47 --- /dev/null +++ b/compiler/tests-js-parser/pass/eda5026c194f7279.js @@ -0,0 +1 @@ +0x0; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/edbdeeb1761675a7.js b/compiler/tests-js-parser/pass/edbdeeb1761675a7.js new file mode 100644 index 000000000..9c36d77df --- /dev/null +++ b/compiler/tests-js-parser/pass/edbdeeb1761675a7.js @@ -0,0 +1 @@ +({"[": 1}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/edd1f39f90576180.js b/compiler/tests-js-parser/pass/edd1f39f90576180.js new file mode 100644 index 000000000..06a4ee6e4 --- /dev/null +++ b/compiler/tests-js-parser/pass/edd1f39f90576180.js @@ -0,0 +1 @@ +try { } catch (a) { b(a) } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/edfe04e832b81a82.js b/compiler/tests-js-parser/pass/edfe04e832b81a82.js new file mode 100644 index 000000000..df05f7130 --- /dev/null +++ b/compiler/tests-js-parser/pass/edfe04e832b81a82.js @@ -0,0 +1 @@ +new a(b) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ee2342b2715c3bf0.js b/compiler/tests-js-parser/pass/ee2342b2715c3bf0.js new file mode 100644 index 000000000..fa06cfa82 --- /dev/null +++ b/compiler/tests-js-parser/pass/ee2342b2715c3bf0.js @@ -0,0 +1 @@ +do { a++; b--; } while (a < 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ee4e8fa6257d810a.js b/compiler/tests-js-parser/pass/ee4e8fa6257d810a.js new file mode 100644 index 000000000..fe6136117 --- /dev/null +++ b/compiler/tests-js-parser/pass/ee4e8fa6257d810a.js @@ -0,0 +1 @@ +let++ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/eea2875eacf36279.js b/compiler/tests-js-parser/pass/eea2875eacf36279.js new file mode 100644 index 000000000..592aa390a --- /dev/null +++ b/compiler/tests-js-parser/pass/eea2875eacf36279.js @@ -0,0 +1,5 @@ +if (a) { + b = c(); + d = e(); + for (; b < d; ++b) f.g(b); +} diff --git a/compiler/tests-js-parser/pass/eebefa78eec0af44.js b/compiler/tests-js-parser/pass/eebefa78eec0af44.js new file mode 100644 index 000000000..a237ac2f6 --- /dev/null +++ b/compiler/tests-js-parser/pass/eebefa78eec0af44.js @@ -0,0 +1,3 @@ +(function () { + -((a) ? b : 1) +}()); diff --git a/compiler/tests-js-parser/pass/eed97872dd924560.js b/compiler/tests-js-parser/pass/eed97872dd924560.js new file mode 100644 index 000000000..3ea75db67 --- /dev/null +++ b/compiler/tests-js-parser/pass/eed97872dd924560.js @@ -0,0 +1 @@ +`outer${{a: {b: 1}}}bar${`nested${function(){return 2;}}endnest`}end` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/eef60d36274e4ed8.js b/compiler/tests-js-parser/pass/eef60d36274e4ed8.js new file mode 100644 index 000000000..24baea0a9 --- /dev/null +++ b/compiler/tests-js-parser/pass/eef60d36274e4ed8.js @@ -0,0 +1,3 @@ +new (a, b) +new (a || b) +new (c ? a : b) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ef086346e9707e91.js b/compiler/tests-js-parser/pass/ef086346e9707e91.js new file mode 100644 index 000000000..ae0dab3bf --- /dev/null +++ b/compiler/tests-js-parser/pass/ef086346e9707e91.js @@ -0,0 +1 @@ +class a {[b]() {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ef15294c7bc4675e.js b/compiler/tests-js-parser/pass/ef15294c7bc4675e.js new file mode 100644 index 000000000..3fcd0788b --- /dev/null +++ b/compiler/tests-js-parser/pass/ef15294c7bc4675e.js @@ -0,0 +1,5 @@ +function a() { + // do not remove it + var b = 1; + ++b; +} diff --git a/compiler/tests-js-parser/pass/ef61944dbb440b60.js b/compiler/tests-js-parser/pass/ef61944dbb440b60.js new file mode 100644 index 000000000..95d30d30d --- /dev/null +++ b/compiler/tests-js-parser/pass/ef61944dbb440b60.js @@ -0,0 +1 @@ +class a extends class b extends c {} {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ef7843986fabc25d.module.js b/compiler/tests-js-parser/pass/ef7843986fabc25d.module.js new file mode 100644 index 000000000..369765733 --- /dev/null +++ b/compiler/tests-js-parser/pass/ef7843986fabc25d.module.js @@ -0,0 +1 @@ +export default a; diff --git a/compiler/tests-js-parser/pass/ef812b85ce5fbc44.js b/compiler/tests-js-parser/pass/ef812b85ce5fbc44.js new file mode 100644 index 000000000..77d189764 --- /dev/null +++ b/compiler/tests-js-parser/pass/ef812b85ce5fbc44.js @@ -0,0 +1,3 @@ +var Infinity, NaN; +Infinity.a(); +NaN.a(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/efb88a0b6e2e170e.js b/compiler/tests-js-parser/pass/efb88a0b6e2e170e.js new file mode 100644 index 000000000..9bfac40f8 --- /dev/null +++ b/compiler/tests-js-parser/pass/efb88a0b6e2e170e.js @@ -0,0 +1,3 @@ +` + +` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/efe1e5c7656bf0ba.js b/compiler/tests-js-parser/pass/efe1e5c7656bf0ba.js new file mode 100644 index 000000000..96f1c8dc8 --- /dev/null +++ b/compiler/tests-js-parser/pass/efe1e5c7656bf0ba.js @@ -0,0 +1 @@ +a < b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/efef19e06f58fdd9.js b/compiler/tests-js-parser/pass/efef19e06f58fdd9.js new file mode 100644 index 000000000..2156b10ed --- /dev/null +++ b/compiler/tests-js-parser/pass/efef19e06f58fdd9.js @@ -0,0 +1 @@ +({ __proto__: null, set __proto__(a){} }) diff --git a/compiler/tests-js-parser/pass/f01d9f3c7b2b2717.js b/compiler/tests-js-parser/pass/f01d9f3c7b2b2717.js new file mode 100644 index 000000000..b32b0c324 --- /dev/null +++ b/compiler/tests-js-parser/pass/f01d9f3c7b2b2717.js @@ -0,0 +1 @@ +a = { get if() {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f062a3f543a622f8.module.js b/compiler/tests-js-parser/pass/f062a3f543a622f8.module.js new file mode 100644 index 000000000..a46af3e32 --- /dev/null +++ b/compiler/tests-js-parser/pass/f062a3f543a622f8.module.js @@ -0,0 +1 @@ +import a from "foo"; diff --git a/compiler/tests-js-parser/pass/f0a5cf41bdef6532.js b/compiler/tests-js-parser/pass/f0a5cf41bdef6532.js new file mode 100644 index 000000000..e4a061546 --- /dev/null +++ b/compiler/tests-js-parser/pass/f0a5cf41bdef6532.js @@ -0,0 +1 @@ +do a(); while (true); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f0bf9ec665d85fa1.js b/compiler/tests-js-parser/pass/f0bf9ec665d85fa1.js new file mode 100644 index 000000000..86f0735a1 --- /dev/null +++ b/compiler/tests-js-parser/pass/f0bf9ec665d85fa1.js @@ -0,0 +1 @@ +class a { b() { () => super.c; } } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f0d9a7a2f5d42210.js b/compiler/tests-js-parser/pass/f0d9a7a2f5d42210.js new file mode 100644 index 000000000..f326e5cdf --- /dev/null +++ b/compiler/tests-js-parser/pass/f0d9a7a2f5d42210.js @@ -0,0 +1 @@ +let + 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f0f2ab32e7f42314.js b/compiler/tests-js-parser/pass/f0f2ab32e7f42314.js new file mode 100644 index 000000000..b1c0a4c06 --- /dev/null +++ b/compiler/tests-js-parser/pass/f0f2ab32e7f42314.js @@ -0,0 +1 @@ +for(var a of [1,2]) 3 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f0f9e218a70eba5c.js b/compiler/tests-js-parser/pass/f0f9e218a70eba5c.js new file mode 100644 index 000000000..9142d6c85 --- /dev/null +++ b/compiler/tests-js-parser/pass/f0f9e218a70eba5c.js @@ -0,0 +1 @@ +/[\w-\s]/; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f0fbbdabdaca2146.js b/compiler/tests-js-parser/pass/f0fbbdabdaca2146.js new file mode 100644 index 000000000..a7aa97561 --- /dev/null +++ b/compiler/tests-js-parser/pass/f0fbbdabdaca2146.js @@ -0,0 +1 @@ +var let; diff --git a/compiler/tests-js-parser/pass/f108a85d36ec9afc.js b/compiler/tests-js-parser/pass/f108a85d36ec9afc.js new file mode 100644 index 000000000..36ec00c4d --- /dev/null +++ b/compiler/tests-js-parser/pass/f108a85d36ec9afc.js @@ -0,0 +1 @@ +({ *a() { yield super.a(); } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f1218947a6a17e65.js b/compiler/tests-js-parser/pass/f1218947a6a17e65.js new file mode 100644 index 000000000..b3949a622 --- /dev/null +++ b/compiler/tests-js-parser/pass/f1218947a6a17e65.js @@ -0,0 +1,6 @@ +(function () { + var a = 1; // hoist this, but it is very difficult. + (function () { + eval(''); + }()); +}()); diff --git a/compiler/tests-js-parser/pass/f139fd88bd0ad9d0.js b/compiler/tests-js-parser/pass/f139fd88bd0ad9d0.js new file mode 100644 index 000000000..10dad430e --- /dev/null +++ b/compiler/tests-js-parser/pass/f139fd88bd0ad9d0.js @@ -0,0 +1 @@ +`{${a}}`, `}` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f13a130829aa77c5.js b/compiler/tests-js-parser/pass/f13a130829aa77c5.js new file mode 100644 index 000000000..a7b7a81bc --- /dev/null +++ b/compiler/tests-js-parser/pass/f13a130829aa77c5.js @@ -0,0 +1 @@ +class a { static *b() {} } diff --git a/compiler/tests-js-parser/pass/f1534392279bddbf.js b/compiler/tests-js-parser/pass/f1534392279bddbf.js new file mode 100644 index 000000000..857f065e4 --- /dev/null +++ b/compiler/tests-js-parser/pass/f1534392279bddbf.js @@ -0,0 +1 @@ +00 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f15772354efa5ecf.js b/compiler/tests-js-parser/pass/f15772354efa5ecf.js new file mode 100644 index 000000000..9f9087575 --- /dev/null +++ b/compiler/tests-js-parser/pass/f15772354efa5ecf.js @@ -0,0 +1 @@ +(function() {'use strict';return 1;}); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f1643d0e6c7fde9a.js b/compiler/tests-js-parser/pass/f1643d0e6c7fde9a.js new file mode 100644 index 000000000..08aba7ae6 --- /dev/null +++ b/compiler/tests-js-parser/pass/f1643d0e6c7fde9a.js @@ -0,0 +1 @@ +var a = /=([^=\s])+/g \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f17ec9517a3339d9.js b/compiler/tests-js-parser/pass/f17ec9517a3339d9.js new file mode 100644 index 000000000..9b14ebbb3 --- /dev/null +++ b/compiler/tests-js-parser/pass/f17ec9517a3339d9.js @@ -0,0 +1 @@ +({ set if(a) { a } }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f1bf02f18fa71ba7.js b/compiler/tests-js-parser/pass/f1bf02f18fa71ba7.js new file mode 100644 index 000000000..2d8fc3cf2 --- /dev/null +++ b/compiler/tests-js-parser/pass/f1bf02f18fa71ba7.js @@ -0,0 +1 @@ +([])=>1; diff --git a/compiler/tests-js-parser/pass/f1d7e3cc86ffc02b.js b/compiler/tests-js-parser/pass/f1d7e3cc86ffc02b.js new file mode 100644 index 000000000..6d80fb2cb --- /dev/null +++ b/compiler/tests-js-parser/pass/f1d7e3cc86ffc02b.js @@ -0,0 +1,10 @@ +function a() { + b(); + var c; + var d; +} +function e(f) { + b(); + var c; + var f; +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f2113065d9111e6d.js b/compiler/tests-js-parser/pass/f2113065d9111e6d.js new file mode 100644 index 000000000..3a5e29682 --- /dev/null +++ b/compiler/tests-js-parser/pass/f2113065d9111e6d.js @@ -0,0 +1 @@ +(() => null)(); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f2142c1dabd961c1.js b/compiler/tests-js-parser/pass/f2142c1dabd961c1.js new file mode 100644 index 000000000..ec9131a29 --- /dev/null +++ b/compiler/tests-js-parser/pass/f2142c1dabd961c1.js @@ -0,0 +1 @@ +/* not comment*/; a-->1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f2aa3da994da03a7.js b/compiler/tests-js-parser/pass/f2aa3da994da03a7.js new file mode 100644 index 000000000..dc4a1b85b --- /dev/null +++ b/compiler/tests-js-parser/pass/f2aa3da994da03a7.js @@ -0,0 +1 @@ +var {a = b} = c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f2d394b74219a023.js b/compiler/tests-js-parser/pass/f2d394b74219a023.js new file mode 100644 index 000000000..59d99f0aa --- /dev/null +++ b/compiler/tests-js-parser/pass/f2d394b74219a023.js @@ -0,0 +1 @@ +typeof /test/ + ' RegExp' diff --git a/compiler/tests-js-parser/pass/f2e0a415d88b3451.js b/compiler/tests-js-parser/pass/f2e0a415d88b3451.js new file mode 100644 index 000000000..b44502fba --- /dev/null +++ b/compiler/tests-js-parser/pass/f2e0a415d88b3451.js @@ -0,0 +1,2 @@ +if (a) { // Some comment +b(); } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f2e41488e95243a8.js b/compiler/tests-js-parser/pass/f2e41488e95243a8.js new file mode 100644 index 000000000..deb237564 --- /dev/null +++ b/compiler/tests-js-parser/pass/f2e41488e95243a8.js @@ -0,0 +1 @@ +var [let] = a; diff --git a/compiler/tests-js-parser/pass/f2ed650f15f224fa.module.js b/compiler/tests-js-parser/pass/f2ed650f15f224fa.module.js new file mode 100644 index 000000000..55bb20974 --- /dev/null +++ b/compiler/tests-js-parser/pass/f2ed650f15f224fa.module.js @@ -0,0 +1 @@ +export default 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f30d88a123e11b55.js b/compiler/tests-js-parser/pass/f30d88a123e11b55.js new file mode 100644 index 000000000..621d54080 --- /dev/null +++ b/compiler/tests-js-parser/pass/f30d88a123e11b55.js @@ -0,0 +1 @@ +for (var [a, b] of c); diff --git a/compiler/tests-js-parser/pass/f3219596b50bb381.js b/compiler/tests-js-parser/pass/f3219596b50bb381.js new file mode 100644 index 000000000..93b003cc9 --- /dev/null +++ b/compiler/tests-js-parser/pass/f3219596b50bb381.js @@ -0,0 +1,2 @@ +{[1]} +/foo/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f3260491590325af.js b/compiler/tests-js-parser/pass/f3260491590325af.js new file mode 100644 index 000000000..460bbe81b --- /dev/null +++ b/compiler/tests-js-parser/pass/f3260491590325af.js @@ -0,0 +1 @@ +(function(){ return true })() ? a.b(true) : a.b(false); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f355802cb6d444e1.js b/compiler/tests-js-parser/pass/f355802cb6d444e1.js new file mode 100644 index 000000000..6bb8c26fb --- /dev/null +++ b/compiler/tests-js-parser/pass/f355802cb6d444e1.js @@ -0,0 +1 @@ +let a; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f3d3a0f30115de54.js b/compiler/tests-js-parser/pass/f3d3a0f30115de54.js new file mode 100644 index 000000000..81e8b1dfa --- /dev/null +++ b/compiler/tests-js-parser/pass/f3d3a0f30115de54.js @@ -0,0 +1 @@ +a < b < c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f404f7ff29ba5d1a.module.js b/compiler/tests-js-parser/pass/f404f7ff29ba5d1a.module.js new file mode 100644 index 000000000..03c095d5f --- /dev/null +++ b/compiler/tests-js-parser/pass/f404f7ff29ba5d1a.module.js @@ -0,0 +1 @@ +export default function () {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f407a3693faf595b.js b/compiler/tests-js-parser/pass/f407a3693faf595b.js new file mode 100644 index 000000000..2ccefadbc --- /dev/null +++ b/compiler/tests-js-parser/pass/f407a3693faf595b.js @@ -0,0 +1 @@ +([a=1], [])=>2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f43f922cccf5b9af.js b/compiler/tests-js-parser/pass/f43f922cccf5b9af.js new file mode 100644 index 000000000..c27460a25 --- /dev/null +++ b/compiler/tests-js-parser/pass/f43f922cccf5b9af.js @@ -0,0 +1,3 @@ +(function () { + a = a += 1; // This is global varible, so observable by getter. +}()); diff --git a/compiler/tests-js-parser/pass/f471327b3e9b8933.js b/compiler/tests-js-parser/pass/f471327b3e9b8933.js new file mode 100644 index 000000000..661182da0 --- /dev/null +++ b/compiler/tests-js-parser/pass/f471327b3e9b8933.js @@ -0,0 +1 @@ +a = { a: 1, a: 2 } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f4864ec70dd99c21.js b/compiler/tests-js-parser/pass/f4864ec70dd99c21.js new file mode 100644 index 000000000..29ff9dd30 --- /dev/null +++ b/compiler/tests-js-parser/pass/f4864ec70dd99c21.js @@ -0,0 +1 @@ +a.false \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f4a61fcdefebb9d4.js b/compiler/tests-js-parser/pass/f4a61fcdefebb9d4.js new file mode 100644 index 000000000..d2c2ed5b6 --- /dev/null +++ b/compiler/tests-js-parser/pass/f4a61fcdefebb9d4.js @@ -0,0 +1 @@ +var private, protected, public, static \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f4b2d8937ec13ab0.js b/compiler/tests-js-parser/pass/f4b2d8937ec13ab0.js new file mode 100644 index 000000000..180469b36 --- /dev/null +++ b/compiler/tests-js-parser/pass/f4b2d8937ec13ab0.js @@ -0,0 +1 @@ +for (var a = ("b" in c), d = 1; d < 2; ++d); diff --git a/compiler/tests-js-parser/pass/f50f858c3ef003f4.js b/compiler/tests-js-parser/pass/f50f858c3ef003f4.js new file mode 100644 index 000000000..3c6b7ca01 --- /dev/null +++ b/compiler/tests-js-parser/pass/f50f858c3ef003f4.js @@ -0,0 +1 @@ +a && (b && c) diff --git a/compiler/tests-js-parser/pass/f552daf299e1c6e5.js b/compiler/tests-js-parser/pass/f552daf299e1c6e5.js new file mode 100644 index 000000000..3aace55fe --- /dev/null +++ b/compiler/tests-js-parser/pass/f552daf299e1c6e5.js @@ -0,0 +1 @@ +({a(){let a;}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f597b0312e2b678c.js b/compiler/tests-js-parser/pass/f597b0312e2b678c.js new file mode 100644 index 000000000..f007b910a --- /dev/null +++ b/compiler/tests-js-parser/pass/f597b0312e2b678c.js @@ -0,0 +1,4 @@ +if (a) { + b(); +} else { +} diff --git a/compiler/tests-js-parser/pass/f5b89028dfa29f27.js b/compiler/tests-js-parser/pass/f5b89028dfa29f27.js new file mode 100644 index 000000000..7b9341ce7 --- /dev/null +++ b/compiler/tests-js-parser/pass/f5b89028dfa29f27.js @@ -0,0 +1 @@ +var \u{1EE06}_$ diff --git a/compiler/tests-js-parser/pass/f5ba9f1b21487d3b.js b/compiler/tests-js-parser/pass/f5ba9f1b21487d3b.js new file mode 100644 index 000000000..3344e0049 --- /dev/null +++ b/compiler/tests-js-parser/pass/f5ba9f1b21487d3b.js @@ -0,0 +1,3 @@ +function a() { + var b = 1; +} diff --git a/compiler/tests-js-parser/pass/f601e7dd0235d423.js b/compiler/tests-js-parser/pass/f601e7dd0235d423.js new file mode 100644 index 000000000..1500e7c46 --- /dev/null +++ b/compiler/tests-js-parser/pass/f601e7dd0235d423.js @@ -0,0 +1 @@ +var {a: b = c} = d \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f658dbaa20c36388.js b/compiler/tests-js-parser/pass/f658dbaa20c36388.js new file mode 100644 index 000000000..cdb2e1b07 --- /dev/null +++ b/compiler/tests-js-parser/pass/f658dbaa20c36388.js @@ -0,0 +1,5 @@ +(function () { + if (!!a && b()) { + with (b) { } + } +}()); diff --git a/compiler/tests-js-parser/pass/f69b27444afab042.js b/compiler/tests-js-parser/pass/f69b27444afab042.js new file mode 100644 index 000000000..47bab69d5 --- /dev/null +++ b/compiler/tests-js-parser/pass/f69b27444afab042.js @@ -0,0 +1,10 @@ +(function () { + // 'a' + b: { + if (a) break b; + if (a) break b; + if (a) break b; + if (a) break b; + } + eval(c); +}()); diff --git a/compiler/tests-js-parser/pass/f6d11d1e4dcb1ded.js b/compiler/tests-js-parser/pass/f6d11d1e4dcb1ded.js new file mode 100644 index 000000000..535c80e41 --- /dev/null +++ b/compiler/tests-js-parser/pass/f6d11d1e4dcb1ded.js @@ -0,0 +1,3 @@ +function a() { + let b = new.target; +} diff --git a/compiler/tests-js-parser/pass/f6d42525cd87339b.js b/compiler/tests-js-parser/pass/f6d42525cd87339b.js new file mode 100644 index 000000000..c300ceaef --- /dev/null +++ b/compiler/tests-js-parser/pass/f6d42525cd87339b.js @@ -0,0 +1,3 @@ +(function () { + var a, b, c; +}()); diff --git a/compiler/tests-js-parser/pass/f7291c5ec70a4152.js b/compiler/tests-js-parser/pass/f7291c5ec70a4152.js new file mode 100644 index 000000000..74e1bded2 --- /dev/null +++ b/compiler/tests-js-parser/pass/f7291c5ec70a4152.js @@ -0,0 +1 @@ +({ a: b, c }, [d, e], ...f) => {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f78abc3cba581cdd.js b/compiler/tests-js-parser/pass/f78abc3cba581cdd.js new file mode 100644 index 000000000..a114ae6dd --- /dev/null +++ b/compiler/tests-js-parser/pass/f78abc3cba581cdd.js @@ -0,0 +1 @@ +class a {*b(c) { yield c; }} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f7af1a6b02dbd440.js b/compiler/tests-js-parser/pass/f7af1a6b02dbd440.js new file mode 100644 index 000000000..d94ed2257 --- /dev/null +++ b/compiler/tests-js-parser/pass/f7af1a6b02dbd440.js @@ -0,0 +1,3 @@ +for (;;) { + a; +} diff --git a/compiler/tests-js-parser/pass/f7e2edf1ccb61303.js b/compiler/tests-js-parser/pass/f7e2edf1ccb61303.js new file mode 100644 index 000000000..aff75722a --- /dev/null +++ b/compiler/tests-js-parser/pass/f7e2edf1ccb61303.js @@ -0,0 +1 @@ +var [[a]]=1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f7f611e6fdb5b9fc.js b/compiler/tests-js-parser/pass/f7f611e6fdb5b9fc.js new file mode 100644 index 000000000..84eba349a --- /dev/null +++ b/compiler/tests-js-parser/pass/f7f611e6fdb5b9fc.js @@ -0,0 +1 @@ +var \u{1EE0A}\u{1EE0B} diff --git a/compiler/tests-js-parser/pass/f80f30fbdd7e7b19.js b/compiler/tests-js-parser/pass/f80f30fbdd7e7b19.js new file mode 100644 index 000000000..9fc3718c4 --- /dev/null +++ b/compiler/tests-js-parser/pass/f80f30fbdd7e7b19.js @@ -0,0 +1 @@ +/.{.}/; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f8323b3c45bd107a.js b/compiler/tests-js-parser/pass/f8323b3c45bd107a.js new file mode 100644 index 000000000..de19a5ebb --- /dev/null +++ b/compiler/tests-js-parser/pass/f8323b3c45bd107a.js @@ -0,0 +1 @@ +a ^ b ^ c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f89bf797c3b1dda4.js b/compiler/tests-js-parser/pass/f89bf797c3b1dda4.js new file mode 100644 index 000000000..d9ab55838 --- /dev/null +++ b/compiler/tests-js-parser/pass/f89bf797c3b1dda4.js @@ -0,0 +1 @@ +(a) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f8a07bd5ab703d4b.js b/compiler/tests-js-parser/pass/f8a07bd5ab703d4b.js new file mode 100644 index 000000000..a9d2ac525 --- /dev/null +++ b/compiler/tests-js-parser/pass/f8a07bd5ab703d4b.js @@ -0,0 +1,6 @@ +for (;;) { + if (a) { + continue; + } + b(); // This should not be removed. +} diff --git a/compiler/tests-js-parser/pass/f8cf06a0d5699319.js b/compiler/tests-js-parser/pass/f8cf06a0d5699319.js new file mode 100644 index 000000000..8633039cf --- /dev/null +++ b/compiler/tests-js-parser/pass/f8cf06a0d5699319.js @@ -0,0 +1 @@ +function a(b, ...c) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f8d843a30c73377a.js b/compiler/tests-js-parser/pass/f8d843a30c73377a.js new file mode 100644 index 000000000..63ce916a2 --- /dev/null +++ b/compiler/tests-js-parser/pass/f8d843a30c73377a.js @@ -0,0 +1 @@ +(class a{}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f8dc2e8bbddcdfbe.js b/compiler/tests-js-parser/pass/f8dc2e8bbddcdfbe.js new file mode 100644 index 000000000..c9606e645 --- /dev/null +++ b/compiler/tests-js-parser/pass/f8dc2e8bbddcdfbe.js @@ -0,0 +1 @@ +a || b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f94e47b7b5cfda74.js b/compiler/tests-js-parser/pass/f94e47b7b5cfda74.js new file mode 100644 index 000000000..a8b3bf55b --- /dev/null +++ b/compiler/tests-js-parser/pass/f94e47b7b5cfda74.js @@ -0,0 +1,2 @@ +// should be 4 +1 << 2 diff --git a/compiler/tests-js-parser/pass/f96c694c5a2f2be9.js b/compiler/tests-js-parser/pass/f96c694c5a2f2be9.js new file mode 100644 index 000000000..9de4b3035 --- /dev/null +++ b/compiler/tests-js-parser/pass/f96c694c5a2f2be9.js @@ -0,0 +1 @@ +function a(b, c, d, e) { return b < !--c && d-- > e; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f974f2619b25b027.js b/compiler/tests-js-parser/pass/f974f2619b25b027.js new file mode 100644 index 000000000..ec2b8011b --- /dev/null +++ b/compiler/tests-js-parser/pass/f974f2619b25b027.js @@ -0,0 +1 @@ +({ a: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f9888fa1a1e366e7.js b/compiler/tests-js-parser/pass/f9888fa1a1e366e7.js new file mode 100644 index 000000000..dd0b56ca9 --- /dev/null +++ b/compiler/tests-js-parser/pass/f9888fa1a1e366e7.js @@ -0,0 +1 @@ +a = [ ,, 1 ] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f990e76e7fcb0dd9.js b/compiler/tests-js-parser/pass/f990e76e7fcb0dd9.js new file mode 100644 index 000000000..be81fcd8e --- /dev/null +++ b/compiler/tests-js-parser/pass/f990e76e7fcb0dd9.js @@ -0,0 +1 @@ +const [a] = [] \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f9b92700d0e68f49.js b/compiler/tests-js-parser/pass/f9b92700d0e68f49.js new file mode 100644 index 000000000..6d7f2aea6 --- /dev/null +++ b/compiler/tests-js-parser/pass/f9b92700d0e68f49.js @@ -0,0 +1 @@ +({a,} = 1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/f9c201250f225ab9.js b/compiler/tests-js-parser/pass/f9c201250f225ab9.js new file mode 100644 index 000000000..65ca7ed8f --- /dev/null +++ b/compiler/tests-js-parser/pass/f9c201250f225ab9.js @@ -0,0 +1 @@ +delete (1, a) diff --git a/compiler/tests-js-parser/pass/f9d67ab9db16c4d5.js b/compiler/tests-js-parser/pass/f9d67ab9db16c4d5.js new file mode 100644 index 000000000..16a62bc21 --- /dev/null +++ b/compiler/tests-js-parser/pass/f9d67ab9db16c4d5.js @@ -0,0 +1 @@ +var a = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fa58aa963031f8df.js b/compiler/tests-js-parser/pass/fa58aa963031f8df.js new file mode 100644 index 000000000..d2943f0dd --- /dev/null +++ b/compiler/tests-js-parser/pass/fa58aa963031f8df.js @@ -0,0 +1,3 @@ + /** + +**/ \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fa59ac4c41d26c14.js b/compiler/tests-js-parser/pass/fa59ac4c41d26c14.js new file mode 100644 index 000000000..08fa9c5d2 --- /dev/null +++ b/compiler/tests-js-parser/pass/fa59ac4c41d26c14.js @@ -0,0 +1 @@ +({let}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fa5b398eeef697a6.js b/compiler/tests-js-parser/pass/fa5b398eeef697a6.js new file mode 100644 index 000000000..4ff7a42c4 --- /dev/null +++ b/compiler/tests-js-parser/pass/fa5b398eeef697a6.js @@ -0,0 +1 @@ +({set a(eval){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fa6c17d9a188d0bb.js b/compiler/tests-js-parser/pass/fa6c17d9a188d0bb.js new file mode 100644 index 000000000..3acbce728 --- /dev/null +++ b/compiler/tests-js-parser/pass/fa6c17d9a188d0bb.js @@ -0,0 +1,3 @@ +(function () { + if (!a || b()); +}()); diff --git a/compiler/tests-js-parser/pass/fa736f4b0cf19c0c.js b/compiler/tests-js-parser/pass/fa736f4b0cf19c0c.js new file mode 100644 index 000000000..d66703353 --- /dev/null +++ b/compiler/tests-js-parser/pass/fa736f4b0cf19c0c.js @@ -0,0 +1 @@ +"Hello\1World" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fa9eaf58f51d6926.js b/compiler/tests-js-parser/pass/fa9eaf58f51d6926.js new file mode 100644 index 000000000..4c206a3f4 --- /dev/null +++ b/compiler/tests-js-parser/pass/fa9eaf58f51d6926.js @@ -0,0 +1 @@ +(function(){}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/faa4a026e1e86145.js b/compiler/tests-js-parser/pass/faa4a026e1e86145.js new file mode 100644 index 000000000..4855487c5 --- /dev/null +++ b/compiler/tests-js-parser/pass/faa4a026e1e86145.js @@ -0,0 +1 @@ +(() => {})() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fada2c7bbfabe14a.js b/compiler/tests-js-parser/pass/fada2c7bbfabe14a.js new file mode 100644 index 000000000..109434686 --- /dev/null +++ b/compiler/tests-js-parser/pass/fada2c7bbfabe14a.js @@ -0,0 +1 @@ +(function arguments() { }); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fae42f5a2ab85c1d.js b/compiler/tests-js-parser/pass/fae42f5a2ab85c1d.js new file mode 100644 index 000000000..2e147fce3 --- /dev/null +++ b/compiler/tests-js-parser/pass/fae42f5a2ab85c1d.js @@ -0,0 +1 @@ +a %= 1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fb50400b4c9cf740.js b/compiler/tests-js-parser/pass/fb50400b4c9cf740.js new file mode 100644 index 000000000..149ad64e0 --- /dev/null +++ b/compiler/tests-js-parser/pass/fb50400b4c9cf740.js @@ -0,0 +1 @@ +({ *a() { yield; } }) diff --git a/compiler/tests-js-parser/pass/fb69459d7628ace1.js b/compiler/tests-js-parser/pass/fb69459d7628ace1.js new file mode 100644 index 000000000..e60fb9121 --- /dev/null +++ b/compiler/tests-js-parser/pass/fb69459d7628ace1.js @@ -0,0 +1 @@ +({ set: 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fb7c5656640f6ec7.js b/compiler/tests-js-parser/pass/fb7c5656640f6ec7.js new file mode 100644 index 000000000..1cc49a3ae --- /dev/null +++ b/compiler/tests-js-parser/pass/fb7c5656640f6ec7.js @@ -0,0 +1 @@ +`${/\d/.a('1')[1]}` \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fb8d437ce90b1178.js b/compiler/tests-js-parser/pass/fb8d437ce90b1178.js new file mode 100644 index 000000000..1e5b074c5 --- /dev/null +++ b/compiler/tests-js-parser/pass/fb8d437ce90b1178.js @@ -0,0 +1 @@ +[a] = 1; diff --git a/compiler/tests-js-parser/pass/fb8db7a71f3755fc.js b/compiler/tests-js-parser/pass/fb8db7a71f3755fc.js new file mode 100644 index 000000000..7b3a26da2 --- /dev/null +++ b/compiler/tests-js-parser/pass/fb8db7a71f3755fc.js @@ -0,0 +1 @@ +class a {set b(c) {}} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fba24e17d16fd0c4.js b/compiler/tests-js-parser/pass/fba24e17d16fd0c4.js new file mode 100644 index 000000000..e2900ca23 --- /dev/null +++ b/compiler/tests-js-parser/pass/fba24e17d16fd0c4.js @@ -0,0 +1 @@ +"\x61" \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fbacebe72fb15fed.module.js b/compiler/tests-js-parser/pass/fbacebe72fb15fed.module.js new file mode 100644 index 000000000..f310bb464 --- /dev/null +++ b/compiler/tests-js-parser/pass/fbacebe72fb15fed.module.js @@ -0,0 +1 @@ +export class a{};1 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fbb6b30b41732026.js b/compiler/tests-js-parser/pass/fbb6b30b41732026.js new file mode 100644 index 000000000..a5fa93545 --- /dev/null +++ b/compiler/tests-js-parser/pass/fbb6b30b41732026.js @@ -0,0 +1 @@ +new a \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fbcd793ec7c82779.js b/compiler/tests-js-parser/pass/fbcd793ec7c82779.js new file mode 100644 index 000000000..552a2daa3 --- /dev/null +++ b/compiler/tests-js-parser/pass/fbcd793ec7c82779.js @@ -0,0 +1 @@ +1) {} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fc063bfba795ad91.js b/compiler/tests-js-parser/pass/fc063bfba795ad91.js new file mode 100644 index 000000000..66fbbcdfe --- /dev/null +++ b/compiler/tests-js-parser/pass/fc063bfba795ad91.js @@ -0,0 +1 @@ +({ a(b = new.target){} }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fc1ba7d289fb1af1.js b/compiler/tests-js-parser/pass/fc1ba7d289fb1af1.js new file mode 100644 index 000000000..6c0801271 --- /dev/null +++ b/compiler/tests-js-parser/pass/fc1ba7d289fb1af1.js @@ -0,0 +1 @@ +a = { b: function(c, ...d) {} } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fc286bf26373db8d.js b/compiler/tests-js-parser/pass/fc286bf26373db8d.js new file mode 100644 index 000000000..d1d8d3011 --- /dev/null +++ b/compiler/tests-js-parser/pass/fc286bf26373db8d.js @@ -0,0 +1,4 @@ +switch (a) { + case 'b': c(); + default: +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fc5c8d6f6bf16121.js b/compiler/tests-js-parser/pass/fc5c8d6f6bf16121.js new file mode 100644 index 000000000..63d626491 --- /dev/null +++ b/compiler/tests-js-parser/pass/fc5c8d6f6bf16121.js @@ -0,0 +1 @@ +{ a(); b(); } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fc9f000aa3e4bd79.js b/compiler/tests-js-parser/pass/fc9f000aa3e4bd79.js new file mode 100644 index 000000000..5e2e30b2e --- /dev/null +++ b/compiler/tests-js-parser/pass/fc9f000aa3e4bd79.js @@ -0,0 +1 @@ +for(let a;;); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fcb318e400b44257.js b/compiler/tests-js-parser/pass/fcb318e400b44257.js new file mode 100644 index 000000000..38f2a860b --- /dev/null +++ b/compiler/tests-js-parser/pass/fcb318e400b44257.js @@ -0,0 +1 @@ +a ? 1 : 2 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fcd33c00916dd6ad.js b/compiler/tests-js-parser/pass/fcd33c00916dd6ad.js new file mode 100644 index 000000000..f9c23aaeb --- /dev/null +++ b/compiler/tests-js-parser/pass/fcd33c00916dd6ad.js @@ -0,0 +1 @@ +a.b.c(1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fcf3738a49a5f358.js b/compiler/tests-js-parser/pass/fcf3738a49a5f358.js new file mode 100644 index 000000000..3771b20ff --- /dev/null +++ b/compiler/tests-js-parser/pass/fcf3738a49a5f358.js @@ -0,0 +1,5 @@ +while (true) { + /** + * comments in empty block + */ +} diff --git a/compiler/tests-js-parser/pass/fd0ad9026eee596b.js b/compiler/tests-js-parser/pass/fd0ad9026eee596b.js new file mode 100644 index 000000000..3d11d2f33 --- /dev/null +++ b/compiler/tests-js-parser/pass/fd0ad9026eee596b.js @@ -0,0 +1 @@ +(1) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fd0e7b0f778f8a3b.js b/compiler/tests-js-parser/pass/fd0e7b0f778f8a3b.js new file mode 100644 index 000000000..d3bd3524a --- /dev/null +++ b/compiler/tests-js-parser/pass/fd0e7b0f778f8a3b.js @@ -0,0 +1,3 @@ +if (a) { + a; +} diff --git a/compiler/tests-js-parser/pass/fd167642d02f2c66.js b/compiler/tests-js-parser/pass/fd167642d02f2c66.js new file mode 100644 index 000000000..748198501 --- /dev/null +++ b/compiler/tests-js-parser/pass/fd167642d02f2c66.js @@ -0,0 +1 @@ +({*[yield](){}}) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fd29828f68a7634e.js b/compiler/tests-js-parser/pass/fd29828f68a7634e.js new file mode 100644 index 000000000..cadaaf18f --- /dev/null +++ b/compiler/tests-js-parser/pass/fd29828f68a7634e.js @@ -0,0 +1,5 @@ +for (;a();) { + if (b()) break; + c(); + d(); +} \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fd34477284c96cbf.js b/compiler/tests-js-parser/pass/fd34477284c96cbf.js new file mode 100644 index 000000000..5d58a9a8a --- /dev/null +++ b/compiler/tests-js-parser/pass/fd34477284c96cbf.js @@ -0,0 +1 @@ +var [a, a] = 1; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fd5ea844fcc07d3d.js b/compiler/tests-js-parser/pass/fd5ea844fcc07d3d.js new file mode 100644 index 000000000..98f3c63e9 --- /dev/null +++ b/compiler/tests-js-parser/pass/fd5ea844fcc07d3d.js @@ -0,0 +1 @@ +a => { 1; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fd889a4ef6e361f1.js b/compiler/tests-js-parser/pass/fd889a4ef6e361f1.js new file mode 100644 index 000000000..c4318a129 --- /dev/null +++ b/compiler/tests-js-parser/pass/fd889a4ef6e361f1.js @@ -0,0 +1 @@ +function a(b, c) { d(); } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fdb05dfd469c46c4.js b/compiler/tests-js-parser/pass/fdb05dfd469c46c4.js new file mode 100644 index 000000000..ca035b321 --- /dev/null +++ b/compiler/tests-js-parser/pass/fdb05dfd469c46c4.js @@ -0,0 +1,5 @@ +var a = {}; +a.你好 = 1; + +var ↂωↂ = 2; +var l০ = 3; // 2nd char is a unicode digit \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fdb684acf63f6274.js b/compiler/tests-js-parser/pass/fdb684acf63f6274.js new file mode 100644 index 000000000..15cc7973f --- /dev/null +++ b/compiler/tests-js-parser/pass/fdb684acf63f6274.js @@ -0,0 +1 @@ +0B10 \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fe03ba1b818c762e.js b/compiler/tests-js-parser/pass/fe03ba1b818c762e.js new file mode 100644 index 000000000..9fd374a4f --- /dev/null +++ b/compiler/tests-js-parser/pass/fe03ba1b818c762e.js @@ -0,0 +1,3 @@ +(function () { + null != (a, 1); +}()); diff --git a/compiler/tests-js-parser/pass/fe24fc72de1ef7cc.js b/compiler/tests-js-parser/pass/fe24fc72de1ef7cc.js new file mode 100644 index 000000000..938287be4 --- /dev/null +++ b/compiler/tests-js-parser/pass/fe24fc72de1ef7cc.js @@ -0,0 +1 @@ +([a,b])=>1; diff --git a/compiler/tests-js-parser/pass/fe2d3b945530c806.js b/compiler/tests-js-parser/pass/fe2d3b945530c806.js new file mode 100644 index 000000000..86a40e71e --- /dev/null +++ b/compiler/tests-js-parser/pass/fe2d3b945530c806.js @@ -0,0 +1 @@ +a
b \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fe5ae04c8d239b26.js b/compiler/tests-js-parser/pass/fe5ae04c8d239b26.js new file mode 100644 index 000000000..7aaa4353f --- /dev/null +++ b/compiler/tests-js-parser/pass/fe5ae04c8d239b26.js @@ -0,0 +1,6 @@ +function a() { + // do not concat i=20,i2=30 + var b = 1; + c(); + var d = 2; +} diff --git a/compiler/tests-js-parser/pass/fe5f0dcb8e902857.js b/compiler/tests-js-parser/pass/fe5f0dcb8e902857.js new file mode 100644 index 000000000..68da970dd --- /dev/null +++ b/compiler/tests-js-parser/pass/fe5f0dcb8e902857.js @@ -0,0 +1,6 @@ +while (a) + // optimize it + (function () { + b('c'); + }()); +try { } catch (d) { b('e'); } diff --git a/compiler/tests-js-parser/pass/fe7c2a6e1efe2cf4.js b/compiler/tests-js-parser/pass/fe7c2a6e1efe2cf4.js new file mode 100644 index 000000000..b6a09f085 --- /dev/null +++ b/compiler/tests-js-parser/pass/fe7c2a6e1efe2cf4.js @@ -0,0 +1 @@ +let[a] = b; \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fec4c4ff229d3fc2.js b/compiler/tests-js-parser/pass/fec4c4ff229d3fc2.js new file mode 100644 index 000000000..5b8ade0a9 --- /dev/null +++ b/compiler/tests-js-parser/pass/fec4c4ff229d3fc2.js @@ -0,0 +1,7 @@ +a(b() + 1 + "c" + "d"); +a(b() + (2 + "c") + "d"); +a((b() + 3) + "c" + "d"); +a(b() + 4 + "c" + "d" + ("e" + "f")); +a("e" + "f" + b() + 5 + "c" + "d" + ("e" + "f")); +a("c" + b() + 6 + "d"); +a(b() + 'e' + (7 + g('10'))); \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fee1cb654a489f02.js b/compiler/tests-js-parser/pass/fee1cb654a489f02.js new file mode 100644 index 000000000..4f8a54935 --- /dev/null +++ b/compiler/tests-js-parser/pass/fee1cb654a489f02.js @@ -0,0 +1 @@ +a - b % c \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fee3f54aa720263f.js b/compiler/tests-js-parser/pass/fee3f54aa720263f.js new file mode 100644 index 000000000..89394db0f --- /dev/null +++ b/compiler/tests-js-parser/pass/fee3f54aa720263f.js @@ -0,0 +1 @@ +(a ? b : c) ? d : e \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fef4facb0b8479bf.js b/compiler/tests-js-parser/pass/fef4facb0b8479bf.js new file mode 100644 index 000000000..43014cb23 --- /dev/null +++ b/compiler/tests-js-parser/pass/fef4facb0b8479bf.js @@ -0,0 +1,3 @@ +function a() { + return 1 ? 2 : 3; +} diff --git a/compiler/tests-js-parser/pass/ff03d6d14c3f4007.js b/compiler/tests-js-parser/pass/ff03d6d14c3f4007.js new file mode 100644 index 000000000..cb6ee0a19 --- /dev/null +++ b/compiler/tests-js-parser/pass/ff03d6d14c3f4007.js @@ -0,0 +1,5 @@ +(function () { + var a = { + 'NaN': 1 + }; +}()); diff --git a/compiler/tests-js-parser/pass/ff215f966bed2b85.js b/compiler/tests-js-parser/pass/ff215f966bed2b85.js new file mode 100644 index 000000000..6b8cf905d --- /dev/null +++ b/compiler/tests-js-parser/pass/ff215f966bed2b85.js @@ -0,0 +1 @@ +({"__proto__": 1 }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ff488aae349cc02d.js b/compiler/tests-js-parser/pass/ff488aae349cc02d.js new file mode 100644 index 000000000..a8931aaa1 --- /dev/null +++ b/compiler/tests-js-parser/pass/ff488aae349cc02d.js @@ -0,0 +1 @@ +for (const a of b); diff --git a/compiler/tests-js-parser/pass/ff4b8762733080cb.js b/compiler/tests-js-parser/pass/ff4b8762733080cb.js new file mode 100644 index 000000000..703ffaaca --- /dev/null +++ b/compiler/tests-js-parser/pass/ff4b8762733080cb.js @@ -0,0 +1 @@ +while (true) { continue } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ff902593b25092d1.js b/compiler/tests-js-parser/pass/ff902593b25092d1.js new file mode 100644 index 000000000..861b40181 --- /dev/null +++ b/compiler/tests-js-parser/pass/ff902593b25092d1.js @@ -0,0 +1 @@ +/[P QR]/i \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ffaf5b9d3140465b.js b/compiler/tests-js-parser/pass/ffaf5b9d3140465b.js new file mode 100644 index 000000000..cfef0d3ba --- /dev/null +++ b/compiler/tests-js-parser/pass/ffaf5b9d3140465b.js @@ -0,0 +1 @@ +let() \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ffbba9592c03baa6.js b/compiler/tests-js-parser/pass/ffbba9592c03baa6.js new file mode 100644 index 000000000..170902452 --- /dev/null +++ b/compiler/tests-js-parser/pass/ffbba9592c03baa6.js @@ -0,0 +1 @@ +switch (a) { case 1: b(); break; } \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/ffc32056a146cc9b.js b/compiler/tests-js-parser/pass/ffc32056a146cc9b.js new file mode 100644 index 000000000..596c73551 --- /dev/null +++ b/compiler/tests-js-parser/pass/ffc32056a146cc9b.js @@ -0,0 +1 @@ +for (a of b); diff --git a/compiler/tests-js-parser/pass/ffcf0064736d41e7.js b/compiler/tests-js-parser/pass/ffcf0064736d41e7.js new file mode 100644 index 000000000..2a69aee8b --- /dev/null +++ b/compiler/tests-js-parser/pass/ffcf0064736d41e7.js @@ -0,0 +1 @@ +(function*(){ (function yield(){}); }) \ No newline at end of file diff --git a/compiler/tests-js-parser/pass/fffe7e78a7ce9f9a.js b/compiler/tests-js-parser/pass/fffe7e78a7ce9f9a.js new file mode 100644 index 000000000..dbeef0905 --- /dev/null +++ b/compiler/tests-js-parser/pass/fffe7e78a7ce9f9a.js @@ -0,0 +1 @@ +/foobar/ \ No newline at end of file diff --git a/compiler/tests-js-parser/run.ml b/compiler/tests-js-parser/run.ml index 43c072aa2..9b4430fe8 100644 --- a/compiler/tests-js-parser/run.ml +++ b/compiler/tests-js-parser/run.ml @@ -1,45 +1,101 @@ open Js_of_ocaml_compiler open Stdlib +let exe = + match Sys.os_type with + | "Cygwin" | "Win32" -> fun x -> x ^ ".exe" + | "Unix" | _ -> fun x -> x + +let node = try Sys.getenv "NODE" with Not_found -> exe "node" + let failure_expected = ref false +let progress = ref false + +let verbose = ref false + let flags, files = Sys.argv |> Array.to_list |> List.tl |> List.partition ~f:(fun x -> Char.equal (String.get x 0) '-') +let rec ls_files path = + match Unix.lstat path with + | { st_kind = S_DIR; _ } -> + Sys.readdir path + |> Array.to_list + |> List.concat_map ~f:(fun name -> ls_files (Filename.concat path name)) + | { st_kind = S_REG; _ } -> [ path ] + | { st_kind = S_CHR | S_BLK | S_LNK | S_FIFO | S_SOCK; _ } -> [] + +let files = + List.concat_map files ~f:(fun path -> + let l = ls_files path in + List.filter l ~f:(fun name -> Filename.check_suffix name ".js")) + +let () = if !verbose then Printf.eprintf "Found %d files\n%!" (List.length files) + let () = List.iter flags ~f:(function - | "-fail" -> failure_expected := true + | "--fail" -> failure_expected := true + | "-p" | "--progress" -> progress := true + | "-v" | "--verbose" -> verbose := true | f -> failwith ("unrecognised flag " ^ f)) -let unsupported_syntax = ref [] +type error = + | Diff of Javascript.program * Javascript.program + | Print_parse of Parse_info.t * string + | Parse of Parse_info.t * string + | Parse_warning of Parse_js.Lexer.error list + | Tok_missmatch of string + +let unsupported = ref [] + +let negative = ref [] + +let noStrict = ref [] let fail = ref [] let pass = ref [] -let rs = - [ Str.regexp_string "import" - ; Str.regexp_string "export" - ; Str.regexp_string "with" - ; Str.regexp_string "" - ] - -let has_unsupported_syntax c = - List.exists rs ~f:(fun r -> - try - let (_ : int) = Str.search_forward r c 0 in - true - with Not_found -> false) +let normalize_string s = + let l = String.length s in + let b = Buffer.create (String.length s + 2) in + for i = 0 to l - 1 do + let c = s.[i] in + match c with + | '\000' when i = l - 1 || not (Char.is_num s.[i + 1]) -> Buffer.add_string b "\\0" + | '\b' -> Buffer.add_string b "\\b" + | '\t' -> Buffer.add_string b "\\t" + | '\n' -> Buffer.add_string b "\\n" + (* This escape sequence is not supported by IE < 9 + | '\011' -> "\\v" + *) + | '\012' -> Buffer.add_string b "\\f" + (* https://github.com/ocsigen/js_of_ocaml/issues/898 *) + | '/' when i > 0 && Char.equal s.[i - 1] '<' -> Buffer.add_string b "\\/" + | '\r' -> Buffer.add_string b "\\r" + | '\000' .. '\031' | '\127' -> + Buffer.add_string b "\\x"; + Buffer.add_char_hex b c + | _ -> Buffer.add_char b c + done; + Buffer.contents b class clean_loc = object - inherit Js_traverse.map + inherit Js_traverse.map as super + + method! parse_info _ = Parse_info.zero method! loc _ = N + + method! expression e = + match e with + | EStr (Utf8 x) -> EStr (Utf8_string.of_string_exn (normalize_string x)) + | e -> super#expression e end let clean_loc = new clean_loc @@ -52,74 +108,230 @@ let p_to_string p = let _ = Js_output.program pp p in Buffer.contents buffer -let patdiff = false +let accepted_by_node file = + let ((ic, oc, ec) as ic_oc) = + Unix.open_process_full (Printf.sprintf "%s --check %s" node file) [||] + in + let pid = Unix.process_full_pid ic_oc in + let _pid, status = Unix.waitpid [] pid in + close_in ic; + close_out oc; + close_in ec; + match status with + | WEXITED 0 -> true + | WEXITED _ -> false + | WSIGNALED _ | WSTOPPED _ -> assert false + +let should_ignore_feature = function + | "import-assertions" | "import-attributes" | "decorators" -> true + | _ -> false + +let should_ignore_flag = function + | "noStrict" -> true + | _ -> false + +let token_equal : Js_token.t -> Js_token.t -> bool = + fun a b -> + match a, b with + | T_SEMICOLON, T_VIRTUAL_SEMICOLON | T_VIRTUAL_SEMICOLON, T_SEMICOLON -> true + | T_DECR_NB, T_DECR | T_DECR, T_DECR_NB | T_INCR_NB, T_INCR | T_INCR, T_INCR_NB -> true + | T_IDENTIFIER (Utf8 a, _), T_IDENTIFIER (Utf8 b, _) -> String.equal a b + | T_STRING (Utf8 a, _), T_STRING (Utf8 b, _) -> + String.equal a b || String.equal (normalize_string a) (normalize_string b) + | a, T_IDENTIFIER (Utf8 b, _) when Poly.(Some a = Js_token.is_keyword b) -> true + | T_IDENTIFIER (Utf8 a, _), b when Poly.(Some b = Js_token.is_keyword a) -> true + | a, b -> Poly.(a = b) + +let rec check_toks + (a : (Js_token.t * _) list) + (stack_a : Js_token.t list) + (b : (Js_token.t * _) list) + (stack_b : Js_token.t list) : _ = + match a, b with + | ( ( ( TComment _ + | T_EOF + | T_LPAREN + | T_LPAREN_ARROW + | T_RPAREN + | T_SEMICOLON + | T_VIRTUAL_SEMICOLON + | T_COMMA ) + , _ ) + :: a + , b ) -> check_toks a stack_a b stack_b + | ( a + , ( ( TComment _ + | T_EOF + | T_LPAREN + | T_LPAREN_ARROW + | T_RPAREN + | T_SEMICOLON + | T_VIRTUAL_SEMICOLON + | T_COMMA ) + , _ ) + :: b ) -> check_toks a stack_a b stack_b + | (ta, loc_a) :: ra, (tb, _loc_b) :: rb -> + if token_equal ta tb + then check_toks ra stack_a rb stack_b + else + Error + (Printf.sprintf + "token mismatch (%d:%d) %s <> %s\n" + (Loc.line loc_a) + (Loc.column loc_a) + (Js_token.to_string ta) + (Js_token.to_string tb)) + | [], [] -> Ok () + | [], (tb, _) :: _rb -> + Error (Printf.sprintf "token mismatch vs %s\n" (Js_token.to_string tb)) + | (ta, _) :: _ra, [] -> + Error (Printf.sprintf "token mismatch %s vs \n" (Js_token.to_string ta)) + +let to_file p = + let s = p_to_string p in + let f, oc = Filename.open_temp_file "as" "WE" in + output_string oc s; + output_string oc "\n"; + close_out oc; + f + +let patdiff p1 p2 = + ignore (Sys.command (Printf.sprintf "patdiff %s %s" (to_file p1) (to_file p2))); + flush_all () -let vs_explicit = false +let print_loc_error (pi : Parse_info.t) c = + List.iteri (String.split_on_char ~sep:'\n' c) ~f:(fun i c -> + let diff = abs (i + 1 - pi.line) in + if diff = 0 + then ( + let b = Buffer.create (String.length c) in + String.fold_utf_8 c () ~f:(fun () i u -> + if i = pi.col then Buffer.add_utf_8_uchar b (Uchar.of_int 0x274C); + Buffer.add_utf_8_uchar b u); + Printf.eprintf "%s\n" (Buffer.contents b)) + else if diff < 5 + then Printf.eprintf "%s\n" c + else ()); + Printf.eprintf "\n" let () = - List.iter files ~f:(fun filename -> + let negative_r = Str.regexp_string "negative:" in + let features_r = Str.regexp {|features: ?\[\([a-zA-Z. ,-]*\)\]|} in + let flags_r = Str.regexp {|flags: ?\[\([a-zA-Z. ,-]*\)\]|} in + let total = List.length files in + List.iteri files ~f:(fun i filename -> + let () = if !progress then Printf.eprintf "%d/%d\r%!" i total in let ic = open_in_bin filename in let content = In_channel.input_all ic in + let errors = ref [] in let add r = r := (filename, content) :: !r in close_in ic; - try - let p1 = Parse_js.Lexer.of_string ~filename content |> Parse_js.parse in - if patdiff - then ( - let s = p_to_string (clean_loc p1) in - let jsoo_name = filename ^ ".jsoo" in - let oc = open_out_bin jsoo_name in - output_string oc s; - close_out oc; - let _ret = Sys.command (Printf.sprintf "patdiff %s %s" filename jsoo_name) in - ()); - (if vs_explicit - then - try - let explicit = - Filename.( - concat - (concat (dirname (dirname filename)) "pass-explicit") - (basename filename)) - in - let ic = open_in_bin explicit in - let content = In_channel.input_all ic in - close_in ic; - let p2 = - Parse_js.Lexer.of_string ~filename:explicit content |> Parse_js.parse - in - let p1 = clean_loc p1 and p2 = clean_loc p2 in - let p1s = p_to_string p1 and p2s = p_to_string p2 in - if Poly.(p1 <> p2) - then ( - Printf.printf ">>>>>>> MISMATCH %s <<<<<<<<<<\n" filename; - Printf.printf "%s\n\n%s\n" p1s p2s) - with _ -> ()); - add pass - with Parse_js.Parsing_error loc -> - if has_unsupported_syntax content - then add unsupported_syntax - else fail := (filename, loc, content) :: !fail); + let mode = + match Str.search_forward negative_r content 0 with + | _ -> `Negative + | exception Not_found -> ( + let features = + match Str.search_forward features_r content 0 with + | _ -> + String.split_on_char ~sep:',' (Str.matched_group 1 content) + |> List.map ~f:String.trim + | exception Not_found -> [] + in + let flags = + match Str.search_forward flags_r content 0 with + | _ -> + String.split_on_char ~sep:',' (Str.matched_group 1 content) + |> List.map ~f:String.trim + | exception Not_found -> [] + in + match List.find_opt ~f:should_ignore_feature features with + | Some f -> `Unsupported f + | None -> ( + match List.find_opt ~f:should_ignore_flag flags with + | Some f -> `Unsupported f + | None -> `Ok)) + in + match mode with + | `Negative -> negative := filename :: !negative + | `Unsupported "noStrict" -> noStrict := filename :: !noStrict + | `Unsupported _ -> unsupported := (filename, content) :: !unsupported + | `Ok -> ( + try + let p1, toks1 = + Parse_js.Lexer.of_string + ~report_error:(fun e -> errors := e :: !errors) + ~filename + content + |> Parse_js.parse' + in + let p1 = List.concat_map p1 ~f:snd in + match List.rev !errors with + | [] -> ( + let s = p_to_string p1 in + try + let p2, toks2 = + Parse_js.Lexer.of_string + ~report_error:(fun e -> errors := e :: !errors) + ~filename + s + |> Parse_js.parse' + in + let p2 = List.concat_map p2 ~f:snd in + match + Poly.(clean_loc p1 = clean_loc p2), check_toks toks1 [] toks2 [] + with + | true, Error s when false -> + fail := (Tok_missmatch s, filename) :: !fail + | true, _ -> add pass + | false, _ -> fail := (Diff (p1, p2), filename) :: !fail + with Parse_js.Parsing_error loc -> + if not (accepted_by_node filename) + then add unsupported + else fail := (Print_parse (loc, s), filename) :: !fail) + | l -> + if accepted_by_node filename + then fail := (Parse_warning l, filename) :: !fail + with + | Parse_js.Parsing_error loc -> + if not (accepted_by_node filename) + then add unsupported + else fail := (Parse (loc, content), filename) :: !fail + | e -> + Printf.eprintf "Unexpected error %s\n%s\n" filename (Printexc.to_string e))); Printf.printf "Summary:\n"; - Printf.printf " skip : %d\n" (List.length !unsupported_syntax); - Printf.printf " fail : %d\n" (List.length !fail); - Printf.printf " pass : %d\n" (List.length !pass); + Printf.printf " invalid : %d\n" (List.length !negative); + Printf.printf " not scrict : %d\n" (List.length !noStrict); + Printf.printf " skip : %d\n" (List.length !unsupported); + Printf.printf " fail : %d\n" (List.length !fail); + Printf.printf " pass : %d\n" (List.length !pass); + flush_all (); let l = !fail in if !failure_expected - then + then ( List.iter !pass ~f:(fun (f, c) -> Printf.printf "succeded to parse %s\n" f; - Printf.printf "%s\n\n" c) - else - List.iter l ~f:(fun (f, (pi : Parse_info.t), c) -> - Printf.printf "failed to parse %s:%d:%d\n" f pi.line pi.col; - List.iteri (String.split_on_char ~sep:'\n' c) ~f:(fun i c -> - if i + 1 = pi.line - then ( - let b = Buffer.create (String.length c) in - String.fold_utf_8 c () ~f:(fun () i u -> - if i = pi.col then Buffer.add_utf_8_uchar b (Uchar.of_int 0x274C); - Buffer.add_utf_8_uchar b u); - Printf.printf "%s\n" (Buffer.contents b)) - else Printf.printf "%s\n" c); - Printf.printf "\n") + Printf.printf "%s\n\n" c); + match !pass with + | [] -> exit 0 + | _ -> exit 1) + else ( + List.iter l ~f:(fun (reason, f) -> + match reason with + | Parse (pi, content) -> + Printf.eprintf ": Parse_error: %s:%d:%d\n" f pi.line pi.col; + print_loc_error pi content + | Print_parse (pi, content) -> + Printf.eprintf ": Parse_error(roundtrip): %s:%d:%d\n" f pi.line pi.col; + print_loc_error pi content + | Diff (p1, p2) -> + Printf.eprintf ": Diff: %s\n%!" f; + patdiff p1 p2 + | Parse_warning l -> + Printf.eprintf ": Lexer warning: %s\n" f; + List.iter l ~f:Parse_js.Lexer.print_error + | Tok_missmatch s -> + Printf.eprintf ": Tok mismatch: %s\n" f; + Printf.eprintf "%s\n" s); + match !fail with + | [] -> exit 0 + | _ -> exit 1) diff --git a/compiler/tests-jsoo/bin/dune b/compiler/tests-jsoo/bin/dune index c92e95460..3cadcdb3e 100644 --- a/compiler/tests-jsoo/bin/dune +++ b/compiler/tests-jsoo/bin/dune @@ -1,15 +1,15 @@ (executables - (names error1 error2 error3) + (names error1 error2) (modes exe js) (foreign_stubs (language c) (names named_value_stubs)) (js_of_ocaml (javascript_files runtime.js)) - (libraries js_of_ocaml)) + (libraries)) (rule - (target error1.actual) + (target error1.js.actual) (deps error1.html) (alias runtest) (action @@ -20,12 +20,27 @@ (run node %{dep:error1.bc.js}))))) (rule + (target error1.exe.actual) (alias runtest) (action - (diff %{dep:error1.expected} %{dep:error1.actual}))) + (with-accepted-exit-codes + 2 + (with-outputs-to + %{target} + (run %{dep:error1.exe}))))) (rule - (target error1-unregister.actual) + (alias runtest) + (action + (diff %{dep:error1.expected} %{dep:error1.js.actual}))) + +(rule + (alias runtest) + (action + (diff %{dep:error1.expected} %{dep:error1.exe.actual}))) + +(rule + (target error1-unregister.js.actual) (deps error1-unregister.html) (alias runtest) (action @@ -38,10 +53,10 @@ (rule (alias runtest) (action - (diff %{dep:error1-unregister.expected} %{dep:error1-unregister.actual}))) + (diff %{dep:error1-unregister.expected} %{dep:error1-unregister.js.actual}))) (rule - (target error2.actual) + (target error2.js.actual) (deps error2.html) (alias runtest) (action @@ -52,48 +67,41 @@ (run node %{dep:error2.bc.js}))))) (rule - (alias runtest) - (enabled_if - (= %{profile} dev)) - (action - (diff %{dep:error2.expected} %{dep:error2.actual}))) - -(rule - (target error2-unregister.actual) - (deps error2-unregister.html) + (target error2.exe.actual) (alias runtest) (action (with-accepted-exit-codes 2 (with-outputs-to %{target} - (run node %{dep:error2.bc.js} unregister))))) + (run %{dep:error2.exe}))))) (rule (alias runtest) + (enabled_if + (= %{profile} dev)) (action - (diff %{dep:error2-unregister.expected} %{dep:error2-unregister.actual}))) + (diff %{dep:error2.expected} %{dep:error2.js.actual}))) -;; We don't expect the output of error3 as it will be flacky +(rule + (alias runtest) + (enabled_if + (= %{profile} dev)) + (action + (diff %{dep:error2.expected} %{dep:error2.exe.actual}))) (rule - (target error3.actual) - (deps error3.html) + (target error2-unregister.js.actual) + (deps error2-unregister.html) (alias runtest) (action (with-accepted-exit-codes - 7 + 2 (with-outputs-to %{target} - (run node %{dep:error3.bc.js}))))) + (run node %{dep:error2.bc.js} unregister))))) (rule - (target error3-unregister.actual) - (deps error3-unregister.html) (alias runtest) (action - (with-accepted-exit-codes - 7 - (with-outputs-to - %{target} - (run node %{dep:error3.bc.js} unregister))))) + (diff %{dep:error2-unregister.expected} %{dep:error2-unregister.js.actual}))) diff --git a/compiler/tests-jsoo/bin/error3.html b/compiler/tests-jsoo/bin/error3.html deleted file mode 100644 index f6770ca91..000000000 --- a/compiler/tests-jsoo/bin/error3.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Error 1 - - - - - diff --git a/compiler/tests-jsoo/bin/error3.ml b/compiler/tests-jsoo/bin/error3.ml deleted file mode 100644 index 6fe0faee9..000000000 --- a/compiler/tests-jsoo/bin/error3.ml +++ /dev/null @@ -1,8 +0,0 @@ -external unregister : string -> unit = "caml_unregister_named_value" - -let () = - match Array.to_list Sys.argv with - | _ :: "unregister" :: _ -> unregister "Printexc.handle_uncaught_exception" - | _ -> () - -let _ = (Obj.magic Js_of_ocaml.Js.null : int -> int -> unit) 1 2 diff --git a/compiler/tests-jsoo/dune b/compiler/tests-jsoo/dune index 2f274f5d8..711186b48 100644 --- a/compiler/tests-jsoo/dune +++ b/compiler/tests-jsoo/dune @@ -1,6 +1,30 @@ +(library + (name jsoo_testsuite_latest) + (modules test_io test_floats) + (libraries unix compiler-libs.common js_of_ocaml-compiler) + (enabled_if + (>= %{ocaml_version} 4.14)) + (inline_tests + (modes js best)) + (preprocess + (pps ppx_expect))) + +(library + (name jsoo_testsuite_compression) + (modules test_marshal_compressed) + (libraries unix compiler-libs.common js_of_ocaml-compiler) + (enabled_if + (>= %{ocaml_version} 5.1.1)) + (inline_tests + (modes js best)) + (preprocess + (pps ppx_expect))) + (library (name jsoo_testsuite) - (libraries unix compiler-libs.common) + (modules + (:standard \ test_io test_floats test_marshal_compressed)) + (libraries unix compiler-libs.common js_of_ocaml-compiler) (foreign_stubs (language c) (names bigarray_stubs flush_stubs)) diff --git a/compiler/tests-jsoo/flush_stubs.c b/compiler/tests-jsoo/flush_stubs.c index 006fcf819..099b0927d 100644 --- a/compiler/tests-jsoo/flush_stubs.c +++ b/compiler/tests-jsoo/flush_stubs.c @@ -4,6 +4,7 @@ #include "caml/memory.h" CAMLprim value flush_stdout_stderr (value unit) { + (void)unit; CAMLparam0 (); /* v is ignored */ fflush(stderr); fflush(stdout); diff --git a/compiler/tests-jsoo/test_gc.ml b/compiler/tests-jsoo/test_gc.ml new file mode 100644 index 000000000..454dc750e --- /dev/null +++ b/compiler/tests-jsoo/test_gc.ml @@ -0,0 +1,57 @@ +(* Js_of_ocaml compiler + * http://www.ocsigen.org/js_of_ocaml/ + * Copyright (C) 2023 Hugo Heuzard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +let print_bool b = print_endline (string_of_bool b) + +let ocaml_version = + match String.split_on_char '.' Sys.ocaml_version with + | major :: minor :: _ -> + let major = int_of_string major and minor = int_of_string minor in + major, minor + | _ -> assert false + +let ok () = print_endline "OK" + +let ko size = Printf.printf "size=%d, ocaml_version=%s" size Sys.ocaml_version + +let%expect_test "stat" = + let s = Gc.stat () in + let size = Obj.size (Obj.repr s) in + (match size with + | 17 when ocaml_version >= (4, 12) -> ok () + | 16 when ocaml_version < (4, 12) -> ok () + | _ -> ko size); + [%expect {| OK |}] + +let%expect_test "quick_stat" = + let s = Gc.quick_stat () in + let size = Obj.size (Obj.repr s) in + (match size with + | 17 when ocaml_version >= (4, 12) -> ok () + | 16 when ocaml_version < (4, 12) -> ok () + | _ -> ko size); + [%expect {| OK |}] + +let%expect_test "control" = + let s = Gc.get () in + let size = Obj.size (Obj.repr s) in + (match size with + | 11 when ocaml_version >= (4, 8) -> ok () + | _ -> ko size); + [%expect {| OK |}] diff --git a/compiler/tests-jsoo/test_ints.ml b/compiler/tests-jsoo/test_ints.ml index 2a7a56f14..e0d2bd141 100644 --- a/compiler/tests-jsoo/test_ints.ml +++ b/compiler/tests-jsoo/test_ints.ml @@ -46,3 +46,13 @@ let%expect_test _ = [%expect {| -123 |}]; Printf.printf "%d\n" (int_of_string "-0U123"); [%expect {| -123 |}] + +let%expect_test _ = + Printf.printf "%ld\n" (Int32.of_string "-0u2147483648"); + [%expect {| -2147483648 |}]; + Printf.printf "%ld\n" (Int32.of_string "-0u2147483648"); + [%expect {| -2147483648 |}]; + Printf.printf "%ld\n" (Int32.of_string "0u2147483648"); + [%expect {| -2147483648 |}]; + Printf.printf "%ld\n" (Int32.of_string "0u2147483648"); + [%expect {| -2147483648 |}] diff --git a/compiler/tests-jsoo/test_marshal.ml b/compiler/tests-jsoo/test_marshal.ml index 734f0c214..4e9759d64 100644 --- a/compiler/tests-jsoo/test_marshal.ml +++ b/compiler/tests-jsoo/test_marshal.ml @@ -134,27 +134,6 @@ let%expect_test _ = [%expect {| "\132\149\166\190\000\000\000'\000\000\000\001\000\000\000\007\000\000\000\007\024_bigarr02\000\000\000\000\020\000\000\000\000\000\000\000(\000\000\000\001\000\000\000\005\000\003\000\003\000\001\000\002" |}] -let%expect_test _ = - let data = - "\132\149\166\189\r\022\206\021\001\147F\137d(\181/\253\000Xm\000\0000\n\ - \000\000'\016c\001\000\012\135\007E" - in - let ocaml_5_1 = - match String.split_on_char '.' Sys.ocaml_version with - | major :: minor :: _ -> - let major = int_of_string major and minor = int_of_string minor in - major > 5 || (major = 5 && minor >= 1) - | _ -> assert false - in - let s = - match Sys.backend_type with - | Other "js_of_ocaml" -> Marshal.from_string data 0 - | Other _ | Native | Bytecode -> - if ocaml_5_1 then Marshal.from_string data 0 else String.make 10000 'c' - in - Printf.printf "%s ... (%d)\n" (String.sub s 0 20) (String.length s); - [%expect {| cccccccccccccccccccc ... (10000) |}] - let%expect_test "test sharing of string" = let s = "AString" in let p = s, s in @@ -165,3 +144,27 @@ let%expect_test "test sharing of string" = Printf.printf "%S" (Marshal.to_string obj []); [%expect {| "\132\149\166\190\000\000\000\016\000\000\000\004\000\000\000\012\000\000\000\011\160\160'AString\004\001\160\004\003@" |}] + +let%expect_test "test float" = + let s = 3.14 in + let p = s, s in + let obj = [ p; p ] in + let r1 = Marshal.to_string s [ No_sharing ] in + Printf.printf "%S\n" r1; + Printf.printf "%f" (Marshal.from_string r1 0); + [%expect + {| + "\132\149\166\190\000\000\000\t\000\000\000\000\000\000\000\003\000\000\000\002\012\031\133\235Q\184\030\t@" + 3.140000 |}]; + let r2 = Marshal.to_string obj [] in + Printf.printf "%S\n" r2; + let a, b, c, d = + match Marshal.from_string r2 0 with + | [ (a, b); (c, d) ] -> a, b, c, d + | _ -> assert false + in + Printf.printf "%f %f %f %f" a b c d; + [%expect + {| + "\132\149\166\190\000\000\000\017\000\000\000\004\000\000\000\012\000\000\000\011\160\160\012\031\133\235Q\184\030\t@\004\001\160\004\003@" + 3.140000 3.140000 3.140000 3.140000 |}] diff --git a/compiler/tests-jsoo/test_marshal_compressed.ml b/compiler/tests-jsoo/test_marshal_compressed.ml new file mode 100644 index 000000000..3f7a9ca73 --- /dev/null +++ b/compiler/tests-jsoo/test_marshal_compressed.ml @@ -0,0 +1,31 @@ +(* Js_of_ocaml tests + * http://www.ocsigen.org/js_of_ocaml/ + * Copyright (C) 2019 Shachar Itzhaky + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) + +let%expect_test _ = + let data = + "\132\149\166\189\r\022\206\021\001\147F\137d(\181/\253\000Xm\000\0000\n\ + \000\000'\016c\001\000\012\135\007E" + in + let s = + if Compression.compression_supported + then Marshal.from_string data 0 + else String.make 10000 'c' + in + Printf.printf "%s ... (%d)\n" (String.sub s 0 20) (String.length s); + [%expect {| cccccccccccccccccccc ... (10000) |}] diff --git a/compiler/tests-jsoo/test_rec_mod.ml b/compiler/tests-jsoo/test_rec_mod.ml index e0a4af966..950b98d91 100644 --- a/compiler/tests-jsoo/test_rec_mod.ml +++ b/compiler/tests-jsoo/test_rec_mod.ml @@ -17,6 +17,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) +open Js_of_ocaml_compiler.Stdlib + (* https://github.com/ocaml/ocaml/pull/9497 *) (* Original test case from the issue: *) @@ -36,7 +38,9 @@ let%expect_test _ = ignore (IdSet.mem { id = 1 } basic_set : bool) (* diverge here *) with e -> - assert (String.ends_with ~suffix:"Undefined recursive module" (Printexc.to_string e)) + if String.is_suffix ~suffix:"Undefined recursive module" (Printexc.to_string e) + then () + else raise e (* Looping version *) module rec M1 : sig diff --git a/compiler/tests-jsoo/test_time.ml b/compiler/tests-jsoo/test_time.ml index b291e9e6a..85824c398 100644 --- a/compiler/tests-jsoo/test_time.ml +++ b/compiler/tests-jsoo/test_time.ml @@ -17,9 +17,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) +open Js_of_ocaml_compiler.Stdlib + let%expect_test _ = let f = Unix.time () in - let z, _integral = Float.modf f in + let z, _integral = modf f in match Float.classify_float f, Float.classify_float z with | FP_normal, FP_zero -> () | _ -> assert false @@ -49,7 +51,7 @@ let%expect_test _ = assert ( String.length s > 0 && String.for_all - (function + ~f:(function | '0' .. '9' | ' ' -> true | _ -> false) s) diff --git a/compiler/tests-linkall/dune b/compiler/tests-linkall/dune new file mode 100644 index 000000000..23747dc90 --- /dev/null +++ b/compiler/tests-linkall/dune @@ -0,0 +1,29 @@ +;; Test that separate compilation behave correctly in presence of pack + +(env + (_ + (js_of_ocaml + (compilation_mode separate)))) + +(executable + (name test) + (modes byte js) + (libraries dynlink) + ;; It doesn't seem possible to create a pack-ed module with dune. + ;; However, dynlink uses pack to embed a copy + ;; of the compiler up until OCaml 5.2. + ;; Let's use it for the test + (link_flags + (:standard -linkall))) + +(rule + (target test.output) + (action + (with-stdout-to + %{target} + (run node %{dep:test.bc.js})))) + +(rule + (alias runtest) + (action + (diff test.reference test.output))) diff --git a/compiler/tests-linkall/test.ml b/compiler/tests-linkall/test.ml new file mode 100644 index 000000000..5dba922ce --- /dev/null +++ b/compiler/tests-linkall/test.ml @@ -0,0 +1 @@ +print_endline "hello world" diff --git a/compiler/tests-linkall/test.reference b/compiler/tests-linkall/test.reference new file mode 100644 index 000000000..3b18e512d --- /dev/null +++ b/compiler/tests-linkall/test.reference @@ -0,0 +1 @@ +hello world diff --git a/compiler/tests-ocaml/lib-digest/digests.ml b/compiler/tests-ocaml/lib-digest/digests.ml new file mode 100644 index 000000000..2d0f653c2 --- /dev/null +++ b/compiler/tests-ocaml/lib-digest/digests.ml @@ -0,0 +1,76 @@ +(* TEST +*) + +module Test(H: Digest.S) = struct + + let string (msg, hh) = + if not ( (H.(equal (string msg) (of_hex hh)))) + then ( + Printf.printf "Expecting %S\ + \nGot %S\n" hh (H.to_hex (H.string msg)); assert false) + + let file wlen rlen = + let data = String.init wlen Char.unsafe_chr in + Out_channel.with_open_bin "data.tmp" + (fun oc -> Out_channel.output_string oc data); + let h1 = H.file "data.tmp" in + assert (H.equal h1 (H.string data)); + let h2 = + In_channel.with_open_bin "data.tmp" + (fun ic -> H.channel ic rlen) in + assert (H.equal h2 (H.substring data 0 rlen)); + Sys.remove "data.tmp" + + let run_tests tests = + List.iter string tests; + file 100 99; + file 100_000 10_000 +end + +(* Test inputs *) + +let in1 = "" +let in2 = "a" +let in3 = "abc" +let in4 = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno\ + ijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu" +let in5 = String.make 100_000 'a' + +(* Test vectors *) + +module TestMD5 = Test(Digest.MD5) +let _ = TestMD5.run_tests + [in1, "d41d8cd98f00b204e9800998ecf8427e"; + in2, "0cc175b9c0f1b6a831c399e269772661"; + in3, "900150983cd24fb0d6963f7d28e17f72"; + in4, "03dd8807a93175fb062dfb55dc7d359c"; + in5, "1af6d6f2f682f76f80e606aeaaee1680"] + +module TestBLAKE512 = Test(Digest.BLAKE512) +let _ = TestBLAKE512.run_tests + [in1, "786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419\ + d25e1031afee585313896444934eb04b903a685b1448b755d56f701afe9be2ce"; + in2, "333fcb4ee1aa7c115355ec66ceac917c8bfd815bf7587d325aec1864edd24e34\ + d5abe2c6b1b5ee3face62fed78dbef802f2a85cb91d455a8f5249d330853cb3c"; + in3, "ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d1\ + 7d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923"; + in4, "ce741ac5930fe346811175c5227bb7bfcd47f42612fae46c0809514f9e0e3a11\ + ee1773287147cdeaeedff50709aa716341fe65240f4ad6777d6bfaf9726e5e52"; + in5, "fe89a110a412012e7cc5c0e05b03b48a6b9d0ba108187826c5ac82ce7aa45e7e\ + 31b054979ec8ca5acd0bcc85f379d848f90f9d1593358cba8d88c7cd94ea8eee"] + +module TestBLAKE256 = Test(Digest.BLAKE256) +let _ = TestBLAKE256.run_tests + [in1, "0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8"; + in2, "8928aae63c84d87ea098564d1e03ad813f107add474e56aedd286349c0c03ea4"; + in3, "bddd813c634239723171ef3fee98579b94964e3bb1cb3e427262c8c068d52319"; + in4, "90a0bcf5e5a67ac1578c2754617994cfc248109275a809a0721feebd1e918738"; + in5, "b717c86cf745507ec5373f12f21350eb8550039b4263f7ba6e8df9030b5673c6"] + +module TestBLAKE128 = Test(Digest.BLAKE128) +let _ = TestBLAKE128.run_tests + [in1, "cae66941d9efbd404e4d88758ea67670"; + in2, "27c35e6e9373877f29e562464e46497e"; + in3, "cf4ab791c62b8d2b2109c90275287816"; + in4, "8fa81cd08c10a6e4dd94583e6fb48c2f"; + in5, "5c4b4b762807b3290e7eee0aa9b18655"] diff --git a/compiler/tests-ocaml/lib-digest/dune b/compiler/tests-ocaml/lib-digest/dune index 61a173c08..e68a7bae9 100644 --- a/compiler/tests-ocaml/lib-digest/dune +++ b/compiler/tests-ocaml/lib-digest/dune @@ -1,6 +1,7 @@ (executables (names md5) (libraries) + (modules md5) (modes js)) (rule @@ -16,3 +17,19 @@ (deps md5.reference md5.referencejs) (action (diff md5.reference md5.referencejs))) + +(executables + (names digests) + (libraries) + (enabled_if + (>= %{ocaml_version} 5.2)) + (modules digests) + (modes js)) + +(rule + (alias runtest) + (deps digests.bc.js) + (enabled_if + (>= %{ocaml_version} 5.2)) + (action + (run node ./digests.bc.js))) diff --git a/compiler/tests-ocaml/lib-effects/effects.ml b/compiler/tests-ocaml/lib-effects/effects.ml index f49a58573..4a78648b3 100644 --- a/compiler/tests-ocaml/lib-effects/effects.ml +++ b/compiler/tests-ocaml/lib-effects/effects.ml @@ -178,7 +178,7 @@ let invert (type a) ~(iter : (a -> unit) -> unit) : a Seq.t = | M.Yield v -> Some (fun (k: (b,_) continuation) -> Seq.Cons (v, continue k)) | _ -> None } - + let s = invert ~iter:(Fun.flip String.iter "OCaml") let next = Seq.to_dispenser s;; diff --git a/compiler/tests-ocaml/lib-format/dune b/compiler/tests-ocaml/lib-format/dune index 390e3acfb..cd96782a0 100644 --- a/compiler/tests-ocaml/lib-format/dune +++ b/compiler/tests-ocaml/lib-format/dune @@ -2,7 +2,7 @@ (names pr6824 print_if_newline pp_print_custom_break print_seq tformat) (libraries) (flags - (:standard \ -strict-formats)) + (:standard -no-strict-formats \ -strict-formats)) (modes js)) (rule diff --git a/compiler/tests-ocaml/lib-gc/test_gc.ml b/compiler/tests-ocaml/lib-gc/test_gc.ml index 00368abc1..eb0572d27 100644 --- a/compiler/tests-ocaml/lib-gc/test_gc.ml +++ b/compiler/tests-ocaml/lib-gc/test_gc.ml @@ -1,6 +1,6 @@ (* TEST *) -type stat = Gc.stat = +type stat = { minor_words : float; promoted_words : float; major_words : float; @@ -17,7 +17,8 @@ type stat = Gc.stat = compactions : int; top_heap_words : int; stack_size: int; - forced_major_collections: int} + forced_major_collections: int + } type control = { minor_heap_size : int; diff --git a/compiler/tests-ocaml/lib-printf/dune b/compiler/tests-ocaml/lib-printf/dune index 5cf5bcb10..766ae6ff8 100644 --- a/compiler/tests-ocaml/lib-printf/dune +++ b/compiler/tests-ocaml/lib-printf/dune @@ -2,7 +2,7 @@ (names pr6534 pr6938 tprintf) (libraries) (flags - (:standard \ -strict-formats)) + (:standard -no-strict-formats \ -strict-formats)) (modes js (best exe))) diff --git a/compiler/tests-sourcemap/dune b/compiler/tests-sourcemap/dune index acc9ebe61..e690f5a3e 100644 --- a/compiler/tests-sourcemap/dune +++ b/compiler/tests-sourcemap/dune @@ -21,10 +21,7 @@ (rule (target dump) (enabled_if - (and - (<> %{profile} using-effects) - (<> %{profile} wasm) - (<> %{profile} wasm-effects))) + (= %{profile} dev)) (action (with-stdout-to %{target} @@ -33,10 +30,7 @@ (rule (alias runtest) (enabled_if - (and - (<> %{profile} using-effects) - (<> %{profile} wasm) - (<> %{profile} wasm-effects))) + (= %{profile} dev)) (deps dump.reference dump) (action (diff dump.reference dump))) diff --git a/compiler/tests-toplevel/test_toplevel.ml b/compiler/tests-toplevel/test_toplevel.ml index e35a3ea90..4b1999537 100644 --- a/compiler/tests-toplevel/test_toplevel.ml +++ b/compiler/tests-toplevel/test_toplevel.ml @@ -14,11 +14,12 @@ let y = float 1 /. float 3;; let lexbuf = Lexing.from_string content in while true do try + Location.reset (); let phr = !Toploop.parse_toplevel_phrase lexbuf in - if not (Toploop.execute_phrase true Format.std_formatter phr) then raise Exit + let res = Toploop.execute_phrase true Format.std_formatter phr in + flush_all (); + if not res then raise Exit with - | End_of_file -> - flush_all (); - exit 0 + | End_of_file -> exit 0 | x -> Location.report_exception Format.std_formatter x done diff --git a/dune-project b/dune-project index a878900ca..c9d84a322 100644 --- a/dune-project +++ b/dune-project @@ -18,7 +18,7 @@ (description "Js_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes it possible to run pure OCaml programs in JavaScript environment like browsers and Node.js") (depends - (ocaml (and (>= 4.08) (< 5.1))) + (ocaml (and (>= 4.08) (< 5.3))) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) (ppxlib (>= 0.15.0)) @@ -96,7 +96,7 @@ (graphics :with-test) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) - (ppxlib (and (>= 0.15) :with-test)) + (ppxlib (and (>= 0.15))) (re (and (>= 1.9.0) :with-test)) )) @@ -109,7 +109,7 @@ (ocaml (>= 4.08)) (js_of_ocaml (= :version)) (js_of_ocaml-ppx (= :version)) - (react (>= 1.2.1)) + (react (>= 1.2.2)) (reactiveData (>= 0.2)) (tyxml (>= 4.6)) (num :with-test) diff --git a/examples/hyperbolic/hypertree.ml b/examples/hyperbolic/hypertree.ml index 80ed2b63f..aacebb611 100644 --- a/examples/hyperbolic/hypertree.ml +++ b/examples/hyperbolic/hypertree.ml @@ -104,9 +104,9 @@ let outside_color = Js.string (*"#0c1a0d"*) "#070718" let option var = Js.Optdef.get var (fun () -> Js.Unsafe.coerce (new%js Js.array_empty)) class type style = object - method border : Js.number Js.t Js.optdef Js.readonly_prop + method border : Js.number_t Js.optdef Js.readonly_prop - method padding : Js.number Js.t Js.optdef Js.readonly_prop + method padding : Js.number_t Js.optdef Js.readonly_prop method backgroundColor : Js.js_string Js.t Js.optdef Js.readonly_prop diff --git a/examples/test_wheel/test_wheel.ml b/examples/test_wheel/test_wheel.ml index 84ef89267..635ca1f7a 100644 --- a/examples/test_wheel/test_wheel.ml +++ b/examples/test_wheel/test_wheel.ml @@ -21,9 +21,9 @@ let () = let wheelDelta = event##.wheelDelta in let wheelDeltaX = event##.wheelDeltaX in let wheelDeltaY = event##.wheelDeltaY in - Printf.printf "deltaX: %f; " deltaX; - Printf.printf "deltaY: %f; " deltaY; - Printf.printf "deltaZ: %f; " deltaZ; + Printf.printf "deltaX: %f; " (Js.to_float deltaX); + Printf.printf "deltaY: %f; " (Js.to_float deltaY); + Printf.printf "deltaZ: %f; " (Js.to_float deltaZ); Printf.printf "deltaMode: %s; " (match deltaMode with diff --git a/js_of_ocaml-compiler.opam b/js_of_ocaml-compiler.opam index cf0554034..217878193 100644 --- a/js_of_ocaml-compiler.opam +++ b/js_of_ocaml-compiler.opam @@ -12,8 +12,8 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.17"} - "ocaml" {>= "4.08" & < "5.1"} + "dune" {>= "3.7"} + "ocaml" {>= "4.08" & < "5.3"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} "ppxlib" {>= "0.15.0"} diff --git a/js_of_ocaml-toplevel.opam b/js_of_ocaml-toplevel.opam index 6ab981807..c1423b680 100644 --- a/js_of_ocaml-toplevel.opam +++ b/js_of_ocaml-toplevel.opam @@ -20,7 +20,7 @@ depends: [ "graphics" {with-test} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} - "ppxlib" {>= "0.15" & with-test} + "ppxlib" {>= "0.15"} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ] diff --git a/js_of_ocaml-tyxml.opam b/js_of_ocaml-tyxml.opam index 4b3062e6a..7f7af606f 100644 --- a/js_of_ocaml-tyxml.opam +++ b/js_of_ocaml-tyxml.opam @@ -16,7 +16,7 @@ depends: [ "ocaml" {>= "4.08"} "js_of_ocaml" {= version} "js_of_ocaml-ppx" {= version} - "react" {>= "1.2.1"} + "react" {>= "1.2.2"} "reactiveData" {>= "0.2"} "tyxml" {>= "4.6"} "num" {with-test} diff --git a/lib/gen_stubs/gen_stubs.ml b/lib/gen_stubs/gen_stubs.ml index a728f432b..190780b53 100644 --- a/lib/gen_stubs/gen_stubs.ml +++ b/lib/gen_stubs/gen_stubs.ml @@ -20,10 +20,11 @@ module String_set = Set.Make (String) let print_stub s = Printf.printf - "void %s () {\n\ - \ fprintf(stderr, \"Unimplemented Javascript primitive %s!\\n\");\n\ - \ exit(1);\n\ - }\n" + {| +void %s () { + caml_fatal_error("Unimplemented Javascript primitive %s!"); +} +|} s s @@ -62,6 +63,5 @@ let () = let except_mls = get_externals !except_mls in let externals = String_set.diff mls except_mls in set_binary_mode_out stdout true; - print_endline "#include "; - print_endline "#include "; + print_endline "#include "; String_set.iter print_stub externals diff --git a/lib/js_of_ocaml/js.mli b/lib/js_of_ocaml/js.mli index 183692ddd..cdaf7ad8f 100644 --- a/lib/js_of_ocaml/js.mli +++ b/lib/js_of_ocaml/js.mli @@ -218,6 +218,7 @@ val nfkc : normalization t (** Compatibility Decomposition, followed by Canonical Composition *) (** Specification of Javascript number objects. *) + class type number = object method toString : js_string t meth diff --git a/lib/js_of_ocaml/js_of_ocaml_stubs.c b/lib/js_of_ocaml/js_of_ocaml_stubs.c index f1ed497ad..292c88f08 100644 --- a/lib/js_of_ocaml/js_of_ocaml_stubs.c +++ b/lib/js_of_ocaml/js_of_ocaml_stubs.c @@ -1,38 +1,37 @@ -#include -#include +#include + void caml_bytes_of_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_bytes_of_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_bytes_of_array!"); } + void caml_custom_identifier () { - fprintf(stderr, "Unimplemented Javascript primitive caml_custom_identifier!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_custom_identifier!"); } + void caml_js_error_of_exception () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_error_of_exception!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_error_of_exception!"); } + void caml_js_get_console () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_get_console!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_get_console!"); } + void caml_js_html_entities () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_html_entities!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_html_entities!"); } + void caml_js_html_escape () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_html_escape!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_html_escape!"); } + void caml_js_on_ie () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_on_ie!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_on_ie!"); } + void caml_uint8_array_of_bytes () { - fprintf(stderr, "Unimplemented Javascript primitive caml_uint8_array_of_bytes!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_uint8_array_of_bytes!"); } + void caml_xmlhttprequest_create () { - fprintf(stderr, "Unimplemented Javascript primitive caml_xmlhttprequest_create!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_xmlhttprequest_create!"); } diff --git a/lib/js_of_ocaml/json.ml b/lib/js_of_ocaml/json.ml index 7ee702ed9..fb525fb32 100644 --- a/lib/js_of_ocaml/json.ml +++ b/lib/js_of_ocaml/json.ml @@ -22,27 +22,29 @@ open! Import (****) +(* The writing logic for basic types is copied from [lib/deriving_json]. *) + let write_string buffer s = - Buffer.add_char buffer '\"'; + Buffer.add_char buffer '"'; for i = 0 to String.length s - 1 do match s.[i] with - | '\"' -> Buffer.add_string buffer "\\\"" - | '\\' -> Buffer.add_string buffer "\\\\" - | '\b' -> Buffer.add_string buffer "\\b" - | '\x0C' -> Buffer.add_string buffer "\\f" - | '\n' -> Buffer.add_string buffer "\\n" - | '\r' -> Buffer.add_string buffer "\\r" - | '\t' -> Buffer.add_string buffer "\\t" + | '"' -> Buffer.add_string buffer {|\"|} + | '\\' -> Buffer.add_string buffer {|\\|} + | '\b' -> Buffer.add_string buffer {|\b|} + | '\x0C' -> Buffer.add_string buffer {|\f|} + | '\n' -> Buffer.add_string buffer {|\n|} + | '\r' -> Buffer.add_string buffer {|\r|} + | '\t' -> Buffer.add_string buffer {|\t|} | c when Poly.(c <= '\x1F') -> (* Other control characters are escaped. *) - Printf.bprintf buffer "\\u%04X" (int_of_char c) + Printf.bprintf buffer {|\u%04X|} (int_of_char c) | c when Poly.(c < '\x80') -> Buffer.add_char buffer s.[i] | _c (* >= '\x80' *) -> (* Bytes greater than 127 are embedded in a UTF-8 sequence. *) Buffer.add_char buffer (Char.chr (0xC2 lor (Char.code s.[i] lsr 6))); Buffer.add_char buffer (Char.chr (0x80 lor (Char.code s.[i] land 0x3F))) done; - Buffer.add_char buffer '\"' + Buffer.add_char buffer '"' let write_float buffer f = (* "%.15g" can be (much) shorter; "%.17g" is round-trippable *) @@ -51,6 +53,16 @@ let write_float buffer f = then Buffer.add_string buffer s else Printf.bprintf buffer "%.17g" f +let write_int64 buffer i = + let mask16 = Int64.of_int 0xffff in + let mask24 = Int64.of_int 0xffffff in + Printf.bprintf + buffer + "[255,%Ld,%Ld,%Ld]" + (Int64.logand i mask24) + (Int64.logand (Int64.shift_right i 24) mask24) + (Int64.logand (Int64.shift_right i 48) mask16) + external custom_identifier : Obj.t -> string = "caml_custom_identifier" let rec write b v = @@ -84,19 +96,8 @@ let rec write b v = | "_i" -> Printf.bprintf b "%ld" (Obj.obj v : int32) | "_j" -> let i : int64 = Obj.obj v in - let mask16 = Int64.of_int 0xffff in - let mask24 = Int64.of_int 0xffffff in - Printf.bprintf - b - "[255,%Ld,%Ld,%Ld]" - (Int64.logand i mask24) - (Int64.logand (Int64.shift_right i 24) mask24) - (Int64.logand (Int64.shift_right i 48) mask16) + write_int64 b i | id -> failwith (Printf.sprintf "Json.output: unsupported custom value %s " id) - else if t = Obj.abstract_tag - then - (* Presumably a JavaScript value *) - Buffer.add_string b (Js.to_string (Unsafe.global##_JSON##stringify v)) else failwith (Printf.sprintf "Json.output: unsupported tag %d " t) let to_json v = @@ -139,7 +140,11 @@ let input_reviver = let unsafe_input s = match Sys.backend_type with - | Other "wasm_of_ocaml" -> failwith "Json.unsafe_input: not implemented" + | Other "wasm_of_ocaml" -> + (* https://github.com/ocsigen/js_of_ocaml/pull/1660#discussion_r1731099372 + The encoding of OCaml values is ambiguous since both integers and floats + are mapped to numbers *) + failwith "Json.unsafe_input: not implemented in the Wasm backend" | _ -> json##parse_ s input_reviver class type obj = object @@ -162,7 +167,20 @@ let output_reviver _key (value : Unsafe.any) : Obj.t = Obj.repr (array [| 255; value##.lo; value##.mi; value##.hi |]) else Obj.repr value +let use_native_stringify_ = + ref + (match Sys.backend_type with + | Other "js_of_ocaml" -> true + | Native | Bytecode | Other _ -> false) + +let use_native_stringify () = !use_native_stringify_ + +let set_use_native_stringify b = use_native_stringify_ := b + +let output_ x = to_json (Obj.repr x) + let output obj = match Sys.backend_type with - | Other "wasm_of_ocaml" -> Js.string (to_json (Obj.repr obj)) - | _ -> json##stringify_ obj (Js.wrap_callback output_reviver) + | Other "js_of_ocaml" when use_native_stringify () -> + json##stringify_ obj (Js.wrap_callback output_reviver) + | _ -> Js.string (output_ obj) diff --git a/lib/js_of_ocaml/json.mli b/lib/js_of_ocaml/json.mli index 828755f59..1d0f38d41 100644 --- a/lib/js_of_ocaml/json.mli +++ b/lib/js_of_ocaml/json.mli @@ -25,3 +25,14 @@ val output : 'a -> Js.js_string Js.t val unsafe_input : Js.js_string Js.t -> 'a (** Unmarshal a string in JSON format as an OCaml value (unsafe but fast !). *) + +(**/**) + +val set_use_native_stringify : bool -> unit +(** Only affects js_of_ocaml. Whether to use native Javascript [stringify] to + turn a value into JSON in {!val:output}. Otherwise, fall back to the slower + method used by other backends, such as wasm_of_ocaml. *) + +val use_native_stringify : unit -> bool +(** Whether js_of_ocaml is using [stringify] in {!val:output}. See + {!val:set_use_native_stringify}. *) diff --git a/lib/lwt/graphics/graphics_js_stubs.c b/lib/lwt/graphics/graphics_js_stubs.c index f9d7cc432..43fe1fd0e 100644 --- a/lib/lwt/graphics/graphics_js_stubs.c +++ b/lib/lwt/graphics/graphics_js_stubs.c @@ -1,18 +1,17 @@ -#include -#include +#include + void caml_gr_doc_of_state () { - fprintf(stderr, "Unimplemented Javascript primitive caml_gr_doc_of_state!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_gr_doc_of_state!"); } + void caml_gr_state_create () { - fprintf(stderr, "Unimplemented Javascript primitive caml_gr_state_create!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_gr_state_create!"); } + void caml_gr_state_get () { - fprintf(stderr, "Unimplemented Javascript primitive caml_gr_state_get!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_gr_state_get!"); } + void caml_gr_state_set () { - fprintf(stderr, "Unimplemented Javascript primitive caml_gr_state_set!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_gr_state_set!"); } diff --git a/lib/runtime/js_of_ocaml_runtime_stubs.c b/lib/runtime/js_of_ocaml_runtime_stubs.c index c6688b1b8..69f6b31c9 100644 --- a/lib/runtime/js_of_ocaml_runtime_stubs.c +++ b/lib/runtime/js_of_ocaml_runtime_stubs.c @@ -1,266 +1,273 @@ -#include -#include +#include + void bigstring_of_array_buffer () { - fprintf(stderr, "Unimplemented Javascript primitive bigstring_of_array_buffer!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive bigstring_of_array_buffer!"); } + void bigstring_of_typed_array () { - fprintf(stderr, "Unimplemented Javascript primitive bigstring_of_typed_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive bigstring_of_typed_array!"); } + void bigstring_to_array_buffer () { - fprintf(stderr, "Unimplemented Javascript primitive bigstring_to_array_buffer!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive bigstring_to_array_buffer!"); } + void bigstring_to_typed_array () { - fprintf(stderr, "Unimplemented Javascript primitive bigstring_to_typed_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive bigstring_to_typed_array!"); } + void caml_ba_from_typed_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_ba_from_typed_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_ba_from_typed_array!"); } + void caml_ba_kind_of_typed_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_ba_kind_of_typed_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_ba_kind_of_typed_array!"); } + void caml_ba_to_typed_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_ba_to_typed_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_ba_to_typed_array!"); } + void caml_create_file () { - fprintf(stderr, "Unimplemented Javascript primitive caml_create_file!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_create_file!"); } + void caml_exn_with_js_backtrace () { - fprintf(stderr, "Unimplemented Javascript primitive caml_exn_with_js_backtrace!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_exn_with_js_backtrace!"); } + void caml_int64_create_lo_mi_hi () { - fprintf(stderr, "Unimplemented Javascript primitive caml_int64_create_lo_mi_hi!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_int64_create_lo_mi_hi!"); } + void caml_js_call () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_call!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_call!"); } + void caml_js_delete () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_delete!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_delete!"); } + void caml_js_equals () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_equals!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_equals!"); } + void caml_js_error_option_of_exception () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_error_option_of_exception!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_error_option_of_exception!"); } + void caml_js_eval_string () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_eval_string!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_eval_string!"); } + void caml_js_expr () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_expr!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_expr!"); } + void caml_js_from_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_from_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_from_array!"); } + void caml_js_from_bool () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_from_bool!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_from_bool!"); } + void caml_js_from_float () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_from_float!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_from_float!"); } + void caml_js_from_int32 () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_from_int32!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_from_int32!"); } + void caml_js_from_nativeint () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_from_nativeint!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_from_nativeint!"); } + void caml_js_from_string () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_from_string!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_from_string!"); } + void caml_js_fun_call () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_fun_call!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_fun_call!"); } + void caml_js_get () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_get!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_get!"); } + void caml_js_instanceof () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_instanceof!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_instanceof!"); } + void caml_js_meth_call () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_meth_call!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_meth_call!"); } + void caml_js_new () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_new!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_new!"); } + void caml_js_object () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_object!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_object!"); } + void caml_js_pure_expr () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_pure_expr!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_pure_expr!"); } + void caml_js_set () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_set!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_set!"); } + void caml_js_strict_equals () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_strict_equals!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_strict_equals!"); } + void caml_js_to_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_to_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_to_array!"); } + void caml_js_to_bool () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_to_bool!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_to_bool!"); } + void caml_js_to_byte_string () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_to_byte_string!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_to_byte_string!"); } + void caml_js_to_float () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_to_float!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_to_float!"); } + void caml_js_to_int32 () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_to_int32!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_to_int32!"); } + void caml_js_to_nativeint () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_to_nativeint!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_to_nativeint!"); } + void caml_js_to_string () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_to_string!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_to_string!"); } + void caml_js_typeof () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_typeof!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_typeof!"); } + void caml_js_var () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_var!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_var!"); } + void caml_js_wrap_callback () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_callback!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_callback!"); } + void caml_js_wrap_callback_arguments () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_callback_arguments!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_callback_arguments!"); } + void caml_js_wrap_callback_strict () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_callback_strict!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_callback_strict!"); } + void caml_js_wrap_callback_unsafe () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_callback_unsafe!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_callback_unsafe!"); } + void caml_js_wrap_meth_callback () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_meth_callback!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_meth_callback!"); } + void caml_js_wrap_meth_callback_arguments () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_meth_callback_arguments!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_meth_callback_arguments!"); } + void caml_js_wrap_meth_callback_strict () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_meth_callback_strict!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_meth_callback_strict!"); } + void caml_js_wrap_meth_callback_unsafe () { - fprintf(stderr, "Unimplemented Javascript primitive caml_js_wrap_meth_callback_unsafe!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_js_wrap_meth_callback_unsafe!"); } + void caml_jsbytes_of_string () { - fprintf(stderr, "Unimplemented Javascript primitive caml_jsbytes_of_string!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_jsbytes_of_string!"); } + void caml_jsoo_flags_effects () { - fprintf(stderr, "Unimplemented Javascript primitive caml_jsoo_flags_effects!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_jsoo_flags_effects!"); } + void caml_jsoo_flags_use_js_string () { - fprintf(stderr, "Unimplemented Javascript primitive caml_jsoo_flags_use_js_string!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_jsoo_flags_use_js_string!"); } + void caml_jsstring_of_string () { - fprintf(stderr, "Unimplemented Javascript primitive caml_jsstring_of_string!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_jsstring_of_string!"); } + void caml_list_mount_point () { - fprintf(stderr, "Unimplemented Javascript primitive caml_list_mount_point!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_list_mount_point!"); } + void caml_list_of_js_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_list_of_js_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_list_of_js_array!"); } + void caml_list_to_js_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_list_to_js_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_list_to_js_array!"); } + +void caml_ml_channel_redirect () { + caml_fatal_error("Unimplemented Javascript primitive caml_ml_channel_redirect!"); +} + +void caml_ml_channel_restore () { + caml_fatal_error("Unimplemented Javascript primitive caml_ml_channel_restore!"); +} + void caml_ml_set_channel_output () { - fprintf(stderr, "Unimplemented Javascript primitive caml_ml_set_channel_output!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_ml_set_channel_output!"); } + void caml_ml_set_channel_refill () { - fprintf(stderr, "Unimplemented Javascript primitive caml_ml_set_channel_refill!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_ml_set_channel_refill!"); } + void caml_mount_autoload () { - fprintf(stderr, "Unimplemented Javascript primitive caml_mount_autoload!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_mount_autoload!"); } + void caml_ojs_new_arr () { - fprintf(stderr, "Unimplemented Javascript primitive caml_ojs_new_arr!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_ojs_new_arr!"); } + void caml_pure_js_expr () { - fprintf(stderr, "Unimplemented Javascript primitive caml_pure_js_expr!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_pure_js_expr!"); } + void caml_read_file_content () { - fprintf(stderr, "Unimplemented Javascript primitive caml_read_file_content!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_read_file_content!"); } + void caml_string_of_array () { - fprintf(stderr, "Unimplemented Javascript primitive caml_string_of_array!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_string_of_array!"); } + void caml_string_of_jsbytes () { - fprintf(stderr, "Unimplemented Javascript primitive caml_string_of_jsbytes!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_string_of_jsbytes!"); } + void caml_string_of_jsstring () { - fprintf(stderr, "Unimplemented Javascript primitive caml_string_of_jsstring!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_string_of_jsstring!"); } + void caml_unmount () { - fprintf(stderr, "Unimplemented Javascript primitive caml_unmount!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive caml_unmount!"); } + void debugger () { - fprintf(stderr, "Unimplemented Javascript primitive debugger!\n"); - exit(1); + caml_fatal_error("Unimplemented Javascript primitive debugger!"); } diff --git a/lib/runtime/jsoo_runtime.ml b/lib/runtime/jsoo_runtime.ml index d1c8a1b1a..812719523 100644 --- a/lib/runtime/jsoo_runtime.ml +++ b/lib/runtime/jsoo_runtime.ml @@ -116,6 +116,14 @@ module Sys = struct external unmount : string -> unit = "caml_unmount" + type redirection + + external redirect_channel : out_channel -> into:out_channel -> redirection + = "caml_ml_channel_redirect" + + external restore_channel : out_channel -> redirection -> unit + = "caml_ml_channel_restore" + module Config = struct external use_js_string : unit -> bool = "caml_jsoo_flags_use_js_string" diff --git a/lib/tests/test_json.ml b/lib/tests/test_json.ml index 7f07f19bb..6360260bc 100644 --- a/lib/tests/test_json.ml +++ b/lib/tests/test_json.ml @@ -22,30 +22,42 @@ open Js_of_ocaml let round_trip x = let s = Json.output x in - Printf.printf "%s\n" (Js.to_bytestring s); - let y = Json.unsafe_input s in - Printf.printf "%b\n" (x = y) + let s1 = Js.to_bytestring s in + let s2 = + let old = Json.use_native_stringify () in + Json.set_use_native_stringify false; + let s = Json.output x in + Json.set_use_native_stringify old; + Js.to_bytestring s + in + Printf.printf "%s\n" s1; + if s1 <> s2 then Printf.printf "Json.output mismatch: %s vs %s\n" s1 s2; + (* Other direction of the round-trip (unmarshalling from JSON) is only + available with js_of_ocaml *) + match Sys.backend_type with + | Other "js_of_ocaml" when Json.use_native_stringify () -> + let y = Json.unsafe_input s in + if not (x = y) then Printf.printf "not invariant by round-trip\n" + | _ -> () let%expect_test _ = round_trip 123L; [%expect {| - [255,123,0,0] - true |}]; + [255,123,0,0] |}]; round_trip "asd"; [%expect {| - "asd" - true |}]; + "asd" |}]; round_trip "\000\255\254"; - [%expect {| - "\u0000ÿþ" - true |}]; + [%expect {| "\u0000ÿþ" |}]; round_trip (2, 3); round_trip (2., 3.); round_trip (2.2, 3.3); [%expect {| [0,2,3] - true [0,2,3] - true [0,2.2,3.3] - true |}] + |}]; + round_trip [| 1.; 2.; 3. |]; + [%expect {| [254,1,2,3] |}]; + round_trip 2n; + [%expect {| 2 |}] diff --git a/lib/tests/test_typed_array.ml b/lib/tests/test_typed_array.ml index 299362873..f85aba7ee 100644 --- a/lib/tests/test_typed_array.ml +++ b/lib/tests/test_typed_array.ml @@ -124,6 +124,20 @@ let test : type a b c. (a, b, c) Setup.t -> b array -> unit = if not (kind_field_is_correct setup a3) then print_endline "corrupted `kind`"; () +(* Byte-wise equality *) +let typed_arrays_equal ta1 ta2 = + let byte_len1 = ta1##.byteLength + and byte_len2 = ta2##.byteLength in + if not (Int.equal byte_len1 byte_len2) then false + else + let view1 = new%js dataView (ta1##.buffer) in + let view2 = new%js dataView (ta2##.buffer) in + let rec cmp i = + if i >= byte_len1 then true + else Int.equal (view1##getUint8 i) (view2##getUint8 i) && cmp (i + 1) + in + cmp 0 + let%expect_test "float32" = test Setup.Float32 [| Float.neg_infinity; -1.; 0.; 1.; Float.infinity |]; [%expect {||}] @@ -137,7 +151,17 @@ let%expect_test "int8" = [%expect {||}] let%expect_test "uint8" = - test Setup.Uint8 [| 0; 255 |]; + let a = [| 0; 255 |] in + test Setup.Uint8 a; + let ta = from_genarray (type_of_setup Setup.Uint8) (ba_of_array Setup.Uint8 a) in + let bytes = Typed_array.Bytes.of_uint8Array ta in + let ta' = Typed_array.Bytes.to_uint8Array bytes in + if not (typed_arrays_equal ta ta') then + print_endline "round-trip from uint8Array to bytes and back not equal"; + let buffer = ta##.buffer in + let bytes'' = Typed_array.Bytes.of_arrayBuffer buffer in + if not (Stdlib.Bytes.equal bytes'' bytes) + then print_endline "bytes from arrayBuffer not equal to bytes from of_uint8Array"; [%expect {||}] let%expect_test "int16" = diff --git a/manual/options.wiki b/manual/options.wiki index f5af01bb0..7ef4fabb3 100644 --- a/manual/options.wiki +++ b/manual/options.wiki @@ -32,18 +32,19 @@ various optimizations until a fix-point is reached ==List of option to "--disable" or "--enable" -|= Option name |= Default |= Description | -| pretty | false | Pretty print the javascript output | -| effects | false | Enable support for effect handlers | -| debuginfo | false | Output debug information (location) | -| deadcode | true | Deadcode elimination | -| inline | true | Code inlining | -| shortvar | true | Shorten variable names | -| staticeval | true | Static evaluation of constants | -| share | true | Share string and number constants | -| strict | true | Enable strict mode | -| debugger | true | Keep debugger statements. - Stripped otherwise | -| genprim | true | Generate dummy primitives when missing | -| excwrap | true | Wrap js exception into ocaml ones | -| optcall | true | Javascript optimizations | +|= Option name |= Default |= Description | +| pretty | false | Pretty print the javascript output | +| effects | false | Enable support for effect handlers | +| debuginfo | false | Output debug information (location) | +| deadcode | true | Deadcode elimination | +| globaldeadcode | true | Global deadcode elimination | +| inline | true | Code inlining | +| shortvar | true | Shorten variable names | +| staticeval | true | Static evaluation of constants | +| share | true | Share string and number constants | +| strict | true | Enable strict mode | +| debugger | true | Keep debugger statements. + Stripped otherwise | +| genprim | true | Generate dummy primitives when missing | +| excwrap | true | Wrap js exception into ocaml ones | +| optcall | true | Javascript optimizations | diff --git a/manual/overview.wiki b/manual/overview.wiki index 377ee8fd3..24c7b8f51 100644 --- a/manual/overview.wiki +++ b/manual/overview.wiki @@ -91,7 +91,8 @@ integers are 32 bits (rather than 31 bits or 63 bits), which is their natural size in JavaScript, and floats are not boxed. As a consequence, marshalling, polymorphic comparison, and hashing functions can yield results different from usual: - * marshalling of floats is not supported (unmarshalling works); + * marshalling floats might generate different output. Such output should not be + unmarshalled using the standard ocaml runtime (native or bytecode); * the polymorphic hash function will not give the same results on datastructures containing floats; * these functions may be more prone to stack overflow. diff --git a/manual/performances.wiki b/manual/performances.wiki index 3715d9f0d..8cb946818 100644 --- a/manual/performances.wiki +++ b/manual/performances.wiki @@ -2,7 +2,7 @@ We have compared the running time of OCaml programs executed natively, interpreted by the bytecode interpreter, and executed by a Javascript engine after compilation by Js_of_ocaml. With a state of the art Javascript engine (such as Google's V8 and Mozilla's SpiderMonkey), programs often run faster when compiled to JavaScript than with the OCaml bytecode interpreter. -Benchmarks were run in novemver 2022 with engines available in Ubuntu 22.04 (V8 : 8.4.371.19-node.16, SpiderMonkey: JavaScript-C91.10.0) +Benchmarks were run in November 2022 with engines available in Ubuntu 22.04 (V8 : 8.4.371.19-node.16, SpiderMonkey: JavaScript-C91.10.0) Exceptions are very expansive preventing some benchmarks to finish in resonable times. String operations are also slow (splay), as OCaml strings cannot be mapped directly to Javascript immutable UTF-16 strings. diff --git a/ppx/ppx_deriving_json/tests/dune b/ppx/ppx_deriving_json/tests/dune index c16ec7532..d2607ddee 100644 --- a/ppx/ppx_deriving_json/tests/dune +++ b/ppx/ppx_deriving_json/tests/dune @@ -26,12 +26,16 @@ (rule (alias runtest) + (enabled_if + (>= %{ocaml_version} 5.1)) ;; (package js_of_ocaml-ppx) (action (diff ppx.mlt ppx.mlt.corrected))) (rule (alias runtest) + (enabled_if + (>= %{ocaml_version} 5.1)) ;; (package js_of_ocaml-ppx) (action (diff gen.mlt gen.mlt.corrected))) diff --git a/ppx/ppx_deriving_json/tests/gen.mlt b/ppx/ppx_deriving_json/tests/gen.mlt index ed52a9446..3994e69fa 100644 --- a/ppx/ppx_deriving_json/tests/gen.mlt +++ b/ppx/ppx_deriving_json/tests/gen.mlt @@ -16,23 +16,21 @@ type int_list = int list [@@deriving json] [%%expect {| - type int_list = int list[@@deriving json] include struct let _ = fun (_ : int_list) -> () - let rec (int_list_of_json : Deriving_Json_lexer.lexbuf -> int_list) = + let rec int_list_of_json : Deriving_Json_lexer.lexbuf -> int_list = fun buf -> Deriving_Json.read_list (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_list_of_json - let rec (int_list_to_json : Buffer.t -> int_list -> unit) = - fun buf -> - fun a -> - Deriving_Json.write_list - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + let rec int_list_to_json : Buffer.t -> int_list -> unit = + fun buf a -> + Deriving_Json.write_list + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_list_to_json - let (int_list_json : int_list Deriving_Json.t) = + let int_list_json : int_list Deriving_Json.t = Deriving_Json.make int_list_to_json int_list_of_json let _ = int_list_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -46,23 +44,21 @@ type int_ref = int ref [@@deriving json] [%%expect {| - type int_ref = int ref[@@deriving json] include struct let _ = fun (_ : int_ref) -> () - let rec (int_ref_of_json : Deriving_Json_lexer.lexbuf -> int_ref) = + let rec int_ref_of_json : Deriving_Json_lexer.lexbuf -> int_ref = fun buf -> Deriving_Json.read_ref (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_ref_of_json - let rec (int_ref_to_json : Buffer.t -> int_ref -> unit) = - fun buf -> - fun a -> - Deriving_Json.write_ref - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + let rec int_ref_to_json : Buffer.t -> int_ref -> unit = + fun buf a -> + Deriving_Json.write_ref + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_ref_to_json - let (int_ref_json : int_ref Deriving_Json.t) = + let int_ref_json : int_ref Deriving_Json.t = Deriving_Json.make int_ref_to_json int_ref_of_json let _ = int_ref_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -76,23 +72,21 @@ type int_option = int option [@@deriving json] [%%expect {| - type int_option = int option[@@deriving json] include struct let _ = fun (_ : int_option) -> () - let rec (int_option_of_json : Deriving_Json_lexer.lexbuf -> int_option) = + let rec int_option_of_json : Deriving_Json_lexer.lexbuf -> int_option = fun buf -> Deriving_Json.read_option (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_option_of_json - let rec (int_option_to_json : Buffer.t -> int_option -> unit) = - fun buf -> - fun a -> - Deriving_Json.write_option - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + let rec int_option_to_json : Buffer.t -> int_option -> unit = + fun buf a -> + Deriving_Json.write_option + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_option_to_json - let (int_option_json : int_option Deriving_Json.t) = + let int_option_json : int_option Deriving_Json.t = Deriving_Json.make int_option_to_json int_option_of_json let _ = int_option_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -106,23 +100,21 @@ type int_array = int array [@@deriving json] [%%expect {| - type int_array = int array[@@deriving json] include struct let _ = fun (_ : int_array) -> () - let rec (int_array_of_json : Deriving_Json_lexer.lexbuf -> int_array) = + let rec int_array_of_json : Deriving_Json_lexer.lexbuf -> int_array = fun buf -> Deriving_Json.read_array (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_array_of_json - let rec (int_array_to_json : Buffer.t -> int_array -> unit) = - fun buf -> - fun a -> - Deriving_Json.write_array - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + let rec int_array_to_json : Buffer.t -> int_array -> unit = + fun buf a -> + Deriving_Json.write_array + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_array_to_json - let (int_array_json : int_array Deriving_Json.t) = + let int_array_json : int_array Deriving_Json.t = Deriving_Json.make int_array_to_json int_array_of_json let _ = int_array_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -136,12 +128,11 @@ type tuple1 = int * string [@@deriving json] [%%expect {| - type tuple1 = (int * string)[@@deriving json] include struct let _ = fun (_ : tuple1) -> () - let rec (tuple1_of_json : Deriving_Json_lexer.lexbuf -> tuple1) = + let rec tuple1_of_json : Deriving_Json_lexer.lexbuf -> tuple1 = fun buf -> Deriving_Json_lexer.read_lbracket buf; ignore (Deriving_Json_lexer.read_tag_1 0 buf); @@ -151,17 +142,16 @@ include (let b = Deriving_Json.Json_string.read buf in Deriving_Json_lexer.read_rbracket buf; (a, b))) let _ = tuple1_of_json - let rec (tuple1_to_json : Buffer.t -> tuple1 -> unit) = - fun buf -> - fun a -> - let (a, b) = a in - Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - Deriving_Json.Json_string.write buf b); - Buffer.add_string buf "]" + let rec tuple1_to_json : Buffer.t -> tuple1 -> unit = + fun buf a -> + let (a, b) = a in + Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + Deriving_Json.Json_string.write buf b); + Buffer.add_string buf "]" let _ = tuple1_to_json - let (tuple1_json : tuple1 Deriving_Json.t) = + let tuple1_json : tuple1 Deriving_Json.t = Deriving_Json.make tuple1_to_json tuple1_of_json let _ = tuple1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -189,7 +179,7 @@ type variant1 = include struct let _ = fun (_ : variant1) -> () - let rec (variant1_of_json : Deriving_Json_lexer.lexbuf -> variant1) = + let rec variant1_of_json : Deriving_Json_lexer.lexbuf -> variant1 = fun buf -> match Deriving_Json_lexer.read_case buf with | `NCst 0 -> @@ -201,7 +191,7 @@ include | `Cst 0 -> A | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = variant1_of_json - let rec (variant1_to_json : Buffer.t -> variant1 -> unit) = + let rec variant1_to_json : Buffer.t -> variant1 -> unit = fun buf -> function | D a -> @@ -212,7 +202,7 @@ include | B -> Deriving_Json.Json_int.write buf 1 | A -> Deriving_Json.Json_int.write buf 0 let _ = variant1_to_json - let (variant1_json : variant1 Deriving_Json.t) = + let variant1_json : variant1 Deriving_Json.t = Deriving_Json.make variant1_to_json variant1_of_json let _ = variant1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -236,7 +226,7 @@ type variant2 = include struct let _ = fun (_ : variant2) -> () - let rec (variant2_of_json : Deriving_Json_lexer.lexbuf -> variant2) = + let rec variant2_of_json : Deriving_Json_lexer.lexbuf -> variant2 = fun buf -> match Deriving_Json_lexer.read_case buf with | `NCst 1 -> @@ -249,7 +239,7 @@ include Deriving_Json_lexer.read_rbracket buf; D a)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = variant2_of_json - let rec (variant2_to_json : Buffer.t -> variant2 -> unit) = + let rec variant2_to_json : Buffer.t -> variant2 -> unit = fun buf -> function | E a -> @@ -262,7 +252,7 @@ include Deriving_Json.Json_string.write buf a); Buffer.add_string buf "]") let _ = variant2_to_json - let (variant2_json : variant2 Deriving_Json.t) = + let variant2_json : variant2 Deriving_Json.t = Deriving_Json.make variant2_to_json variant2_of_json let _ = variant2_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -280,7 +270,6 @@ type record1 = [%%expect {| - type record1 = { f: variant1 ; g: variant2 ; @@ -288,7 +277,7 @@ type record1 = { include struct let _ = fun (_ : record1) -> () - let rec (record1_of_json : Deriving_Json_lexer.lexbuf -> record1) = + let rec record1_of_json : Deriving_Json_lexer.lexbuf -> record1 = fun buf -> Deriving_Json_lexer.read_lbracket buf; ignore (Deriving_Json_lexer.read_tag_2 0 254 buf); @@ -301,19 +290,18 @@ include Deriving_Json.read_option (fun buf -> record1_of_json buf) buf in Deriving_Json_lexer.read_rbracket buf; { f = a; g = b; h = c }))) let _ = record1_of_json - let rec (record1_to_json : Buffer.t -> record1 -> unit) = - fun buf -> - fun { f; g; h } -> - Buffer.add_string buf "[0"; - (((Buffer.add_string buf ","; variant1_to_json buf f); - Buffer.add_string buf ","; - variant2_to_json buf g); - Buffer.add_string buf ","; - Deriving_Json.write_option - (fun buf -> fun a -> record1_to_json buf a) buf h); - Buffer.add_string buf "]" + let rec record1_to_json : Buffer.t -> record1 -> unit = + fun buf { f; g; h } -> + Buffer.add_string buf "[0"; + (((Buffer.add_string buf ","; variant1_to_json buf f); + Buffer.add_string buf ","; + variant2_to_json buf g); + Buffer.add_string buf ","; + Deriving_Json.write_option (fun buf a -> record1_to_json buf a) buf + h); + Buffer.add_string buf "]" let _ = record1_to_json - let (record1_json : record1 Deriving_Json.t) = + let record1_json : record1 Deriving_Json.t = Deriving_Json.make record1_to_json record1_of_json let _ = record1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -330,16 +318,15 @@ type poly1 = [%%expect {| - type poly1 = [ `A | `B of string ][@@deriving json] include struct let _ = fun (_ : poly1) -> () - let rec (poly1_recognize : [ `NCst of int | `Cst of int ] -> bool) = + let rec poly1_recognize : [ `NCst of int | `Cst of int ] -> bool = function | `Cst 65 -> true | `NCst 66 -> true | _ -> false let _ = poly1_recognize - let rec (poly1_of_json_with_tag : - Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly1) + let rec poly1_of_json_with_tag : + Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly1 = fun buf -> function @@ -349,26 +336,24 @@ include (let v = Deriving_Json.Json_string.read buf in Deriving_Json_lexer.read_rbracket buf; `B v)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf - and (poly1_of_json : Deriving_Json_lexer.lexbuf -> poly1) = + and poly1_of_json : Deriving_Json_lexer.lexbuf -> poly1 = fun buf -> poly1_of_json_with_tag buf (Deriving_Json_lexer.read_vcase buf) let _ = poly1_of_json_with_tag and _ = poly1_of_json - let rec (poly1_to_json : Buffer.t -> [> poly1] -> unit) = - fun buf -> - fun a -> - match a with - | `A -> Deriving_Json.Json_int.write buf 65 - | `B a -> - let (a, b) = (66, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - Deriving_Json.Json_string.write buf b); - Buffer.add_string buf "]") + let rec poly1_to_json : Buffer.t -> [> poly1] -> unit = + fun buf a -> + match a with + | `A -> Deriving_Json.Json_int.write buf 65 + | `B a -> + let (a, b) = (66, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + Deriving_Json.Json_string.write buf b); + Buffer.add_string buf "]") let _ = poly1_to_json - let (poly1_json : poly1 Deriving_Json.t) = + let poly1_json : poly1 Deriving_Json.t = Deriving_Json.make poly1_to_json poly1_of_json let _ = poly1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -389,19 +374,18 @@ type poly2 = [%%expect {| - type poly2 = [ | poly1 | `C of int ][@@deriving json] include struct let _ = fun (_ : poly2) -> () - let rec (poly2_recognize : [ `NCst of int | `Cst of int ] -> bool) = + let rec poly2_recognize : [ `NCst of int | `Cst of int ] -> bool = function | x when poly1_recognize x -> true | `NCst 67 -> true | _ -> false let _ = poly2_recognize - let rec (poly2_of_json_with_tag : - Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly2) + let rec poly2_of_json_with_tag : + Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly2 = fun buf -> function @@ -412,26 +396,24 @@ include (let v = Deriving_Json.Json_int.read buf in Deriving_Json_lexer.read_rbracket buf; `C v)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf - and (poly2_of_json : Deriving_Json_lexer.lexbuf -> poly2) = + and poly2_of_json : Deriving_Json_lexer.lexbuf -> poly2 = fun buf -> poly2_of_json_with_tag buf (Deriving_Json_lexer.read_vcase buf) let _ = poly2_of_json_with_tag and _ = poly2_of_json - let rec (poly2_to_json : Buffer.t -> [> poly2] -> unit) = - fun buf -> - fun a -> - match a with - | #poly1 as a -> poly1_to_json buf a - | `C a -> - let (a, b) = (67, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf b); - Buffer.add_string buf "]") + let rec poly2_to_json : Buffer.t -> [> poly2] -> unit = + fun buf a -> + match a with + | #poly1 as a -> poly1_to_json buf a + | `C a -> + let (a, b) = (67, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf b); + Buffer.add_string buf "]") let _ = poly2_to_json - let (poly2_json : poly2 Deriving_Json.t) = + let poly2_json : poly2 Deriving_Json.t = Deriving_Json.make poly2_to_json poly2_of_json let _ = poly2_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -464,8 +446,8 @@ type inline_record = include struct let _ = fun (_ : inline_record) -> () - let rec (inline_record_of_json : - Deriving_Json_lexer.lexbuf -> inline_record) = + let rec inline_record_of_json : + Deriving_Json_lexer.lexbuf -> inline_record = fun buf -> match Deriving_Json_lexer.read_case buf with | `NCst 1 -> @@ -480,7 +462,7 @@ include Deriving_Json_lexer.read_rbracket buf; I { name = a; age = b }))) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = inline_record_of_json - let rec (inline_record_to_json : Buffer.t -> inline_record -> unit) = + let rec inline_record_to_json : Buffer.t -> inline_record -> unit = fun buf -> function | J { empty } -> @@ -496,7 +478,7 @@ include Deriving_Json.Json_int.write buf age); Buffer.add_string buf "]") let _ = inline_record_to_json - let (inline_record_json : inline_record Deriving_Json.t) = + let inline_record_json : inline_record Deriving_Json.t = Deriving_Json.make inline_record_to_json inline_record_of_json let _ = inline_record_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -511,27 +493,21 @@ val inline_record_json : inline_record Deriving_Json.t = type 'a t = 'a array [@@deriving json] [%%expect {| - type 'a t = 'a array[@@deriving json] include struct let _ = fun (_ : 'a t) -> () - let rec (of_json : + let rec of_json : (Deriving_Json_lexer.lexbuf -> 'a) -> - Deriving_Json_lexer.lexbuf -> 'a t) + Deriving_Json_lexer.lexbuf -> 'a t = - fun poly_a -> - fun buf -> Deriving_Json.read_array (fun buf -> poly_a buf) buf + fun poly_a buf -> Deriving_Json.read_array (fun buf -> poly_a buf) buf let _ = of_json - let rec (to_json : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit) - = - fun poly_a -> - fun buf -> - fun a -> - Deriving_Json.write_array (fun buf -> fun a -> poly_a buf a) buf - a + let rec to_json : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit = + fun poly_a buf a -> + Deriving_Json.write_array (fun buf a -> poly_a buf a) buf a let _ = to_json - let (json : 'a Deriving_Json.t -> 'a t Deriving_Json.t) = + let json : 'a Deriving_Json.t -> 'a t Deriving_Json.t = fun poly_a -> Deriving_Json.make (to_json (Deriving_Json.write poly_a)) (of_json (Deriving_Json.read poly_a)) @@ -548,54 +524,44 @@ val json : 'a Deriving_Json.t -> 'a t Deriving_Json.t = type ('a,'b) t = ('a array * 'b) [@@deriving json] [%%expect {| - type ('a, 'b) t = ('a array * 'b)[@@deriving json] include struct let _ = fun (_ : ('a, 'b) t) -> () - let rec (of_json : + let rec of_json : (Deriving_Json_lexer.lexbuf -> 'a) -> (Deriving_Json_lexer.lexbuf -> 'b) -> - Deriving_Json_lexer.lexbuf -> ('a, 'b) t) + Deriving_Json_lexer.lexbuf -> ('a, 'b) t = - fun poly_a -> - fun poly_b -> - fun buf -> - Deriving_Json_lexer.read_lbracket buf; - ignore (Deriving_Json_lexer.read_tag_1 0 buf); - Deriving_Json_lexer.read_comma buf; - (let a = Deriving_Json.read_array (fun buf -> poly_a buf) buf in - Deriving_Json_lexer.read_comma buf; - (let b = poly_b buf in - Deriving_Json_lexer.read_rbracket buf; (a, b))) + fun poly_a poly_b buf -> + Deriving_Json_lexer.read_lbracket buf; + ignore (Deriving_Json_lexer.read_tag_1 0 buf); + Deriving_Json_lexer.read_comma buf; + (let a = Deriving_Json.read_array (fun buf -> poly_a buf) buf in + Deriving_Json_lexer.read_comma buf; + (let b = poly_b buf in Deriving_Json_lexer.read_rbracket buf; (a, b))) let _ = of_json - let rec (to_json : + let rec to_json : (Buffer.t -> 'a -> unit) -> - (Buffer.t -> 'b -> unit) -> Buffer.t -> ('a, 'b) t -> unit) + (Buffer.t -> 'b -> unit) -> Buffer.t -> ('a, 'b) t -> unit = - fun poly_a -> - fun poly_b -> - fun buf -> - fun a -> - let (a, b) = a in - Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.write_array (fun buf -> fun a -> poly_a buf a) - buf a); - Buffer.add_string buf ","; - poly_b buf b); - Buffer.add_string buf "]" + fun poly_a poly_b buf a -> + let (a, b) = a in + Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.write_array (fun buf a -> poly_a buf a) buf a); + Buffer.add_string buf ","; + poly_b buf b); + Buffer.add_string buf "]" let _ = to_json - let (json : - 'a Deriving_Json.t -> 'b Deriving_Json.t -> ('a, 'b) t Deriving_Json.t) + let json : + 'a Deriving_Json.t -> 'b Deriving_Json.t -> ('a, 'b) t Deriving_Json.t = - fun poly_a -> - fun poly_b -> - Deriving_Json.make - ((to_json (Deriving_Json.write poly_a)) - (Deriving_Json.write poly_b)) - ((of_json (Deriving_Json.read poly_a)) - (Deriving_Json.read poly_b)) + fun poly_a poly_b -> + Deriving_Json.make + ((to_json (Deriving_Json.write poly_a)) + (Deriving_Json.write poly_b)) + ((of_json (Deriving_Json.read poly_a)) (Deriving_Json.read poly_b)) let _ = json end[@@ocaml.doc "@inline"][@@merlin.hide ];; type ('a, 'b) t = 'a array * 'b @@ -621,20 +587,20 @@ type t = include struct let _ = fun (_ : t) -> () - let rec (of_json : Deriving_Json_lexer.lexbuf -> t) = + let rec of_json : Deriving_Json_lexer.lexbuf -> t = fun buf -> match Deriving_Json_lexer.read_case buf with | `Cst 1 -> B | `Cst 0 -> A | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = of_json - let rec (to_json : Buffer.t -> t -> unit) = + let rec to_json : Buffer.t -> t -> unit = fun buf -> function | B -> Deriving_Json.Json_int.write buf 1 | A -> Deriving_Json.Json_int.write buf 0 let _ = to_json - let (json : t Deriving_Json.t) = Deriving_Json.make to_json of_json + let json : t Deriving_Json.t = Deriving_Json.make to_json of_json let _ = json end[@@ocaml.doc "@inline"][@@merlin.hide ];; type t = A | B @@ -645,24 +611,19 @@ val json : t Deriving_Json.t = let x = [%json: t option] [%%expect {| - let x = Deriving_Json.make - (fun buf -> - fun a -> - Deriving_Json.write_option (fun buf -> fun a -> to_json buf a) buf a) + (fun buf a -> + Deriving_Json.write_option (fun buf a -> to_json buf a) buf a) (fun buf -> Deriving_Json.read_option (fun buf -> of_json buf) buf);; val x : t option Deriving_Json.t = |}];; let y = [%to_json: t list] [%%expect {| - let y x = let buf = Buffer.create 50 in - ((fun buf -> - fun a -> - Deriving_Json.write_list (fun buf -> fun a -> to_json buf a) buf a)) + ((fun buf a -> Deriving_Json.write_list (fun buf a -> to_json buf a) buf a)) buf x; Buffer.contents buf;; val y : t list -> string = @@ -670,12 +631,9 @@ val y : t list -> string = let z = [%json_of: t array] [%%expect {| - let z x = let buf = Buffer.create 50 in - ((fun buf -> - fun a -> - Deriving_Json.write_array (fun buf -> fun a -> to_json buf a) buf a)) + ((fun buf a -> Deriving_Json.write_array (fun buf a -> to_json buf a) buf a)) buf x; Buffer.contents buf;; val z : t array -> string = @@ -699,18 +657,17 @@ val t : string -> t * t = ;; type id' = int [@@deriving json] [%%expect {| - type id' = int[@@deriving json] include struct let _ = fun (_ : id') -> () - let rec (id'_of_json : Deriving_Json_lexer.lexbuf -> id') = + let rec id'_of_json : Deriving_Json_lexer.lexbuf -> id' = fun buf -> Deriving_Json.Json_int.read buf let _ = id'_of_json - let rec (id'_to_json : Buffer.t -> id' -> unit) = - fun buf -> fun a -> Deriving_Json.Json_int.write buf a + let rec id'_to_json : Buffer.t -> id' -> unit = + fun buf a -> Deriving_Json.Json_int.write buf a let _ = id'_to_json - let (id'_json : id' Deriving_Json.t) = + let id'_json : id' Deriving_Json.t = Deriving_Json.make id'_to_json id'_of_json let _ = id'_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -727,21 +684,20 @@ type poly3 = [%%expect {| - type poly3 = [ | poly1 | `C of [ `p1 of poly1 | `p2 of poly2 | `p3 of poly3 ] ] [@@deriving json] include struct let _ = fun (_ : poly3) -> () - let rec (poly3_recognize : [ `NCst of int | `Cst of int ] -> bool) = + let rec poly3_recognize : [ `NCst of int | `Cst of int ] -> bool = function | x when poly1_recognize x -> true | `NCst 67 -> true | _ -> false let _ = poly3_recognize - let rec (poly3_of_json_with_tag : - Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly3) + let rec poly3_of_json_with_tag : + Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly3 = fun buf -> function @@ -772,50 +728,48 @@ include (Deriving_Json_lexer.read_vcase buf) in Deriving_Json_lexer.read_rbracket buf; `C v)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf - and (poly3_of_json : Deriving_Json_lexer.lexbuf -> poly3) = + and poly3_of_json : Deriving_Json_lexer.lexbuf -> poly3 = fun buf -> poly3_of_json_with_tag buf (Deriving_Json_lexer.read_vcase buf) let _ = poly3_of_json_with_tag and _ = poly3_of_json - let rec (poly3_to_json : Buffer.t -> [> poly3] -> unit) = - fun buf -> - fun a -> - match a with - | #poly1 as a -> poly1_to_json buf a - | `C a -> - let (a, b) = (67, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - (match b with - | `p1 a -> - let (a, b) = (25025, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - poly1_to_json buf b); - Buffer.add_string buf "]") - | `p2 a -> - let (a, b) = (25026, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - poly2_to_json buf b); - Buffer.add_string buf "]") - | `p3 a -> - let (a, b) = (25027, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - poly3_to_json buf b); - Buffer.add_string buf "]"))); - Buffer.add_string buf "]") + let rec poly3_to_json : Buffer.t -> [> poly3] -> unit = + fun buf a -> + match a with + | #poly1 as a -> poly1_to_json buf a + | `C a -> + let (a, b) = (67, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + (match b with + | `p1 a -> + let (a, b) = (25025, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + poly1_to_json buf b); + Buffer.add_string buf "]") + | `p2 a -> + let (a, b) = (25026, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + poly2_to_json buf b); + Buffer.add_string buf "]") + | `p3 a -> + let (a, b) = (25027, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + poly3_to_json buf b); + Buffer.add_string buf "]"))); + Buffer.add_string buf "]") let _ = poly3_to_json - let (poly3_json : poly3 Deriving_Json.t) = + let poly3_json : poly3 Deriving_Json.t = Deriving_Json.make poly3_to_json poly3_of_json let _ = poly3_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; diff --git a/ppx/ppx_js/as-lib/ppx_js.mli b/ppx/ppx_js/as-lib/ppx_js.mli index 0fbce6073..654345a64 100644 --- a/ppx/ppx_js/as-lib/ppx_js.mli +++ b/ppx/ppx_js/as-lib/ppx_js.mli @@ -1,7 +1,7 @@ (* Js_of_ocaml library * http://www.ocsigen.org/js_of_ocaml/ * - * This program is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, with linking exception; * either version 2.1 of the License, or (at your option) any later version. @@ -20,5 +20,5 @@ val mapper : Ast_mapper.mapper (** You can use this mapper to register the extension when building a toplevel. - You can only use it the way it is; it is not possible to update any fields + You can only use it the way it is; it is not possible to update any fields of this mapper. *) diff --git a/ppx/ppx_js/tests/dune b/ppx/ppx_js/tests/dune index 4032859f1..6cc1f5456 100644 --- a/ppx/ppx_js/tests/dune +++ b/ppx/ppx_js/tests/dune @@ -6,11 +6,15 @@ (rule (targets ppx.mlt.corrected) + (enabled_if + (>= %{ocaml_version} 5.2)) (action (run %{exe:main.bc} %{dep:ppx.mlt}))) (rule (alias runtest) (package js_of_ocaml-ppx) + (enabled_if + (>= %{ocaml_version} 5.2)) (action (diff ppx.mlt ppx.mlt.corrected))) diff --git a/ppx/ppx_js/tests/ppx.mlt b/ppx/ppx_js/tests/ppx.mlt index e20663af9..e1c151013 100644 --- a/ppx/ppx_js/tests/ppx.mlt +++ b/ppx/ppx_js/tests/ppx.mlt @@ -274,7 +274,8 @@ Error: This expression has type < get : float; set : float -> unit > Js_of_ocaml.Js.gen_prop but an expression was expected of type < set : int -> unit; .. > Js_of_ocaml.Js.gen_prop - Types for method set are incompatible + The method set has type float -> unit, + but the expected method type was int -> unit |}] ;; @@ -325,7 +326,7 @@ Error: This expression has type is not compatible with type float Js_of_ocaml.Js.prop = < get : float; set : float -> unit > Js_of_ocaml.Js.gen_prop - Types for method get are incompatible + The method get has type int, but the expected method type was float |}] ;; @@ -349,7 +350,8 @@ Error: This expression has type Js_of_ocaml.Js.t but an expression was expected of type < m : int Js_of_ocaml.Js.meth; .. > Js_of_ocaml.Js.t - Types for method m are incompatible + The method m has type string Js_of_ocaml.Js.meth, + but the expected method type was int Js_of_ocaml.Js.meth |}] ;; @@ -479,7 +481,8 @@ Error: This expression has type is not compatible with type int Js_of_ocaml.Js.prop = < get : int; set : int -> unit > Js_of_ocaml.Js.gen_prop - Types for method get are incompatible + The method get has type int Js_of_ocaml.Js.optdef, + but the expected method type was int |}] ;; diff --git a/runtime/backtrace.js b/runtime/backtrace.js index 1c894c988..be09b5974 100644 --- a/runtime/backtrace.js +++ b/runtime/backtrace.js @@ -16,36 +16,40 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -//Provides: caml_record_backtrace_flag +//Provides: caml_record_backtrace_env_flag //Requires: jsoo_sys_getenv -var caml_record_backtrace_flag = FLAG("with-js-error"); +var caml_record_backtrace_env_flag = FLAG("with-js-error"); (function () { var r = jsoo_sys_getenv("OCAMLRUNPARAM") if(r !== undefined){ var l = r.split(","); for(var i = 0; i < l.length; i++){ - if(l[i] == "b") { caml_record_backtrace_flag = 1; break } + if(l[i] == "b") { caml_record_backtrace_env_flag = 1; break } else if (l[i].startsWith("b=")) { - caml_record_backtrace_flag = +(l[i].slice(2))} + caml_record_backtrace_env_flag = +(l[i].slice(2)) } else continue; } } }) () +//Provides: caml_record_backtrace_runtime_flag +//Requires: caml_record_backtrace_env_flag +var caml_record_backtrace_runtime_flag = caml_record_backtrace_env_flag; + //Provides: caml_ml_debug_info_status const function caml_ml_debug_info_status () { return 0; } //Provides: caml_backtrace_status -//Requires: caml_record_backtrace_flag -function caml_backtrace_status (_unit) { return caml_record_backtrace_flag ? 1 : 0; } +//Requires: caml_record_backtrace_runtime_flag +function caml_backtrace_status (_unit) { return caml_record_backtrace_runtime_flag ? 1 : 0; } //Provides: caml_get_exception_backtrace const function caml_get_exception_backtrace () { return 0; } //Provides: caml_get_exception_raw_backtrace const function caml_get_exception_raw_backtrace () { return [0]; } //Provides: caml_record_backtrace -//Requires: caml_record_backtrace_flag -function caml_record_backtrace (b) { caml_record_backtrace_flag = b; return 0; } +//Requires: caml_record_backtrace_runtime_flag +function caml_record_backtrace (b) { caml_record_backtrace_runtime_flag = b; return 0; } //Provides: caml_convert_raw_backtrace const function caml_convert_raw_backtrace () { return [0]; } //Provides: caml_raw_backtrace_length diff --git a/runtime/blake2.js b/runtime/blake2.js new file mode 100644 index 000000000..684e5c37d --- /dev/null +++ b/runtime/blake2.js @@ -0,0 +1,348 @@ +//Provides: blake2b +//Version: >= 5.2 +var blake2b = (function () { +// Blake2B in pure Javascript +// Adapted from the reference implementation in RFC7693 +// Ported to Javascript by DC - https://github.com/dcposch + +// 64-bit unsigned addition +// Sets v[a,a+1] += v[b,b+1] +// v should be a Uint32Array +function ADD64AA (v, a, b) { + const o0 = v[a] + v[b] + let o1 = v[a + 1] + v[b + 1] + if (o0 >= 0x100000000) { + o1++ + } + v[a] = o0 + v[a + 1] = o1 +} + +// 64-bit unsigned addition +// Sets v[a,a+1] += b +// b0 is the low 32 bits of b, b1 represents the high 32 bits +function ADD64AC (v, a, b0, b1) { + let o0 = v[a] + b0 + if (b0 < 0) { + o0 += 0x100000000 + } + let o1 = v[a + 1] + b1 + if (o0 >= 0x100000000) { + o1++ + } + v[a] = o0 + v[a + 1] = o1 +} + +// Little-endian byte access +function B2B_GET32 (arr, i) { + return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24) +} + +// G Mixing function +// The ROTRs are inlined for speed +function B2B_G (a, b, c, d, ix, iy) { + const x0 = m[ix] + const x1 = m[ix + 1] + const y0 = m[iy] + const y1 = m[iy + 1] + + ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s + ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits + + // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits + let xor0 = v[d] ^ v[a] + let xor1 = v[d + 1] ^ v[a + 1] + v[d] = xor1 + v[d + 1] = xor0 + + ADD64AA(v, c, d) + + // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits + xor0 = v[b] ^ v[c] + xor1 = v[b + 1] ^ v[c + 1] + v[b] = (xor0 >>> 24) ^ (xor1 << 8) + v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8) + + ADD64AA(v, a, b) + ADD64AC(v, a, y0, y1) + + // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits + xor0 = v[d] ^ v[a] + xor1 = v[d + 1] ^ v[a + 1] + v[d] = (xor0 >>> 16) ^ (xor1 << 16) + v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16) + + ADD64AA(v, c, d) + + // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits + xor0 = v[b] ^ v[c] + xor1 = v[b + 1] ^ v[c + 1] + v[b] = (xor1 >>> 31) ^ (xor0 << 1) + v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1) +} + +// Initialization Vector +const BLAKE2B_IV32 = new Uint32Array([ + 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, + 0x5f1d36f1, 0xa54ff53a, 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, + 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19 +]) + +const SIGMA8 = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, + 6, 1, 12, 0, 2, 11, 7, 5, 3, 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, + 9, 4, 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, 9, 0, 5, 7, 2, 4, + 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, + 15, 14, 1, 9, 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, 13, 11, 7, + 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, + 13, 7, 1, 4, 10, 5, 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 10, 4, 8, 9, 15, 13, 6, + 1, 12, 0, 2, 11, 7, 5, 3 +] + +// These are offsets into a uint64 buffer. +// Multiply them all by 2 to make them offsets into a uint32 buffer, +// because this is Javascript and we don't have uint64s +const SIGMA82 = new Uint8Array( + SIGMA8.map(function (x) { + return x * 2 + }) +) + +// Compression function. 'last' flag indicates last block. +// Note we're representing 16 uint64s as 32 uint32s +const v = new Uint32Array(32) +const m = new Uint32Array(32) +function blake2bCompress (ctx, last) { + let i = 0 + + // init work variables + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i] + v[i + 16] = BLAKE2B_IV32[i] + } + + // low 64 bits of offset + v[24] = v[24] ^ ctx.t + v[25] = v[25] ^ (ctx.t / 0x100000000) + // high 64 bits not supported, offset may not be higher than 2**53-1 + + // last block flag set ? + if (last) { + v[28] = ~v[28] + v[29] = ~v[29] + } + + // get little-endian words + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i) + } + + // twelve rounds of mixing + // uncomment the DebugPrint calls to log the computation + // and match the RFC sample documentation + for (i = 0; i < 12; i++) { + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]) + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]) + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]) + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]) + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]) + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]) + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]) + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]) + } + + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16] + } +} + +// reusable parameterBlock +const parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, // 0: outlen, keylen, fanout, depth + 0, + 0, + 0, + 0, // 4: leaf length, sequential mode + 0, + 0, + 0, + 0, // 8: node offset + 0, + 0, + 0, + 0, // 12: node offset + 0, + 0, + 0, + 0, // 16: node depth, inner length, rfu + 0, + 0, + 0, + 0, // 20: rfu + 0, + 0, + 0, + 0, // 24: rfu + 0, + 0, + 0, + 0, // 28: rfu + 0, + 0, + 0, + 0, // 32: salt + 0, + 0, + 0, + 0, // 36: salt + 0, + 0, + 0, + 0, // 40: salt + 0, + 0, + 0, + 0, // 44: salt + 0, + 0, + 0, + 0, // 48: personal + 0, + 0, + 0, + 0, // 52: personal + 0, + 0, + 0, + 0, // 56: personal + 0, + 0, + 0, + 0 // 60: personal +]) + +// Creates a BLAKE2b hashing context +// Requires an output length between 1 and 64 bytes +// Takes an optional Uint8Array key +function blake2bInit (outlen, key) { + if (outlen === 0 || outlen > 64) { + throw new Error('Illegal output length, expected 0 < length <= 64') + } + if (key.length > 64) { + throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64') + } + + // state, 'param block' + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, // input count + c: 0, // pointer within buffer + outlen: outlen // output length in bytes + } + + // initialize parameterBlock before usage + parameterBlock.fill(0) + parameterBlock[0] = outlen + parameterBlock[1] = key.length + parameterBlock[2] = 1 // fanout + parameterBlock[3] = 1 // depth + + // initialize hash state + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4) + } + + + + if(key.length > 0){ + blake2bUpdate(ctx, key) + // at the end + ctx.c = 128 + } + + return ctx +} + +// Updates a BLAKE2b streaming hash +// Requires hash context and Uint8Array (byte array) +function blake2bUpdate (ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + // buffer full ? + ctx.t += ctx.c // add counters + blake2bCompress(ctx, false) // compress (not last) + ctx.c = 0 // counter to zero + } + ctx.b[ctx.c++] = input[i] + } +} + +// Completes a BLAKE2b streaming hash +// Returns a Uint8Array containing the message digest +function blake2bFinal (ctx) { + ctx.t += ctx.c // mark last block offset + + while (ctx.c < 128) { + // fill up with zeros + ctx.b[ctx.c++] = 0 + } + blake2bCompress(ctx, true) // final block flag = 1 + + // little endian convert and store + const out = new Uint8Array(ctx.outlen) + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> (8 * (i & 3)) + } + return out +} + return {Init:blake2bInit, Update:blake2bUpdate, Final:blake2bFinal} +})() + +//Provides: caml_blake2_create +//Requires: caml_uint8_array_of_string +//Requires: blake2b +//Version: >= 5.2 +function caml_blake2_create(hashlen, key){ + key = caml_uint8_array_of_string(key); + if(key.length > 64) { + key.subarray(0,64); + } + return blake2b.Init(hashlen, key); +} + +//Provides: caml_blake2_final +//Requires: caml_string_of_array +//Requires: blake2b +//Version: >= 5.2 +function caml_blake2_final(ctx, hashlen) { + var r = blake2b.Final(ctx); + return caml_string_of_array(r); +} + +//Provides: caml_blake2_update +//Requires: blake2b +//Requires: caml_uint8_array_of_string +//Version: >= 5.2 +function caml_blake2_update(ctx, buf, ofs, len){ + var input = caml_uint8_array_of_string(buf); + input = input.subarray(ofs, ofs + len); + blake2b.Update(ctx, input); + return 0 +} + +//Provides: caml_blake2_string +//Requires: caml_blake2_create +//Requires: caml_blake2_update +//Requires: caml_blake2_final +//Version: >= 5.2 +function caml_blake2_string(hashlen, key, buf, ofs, len) { + var ctx = caml_blake2_create (hashlen, key); + caml_blake2_update(ctx, buf, ofs, len); + return caml_blake2_final(ctx, hashlen); +} diff --git a/runtime/domain.js b/runtime/domain.js index b4c292162..a0e53aa2f 100644 --- a/runtime/domain.js +++ b/runtime/domain.js @@ -7,6 +7,15 @@ function caml_domain_dls_set(a) { caml_domain_dls = a; } +//Provides: caml_domain_dls_compare_and_set +//Requires: caml_domain_dls +//Version: >= 5.2 +function caml_domain_dls_compare_and_set(old,n) { + if(caml_domain_dls !== old) return 0 + caml_domain_dls = n; + return 1; +} + //Provides: caml_domain_dls_get //Requires: caml_domain_dls function caml_domain_dls_get(unit) { @@ -42,7 +51,13 @@ function caml_atomic_exchange(ref, v) { return r; } +//Provides: caml_atomic_make_contended +function caml_atomic_make_contended(a) { + return [0, a] +} + //Provides: caml_ml_domain_unique_token +//Version: < 5.2 var caml_ml_domain_unique_token_ = [0] function caml_ml_domain_unique_token(unit) { return caml_ml_domain_unique_token_ @@ -65,12 +80,31 @@ var caml_domain_id = 0; //Requires: caml_ml_mutex_unlock //Requires: caml_domain_id //Requires: caml_callback +//Version: >= 5.2 +var caml_domain_latest_idx = 1 +function caml_domain_spawn(f,term_sync){ + var id = caml_domain_latest_idx++; + var old = caml_domain_id; + caml_domain_id = id; + var res = caml_callback(f,[0]); + caml_domain_id = old; + caml_ml_mutex_unlock(term_sync[2]); + //TODO: fix exn case + term_sync[1] = [0, [0, res]]; + return id; +} + +//Provides: caml_domain_spawn +//Requires: caml_ml_mutex_unlock +//Requires: caml_domain_id +//Requires: caml_callback +//Version: < 5.2 var caml_domain_latest_idx = 1 function caml_domain_spawn(f,mutex){ var id = caml_domain_latest_idx++; var old = caml_domain_id; caml_domain_id = id; - caml_callback(f,[0]); + var res = caml_callback(f,[0]); caml_domain_id = old; caml_ml_mutex_unlock(mutex); return id; diff --git a/runtime/dynlink.js b/runtime/dynlink.js index 8b0bd4e3b..9664498a9 100644 --- a/runtime/dynlink.js +++ b/runtime/dynlink.js @@ -16,33 +16,41 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -//Provides: current_libs -var current_libs = [0, globalThis] +//Provides: get_current_libs +var current_libs; +function get_current_libs () { + if(!current_libs) + current_libs = [0, globalThis, globalThis.jsoo_runtime] + return current_libs +} //Provides: caml_dynlink_open_lib -//Requires: current_libs, caml_failwith +//Requires: get_current_libs, caml_failwith //Requires: caml_jsstring_of_string function caml_dynlink_open_lib (_mode,file) { var name = caml_jsstring_of_string(file); console.log("Dynlink: try to open ", name); //caml_failwith("file not found: "+name) + var current_libs = get_current_libs(); current_libs.push({}); return current_libs.length; } //Provides: caml_dynlink_close_lib -//Requires: current_libs +//Requires: get_current_libs function caml_dynlink_close_lib (idx) { + var current_libs = get_current_libs(); current_libs[idx]=null; return 0; } //Provides: caml_dynlink_lookup_symbol -//Requires: current_libs +//Requires: get_current_libs //Requires: caml_jsstring_of_string function caml_dynlink_lookup_symbol (idx, fun_name) { var name = caml_jsstring_of_string(fun_name); console.log("Dynlink: looking for symbol", name); + var current_libs = get_current_libs(); if(current_libs[idx] && current_libs[idx][name]) return {name: name, symbol: current_libs[idx][name]}; return 0; @@ -56,8 +64,9 @@ function caml_dynlink_add_primitive (dll_addr) { } //Provides: caml_dynlink_get_current_libs -//Requires: current_libs +//Requires: get_current_libs function caml_dynlink_get_current_libs () { + var current_libs = get_current_libs(); var len = current_libs.length; var a = new Array(len); for(var i=0; i < len; i++) diff --git a/runtime/fs.js b/runtime/fs.js index 58b272755..3e74e33ad 100644 --- a/runtime/fs.js +++ b/runtime/fs.js @@ -85,7 +85,7 @@ function caml_make_path (name) { if( !path_is_absolute(name) ) name = caml_current_dir + name; var comp0 = path_is_absolute(name); - var comp = comp0[1].split("/"); + var comp = comp0[1].split(/[/\\]/); var ncomp = [] for(var i = 0; i= 4.12 function caml_gc_quick_stat(){ return [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] } + +//Provides: caml_gc_quick_stat +//Version: < 4.12 +function caml_gc_quick_stat(){ + return [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] +} //Provides: caml_gc_stat +//Requires: caml_gc_quick_stat function caml_gc_stat() { - // A field was added in OCaml 4.12. It is unlikely to be an issue to - // return too many fields in previous versions of OCaml. - return [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] + return caml_gc_quick_stat(); } //Provides: caml_gc_set @@ -75,6 +81,9 @@ function caml_memprof_stop(unit) { return 0; } +//Provides: caml_memprof_discard +function caml_memprof_discard(t) { return 0 } + //Provides: caml_eventlog_resume function caml_eventlog_resume(unit) { return 0; } diff --git a/runtime/internalMod.js b/runtime/internalMod.js index f0e194e57..00e19171e 100644 --- a/runtime/internalMod.js +++ b/runtime/internalMod.js @@ -18,7 +18,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //Provides: caml_CamlinternalMod_init_mod -//Requires: caml_raise_with_arg, caml_global_data +//Requires: caml_raise_with_arg, caml_global_data, caml_alloc_dummy_infix //If: !effects //Version: < 4.13 function caml_CamlinternalMod_init_mod(loc,shape) { @@ -29,7 +29,9 @@ function caml_CamlinternalMod_init_mod(loc,shape) { if(typeof shape === "number") switch(shape){ case 0://function - struct[idx]={fun:undef_module}; + var dummy=caml_alloc_dummy_infix(); + dummy.fun=undef_module; + struct[idx]=dummy; break; case 1://lazy struct[idx]=[246, undef_module]; @@ -78,7 +80,7 @@ function caml_CamlinternalMod_update_mod(shape,real,x) { } //Provides: caml_CamlinternalMod_init_mod -//Requires: caml_raise_with_arg, caml_global_data +//Requires: caml_raise_with_arg, caml_global_data, caml_alloc_dummy_infix //If: effects //Version: < 4.13 function caml_CamlinternalMod_init_mod(loc,shape,cont) { @@ -89,7 +91,9 @@ function caml_CamlinternalMod_init_mod(loc,shape,cont) { if(typeof shape === "number") switch(shape){ case 0://function - struct[idx]={fun:undef_module}; + var dummy=caml_alloc_dummy_infix(); + dummy.fun=undef_module; + struct[idx]=dummy; break; case 1://lazy struct[idx]=[246, undef_module]; diff --git a/runtime/ints.js b/runtime/ints.js index b4afcbbd8..d3361a85b 100644 --- a/runtime/ints.js +++ b/runtime/ints.js @@ -34,7 +34,7 @@ function caml_format_int(fmt, i) { //Provides: caml_parse_sign_and_base //Requires: caml_string_unsafe_get, caml_ml_string_length function caml_parse_sign_and_base (s) { - var i = 0, len = caml_ml_string_length(s), base = 10, sign = 1; + var i = 0, len = caml_ml_string_length(s), base = 10, sign = 1, signedness = 1; if (len > 0) { switch (caml_string_unsafe_get(s,i)) { case 45: i++; sign = -1; break; @@ -43,12 +43,12 @@ function caml_parse_sign_and_base (s) { } if (i + 1 < len && caml_string_unsafe_get(s, i) == 48) switch (caml_string_unsafe_get(s, i + 1)) { - case 120: case 88: base = 16; i += 2; break; - case 111: case 79: base = 8; i += 2; break; - case 98: case 66: base = 2; i += 2; break; - case 117: case 85: i += 2; break; + case 120: case 88: signedness = 0; base = 16; i += 2; break; + case 111: case 79: signedness = 0; base = 8; i += 2; break; + case 98: case 66: signedness = 0; base = 2; i += 2; break; + case 117: case 85: signedness = 0; i += 2; break; } - return [i, sign, base]; + return [i, sign, base, signedness]; } //Provides: caml_parse_digit @@ -64,7 +64,7 @@ function caml_parse_digit(c) { //Requires: caml_parse_sign_and_base, caml_parse_digit, caml_failwith function caml_int_of_string (s) { var r = caml_parse_sign_and_base (s); - var i = r[0], sign = r[1], base = r[2]; + var i = r[0], sign = r[1], base = r[2], signedness = r[3]; var len = caml_ml_string_length(s); var threshold = -1 >>> 0; var c = (i < len)?caml_string_unsafe_get(s, i):0; @@ -84,7 +84,7 @@ function caml_int_of_string (s) { // hence any value of 'res' (less than 'threshold') is acceptable. // But we have to convert the result back to a signed integer. res = sign * res; - if ((base == 10) && ((res | 0) != res)) + if (signedness && ((res | 0) != res)) /* Signed representation expected, allow -2^(nbits-1) to 2^(nbits-1) - 1 */ caml_failwith("int_of_string"); return res | 0; diff --git a/runtime/io.js b/runtime/io.js index 0a8b1590f..beae07f2e 100644 --- a/runtime/io.js +++ b/runtime/io.js @@ -88,9 +88,9 @@ function caml_sys_open (name, flags, _perms) { // ocaml Channels //Provides: caml_ml_set_channel_name -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get function caml_ml_set_channel_name(chanid, name) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); chan.name = name; return 0; } @@ -98,6 +98,28 @@ function caml_ml_set_channel_name(chanid, name) { //Provides: caml_ml_channels var caml_ml_channels = new Array(); +//Provides: caml_ml_channel_redirect +//Requires: caml_ml_channel_get, caml_ml_channels +function caml_ml_channel_redirect (captured, into){ + var to_restore = caml_ml_channel_get(captured); + var new_ = caml_ml_channel_get(into); + caml_ml_channels[captured] = new_; // XXX + return to_restore; +} + +//Provides: caml_ml_channel_restore +//Requires: caml_ml_channels +function caml_ml_channel_restore (captured, to_restore){ + caml_ml_channels[captured] = to_restore; // XXX + return 0; +} + +//Provides: caml_ml_channel_get +//Requires: caml_ml_channels +function caml_ml_channel_get(id) { + return caml_ml_channels[id]; // XXX +} + //Provides: caml_ml_out_channels_list //Requires: caml_ml_channels function caml_ml_out_channels_list () { @@ -156,61 +178,89 @@ function caml_ml_open_descriptor_in (fd) { } +//Provides: caml_ml_open_descriptor_in_with_flags +//Requires: caml_ml_open_descriptor_in +//Version: >= 5.1 +function caml_ml_open_descriptor_in_with_flags(fd, flags){ + return caml_ml_open_descriptor_in(fd); +} + +//Provides: caml_ml_open_descriptor_out_with_flags +//Requires: caml_ml_open_descriptor_out +//Version: >= 5.1 +function caml_ml_open_descriptor_out_with_flags(fd, flags){ + return caml_ml_open_descriptor_out(fd); +} + //Provides: caml_channel_descriptor -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get //Alias: win_filedescr_of_channel function caml_channel_descriptor(chanid){ - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); return chan.fd; } //Provides: caml_ml_set_binary_mode -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get function caml_ml_set_binary_mode(chanid,mode){ - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); chan.file.flags.text = !mode chan.file.flags.binary = mode return 0; } +//Provides: caml_ml_is_binary_mode +//Requires: caml_ml_channel_get +//Version: >= 5.2 +function caml_ml_is_binary_mode(chanid) { + var chan = caml_ml_channel_get(chanid); + return chan.file.flags.binary +} + //Input from in_channel //Provides: caml_ml_close_channel -//Requires: caml_ml_flush, caml_ml_channels +//Requires: caml_ml_flush, caml_ml_channel_get //Requires: caml_sys_close function caml_ml_close_channel (chanid) { - var chan = caml_ml_channels[chanid]; - chan.opened = false; - caml_sys_close(chan.fd) + var chan = caml_ml_channel_get(chanid); + if(chan.opened) { + chan.opened = false; + caml_sys_close(chan.fd); + chan.fd = -1; + chan.buffer = new Uint8Array(0); + chan.buffer_curr = 0; + chan.buffer_max = 0; + } return 0; } //Provides: caml_ml_channel_size -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get function caml_ml_channel_size(chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); return chan.file.length(); } //Provides: caml_ml_channel_size_64 -//Requires: caml_int64_of_float,caml_ml_channels +//Requires: caml_int64_of_float,caml_ml_channel_get function caml_ml_channel_size_64(chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); return caml_int64_of_float(chan.file.length ()); } //Provides: caml_ml_set_channel_output -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get function caml_ml_set_channel_output(chanid,f) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); chan.output = (function (s) {f(s)}); return 0; } //Provides: caml_ml_set_channel_refill -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get function caml_ml_set_channel_refill(chanid,f) { - caml_ml_channels[chanid].refill = f; + caml_ml_channel_get(chanid).refill = f; return 0; } @@ -248,10 +298,18 @@ function caml_ml_input (chanid, b, i, l) { return caml_ml_input_block(chanid, ba, i, l) } +//Provides: caml_ml_input_bigarray +//Requires: caml_ml_input_block +//Requires: caml_ba_to_typed_array +function caml_ml_input_bigarray (chanid, b, i, l) { + var ba = caml_ba_to_typed_array(b); + return caml_ml_input_block(chanid, ba, i, l) +} + //Provides: caml_ml_input_block -//Requires: caml_refill, caml_ml_channels +//Requires: caml_refill, caml_ml_channel_get function caml_ml_input_block (chanid, ba, i, l) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); var n = l; var avail = chan.buffer_max - chan.buffer_curr; if(l <= avail) { @@ -275,11 +333,11 @@ function caml_ml_input_block (chanid, ba, i, l) { } //Provides: caml_input_value -//Requires: caml_marshal_data_size, caml_input_value_from_bytes, caml_create_bytes, caml_ml_channels, caml_bytes_of_array +//Requires: caml_marshal_data_size, caml_input_value_from_bytes, caml_create_bytes, caml_ml_channel_get, caml_bytes_of_array //Requires: caml_refill, caml_failwith, caml_raise_end_of_file //Requires: caml_marshal_header_size function caml_input_value (chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); var header = new Uint8Array(caml_marshal_header_size); function block(buffer, offset, n) { var r = 0; @@ -322,9 +380,9 @@ function caml_input_value_to_outside_heap(c) { //Provides: caml_ml_input_char //Requires: caml_raise_end_of_file, caml_array_bound_error -//Requires: caml_ml_channels, caml_refill +//Requires: caml_ml_channel_get, caml_refill function caml_ml_input_char (chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); if(chan.buffer_curr >= chan.buffer_max){ chan.buffer_curr = 0; chan.buffer_max = 0; @@ -339,9 +397,9 @@ function caml_ml_input_char (chanid) { //Provides: caml_ml_input_int //Requires: caml_raise_end_of_file -//Requires: caml_ml_input_char, caml_ml_channels +//Requires: caml_ml_input_char, caml_ml_channel_get function caml_ml_input_int (chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); var res = 0; for(var i = 0; i < 4; i++){ res = (res << 8) + caml_ml_input_char(chanid) | 0; @@ -350,9 +408,9 @@ function caml_ml_input_int (chanid) { } //Provides: caml_seek_in -//Requires: caml_raise_sys_error, caml_ml_channels +//Requires: caml_raise_sys_error, caml_ml_channel_get function caml_seek_in(chanid, pos) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); if (chan.refill != null) caml_raise_sys_error("Illegal seek"); if(pos >= chan.offset - chan.buffer_max && pos <= chan.offset @@ -380,9 +438,9 @@ function caml_ml_seek_in_64(chanid,pos){ } //Provides: caml_pos_in -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get function caml_pos_in(chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); return chan.offset - (chan.buffer_max - chan.buffer_curr) | 0; } @@ -400,9 +458,9 @@ function caml_ml_pos_in_64(chanid) { //Provides: caml_ml_input_scan_line //Requires: caml_array_bound_error -//Requires: caml_ml_channels, caml_refill +//Requires: caml_ml_channel_get, caml_refill function caml_ml_input_scan_line(chanid){ - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); var p = chan.buffer_curr; do { if(p >= chan.buffer_max) { @@ -426,10 +484,10 @@ function caml_ml_input_scan_line(chanid){ } //Provides: caml_ml_flush -//Requires: caml_raise_sys_error, caml_ml_channels +//Requires: caml_raise_sys_error, caml_ml_channel_get //Requires: caml_subarray_to_jsbytes function caml_ml_flush (chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); if(! chan.opened) caml_raise_sys_error("Cannot flush a closed channel"); if(!chan.buffer || chan.buffer_curr == 0) return 0; if(chan.output) { @@ -444,14 +502,12 @@ function caml_ml_flush (chanid) { //output to out_channel -//Provides: caml_ml_output_bytes +//Provides: caml_ml_output_ta //Requires: caml_ml_flush,caml_ml_bytes_length -//Requires: caml_create_bytes, caml_blit_bytes, caml_raise_sys_error, caml_ml_channels, caml_string_of_bytes -//Requires: caml_uint8_array_of_bytes -function caml_ml_output_bytes(chanid,buffer,offset,len) { - var chan = caml_ml_channels[chanid]; +//Requires: caml_raise_sys_error, caml_ml_channel_get +function caml_ml_output_ta(chanid,buffer,offset,len) { + var chan = caml_ml_channel_get(chanid); if(! chan.opened) caml_raise_sys_error("Cannot output to a closed channel"); - var buffer = caml_uint8_array_of_bytes(buffer); buffer = buffer.subarray(offset, offset + len); if(chan.buffer_curr + buffer.length > chan.buffer.length) { var b = new Uint8Array(chan.buffer_curr + buffer.length); @@ -490,6 +546,23 @@ function caml_ml_output_bytes(chanid,buffer,offset,len) { return 0; } +//Provides: caml_ml_output_bytes +//Requires: caml_uint8_array_of_bytes, caml_ml_output_ta +function caml_ml_output_bytes(chanid,buffer,offset,len) { + var buffer = caml_uint8_array_of_bytes(buffer); + return caml_ml_output_ta(chanid,buffer,offset,len); +} + + +//Provides: caml_ml_output_bigarray +//Requires: caml_ba_to_typed_array, caml_ml_output_ta +function caml_ml_output_bigarray(chanid,buffer,offset,len) { + var buffer = caml_ba_to_typed_array(buffer); + return caml_ml_output_ta(chanid,buffer,offset,len); +} + + + //Provides: caml_ml_output //Requires: caml_ml_output_bytes, caml_bytes_of_string function caml_ml_output(chanid,buffer,offset,len){ @@ -515,10 +588,10 @@ function caml_output_value (chanid,v,flags) { //Provides: caml_seek_out -//Requires: caml_ml_channels, caml_ml_flush +//Requires: caml_ml_channel_get, caml_ml_flush function caml_seek_out(chanid, pos){ caml_ml_flush(chanid); - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); chan.offset = pos; return 0; } @@ -536,9 +609,9 @@ function caml_ml_seek_out_64(chanid,pos){ } //Provides: caml_pos_out -//Requires: caml_ml_channels, caml_ml_flush +//Requires: caml_ml_channel_get, caml_ml_flush function caml_pos_out(chanid) { - var chan = caml_ml_channels[chanid]; + var chan = caml_ml_channel_get(chanid); return chan.offset + chan.buffer_curr } @@ -565,15 +638,15 @@ function caml_ml_output_int (chanid,i) { } //Provides: caml_ml_is_buffered -//Requires: caml_ml_channels +//Requires: caml_ml_channel_get function caml_ml_is_buffered(chanid) { - return caml_ml_channels[chanid].buffered ? 1 : 0 + return caml_ml_channel_get(chanid).buffered ? 1 : 0 } //Provides: caml_ml_set_buffered -//Requires: caml_ml_channels, caml_ml_flush +//Requires: caml_ml_channel_get, caml_ml_flush function caml_ml_set_buffered(chanid,v) { - caml_ml_channels[chanid].buffered = v; + caml_ml_channel_get(chanid).buffered = v; if(!v) caml_ml_flush(chanid); return 0 } diff --git a/runtime/jslib.js b/runtime/jslib.js index 59d954d91..23e5a1a99 100644 --- a/runtime/jslib.js +++ b/runtime/jslib.js @@ -161,9 +161,14 @@ function caml_wrap_exception(e) { //Provides: caml_maybe_attach_backtrace //Requires: caml_exn_with_js_backtrace -//Requires: caml_record_backtrace_flag +//Requires: caml_record_backtrace_env_flag +//Requires: caml_record_backtrace_runtime_flag function caml_maybe_attach_backtrace(exn, force) { - if(caml_record_backtrace_flag) + // Backtraces are very expensive, we only enable them when explicitly requested + // at compile-time (--enable with-js-error) or at startup with OCAMLRUNPARAM=b=1. + // Libraries such as Base unconditionally enable backtraces (programmatically) but + // it's way to slow. Here, we force the end-user to opt-in to backtraces. + if(caml_record_backtrace_env_flag && caml_record_backtrace_runtime_flag) return caml_exn_with_js_backtrace(exn, force); else return exn } diff --git a/runtime/marshal.js b/runtime/marshal.js index 9fe2d6c4d..2673f2d33 100644 --- a/runtime/marshal.js +++ b/runtime/marshal.js @@ -273,8 +273,8 @@ var caml_custom_ops = //Provides: caml_input_value_from_reader mutable //Requires: caml_failwith //Requires: caml_float_of_bytes, caml_custom_ops -//Requires: zstd_decompress //Requires: UInt8ArrayReader +//Requires: caml_decompress_input function caml_input_value_from_reader(reader, ofs) { function readvlq(overflow) { var c = reader.read8u(); @@ -483,10 +483,14 @@ function caml_input_value_from_reader(reader, ofs) { } } if(compressed) { - var data = reader.readuint8array(data_len); - var res = new Uint8Array(uncompressed_data_len); - var res = zstd_decompress(data, res); - var reader = new UInt8ArrayReader(res, 0); + if(caml_decompress_input) { + var data = reader.readuint8array(data_len); + var res = new Uint8Array(uncompressed_data_len); + var res = caml_decompress_input(data, res); + var reader = new UInt8ArrayReader(res, 0); + } else { + caml_failwith("input_value: compressed object, cannot decompress"); + } } var res = intern_rec (reader); while (stack.length > 0) { @@ -730,18 +734,18 @@ var caml_output_val = function (){ } else { if (v != (v|0)){ var type_of_v = typeof v; - // + if(type_of_v != "number") + caml_failwith("output_value: abstract value ("+type_of_v+")"); // If a float happens to be an integer it is serialized as an integer // (Js_of_ocaml cannot tell whether the type of an integer number is // float or integer.) This can result in unexpected crashes when - // unmarshalling using the standard runtime. It seems better to - // systematically fail on marshalling. - // - // if(type_of_v != "number") - caml_failwith("output_value: abstract value ("+type_of_v+")"); - // var t = caml_int64_to_bytes(caml_int64_bits_of_float(v)); - // writer.write (8, 0x0B /*cst.CODE_DOUBLE_BIG*/); - // for(var i = 0; i<8; i++){writer.write(8,t[i])} + // unmarshalling using the standard runtime. + if (memo(v)) return; + var t = caml_int64_to_bytes(caml_int64_bits_of_float(v)); + writer.write (8, 0x0C /*cst.CODE_DOUBLE_LITTLE*/); + for(var i = 0; i<8; i++){writer.write(8,t[7 - i])} + writer.size_32 += 3 + writer.size_64 += 2 } else if (v >= 0 && v < 0x40) { writer.write (8, 0X40 /*cst.PREFIX_SMALL_INT*/ + v); diff --git a/runtime/mlBytes.js b/runtime/mlBytes.js index c6dbf95e3..9a2520455 100644 --- a/runtime/mlBytes.js +++ b/runtime/mlBytes.js @@ -473,7 +473,7 @@ function caml_uint8_array_of_bytes (s) { //Requires: caml_ml_string_length, caml_string_unsafe_get function caml_uint8_array_of_string (s) { var l = caml_ml_string_length(s); - var a = new Array(l); + var a = new Uint8Array(l); var i = 0; for (; i < l; i++) a[i] = caml_string_unsafe_get(s,i); return a; @@ -645,6 +645,20 @@ function caml_blit_string(a,b,c,d,e) { //Provides: caml_ml_bytes_length const function caml_ml_bytes_length(s) { return s.l } +//Provides: caml_string_concat +//If: js-string +function caml_string_concat(a,b) { return a + b } + +//Provides: caml_string_concat +//Requires: caml_convert_string_to_bytes, MlBytes +//If: !js-string +function caml_string_concat(s1,s2){ + (s1.t & 6) && caml_convert_string_to_bytes(s1); + (s2.t & 6) && caml_convert_string_to_bytes(s2); + return new MlBytes(s1.t,s1.c+s2.c,s1.l+s2.l) +} + + //Provides: caml_string_unsafe_get const //If: js-string function caml_string_unsafe_get (s, i) { diff --git a/runtime/nat.js b/runtime/nat.js index 3843dd845..a4479b915 100644 --- a/runtime/nat.js +++ b/runtime/nat.js @@ -12,8 +12,12 @@ function initialize_nat() { //Provides: MlNat function MlNat(x){ this.data = new Int32Array(x); + // For num < 1.5 // length_nat isn't external, so we have to make the Obj.size - // work out right. The +2 to array length seems to work. + // work out right. + // We add +2 to the array length: + // - +1 for the tag + // - +1 for the custom_ops slot this.length = this.data.length + 2 } @@ -30,6 +34,10 @@ function caml_hash_nat(x) { return h; } +//Provides: length_nat +function length_nat(x) { + return x.data.length; +} //Provides: nat_of_array //Requires: MlNat diff --git a/runtime/obj.js b/runtime/obj.js index 9ed63d8db..7d3bfee3c 100644 --- a/runtime/obj.js +++ b/runtime/obj.js @@ -17,8 +17,8 @@ //Provides: caml_update_dummy function caml_update_dummy (x, y) { - if( typeof y==="function" ) { x.fun = y; return 0; } if( y.fun ) { x.fun = y.fun; return 0; } + if( typeof y==="function" ) { x.fun = y; return 0; } var i = y.length; while (i--) x[i] = y[i]; return 0; } @@ -218,5 +218,5 @@ function caml_is_continuation_tag(t) { //Provides: caml_custom_identifier //Requires: caml_string_of_jsstring function caml_custom_identifier (o) { - return caml_string_of_jsstring(o.custom_tag); + return caml_string_of_jsstring(o.caml_custom); } diff --git a/runtime/runtime_events.js b/runtime/runtime_events.js index a5e82f505..39242f0db 100644 --- a/runtime/runtime_events.js +++ b/runtime/runtime_events.js @@ -19,18 +19,27 @@ function caml_runtime_events_user_resolve() { return 0; } -//Provides: caml_runtime_events_start -function caml_runtime_events_start() { +//Provides: caml_ml_runtime_events_start +//Alias: caml_runtime_events_start +function caml_ml_runtime_events_start() { return 0; } -//Provides: caml_runtime_events_pause -function caml_runtime_events_pause() { +//Provides: caml_ml_runtime_events_pause +//Alias: caml_runtime_events_pause +function caml_ml_runtime_events_pause() { return 0; } -//Provides: caml_runtime_events_resume -function caml_runtime_events_resume() { +//Provides: caml_ml_runtime_events_are_active +//Version: >= 5.2 +function caml_ml_runtime_events_are_active() { + return 0; +} + +//Provides: caml_ml_runtime_events_resume +//Alias: caml_runtime_events_resume +function caml_ml_runtime_events_resume() { return 0; } diff --git a/runtime/stdlib.js b/runtime/stdlib.js index 402930513..01285c96e 100644 --- a/runtime/stdlib.js +++ b/runtime/stdlib.js @@ -146,15 +146,7 @@ var caml_global_data = [0]; //Provides: caml_build_symbols //Requires: caml_jsstring_of_string -function caml_build_symbols(toc) { - var symb; - while(toc) { - if(caml_jsstring_of_string(toc[1][1]) == "SYJS") { - symb = toc[1][2]; - break; - } - else toc = toc[2] - } +function caml_build_symbols(symb) { var r = {}; if(symb) { for(var i = 1; i < symb.length; i++){ @@ -173,11 +165,11 @@ function caml_register_global (n, v, name_opt) { if(globalThis.toplevelReloc) { n = caml_callback(globalThis.toplevelReloc, [name]); } - else if (caml_global_data.toc) { - if(!caml_global_data.symbols) { - caml_global_data.symbols = caml_build_symbols(caml_global_data.toc) + else if (caml_global_data.symbols) { + if(!caml_global_data.symidx) { + caml_global_data.symidx = caml_build_symbols(caml_global_data.symbols) } - var nid = caml_global_data.symbols[name] + var nid = caml_global_data.symidx[name] if(nid >= 0) n = nid else { diff --git a/runtime/sys.js b/runtime/sys.js index 02c57da15..92c402bbd 100644 --- a/runtime/sys.js +++ b/runtime/sys.js @@ -277,7 +277,7 @@ function caml_sys_const_backend_type () { //Provides: os_type var os_type = (globalThis.process && globalThis.process.platform && - globalThis.process.platform == "win32") ? "Cygwin" : "Unix"; + globalThis.process.platform == "win32") ? "Win32" : "Unix"; //Provides: caml_sys_get_config const @@ -343,6 +343,11 @@ function caml_spacetime_only_works_for_native_code() { caml_failwith("Spacetime profiling only works for native code"); } +//Provides: caml_xdg_defaults +//Version: >= 5.2 +function caml_xdg_defaults(_unit) { + return 0; // empty list +} //Provides: caml_sys_is_regular_file //Requires: resolve_fs_device @@ -369,3 +374,5 @@ function caml_setup_uncaught_exception_handler() { } } caml_setup_uncaught_exception_handler(); + + diff --git a/runtime/toplevel.js b/runtime/toplevel.js index 3a3c911b7..a2d03be97 100644 --- a/runtime/toplevel.js +++ b/runtime/toplevel.js @@ -41,18 +41,78 @@ function caml_get_current_environment() { //Provides: caml_get_section_table //Requires: caml_global_data, caml_failwith +//Requires: caml_string_of_jsbytes, caml_jsbytes_of_string +//Requires: caml_list_of_js_array +//Version: < 5.3 function caml_get_section_table () { - if(!caml_global_data.toc) { + if(!caml_global_data.sections) { caml_failwith("Program not compiled with --toplevel"); } - return caml_global_data.toc; + var symb = caml_global_data.sections[1]; + var crcs = caml_global_data.sections[2]; + var prim = caml_global_data.sections[3]; + var dlpt = caml_global_data.sections[4]; + function sl(l) { + var x = "" + while(l){ + x += caml_jsbytes_of_string(l[1]); + x += "\0"; + l = l[2]; + } + return caml_string_of_jsbytes(x); + } + var res = caml_list_of_js_array([ + [0, caml_string_of_jsbytes("SYMB"), symb], + [0, caml_string_of_jsbytes("CRCS"), crcs], + [0, caml_string_of_jsbytes("PRIM"), sl(prim)], + [0, caml_string_of_jsbytes("DLPT"), sl(dlpt)] + ]); + return res +} + +//Provides: caml_dynlink_get_bytecode_sections +//Requires: caml_global_data, caml_failwith +//Alias: jsoo_get_bytecode_sections +function caml_dynlink_get_bytecode_sections() { + if(!caml_global_data.sections) { + caml_failwith("Program not compiled with --toplevel"); + } + return caml_global_data.sections; } //Provides: caml_reify_bytecode //Requires: caml_failwith,caml_callback +//Requires: caml_string_of_array, caml_ba_to_typed_array +//Version: >= 5.2 function caml_reify_bytecode (code, debug,_digest) { - if(globalThis.toplevelCompile) + if(globalThis.toplevelCompile){ + code=caml_string_of_array(caml_ba_to_typed_array(code)); return [0, 0, caml_callback(globalThis.toplevelCompile, [code,debug])]; + } + else caml_failwith("Toplevel not initialized (toplevelCompile)") +} + +//Provides: caml_reify_bytecode +//Requires: caml_failwith,caml_callback +//Requires: caml_string_of_array, caml_uint8_array_of_bytes +//Version: < 5.2 +function caml_reify_bytecode (code, debug,_digest) { + if(globalThis.toplevelCompile){ + var len = 0; + var all = []; + for(var i = 1; i < code.length; i++) { + var a = caml_uint8_array_of_bytes(code[i]); + all.push(a); + len += a.length; + } + code = new Uint8Array(len); + for(var i = 0, len = 0; i < all.length; i++){ + code.set(all[i], len); + len += all[i].length; + } + code = caml_string_of_array(code); + return [0, 0, caml_callback(globalThis.toplevelCompile, [code,debug])]; + } else caml_failwith("Toplevel not initialized (toplevelCompile)") } diff --git a/runtime/unix.js b/runtime/unix.js index 95d349dea..be63a17dd 100644 --- a/runtime/unix.js +++ b/runtime/unix.js @@ -135,6 +135,7 @@ function caml_unix_stat(name) { function caml_unix_stat_64(name) { var r = caml_unix_stat(name); r[9] = caml_int64_of_int32(r[9]); + return r; } //Provides: caml_unix_lstat @@ -154,6 +155,7 @@ function caml_unix_lstat(name) { function caml_unix_lstat_64(name) { var r = caml_unix_lstat(name); r[9] = caml_int64_of_int32(r[9]); + return r; } //Provides: caml_unix_mkdir diff --git a/runtime/zstd.js b/runtime/zstd.js index b0f05727d..8f892fd27 100644 --- a/runtime/zstd.js +++ b/runtime/zstd.js @@ -1,5 +1,6 @@ //Provides: zstd_decompress +//Version: >= 5.1 var zstd_decompress = (function () { "use strict"; // aliases for shorter compressed code (most minifers don't do this) @@ -644,3 +645,34 @@ return function decompress(dat, buf) { return cct(bufs, ol); } }) () + + +//Provides: caml_decompress_input +//Version: < 5.1.0 +var caml_decompress_input = null + +//Provides: caml_decompress_input +//Version: >= 5.1.0 +//Version: < 5.1.1 +//Requires: zstd_decompress +var caml_decompress_input = zstd_decompress; + +//Provides: caml_decompress_input +//Version: >= 5.1.1 +//Version: < 5.2.0 +var caml_decompress_input = null + +//Provides: caml_decompress_input +//Version: >= 5.2 +//Requires: zstd_decompress +var caml_decompress_input = zstd_decompress; + +//Provides: caml_zstd_initialize +//Requires: caml_decompress_input +//Requires: zstd_decompress +//Version: >= 5.1.1 +function caml_zstd_initialize(unit) { + caml_decompress_input = zstd_decompress; + return 1 +} + diff --git a/tools/toplevel_expect/toplevel_expect_test.ml-default b/tools/toplevel_expect/toplevel_expect_test.ml-default index 5c9a5d037..303a969fe 100644 --- a/tools/toplevel_expect/toplevel_expect_test.ml-default +++ b/tools/toplevel_expect/toplevel_expect_test.ml-default @@ -206,7 +206,12 @@ let eval_expectation expectation ~output = if s.str = output then None else - let s = { s with str = output } in + let trimmed = String.trim output in + let normalized = if String.exists ~f:(function '\n' -> true | _ -> false) output + then "\n" ^ trimmed ^ "\n" + else trimmed + in + let s = { s with str = normalized } in Some ( if !Clflags.principal then { expectation with principal = s } @@ -274,6 +279,7 @@ let eval_expect_file mapper fname ~file_contents = List.fold_left phrases ~init:true ~f:(fun acc phrase -> acc && try + Location.reset (); exec_phrase ppf phrase with exn -> Location.report_exception ppf exn; diff --git a/tools/version/dune b/tools/version/dune index 4c722b77f..af3a2b300 100644 --- a/tools/version/dune +++ b/tools/version/dune @@ -3,9 +3,13 @@ open StdLabels open Jbuild_plugin.V1 let git_version = + let placeholder = "%%VERSION%%" in match run_and_read_lines "git describe --always --dirty" with | exception _ -> "" - | version :: _ -> version + | version :: _ -> + if "%%" ^ "VERSION" ^ "%%" = placeholder + then version + else placeholder | [] -> "" let dyn = diff --git a/tools/version/gen/gen.ml b/tools/version/gen/gen.ml index 33d357eb4..1af6c5220 100644 --- a/tools/version/gen/gen.ml +++ b/tools/version/gen/gen.ml @@ -14,6 +14,23 @@ let git_version = close_in ic; git_version +let drop_prefix ~prefix s = + let plen = String.length prefix in + if plen > String.length s + then None + else + try + for i = 0 to String.length prefix - 1 do + if not (Char.equal s.[i] prefix.[i]) then raise Exit + done; + Some (String.sub s plen (String.length s - plen)) + with Exit -> None + +let git_version = + match drop_prefix ~prefix:(version ^ "-") git_version with + | Some v -> v + | None -> git_version + let () = Printf.printf {| let s = "%s" let git_version = "%s" diff --git a/toplevel/examples/lwt_toplevel/dune b/toplevel/examples/lwt_toplevel/dune index 81ca33c23..9e2dc1dde 100644 --- a/toplevel/examples/lwt_toplevel/dune +++ b/toplevel/examples/lwt_toplevel/dune @@ -46,14 +46,16 @@ (link_flags (:standard)) (build_runtime_flags (:standard - +toplevel.js - +dynlink.js --file %{dep:examples.ml} --file %{dep:test_dynlink.cmo} --file - %{dep:test_dynlink.js})) + %{dep:test_dynlink.js} + --file + %{dep:test_lib_jsoo.js} + --file + (:include html_types_path.txt))) (flags (:standard --toplevel @@ -63,6 +65,18 @@ (preprocess (pps js_of_ocaml-ppx))) +(rule + (target html_types_path.txt) + (action + (with-stdout-to + %{target} + (run + ocamlfind + query + tyxml.functor + -format + "%d/html_types.cmi:/static/cmis/")))) + (rule (targets test_dynlink.cmo test_dynlink.cmi) (action @@ -78,6 +92,20 @@ %{read-strings:effects_flags.txt} %{dep:test_dynlink.cmo}))) +(rule + (target test_lib_jsoo.js) + (action + (run + %{bin:js_of_ocaml} + --pretty + --toplevel + --include-runtime + %{read-strings:effects_flags.txt} + %{dep:test_lib/stubs.js} + %{dep:test_lib/test_lib_jsoo.cma} + -o + %{target}))) + (rule (targets export.txt) (deps @@ -149,6 +177,8 @@ %{dep:test_dynlink.cmo} --file %{dep:test_dynlink.js} + --file + %{dep:test_lib_jsoo.js} --export %{dep:export.txt} --toplevel diff --git a/toplevel/examples/lwt_toplevel/test_lib/a.ml b/toplevel/examples/lwt_toplevel/test_lib/a.ml new file mode 100644 index 000000000..4bd7f60d5 --- /dev/null +++ b/toplevel/examples/lwt_toplevel/test_lib/a.ml @@ -0,0 +1,8 @@ +external test_stubs : unit -> int = "test_lib_jsoo_a" + +let () = print_endline "This is A" + +let test () = + let i = test_stubs () in + flush_all (); + Printf.printf "returned %d\n" i diff --git a/toplevel/examples/lwt_toplevel/test_lib/b.ml b/toplevel/examples/lwt_toplevel/test_lib/b.ml new file mode 100644 index 000000000..4ee55cdc4 --- /dev/null +++ b/toplevel/examples/lwt_toplevel/test_lib/b.ml @@ -0,0 +1 @@ +let () = print_endline "This is B" diff --git a/toplevel/examples/lwt_toplevel/test_lib/dune b/toplevel/examples/lwt_toplevel/test_lib/dune new file mode 100644 index 000000000..bdb7930d5 --- /dev/null +++ b/toplevel/examples/lwt_toplevel/test_lib/dune @@ -0,0 +1,5 @@ +(library + (name test_lib_jsoo) + (modes byte) + (js_of_ocaml + (javascript_files stubs.js))) diff --git a/toplevel/examples/lwt_toplevel/test_lib/stubs.js b/toplevel/examples/lwt_toplevel/test_lib/stubs.js new file mode 100644 index 000000000..fa39962ed --- /dev/null +++ b/toplevel/examples/lwt_toplevel/test_lib/stubs.js @@ -0,0 +1,11 @@ +//Provides: test_lib_jsoo_a +//Requires: caml_string_of_jsbytes +//Requires: caml_ml_output +//Requires: caml_ml_string_length +function test_lib_jsoo_a (unit) { + var s = caml_string_of_jsbytes("test_lib_jsoo_a: ok\n"); + caml_ml_output(2, s, 0, caml_ml_string_length(s)); + return 42 +} + +