From ac6c447a88d765ad2d24c428b8116bf3c3e38c4b Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 13 Mar 2023 17:30:55 +0100 Subject: [PATCH 01/20] Remove jbuild-ignore --- jbuild-ignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 jbuild-ignore diff --git a/jbuild-ignore b/jbuild-ignore deleted file mode 100644 index 8bc0cbef1..000000000 --- a/jbuild-ignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -_release From bc8a41a4e1f563b9d1689881b639ce195bfa2884 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 13 Mar 2023 17:32:20 +0100 Subject: [PATCH 02/20] Add esy-ci and opam-ci --- .github/workflows/esy-ci.yml | 117 +++++++++++++++++++++++++++ .github/workflows/opam-ci.yml | 82 +++++++++++++++++++ .github/workflows/print-esy-cache.js | 17 ++++ 3 files changed, 216 insertions(+) create mode 100644 .github/workflows/esy-ci.yml create mode 100644 .github/workflows/opam-ci.yml create mode 100644 .github/workflows/print-esy-cache.js diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml new file mode 100644 index 000000000..968872cff --- /dev/null +++ b/.github/workflows/esy-ci.yml @@ -0,0 +1,117 @@ +name: esy CI + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + build: + name: Build + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + + ocaml-compiler: + # Please keep the list in sync with the minimal version of OCaml in + # esy.json, reason.esy/reason.opam and rtop.esy/rtop.opam. + - 4.06.x # We support 4.06 because is the one that is used in BuckleScript / ReScript v9 + - 4.10.x + - 4.12.x + - 4.14.x + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + + - name: Install esy + run: npm install -g esy@0.6.12 + + - name: Restore global cache (~/.esy/source) + id: global-cache + uses: actions/cache/restore@v3 + with: + path: ~/.esy/source + key: esy-source-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }} + + - name: Install dependencies + run: esy install + + - name: Print esy cache + id: print_esy_cache + run: echo "ESY_CACHE=$(node .github/workflows/print-esy-cache.js)" >> $GITHUB_OUTPUT; + + - name: Load dependencies cache + id: deps-cache + uses: actions/cache/restore@v3 + with: + path: | + ${{ steps.print_esy_cache.outputs.ESY_CACHE }} + _export + key: esy-build-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }} + restore-keys: esy-build-${{ matrix.os }}- + + - name: Import dependencies + if: steps.deps-cache.outputs.cache-hit == 'true' + run: | + esy import-dependencies _export + rm -rf _export + + - name: Build dependencies + run: esy build-dependencies + + - name: Build + run: esy build + + - name: Test when not Windows + if: runner.os != 'Windows' + run: esy dune runtest + + - name: Test when Windows + if: runner.os == 'Windows' + run: esy b dune runtest -p "reason,rtop" + + - name: Export dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' + run: esy export-dependencies + + - name: Save global cache + uses: actions/cache/save@v3 + if: steps.global-cache.outputs.cache-hit != 'true' + with: + path: ~/.esy/source + key: esy-source-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }} + + - name: Save dependencies cache + if: steps.deps-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: | + ${{ steps.print_esy_cache.outputs.ESY_CACHE }} + _export + key: esy-build-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }} + + # Cleanup build cache in case dependencies have changed + - name: Cleanup + if: steps.deps-cache.outputs.cache-hit != 'true' + run: esy cleanup . diff --git a/.github/workflows/opam-ci.yml b/.github/workflows/opam-ci.yml new file mode 100644 index 000000000..20296e333 --- /dev/null +++ b/.github/workflows/opam-ci.yml @@ -0,0 +1,82 @@ +name: opam CI + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + + ocaml-compiler: + # Please keep the list in sync with the minimal version of OCaml in + # esy.json, reason.esy/reason.opam and rtop.esy/rtop.opam. + - 4.06.x # We support 4.06 because is the one that is used in BuckleScript / ReScript v9 + - 4.10.x + - 4.12.x + - 4.14.x + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Use OCaml ${{ matrix.ocaml-compiler }} + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + opam-pin: false + + - name: Load opam cache when not Windows + if: runner.os != 'Windows' + id: opam-cache + uses: actions/cache/restore@v3 + with: + path: ~/.opam + key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }} + + - name: Load opam cache when Windows + if: runner.os == 'Windows' + id: opam-cache-windows + uses: actions/cache/restore@v3 + with: + path: _opam + key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }} + + - name: Install dependencies + run: opam install . --deps-only + + - name: Build reason and rtop + run: opam exec -- dune build -p reason,rtop + + - name: Test + run: opam exec -- dune runtest + + - name: Save cache when not Windows + uses: actions/cache/save@v3 + if: steps.opam-cache.outputs.cache-hit != 'true' && runner.os != 'Windows' + with: + path: ~/.opam + key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }} + + - name: Save cache when Windows + uses: actions/cache/save@v3 + if: steps.opam-cache-windows.outputs.cache-hit != 'true' && runner.os == 'Windows' + with: + path: _opam + key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }} + diff --git a/.github/workflows/print-esy-cache.js b/.github/workflows/print-esy-cache.js new file mode 100644 index 000000000..62fec19fa --- /dev/null +++ b/.github/workflows/print-esy-cache.js @@ -0,0 +1,17 @@ +const fs = require("fs"); +const os = require("os"); +const path = require("path"); + +const ESY_FOLDER = process.env.ESY__PREFIX + ? process.env.ESY__PREFIX + : path.join(os.homedir(), ".esy"); + +const someEsy3 = fs + .readdirSync(ESY_FOLDER) + .filter((name) => name.length > 0 && name[0] === "3"); + +const esy3 = someEsy3 + .sort() + .pop(); + +console.log(path.join(ESY_FOLDER, esy3, "i")); From 128e6eafa2e5b58196112a3169d7e675961840c4 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 13 Mar 2023 17:32:36 +0100 Subject: [PATCH 03/20] Rename refmt_test to test --- {refmt_test => test}/README.md | 0 {refmt_test => test}/assert.t/input.re | 0 {refmt_test => test}/assert.t/run.t | 0 {refmt_test => test}/basicStructures.t/input.re | 0 {refmt_test => test}/basicStructures.t/run.t | 0 {refmt_test => test}/bigarray.t/input.re | 0 {refmt_test => test}/bigarray.t/run.t | 0 {refmt_test => test}/bucklescript.t/input.re | 0 {refmt_test => test}/bucklescript.t/run.t | 0 {refmt_test => test}/class_types.t/input.re | 0 {refmt_test => test}/class_types.t/run.t | 0 {refmt_test => test}/dune | 0 {refmt_test => test}/emptyFileComment.t/input.re | 0 {refmt_test => test}/emptyFileComment.t/run.t | 0 {refmt_test => test}/escapesInStrings.t/input.re | 0 {refmt_test => test}/escapesInStrings.t/run.t | 0 {refmt_test => test}/extensions.t/input.re | 0 {refmt_test => test}/extensions.t/run.t | 0 {refmt_test => test}/externals.t/input.re | 0 {refmt_test => test}/externals.t/run.t | 0 {refmt_test => test}/features403.t/input.re | 0 {refmt_test => test}/features403.t/run.t | 0 {refmt_test => test}/firstClassModules.t/input.re | 0 {refmt_test => test}/firstClassModules.t/run.t | 0 {refmt_test => test}/fixme.t/input.re | 0 {refmt_test => test}/fixme.t/run.t | 0 {refmt_test => test}/functionInfix.t/input.re | 0 {refmt_test => test}/functionInfix.t/run.t | 0 {refmt_test => test}/general-syntax-re.t/input.re | 0 {refmt_test => test}/general-syntax-re.t/run.t | 0 {refmt_test => test}/general-syntax-rei.t/input.rei | 0 {refmt_test => test}/general-syntax-rei.t/run.t | 0 {refmt_test => test}/if.t/input.re | 0 {refmt_test => test}/if.t/run.t | 0 {refmt_test => test}/infix.t/input.re | 0 {refmt_test => test}/infix.t/run.t | 0 {refmt_test => test}/jsx.t/input.re | 0 {refmt_test => test}/jsx.t/run.t | 0 {refmt_test => test}/jsx_functor.t/input.re | 0 {refmt_test => test}/jsx_functor.t/run.t | 0 {refmt_test => test}/lineComments.t/input.re | 0 {refmt_test => test}/lineComments.t/run.t | 0 {refmt_test => test}/modules.t/input.re | 0 {refmt_test => test}/modules.t/run.t | 0 {refmt_test => test}/modules_no_semi.t/input.re | 0 {refmt_test => test}/modules_no_semi.t/run.t | 0 {refmt_test => test}/object.t/input.re | 0 {refmt_test => test}/object.t/run.t | 0 {refmt_test => test}/ocaml_identifiers.t/input.ml | 0 {refmt_test => test}/ocaml_identifiers.t/run.t | 0 {refmt_test => test}/pexpFun.t/input.re | 0 {refmt_test => test}/pexpFun.t/run.t | 0 {refmt_test => test}/pipeFirst.t/input.re | 0 {refmt_test => test}/pipeFirst.t/run.t | 0 {refmt_test => test}/polymorphism.t/input.re | 0 {refmt_test => test}/polymorphism.t/run.t | 0 {refmt_test => test}/print-width-env.t | 0 {refmt_test => test}/sharpop.t/input.re | 0 {refmt_test => test}/sharpop.t/run.t | 0 {refmt_test => test}/singleLineCommentEof.t/input.re | 0 {refmt_test => test}/singleLineCommentEof.t/run.t | 0 {refmt_test => test}/testUtils.t/input.re | 0 {refmt_test => test}/testUtils.t/run.t | 0 {refmt_test => test}/trailing.t/input.re | 0 {refmt_test => test}/trailing.t/run.t | 0 {refmt_test => test}/trailingSpaces.t/input.re | 0 {refmt_test => test}/trailingSpaces.t/run.t | 0 {refmt_test => test}/typeDeclarations.t/input.re | 0 {refmt_test => test}/typeDeclarations.t/run.t | 0 {refmt_test => test}/uncurried.t/input.re | 0 {refmt_test => test}/uncurried.t/run.t | 0 {refmt_test => test}/variants.t/input.re | 0 {refmt_test => test}/variants.t/run.t | 0 {refmt_test => test}/version.t | 0 {refmt_test => test}/whitespace-re.t/input.re | 0 {refmt_test => test}/whitespace-re.t/run.t | 0 {refmt_test => test}/whitespace-rei.t/input.rei | 0 {refmt_test => test}/whitespace-rei.t/run.t | 0 {refmt_test => test}/wrapping-re.t/input.re | 0 {refmt_test => test}/wrapping-re.t/run.t | 0 {refmt_test => test}/wrapping-rei.t/input.rei | 0 {refmt_test => test}/wrapping-rei.t/run.t | 0 82 files changed, 0 insertions(+), 0 deletions(-) rename {refmt_test => test}/README.md (100%) rename {refmt_test => test}/assert.t/input.re (100%) rename {refmt_test => test}/assert.t/run.t (100%) rename {refmt_test => test}/basicStructures.t/input.re (100%) rename {refmt_test => test}/basicStructures.t/run.t (100%) rename {refmt_test => test}/bigarray.t/input.re (100%) rename {refmt_test => test}/bigarray.t/run.t (100%) rename {refmt_test => test}/bucklescript.t/input.re (100%) rename {refmt_test => test}/bucklescript.t/run.t (100%) rename {refmt_test => test}/class_types.t/input.re (100%) rename {refmt_test => test}/class_types.t/run.t (100%) rename {refmt_test => test}/dune (100%) rename {refmt_test => test}/emptyFileComment.t/input.re (100%) rename {refmt_test => test}/emptyFileComment.t/run.t (100%) rename {refmt_test => test}/escapesInStrings.t/input.re (100%) rename {refmt_test => test}/escapesInStrings.t/run.t (100%) rename {refmt_test => test}/extensions.t/input.re (100%) rename {refmt_test => test}/extensions.t/run.t (100%) rename {refmt_test => test}/externals.t/input.re (100%) rename {refmt_test => test}/externals.t/run.t (100%) rename {refmt_test => test}/features403.t/input.re (100%) rename {refmt_test => test}/features403.t/run.t (100%) rename {refmt_test => test}/firstClassModules.t/input.re (100%) rename {refmt_test => test}/firstClassModules.t/run.t (100%) rename {refmt_test => test}/fixme.t/input.re (100%) rename {refmt_test => test}/fixme.t/run.t (100%) rename {refmt_test => test}/functionInfix.t/input.re (100%) rename {refmt_test => test}/functionInfix.t/run.t (100%) rename {refmt_test => test}/general-syntax-re.t/input.re (100%) rename {refmt_test => test}/general-syntax-re.t/run.t (100%) rename {refmt_test => test}/general-syntax-rei.t/input.rei (100%) rename {refmt_test => test}/general-syntax-rei.t/run.t (100%) rename {refmt_test => test}/if.t/input.re (100%) rename {refmt_test => test}/if.t/run.t (100%) rename {refmt_test => test}/infix.t/input.re (100%) rename {refmt_test => test}/infix.t/run.t (100%) rename {refmt_test => test}/jsx.t/input.re (100%) rename {refmt_test => test}/jsx.t/run.t (100%) rename {refmt_test => test}/jsx_functor.t/input.re (100%) rename {refmt_test => test}/jsx_functor.t/run.t (100%) rename {refmt_test => test}/lineComments.t/input.re (100%) rename {refmt_test => test}/lineComments.t/run.t (100%) rename {refmt_test => test}/modules.t/input.re (100%) rename {refmt_test => test}/modules.t/run.t (100%) rename {refmt_test => test}/modules_no_semi.t/input.re (100%) rename {refmt_test => test}/modules_no_semi.t/run.t (100%) rename {refmt_test => test}/object.t/input.re (100%) rename {refmt_test => test}/object.t/run.t (100%) rename {refmt_test => test}/ocaml_identifiers.t/input.ml (100%) rename {refmt_test => test}/ocaml_identifiers.t/run.t (100%) rename {refmt_test => test}/pexpFun.t/input.re (100%) rename {refmt_test => test}/pexpFun.t/run.t (100%) rename {refmt_test => test}/pipeFirst.t/input.re (100%) rename {refmt_test => test}/pipeFirst.t/run.t (100%) rename {refmt_test => test}/polymorphism.t/input.re (100%) rename {refmt_test => test}/polymorphism.t/run.t (100%) rename {refmt_test => test}/print-width-env.t (100%) rename {refmt_test => test}/sharpop.t/input.re (100%) rename {refmt_test => test}/sharpop.t/run.t (100%) rename {refmt_test => test}/singleLineCommentEof.t/input.re (100%) rename {refmt_test => test}/singleLineCommentEof.t/run.t (100%) rename {refmt_test => test}/testUtils.t/input.re (100%) rename {refmt_test => test}/testUtils.t/run.t (100%) rename {refmt_test => test}/trailing.t/input.re (100%) rename {refmt_test => test}/trailing.t/run.t (100%) rename {refmt_test => test}/trailingSpaces.t/input.re (100%) rename {refmt_test => test}/trailingSpaces.t/run.t (100%) rename {refmt_test => test}/typeDeclarations.t/input.re (100%) rename {refmt_test => test}/typeDeclarations.t/run.t (100%) rename {refmt_test => test}/uncurried.t/input.re (100%) rename {refmt_test => test}/uncurried.t/run.t (100%) rename {refmt_test => test}/variants.t/input.re (100%) rename {refmt_test => test}/variants.t/run.t (100%) rename {refmt_test => test}/version.t (100%) rename {refmt_test => test}/whitespace-re.t/input.re (100%) rename {refmt_test => test}/whitespace-re.t/run.t (100%) rename {refmt_test => test}/whitespace-rei.t/input.rei (100%) rename {refmt_test => test}/whitespace-rei.t/run.t (100%) rename {refmt_test => test}/wrapping-re.t/input.re (100%) rename {refmt_test => test}/wrapping-re.t/run.t (100%) rename {refmt_test => test}/wrapping-rei.t/input.rei (100%) rename {refmt_test => test}/wrapping-rei.t/run.t (100%) diff --git a/refmt_test/README.md b/test/README.md similarity index 100% rename from refmt_test/README.md rename to test/README.md diff --git a/refmt_test/assert.t/input.re b/test/assert.t/input.re similarity index 100% rename from refmt_test/assert.t/input.re rename to test/assert.t/input.re diff --git a/refmt_test/assert.t/run.t b/test/assert.t/run.t similarity index 100% rename from refmt_test/assert.t/run.t rename to test/assert.t/run.t diff --git a/refmt_test/basicStructures.t/input.re b/test/basicStructures.t/input.re similarity index 100% rename from refmt_test/basicStructures.t/input.re rename to test/basicStructures.t/input.re diff --git a/refmt_test/basicStructures.t/run.t b/test/basicStructures.t/run.t similarity index 100% rename from refmt_test/basicStructures.t/run.t rename to test/basicStructures.t/run.t diff --git a/refmt_test/bigarray.t/input.re b/test/bigarray.t/input.re similarity index 100% rename from refmt_test/bigarray.t/input.re rename to test/bigarray.t/input.re diff --git a/refmt_test/bigarray.t/run.t b/test/bigarray.t/run.t similarity index 100% rename from refmt_test/bigarray.t/run.t rename to test/bigarray.t/run.t diff --git a/refmt_test/bucklescript.t/input.re b/test/bucklescript.t/input.re similarity index 100% rename from refmt_test/bucklescript.t/input.re rename to test/bucklescript.t/input.re diff --git a/refmt_test/bucklescript.t/run.t b/test/bucklescript.t/run.t similarity index 100% rename from refmt_test/bucklescript.t/run.t rename to test/bucklescript.t/run.t diff --git a/refmt_test/class_types.t/input.re b/test/class_types.t/input.re similarity index 100% rename from refmt_test/class_types.t/input.re rename to test/class_types.t/input.re diff --git a/refmt_test/class_types.t/run.t b/test/class_types.t/run.t similarity index 100% rename from refmt_test/class_types.t/run.t rename to test/class_types.t/run.t diff --git a/refmt_test/dune b/test/dune similarity index 100% rename from refmt_test/dune rename to test/dune diff --git a/refmt_test/emptyFileComment.t/input.re b/test/emptyFileComment.t/input.re similarity index 100% rename from refmt_test/emptyFileComment.t/input.re rename to test/emptyFileComment.t/input.re diff --git a/refmt_test/emptyFileComment.t/run.t b/test/emptyFileComment.t/run.t similarity index 100% rename from refmt_test/emptyFileComment.t/run.t rename to test/emptyFileComment.t/run.t diff --git a/refmt_test/escapesInStrings.t/input.re b/test/escapesInStrings.t/input.re similarity index 100% rename from refmt_test/escapesInStrings.t/input.re rename to test/escapesInStrings.t/input.re diff --git a/refmt_test/escapesInStrings.t/run.t b/test/escapesInStrings.t/run.t similarity index 100% rename from refmt_test/escapesInStrings.t/run.t rename to test/escapesInStrings.t/run.t diff --git a/refmt_test/extensions.t/input.re b/test/extensions.t/input.re similarity index 100% rename from refmt_test/extensions.t/input.re rename to test/extensions.t/input.re diff --git a/refmt_test/extensions.t/run.t b/test/extensions.t/run.t similarity index 100% rename from refmt_test/extensions.t/run.t rename to test/extensions.t/run.t diff --git a/refmt_test/externals.t/input.re b/test/externals.t/input.re similarity index 100% rename from refmt_test/externals.t/input.re rename to test/externals.t/input.re diff --git a/refmt_test/externals.t/run.t b/test/externals.t/run.t similarity index 100% rename from refmt_test/externals.t/run.t rename to test/externals.t/run.t diff --git a/refmt_test/features403.t/input.re b/test/features403.t/input.re similarity index 100% rename from refmt_test/features403.t/input.re rename to test/features403.t/input.re diff --git a/refmt_test/features403.t/run.t b/test/features403.t/run.t similarity index 100% rename from refmt_test/features403.t/run.t rename to test/features403.t/run.t diff --git a/refmt_test/firstClassModules.t/input.re b/test/firstClassModules.t/input.re similarity index 100% rename from refmt_test/firstClassModules.t/input.re rename to test/firstClassModules.t/input.re diff --git a/refmt_test/firstClassModules.t/run.t b/test/firstClassModules.t/run.t similarity index 100% rename from refmt_test/firstClassModules.t/run.t rename to test/firstClassModules.t/run.t diff --git a/refmt_test/fixme.t/input.re b/test/fixme.t/input.re similarity index 100% rename from refmt_test/fixme.t/input.re rename to test/fixme.t/input.re diff --git a/refmt_test/fixme.t/run.t b/test/fixme.t/run.t similarity index 100% rename from refmt_test/fixme.t/run.t rename to test/fixme.t/run.t diff --git a/refmt_test/functionInfix.t/input.re b/test/functionInfix.t/input.re similarity index 100% rename from refmt_test/functionInfix.t/input.re rename to test/functionInfix.t/input.re diff --git a/refmt_test/functionInfix.t/run.t b/test/functionInfix.t/run.t similarity index 100% rename from refmt_test/functionInfix.t/run.t rename to test/functionInfix.t/run.t diff --git a/refmt_test/general-syntax-re.t/input.re b/test/general-syntax-re.t/input.re similarity index 100% rename from refmt_test/general-syntax-re.t/input.re rename to test/general-syntax-re.t/input.re diff --git a/refmt_test/general-syntax-re.t/run.t b/test/general-syntax-re.t/run.t similarity index 100% rename from refmt_test/general-syntax-re.t/run.t rename to test/general-syntax-re.t/run.t diff --git a/refmt_test/general-syntax-rei.t/input.rei b/test/general-syntax-rei.t/input.rei similarity index 100% rename from refmt_test/general-syntax-rei.t/input.rei rename to test/general-syntax-rei.t/input.rei diff --git a/refmt_test/general-syntax-rei.t/run.t b/test/general-syntax-rei.t/run.t similarity index 100% rename from refmt_test/general-syntax-rei.t/run.t rename to test/general-syntax-rei.t/run.t diff --git a/refmt_test/if.t/input.re b/test/if.t/input.re similarity index 100% rename from refmt_test/if.t/input.re rename to test/if.t/input.re diff --git a/refmt_test/if.t/run.t b/test/if.t/run.t similarity index 100% rename from refmt_test/if.t/run.t rename to test/if.t/run.t diff --git a/refmt_test/infix.t/input.re b/test/infix.t/input.re similarity index 100% rename from refmt_test/infix.t/input.re rename to test/infix.t/input.re diff --git a/refmt_test/infix.t/run.t b/test/infix.t/run.t similarity index 100% rename from refmt_test/infix.t/run.t rename to test/infix.t/run.t diff --git a/refmt_test/jsx.t/input.re b/test/jsx.t/input.re similarity index 100% rename from refmt_test/jsx.t/input.re rename to test/jsx.t/input.re diff --git a/refmt_test/jsx.t/run.t b/test/jsx.t/run.t similarity index 100% rename from refmt_test/jsx.t/run.t rename to test/jsx.t/run.t diff --git a/refmt_test/jsx_functor.t/input.re b/test/jsx_functor.t/input.re similarity index 100% rename from refmt_test/jsx_functor.t/input.re rename to test/jsx_functor.t/input.re diff --git a/refmt_test/jsx_functor.t/run.t b/test/jsx_functor.t/run.t similarity index 100% rename from refmt_test/jsx_functor.t/run.t rename to test/jsx_functor.t/run.t diff --git a/refmt_test/lineComments.t/input.re b/test/lineComments.t/input.re similarity index 100% rename from refmt_test/lineComments.t/input.re rename to test/lineComments.t/input.re diff --git a/refmt_test/lineComments.t/run.t b/test/lineComments.t/run.t similarity index 100% rename from refmt_test/lineComments.t/run.t rename to test/lineComments.t/run.t diff --git a/refmt_test/modules.t/input.re b/test/modules.t/input.re similarity index 100% rename from refmt_test/modules.t/input.re rename to test/modules.t/input.re diff --git a/refmt_test/modules.t/run.t b/test/modules.t/run.t similarity index 100% rename from refmt_test/modules.t/run.t rename to test/modules.t/run.t diff --git a/refmt_test/modules_no_semi.t/input.re b/test/modules_no_semi.t/input.re similarity index 100% rename from refmt_test/modules_no_semi.t/input.re rename to test/modules_no_semi.t/input.re diff --git a/refmt_test/modules_no_semi.t/run.t b/test/modules_no_semi.t/run.t similarity index 100% rename from refmt_test/modules_no_semi.t/run.t rename to test/modules_no_semi.t/run.t diff --git a/refmt_test/object.t/input.re b/test/object.t/input.re similarity index 100% rename from refmt_test/object.t/input.re rename to test/object.t/input.re diff --git a/refmt_test/object.t/run.t b/test/object.t/run.t similarity index 100% rename from refmt_test/object.t/run.t rename to test/object.t/run.t diff --git a/refmt_test/ocaml_identifiers.t/input.ml b/test/ocaml_identifiers.t/input.ml similarity index 100% rename from refmt_test/ocaml_identifiers.t/input.ml rename to test/ocaml_identifiers.t/input.ml diff --git a/refmt_test/ocaml_identifiers.t/run.t b/test/ocaml_identifiers.t/run.t similarity index 100% rename from refmt_test/ocaml_identifiers.t/run.t rename to test/ocaml_identifiers.t/run.t diff --git a/refmt_test/pexpFun.t/input.re b/test/pexpFun.t/input.re similarity index 100% rename from refmt_test/pexpFun.t/input.re rename to test/pexpFun.t/input.re diff --git a/refmt_test/pexpFun.t/run.t b/test/pexpFun.t/run.t similarity index 100% rename from refmt_test/pexpFun.t/run.t rename to test/pexpFun.t/run.t diff --git a/refmt_test/pipeFirst.t/input.re b/test/pipeFirst.t/input.re similarity index 100% rename from refmt_test/pipeFirst.t/input.re rename to test/pipeFirst.t/input.re diff --git a/refmt_test/pipeFirst.t/run.t b/test/pipeFirst.t/run.t similarity index 100% rename from refmt_test/pipeFirst.t/run.t rename to test/pipeFirst.t/run.t diff --git a/refmt_test/polymorphism.t/input.re b/test/polymorphism.t/input.re similarity index 100% rename from refmt_test/polymorphism.t/input.re rename to test/polymorphism.t/input.re diff --git a/refmt_test/polymorphism.t/run.t b/test/polymorphism.t/run.t similarity index 100% rename from refmt_test/polymorphism.t/run.t rename to test/polymorphism.t/run.t diff --git a/refmt_test/print-width-env.t b/test/print-width-env.t similarity index 100% rename from refmt_test/print-width-env.t rename to test/print-width-env.t diff --git a/refmt_test/sharpop.t/input.re b/test/sharpop.t/input.re similarity index 100% rename from refmt_test/sharpop.t/input.re rename to test/sharpop.t/input.re diff --git a/refmt_test/sharpop.t/run.t b/test/sharpop.t/run.t similarity index 100% rename from refmt_test/sharpop.t/run.t rename to test/sharpop.t/run.t diff --git a/refmt_test/singleLineCommentEof.t/input.re b/test/singleLineCommentEof.t/input.re similarity index 100% rename from refmt_test/singleLineCommentEof.t/input.re rename to test/singleLineCommentEof.t/input.re diff --git a/refmt_test/singleLineCommentEof.t/run.t b/test/singleLineCommentEof.t/run.t similarity index 100% rename from refmt_test/singleLineCommentEof.t/run.t rename to test/singleLineCommentEof.t/run.t diff --git a/refmt_test/testUtils.t/input.re b/test/testUtils.t/input.re similarity index 100% rename from refmt_test/testUtils.t/input.re rename to test/testUtils.t/input.re diff --git a/refmt_test/testUtils.t/run.t b/test/testUtils.t/run.t similarity index 100% rename from refmt_test/testUtils.t/run.t rename to test/testUtils.t/run.t diff --git a/refmt_test/trailing.t/input.re b/test/trailing.t/input.re similarity index 100% rename from refmt_test/trailing.t/input.re rename to test/trailing.t/input.re diff --git a/refmt_test/trailing.t/run.t b/test/trailing.t/run.t similarity index 100% rename from refmt_test/trailing.t/run.t rename to test/trailing.t/run.t diff --git a/refmt_test/trailingSpaces.t/input.re b/test/trailingSpaces.t/input.re similarity index 100% rename from refmt_test/trailingSpaces.t/input.re rename to test/trailingSpaces.t/input.re diff --git a/refmt_test/trailingSpaces.t/run.t b/test/trailingSpaces.t/run.t similarity index 100% rename from refmt_test/trailingSpaces.t/run.t rename to test/trailingSpaces.t/run.t diff --git a/refmt_test/typeDeclarations.t/input.re b/test/typeDeclarations.t/input.re similarity index 100% rename from refmt_test/typeDeclarations.t/input.re rename to test/typeDeclarations.t/input.re diff --git a/refmt_test/typeDeclarations.t/run.t b/test/typeDeclarations.t/run.t similarity index 100% rename from refmt_test/typeDeclarations.t/run.t rename to test/typeDeclarations.t/run.t diff --git a/refmt_test/uncurried.t/input.re b/test/uncurried.t/input.re similarity index 100% rename from refmt_test/uncurried.t/input.re rename to test/uncurried.t/input.re diff --git a/refmt_test/uncurried.t/run.t b/test/uncurried.t/run.t similarity index 100% rename from refmt_test/uncurried.t/run.t rename to test/uncurried.t/run.t diff --git a/refmt_test/variants.t/input.re b/test/variants.t/input.re similarity index 100% rename from refmt_test/variants.t/input.re rename to test/variants.t/input.re diff --git a/refmt_test/variants.t/run.t b/test/variants.t/run.t similarity index 100% rename from refmt_test/variants.t/run.t rename to test/variants.t/run.t diff --git a/refmt_test/version.t b/test/version.t similarity index 100% rename from refmt_test/version.t rename to test/version.t diff --git a/refmt_test/whitespace-re.t/input.re b/test/whitespace-re.t/input.re similarity index 100% rename from refmt_test/whitespace-re.t/input.re rename to test/whitespace-re.t/input.re diff --git a/refmt_test/whitespace-re.t/run.t b/test/whitespace-re.t/run.t similarity index 100% rename from refmt_test/whitespace-re.t/run.t rename to test/whitespace-re.t/run.t diff --git a/refmt_test/whitespace-rei.t/input.rei b/test/whitespace-rei.t/input.rei similarity index 100% rename from refmt_test/whitespace-rei.t/input.rei rename to test/whitespace-rei.t/input.rei diff --git a/refmt_test/whitespace-rei.t/run.t b/test/whitespace-rei.t/run.t similarity index 100% rename from refmt_test/whitespace-rei.t/run.t rename to test/whitespace-rei.t/run.t diff --git a/refmt_test/wrapping-re.t/input.re b/test/wrapping-re.t/input.re similarity index 100% rename from refmt_test/wrapping-re.t/input.re rename to test/wrapping-re.t/input.re diff --git a/refmt_test/wrapping-re.t/run.t b/test/wrapping-re.t/run.t similarity index 100% rename from refmt_test/wrapping-re.t/run.t rename to test/wrapping-re.t/run.t diff --git a/refmt_test/wrapping-rei.t/input.rei b/test/wrapping-rei.t/input.rei similarity index 100% rename from refmt_test/wrapping-rei.t/input.rei rename to test/wrapping-rei.t/input.rei diff --git a/refmt_test/wrapping-rei.t/run.t b/test/wrapping-rei.t/run.t similarity index 100% rename from refmt_test/wrapping-rei.t/run.t rename to test/wrapping-rei.t/run.t From 886c91f8cdfb0f9108007b28d01b0382973bc043 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 13 Mar 2023 17:33:38 +0100 Subject: [PATCH 04/20] Ignore _export from esy --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a0f8cb8ba..eee575a01 100644 --- a/.gitignore +++ b/.gitignore @@ -21,11 +21,15 @@ node_modules /bspacks/build/ /bspacks/ocaml-migrate-parsetree/ /bspacks/closure-compiler/ + # gitignored, but not npmignored. Published by `npm run prepublish` refmt.js refmt.map +.merlin + +# Esy _esy _esybuild _esyinstall -.merlin _release +_export/ From aa28e41c1c1d14f043c71250166998666b69e91a Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 13 Mar 2023 18:25:38 +0100 Subject: [PATCH 05/20] Use master branch instead of main --- .github/workflows/esy-ci.yml | 2 +- .github/workflows/opam-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml index 968872cff..840413387 100644 --- a/.github/workflows/esy-ci.yml +++ b/.github/workflows/esy-ci.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - main + - master concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/opam-ci.yml b/.github/workflows/opam-ci.yml index 20296e333..9f3da004c 100644 --- a/.github/workflows/opam-ci.yml +++ b/.github/workflows/opam-ci.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - main + - master concurrency: group: ${{ github.workflow }}-${{ github.ref }} From cebaf615d55f7421b40e0aa9210a7c703d604536 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 13 Mar 2023 20:55:18 +0100 Subject: [PATCH 06/20] Reduce install esy time --- .github/workflows/esy-ci.yml | 14 +++++++++++--- package-lock.json | 31 +++++++++++++++++++++++++++++++ package.json | 5 ++--- yarn.lock | 7 ------- 4 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 package-lock.json delete mode 100644 yarn.lock diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml index 840413387..557bd16a6 100644 --- a/.github/workflows/esy-ci.yml +++ b/.github/workflows/esy-ci.yml @@ -38,14 +38,22 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3 with: node-version: 16 cache: 'npm' - name: Install esy - run: npm install -g esy@0.6.12 + run: npm install --prefer-offline --audit false + + - name: Expose esy as binary + if: runner.os == 'Windows' + run: echo "node_modules\.bin" >> $GITHUB_PATH + + - name: Expose esy as binary + if: runner.os != 'Windows' + run: echo "node_modules/.bin" >> $GITHUB_PATH + - name: Restore global cache (~/.esy/source) id: global-cache diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..d5591ba97 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,31 @@ +{ + "name": "reason", + "version": "3.6.2", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "3.6.2", + "license": "MIT", + "dependencies": { + "esy": "^0.6.12" + } + }, + "node_modules/esy": { + "version": "0.6.12", + "resolved": "https://registry.npmjs.org/esy/-/esy-0.6.12.tgz", + "integrity": "sha512-EJAbVSOA+KRAK86ZY3tSZUpbh9cYaUxIITycXFJp9yuH+XAuLrCSdTJsH+wvQniRrzAgUBJ6B2vYC2hFB09lTQ==", + "hasInstallScript": true, + "bin": { + "esy": "bin/esy" + } + } + }, + "dependencies": { + "esy": { + "version": "0.6.12", + "resolved": "https://registry.npmjs.org/esy/-/esy-0.6.12.tgz", + "integrity": "sha512-EJAbVSOA+KRAK86ZY3tSZUpbh9cYaUxIITycXFJp9yuH+XAuLrCSdTJsH+wvQniRrzAgUBJ6B2vYC2hFB09lTQ==" + } + } +} diff --git a/package.json b/package.json index 956ced6d3..3989f671b 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,8 @@ ], "license": "MIT", "homepage": "https://github.com/reasonml/reason", - "dependencies": {}, - "devDependencies": { - "bs-platform": "1.9.3" + "dependencies": { + "esy": "^0.6.12" }, "scripts": { "prepublishOnly": "cp .dune-for-prepublish dune && esy @jsoo && ./js/closurefy.sh" diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 62569f061..000000000 --- a/yarn.lock +++ /dev/null @@ -1,7 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -bs-platform@1.9.3: - version "1.9.3" - resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-1.9.3.tgz#8c28976ea206165183f0e8bb2c3cfd8a04120a8a" From 088576aa67f66d6661b3e75c73466d603ea2ba9f Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Fri, 17 Mar 2023 13:09:00 +0100 Subject: [PATCH 07/20] Re-arrange esy install --- .github/workflows/esy-ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml index 557bd16a6..9c68359fd 100644 --- a/.github/workflows/esy-ci.yml +++ b/.github/workflows/esy-ci.yml @@ -54,7 +54,6 @@ jobs: if: runner.os != 'Windows' run: echo "node_modules/.bin" >> $GITHUB_PATH - - name: Restore global cache (~/.esy/source) id: global-cache uses: actions/cache/restore@v3 @@ -62,9 +61,6 @@ jobs: path: ~/.esy/source key: esy-source-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }} - - name: Install dependencies - run: esy install - - name: Print esy cache id: print_esy_cache run: echo "ESY_CACHE=$(node .github/workflows/print-esy-cache.js)" >> $GITHUB_OUTPUT; @@ -85,6 +81,9 @@ jobs: esy import-dependencies _export rm -rf _export + - name: Install dependencies + run: esy install + - name: Build dependencies run: esy build-dependencies From 9cf446f002e43eecac66aa98abecaf78ccb9a317 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Fri, 17 Mar 2023 13:29:27 +0100 Subject: [PATCH 08/20] Update package json and install esy normally --- .github/workflows/esy-ci.yml | 11 +---------- package-lock.json | 23 +++++++++++++---------- package.json | 4 ++-- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml index 9c68359fd..28a8e750b 100644 --- a/.github/workflows/esy-ci.yml +++ b/.github/workflows/esy-ci.yml @@ -41,18 +41,9 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - cache: 'npm' - name: Install esy - run: npm install --prefer-offline --audit false - - - name: Expose esy as binary - if: runner.os == 'Windows' - run: echo "node_modules\.bin" >> $GITHUB_PATH - - - name: Expose esy as binary - if: runner.os != 'Windows' - run: echo "node_modules/.bin" >> $GITHUB_PATH + run: npm install -g esy@0.6.12 - name: Restore global cache (~/.esy/source) id: global-cache diff --git a/package-lock.json b/package-lock.json index d5591ba97..3e9015a4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,27 +5,30 @@ "requires": true, "packages": { "": { + "name": "reason", "version": "3.6.2", "license": "MIT", "dependencies": { - "esy": "^0.6.12" + "bs-platform": "1.9.3" } }, - "node_modules/esy": { - "version": "0.6.12", - "resolved": "https://registry.npmjs.org/esy/-/esy-0.6.12.tgz", - "integrity": "sha512-EJAbVSOA+KRAK86ZY3tSZUpbh9cYaUxIITycXFJp9yuH+XAuLrCSdTJsH+wvQniRrzAgUBJ6B2vYC2hFB09lTQ==", + "node_modules/bs-platform": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-1.9.3.tgz", + "integrity": "sha512-Y37L43zKPoAJh8t7fbcxLlMYPvsjGR/CZrOF5Mr9tVBq53OaRmSXF9rDRYHjdMY8Nhpp99f0AD8aKnrr/cH6jg==", "hasInstallScript": true, "bin": { - "esy": "bin/esy" + "bsb": "bin/bsb", + "bsc": "bin/bsc", + "bsrefmt": "bin/bsrefmt" } } }, "dependencies": { - "esy": { - "version": "0.6.12", - "resolved": "https://registry.npmjs.org/esy/-/esy-0.6.12.tgz", - "integrity": "sha512-EJAbVSOA+KRAK86ZY3tSZUpbh9cYaUxIITycXFJp9yuH+XAuLrCSdTJsH+wvQniRrzAgUBJ6B2vYC2hFB09lTQ==" + "bs-platform": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-1.9.3.tgz", + "integrity": "sha512-Y37L43zKPoAJh8t7fbcxLlMYPvsjGR/CZrOF5Mr9tVBq53OaRmSXF9rDRYHjdMY8Nhpp99f0AD8aKnrr/cH6jg==" } } } diff --git a/package.json b/package.json index 3989f671b..37856b401 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ ], "license": "MIT", "homepage": "https://github.com/reasonml/reason", - "dependencies": { - "esy": "^0.6.12" + "devDependencies": { + "bs-platform": "1.9.3" }, "scripts": { "prepublishOnly": "cp .dune-for-prepublish dune && esy @jsoo && ./js/closurefy.sh" From 2939f447a6ea64191ae1778cf7c88e7f0dc4c08a Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Fri, 17 Mar 2023 13:43:22 +0100 Subject: [PATCH 09/20] Install before importing deps --- .github/workflows/esy-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml index 28a8e750b..73d7ca02c 100644 --- a/.github/workflows/esy-ci.yml +++ b/.github/workflows/esy-ci.yml @@ -66,15 +66,15 @@ jobs: key: esy-build-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }} restore-keys: esy-build-${{ matrix.os }}- + - name: Install dependencies + run: esy install + - name: Import dependencies if: steps.deps-cache.outputs.cache-hit == 'true' run: | esy import-dependencies _export rm -rf _export - - name: Install dependencies - run: esy install - - name: Build dependencies run: esy build-dependencies From c77cf2dbcd7cd75240df1aec84f0be9e353d046a Mon Sep 17 00:00:00 2001 From: David Sancho Date: Sat, 18 Mar 2023 15:06:59 +0100 Subject: [PATCH 10/20] Fix top level extensions (#2693) --- HISTORY.md | 1 + .../unit_tests/expected_output/extensions.re | 2 ++ formatTest/unit_tests/input/extensions.re | 2 ++ src/reason-parser/reason_pprint_ast.ml | 31 +++++++++++++------ test/extensions.t/input.re | 21 ++++++++++--- test/extensions.t/run.t | 21 ++++++++++--- 6 files changed, 61 insertions(+), 17 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 9144831a0..fd45cb33e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,7 @@ ## 3.9 (unreleased) - Fix missing patterns around contraint pattern (a pattern with a type annotation). +- Fix top level extension printing ## 3.8.2 diff --git a/formatTest/unit_tests/expected_output/extensions.re b/formatTest/unit_tests/expected_output/extensions.re index 3660f1e6b..a6d5d84d8 100644 --- a/formatTest/unit_tests/expected_output/extensions.re +++ b/formatTest/unit_tests/expected_output/extensions.re @@ -350,6 +350,8 @@ let () = { something_else(); }; +let f = [%bs.raw x => x]; + [%bs.raw x => x]; let work = () => { diff --git a/formatTest/unit_tests/input/extensions.re b/formatTest/unit_tests/input/extensions.re index 218f02e37..8024f3c36 100644 --- a/formatTest/unit_tests/input/extensions.re +++ b/formatTest/unit_tests/input/extensions.re @@ -348,6 +348,8 @@ let () = { something_else(); }; +let f = [%bs.raw x => x]; + [%bs.raw x => x]; let work = () => { diff --git a/src/reason-parser/reason_pprint_ast.ml b/src/reason-parser/reason_pprint_ast.ml index 06fe241b1..18b03f196 100644 --- a/src/reason-parser/reason_pprint_ast.ml +++ b/src/reason-parser/reason_pprint_ast.ml @@ -7576,29 +7576,42 @@ let printer = object(self:'self) | Pmod_constraint _ | Pmod_structure _ -> self#simple_module_expr x - method structure structureItems = + (* We don't have any way to know if an extension is placed at the top level by the parsetree + while there's a difference syntactically (% for structure_items/expressons and %% for top_level). + This small fn detects this particular case (structure > structure_item > extension > value) and + prints with double % *) + let structure_item item = + match item.pstr_desc with + | Pstr_extension ((extension, PStr [item]), attrs) -> + begin match item.pstr_desc with + (* In case of a value, the extension gets inlined `let%private a = 1` *) + | Pstr_value (rf, vb_list) -> self#bindings ~extension (rf, vb_list) + | _ -> self#attach_std_item_attrs attrs (self#payload "%%" extension (PStr [item])) + end + | _ -> self#structure_item item + in match structureItems with | [] -> atom "" - | first::_ as structureItems -> + | first :: _ as structureItems -> let last = match (List.rev structureItems) with | last::_ -> last | [] -> assert false in let loc_start = first.pstr_loc.loc_start in let loc_end = last.pstr_loc.loc_end in let items = groupAndPrint - ~xf:self#structure_item + ~xf:structure_item ~getLoc:(fun x -> x.pstr_loc) ~comments:self#comments structureItems in source_map ~loc:{loc_start; loc_end; loc_ghost = false} (makeList - ~postSpace:true - ~break:Always_rec - ~indent:0 - ~inline:(true, false) - ~sep:(SepFinal (";", ";")) - items) + ~postSpace:true + ~break:Always_rec + ~indent:0 + ~inline:(true, false) + ~sep:(SepFinal (";", ";")) + items) (* How do modules become parsed? diff --git a/test/extensions.t/input.re b/test/extensions.t/input.re index 218f02e37..2bbeab3c2 100644 --- a/test/extensions.t/input.re +++ b/test/extensions.t/input.re @@ -348,16 +348,29 @@ let () = { something_else(); }; -[%bs.raw x => x]; - let work = () => { open Syntax; let%bind name = x; name; }; -/** header */ -[%raw "console.log(42)"]; +/* Extensions can have % or %% at the top-level */ + +[%bs.raw x => x]; + +[%%bs.raw x => x]; + +[%%randomExtension "with string payload"]; + +[%%randomExtension { with_obj: 33 }]; + +[%randomExtension { with_obj: 33 }]; + +/** with a comment on top */ +[%%raw "console.log(42)"]; + +/* extensions live under expresions with only one % */ +let f = [%bs.raw x => x]; /* https://github.com/facebook/reason/issues/2032 */ let predicate = diff --git a/test/extensions.t/run.t b/test/extensions.t/run.t index 735b93f2b..17f1f283f 100644 --- a/test/extensions.t/run.t +++ b/test/extensions.t/run.t @@ -352,16 +352,29 @@ Format extensions something_else(); }; - [%bs.raw x => x]; - let work = () => { open Syntax; let%bind name = x; name; }; - /** header */ - [%raw "console.log(42)"]; + /* Extensions can have % or %% at the top-level */ + + [%bs.raw x => x]; + + [%%bs.raw x => x]; + + [%%randomExtension "with string payload"]; + + [%%randomExtension {with_obj: 33}]; + + [%randomExtension {with_obj: 33}]; + + /** with a comment on top */ + [%%raw "console.log(42)"]; + + /* extensions live under expresions with only one % */ + let f = [%bs.raw x => x]; /* https://github.com/facebook/reason/issues/2032 */ let predicate = From 65ba873846bf328640b736cc9cb751edfccf4774 Mon Sep 17 00:00:00 2001 From: David Sancho Date: Sat, 18 Mar 2023 19:33:19 +0100 Subject: [PATCH 11/20] Make sure win doesnt break when importing (#2700) --- .github/workflows/esy-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml index 73d7ca02c..9f68be9fa 100644 --- a/.github/workflows/esy-ci.yml +++ b/.github/workflows/esy-ci.yml @@ -71,6 +71,8 @@ jobs: - name: Import dependencies if: steps.deps-cache.outputs.cache-hit == 'true' + # Don't crash the run if esy cache import fails - mostly happens on Windows + continue-on-error: true run: | esy import-dependencies _export rm -rf _export From 0ce98e0cb1b07eecba948a27006787b33d93f0ed Mon Sep 17 00:00:00 2001 From: David Sancho Date: Mon, 20 Mar 2023 20:10:30 +0100 Subject: [PATCH 12/20] Migrate tests to cram suite (#2694) * test(refmt) Add basic type-check tests to cram * test(refmt) Make ocamlc a valid windows script * test(refmt) Hide refmt_impl.exe under run-refmt.sh * test(refmt) Remove run-refmt * test(refmt) Fix path for run-ocamlc * test(refmt) Remove ocamlc check * refactor(refmt) Make run-ocamlc available to run everywhere * refactor(refmt) Remove failing dir * fix(refmt_test) cd work in windows * test(refmt) Check ocamlc instalation working * test(refmt) Remove ocamlc check * test(refmt) Remove set in run-ocamlc * test(refmt) Enable debug to see Windows command * test(refmt) Remove binary from refmt * test(refmt) Revert binary from refmt * test(refmt) Move to direct path * test(refmt) Try ./ and ocamlopt * test(refmt) export readlink * test(refmt) Assign variable based on the path * test(refmt) Try with bash * test(refmt) Add readlink to REFMT * test(refmt) Add batch and sh script for refmt * test(refmt) Setup refmt_impl as binary * test(refmt) Remove batch and sh wrappers * test(refmt) Remove --print-width and set REFMT_PRINT_WIDTH as env var * test(refmt) Trying single quote, wat * test(refmt) buildInSource and run refmt in cram * test(refmt) Revert buildInSource and run esy x * test(refmt) Remove refmt_impl for print w and debug PATH * test(refmt) Add -p reason * test(refmt) Update dune * test(refmt) Remove logging on PATH * Add idempotency test in basics * Add error test * Add testOprint case * Moved and renamed testOprint into refmt_test/ folder * Remove OCaml-versioned based cram tests * Add backportSyntax * Add rtopIntegration * Move back testOprint into src * Trim rtop output * Remove the begining of the error message for OCaml 4.03 * Try tests based on ocaml version * Fix test 4.03 * Fix test for ocaml_version * Ensure works with 4.03 * Move test to 4.07 * Build all packages needed for tests in release mode * Don't build testOprint * Move testOprint inside refmt_test and rename to typedtree_printer * Ensure works with 4.08 * Remove test.re from version test * Revert rename on reason-parser-test * Revert debugging on test.sh * Improve safety for rtop * Migrate all error cases * Migrate all oprint tests * Migrate all typecheck tests * Clean up tests * Enable 4.03 in CI * Move newast to 4.06 * Fix 4.10 tests * Move mlsyntax to 4.08 * Move type-trailing to 4.04 * Remove 4.03 * Fix 4.06 test * Fix 4.08 tests * Fix 4.10 tests * Fix 4.12 tests * Remove 4.04 since we have them on 4.06 * Update ocamlfind to 1.9.6 * Rollback ocamlfind to 1.9.5 * Disable tests on windows in 4.12 * Remove debugging * Change path and condition * Disable all tests in win * Install right OCaml in esy ci * Explain how to run different ocaml versions for testing * Remove empty space from pattern matching --- .ci/build-platform.yml | 2 +- .github/workflows/esy-ci.yml | 3 + esy.json | 6 +- esy.lock/index.json | 554 ++++++------- esy.lock/opam/camomile.1.0.2/opam | 35 - esy.lock/opam/charInfo_width.1.1.0/opam | 27 - .../opam | 19 +- esy.lock/opam/{dune.2.9.3 => dune.3.6.2}/opam | 17 +- .../opam | 41 +- esy.lock/opam/logs.0.7.0/opam | 66 ++ esy.lock/opam/lwt_log.1.1.1/opam | 30 - esy.lock/opam/menhir.20220210/opam | 2 +- esy.lock/opam/menhirLib.20220210/opam | 2 +- esy.lock/opam/menhirSdk.20220210/opam | 2 +- .../opam | 6 +- esy.lock/opam/ocamlfind.1.9.5/opam | 2 +- .../opam | 8 +- esy.lock/opam/{odoc.2.1.1 => odoc.2.2.0}/opam | 17 +- .../opam/{topkg.1.0.5 => topkg.1.0.7}/opam | 41 +- esy.lock/opam/uchar.0.0.2/opam | 36 + .../opam/{utop.2.9.2 => utop.2.11.0}/opam | 31 +- esy.lock/opam/uucp.15.0.0/opam | 55 ++ esy.lock/opam/uuseg.15.0.0/opam | 57 ++ esy.lock/opam/{zed.3.1.0 => zed.3.2.1}/opam | 58 +- .../files/winpatch.patch | 0 .../package.json | 0 .../files/winpatch.patch | 11 + .../package.json | 11 + formatTest/test.sh | 6 +- test/4.06/attributes.t | 34 + test/4.06/dune | 5 + test/4.06/error-comments.t | 9 + test/4.06/error-lowercase_module.t | 9 + test/4.06/error-lowercase_module_rec.t | 9 + test/4.06/error-reservedField.t | 9 + test/4.06/error-reservedRecord.t | 9 + test/4.06/error-reservedRecordPunned.t | 9 + test/4.06/error-reservedRecordType.t | 12 + test/4.06/error-reservedRecordTypePunned.t | 9 + test/4.06/error-syntaxError.t | 9 + test/4.06/objects.t | 51 ++ test/4.06/type-trailing.t/input.re | 182 +++++ test/4.06/type-trailing.t/run.t | 11 + test/4.06/typecheck-module-and-class.t | 32 + test/4.08/dune | 6 + test/4.08/error-comments.t | 12 + test/4.08/error-lowercase_module.t | 12 + test/4.08/error-lowercase_module_rec.t | 12 + test/4.08/error-reservedField.t | 12 + test/4.08/error-reservedRecord.t | 12 + test/4.08/error-reservedRecordPunned.t | 14 + test/4.08/error-reservedRecordType.t | 15 + test/4.08/error-reservedRecordTypePunned.t | 12 + test/4.08/error-syntaxError.t | 12 + test/4.08/mlSyntax.t/input.ml | 86 ++ test/4.08/mlSyntax.t/run.t | 19 + test/4.08/type-jsx.t/input.re | 458 +++++++++++ test/4.08/type-jsx.t/run.t | 15 + test/4.08/typecheck-features.t | 34 + test/4.10/attributes-re.t/input.re | 664 ++++++++++++++++ test/4.10/attributes-re.t/run.t | 15 + test/4.10/dune | 14 + test/4.10/local-openings.t/input.ml | 14 + test/4.10/local-openings.t/run.t | 15 + test/4.10/reasonComments-re.t/input.re | 736 ++++++++++++++++++ test/4.10/reasonComments-re.t/run.t | 35 + test/4.10/type-jsx.t/input.re | 458 +++++++++++ test/4.10/type-jsx.t/run.t | 15 + test/4.10/typecheck-let-ops.t | 31 + test/4.12/attributes-re.t/input.re | 664 ++++++++++++++++ test/4.12/attributes-re.t/run.t | 15 + test/4.12/dune | 12 + test/4.12/local-openings.t/input.ml | 14 + test/4.12/local-openings.t/run.t | 15 + test/4.12/reasonComments-re.t/input.re | 736 ++++++++++++++++++ test/4.12/reasonComments-re.t/run.t | 35 + test/4.12/type-jsx.t/input.re | 458 +++++++++++ test/4.12/type-jsx.t/run.t | 15 + test/4.12/typecheck-let-ops.t | 31 + test/README.md | 26 +- test/arityConversion.t/arity.txt | 7 + test/arityConversion.t/input.ml | 43 + test/arityConversion.t/run.t | 11 + test/assert.t/run.t | 2 +- test/attributes-rei.t/input.rei | 73 ++ test/attributes-rei.t/run.t | 11 + test/backportSyntax.t/input.re | 21 + test/backportSyntax.t/run.t | 6 + test/basic.t/input.re | 142 ++++ test/basic.t/run.t | 63 ++ test/basicStructures.t/run.t | 2 +- test/basics.t/input.re | 98 +++ test/basics.t/run.t | 11 + test/basics_no_semi.t/input.re | 88 +++ test/basics_no_semi.t/run.t | 11 + test/bigarray.t/run.t | 2 +- test/bigarraySyntax.t/input.re | 27 + test/bigarraySyntax.t/run.t | 11 + test/bucklescript.t/run.t | 2 +- test/class.t/input.re | 36 + test/class.t/run.t | 22 + test/class_types.t/run.t | 2 +- test/comments-ml.t/input.ml | 128 +++ test/comments-ml.t/run.t | 18 + test/comments-mli.t/input.mli | 41 + test/comments-mli.t/run.t | 11 + test/dune | 13 +- test/emptyFileComment.t/run.t | 2 +- test/escapesInStrings.t/run.t | 2 +- test/extensions.t/run.t | 2 +- test/externals.t/run.t | 2 +- test/firstClassModules.t/run.t | 2 +- test/fixme.t/run.t | 2 +- test/functionInfix.t/run.t | 2 +- test/general-syntax-re.t/run.t | 2 +- test/general-syntax-rei.t/run.t | 2 +- test/{features403.t => generics.t}/input.re | 0 test/{features403.t => generics.t}/run.t | 2 +- test/if.t/run.t | 2 +- test/imperative.t/input.re | 76 ++ test/imperative.t/run.t | 11 + test/infix.t/run.t | 2 +- test/inlineRecord.t/input.re | 11 + test/inlineRecord.t/run.t | 8 + test/jsx.t/run.t | 2 +- test/jsx_functor.t/run.t | 2 +- test/knownMlIssues.t/input.ml | 35 + test/knownMlIssues.t/run.t | 11 + test/knownReIssues.t/input.re | 23 + test/knownReIssues.t/run.t | 11 + test/lazy.t/input.re | 27 + test/lazy.t/run.t | 11 + test/letop.t/input.re | 28 + test/letop.t/run.t | 11 + test/lib/dune | 11 + test/lib/typedtreePrinter.cppo.ml | 59 ++ test/lineComments.t/run.t | 2 +- test/mlVariants.t/input.ml | 26 + test/mlVariants.t/run.t | 11 + test/modules.t/run.t | 2 +- test/modules_no_semi.t/run.t | 2 +- test/mutation.t/input.re | 49 ++ test/mutation.t/run.t | 11 + test/object.t/run.t | 2 +- test/ocaml_identifiers.t/run.t | 2 +- test/oo.t/input.re | 334 ++++++++ test/oo.t/run.t | 11 + test/patternMatching.t/input.re | 266 +++++++ test/patternMatching.t/run.t | 11 + test/pervasive.t/input.mli | 5 + test/pervasive.t/run.t | 11 + test/pexpFun.t/run.t | 2 +- test/pipeFirst.t/run.t | 2 +- test/polymorphism.t/run.t | 2 +- test/print-width-env.t | 4 +- test/reasonComments-rei.t/input.rei | 3 + test/reasonComments-rei.t/run.t | 11 + test/rtopIntegration.t | 17 + test/sequences.t/input.re | 81 ++ test/sequences.t/run.t | 11 + test/sharpop.t/run.t | 2 +- test/singleLineCommentEof.t/run.t | 2 +- test/testUtils.t/run.t | 2 +- test/trailing.t/run.t | 2 +- test/trailingSpaces.t/run.t | 2 +- test/type-pipeFirst.t/input.re | 168 ++++ test/type-pipeFirst.t/run.t | 11 + test/typeDeclarations.t/run.t | 2 +- test/typeParameters.t/input.re | 80 ++ test/typeParameters.t/run.t | 11 + test/uncurried.t/run.t | 2 +- test/variants.t/run.t | 2 +- test/version.t | 4 +- test/whitespace-re.t/run.t | 2 +- test/whitespace-rei.t/run.t | 2 +- test/wrapping-re.t/run.t | 2 +- test/wrapping-rei.t/run.t | 2 +- 177 files changed, 8216 insertions(+), 516 deletions(-) delete mode 100644 esy.lock/opam/camomile.1.0.2/opam delete mode 100644 esy.lock/opam/charInfo_width.1.1.0/opam rename esy.lock/opam/{dune-configurator.2.9.3 => dune-configurator.3.7.0}/opam (66%) rename esy.lock/opam/{dune.2.9.3 => dune.3.6.2}/opam (73%) rename esy.lock/opam/{lambda-term.3.2.0 => lambda-term.3.3.1}/opam (59%) create mode 100644 esy.lock/opam/logs.0.7.0/opam delete mode 100644 esy.lock/opam/lwt_log.1.1.1/opam rename esy.lock/opam/{ocamlbuild.0.14.1 => ocamlbuild.0.14.2}/opam (83%) rename esy.lock/opam/{odoc-parser.1.0.1 => odoc-parser.2.0.0}/opam (79%) rename esy.lock/opam/{odoc.2.1.1 => odoc.2.2.0}/opam (67%) rename esy.lock/opam/{topkg.1.0.5 => topkg.1.0.7}/opam (66%) create mode 100644 esy.lock/opam/uchar.0.0.2/opam rename esy.lock/opam/{utop.2.9.2 => utop.2.11.0}/opam (66%) create mode 100644 esy.lock/opam/uucp.15.0.0/opam create mode 100644 esy.lock/opam/uuseg.15.0.0/opam rename esy.lock/opam/{zed.3.1.0 => zed.3.2.1}/opam (55%) rename esy.lock/overrides/{opam__s__ocamlbuild_opam__c__0.14.1_opam_override => opam__s__ocamlbuild_opam__c__0.14.2_opam_override}/files/winpatch.patch (100%) rename esy.lock/overrides/{opam__s__ocamlbuild_opam__c__0.14.1_opam_override => opam__s__ocamlbuild_opam__c__0.14.2_opam_override}/package.json (100%) create mode 100644 esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/files/winpatch.patch create mode 100644 esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/package.json create mode 100644 test/4.06/attributes.t create mode 100644 test/4.06/dune create mode 100644 test/4.06/error-comments.t create mode 100644 test/4.06/error-lowercase_module.t create mode 100644 test/4.06/error-lowercase_module_rec.t create mode 100644 test/4.06/error-reservedField.t create mode 100644 test/4.06/error-reservedRecord.t create mode 100644 test/4.06/error-reservedRecordPunned.t create mode 100644 test/4.06/error-reservedRecordType.t create mode 100644 test/4.06/error-reservedRecordTypePunned.t create mode 100644 test/4.06/error-syntaxError.t create mode 100644 test/4.06/objects.t create mode 100644 test/4.06/type-trailing.t/input.re create mode 100644 test/4.06/type-trailing.t/run.t create mode 100644 test/4.06/typecheck-module-and-class.t create mode 100644 test/4.08/dune create mode 100644 test/4.08/error-comments.t create mode 100644 test/4.08/error-lowercase_module.t create mode 100644 test/4.08/error-lowercase_module_rec.t create mode 100644 test/4.08/error-reservedField.t create mode 100644 test/4.08/error-reservedRecord.t create mode 100644 test/4.08/error-reservedRecordPunned.t create mode 100644 test/4.08/error-reservedRecordType.t create mode 100644 test/4.08/error-reservedRecordTypePunned.t create mode 100644 test/4.08/error-syntaxError.t create mode 100644 test/4.08/mlSyntax.t/input.ml create mode 100644 test/4.08/mlSyntax.t/run.t create mode 100644 test/4.08/type-jsx.t/input.re create mode 100644 test/4.08/type-jsx.t/run.t create mode 100644 test/4.08/typecheck-features.t create mode 100644 test/4.10/attributes-re.t/input.re create mode 100644 test/4.10/attributes-re.t/run.t create mode 100644 test/4.10/dune create mode 100644 test/4.10/local-openings.t/input.ml create mode 100644 test/4.10/local-openings.t/run.t create mode 100644 test/4.10/reasonComments-re.t/input.re create mode 100644 test/4.10/reasonComments-re.t/run.t create mode 100644 test/4.10/type-jsx.t/input.re create mode 100644 test/4.10/type-jsx.t/run.t create mode 100644 test/4.10/typecheck-let-ops.t create mode 100644 test/4.12/attributes-re.t/input.re create mode 100644 test/4.12/attributes-re.t/run.t create mode 100644 test/4.12/dune create mode 100644 test/4.12/local-openings.t/input.ml create mode 100644 test/4.12/local-openings.t/run.t create mode 100644 test/4.12/reasonComments-re.t/input.re create mode 100644 test/4.12/reasonComments-re.t/run.t create mode 100644 test/4.12/type-jsx.t/input.re create mode 100644 test/4.12/type-jsx.t/run.t create mode 100644 test/4.12/typecheck-let-ops.t create mode 100644 test/arityConversion.t/arity.txt create mode 100644 test/arityConversion.t/input.ml create mode 100644 test/arityConversion.t/run.t create mode 100644 test/attributes-rei.t/input.rei create mode 100644 test/attributes-rei.t/run.t create mode 100644 test/backportSyntax.t/input.re create mode 100644 test/backportSyntax.t/run.t create mode 100644 test/basic.t/input.re create mode 100644 test/basic.t/run.t create mode 100644 test/basics.t/input.re create mode 100644 test/basics.t/run.t create mode 100644 test/basics_no_semi.t/input.re create mode 100644 test/basics_no_semi.t/run.t create mode 100644 test/bigarraySyntax.t/input.re create mode 100644 test/bigarraySyntax.t/run.t create mode 100644 test/class.t/input.re create mode 100644 test/class.t/run.t create mode 100644 test/comments-ml.t/input.ml create mode 100644 test/comments-ml.t/run.t create mode 100644 test/comments-mli.t/input.mli create mode 100644 test/comments-mli.t/run.t rename test/{features403.t => generics.t}/input.re (100%) rename test/{features403.t => generics.t}/run.t (93%) create mode 100644 test/imperative.t/input.re create mode 100644 test/imperative.t/run.t create mode 100644 test/inlineRecord.t/input.re create mode 100644 test/inlineRecord.t/run.t create mode 100644 test/knownMlIssues.t/input.ml create mode 100644 test/knownMlIssues.t/run.t create mode 100644 test/knownReIssues.t/input.re create mode 100644 test/knownReIssues.t/run.t create mode 100644 test/lazy.t/input.re create mode 100644 test/lazy.t/run.t create mode 100644 test/letop.t/input.re create mode 100644 test/letop.t/run.t create mode 100644 test/lib/dune create mode 100644 test/lib/typedtreePrinter.cppo.ml create mode 100644 test/mlVariants.t/input.ml create mode 100644 test/mlVariants.t/run.t create mode 100644 test/mutation.t/input.re create mode 100644 test/mutation.t/run.t create mode 100644 test/oo.t/input.re create mode 100644 test/oo.t/run.t create mode 100644 test/patternMatching.t/input.re create mode 100644 test/patternMatching.t/run.t create mode 100644 test/pervasive.t/input.mli create mode 100644 test/pervasive.t/run.t create mode 100644 test/reasonComments-rei.t/input.rei create mode 100644 test/reasonComments-rei.t/run.t create mode 100644 test/rtopIntegration.t create mode 100644 test/sequences.t/input.re create mode 100644 test/sequences.t/run.t create mode 100644 test/type-pipeFirst.t/input.re create mode 100644 test/type-pipeFirst.t/run.t create mode 100644 test/typeParameters.t/input.re create mode 100644 test/typeParameters.t/run.t diff --git a/.ci/build-platform.yml b/.ci/build-platform.yml index d26227e53..cd833fdc7 100644 --- a/.ci/build-platform.yml +++ b/.ci/build-platform.yml @@ -66,7 +66,7 @@ jobs: - template: utils/create-docs.yml - script: "esy test" displayName: "Test command" - - script: "esy b dune runtest -p reason" + - script: "esy b dune runtest -p reason,rtop" displayName: "Cram tests command" - powershell: esy x env continueOnError: true diff --git a/.github/workflows/esy-ci.yml b/.github/workflows/esy-ci.yml index 9f68be9fa..74161d7bd 100644 --- a/.github/workflows/esy-ci.yml +++ b/.github/workflows/esy-ci.yml @@ -66,6 +66,9 @@ jobs: key: esy-build-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }} restore-keys: esy-build-${{ matrix.os }}- + - name: Instal OCaml ${{ matrix.ocaml-compiler }} + run: esy add ocaml@${{ matrix.ocaml-compiler }} + - name: Install dependencies run: esy install diff --git a/esy.json b/esy.json index e73e58bc7..8070fbee2 100644 --- a/esy.json +++ b/esy.json @@ -5,11 +5,11 @@ "license": "MIT", "version": "3.8.1", "dependencies": { - "@opam/dune": "2.9.3", + "@opam/dune": "3.6.2", "@opam/fix": "*", "@opam/menhir": " >= 20180523.0.0", "@opam/merlin-extend": " >= 0.6", - "@opam/ocamlfind": "*", + "@opam/ocamlfind": "1.9.5", "@opam/ppx_derivers": "< 2.0.0", "@opam/result": "*", "@opam/utop": " >= 1.17.0", @@ -37,7 +37,7 @@ "SYSTEM_PULLREQUEST_MERGEDAT": { "scope": "global", "val": "d" } }, "release": { - "bin": { "rtop": "rtop", "refmt": "refmt" }, + "bin": ["rtop", "refmt"], "includePackages": [ "root", "@opam/base-bytes", "@opam/base-threads", "@opam/base-unix", "@opam/camomile", "@opam/lambda-term", "@opam/lwt", "@opam/lwt_log", diff --git a/esy.lock/index.json b/esy.lock/index.json index ad06ec858..8ce1a3c43 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "73f02c92ad250c779b1e635654b45ea0", + "checksum": "8e1a343c58ed6dd5c0179b308da5df90", "root": "reason-cli@link-dev:./esy.json", "node": { "reason-cli@link-dev:./esy.json": { @@ -9,16 +9,16 @@ "source": { "type": "link-dev", "path": ".", "manifest": "esy.json" }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/utop@opam:2.9.2@b7356e33", + "ocaml@4.12.1001@d41d8cd9", "@opam/utop@opam:2.11.0@bd245e47", "@opam/result@opam:1.5@1c6a6533", "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "@opam/ocamlfind@opam:1.9.5@c23112ba", + "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/merlin-extend@opam:0.6.1@7d979feb", - "@opam/menhir@opam:20220210@ff87a93b", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@4d52c673" + "@opam/menhir@opam:20220210@ff5ea9a7", + "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:3.6.2@e55a9c34" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/odoc@opam:2.1.1@ccba8a4e" + "ocaml@4.12.1001@d41d8cd9", "@opam/odoc@opam:2.2.0@020767ad" ] }, "ocaml@4.12.1001@d41d8cd9": { @@ -35,37 +35,36 @@ "dependencies": [], "devDependencies": [] }, - "@opam/zed@opam:3.1.0@6e750e3e": { - "id": "@opam/zed@opam:3.1.0@6e750e3e", + "@opam/zed@opam:3.2.1@276736c0": { + "id": "@opam/zed@opam:3.2.1@276736c0", "name": "@opam/zed", - "version": "opam:3.1.0", + "version": "opam:3.2.1", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/51/51e8676ba972e5ad727633c161e404b1#md5:51e8676ba972e5ad727633c161e404b1", - "archive:https://github.com/ocaml-community/zed/archive/3.1.0.tar.gz#md5:51e8676ba972e5ad727633c161e404b1" + "archive:https://opam.ocaml.org/cache/sha256/14/141091d21a03e92eed0efd96ece150c08c619bfbcd1b153a42d8a261b2b57f53#sha256:141091d21a03e92eed0efd96ece150c08c619bfbcd1b153a42d8a261b2b57f53", + "archive:https://github.com/ocaml-community/zed/releases/download/3.2.1/zed-3.2.1.tbz#sha256:141091d21a03e92eed0efd96ece150c08c619bfbcd1b153a42d8a261b2b57f53" ], "opam": { "name": "zed", - "version": "3.1.0", - "path": "esy.lock/opam/zed.3.1.0" + "version": "3.2.1", + "path": "esy.lock/opam/zed.3.2.1" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/charInfo_width@opam:1.1.0@2e6806d6", - "@opam/camomile@opam:1.0.2@27671317", - "@opam/base-bytes@opam:base@19d0c2ff", - "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "@opam/uuseg@opam:15.0.0@14085231", + "@opam/uucp@opam:15.0.0@55460339", "@opam/uchar@opam:0.0.2@aedf91f9", + "@opam/result@opam:1.5@1c6a6533", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/charInfo_width@opam:1.1.0@2e6806d6", - "@opam/camomile@opam:1.0.2@27671317", - "@opam/base-bytes@opam:base@19d0c2ff" + "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "@opam/uuseg@opam:15.0.0@14085231", + "@opam/uucp@opam:15.0.0@55460339", "@opam/uchar@opam:0.0.2@aedf91f9", + "@opam/result@opam:1.5@1c6a6533", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/uutf@opam:1.0.3@47c95a18": { @@ -86,55 +85,139 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.5@0aa59f51", - "@opam/ocamlfind@opam:1.9.5@c23112ba", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", + "@opam/cmdliner@opam:1.1.1@03763729", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + }, + "@opam/uuseg@opam:15.0.0@14085231": { + "id": "@opam/uuseg@opam:15.0.0@14085231", + "name": "@opam/uuseg", + "version": "opam:15.0.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha512/37/37ea83b582dd779a026cfae11f08f5d67ef79fce65a2cf03f2a9aabc7eb5de60c8e812524fa7531e4ff6e22a3b18228e3438a0143ce43be95f23237cc283576f#sha512:37ea83b582dd779a026cfae11f08f5d67ef79fce65a2cf03f2a9aabc7eb5de60c8e812524fa7531e4ff6e22a3b18228e3438a0143ce43be95f23237cc283576f", + "archive:https://erratique.ch/software/uuseg/releases/uuseg-15.0.0.tbz#sha512:37ea83b582dd779a026cfae11f08f5d67ef79fce65a2cf03f2a9aabc7eb5de60c8e812524fa7531e4ff6e22a3b18228e3438a0143ce43be95f23237cc283576f" + ], + "opam": { + "name": "uuseg", + "version": "15.0.0", + "path": "esy.lock/opam/uuseg.15.0.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "@opam/uucp@opam:15.0.0@55460339", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", + "@opam/cmdliner@opam:1.1.1@03763729", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.12.1001@d41d8cd9", "@opam/uucp@opam:15.0.0@55460339" + ] + }, + "@opam/uucp@opam:15.0.0@55460339": { + "id": "@opam/uucp@opam:15.0.0@55460339", + "name": "@opam/uucp", + "version": "opam:15.0.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha512/ee/ee4acff5666961766321e85e287fb9d5b8d50533319f22bf6f4eceb943242df2d0e0f4e775c4a140f68ca142837938eaa5926e22362215a3365ffe7f8768923b#sha512:ee4acff5666961766321e85e287fb9d5b8d50533319f22bf6f4eceb943242df2d0e0f4e775c4a140f68ca142837938eaa5926e22362215a3365ffe7f8768923b", + "archive:https://erratique.ch/software/uucp/releases/uucp-15.0.0.tbz#sha512:ee4acff5666961766321e85e287fb9d5b8d50533319f22bf6f4eceb943242df2d0e0f4e775c4a140f68ca142837938eaa5926e22362215a3365ffe7f8768923b" + ], + "opam": { + "name": "uucp", + "version": "15.0.0", + "path": "esy.lock/opam/uucp.15.0.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/cmdliner@opam:1.1.1@03763729", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] }, - "@opam/utop@opam:2.9.2@b7356e33": { - "id": "@opam/utop@opam:2.9.2@b7356e33", + "@opam/utop@opam:2.11.0@bd245e47": { + "id": "@opam/utop@opam:2.11.0@bd245e47", "name": "@opam/utop", - "version": "opam:2.9.2", + "version": "opam:2.11.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/ab/abd1c592464ce5f31b17009954040d7c#md5:abd1c592464ce5f31b17009954040d7c", - "archive:https://github.com/ocaml-community/utop/releases/download/2.9.2/utop-2.9.2.tbz#md5:abd1c592464ce5f31b17009954040d7c" + "archive:https://opam.ocaml.org/cache/sha256/69/6937c6c672913ac3b875341ac4a205c7561d01cd8ac8f47cfb35d3bc0e762170#sha256:6937c6c672913ac3b875341ac4a205c7561d01cd8ac8f47cfb35d3bc0e762170", + "archive:https://github.com/ocaml-community/utop/releases/download/2.11.0/utop-2.11.0.tbz#sha256:6937c6c672913ac3b875341ac4a205c7561d01cd8ac8f47cfb35d3bc0e762170" ], "opam": { "name": "utop", - "version": "2.9.2", - "path": "esy.lock/opam/utop.2.9.2" + "version": "2.11.0", + "path": "esy.lock/opam/utop.2.11.0" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/ocamlfind@opam:1.9.5@c23112ba", + "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", + "@opam/react@opam:1.2.2@e0f4480e", + "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/lambda-term@opam:3.2.0@5fedaa67", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", - "@opam/camomile@opam:1.0.2@27671317", + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", + "@opam/lambda-term@opam:3.3.1@ee145aff", + "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/ocamlfind@opam:1.9.5@c23112ba", + "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", + "@opam/react@opam:1.2.2@e0f4480e", + "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/lambda-term@opam:3.2.0@5fedaa67", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317", + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", + "@opam/lambda-term@opam:3.3.1@ee145aff", + "@opam/dune@opam:3.6.2@e55a9c34", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084" ] }, + "@opam/uchar@opam:0.0.2@aedf91f9": { + "id": "@opam/uchar@opam:0.0.2@aedf91f9", + "name": "@opam/uchar", + "version": "opam:0.0.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/c9/c9ba2c738d264c420c642f7bb1cf4a36#md5:c9ba2c738d264c420c642f7bb1cf4a36", + "archive:https://github.com/ocaml/uchar/releases/download/v0.0.2/uchar-0.0.2.tbz#md5:c9ba2c738d264c420c642f7bb1cf4a36" + ], + "opam": { + "name": "uchar", + "version": "0.0.2", + "path": "esy.lock/opam/uchar.0.0.2" + } + }, + "overrides": [ + { + "opamoverride": + "esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override" + } + ], + "dependencies": [ + "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + }, "@opam/tyxml@opam:4.5.0@0a609297": { "id": "@opam/tyxml@opam:4.5.0@0a609297", "name": "@opam/tyxml", @@ -155,12 +238,12 @@ "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/seq@opam:base@d8d7de1d", "@opam/re@opam:1.10.4@c4910ba6", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/seq@opam:base@d8d7de1d", "@opam/re@opam:1.10.4@c4910ba6", - "@opam/dune@opam:2.9.3@4d52c673" + "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/trie@opam:1.0.0@f4e510e2": { @@ -181,37 +264,37 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, - "@opam/topkg@opam:1.0.5@0aa59f51": { - "id": "@opam/topkg@opam:1.0.5@0aa59f51", + "@opam/topkg@opam:1.0.7@7ee47d76": { + "id": "@opam/topkg@opam:1.0.7@7ee47d76", "name": "@opam/topkg", - "version": "opam:1.0.5", + "version": "opam:1.0.7", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha512/94/9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab#sha512:9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab", - "archive:https://erratique.ch/software/topkg/releases/topkg-1.0.5.tbz#sha512:9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab" + "archive:https://opam.ocaml.org/cache/sha512/09/09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535#sha512:09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535", + "archive:https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz#sha512:09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535" ], "opam": { "name": "topkg", - "version": "1.0.5", - "path": "esy.lock/opam/topkg.1.0.5" + "version": "1.0.7", + "path": "esy.lock/opam/topkg.1.0.7" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@c23112ba", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlbuild@opam:0.14.1@ead10f40" + "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28" ] }, "@opam/seq@opam:base@d8d7de1d": { @@ -251,11 +334,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/react@opam:1.2.2@e0f4480e": { @@ -276,9 +359,9 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.5@0aa59f51", - "@opam/ocamlfind@opam:1.9.5@c23112ba", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] @@ -302,11 +385,11 @@ "overrides": [], "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:2.9.3@4d52c673" + "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/ppx_derivers@opam:1.2.1@e2cbad12": { @@ -327,67 +410,67 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, - "@opam/odoc-parser@opam:1.0.1@4bf15d79": { - "id": "@opam/odoc-parser@opam:1.0.1@4bf15d79", + "@opam/odoc-parser@opam:2.0.0@a08011a0": { + "id": "@opam/odoc-parser@opam:2.0.0@a08011a0", "name": "@opam/odoc-parser", - "version": "opam:1.0.1", + "version": "opam:2.0.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/a2/a2bbe8e4201b60e980bab01e96e41f2ba0b05ba3f50b44f75837e8a2fb907d2c#sha256:a2bbe8e4201b60e980bab01e96e41f2ba0b05ba3f50b44f75837e8a2fb907d2c", - "archive:https://github.com/ocaml-doc/odoc-parser/releases/download/1.0.1/odoc-parser-1.0.1.tbz#sha256:a2bbe8e4201b60e980bab01e96e41f2ba0b05ba3f50b44f75837e8a2fb907d2c" + "archive:https://opam.ocaml.org/cache/sha256/40/407919fbb0eb95761d6fc6ec6777628d94aa1907343bdca678b1880bafb33922#sha256:407919fbb0eb95761d6fc6ec6777628d94aa1907343bdca678b1880bafb33922", + "archive:https://github.com/ocaml-doc/odoc-parser/releases/download/2.0.0/odoc-parser-2.0.0.tbz#sha256:407919fbb0eb95761d6fc6ec6777628d94aa1907343bdca678b1880bafb33922" ], "opam": { "name": "odoc-parser", - "version": "1.0.1", - "path": "esy.lock/opam/odoc-parser.1.0.1" + "version": "2.0.0", + "path": "esy.lock/opam/odoc-parser.2.0.0" } }, "overrides": [], "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dune@opam:3.6.2@e55a9c34", "@opam/camlp-streams@opam:5.0.1@daaa0f94", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dune@opam:3.6.2@e55a9c34", "@opam/camlp-streams@opam:5.0.1@daaa0f94", "@opam/astring@opam:0.8.5@1300cee8" ] }, - "@opam/odoc@opam:2.1.1@ccba8a4e": { - "id": "@opam/odoc@opam:2.1.1@ccba8a4e", + "@opam/odoc@opam:2.2.0@020767ad": { + "id": "@opam/odoc@opam:2.2.0@020767ad", "name": "@opam/odoc", - "version": "opam:2.1.1", + "version": "opam:2.2.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/f5/f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd#sha256:f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd", - "archive:https://github.com/ocaml/odoc/releases/download/2.1.1/odoc-2.1.1.tbz#sha256:f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd" + "archive:https://opam.ocaml.org/cache/sha256/68/6818c971fc0c3eed9d3d143389f80739b1618af70b9fdb443b35bd7f0121740c#sha256:6818c971fc0c3eed9d3d143389f80739b1618af70b9fdb443b35bd7f0121740c", + "archive:https://github.com/ocaml/odoc/releases/download/2.2.0/odoc-2.2.0.tbz#sha256:6818c971fc0c3eed9d3d143389f80739b1618af70b9fdb443b35bd7f0121740c" ], "opam": { "name": "odoc", - "version": "2.1.1", - "path": "esy.lock/opam/odoc.2.1.1" + "version": "2.2.0", + "path": "esy.lock/opam/odoc.2.2.0" } }, "overrides": [], "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/tyxml@opam:4.5.0@0a609297", "@opam/result@opam:1.5@1c6a6533", - "@opam/odoc-parser@opam:1.0.1@4bf15d79", + "@opam/odoc-parser@opam:2.0.0@a08011a0", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.9.0@87213963", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", + "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@opam/cmdliner@opam:1.1.1@03763729", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" @@ -395,9 +478,9 @@ "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/tyxml@opam:4.5.0@0a609297", "@opam/result@opam:1.5@1c6a6533", - "@opam/odoc-parser@opam:1.0.1@4bf15d79", + "@opam/odoc-parser@opam:2.0.0@a08011a0", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.9.0@87213963", - "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cmdliner@opam:1.1.1@03763729", "@opam/astring@opam:0.8.5@1300cee8" ] @@ -420,18 +503,18 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-bytes@opam:base@19d0c2ff", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/base-bytes@opam:base@19d0c2ff" ] }, - "@opam/ocamlfind@opam:1.9.5@c23112ba": { - "id": "@opam/ocamlfind@opam:1.9.5@c23112ba", + "@opam/ocamlfind@opam:1.9.5@e83abf74": { + "id": "@opam/ocamlfind@opam:1.9.5@e83abf74", "name": "@opam/ocamlfind", "version": "opam:1.9.5", "source": { @@ -457,26 +540,26 @@ ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] }, - "@opam/ocamlbuild@opam:0.14.1@ead10f40": { - "id": "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "@opam/ocamlbuild@opam:0.14.2@c6163b28": { + "id": "@opam/ocamlbuild@opam:0.14.2@c6163b28", "name": "@opam/ocamlbuild", - "version": "opam:0.14.1", + "version": "opam:0.14.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/70/7027e507ed85f290923ad198f3d2cd1c#md5:7027e507ed85f290923ad198f3d2cd1c", - "archive:https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.1.tar.gz#md5:7027e507ed85f290923ad198f3d2cd1c" + "archive:https://opam.ocaml.org/cache/md5/2f/2f407fadd57b073155a6aead887d9676#md5:2f407fadd57b073155a6aead887d9676", + "archive:https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz#md5:2f407fadd57b073155a6aead887d9676" ], "opam": { "name": "ocamlbuild", - "version": "0.14.1", - "path": "esy.lock/opam/ocamlbuild.0.14.1" + "version": "0.14.2", + "path": "esy.lock/opam/ocamlbuild.0.14.2" } }, "overrides": [ { "opamoverride": - "esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override" + "esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override" } ], "dependencies": [ @@ -503,12 +586,12 @@ "overrides": [], "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@4d52c673" + "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/mew@opam:0.1.0@65011d4b": { @@ -530,12 +613,12 @@ "overrides": [], "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@4d52c673" + "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/merlin-extend@opam:0.6.1@7d979feb": { @@ -556,15 +639,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, - "@opam/menhirSdk@opam:20220210@b8921e41": { - "id": "@opam/menhirSdk@opam:20220210@b8921e41", + "@opam/menhirSdk@opam:20220210@fe146ed3": { + "id": "@opam/menhirSdk@opam:20220210@fe146ed3", "name": "@opam/menhirSdk", "version": "opam:20220210", "source": { @@ -581,15 +664,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, - "@opam/menhirLib@opam:20220210@e6562f4f": { - "id": "@opam/menhirLib@opam:20220210@e6562f4f", + "@opam/menhirLib@opam:20220210@9afeb270": { + "id": "@opam/menhirLib@opam:20220210@9afeb270", "name": "@opam/menhirLib", "version": "opam:20220210", "source": { @@ -606,15 +689,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, - "@opam/menhir@opam:20220210@ff87a93b": { - "id": "@opam/menhir@opam:20220210@ff87a93b", + "@opam/menhir@opam:20220210@ff5ea9a7": { + "id": "@opam/menhir@opam:20220210@ff5ea9a7", "name": "@opam/menhir", "version": "opam:20220210", "source": { @@ -631,14 +714,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/menhirSdk@opam:20220210@b8921e41", - "@opam/menhirLib@opam:20220210@e6562f4f", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.12.1001@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "@opam/menhirLib@opam:20220210@9afeb270", + "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/menhirSdk@opam:20220210@b8921e41", - "@opam/menhirLib@opam:20220210@e6562f4f", - "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "@opam/menhirLib@opam:20220210@9afeb270", + "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/lwt_react@opam:1.2.0@4253a145": { @@ -660,38 +743,12 @@ "overrides": [], "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/lwt_log@opam:1.1.1@b126dcbe": { - "id": "@opam/lwt_log@opam:1.1.1@b126dcbe", - "name": "@opam/lwt_log", - "version": "opam:1.1.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/02/02e93be62288037870ae5b1ce099fe59#md5:02e93be62288037870ae5b1ce099fe59", - "archive:https://github.com/aantron/lwt_log/archive/1.1.1.tar.gz#md5:02e93be62288037870ae5b1ce099fe59" - ], - "opam": { - "name": "lwt_log", - "version": "1.1.1", - "path": "esy.lock/opam/lwt_log.1.1.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673" + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/lwt@opam:5.6.1@2a9902ab": { @@ -713,53 +770,78 @@ "overrides": [], "dependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", - "@opam/dune-configurator@opam:2.9.3@174e411b", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", + "@opam/dune-configurator@opam:3.7.0@4fa6f76e", + "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", - "@opam/dune-configurator@opam:2.9.3@174e411b", - "@opam/dune@opam:2.9.3@4d52c673" + "@opam/dune-configurator@opam:3.7.0@4fa6f76e", + "@opam/dune@opam:3.6.2@e55a9c34" ] }, - "@opam/lambda-term@opam:3.2.0@5fedaa67": { - "id": "@opam/lambda-term@opam:3.2.0@5fedaa67", + "@opam/logs@opam:0.7.0@46a3dffc": { + "id": "@opam/logs@opam:0.7.0@46a3dffc", + "name": "@opam/logs", + "version": "opam:0.7.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/2b/2bf021ca13331775e33cf34ab60246f7#md5:2bf021ca13331775e33cf34ab60246f7", + "archive:https://erratique.ch/software/logs/releases/logs-0.7.0.tbz#md5:2bf021ca13331775e33cf34ab60246f7" + ], + "opam": { + "name": "logs", + "version": "0.7.0", + "path": "esy.lock/opam/logs.0.7.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/fmt@opam:0.9.0@87213963", + "@opam/cmdliner@opam:1.1.1@03763729", + "@opam/base-threads@opam:base@36803084", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + }, + "@opam/lambda-term@opam:3.3.1@ee145aff": { + "id": "@opam/lambda-term@opam:3.3.1@ee145aff", "name": "@opam/lambda-term", - "version": "opam:3.2.0", + "version": "opam:3.3.1", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/68/68a44ac4a5c643cf48ea927c073b4428#md5:68a44ac4a5c643cf48ea927c073b4428", - "archive:https://github.com/ocaml-community/lambda-term/releases/download/3.2.0/lambda-term-3.2.0.tar.gz#md5:68a44ac4a5c643cf48ea927c073b4428" + "archive:https://opam.ocaml.org/cache/sha256/5b/5b77cbe096d56ae9157cb1fb55fb4e9028c89e841b1d2bfad4f13d8a1395db3c#sha256:5b77cbe096d56ae9157cb1fb55fb4e9028c89e841b1d2bfad4f13d8a1395db3c", + "archive:https://github.com/ocaml-community/lambda-term/releases/download/3.3.1/lambda-term-3.3.1.tbz#sha256:5b77cbe096d56ae9157cb1fb55fb4e9028c89e841b1d2bfad4f13d8a1395db3c" ], "opam": { "name": "lambda-term", - "version": "3.2.0", - "path": "esy.lock/opam/lambda-term.3.2.0" + "version": "3.3.1", + "path": "esy.lock/opam/lambda-term.3.3.1" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", + "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew_vi@opam:0.5.0@cf66c299", "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt_log@opam:1.1.1@b126dcbe", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317", - "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", + "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", + "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew_vi@opam:0.5.0@cf66c299", "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt_log@opam:1.1.1@b126dcbe", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317" + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", + "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/fpath@opam:0.7.3@674d8125": { @@ -780,9 +862,9 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.5@0aa59f51", - "@opam/ocamlfind@opam:1.9.5@c23112ba", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], @@ -808,9 +890,9 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.5@0aa59f51", - "@opam/ocamlfind@opam:1.9.5@c23112ba", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/cmdliner@opam:1.1.1@03763729", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" @@ -835,54 +917,56 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, - "@opam/dune-configurator@opam:2.9.3@174e411b": { - "id": "@opam/dune-configurator@opam:2.9.3@174e411b", + "@opam/dune-configurator@opam:3.7.0@4fa6f76e": { + "id": "@opam/dune-configurator@opam:3.7.0@4fa6f76e", "name": "@opam/dune-configurator", - "version": "opam:2.9.3", + "version": "opam:3.7.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/3e/3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6", - "archive:https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" + "archive:https://opam.ocaml.org/cache/sha256/e2/e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8", + "archive:https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" ], "opam": { "name": "dune-configurator", - "version": "2.9.3", - "path": "esy.lock/opam/dune-configurator.2.9.3" + "version": "3.7.0", + "path": "esy.lock/opam/dune-configurator.3.7.0" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/csexp@opam:1.5.1@8a8fb3a7", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/csexp@opam:1.5.1@8a8fb3a7", + "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/csexp@opam:1.5.1@8a8fb3a7" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/csexp@opam:1.5.1@8a8fb3a7", + "@opam/base-unix@opam:base@87d0b2eb" ] }, - "@opam/dune@opam:2.9.3@4d52c673": { - "id": "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dune@opam:3.6.2@e55a9c34": { + "id": "@opam/dune@opam:3.6.2@e55a9c34", "name": "@opam/dune", - "version": "opam:2.9.3", + "version": "opam:3.6.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/3e/3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6", - "archive:https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" + "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", + "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" ], "opam": { "name": "dune", - "version": "2.9.3", - "path": "esy.lock/opam/dune.2.9.3" + "version": "3.6.2", + "path": "esy.lock/opam/dune.3.6.2" } }, "overrides": [], @@ -914,11 +998,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/cppo@opam:1.6.9@db929a12": { @@ -939,12 +1023,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/base-unix@opam:base@87d0b2eb" ] }, @@ -970,60 +1054,6 @@ ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] }, - "@opam/charInfo_width@opam:1.1.0@2e6806d6": { - "id": "@opam/charInfo_width@opam:1.1.0@2e6806d6", - "name": "@opam/charInfo_width", - "version": "opam:1.1.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/a5/a539436d1da4aeb93711303f107bec7e#md5:a539436d1da4aeb93711303f107bec7e", - "archive:https://github.com/kandu/charInfo_width/archive/1.1.0.tar.gz#md5:a539436d1da4aeb93711303f107bec7e" - ], - "opam": { - "name": "charInfo_width", - "version": "1.1.0", - "path": "esy.lock/opam/charInfo_width.1.1.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317" - ] - }, - "@opam/camomile@opam:1.0.2@27671317": { - "id": "@opam/camomile@opam:1.0.2@27671317", - "name": "@opam/camomile", - "version": "opam:1.0.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/f0/f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632#sha256:f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632", - "archive:https://github.com/yoriyuki/Camomile/releases/download/1.0.2/camomile-1.0.2.tbz#sha256:f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632" - ], - "opam": { - "name": "camomile", - "version": "1.0.2", - "path": "esy.lock/opam/camomile.1.0.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, "@opam/camlp-streams@opam:5.0.1@daaa0f94": { "id": "@opam/camlp-streams@opam:5.0.1@daaa0f94", "name": "@opam/camlp-streams", @@ -1042,11 +1072,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" + "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/base-unix@opam:base@87d0b2eb": { @@ -1098,11 +1128,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@c23112ba", + "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@c23112ba" + "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74" ] }, "@opam/astring@opam:0.8.5@1300cee8": { @@ -1123,9 +1153,9 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.5@0aa59f51", - "@opam/ocamlfind@opam:1.9.5@c23112ba", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.5@e83abf74", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] diff --git a/esy.lock/opam/camomile.1.0.2/opam b/esy.lock/opam/camomile.1.0.2/opam deleted file mode 100644 index f8572c012..000000000 --- a/esy.lock/opam/camomile.1.0.2/opam +++ /dev/null @@ -1,35 +0,0 @@ -opam-version: "2.0" -synopsis: "A Unicode library" -description: """ -Camomile is a Unicode library for OCaml. Camomile provides Unicode character -type, UTF-8, UTF-16, UTF-32 strings, conversion to/from about 200 encodings, -collation and locale-sensitive case mappings, and more. The library is currently -designed for Unicode Standard 3.2.""" -maintainer: ["yoriyuki.y@gmail.com"] -authors: ["Yoriyuki Yamagata"] -license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" -homepage: "https://github.com/yoriyuki/Camomile" -doc: "https://yoriyuki.github.io/Camomile/" -bug-reports: "https://github.com/yoriyuki/Camomile/issues" -depends: [ - "dune" {>= "1.11"} - "ocaml" {>= "4.02.3" & < "5.0"} -] -dev-repo: "git+https://github.com/yoriyuki/Camomile.git" -build: [ - ["ocaml" "configure.ml" "--share" "%{share}%/camomile"] - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs - "@install" - "@doc" {with-doc} - ] -] -url { - src: - "https://github.com/yoriyuki/Camomile/releases/download/1.0.2/camomile-1.0.2.tbz" - checksum: [ - "sha256=f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632" - "sha512=7586422e68779476206027c6ebbe19b677fbe459153221f7c952c7fae374c5c8232249cb76fdb1f482069707aa1580be827cd39693906142988268b7f0e7f6d0" - ] -} -available: arch != "ppc64" diff --git a/esy.lock/opam/charInfo_width.1.1.0/opam b/esy.lock/opam/charInfo_width.1.1.0/opam deleted file mode 100644 index e87929b0e..000000000 --- a/esy.lock/opam/charInfo_width.1.1.0/opam +++ /dev/null @@ -1,27 +0,0 @@ -opam-version: "2.0" -maintainer: "zandoye@gmail.com" -authors: [ "ZAN DoYe" ] -homepage: "https://github.com/kandu/charinfo_width/" -bug-reports: "https://github.com/kandu/charinfo_width/issues" -license: "MIT" -dev-repo: "git+https://github.com/kandu/charinfo_width.git" -build: [ - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test & (ocaml:version >= "4.04.0")} -] -depends: [ - "ocaml" {>= "4.02.3"} - "result" - "camomile" {>= "1.0.0" & < "2.0~"} - "dune" - "ppx_expect" {with-test} -] - -synopsis: "Determine column width for a character" -description: """ -This module is implemented purely in OCaml and the width function follows the prototype of POSIX's wcwidth.""" - -url { - src:"https://github.com/kandu/charInfo_width/archive/1.1.0.tar.gz" - checksum: "md5=a539436d1da4aeb93711303f107bec7e" -} diff --git a/esy.lock/opam/dune-configurator.2.9.3/opam b/esy.lock/opam/dune-configurator.3.7.0/opam similarity index 66% rename from esy.lock/opam/dune-configurator.2.9.3/opam rename to esy.lock/opam/dune-configurator.3.7.0/opam index 60d8173a6..c5555e817 100644 --- a/esy.lock/opam/dune-configurator.2.9.3/opam +++ b/esy.lock/opam/dune-configurator.3.7.0/opam @@ -17,15 +17,17 @@ homepage: "https://github.com/ocaml/dune" doc: "https://dune.readthedocs.io/" bug-reports: "https://github.com/ocaml/dune/issues" depends: [ - "dune" {>= "2.9"} - "ocaml" {>= "4.03.0"} - "result" - "csexp" {>= "1.3.0"} + "dune" {>= "3.5"} + "ocaml" {>= "4.04.0"} + "base-unix" + "csexp" {>= "1.5.0"} "odoc" {with-doc} ] dev-repo: "git+https://github.com/ocaml/dune.git" build: [ ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] [ "dune" "build" @@ -38,11 +40,10 @@ build: [ ] ] url { - src: - "https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz" + src: "https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz" checksum: [ - "sha256=3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - "sha512=04b48501ac16c3608e3b6bfbdbabf810df0fb844ea3b7d25ba50f03b9d6cb1d2c933cf747d694029d82a9777a774e48e5c38ab010fe53ce1eae367da0ed04d6d" + "sha256=e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + "sha512=586e47ee45cd53a8c13095bde0b47de99aad9462d0a52199362140b5b654ca862597fa9f27f729a8cc594684ac46858848f9fa76f8f06dc8dc8ab8b1186a3295" ] } -x-commit-hash: "dea03875affccc0620e902d28fed8d6b4351e112" +x-commit-hash: "d3d628f2eda2278bd2df6e37452d8693f367fcfd" diff --git a/esy.lock/opam/dune.2.9.3/opam b/esy.lock/opam/dune.3.6.2/opam similarity index 73% rename from esy.lock/opam/dune.2.9.3/opam rename to esy.lock/opam/dune.3.6.2/opam index 056c52674..b66dce86b 100644 --- a/esy.lock/opam/dune.2.9.3/opam +++ b/esy.lock/opam/dune.3.6.2/opam @@ -29,29 +29,28 @@ conflicts: [ "merlin" {< "3.4.0"} "ocaml-lsp-server" {< "1.3.0"} "dune-configurator" {< "2.3.0"} - "odoc" {< "1.3.0"} + "odoc" {< "2.0.1"} "dune-release" {< "1.3.0"} "js_of_ocaml-compiler" {< "3.6.0"} "jbuilder" {= "transition"} ] dev-repo: "git+https://github.com/ocaml/dune.git" build: [ - ["ocaml" "bootstrap.ml" "-j" jobs] - ["./dune.exe" "build" "-p" name "--profile" "dune-bootstrap" "-j" jobs] + ["ocaml" "boot/bootstrap.ml" "-j" jobs] + ["./_boot/dune.exe" "build" "dune.install" "--release" "--profile" "dune-bootstrap" "-j" jobs] ] depends: [ # Please keep the lower bound in sync with .github/workflows/workflow.yml, # dune-project and min_ocaml_version in bootstrap.ml - ("ocaml" {>= "4.08" & < "5.0"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) + ("ocaml" {>= "4.08"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) "base-unix" "base-threads" ] url { - src: - "https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz" + src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" checksum: [ - "sha256=3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - "sha512=04b48501ac16c3608e3b6bfbdbabf810df0fb844ea3b7d25ba50f03b9d6cb1d2c933cf747d694029d82a9777a774e48e5c38ab010fe53ce1eae367da0ed04d6d" + "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" ] } -x-commit-hash: "dea03875affccc0620e902d28fed8d6b4351e112" +x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" diff --git a/esy.lock/opam/lambda-term.3.2.0/opam b/esy.lock/opam/lambda-term.3.3.1/opam similarity index 59% rename from esy.lock/opam/lambda-term.3.2.0/opam rename to esy.lock/opam/lambda-term.3.3.1/opam index 8f21a6ab1..3a814ebae 100644 --- a/esy.lock/opam/lambda-term.3.2.0/opam +++ b/esy.lock/opam/lambda-term.3.3.1/opam @@ -1,6 +1,6 @@ opam-version: "2.0" synopsis: "Terminal manipulation library for OCaml" -description: """\ +description: """ Lambda-term is a cross-platform library for manipulating the terminal. It provides an abstraction for keys, mouse events, colors, as well as a set of widgets to write curses-like applications. The main objective of lambda-term is @@ -8,30 +8,43 @@ to provide a higher level functional interface to terminal manipulation than, for example, ncurses, by providing a native OCaml interface instead of bindings to a C library. Lambda-term integrates with zed to provide text edition facilities in console applications.""" -maintainer: "jeremie@dimino.org" -authors: "Jérémie Dimino" +maintainer: ["opam-devel@lists.ocaml.org"] +authors: ["Jérémie Dimino"] license: "BSD-3-Clause" homepage: "https://github.com/ocaml-community/lambda-term" bug-reports: "https://github.com/ocaml-community/lambda-term/issues" depends: [ + "dune" {>= "3.0"} "ocaml" {>= "4.08.0"} - "lwt" {>= "4.0.0"} - "lwt_log" - "react" - "zed" {>= "3.1.0" & < "3.2.0"} - "camomile" {>= "1.0.1"} + "logs" + "lwt" {>= "4.2.0"} "lwt_react" "mew_vi" {>= "0.5.0" & < "0.6.0"} - "dune" {>= "1.1.0"} + "react" + "zed" {>= "3.2.0" & < "4.0"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] -build: ["dune" "build" "-p" name "-j" jobs] -run-test: ["dune" "runtest" "-p" name "-j" jobs] dev-repo: "git+https://github.com/ocaml-community/lambda-term.git" url { src: - "https://github.com/ocaml-community/lambda-term/releases/download/3.2.0/lambda-term-3.2.0.tar.gz" + "https://github.com/ocaml-community/lambda-term/releases/download/3.3.1/lambda-term-3.3.1.tbz" checksum: [ - "md5=68a44ac4a5c643cf48ea927c073b4428" - "sha512=46cd46f47c9f34c0a5e096b96e6eec59667b645bf5201140e498e6d4eb9baba8204a2b30b73c4b2f8140e5cf1972a56e3aa485b27bc5ace25b2c368f713ad7c4" + "sha256=5b77cbe096d56ae9157cb1fb55fb4e9028c89e841b1d2bfad4f13d8a1395db3c" + "sha512=d7968ad000c9c7e899ffb7fdd0016009f41c71d9fad4897decbe66ea24140ab1ee8428fd550c7b8016e7f6343f41e7abd53b52b5f2bf6bb85b4de64f12ac9161" ] } +x-commit-hash: "f6b1940863e94d437a0578e19076a342bc9b5a70" diff --git a/esy.lock/opam/logs.0.7.0/opam b/esy.lock/opam/logs.0.7.0/opam new file mode 100644 index 000000000..c803bafdb --- /dev/null +++ b/esy.lock/opam/logs.0.7.0/opam @@ -0,0 +1,66 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["The logs programmers"] +homepage: "https://erratique.ch/software/logs" +doc: "https://erratique.ch/software/logs/doc" +dev-repo: "git+https://erratique.ch/repos/logs.git" +bug-reports: "https://github.com/dbuenzli/logs/issues" +tags: [ "log" "system" "org:erratique" ] +license: "ISC" +depends: [ + "ocaml" {>= "4.03.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build} + "mtime" {with-test} ] +depopts: [ + "js_of_ocaml" + "fmt" + "cmdliner" + "lwt" + "base-threads" +] +conflicts: [ + "cmdliner" {< "0.9.8"} + "js_of_ocaml" { < "3.3.0" } +] + +build: [[ + "ocaml" "pkg/pkg.ml" "build" + "--pinned" "%{pinned}%" + "--with-js_of_ocaml" "%{js_of_ocaml:installed}%" + "--with-fmt" "%{fmt:installed}%" + "--with-cmdliner" "%{cmdliner:installed}%" + "--with-lwt" "%{lwt:installed}%" + "--with-base-threads" "%{base-threads:installed}%" +]] + +synopsis: """Logging infrastructure for OCaml""" +description: """\ + +Logs provides a logging infrastructure for OCaml. Logging is performed +on sources whose reporting level can be set independently. Log message +report is decoupled from logging and is handled by a reporter. + +A few optional log reporters are distributed with the base library and +the API easily allows to implement your own. + +`Logs` has no dependencies. The optional `Logs_fmt` reporter on OCaml +formatters depends on [Fmt][fmt]. The optional `Logs_browser` +reporter that reports to the web browser console depends on +[js_of_ocaml][jsoo]. The optional `Logs_cli` library that provides +command line support for controlling Logs depends on +[`Cmdliner`][cmdliner]. The optional `Logs_lwt` library that provides +Lwt logging functions depends on [`Lwt`][lwt] + +Logs and its reporters are distributed under the ISC license. + +[fmt]: http://erratique.ch/software/fmt +[jsoo]: http://ocsigen.org/js_of_ocaml/ +[cmdliner]: http://erratique.ch/software/cmdliner +[lwt]: http://ocsigen.org/lwt/ +""" +url { +archive: "https://erratique.ch/software/logs/releases/logs-0.7.0.tbz" +checksum: "2bf021ca13331775e33cf34ab60246f7" +} diff --git a/esy.lock/opam/lwt_log.1.1.1/opam b/esy.lock/opam/lwt_log.1.1.1/opam deleted file mode 100644 index 90b227c50..000000000 --- a/esy.lock/opam/lwt_log.1.1.1/opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "2.0" - -synopsis: "Lwt logging library (deprecated)" - -license: "LGPL-2.0-or-later" -homepage: "https://github.com/ocsigen/lwt_log" -doc: "https://github.com/ocsigen/lwt_log/blob/master/src/core/lwt_log_core.mli" -bug-reports: "https://github.com/ocsigen/lwt_log/issues" - -authors: [ - "Shawn Wagner" - "Jérémie Dimino" -] -maintainer: "Anton Bachin " -dev-repo: "git+https://github.com/ocsigen/lwt_log.git" - -depends: [ - "ocaml" {< "5.0"} - "dune" {>= "1.0"} - "lwt" {>= "4.0.0"} -] - -build: [ - ["dune" "build" "-p" name "-j" jobs] -] - -url { - src: "https://github.com/aantron/lwt_log/archive/1.1.1.tar.gz" - checksum: "md5=02e93be62288037870ae5b1ce099fe59" -} diff --git a/esy.lock/opam/menhir.20220210/opam b/esy.lock/opam/menhir.20220210/opam index 3cd79886c..498658b42 100644 --- a/esy.lock/opam/menhir.20220210/opam +++ b/esy.lock/opam/menhir.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/esy.lock/opam/menhirLib.20220210/opam b/esy.lock/opam/menhirLib.20220210/opam index 895b54277..d2097ae4f 100644 --- a/esy.lock/opam/menhirLib.20220210/opam +++ b/esy.lock/opam/menhirLib.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/esy.lock/opam/menhirSdk.20220210/opam b/esy.lock/opam/menhirSdk.20220210/opam index d95c170de..585d2ca33 100644 --- a/esy.lock/opam/menhirSdk.20220210/opam +++ b/esy.lock/opam/menhirSdk.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/esy.lock/opam/ocamlbuild.0.14.1/opam b/esy.lock/opam/ocamlbuild.0.14.2/opam similarity index 83% rename from esy.lock/opam/ocamlbuild.0.14.1/opam rename to esy.lock/opam/ocamlbuild.0.14.2/opam index d7413780d..74bfbb272 100644 --- a/esy.lock/opam/ocamlbuild.0.14.1/opam +++ b/esy.lock/opam/ocamlbuild.0.14.2/opam @@ -31,9 +31,9 @@ build: [ ] dev-repo: "git+https://github.com/ocaml/ocamlbuild.git" url { - src: "https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.1.tar.gz" + src: "https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz" checksum: [ - "md5=7027e507ed85f290923ad198f3d2cd1c" - "sha512=1f5b43215b1d3dc427b9c64e005add9d423ed4bca9686d52c55912df8955647cb2d7d86622d44b41b14c4f0d657b770c27967c541c868eeb7c78e3bd35b827ad" + "md5=2f407fadd57b073155a6aead887d9676" + "sha512=f568bf10431a1f701e8bd7554dc662400a0d978411038bbad93d44dceab02874490a8a5886a9b44e017347e7949997f13f5c3752f74e1eb5e273d2beb19a75fd" ] } \ No newline at end of file diff --git a/esy.lock/opam/ocamlfind.1.9.5/opam b/esy.lock/opam/ocamlfind.1.9.5/opam index 73b6d69f8..2c4f8fc4a 100644 --- a/esy.lock/opam/ocamlfind.1.9.5/opam +++ b/esy.lock/opam/ocamlfind.1.9.5/opam @@ -13,7 +13,7 @@ authors: "Gerd Stolpmann " homepage: "http://projects.camlcity.org/projects/findlib.html" bug-reports: "https://github.com/ocaml/ocamlfind/issues" depends: [ - "ocaml" {>= "4.00.0"} + "ocaml" {>= "4.02.0"} ] depopts: ["graphics"] build: [ diff --git a/esy.lock/opam/odoc-parser.1.0.1/opam b/esy.lock/opam/odoc-parser.2.0.0/opam similarity index 79% rename from esy.lock/opam/odoc-parser.1.0.1/opam rename to esy.lock/opam/odoc-parser.2.0.0/opam index 6b61ea102..602b2bdfb 100644 --- a/esy.lock/opam/odoc-parser.1.0.1/opam +++ b/esy.lock/opam/odoc-parser.2.0.0/opam @@ -37,11 +37,11 @@ build: [ ] url { src: - "https://github.com/ocaml-doc/odoc-parser/releases/download/1.0.1/odoc-parser-1.0.1.tbz" + "https://github.com/ocaml-doc/odoc-parser/releases/download/2.0.0/odoc-parser-2.0.0.tbz" checksum: [ - "sha256=a2bbe8e4201b60e980bab01e96e41f2ba0b05ba3f50b44f75837e8a2fb907d2c" - "sha512=c3339aae880ce72df866746d9ed9e7d38a752bf994ba24e948c086349604007e39602a1c31cf2ddb61ac8f8dc9dceccca43fe185850b83e3a02d75121f9ddfe2" + "sha256=407919fbb0eb95761d6fc6ec6777628d94aa1907343bdca678b1880bafb33922" + "sha512=d2bffa3e9f30471045682e390dcee7a2c1caf3831bca4bd57c16939e782c2e23434e6f1c9887580a1804800b3629ef4c4311a9d418fca5a939f324650d54006e" ] } -x-commit-hash: "216e3234b57bf194e65e14200e43607cc4e47da6" +x-commit-hash: "ebfd3b9489e44187da2c67d79a32b6fc1e92bda4" diff --git a/esy.lock/opam/odoc.2.1.1/opam b/esy.lock/opam/odoc.2.2.0/opam similarity index 67% rename from esy.lock/opam/odoc.2.1.1/opam rename to esy.lock/opam/odoc.2.2.0/opam index 005d6043f..c284fc6d5 100644 --- a/esy.lock/opam/odoc.2.1.1/opam +++ b/esy.lock/opam/odoc.2.2.0/opam @@ -23,11 +23,11 @@ delimited with `(** ... *)`, and outputs HTML. """ depends: [ - "odoc-parser" {>= "0.9.0" & < "2.0.0"} + "odoc-parser" {>= "2.0.0"} "astring" "cmdliner" {>= "1.0.0"} "cppo" {build & >= "1.1.0"} - "dune" {>= "2.9.1"} + "dune" {>= "3.0.2"} "fpath" "ocaml" {>= "4.02.0"} "result" @@ -41,9 +41,10 @@ depends: [ "ppx_expect" {with-test} "bos" {with-test} + "crunch" {with-test} - "bisect_ppx" {dev & > "2.5.0"} - ("ocaml" {< "4.03.0" & dev} | "mdx" {dev}) + ("ocaml" {< "4.07.0" & with-test} | "bisect_ppx" {with-test & > "2.5.0"}) + ("ocaml" {< "4.03.0" & with-test} | "mdx" {with-test}) ] build: [ @@ -51,10 +52,10 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] url { - src: "https://github.com/ocaml/odoc/releases/download/2.1.1/odoc-2.1.1.tbz" + src: "https://github.com/ocaml/odoc/releases/download/2.2.0/odoc-2.2.0.tbz" checksum: [ - "sha256=f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd" - "sha512=1c545c281a7022a167f028fff8cec6fb3f2f82da0881431be74e7a4281c5353ed83bfbdb4d9d9e08af6755dbe3505c052c5e5b58cdeb08c57aed5e89c0f15e91" + "sha256=6818c971fc0c3eed9d3d143389f80739b1618af70b9fdb443b35bd7f0121740c" + "sha512=9f8fc2ee6b25629474e8aa69dd460becab9277261578af0f7b97f7f779cc5f1056d1b5f14ab583b9b94ea097e5df2d6e35040f2a4887021209705486f9d44a22" ] } -x-commit-hash: "f556f10aa67f80e83d1e3e66c4b478e8efe4e18d" +x-commit-hash: "103dac4c370aa2ad5aca7ba54f02f8e06adb941b" diff --git a/esy.lock/opam/topkg.1.0.5/opam b/esy.lock/opam/topkg.1.0.7/opam similarity index 66% rename from esy.lock/opam/topkg.1.0.5/opam rename to esy.lock/opam/topkg.1.0.7/opam index 3b2f63a01..83fc06f49 100644 --- a/esy.lock/opam/topkg.1.0.5/opam +++ b/esy.lock/opam/topkg.1.0.7/opam @@ -1,22 +1,6 @@ opam-version: "2.0" -synopsis: """The transitory OCaml software packager""" -maintainer: ["Daniel Bünzli "] -authors: ["The topkg programmers"] -homepage: "https://erratique.ch/software/topkg" -doc: "https://erratique.ch/software/topkg/doc" -dev-repo: "git+https://erratique.ch/repos/topkg.git" -bug-reports: "https://github.com/dbuenzli/topkg/issues" -license: ["ISC"] -tags: ["packaging" "ocamlbuild" "org:erratique"] -depends: ["ocaml" {>= "4.05.0"} - "ocamlfind" {build & >= "1.6.1"} - "ocamlbuild"] -build: [["ocaml" "pkg/pkg.ml" "build" "--pkg-name" name - "--dev-pkg" "%{dev}%"]] -url { - src: "https://erratique.ch/software/topkg/releases/topkg-1.0.5.tbz" - checksum: "sha512=9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab"} -description: """ +synopsis: "The transitory OCaml software packager" +description: """\ Topkg is a packager for distributing OCaml software. It provides an API to describe the files a package installs in a given build configuration and to specify information about the package's @@ -41,4 +25,23 @@ Topkg-care is distributed under the ISC license it depends on [cmdliner]: http://erratique.ch/software/cmdliner [webbrowser]: http://erratique.ch/software/webbrowser -Home page: http://erratique.ch/software/topkg""" \ No newline at end of file +Home page: http://erratique.ch/software/topkg""" +maintainer: "Daniel Bünzli " +authors: "The topkg programmers" +license: "ISC" +tags: ["packaging" "ocamlbuild" "org:erratique"] +homepage: "https://erratique.ch/software/topkg" +doc: "https://erratique.ch/software/topkg/doc" +bug-reports: "https://github.com/dbuenzli/topkg/issues" +depends: [ + "ocaml" {>= "4.05.0"} + "ocamlfind" {build & >= "1.6.1"} + "ocamlbuild" +] +build: ["ocaml" "pkg/pkg.ml" "build" "--pkg-name" name "--dev-pkg" "%{dev}%"] +dev-repo: "git+https://erratique.ch/repos/topkg.git" +url { + src: "https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz" + checksum: + "sha512=09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535" +} \ No newline at end of file diff --git a/esy.lock/opam/uchar.0.0.2/opam b/esy.lock/opam/uchar.0.0.2/opam new file mode 100644 index 000000000..4310af436 --- /dev/null +++ b/esy.lock/opam/uchar.0.0.2/opam @@ -0,0 +1,36 @@ +opam-version: "2.0" +maintainer: "Daniel Bünzli " +authors: ["Daniel Bünzli "] +homepage: "http://ocaml.org" +doc: "https://ocaml.github.io/uchar/" +dev-repo: "git+https://github.com/ocaml/uchar.git" +bug-reports: "https://github.com/ocaml/uchar/issues" +tags: [ "text" "character" "unicode" "compatibility" "org:ocaml.org" ] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" +depends: [ + "ocaml" {>= "3.12.0"} + "ocamlbuild" {build} +] +build: [ + ["ocaml" "pkg/git.ml"] + [ + "ocaml" + "pkg/build.ml" + "native=%{ocaml:native}%" + "native-dynlink=%{ocaml:native-dynlink}%" + ] +] +synopsis: "Compatibility library for OCaml's Uchar module" +description: """ +The `uchar` package provides a compatibility library for the +[`Uchar`][1] module introduced in OCaml 4.03. + +The `uchar` package is distributed under the license of the OCaml +compiler. See [LICENSE](LICENSE) for details. + +[1]: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Uchar.html""" +url { + src: + "https://github.com/ocaml/uchar/releases/download/v0.0.2/uchar-0.0.2.tbz" + checksum: "md5=c9ba2c738d264c420c642f7bb1cf4a36" +} diff --git a/esy.lock/opam/utop.2.9.2/opam b/esy.lock/opam/utop.2.11.0/opam similarity index 66% rename from esy.lock/opam/utop.2.9.2/opam rename to esy.lock/opam/utop.2.11.0/opam index c3ff53106..d9f71c3cd 100644 --- a/esy.lock/opam/utop.2.9.2/opam +++ b/esy.lock/opam/utop.2.11.0/opam @@ -1,25 +1,20 @@ opam-version: "2.0" -synopsis: "Universal toplevel for OCaml" -description: """\ -utop is an improved toplevel (i.e., Read-Eval-Print Loop or REPL) for -OCaml. It can run in a terminal or in Emacs. It supports line -edition, history, real-time and context sensitive completion, colors, -and more. It integrates with the Tuareg mode in Emacs.""" maintainer: "jeremie@dimino.org" authors: "Jérémie Dimino" license: "BSD-3-Clause" homepage: "https://github.com/ocaml-community/utop" -doc: "https://ocaml-community.github.io/utop/" bug-reports: "https://github.com/ocaml-community/utop/issues" +doc: "https://ocaml-community.github.io/utop/" depends: [ - "ocaml" {>= "4.03.0"} + "ocaml" {>= "4.08.0"} "base-unix" "base-threads" "ocamlfind" {>= "1.7.2"} - "lambda-term" {>= "3.1.0" & < "3.3.0"} + "lambda-term" {>= "3.1.0" & < "4.0"} + "logs" "lwt" "lwt_react" - "camomile" + "zed" { >= "3.2.0" } "react" {>= "1.0.0"} "cppo" {build & >= "1.1.2"} "dune" {>= "1.0"} @@ -30,11 +25,19 @@ build: [ ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] dev-repo: "git+https://github.com/ocaml-community/utop.git" +synopsis: "Universal toplevel for OCaml" +description: """ +utop is an improved toplevel (i.e., Read-Eval-Print Loop or REPL) for +OCaml. It can run in a terminal or in Emacs. It supports line +edition, history, real-time and context sensitive completion, colors, +and more. It integrates with the Tuareg mode in Emacs. +""" url { src: - "https://github.com/ocaml-community/utop/releases/download/2.9.2/utop-2.9.2.tbz" + "https://github.com/ocaml-community/utop/releases/download/2.11.0/utop-2.11.0.tbz" checksum: [ - "md5=abd1c592464ce5f31b17009954040d7c" - "sha512=db97275aa4bd7725a9eeec6d9155c239f3e48adf8d34b73f55caa2de32fde98862480db5e05dffc89e98efd12eb60e08d89ad34b9a92a8de0d37ccb32af07ddf" + "sha256=6937c6c672913ac3b875341ac4a205c7561d01cd8ac8f47cfb35d3bc0e762170" + "sha512=ab8b96eaa7f24654a371245f14819b74de0907ed8f3b2bbd9196808dc10e536458cf95418eeacf6dfc4b7f64a8dd088ee31e2eaae3d9ebc7de7cebcada52fb84" ] -} \ No newline at end of file +} +x-commit-hash: "595002e6f07e6a3c6abc6e94a1b2448006115f1b" diff --git a/esy.lock/opam/uucp.15.0.0/opam b/esy.lock/opam/uucp.15.0.0/opam new file mode 100644 index 000000000..dccf7c220 --- /dev/null +++ b/esy.lock/opam/uucp.15.0.0/opam @@ -0,0 +1,55 @@ +opam-version: "2.0" +synopsis: "Unicode character properties for OCaml" +description: """\ +Uucp is an OCaml library providing efficient access to a selection of +character properties of the [Unicode character database][1]. + +Uucp is independent from any Unicode text data structure and has no +dependencies. It is distributed under the ISC license. + +[1]: http://www.unicode.org/reports/tr44/ + +Home page: http://erratique.ch/software/uucp""" +maintainer: "Daniel Bünzli " +authors: "The uucp programmers" +license: "ISC" +tags: ["unicode" "text" "character" "org:erratique"] +homepage: "https://erratique.ch/software/uucp" +doc: "https://erratique.ch/software/uucp/doc/" +bug-reports: "https://github.com/dbuenzli/uucp/issues" +depends: [ + "ocaml" {>= "4.03.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "1.0.3"} + "uucd" {with-test} + "uunf" {with-test} + "uutf" {with-test} +] +depopts: ["uutf" "uunf" "cmdliner"] +conflicts: [ + "uutf" {< "1.0.1"} + "cmdliner" {< "1.1.0"} +] +build: [ + "ocaml" + "pkg/pkg.ml" + "build" + "--dev-pkg" + "%{dev}%" + "--with-uutf" + "%{uutf:installed}%" + "--with-uunf" + "%{uunf:installed}%" + "--with-cmdliner" + "%{cmdliner:installed}%" +] +post-messages: + "If the build fails with \"ocamlopt.opt got signal and exited\", issue 'ulimit -s unlimited' and retry." + {failure & (arch = "ppc64" | arch = "arm64")} +dev-repo: "git+https://erratique.ch/repos/uucp.git" +url { + src: "https://erratique.ch/software/uucp/releases/uucp-15.0.0.tbz" + checksum: + "sha512=ee4acff5666961766321e85e287fb9d5b8d50533319f22bf6f4eceb943242df2d0e0f4e775c4a140f68ca142837938eaa5926e22362215a3365ffe7f8768923b" +} \ No newline at end of file diff --git a/esy.lock/opam/uuseg.15.0.0/opam b/esy.lock/opam/uuseg.15.0.0/opam new file mode 100644 index 000000000..2178c0440 --- /dev/null +++ b/esy.lock/opam/uuseg.15.0.0/opam @@ -0,0 +1,57 @@ +opam-version: "2.0" +synopsis: "Unicode text segmentation for OCaml" +description: """\ +Uuseg is an OCaml library for segmenting Unicode text. It implements +the locale independent [Unicode text segmentation algorithms][1] to +detect grapheme cluster, word and sentence boundaries and the +[Unicode line breaking algorithm][2] to detect line break +opportunities. + +The library is independent from any IO mechanism or Unicode text data +structure and it can process text without a complete in-memory +representation. + +Uuseg depends on [Uucp](http://erratique.ch/software/uucp) and +optionally on [Uutf](http://erratique.ch/software/uutf) for support on +OCaml UTF-X encoded strings. It is distributed under the ISC license. + +[1]: http://www.unicode.org/reports/tr29/ +[2]: http://www.unicode.org/reports/tr14/ + +Homepage: http://erratique.ch/software/uuseg""" +maintainer: "Daniel Bünzli " +authors: "The uuseg programmers" +license: "ISC" +tags: ["unicode" "text" "segmentation" "org:erratique"] +homepage: "https://erratique.ch/software/uuseg" +doc: "https://erratique.ch/software/uuseg/doc/" +bug-reports: "https://github.com/dbuenzli/uuseg/issues" +depends: [ + "ocaml" {>= "4.03.0"} + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "1.0.3"} + "uucp" {>= "15.0.0" & < "16.0.0"} +] +depopts: ["uutf" "cmdliner"] +conflicts: [ + "uutf" {< "1.0.0"} + "cmdliner" {< "1.1.0"} +] +build: [ + "ocaml" + "pkg/pkg.ml" + "build" + "--dev-pkg" + "%{dev}%" + "--with-uutf" + "%{uutf:installed}%" + "--with-cmdliner" + "%{cmdliner:installed}%" +] +dev-repo: "git+https://erratique.ch/repos/uuseg.git" +url { + src: "https://erratique.ch/software/uuseg/releases/uuseg-15.0.0.tbz" + checksum: + "sha512=37ea83b582dd779a026cfae11f08f5d67ef79fce65a2cf03f2a9aabc7eb5de60c8e812524fa7531e4ff6e22a3b18228e3438a0143ce43be95f23237cc283576f" +} \ No newline at end of file diff --git a/esy.lock/opam/zed.3.1.0/opam b/esy.lock/opam/zed.3.2.1/opam similarity index 55% rename from esy.lock/opam/zed.3.1.0/opam rename to esy.lock/opam/zed.3.2.1/opam index d6d47cfe9..c4043db88 100644 --- a/esy.lock/opam/zed.3.1.0/opam +++ b/esy.lock/opam/zed.3.2.1/opam @@ -1,22 +1,4 @@ opam-version: "2.0" -maintainer: "opam-devel@lists.ocaml.org" -authors: ["Jérémie Dimino"] -homepage: "https://github.com/ocaml-community/zed" -bug-reports: "https://github.com/ocaml-community/zed/issues" -dev-repo: "git+https://github.com/ocaml-community/zed.git" -license: "BSD-3-Clause" -depends: [ - "ocaml" {>= "4.02.3"} - "dune" {>= "1.1.0"} - "base-bytes" - "camomile" {>= "1.0.1"} - "react" - "charInfo_width" {>= "1.1.0" & < "2.0~"} -] -build: [ - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] synopsis: "Abstract engine for text edition in OCaml" description: """ Zed is an abstract engine for text edition. It can be used to write text @@ -26,7 +8,43 @@ validation, and a rope datastructure to achieve efficient operations on large Unicode buffers. Zed also features a regular expression search on ropes. To support efficient text edition capabilities, Zed provides macro recording and cursor management facilities.""" +maintainer: ["opam-devel@lists.ocaml.org"] +authors: ["Jérémie Dimino"] +license: "BSD-3-Clause" +homepage: "https://github.com/ocaml-community/zed" +bug-reports: "https://github.com/ocaml-community/zed/issues" +depends: [ + "dune" {>= "3.0"} + "ocaml" {>= "4.02.3"} + "react" + "result" + "uchar" + "uutf" + "uucp" {>= "2.0.0"} + "uuseg" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocaml-community/zed.git" url { - src: "https://github.com/ocaml-community/zed/archive/3.1.0.tar.gz" - checksum: "md5=51e8676ba972e5ad727633c161e404b1" + src: + "https://github.com/ocaml-community/zed/releases/download/3.2.1/zed-3.2.1.tbz" + checksum: [ + "sha256=141091d21a03e92eed0efd96ece150c08c619bfbcd1b153a42d8a261b2b57f53" + "sha512=5c4c3bda52d3b8ba8618a91ac7864ebebd6020742e812d46f2a1cc78034acfc53b0a9b697424259b24fa84b367e36f154f35d4ac7ed536329294f000c7f52156" + ] } +x-commit-hash: "a7f3d7f967ab8cebe99817a0224fc8fbc3c290b5" diff --git a/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/files/winpatch.patch b/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch similarity index 100% rename from esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/files/winpatch.patch rename to esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch diff --git a/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/package.json b/esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json similarity index 100% rename from esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/package.json rename to esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json diff --git a/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/files/winpatch.patch b/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/files/winpatch.patch new file mode 100644 index 000000000..347e84160 --- /dev/null +++ b/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/files/winpatch.patch @@ -0,0 +1,11 @@ +--- ./pkg/topkg.ml ++++ ./pkg/topkg.ml +@@ -344,7 +344,7 @@ + let build ccomp btool bdir pkg mvs = + let ext_to_string = Exts.ext_to_string ccomp in + let install, exec = build_strings btool bdir ext_to_string mvs in +- let e = Sys.command exec in ++ let e = Sys.command ("bash -c '" ^ exec ^ "'") in + if e <> 0 then exit e else + let install_file = pkg ^ ".install" in + try diff --git a/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/package.json b/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/package.json new file mode 100644 index 000000000..dc79f7593 --- /dev/null +++ b/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/package.json @@ -0,0 +1,11 @@ +{ + "build": [ + [ + "bash", + "-c", + "#{os == 'windows' ? 'patch -p1 < winpatch.patch' : 'true' }" + ], + "ocaml pkg/git.ml", + "ocaml pkg/build.ml native=true native-dynlink=true" + ] +} diff --git a/formatTest/test.sh b/formatTest/test.sh index b891317dd..1aa3867f6 100755 --- a/formatTest/test.sh +++ b/formatTest/test.sh @@ -84,9 +84,9 @@ function info() { } function debug() { - if [ ! -z "$VERBOSE" ]; then - printf "${DEBUG}$1${RESET}\n" - fi + if [ ! -z "$VERBOSE" ]; then + printf "${DEBUG}$1${RESET}\n" + fi } function notice() { diff --git a/test/4.06/attributes.t b/test/4.06/attributes.t new file mode 100644 index 000000000..2e6c1dda9 --- /dev/null +++ b/test/4.06/attributes.t @@ -0,0 +1,34 @@ + $ cat > input.re < /* Pexp_letexception with attributes */ + > let () = { + > [@attribute] exception E; + > raise(E) + > }; + > + > /** Different payloads **/ + > + > /* Empty signature */ + > + > [@haha: ] + > let x = 5; + > + > /* signature_item */ + > [@haha: let x : option(int)] + > let x = 5; + > + > /* Signature */ + > [@haha: type t; let x : option(t)] + > let x = 5; + > EOF + +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.06/dune b/test/4.06/dune new file mode 100644 index 000000000..88fe54b9a --- /dev/null +++ b/test/4.06/dune @@ -0,0 +1,5 @@ +(cram + (enabled_if + (or + (= %{ocaml_version} 4.06.0) + (= %{ocaml_version} 4.06.1)))) diff --git a/test/4.06/error-comments.t b/test/4.06/error-comments.t new file mode 100644 index 000000000..f62b841c6 --- /dev/null +++ b/test/4.06/error-comments.t @@ -0,0 +1,9 @@ +Format ./input.re + $ cat >input.re < /* this is an unterminated comment + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 0-2: + Error: Comment not terminated + [1] diff --git a/test/4.06/error-lowercase_module.t b/test/4.06/error-lowercase_module.t new file mode 100644 index 000000000..9546194a8 --- /dev/null +++ b/test/4.06/error-lowercase_module.t @@ -0,0 +1,9 @@ +Print error for lowercase module + $ cat >input.re < module lowercase = {}; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 7-16: + Error: Module names must start with an uppercase letter. + [1] diff --git a/test/4.06/error-lowercase_module_rec.t b/test/4.06/error-lowercase_module_rec.t new file mode 100644 index 000000000..3c126eb8c --- /dev/null +++ b/test/4.06/error-lowercase_module_rec.t @@ -0,0 +1,9 @@ +Print error for lowercase module + $ cat >input.re < module rec lowercase = {}; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-20: + Error: Module names must start with an uppercase letter. + [1] diff --git a/test/4.06/error-reservedField.t b/test/4.06/error-reservedField.t new file mode 100644 index 000000000..d62d0568f --- /dev/null +++ b/test/4.06/error-reservedField.t @@ -0,0 +1,9 @@ +Print error for type reserved keyword + $ cat >input.re < let x = {< type >}; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-15: + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + [1] diff --git a/test/4.06/error-reservedRecord.t b/test/4.06/error-reservedRecord.t new file mode 100644 index 000000000..5dce5e425 --- /dev/null +++ b/test/4.06/error-reservedRecord.t @@ -0,0 +1,9 @@ +Print error for type reserved keyword + $ cat >input.re < let foo = { foo: "bar", type: "qux" }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 24-28: + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + [1] diff --git a/test/4.06/error-reservedRecordPunned.t b/test/4.06/error-reservedRecordPunned.t new file mode 100644 index 000000000..4e8b5bef0 --- /dev/null +++ b/test/4.06/error-reservedRecordPunned.t @@ -0,0 +1,9 @@ +Print error for type reserved keyword + $ cat >input.re < let foo = { ...other, type }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 22-26: + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + [1] diff --git a/test/4.06/error-reservedRecordType.t b/test/4.06/error-reservedRecordType.t new file mode 100644 index 000000000..18d1a14a8 --- /dev/null +++ b/test/4.06/error-reservedRecordType.t @@ -0,0 +1,12 @@ +Print error for type reserved keyword + $ cat >input.re < type x = { type: string }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-15: + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + [1] + + + diff --git a/test/4.06/error-reservedRecordTypePunned.t b/test/4.06/error-reservedRecordTypePunned.t new file mode 100644 index 000000000..1b39e7910 --- /dev/null +++ b/test/4.06/error-reservedRecordTypePunned.t @@ -0,0 +1,9 @@ +Print error for type reserved keyword + $ cat >input.re < type x = { type }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-15: + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + [1] diff --git a/test/4.06/error-syntaxError.t b/test/4.06/error-syntaxError.t new file mode 100644 index 000000000..3b4fd7455 --- /dev/null +++ b/test/4.06/error-syntaxError.t @@ -0,0 +1,9 @@ +Force error for try catch + $ cat >input.re < try (bad); + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 9-10: + Error: Syntax error + [1] diff --git a/test/4.06/objects.t b/test/4.06/objects.t new file mode 100644 index 000000000..07c977e78 --- /dev/null +++ b/test/4.06/objects.t @@ -0,0 +1,51 @@ + $ cat > input.re < /* Oinherit (https://github.com/ocaml/ocaml/pull/1118) */ + > type t = { + > . + > a: string + > }; + > + > type t1 = { + > . + > n: string, + > ...t, + > }; + > + > type t2('a) = { + > .. + > o: string, + > ...t, + > } as 'a; + > + > /* Pcl_open, Pcty_open (https://github.com/ocaml/ocaml/pull/1249) */ + > module EM = { + > type t; + > }; + > + > module OM = { + > type t; + > }; + > + > class x = { + > open EM; + > as self; + > }; + > + > class y = { + > open EM; + > open OM; + > as self; + > }; + > EOF + +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.06/type-trailing.t/input.re b/test/4.06/type-trailing.t/input.re new file mode 100644 index 000000000..9934332cc --- /dev/null +++ b/test/4.06/type-trailing.t/input.re @@ -0,0 +1,182 @@ + +let x = 0; +let y = 0; + +[@warning "-8"] +let [|x, y|] = [|0, y|]; +[@warning "-8"] +let [|x, y,|] = [|0, y,|]; + +[@warning "-8"] +let [|reallyLongIdentifier, reallyLongIdentifier2|] = [|0, 1|]; +[@warning "-8"] +let [|reallyLongIdentifier_, reallyLongIdentifier2_,|] = [|0, 2,|]; + +let takesUnit = () => (); +let res = takesUnit (); +let wat = (0,); + +type t = {x: int, y: int}; +let p = {contents: 0,}; +let {contents:c, } = p; +let point = {x: 0, y: 0}; +let point2 = {...point, y: 200,}; + +let myTuple = (0, 0,); +let (i, j,) = myTuple; + +type foo_('a, 'b) = ('a, 'b); +type foo__ = foo_(int, int,); +type foo('a, 'b, ) = Foo('a, 'b, ); +type tupVariant('a, 'b, ) = Tup(('a, 'b,),); + + +/* Won't wrap so removes trailing comma */ +let noWrap = (a, b,) => { + let x = a; + x + x; +}; + +let res = noWrap(0, 0,); +let reallyLongIdentifierCausesWrap = 0; +let wrap = noWrap; +let res = wrap( + reallyLongIdentifierCausesWrap, + reallyLongIdentifierCausesWrap, +); + +/* Won't wrap so removes trailing comma */ +let noWrap = (~a, ~b,) => { + let x = a; + x + x; +}; + +/* Won't wrap so removes trailing comma */ +let noWrap = (~a=0, ~b=0, (),) => { + let x = a; + x + x; +}; + +let res = noWrap( + ~a=reallyLongIdentifierCausesWrap, + ~b=reallyLongIdentifierCausesWrap, + (), +); + +/* Won't wrap so removes trailing comma */ +let noWrap = (~a=0, ~b:int=0, (),) => { + let x = a; + x + x; +}; + +let res = noWrap( + ~a=reallyLongIdentifierCausesWrap, + ~b=reallyLongIdentifierCausesWrap, + (), +); + +/* Long enough to wrap the args and therefore remove trail */ +let wrap = (long, enough, toWrap, args,) => { + let x = long; + x + enough + toWrap + args; +}; + + +let takesPattern = (d, Foo(x, y,)) => { + /* won't wrap */ + let _ = Foo(y, x,); + /* will wrap */ + let ret = Foo(y + y + y + y, x + x + x + x + x + x + x + x + x,); + ret +}; + +let takesPattern = (d, Tup((x, y,))) => { + /* won't wrap */ + let _ = Tup((y, x,)); + /* will wrap */ + let ret = Tup((y + y + y + y, x + x + x + x + x + x + x + x + x,)); + ret +}; + +let takesPattern = (d, Tup((thisPatternIsSoLongThatThe, fooWillWrapItself,))) => { + /* won't wrap */ + let _ = Tup((d, d,)); + /* will wrap */ + let ret = Tup((d + d + d + d, d + d + d + d + d + d + d + d + d,)); + ret +}; + + +let myFunc = (type t, (),) => (); + +type funcType = (int, int,) => int; +type v = Func ((int, int,) => int,); + +type params('a, 'b,) = ('a, 'b,); + + +let myList = [ + 2, + 3, +]; + +let yourList = [ + 5, + 6, + ...myList, +]; + + +class virtual tupleStack( + 'reallyLongIdentifier, + 'anotherReallyLongIdentifier, + )(init, init2,) { + val mutable v : list(('reallyLongIdentifier, 'anotherReallyLongIdentifier)) = [(init, init2,),]; + pub virtual implementMe: (int, int,) => (int, int); + initializer { + print_string("initializing object"); + }; +}; + +class extendedStack('reallyLongIdentifier, 'anotherReallyLongIdentifier)(init, init2,) { + inherit (class tupleStack('reallyLongIdentifier, 'anotherReallyLongIdentifier,))(init, init2,); + pub implementMe(i, j) = (i, j); +}; + + +module type HasType = {type t;}; +module type HasType2 = {type t; type q;}; +module type ReallyReallyReallyLongIdentifierModuleType = {type t}; +module type F = (HasType,) => HasType2; +module FInstance = (HasType : HasType,) => {type t = HasType.t; type q = HasType.t}; +module ReallyReallyReallyLongIdentifierModuleName = {type t = int;}; +module FResult = FInstance(ReallyReallyReallyLongIdentifierModuleName,); + + +module Component = { + let createElement = (~arg, ~children, ()) => [0]; +}; + +let componentList = []; +let componentList = []; +let componentList = [,]; +let componentList = [,]; +let componentList = [, ]; +let componentList = [, ]; +let componentList = [, , ]; +let componentList = [, , ]; +let componentList = [, , ]; +let componentList = [, , ]; + +let componentList = [||]; +let componentList = [||]; +let componentList = [|,|]; +let componentList = [|,|]; +let componentList = [|, |]; +let componentList = [|, |]; +let componentList = [|, ,|]; +let componentList = [|, ,|]; +let componentList = [|, ,|]; +let componentList = [|, ,|]; + + diff --git a/test/4.06/type-trailing.t/run.t b/test/4.06/type-trailing.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/4.06/type-trailing.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.06/typecheck-module-and-class.t b/test/4.06/typecheck-module-and-class.t new file mode 100644 index 000000000..f5280cbed --- /dev/null +++ b/test/4.06/typecheck-module-and-class.t @@ -0,0 +1,32 @@ + $ cat > input.ml < module EM = struct + > (** Exception *) + > exception E of int * int + > end + > + > (* Pcl_open *) + > class x = let open EM in object (self) end + > + > module OM = struct + > type t + > end + > + > class y = let open EM in let open OM in object (self) end + > + > module type S = sig + > type t = private .. + > type t += Foo + > end + > EOF + +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.08/dune b/test/4.08/dune new file mode 100644 index 000000000..674eb6702 --- /dev/null +++ b/test/4.08/dune @@ -0,0 +1,6 @@ +(cram + (enabled_if + (or + (= %{ocaml_version} 4.08.0) + (= %{ocaml_version} 4.08.1) + (= %{ocaml_version} 4.08.2)))) diff --git a/test/4.08/error-comments.t b/test/4.08/error-comments.t new file mode 100644 index 000000000..44f56100b --- /dev/null +++ b/test/4.08/error-comments.t @@ -0,0 +1,12 @@ +Format ./input.re + $ cat >input.re < /* this is an unterminated comment + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 0-2: + 1 | /* this is an unterminated comment + ^^ + Error: Comment not terminated + + [1] diff --git a/test/4.08/error-lowercase_module.t b/test/4.08/error-lowercase_module.t new file mode 100644 index 000000000..3b5adaad1 --- /dev/null +++ b/test/4.08/error-lowercase_module.t @@ -0,0 +1,12 @@ +Print error for lowercase module + $ cat >input.re < module lowercase = {}; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 7-16: + 1 | module lowercase = {}; + ^^^^^^^^^ + Error: Module names must start with an uppercase letter. + + [1] diff --git a/test/4.08/error-lowercase_module_rec.t b/test/4.08/error-lowercase_module_rec.t new file mode 100644 index 000000000..2855a8e7f --- /dev/null +++ b/test/4.08/error-lowercase_module_rec.t @@ -0,0 +1,12 @@ +Print error for lowercase module + $ cat >input.re < module rec lowercase = {}; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-20: + 1 | module rec lowercase = {}; + ^^^^^^^^^ + Error: Module names must start with an uppercase letter. + + [1] diff --git a/test/4.08/error-reservedField.t b/test/4.08/error-reservedField.t new file mode 100644 index 000000000..53127fc49 --- /dev/null +++ b/test/4.08/error-reservedField.t @@ -0,0 +1,12 @@ +Print error for type reserved keyword + $ cat >input.re < let x = {< type >}; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-15: + 1 | let x = {< type >}; + ^^^^ + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + + [1] diff --git a/test/4.08/error-reservedRecord.t b/test/4.08/error-reservedRecord.t new file mode 100644 index 000000000..6dbcca37e --- /dev/null +++ b/test/4.08/error-reservedRecord.t @@ -0,0 +1,12 @@ +Force error for type ./input.re + $ cat >input.re < let foo = { foo: "bar", type: "qux" }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 24-28: + 1 | let foo = { foo: "bar", type: "qux" }; + ^^^^ + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + + [1] diff --git a/test/4.08/error-reservedRecordPunned.t b/test/4.08/error-reservedRecordPunned.t new file mode 100644 index 000000000..15b985b00 --- /dev/null +++ b/test/4.08/error-reservedRecordPunned.t @@ -0,0 +1,14 @@ +Print error for type reserved keyword + $ cat >input.re < let foo = { ...other, type }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 22-26: + 1 | let foo = { ...other, type }; + ^^^^ + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + + [1] + + diff --git a/test/4.08/error-reservedRecordType.t b/test/4.08/error-reservedRecordType.t new file mode 100644 index 000000000..ed831203e --- /dev/null +++ b/test/4.08/error-reservedRecordType.t @@ -0,0 +1,15 @@ +Print error for type reserved keyword + $ cat >input.re < type x = { type: string }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-15: + 1 | type x = { type: string }; + ^^^^ + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + + [1] + + + diff --git a/test/4.08/error-reservedRecordTypePunned.t b/test/4.08/error-reservedRecordTypePunned.t new file mode 100644 index 000000000..f0f67582d --- /dev/null +++ b/test/4.08/error-reservedRecordTypePunned.t @@ -0,0 +1,12 @@ +Print error for type reserved keyword + $ cat >input.re < type x = { type }; + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 11-15: + 1 | type x = { type }; + ^^^^ + Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead + + [1] diff --git a/test/4.08/error-syntaxError.t b/test/4.08/error-syntaxError.t new file mode 100644 index 000000000..c9fe694e2 --- /dev/null +++ b/test/4.08/error-syntaxError.t @@ -0,0 +1,12 @@ +Force error for type ./input.re + $ cat >input.re < try (bad); + > EOF + + $ refmt ./input.re + File "./input.re", line 1, characters 9-10: + 1 | try (bad); + ^ + Error: Syntax error + + [1] diff --git a/test/4.08/mlSyntax.t/input.ml b/test/4.08/mlSyntax.t/input.ml new file mode 100644 index 000000000..e501ecec2 --- /dev/null +++ b/test/4.08/mlSyntax.t/input.ml @@ -0,0 +1,86 @@ +(* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. *) + +(** + * Testing pattern matching using ml syntax to exercise nesting of cases. + *) + + +type xyz = + | X + | Y of int * int * int + | Z of int * int + | Q + | R + +let doubleBar = function + | X | Y (_, _, _) | Z (_, _) | Q -> true + | _ -> false + +let doubleBarNested = function + | X | Y (_, _, _) | (Z (_, _) | Q) -> true + | _ -> false + + +(* Liberal use of the Any pattern being compatible with multiple arguments *) +let doubleBarAnyPatterns = function + | X | Y _ | Z _ | Q -> true + | _ -> false + +let doubleBarNestedAnyPatterns = function + | X | Y _ | (Z _ | Q) -> true + | _ -> false + +type bcd = B | C | D | E +type a = A of bcd +let result = match B with + | B + | C + | D + | E -> () + +let nested_match = function | A (B | C | D | E) -> 3 + +let some = Some (1, 2, 3) + +let (===) = (=) + +(* Test regression for https://github.com/facebook/Reason/issues/222 *) +let _ = Pervasives.(=) + +let structuralEquality = 1 = 1 + +let physicalInequality = 1 <> 2 + +let referentialEquality = 2 == 2 + +let referentialInequality = 2 != 2 + +let equalityInIf = if 1 = 1 then true else false + +let equalityWithIdentifiers = structuralEquality = referentialEquality + +let nestedSome = Some (1, 2, Some (1, 2, 3)) + +let nestedSomeSimple = Some (Some (1, 2, 3)) + +module EM = struct + (** Exception *) + exception E of int * int +end + +exception Ealias = EM.E + +let switc = "match" +let switch = "match" +let switch_ = "match" +let pub = "method" +let pub_ = "method" +let pri = "private" +let pri_ = "private" + +external private_ : unit -> unit = "" +external pri : unit -> unit = "" + +type pub = int +type pub_ = int + diff --git a/test/4.08/mlSyntax.t/run.t b/test/4.08/mlSyntax.t/run.t new file mode 100644 index 000000000..c885c5382 --- /dev/null +++ b/test/4.08/mlSyntax.t/run.t @@ -0,0 +1,19 @@ +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 71, characters 8-23: + 71 | let _ = Pervasives.(==); + ^^^^^^^^^^^^^^^ + Alert deprecated: module Stdlib.Pervasives + Use Stdlib instead. + + If you need to stay compatible with OCaml < 4.07, you can use the + stdlib-shims library: https://github.com/ocaml/stdlib-shims + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.08/type-jsx.t/input.re b/test/4.08/type-jsx.t/input.re new file mode 100644 index 000000000..38c2ac8a7 --- /dev/null +++ b/test/4.08/type-jsx.t/input.re @@ -0,0 +1,458 @@ +type component = {displayName: string}; + +module Bar = { + let createElement(~c=?,~children,()) {displayName: "test"}; +}; + +module Nesting = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Much = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Foo = { + let createElement(~a=?,~b=?,~children,()) {displayName: "test"}; +}; + +module One = { + let createElement(~test=?,~foo=?,~children,()) {displayName: "test"}; + + let createElementobvioustypo(~test,~children,()) {displayName: "test"}; +}; + +module Two = { + let createElement(~foo=?,~children,()) {displayName: "test"}; +}; + +module Sibling = { + let createElement(~foo=?,~children : list(component),()) = {displayName: "test"}; +}; + +module Test = { + let createElement(~yo=?,~children,()) {displayName: "test"}; +}; + +module So = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Foo2 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Text = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Exp = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Pun = { + let createElement(~intended=?,~children,()) {displayName: "test"}; +}; + +module Namespace = { + module Foo = { + let createElement(~intended=?,~anotherOptional as x=100,~children,()) {displayName: "test"}; + }; +}; + +module Optional1 = { + let createElement(~required,~children,()) { + switch (required) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + +module Optional2 = { + let createElement(~optional=?,~children,()) { + switch (optional) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + +module DefaultArg = { + let createElement(~default=Some("foo"),~children,()) { + switch (default) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + + +module LotsOfArguments = { + let createElement(~argument1=?,~argument2=?,~argument3=?,~argument4=?,~argument5=?,~argument6=?,~children,()) {displayName: "test"}; +}; + +let div(~argument1=?,~children,()) { + displayName: "test" +}; + +module List1 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module List2 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module List3 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module NotReallyJSX = { + let createElement(~foo,~bar,children) {displayName: "test"}; +}; + +let notReallyJSX(~foo,~bar,children) { + displayName: "test" +}; + +let fakeRender (el:component) { + el.displayName +}; + +/* end of setup */ + +let (/><)(a,b) = a + b; +let (><)(a,b) = a + b; +let (/>) = fun(a,b) => a + b; +let ( ><\/ ) = fun(a,b) => a + b; + +let tag1 = 5 />< 6; +let tag2 = 5 >< 7; +let tag3 = 5 /> 7; +let tag4 = 5 ><\/ 7; + +let b = 2; +let selfClosing = ; +let selfClosing2 = ; +let selfClosing3 = + ; +let a = a + 2) /> ; +let a3 = ; +let a4 = ; +let a5 = "testing a string here"; +let a6 = + + + "testing a string here" + "another string" ( 2 + 4 ) + ; +let intended = true; +let punning = ; +let namespace = ; +let c = ; +let d = ; + +let spaceBefore = ; +let spaceBefore2 = ; +let siblingNotSpaced = ; +let jsxInList = [ ]; +let jsxInList2 = [ ]; +let jsxInListA = [ ]; +let jsxInListB = [ ]; +let jsxInListC = [ ]; +let jsxInListD = [ ]; +let jsxInList3 = [ , , ]; +let jsxInList4 = [ , , ]; +let jsxInList5 = [ , ]; +let jsxInList6 = [ , ]; +let jsxInList7 = [ , ]; +let jsxInList8 = [ , ]; +let testFunc(b) = b; +let jsxInFnCall = testFunc (); +let lotsOfArguments = ; +let lowerCase =
; + +let b = 0; +let d = 0; +/* + * Should pun the first example: + */ +let a = 5; +let a = 5; +let a = 5; +let a = 0.55; +let a = [@JSX] Foo.createElement(~children=[],()); +let ident = {a}; +let fragment1 = <> ; +let fragment2 = <> ; +let fragment3 = <> ; +let fragment4 = <> ; +let fragment5 = <> ; +let fragment6 = <> ; +let fragment7 = <> ; +let fragment8 = <> ; +let fragment9 = <> 2 2 2 2 ; +let fragment10 = <>2.2 3.2 4.6 1.2 ; +let fragment11 = <>"str"; +let fragment12 = <>(6 + 2) (6 + 2) (6 + 2); +let fragment13 = <>fragment11 fragment11; +let listOfItems1 = 1 2 3 4 5; +let listOfItems2 = 1.0 2.8 3.8 4.0 5.1; +let listOfItems3 = fragment11 fragment11; + + + +/* + * Several sequential simple jsx expressions must be separated with a space. + */ +let thisIsRight(a,b) = (); +let tagOne = fun(~children,()) => (); +let tagTwo = fun(~children,()) => (); +/* thisIsWrong ; */ +thisIsRight(,); + +/* thisIsWrong ; */ +thisIsRight( , ); + + +let a = fun(~children,()) => (); +let b = fun(~children,()) => (); + +let thisIsOkay = + + + + ; + +let thisIsAlsoOkay = + + + ; + + +/* Doesn't make any sense, but suppose you defined an + infix operator to compare jsx */ + < ; + > ; + + < ; + > ; + +let listOfListOfJsx = [<> ]; +let listOfListOfJsx = [<> ]; +let listOfListOfJsx = [<> , <> ]; +let listOfListOfJsx = [<> , <> , ...listOfListOfJsx]; + + +let sameButWithSpaces = [ <> ]; +let sameButWithSpaces = [ <> ]; +let sameButWithSpaces = [ <> , <> ]; +let sameButWithSpaces = [ <> , <> , ...sameButWithSpaces]; + +/* + * Test named tag right next to an open bracket. + */ + +let listOfJsx = []; +let listOfJsx = [ ]; +let listOfJsx = [, ]; +let listOfJsx = [, , ...listOfJsx]; + + +let sameButWithSpaces = []; +let sameButWithSpaces = []; +let sameButWithSpaces = [, ]; +let sameButWithSpaces = [, , ...sameButWithSpaces]; + +/** + * Test no conflict with polymorphic variant types. + */ +type thisType = [`Foo | `Bar]; +type t('a) = [< thisType ] as 'a; + +let asd = [@JSX] [@foo] One.createElement(~test=true, ~foo=2, ~children=["a", "b"],()); +let asd2 = [@JSX] [@foo] One.createElementobvioustypo(~test=false, ~children=["a", "b"],()); + +let span(~test : bool,~foo : int,~children,()) = 1; +let asd = [@JSX] [@foo] span(~test=true, ~foo=2, ~children=["a", "b"],()); +/* "video" call doesn't end with a list, so the expression isn't converted to JSX */ +let video(~test: bool,children) = children; +let asd2 = [@JSX] [@foo] video(~test=false,10); + + +let div(~children) = 1; +([@JSX] (((fun () => div) ())(~children=[]))); + +let myFun () { + <> + + + + + + + + + + + + ; + +}; + +let myFun () { +<> +; +}; + +let myFun () { + <> + + + + + + + + + + + + ; +}; + +/** + * Children should wrap without forcing attributes to. + */ + + + + + +; + +/** + * Failing test cases: + */ +/* let res = ) > */ +/* */ +/* ; */ + +/* let res = ) />; */ +let zzz = Some("oh hai"); +/* this should be the only test that generates a warning. We're explicitly testing for this */ +let optionalCallSite = ; +fakeRender(optionalCallSite); +let optionalArgument = ; +fakeRender(optionalArgument); +let optionalArgument = ; +fakeRender(optionalArgument); +let defaultArg = ; +fakeRender(defaultArg); +let defaultArg = ; +fakeRender(defaultArg); + +([@JSX][@bla] NotReallyJSX.createElement([],~foo=1,~bar=2)); +([@bla][@JSX] NotReallyJSX.createElement(~foo=1,[],~bar=2)); +([@JSX][@bla] notReallyJSX([],~foo=1)); +([@bla][@JSX] notReallyJSX(~foo=1,[],~bar=2)); + +/* children can be at any position */ +([@JSX] span(~children=[],~test=true,~foo=2,())); + +([@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); + +/* preserve some other attributes too! */ +([@JSX][@bla] span(~children=[],~test=true,~foo=2,())); +([@bla][@JSX] span(~children=[],~test=true,~foo=2,())); + +([@JSX][@bla] Optional1.createElement(~children=[],~required=Some("hi"),())); +([@bla][@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); + +/* Overeager JSX punning #1099 */ +module Metal = { + let fiber = "fiber"; +}; + +module OverEager = { + let createElement(~fiber,~children,()) {displayName: "test"}; +}; + +let element = ; + +type style = { + width: int, + height: int, + paddingTop: int, + paddingLeft: int, + paddingRight: int, + paddingBottom: int +}; + +module Window = { + let createElement(~style,~children,()) {displayName: "window"}; +}; + +let w = + ; + + +let foo = None; + +let g = ; + +/* https://github.com/facebook/reason/issues/1428 */ + ...element ; + + ...((a) => 1) ; + + ... ; + + ...[|a|] ; + + ...(1, 2) ; + +module Foo3 = { + let createElement = (~bar, ~children, ()) => (); +}; + + />; + +let onClickHandler = () => (); + +let div = (~onClick, ~children, ()) => (); + +
<> "foobar"
; + +/* + * This is identical to just having "foobar" as a single JSX child (which means + * it's in a list). + */ +let yetAnotherDiv =
... <> "foobar"
; + +let tl = []; + +/* + * Spreading a list that has an identifier/expression as its tail. This should + * preserve the spread and preserve the braces. [list] is not considered + * simple for the purposes of spreading into JSX, or as a child. + */ +
...{[yetAnotherDiv, ...tl]}
; + +/* + * This is equivalent to having no children. + */ +
...{[]}
; diff --git a/test/4.08/type-jsx.t/run.t b/test/4.08/type-jsx.t/run.t new file mode 100644 index 000000000..58b5a34fe --- /dev/null +++ b/test/4.08/type-jsx.t/run.t @@ -0,0 +1,15 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 460, characters 23-26: + 460 | ; + ^^^ + Warning 43: the label required is not optional. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.08/typecheck-features.t b/test/4.08/typecheck-features.t new file mode 100644 index 000000000..5a05b2ac4 --- /dev/null +++ b/test/4.08/typecheck-features.t @@ -0,0 +1,34 @@ + $ cat > input.mli < module X : sig + > type t + > end + > + > module M := X + > + > module N := X [@@attr] + > + > type y = int + > + > type z = int + > + > type t = int + > + > type x := y + > + > type y := z [@@attr1] + > and w := t [@@attr2] + > + > type x' = | and y' = | + > EOF + +Format basic + $ refmt --print re ./input.mli > ./formatted.rei + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -intf formatted.rei + +Format the formatted file back + $ refmt --print re ./formatted.rei > ./formatted_back.rei + +Ensure idempotency: first format and second format are the same + $ diff formatted.rei formatted_back.rei diff --git a/test/4.10/attributes-re.t/input.re b/test/4.10/attributes-re.t/input.re new file mode 100644 index 000000000..c7bbca906 --- /dev/null +++ b/test/4.10/attributes-re.t/input.re @@ -0,0 +1,664 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ +/** + * Generally, dangling attributes [@..] apply to everything to the left of it, + * up until a comma, equals asignment, arrow, bar, or infix symbol (+/-) or + * prefix. + * + * This has a nice side effect when printing the terms: + * If a node has attributes attached to it, + */ + +[@ocaml.text "Floating comment text should be removed"]; + +/** + * Core language features: + * ---------------------- + */ + +[@ocaml.doc "Floating doc text should be removed"]; + +[@itemAttributeOnTypeDef] [@ocaml.text "removed text on type def"] +type itemText = int; +type nodeText = [@ocaml.text "removed text on item"] int; +[@itemAttributeOnTypeDef] +[@ocaml.text "removed text on type def"] +type nodeAndItemText = + [@ocaml.text "removed text on item"] int; + +[@itemAttributeOnTypeDef] [@ocaml.doc "removed doc on type def"] +type itemDoc = int; +[@itemAttributeOnTypeDef] +type nodeDoc = [@ocaml.text "removed text on item"] int; +[@itemAttributeOnTypeDef] [@ocaml.doc "removed doc on type def"] +type nodeAndItemDoc = + [@ocaml.text "removed text on item"] int; + +[@itemAttributeOnTypeDef] +type x = int; +type attributedInt = [@onTopLevelTypeDef] int; + +[@itemAttributeOnTypeDef] +type attributedIntsInTuple = ([@onInt] int, [@onFloat] float); + +type myDataType('x,'y) = | MyDataType('x,'y); + +type myType = + [@onEntireType] + myDataType ([@onOptionInt] option(int), + [@onOption] option(float)); + + +let thisInst : myType = + [@attOnEntireDatatype] MyDataType(Some(10),Some(10.0)); + +let thisInst : myType = + [@attOnEntireDatatype] MyDataType([@onFirstParam] Some(10), Some(10.0)); + +let x = ([@onHello] "hello"); +let x = [@onHello] "hello"; + +let x = "hello" ++ ([@onGoodbye] "goodbye"); +let x = ([@onHello] "hello") ++ "goodbye"; +let x = [@onHello] "hello" ++ "goodbye"; +let x = "hello" ++ [@onGoodbye] "goodbye"; +let x = [@onEverything] ("hello" ++ "goodbye"); + +let x = 10 + ([@on20] 20); +let x = 10 + [@on20] 20; +let x = [@on10] 10 + 20; +let x = ([@on10] 10) + 20; +let x = [@attrEverything] (10 + 20); + +let x = 10 - ([@on20] 20); +let x = 10 - [@on20] 20; +let x = [@on10] 10 - 20; +let x = ([@on10] 10) - 20; +let x = [@attrEntireEverything] (10 - 20); + +let x = true && ([@onFalse] false); +let x = true && [@onFalse] false; +let x = [@onTrue] true && false; +let x = ([@onTrue] true) && false; +let x = [@attrEverything] (true && false); + + +/* now make sure to try with variants (tagged and `) */ + +/** + * How attribute parsings respond to other syntactic constructs. + */ +let add(a) { [@onRet] a }; +let add = fun(a) => [@onRet] a; +let add = [@onEntireFunction] (fun(a) => a); + +let res = if (true) false else [@onFalse] false; +let res = [@onEntireIf] (if (true) false else false); + + +let add(a,b) = [@onEverything] ([@onA] a + b); +let add(a,b) = [@onEverything] ([@onA]a + ([@onB]b)); +let add = (a,b) => a + [@onB]b; + +let both = [@onEntireFunction](fun(a) => a); +let both(a,b) = [@onEverything]([@onA]a && b); +let both(a,b) = [@onA] a && [@onB] ([@onB] b); +let both = fun(a,b) => [@onEverything](a && b); + +let thisVal = 10; +let x = 20 + - [@onFunctionCall] add(thisVal,thisVal); +let x = [@onEverything] (20 + - add(thisVal,thisVal)); +let x = - [@onFunctionCall] add(thisVal,thisVal); +let x = [@onEverything] (- add(thisVal,thisVal)); + + +let bothTrue(x,y) = {contents: x && y}; +let something = [@onEverythingToRightOfEquals](bothTrue(true,true)^); +let something = ([@onlyOnArgumentToBang]bothTrue(true,true))^; + +let res = [@appliesToEntireFunctionApplication] add(2,4); + [@appliesToEntireFunctionApplication]add(2,4); + + +let myObj = { + pub p () = { + pub z () = 10 + }; +}; + +let result = [@onSecondSend]([@attOnFirstSend]myObj#p ())#z (); + +[@onRecordFunctions] +type recordFunctions = { + p: (unit) => ([@onUnit] recordFunctions), + q: [@onArrow] ((unit) => unit) +} +[@onUnusedType] +and unusedType = unit; +[@onMyRecord] +let rec myRecord = { + p: fun () => myRecord, + q: fun () => () +} +[@onUnused] +and unused = (); +let result = [@onSecondSend]([@attOnFirstSend]myRecord.p()).q(); + +[@onVariantType] +type variantType = + [@onInt] | Foo(int) + | Bar ([@onInt] int) + | Baz; + +[@onVariantType] +type gadtType('x) = + | Foo(int) : [@onFirstRow] gadtType(int) + | Bar ([@onInt]int) : [@onSecondRow]gadtType(unit) + | Baz: [@onThirdRow] gadtType ([@onUnit] unit); + +[@floatingTopLevelStructureItem hello]; +[@itemAttributeOnEval] +print_string("hello"); + +[@itemAttrOnFirst] +let firstBinding = "first" +[@itemAttrOnSecond] +and secondBinding = "second"; + +/** + * Let bindings. + * ---------------------- + */ +let showLets () = [@onOuterLet] { + let tmp = 20; + [@onFinalLet] { + let tmpTmp = tmp + tmp; + tmpTmp + tmpTmp; + } +}; + + +/** + * Classes: + * ------------ + */ +/** + * In curried sugar, the class_expr attribute will apply to the return. + */ +[@moduleItemAttribute] +class boxA('a) (init: 'a) = [@onReturnClassExpr] { + [@ocaml.text "Floating comment text should be removed"]; + [@ocaml.doc "Floating comment text should be removed"]; + pub pr = init + init + init; +}; + +/** + * In non-curried sugar, the class_expr still sticks to "the simple thing". + */ +class boxB('a) = + fun (init: 'a) => [@stillOnTheReturnBecauseItsSimple] { + pub pr = init + init + init; + }; + +/* To be able to put an attribute on just the return in that case, use + * parens. */ +[@onBoxC x ; y] +class boxC('a) = [@onEntireFunction] ( + fun (init: 'a) => ( + [@onReturnClassExpr] { + pub pr = init + init + init; + } + ) +); + +[@moduleItemAttribute onTheTupleClassItem;] +class tupleClass('a,'b)(init: ('a, 'b)) { + let one = [@exprAttr ten;] 10; + let two = [@exprAttr twenty;] 20 + and three = [@exprAttr thirty;] 30; + [@pr prMember;] + pub pr = one + two + three; +}; + +[@structureItem] +class type addablePointClassType = { + [@ocaml.text "Floating comment text should be removed"]; + [@ocaml.doc "Floating comment text should be removed"]; + pub x: int; + pub y: int; + pub add: (addablePointClassType, addablePointClassType) => int; +} +[@structureItem] +and anotherClassType = { + pub foo: int; + pub bar: int; +}; + +class type _x = [@bs]{ pub height : int }; + +class type _y { [@bs.set] pub height : int }; + +[@attr] class type _z { pub height : int }; + +module NestedModule { + [@floatingNestedStructureItem hello]; +}; +[@structureItem] +module type HasAttrs = { + [@onTypeDef] + type t = int; + [@floatingNestedSigItem hello]; + [@sigItem] + class type foo = {pub foo: int; pub bar: int;}; + [@sigItem] + class fooBar: (int) => foo; + [@ocaml.text "Floating comment text should be removed"]; + [@ocaml.doc "Floating comment text should be removed"]; +}; + +type s = S(string); + +let S ([@onStr] str) = S ([@onHello]"hello"); +let [@onConstruction](S(str)) = [@onConstruction](S("hello")); + +type xy = | X(string) + | Y(string); + +let myFun = fun ([@onConstruction]X(hello) | [@onConstruction]Y(hello)) => hello; +let myFun = fun (X ([@onHello] hello ) | Y ([@onHello]hello )) => hello; + +/* Another bug: Cannot have an attribute on or pattern +let myFun = fun ((X(hello) | Y(hello)) [@onOrPattern]) => hello; +*/ + +/* Bucklescript FFI item attributes */ + +[@bs.val] +external imul : (int, int) => int = "Math.imul"; + +let module Js { + type t('a); +}; + +type classAttributesOnKeys = { + . + [@bs.set] key1 : string, + + /* The follow two are the same */ + [@bs.get {null}] key2 : [@onType2] Js.t(int), + [@bs.get {null}] key3 : ([@onType2] (Js.t(int))), + + key4 : Js.t ([@justOnInt] int) +}; + +/* extensible variants */ +type attr = ..; + +[@block] +type attr += + [@tag1] [@tag2] | Str + [@tag3] | Float ; + +type reconciler('props) = ..; + +[@onVariantType] +type reconciler('props) += + | Foo(int) : [@onFirstRow] reconciler(int) + | Bar ([@onInt] int) : [@onSecondRow] reconciler(unit) + [@baz] | Baz: [@onThirdRow] reconciler ([@onUnit] unit); + +type water = ..; + +type water += pri [@foo] | [@foo2] MineralWater | SpringWater; + +type cloud = string; + +type water += pri | [@h2o] PreparedWater | [@nature] RainWater(cloud) | [@toxic] MeltedSnowWaterFromNuclearWastelandWithALineBreakBecauseTheNameIsSoLong; + + +/* reasonreact */ +type element; + +type reactElement; + +type reactClass; + +/* "react-dom" shouldn't spread the attribute over multiple lines */ +[@bs.val] [@bs.module "react-dom"] +external render : (reactElement, element) => unit = "render"; + +[@bs.module "f"] +external f : (int) => int = "f"; + +[@bs.val] [@bs.module "react"] [@bs.splice] +external createCompositeElementInternalHack + : (reactClass, Js.t({.. reasonProps : 'props}), array(reactElement)) => reactElement + = "createElement"; + +external add_nat: (int, int) => int = "add_nat_bytecode" "add_nat_native"; + +[@bs.module "Bar"] [@ocaml.deprecated "Use bar instead. It's a much cooler function. This string needs to be a little long"] +external foo : (bool) => bool = ""; + +/* Attributes on an entire polymorphic variant leaf */ +[@bs.module "fs"] +external readFileSync : ( + ~name: string, + [@bs.string] [ + | `utf8 + [@bs.as "ascii"] | `my_name + ] +) => string = ""; + +[@bs.module "fs"] +external readFileSync2 : ( + ~name: string, + [@bs.string] [ + [@bs.as "ascii"] | `utf8 + [@bs.as "ascii"] | `my_name + ]) => string = ""; + +/* Ensure that attributes on extensions are printed */ +[@test + [@attr] + [%%extension] +]; + +external debounce : (int, [@bs.meth] unit) => unit; + +external debounce : (int, [@bs.meth] unit) => unit = "debounce"; + +external debounce : (int, [@bs.meth] unit) => unit = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => [@bs.meth] (unit => unit))) => ([@bs.meth] (unit => unit)) = ""; + + +let x = "hi"; + +let res = switch (x) { +| _ => + [@attr] + { + open String; + open Array; + concat; + index_from; + } +}; + +let res = switch (x) { +| _ => + [@attr] + { + open String; + open Array; + concat; + } +}; + +/* GADT */ +type value = +| [@foo] VBool'(bool): [@bar] value +| VInt'(int): value; + +/** Different payloads **/ + +/* Empty structure */ +[@haha] +let x = 5; + +/* Expression structure */ +[@haha "hello world"] +let x = 5; + +/* structure_item */ +[@haha let x = 5] +let x = 5; + +/* structure */ +[@haha let x = 5; module X = {};] +let x = 5; + +/* Pattern */ +[@haha? Some(_) ] +let x = 5; + +/* Type */ +[@haha: option(int)] +let x = 5; + +/* Record item attributes */ + +type t_ = { + /** Comment attribute on record item */ + x: int +}; + +type tt = { + [@attr "on record field"] + x: int +}; + +type ttt = { + [@attr "on record field"] + x: [@attr "on type itself"] int +}; + +type tttt = { + /** Comment attribute on record item */ + x: int, + [@regularAttribute "on next item"] + y: int +}; + +type ttttt = [@attr "moved to first row"] { + [@attr] + x: int +}; + +type tttttt = { + [@attr "testing with mutable field"] + mutable x: int +}; + + +let tmp = { + /** On if statement */ + if (true) { + true + } else { + false + }; +}; + +type foo = + option( + [@foo ["how does this break", "when long enough"]] ( + [@bar] (int => int), + [@baz] (int => int), + ), + ); + +module Callbacks = { + let cb = () => 1 + 1; +}; + +let test = { + let _x = 1; + [@attr1] + open Callbacks; + let _s = "hello" ++ "!"; + [@attr2] Callbacks.("hello" ++ "!"); +}; + +[@test.call string => string] +let processCommandItem = 12; + +module type Foo = { [@someattr] let foo: int => int;}; + + +[@bs.deriving abstract] + type t = { + /** Position (in the pre-change coordinate system) where the change ended. */ + [@bs.as "to"] [@bar] + to_: string, + }; + +[@bs.deriving abstract] +type editorConfiguration = { + [@bs.optional] + /** Determines whether horizontal cursor movement through right-to-left (Arabic, Hebrew) text + is visual (pressing the left arrow moves the cursor left) + or logical (pressing the left arrow moves to the next lower index in the string, which is visually right in right-to-left text). + The default is false on Windows, and true on other platforms. */ + rtlMoveVisually: bool, +}; + +module Fmt = { + let barBaz = () => (); + + type record = {x: int}; +}; + +Fmt.([@foo] barBaz()); +Fmt.([@foo] {x: 1}); +Fmt.([@foo] [1, 2, 3]); +Fmt.([@foo] (1, 2, 3)); +Fmt.([@foo] {val x = 10}); + + +/** + * Attributes are associate with the identifier, function call, constructor + * appcation or constructor application pattern in front of it - up until a + * type constraint, an | (or) or an 'as'. + */ + +let punnned_lbl_a = (~lbl as [@ATTR] lbl) => lbl; +let punnned_lbl_b = (~lbl as [@ATTR] (lbl: int)) => lbl; +let punnned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lbl)) => lbl; +let punnned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lbl: int)) => lbl; +let punnned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lbl: int))) => lbl; + +let punnned_lbl_f = (~lbl as [@ATTR] lbl: int) => lbl; +let punnned_lbl_g = (~lbl as ([@ATTR] lbl: int)) => lbl; +let punnned_lbl_h = (~lbl as ([@ATTR] (lbl: int))) => lbl; +/** Attributes have lower precedence than type constraint. The following should + * be printed identically. */ +let punnned_lbl_i = (~lbl as [@ATTR] lbl: int) => lbl; +let punnned_lbl_i' = (~lbl as [@ATTR] (lbl: int)) => lbl; + +let nonpunned_lbla = (~lbl as [@ATTR] lblNonpunned) => lblNonpunned; +let nonpunned_lbl_b = (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; +let nonpunned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned)) => lblNonpunned; +let nonpunned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned: int)) => lblNonpunned; +let nonpunned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lblNonpunned: int))) => lblNonpunned; + +let nonpunned_lbl_f = (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; +let nonpunned_lbl_g = (~lbl as ([@ATTR] lblNonpunned: int)) => lblNonpunned; +let nonpunned_lbl_h = (~lbl as ([@ATTR] (lblNonpunned: int))) => lblNonpunned; + +let nonpunned_lbl_i = (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; +let nonpunned_lbl_i' = (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; + +let defaulted_punnned_lbl_a = (~lbl as [@ATTR] lbl=0, ()) => lbl; +let defaulted_punnned_lbl_b = (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; +let defaulted_punnned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lbl)=0, ()) => lbl; +let defaulted_punnned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lbl: int)=0, ()) => lbl; +let defaulted_punnned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lbl: int))=0, ()) => lbl; + +let defaulted_punnned_lbl_f = (~lbl as [@ATTR] lbl: int=0, ()) => lbl; +let defaulted_punnned_lbl_g = (~lbl as ([@ATTR] lbl: int)=0, ()) => lbl; +let defaulted_punnned_lbl_h = (~lbl as ([@ATTR] (lbl: int))=0, ()) => lbl; +/** Attributes have lower precedence than type constraint. The following should + * be printed identically. */ +let defaulted_punnned_lbl_i = (~lbl as [@ATTR] lbl: int=0, ()) => lbl; +let defaulted_punnned_lbl_i' = (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; + +let defaulted_nonpunned_lbla = (~lbl as [@ATTR] lblNonpunned=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_b = (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned: int)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lblNonpunned: int))=0, ()) => lblNonpunned; + +let defaulted_nonpunned_lbl_f = (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_g = (~lbl as ([@ATTR] lblNonpunned: int)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_h = (~lbl as ([@ATTR] (lblNonpunned: int))=0, ()) => lblNonpunned; + +let defaulted_nonpunned_lbl_i = (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_i' = (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; + +/* Won't parse: let [@attr] x1 : int = xInt; */ +let xInt = 0; + +/** + Attribute on the pattern node inside of constraint + pattern ( + Ppat_constraint( + pattern(@xxx, Ppat_var "x"), + coretype + ) + ) + This will get sugared to `let ([@attr] x2) : int = xInt` +*/ +let ([@attr] x2 : int) = xInt; +/** + Attribute on the pattern holding the constraint: + pattern( + @xxx + Ppat_constraint( + pattern(Pexpident "x"), + coretype + ) + ) +*/ +let ([@attr] (x3 : int)) = xInt; +let ([@attr] ([@attr0] x4: int)) = xInt; +let ([@attr] (([@attr0] x5): int)) = xInt; + +type eitherOr('a, 'b) = Either('a) | Or('b); +let [@attr] Either(a) | Or(a) = Either("hi"); +// Can drop the the parens around Either. +let ([@attr] Either(a)) | Or(a) = Either("hi"); +// Can drop the parens around Or. +let Either(b) | ([@attr] Or(b)) = Either("hi"); +// Should keep the parens around both +let [@attr] (Either(a) | Or(a)) = Either("hi"); + +// Should keep the parens +let [@attr] (_x as xAlias) = 10; +// Should drop the parens +let ([@attr] _x) as xAlias' = 10; + + +/** + Attribute on the expression node inside of constraint + expression( + Pexp_constraint( + expression(@xxx, Pexpident "x"), + coretype + ) + ) +*/ +let _ = ([@xxx] xInt : int); // This should format the same +let _ = (([@xxx] xInt) : int); // This should format the same + +/** + Attribute on the expression holding the constraint: + expression( + @xxx + Pexp_constraint( + expression(Pexpident "x"), + coretype + ) + ) +*/ +let _ = [@xxx] (xInt : int); // This should format the same + +[@foo? [@attr] (x: int)]; +[@foo? [@attr] ([@bar] x: int)]; +[@foo ? [@attr] (Either("hi") | Or("hi"))]; diff --git a/test/4.10/attributes-re.t/run.t b/test/4.10/attributes-re.t/run.t new file mode 100644 index 000000000..08f84df93 --- /dev/null +++ b/test/4.10/attributes-re.t/run.t @@ -0,0 +1,15 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 503, characters 4-10: + 503 | concat; + ^^^^^^ + Warning 10: this expression should have type unit. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.10/dune b/test/4.10/dune new file mode 100644 index 000000000..386c8f23b --- /dev/null +++ b/test/4.10/dune @@ -0,0 +1,14 @@ +; Disable these tests in windows since their output don't match, and we +; want to ensure the output works in other systems + +(cram + (enabled_if + (and + (or + (= %{system} "mac") + (= %{system} "linux")) + (or + (= %{ocaml_version} 4.10.0) + (= %{ocaml_version} 4.10.1) + (= %{ocaml_version} 4.10.2) + (= %{ocaml_version} 4.10.3))))) diff --git a/test/4.10/local-openings.t/input.ml b/test/4.10/local-openings.t/input.ml new file mode 100644 index 000000000..e1f0df6fa --- /dev/null +++ b/test/4.10/local-openings.t/input.ml @@ -0,0 +1,14 @@ +module Foo = struct + type t = { name: string } +end + +let foo Foo.{name} = () + +let f = function + | Foo.{name} -> () + | _ -> () + +let x = { Foo.name = "Reason" } +let Foo.{name} = x + +let Foo.{name}, _ = x, () diff --git a/test/4.10/local-openings.t/run.t b/test/4.10/local-openings.t/run.t new file mode 100644 index 000000000..d2d42f750 --- /dev/null +++ b/test/4.10/local-openings.t/run.t @@ -0,0 +1,15 @@ +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 10, characters 2-5: + 10 | | _ => (); + ^^^ + Warning 11: this match case is unused. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.10/reasonComments-re.t/input.re b/test/4.10/reasonComments-re.t/input.re new file mode 100644 index 000000000..6156f3c4a --- /dev/null +++ b/test/4.10/reasonComments-re.t/input.re @@ -0,0 +1,736 @@ +3; /* - */ +3 /*-*/ +; +3/*-*/ +; +3/*-*/; +/* **** comment */ +/*** comment */ +/** docstring */ +/* comment */ +/** docstring */ +/*** comment */ +/**** comment */ +/***** comment */ +/** */ +/*** */ +/**** */ +/**/ +/***/ +/****/ +/** (** comment *) */ +/** (*** comment *) */ +/* (** comment *) */ +/* (*** comment *) */ +/* *(*** comment *) */ +/* comment **/ +/* comment ***/ +/* comment ****/ +/* comment *****/ +/** + * Multiline + */ +/** Multiline + * + */ +/** + ** + */ + +module JustString = { + include Map.Make(Int32); /* Comment eol include */ +}; + +let testingEndOfLineComments = + [ + "Item 1" /* Comment For First Item */, + "Item 2" /* Comment For Second Item */, + "Item 3" /* Comment For Third Item */, + "Item 4" /* Comment For Fourth Item - but before trailing comma */, + /* Comment after last item in list. */ + ] /* Comment after rbracket */; + +/* But if you place them after the comma at eol, they're preserved as such */ +let testingEndOfLineComments = + [ + "Item 1", /* Comment For First Item */ + "Item 2", /* Comment For Second Item */ + "Item 3", /* Comment For Third Item */ + "Item 4" /* Comment For Fourth Item - but before trailing comma */, + /* Comment after last item in list. */ + ] /* Comment after rbracket */ ; + + +/* The space between ; and comment shoudn't matter */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ + /* Comment after last item in list. */ +]; /* Comment after semi */ + +/* The space between ; and comment shoudn't matter */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ + /* Comment after last item in list. */ +];/* Comment after semi */ + +/* Try again but without other things in the list */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ +]; /* Comment after semi */ + +/* The space between ; and comment shoudn't matter */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ + /* Comment after last item in list. */ +];/* Comment after semi */ + +let testingEndOfLineComments = [];/* Comment after entire let binding */ + + +/* The following is not yet idempotent */ +/* let myFunction */ +/* withFirstArg /* First arg */ */ +/* andSecondArg => { /* Second Arg */ */ +/* withFirstArg + andSecondArg /* before semi */ ; */ +/* }; */ + +let myFunction + (/* First arg */ + withFirstArg, + /* Second Arg */ + andSecondArg) { + withFirstArg + andSecondArg +}; /* After Semi */ + +type point = { + x: string, /* x field */ + y: string, /* y field */ +}; + +type pointWithManyKindsOfComments = { + /* Line before x */ + x: string, /* x field */ + /* Line before y */ + y: string, /* y field */ + /* Final row of record */ +}; + +type typeParamPointWithComments('a) = { + /* Line before x */ + x: 'a, /* x field */ + /* Line before y */ + y: 'a /* y field */ + /* Final row of record */ +}; + +/* Now, interleaving comments in type params */ +type + /* Type name */ + typeParamPointWithComments2( + /* The a type param */ + 'a, + /* The b type apram */ + 'b) = { + /* Line before x */ + x: 'a, /* x field */ + /* Line before y */ + y: 'a /* y field */ + /* Final row of record */ +}; + +/* The way the last row comment is formatted is suboptimal becuase + * record type definitions do not include enough location information */ +type anotherpoint = { + x: string, /* x field */ + y: string, /* y field */ + /* comment as last row of record */ +}; + +type t = (int, int); /* End of line on t */ +type t2 = + (int, int) /* End of line on (int, int) */ + ; + +type t3 = + (int, int); /* End of line on (int, int) */ + + +type variant = + | X (int, int) /* End of line on X */ + | Y (int, int) /* End of line on Y */ +; /* Comment on entire type def for variant */ + +/* Before let */ +let res = + /* Before switch */ + switch (X (2, 3)) { + /* Above X line */ + | X(_) => "result of X" /* End of arrow and X line */ + /* Above Y line */ + | Y(_) => "result of Y" /* End of arrow and Y line */ + }; /* After final semi in switch */ + +let res = + switch (X (2, 3)) { + | X (0, 0) => /* After X arrow */ + "result of X" /* End of X body line */ + | X (1, 0) /* Before X's arrow */ => + "result of X" /* End of X body line */ + | X (_) => /* After X _ arrow */ + "result of X" /* End of X body line */ + /* Above Y line */ + | Y (_) => + /* Comment above Y body */ + "result of Y" + }; + +type variant2 = + /* Comment above X */ + | X (int, int) /* End of line on X */ + /* Comment above Y */ + | Y (int, int); + +type variant3 = + /* Comment above X */ + | X (int, int) /* End of line on X */ + /* Comment above Y */ + | Y (int, int) /* End of line on Y */ +; + + +type x = { /* not attached *above* x */ + fieldOne : int, + fieldA : int +} /* Attached end of line after x */ +and y = { /* not attached *above* y */ + fieldTwo : int +} /* Attached end of line after y */ +; + +type x2 = { /* not attached *above* x2 */ + fieldOne : int, + fieldA : int +} /* Attached end of line after x2 */ +and y2 = { /* not attached *above* y2 */ + fieldTwo : int +}; + + +let result = + switch (None) { + | Some({fieldOne: 20, fieldA:a})=> /* Where does this comment go? */ + let tmp = 0; + 2 + tmp + | Some {fieldOne: n, fieldA:a} => + /* How about this one */ + let tmp = n; + n + tmp + | None => 20 + }; + +let res = + /* Before switch */ + switch (X (2, 3)) { + /* Above X line */ + | X(_) => "result of X" /* End of arrow and X line */ + /* Above Y line */ + | Y(_) => "result of Y" /* End of arrow and Y line */ + }; + +/* + * Now these end of line comments *should* be retained. + */ +let result = switch (None) { + | Some { + fieldOne: 20, /* end of line */ + fieldA:a /* end of line */ + } => + let tmp = 0; + 2 + tmp + | Some { + fieldOne: n, /* end of line */ + fieldA:a /* end of line */ + } => + let tmp = n; + n + tmp + | None => 20 + }; + +/* + * These end of line comments *should* be retained. + * To get the simple expression eol comment to be retained, we just need to + * implement label breaking eol behavior much like we did with sequences. + * Otherwise, right now they are not idempotent. + */ +let res = + switch ( /* Retain this */ + X (2, 3) + ) + { + /* Above X line */ + | X ( + _, /* retain this */ + _ /* retain this */ + ) => "result of X" + + /* Above Y line */ + | Y(_) => "result of Y" /* End of arrow and Y line */ + }; + + +type optionalTuple = + | OptTup ( + option (( + int, /* First int */ + int /* Second int */ + )) + ); + +type optionTuple = + option (( + int, /* First int */ + int /* Second int */ + )); + +type intPair = ( + int, /* First int */ + int /* Second int */ +); +type intPair2 = ( + /* First int */ + int, + /* Second int */ + int +); + +let result = { + /**/ + (+)(2,3) +}; + +/* This is not yet idempotent */ +/* { */ +/* /**/ */ +/* (+) 2 3 */ +/* }; */ + +let a = (); +for (i in 0 to 10) { + /* bla */ + a +}; + +if (true) { + /* hello */ + () +}; + +type color = + | Red(int) /* After red end of line */ + | Black(int) /* After black end of line */ + | Green(int) /* After green end of line */ +; /* On next line after color type def */ + +let blahCurriedX(x) = + fun + | Red(10) + | Black(20) + | Green(10) => 1 /* After or pattern green */ + | Red(x) => 0 /* After red */ + | Black(x) => 0 /* After black */ + | Green(x) => 0 /* After second green */ +; /* On next line after blahCurriedX def */ + +let name_equal(x,y) { x == y }; + +let equal(i1,i2) = + i1.contents === i2.contents && true; /* most unlikely first */ + +let equal(i1,i2) = + compare(compare(0,0),compare(1,1)); /* END OF LINE HERE */ + +let tuple_equal((i1, i2)) = i1 == i2; + +let tuple_equal((csu, mgd)) = + /* Some really long comments, see https://github.com/facebook/reason/issues/811 */ + tuple_equal((csu, mgd)); + +/** Comments inside empty function bodies + * See https://github.com/facebook/reason/issues/860 + */ +let fun_def_comment_inline = () => { /* */ }; + +let fun_def_comment_newline = () => { + /* */ +}; + +let fun_def_comment_long = () => { /* longer comment inside empty function body */}; + + +let trueThing = true; + +for (i in 0 to 1) { + /* comment */ + print_newline(); +}; + +while (trueThing) { + /* comment */ + print_newline(); +}; + +if (trueThing) { + /* comment */ + print_newline() +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +} else { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +} else { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + + + +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +} else { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ +} else { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + + +let f = (a, b, c, d) => a + b + c + d; + +while(trueThing) { + f( + /* a */ + 1, + /* b */ + 2, + /* c */ + 3, + /* d */ + 4 + /* does work */ + ); +}; +while(trueThing) { + f( + /* a */ + 1, + /* b */ + 2, + /* c */ + 3, + /* d */ + 4 /* does work */ + ); +}; + +ignore((_really, _long, _printWidth, _exceeded, _here) => { + /* First comment */ + let x = 0; + x + x; + /* Closing comment */ +}); + +ignore((_xxx, _yyy) => { + /* First comment */ + let x = 0; + x + x; + /* Closing comment */ +}); + +type tester('a, 'b) = | TwoArgsConstructor('a, 'b) | OneTupleArgConstructor(('a, 'b)); +let callFunctionTwoArgs = (a, b) => (); +let callFunctionOneTuple = (tuple) => (); + +let y = TwoArgsConstructor( + 1, /*eol1*/ + 2 /* eol2 */ +); + +let y = callFunctionTwoArgs( + 1, /*eol1*/ + 2 /* eol2 */ +); + +let y = OneTupleArgConstructor(( + 1, /*eol1*/ + 2 /* eol2 */ +)); + +let y = callFunctionOneTuple(( + 1, /*eol1*/ + 2 /* eol2 */ +)); + + +type polyRecord('a, 'b) = {fieldOne: 'a, fieldTwo: 'b}; + +let r = { + fieldOne: 1, /*eol1*/ + fieldTwo: 2 /* eol2 */ +}; + +let r = { + fieldOne: 1, /*eol1*/ + fieldTwo: 2, /* eol2 with trailing comma */ +}; + + +let y = TwoArgsConstructor( + "1", /*eol1*/ + "2" /* eol2 */ +); + +let y = callFunctionTwoArgs( + "1", /*eol1*/ + "2" /* eol2 */ +); + +let y = OneTupleArgConstructor(( + "1", /*eol1*/ + "2" /* eol2 */ +)); + +let y = callFunctionOneTuple(( + "1", /*eol1*/ + "2" /* eol2 */ +)); + + +let r = { + fieldOne: "1", /*eol1*/ + fieldTwo: "2" /* eol2 */ +}; + +let r = { + fieldOne: "1", /*eol1*/ + fieldTwo: "2", /* eol2 with trailing comma */ +}; + +let identifier = "hello"; + +let y = TwoArgsConstructor( + identifier, /*eol1*/ + identifier /* eol2 */ +); + +let y = callFunctionTwoArgs( + identifier , /*eol1*/ + identifier /* eol2 */ +); + +let y = OneTupleArgConstructor(( + identifier , /*eol1*/ + identifier /* eol2 */ +)); + +let y = callFunctionOneTuple(( + identifier , /*eol1*/ + identifier /* eol2 */ +)); + + +let r = { + fieldOne: identifier, /*eol1*/ + fieldTwo: identifier /* eol2 */ +}; + +let r = { + fieldOne: identifier, /*eol1*/ + fieldTwo: identifier, /* eol2 with trailing comma */ +}; + + +let y = TwoArgsConstructor( + identifier : string, /*eol1*/ + identifier : string/* eol2 */ +); + +let y = callFunctionTwoArgs( + identifier : string , /*eol1*/ + identifier : string /* eol2 */ +); + +let y = OneTupleArgConstructor(( + identifier : string , /*eol1*/ + identifier : string /* eol2 */ +)); + +let y = callFunctionOneTuple(( + identifier : string , /*eol1*/ + identifier : string /* eol2 */ +)); + + +let r = { + fieldOne: (identifier : string), /*eol1*/ + fieldTwo: (identifier : string) /* eol2 */ +}; + +let r = { + fieldOne: (identifier : string), /*eol1*/ + fieldTwo: (identifier : string), /* eol2 with trailing comma */ +}; + +/** doc comment */ +[@bs.send] +external url : t => string = ""; + +/** + * Short multiline doc comment + */ +[@bs.send] +external url : t => string = ""; + +/** Longer doc comment before an attribute on an external. */ +[@bs.send] +external url : t => string = ""; + +/* normal comment */ +[@bs.send] external url : t => string = ""; + +/** doc type */ +type q = {a: int, b: string}; + +/** doc let */ +let letter : q = {a: 42, b: "answer"}; diff --git a/test/4.10/reasonComments-re.t/run.t b/test/4.10/reasonComments-re.t/run.t new file mode 100644 index 000000000..8135a23b7 --- /dev/null +++ b/test/4.10/reasonComments-re.t/run.t @@ -0,0 +1,35 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", lines 536-548, characters 18-1: + 536 | ..................{ + 537 | f( + 538 | /* a */ + 539 | 1, + 540 | /* b */ + ... + 545 | 4, + 546 | /* does work */ + 547 | ); + 548 | }. + Warning 10: this expression should have type unit. + File "formatted.re", lines 549-560, characters 18-1: + 549 | ..................{ + 550 | f( + 551 | /* a */ + 552 | 1, + 553 | /* b */ + ... + 557 | /* d */ + 558 | 4 /* does work */ + 559 | ); + 560 | }. + Warning 10: this expression should have type unit. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.10/type-jsx.t/input.re b/test/4.10/type-jsx.t/input.re new file mode 100644 index 000000000..38c2ac8a7 --- /dev/null +++ b/test/4.10/type-jsx.t/input.re @@ -0,0 +1,458 @@ +type component = {displayName: string}; + +module Bar = { + let createElement(~c=?,~children,()) {displayName: "test"}; +}; + +module Nesting = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Much = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Foo = { + let createElement(~a=?,~b=?,~children,()) {displayName: "test"}; +}; + +module One = { + let createElement(~test=?,~foo=?,~children,()) {displayName: "test"}; + + let createElementobvioustypo(~test,~children,()) {displayName: "test"}; +}; + +module Two = { + let createElement(~foo=?,~children,()) {displayName: "test"}; +}; + +module Sibling = { + let createElement(~foo=?,~children : list(component),()) = {displayName: "test"}; +}; + +module Test = { + let createElement(~yo=?,~children,()) {displayName: "test"}; +}; + +module So = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Foo2 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Text = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Exp = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Pun = { + let createElement(~intended=?,~children,()) {displayName: "test"}; +}; + +module Namespace = { + module Foo = { + let createElement(~intended=?,~anotherOptional as x=100,~children,()) {displayName: "test"}; + }; +}; + +module Optional1 = { + let createElement(~required,~children,()) { + switch (required) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + +module Optional2 = { + let createElement(~optional=?,~children,()) { + switch (optional) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + +module DefaultArg = { + let createElement(~default=Some("foo"),~children,()) { + switch (default) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + + +module LotsOfArguments = { + let createElement(~argument1=?,~argument2=?,~argument3=?,~argument4=?,~argument5=?,~argument6=?,~children,()) {displayName: "test"}; +}; + +let div(~argument1=?,~children,()) { + displayName: "test" +}; + +module List1 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module List2 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module List3 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module NotReallyJSX = { + let createElement(~foo,~bar,children) {displayName: "test"}; +}; + +let notReallyJSX(~foo,~bar,children) { + displayName: "test" +}; + +let fakeRender (el:component) { + el.displayName +}; + +/* end of setup */ + +let (/><)(a,b) = a + b; +let (><)(a,b) = a + b; +let (/>) = fun(a,b) => a + b; +let ( ><\/ ) = fun(a,b) => a + b; + +let tag1 = 5 />< 6; +let tag2 = 5 >< 7; +let tag3 = 5 /> 7; +let tag4 = 5 ><\/ 7; + +let b = 2; +let selfClosing = ; +let selfClosing2 = ; +let selfClosing3 = + ; +let a = a + 2) /> ; +let a3 = ; +let a4 = ; +let a5 = "testing a string here"; +let a6 = + + + "testing a string here" + "another string" ( 2 + 4 ) + ; +let intended = true; +let punning = ; +let namespace = ; +let c = ; +let d = ; + +let spaceBefore = ; +let spaceBefore2 = ; +let siblingNotSpaced = ; +let jsxInList = [ ]; +let jsxInList2 = [ ]; +let jsxInListA = [ ]; +let jsxInListB = [ ]; +let jsxInListC = [ ]; +let jsxInListD = [ ]; +let jsxInList3 = [ , , ]; +let jsxInList4 = [ , , ]; +let jsxInList5 = [ , ]; +let jsxInList6 = [ , ]; +let jsxInList7 = [ , ]; +let jsxInList8 = [ , ]; +let testFunc(b) = b; +let jsxInFnCall = testFunc (); +let lotsOfArguments = ; +let lowerCase =
; + +let b = 0; +let d = 0; +/* + * Should pun the first example: + */ +let a = 5; +let a = 5; +let a = 5; +let a = 0.55; +let a = [@JSX] Foo.createElement(~children=[],()); +let ident = {a}; +let fragment1 = <> ; +let fragment2 = <> ; +let fragment3 = <> ; +let fragment4 = <> ; +let fragment5 = <> ; +let fragment6 = <> ; +let fragment7 = <> ; +let fragment8 = <> ; +let fragment9 = <> 2 2 2 2 ; +let fragment10 = <>2.2 3.2 4.6 1.2 ; +let fragment11 = <>"str"; +let fragment12 = <>(6 + 2) (6 + 2) (6 + 2); +let fragment13 = <>fragment11 fragment11; +let listOfItems1 = 1 2 3 4 5; +let listOfItems2 = 1.0 2.8 3.8 4.0 5.1; +let listOfItems3 = fragment11 fragment11; + + + +/* + * Several sequential simple jsx expressions must be separated with a space. + */ +let thisIsRight(a,b) = (); +let tagOne = fun(~children,()) => (); +let tagTwo = fun(~children,()) => (); +/* thisIsWrong ; */ +thisIsRight(,); + +/* thisIsWrong ; */ +thisIsRight( , ); + + +let a = fun(~children,()) => (); +let b = fun(~children,()) => (); + +let thisIsOkay = + + + + ; + +let thisIsAlsoOkay = + + + ; + + +/* Doesn't make any sense, but suppose you defined an + infix operator to compare jsx */ + < ; + > ; + + < ; + > ; + +let listOfListOfJsx = [<> ]; +let listOfListOfJsx = [<> ]; +let listOfListOfJsx = [<> , <> ]; +let listOfListOfJsx = [<> , <> , ...listOfListOfJsx]; + + +let sameButWithSpaces = [ <> ]; +let sameButWithSpaces = [ <> ]; +let sameButWithSpaces = [ <> , <> ]; +let sameButWithSpaces = [ <> , <> , ...sameButWithSpaces]; + +/* + * Test named tag right next to an open bracket. + */ + +let listOfJsx = []; +let listOfJsx = [ ]; +let listOfJsx = [, ]; +let listOfJsx = [, , ...listOfJsx]; + + +let sameButWithSpaces = []; +let sameButWithSpaces = []; +let sameButWithSpaces = [, ]; +let sameButWithSpaces = [, , ...sameButWithSpaces]; + +/** + * Test no conflict with polymorphic variant types. + */ +type thisType = [`Foo | `Bar]; +type t('a) = [< thisType ] as 'a; + +let asd = [@JSX] [@foo] One.createElement(~test=true, ~foo=2, ~children=["a", "b"],()); +let asd2 = [@JSX] [@foo] One.createElementobvioustypo(~test=false, ~children=["a", "b"],()); + +let span(~test : bool,~foo : int,~children,()) = 1; +let asd = [@JSX] [@foo] span(~test=true, ~foo=2, ~children=["a", "b"],()); +/* "video" call doesn't end with a list, so the expression isn't converted to JSX */ +let video(~test: bool,children) = children; +let asd2 = [@JSX] [@foo] video(~test=false,10); + + +let div(~children) = 1; +([@JSX] (((fun () => div) ())(~children=[]))); + +let myFun () { + <> + + + + + + + + + + + + ; + +}; + +let myFun () { +<> +; +}; + +let myFun () { + <> + + + + + + + + + + + + ; +}; + +/** + * Children should wrap without forcing attributes to. + */ + + + + + +; + +/** + * Failing test cases: + */ +/* let res = ) > */ +/* */ +/* ; */ + +/* let res = ) />; */ +let zzz = Some("oh hai"); +/* this should be the only test that generates a warning. We're explicitly testing for this */ +let optionalCallSite = ; +fakeRender(optionalCallSite); +let optionalArgument = ; +fakeRender(optionalArgument); +let optionalArgument = ; +fakeRender(optionalArgument); +let defaultArg = ; +fakeRender(defaultArg); +let defaultArg = ; +fakeRender(defaultArg); + +([@JSX][@bla] NotReallyJSX.createElement([],~foo=1,~bar=2)); +([@bla][@JSX] NotReallyJSX.createElement(~foo=1,[],~bar=2)); +([@JSX][@bla] notReallyJSX([],~foo=1)); +([@bla][@JSX] notReallyJSX(~foo=1,[],~bar=2)); + +/* children can be at any position */ +([@JSX] span(~children=[],~test=true,~foo=2,())); + +([@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); + +/* preserve some other attributes too! */ +([@JSX][@bla] span(~children=[],~test=true,~foo=2,())); +([@bla][@JSX] span(~children=[],~test=true,~foo=2,())); + +([@JSX][@bla] Optional1.createElement(~children=[],~required=Some("hi"),())); +([@bla][@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); + +/* Overeager JSX punning #1099 */ +module Metal = { + let fiber = "fiber"; +}; + +module OverEager = { + let createElement(~fiber,~children,()) {displayName: "test"}; +}; + +let element = ; + +type style = { + width: int, + height: int, + paddingTop: int, + paddingLeft: int, + paddingRight: int, + paddingBottom: int +}; + +module Window = { + let createElement(~style,~children,()) {displayName: "window"}; +}; + +let w = + ; + + +let foo = None; + +let g = ; + +/* https://github.com/facebook/reason/issues/1428 */ + ...element ; + + ...((a) => 1) ; + + ... ; + + ...[|a|] ; + + ...(1, 2) ; + +module Foo3 = { + let createElement = (~bar, ~children, ()) => (); +}; + + />; + +let onClickHandler = () => (); + +let div = (~onClick, ~children, ()) => (); + +
<> "foobar"
; + +/* + * This is identical to just having "foobar" as a single JSX child (which means + * it's in a list). + */ +let yetAnotherDiv =
... <> "foobar"
; + +let tl = []; + +/* + * Spreading a list that has an identifier/expression as its tail. This should + * preserve the spread and preserve the braces. [list] is not considered + * simple for the purposes of spreading into JSX, or as a child. + */ +
...{[yetAnotherDiv, ...tl]}
; + +/* + * This is equivalent to having no children. + */ +
...{[]}
; diff --git a/test/4.10/type-jsx.t/run.t b/test/4.10/type-jsx.t/run.t new file mode 100644 index 000000000..58b5a34fe --- /dev/null +++ b/test/4.10/type-jsx.t/run.t @@ -0,0 +1,15 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 460, characters 23-26: + 460 | ; + ^^^ + Warning 43: the label required is not optional. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.10/typecheck-let-ops.t b/test/4.10/typecheck-let-ops.t new file mode 100644 index 000000000..a90d13d64 --- /dev/null +++ b/test/4.10/typecheck-let-ops.t @@ -0,0 +1,31 @@ + $ cat > input.ml < open struct + > type t = string + > end + > + > let (let+) x f = List.map f x + > + > let (and+) = List.map2 (fun x y -> x,y) + > + > let x = + > let+ x = [2] + > and+ y = [3] + > in + > x, y + > + > let y = + > let+ x = [2] in + > x + > EOF + +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.12/attributes-re.t/input.re b/test/4.12/attributes-re.t/input.re new file mode 100644 index 000000000..c7bbca906 --- /dev/null +++ b/test/4.12/attributes-re.t/input.re @@ -0,0 +1,664 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ +/** + * Generally, dangling attributes [@..] apply to everything to the left of it, + * up until a comma, equals asignment, arrow, bar, or infix symbol (+/-) or + * prefix. + * + * This has a nice side effect when printing the terms: + * If a node has attributes attached to it, + */ + +[@ocaml.text "Floating comment text should be removed"]; + +/** + * Core language features: + * ---------------------- + */ + +[@ocaml.doc "Floating doc text should be removed"]; + +[@itemAttributeOnTypeDef] [@ocaml.text "removed text on type def"] +type itemText = int; +type nodeText = [@ocaml.text "removed text on item"] int; +[@itemAttributeOnTypeDef] +[@ocaml.text "removed text on type def"] +type nodeAndItemText = + [@ocaml.text "removed text on item"] int; + +[@itemAttributeOnTypeDef] [@ocaml.doc "removed doc on type def"] +type itemDoc = int; +[@itemAttributeOnTypeDef] +type nodeDoc = [@ocaml.text "removed text on item"] int; +[@itemAttributeOnTypeDef] [@ocaml.doc "removed doc on type def"] +type nodeAndItemDoc = + [@ocaml.text "removed text on item"] int; + +[@itemAttributeOnTypeDef] +type x = int; +type attributedInt = [@onTopLevelTypeDef] int; + +[@itemAttributeOnTypeDef] +type attributedIntsInTuple = ([@onInt] int, [@onFloat] float); + +type myDataType('x,'y) = | MyDataType('x,'y); + +type myType = + [@onEntireType] + myDataType ([@onOptionInt] option(int), + [@onOption] option(float)); + + +let thisInst : myType = + [@attOnEntireDatatype] MyDataType(Some(10),Some(10.0)); + +let thisInst : myType = + [@attOnEntireDatatype] MyDataType([@onFirstParam] Some(10), Some(10.0)); + +let x = ([@onHello] "hello"); +let x = [@onHello] "hello"; + +let x = "hello" ++ ([@onGoodbye] "goodbye"); +let x = ([@onHello] "hello") ++ "goodbye"; +let x = [@onHello] "hello" ++ "goodbye"; +let x = "hello" ++ [@onGoodbye] "goodbye"; +let x = [@onEverything] ("hello" ++ "goodbye"); + +let x = 10 + ([@on20] 20); +let x = 10 + [@on20] 20; +let x = [@on10] 10 + 20; +let x = ([@on10] 10) + 20; +let x = [@attrEverything] (10 + 20); + +let x = 10 - ([@on20] 20); +let x = 10 - [@on20] 20; +let x = [@on10] 10 - 20; +let x = ([@on10] 10) - 20; +let x = [@attrEntireEverything] (10 - 20); + +let x = true && ([@onFalse] false); +let x = true && [@onFalse] false; +let x = [@onTrue] true && false; +let x = ([@onTrue] true) && false; +let x = [@attrEverything] (true && false); + + +/* now make sure to try with variants (tagged and `) */ + +/** + * How attribute parsings respond to other syntactic constructs. + */ +let add(a) { [@onRet] a }; +let add = fun(a) => [@onRet] a; +let add = [@onEntireFunction] (fun(a) => a); + +let res = if (true) false else [@onFalse] false; +let res = [@onEntireIf] (if (true) false else false); + + +let add(a,b) = [@onEverything] ([@onA] a + b); +let add(a,b) = [@onEverything] ([@onA]a + ([@onB]b)); +let add = (a,b) => a + [@onB]b; + +let both = [@onEntireFunction](fun(a) => a); +let both(a,b) = [@onEverything]([@onA]a && b); +let both(a,b) = [@onA] a && [@onB] ([@onB] b); +let both = fun(a,b) => [@onEverything](a && b); + +let thisVal = 10; +let x = 20 + - [@onFunctionCall] add(thisVal,thisVal); +let x = [@onEverything] (20 + - add(thisVal,thisVal)); +let x = - [@onFunctionCall] add(thisVal,thisVal); +let x = [@onEverything] (- add(thisVal,thisVal)); + + +let bothTrue(x,y) = {contents: x && y}; +let something = [@onEverythingToRightOfEquals](bothTrue(true,true)^); +let something = ([@onlyOnArgumentToBang]bothTrue(true,true))^; + +let res = [@appliesToEntireFunctionApplication] add(2,4); + [@appliesToEntireFunctionApplication]add(2,4); + + +let myObj = { + pub p () = { + pub z () = 10 + }; +}; + +let result = [@onSecondSend]([@attOnFirstSend]myObj#p ())#z (); + +[@onRecordFunctions] +type recordFunctions = { + p: (unit) => ([@onUnit] recordFunctions), + q: [@onArrow] ((unit) => unit) +} +[@onUnusedType] +and unusedType = unit; +[@onMyRecord] +let rec myRecord = { + p: fun () => myRecord, + q: fun () => () +} +[@onUnused] +and unused = (); +let result = [@onSecondSend]([@attOnFirstSend]myRecord.p()).q(); + +[@onVariantType] +type variantType = + [@onInt] | Foo(int) + | Bar ([@onInt] int) + | Baz; + +[@onVariantType] +type gadtType('x) = + | Foo(int) : [@onFirstRow] gadtType(int) + | Bar ([@onInt]int) : [@onSecondRow]gadtType(unit) + | Baz: [@onThirdRow] gadtType ([@onUnit] unit); + +[@floatingTopLevelStructureItem hello]; +[@itemAttributeOnEval] +print_string("hello"); + +[@itemAttrOnFirst] +let firstBinding = "first" +[@itemAttrOnSecond] +and secondBinding = "second"; + +/** + * Let bindings. + * ---------------------- + */ +let showLets () = [@onOuterLet] { + let tmp = 20; + [@onFinalLet] { + let tmpTmp = tmp + tmp; + tmpTmp + tmpTmp; + } +}; + + +/** + * Classes: + * ------------ + */ +/** + * In curried sugar, the class_expr attribute will apply to the return. + */ +[@moduleItemAttribute] +class boxA('a) (init: 'a) = [@onReturnClassExpr] { + [@ocaml.text "Floating comment text should be removed"]; + [@ocaml.doc "Floating comment text should be removed"]; + pub pr = init + init + init; +}; + +/** + * In non-curried sugar, the class_expr still sticks to "the simple thing". + */ +class boxB('a) = + fun (init: 'a) => [@stillOnTheReturnBecauseItsSimple] { + pub pr = init + init + init; + }; + +/* To be able to put an attribute on just the return in that case, use + * parens. */ +[@onBoxC x ; y] +class boxC('a) = [@onEntireFunction] ( + fun (init: 'a) => ( + [@onReturnClassExpr] { + pub pr = init + init + init; + } + ) +); + +[@moduleItemAttribute onTheTupleClassItem;] +class tupleClass('a,'b)(init: ('a, 'b)) { + let one = [@exprAttr ten;] 10; + let two = [@exprAttr twenty;] 20 + and three = [@exprAttr thirty;] 30; + [@pr prMember;] + pub pr = one + two + three; +}; + +[@structureItem] +class type addablePointClassType = { + [@ocaml.text "Floating comment text should be removed"]; + [@ocaml.doc "Floating comment text should be removed"]; + pub x: int; + pub y: int; + pub add: (addablePointClassType, addablePointClassType) => int; +} +[@structureItem] +and anotherClassType = { + pub foo: int; + pub bar: int; +}; + +class type _x = [@bs]{ pub height : int }; + +class type _y { [@bs.set] pub height : int }; + +[@attr] class type _z { pub height : int }; + +module NestedModule { + [@floatingNestedStructureItem hello]; +}; +[@structureItem] +module type HasAttrs = { + [@onTypeDef] + type t = int; + [@floatingNestedSigItem hello]; + [@sigItem] + class type foo = {pub foo: int; pub bar: int;}; + [@sigItem] + class fooBar: (int) => foo; + [@ocaml.text "Floating comment text should be removed"]; + [@ocaml.doc "Floating comment text should be removed"]; +}; + +type s = S(string); + +let S ([@onStr] str) = S ([@onHello]"hello"); +let [@onConstruction](S(str)) = [@onConstruction](S("hello")); + +type xy = | X(string) + | Y(string); + +let myFun = fun ([@onConstruction]X(hello) | [@onConstruction]Y(hello)) => hello; +let myFun = fun (X ([@onHello] hello ) | Y ([@onHello]hello )) => hello; + +/* Another bug: Cannot have an attribute on or pattern +let myFun = fun ((X(hello) | Y(hello)) [@onOrPattern]) => hello; +*/ + +/* Bucklescript FFI item attributes */ + +[@bs.val] +external imul : (int, int) => int = "Math.imul"; + +let module Js { + type t('a); +}; + +type classAttributesOnKeys = { + . + [@bs.set] key1 : string, + + /* The follow two are the same */ + [@bs.get {null}] key2 : [@onType2] Js.t(int), + [@bs.get {null}] key3 : ([@onType2] (Js.t(int))), + + key4 : Js.t ([@justOnInt] int) +}; + +/* extensible variants */ +type attr = ..; + +[@block] +type attr += + [@tag1] [@tag2] | Str + [@tag3] | Float ; + +type reconciler('props) = ..; + +[@onVariantType] +type reconciler('props) += + | Foo(int) : [@onFirstRow] reconciler(int) + | Bar ([@onInt] int) : [@onSecondRow] reconciler(unit) + [@baz] | Baz: [@onThirdRow] reconciler ([@onUnit] unit); + +type water = ..; + +type water += pri [@foo] | [@foo2] MineralWater | SpringWater; + +type cloud = string; + +type water += pri | [@h2o] PreparedWater | [@nature] RainWater(cloud) | [@toxic] MeltedSnowWaterFromNuclearWastelandWithALineBreakBecauseTheNameIsSoLong; + + +/* reasonreact */ +type element; + +type reactElement; + +type reactClass; + +/* "react-dom" shouldn't spread the attribute over multiple lines */ +[@bs.val] [@bs.module "react-dom"] +external render : (reactElement, element) => unit = "render"; + +[@bs.module "f"] +external f : (int) => int = "f"; + +[@bs.val] [@bs.module "react"] [@bs.splice] +external createCompositeElementInternalHack + : (reactClass, Js.t({.. reasonProps : 'props}), array(reactElement)) => reactElement + = "createElement"; + +external add_nat: (int, int) => int = "add_nat_bytecode" "add_nat_native"; + +[@bs.module "Bar"] [@ocaml.deprecated "Use bar instead. It's a much cooler function. This string needs to be a little long"] +external foo : (bool) => bool = ""; + +/* Attributes on an entire polymorphic variant leaf */ +[@bs.module "fs"] +external readFileSync : ( + ~name: string, + [@bs.string] [ + | `utf8 + [@bs.as "ascii"] | `my_name + ] +) => string = ""; + +[@bs.module "fs"] +external readFileSync2 : ( + ~name: string, + [@bs.string] [ + [@bs.as "ascii"] | `utf8 + [@bs.as "ascii"] | `my_name + ]) => string = ""; + +/* Ensure that attributes on extensions are printed */ +[@test + [@attr] + [%%extension] +]; + +external debounce : (int, [@bs.meth] unit) => unit; + +external debounce : (int, [@bs.meth] unit) => unit = "debounce"; + +external debounce : (int, [@bs.meth] unit) => unit = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) = ""; + +external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => [@bs.meth] (unit => unit))) => ([@bs.meth] (unit => unit)) = ""; + + +let x = "hi"; + +let res = switch (x) { +| _ => + [@attr] + { + open String; + open Array; + concat; + index_from; + } +}; + +let res = switch (x) { +| _ => + [@attr] + { + open String; + open Array; + concat; + } +}; + +/* GADT */ +type value = +| [@foo] VBool'(bool): [@bar] value +| VInt'(int): value; + +/** Different payloads **/ + +/* Empty structure */ +[@haha] +let x = 5; + +/* Expression structure */ +[@haha "hello world"] +let x = 5; + +/* structure_item */ +[@haha let x = 5] +let x = 5; + +/* structure */ +[@haha let x = 5; module X = {};] +let x = 5; + +/* Pattern */ +[@haha? Some(_) ] +let x = 5; + +/* Type */ +[@haha: option(int)] +let x = 5; + +/* Record item attributes */ + +type t_ = { + /** Comment attribute on record item */ + x: int +}; + +type tt = { + [@attr "on record field"] + x: int +}; + +type ttt = { + [@attr "on record field"] + x: [@attr "on type itself"] int +}; + +type tttt = { + /** Comment attribute on record item */ + x: int, + [@regularAttribute "on next item"] + y: int +}; + +type ttttt = [@attr "moved to first row"] { + [@attr] + x: int +}; + +type tttttt = { + [@attr "testing with mutable field"] + mutable x: int +}; + + +let tmp = { + /** On if statement */ + if (true) { + true + } else { + false + }; +}; + +type foo = + option( + [@foo ["how does this break", "when long enough"]] ( + [@bar] (int => int), + [@baz] (int => int), + ), + ); + +module Callbacks = { + let cb = () => 1 + 1; +}; + +let test = { + let _x = 1; + [@attr1] + open Callbacks; + let _s = "hello" ++ "!"; + [@attr2] Callbacks.("hello" ++ "!"); +}; + +[@test.call string => string] +let processCommandItem = 12; + +module type Foo = { [@someattr] let foo: int => int;}; + + +[@bs.deriving abstract] + type t = { + /** Position (in the pre-change coordinate system) where the change ended. */ + [@bs.as "to"] [@bar] + to_: string, + }; + +[@bs.deriving abstract] +type editorConfiguration = { + [@bs.optional] + /** Determines whether horizontal cursor movement through right-to-left (Arabic, Hebrew) text + is visual (pressing the left arrow moves the cursor left) + or logical (pressing the left arrow moves to the next lower index in the string, which is visually right in right-to-left text). + The default is false on Windows, and true on other platforms. */ + rtlMoveVisually: bool, +}; + +module Fmt = { + let barBaz = () => (); + + type record = {x: int}; +}; + +Fmt.([@foo] barBaz()); +Fmt.([@foo] {x: 1}); +Fmt.([@foo] [1, 2, 3]); +Fmt.([@foo] (1, 2, 3)); +Fmt.([@foo] {val x = 10}); + + +/** + * Attributes are associate with the identifier, function call, constructor + * appcation or constructor application pattern in front of it - up until a + * type constraint, an | (or) or an 'as'. + */ + +let punnned_lbl_a = (~lbl as [@ATTR] lbl) => lbl; +let punnned_lbl_b = (~lbl as [@ATTR] (lbl: int)) => lbl; +let punnned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lbl)) => lbl; +let punnned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lbl: int)) => lbl; +let punnned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lbl: int))) => lbl; + +let punnned_lbl_f = (~lbl as [@ATTR] lbl: int) => lbl; +let punnned_lbl_g = (~lbl as ([@ATTR] lbl: int)) => lbl; +let punnned_lbl_h = (~lbl as ([@ATTR] (lbl: int))) => lbl; +/** Attributes have lower precedence than type constraint. The following should + * be printed identically. */ +let punnned_lbl_i = (~lbl as [@ATTR] lbl: int) => lbl; +let punnned_lbl_i' = (~lbl as [@ATTR] (lbl: int)) => lbl; + +let nonpunned_lbla = (~lbl as [@ATTR] lblNonpunned) => lblNonpunned; +let nonpunned_lbl_b = (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; +let nonpunned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned)) => lblNonpunned; +let nonpunned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned: int)) => lblNonpunned; +let nonpunned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lblNonpunned: int))) => lblNonpunned; + +let nonpunned_lbl_f = (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; +let nonpunned_lbl_g = (~lbl as ([@ATTR] lblNonpunned: int)) => lblNonpunned; +let nonpunned_lbl_h = (~lbl as ([@ATTR] (lblNonpunned: int))) => lblNonpunned; + +let nonpunned_lbl_i = (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; +let nonpunned_lbl_i' = (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; + +let defaulted_punnned_lbl_a = (~lbl as [@ATTR] lbl=0, ()) => lbl; +let defaulted_punnned_lbl_b = (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; +let defaulted_punnned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lbl)=0, ()) => lbl; +let defaulted_punnned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lbl: int)=0, ()) => lbl; +let defaulted_punnned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lbl: int))=0, ()) => lbl; + +let defaulted_punnned_lbl_f = (~lbl as [@ATTR] lbl: int=0, ()) => lbl; +let defaulted_punnned_lbl_g = (~lbl as ([@ATTR] lbl: int)=0, ()) => lbl; +let defaulted_punnned_lbl_h = (~lbl as ([@ATTR] (lbl: int))=0, ()) => lbl; +/** Attributes have lower precedence than type constraint. The following should + * be printed identically. */ +let defaulted_punnned_lbl_i = (~lbl as [@ATTR] lbl: int=0, ()) => lbl; +let defaulted_punnned_lbl_i' = (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; + +let defaulted_nonpunned_lbla = (~lbl as [@ATTR] lblNonpunned=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_b = (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned: int)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lblNonpunned: int))=0, ()) => lblNonpunned; + +let defaulted_nonpunned_lbl_f = (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_g = (~lbl as ([@ATTR] lblNonpunned: int)=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_h = (~lbl as ([@ATTR] (lblNonpunned: int))=0, ()) => lblNonpunned; + +let defaulted_nonpunned_lbl_i = (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; +let defaulted_nonpunned_lbl_i' = (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; + +/* Won't parse: let [@attr] x1 : int = xInt; */ +let xInt = 0; + +/** + Attribute on the pattern node inside of constraint + pattern ( + Ppat_constraint( + pattern(@xxx, Ppat_var "x"), + coretype + ) + ) + This will get sugared to `let ([@attr] x2) : int = xInt` +*/ +let ([@attr] x2 : int) = xInt; +/** + Attribute on the pattern holding the constraint: + pattern( + @xxx + Ppat_constraint( + pattern(Pexpident "x"), + coretype + ) + ) +*/ +let ([@attr] (x3 : int)) = xInt; +let ([@attr] ([@attr0] x4: int)) = xInt; +let ([@attr] (([@attr0] x5): int)) = xInt; + +type eitherOr('a, 'b) = Either('a) | Or('b); +let [@attr] Either(a) | Or(a) = Either("hi"); +// Can drop the the parens around Either. +let ([@attr] Either(a)) | Or(a) = Either("hi"); +// Can drop the parens around Or. +let Either(b) | ([@attr] Or(b)) = Either("hi"); +// Should keep the parens around both +let [@attr] (Either(a) | Or(a)) = Either("hi"); + +// Should keep the parens +let [@attr] (_x as xAlias) = 10; +// Should drop the parens +let ([@attr] _x) as xAlias' = 10; + + +/** + Attribute on the expression node inside of constraint + expression( + Pexp_constraint( + expression(@xxx, Pexpident "x"), + coretype + ) + ) +*/ +let _ = ([@xxx] xInt : int); // This should format the same +let _ = (([@xxx] xInt) : int); // This should format the same + +/** + Attribute on the expression holding the constraint: + expression( + @xxx + Pexp_constraint( + expression(Pexpident "x"), + coretype + ) + ) +*/ +let _ = [@xxx] (xInt : int); // This should format the same + +[@foo? [@attr] (x: int)]; +[@foo? [@attr] ([@bar] x: int)]; +[@foo ? [@attr] (Either("hi") | Or("hi"))]; diff --git a/test/4.12/attributes-re.t/run.t b/test/4.12/attributes-re.t/run.t new file mode 100644 index 000000000..7e1748897 --- /dev/null +++ b/test/4.12/attributes-re.t/run.t @@ -0,0 +1,15 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 503, characters 4-10: + 503 | concat; + ^^^^^^ + Warning 10 [non-unit-statement]: this expression should have type unit. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.12/dune b/test/4.12/dune new file mode 100644 index 000000000..a978469fc --- /dev/null +++ b/test/4.12/dune @@ -0,0 +1,12 @@ +; Disable these tests in windows since their output don't match, and we +; want to ensure the output works in other systems + +(cram + (enabled_if + (and + (or + (= %{system} "mac") + (= %{system} "linux")) + (or + (= %{ocaml_version} 4.12.0) + (= %{ocaml_version} 4.12.1))))) diff --git a/test/4.12/local-openings.t/input.ml b/test/4.12/local-openings.t/input.ml new file mode 100644 index 000000000..e1f0df6fa --- /dev/null +++ b/test/4.12/local-openings.t/input.ml @@ -0,0 +1,14 @@ +module Foo = struct + type t = { name: string } +end + +let foo Foo.{name} = () + +let f = function + | Foo.{name} -> () + | _ -> () + +let x = { Foo.name = "Reason" } +let Foo.{name} = x + +let Foo.{name}, _ = x, () diff --git a/test/4.12/local-openings.t/run.t b/test/4.12/local-openings.t/run.t new file mode 100644 index 000000000..0b8337a2e --- /dev/null +++ b/test/4.12/local-openings.t/run.t @@ -0,0 +1,15 @@ +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 10, characters 2-5: + 10 | | _ => (); + ^^^ + Warning 11 [redundant-case]: this match case is unused. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.12/reasonComments-re.t/input.re b/test/4.12/reasonComments-re.t/input.re new file mode 100644 index 000000000..6156f3c4a --- /dev/null +++ b/test/4.12/reasonComments-re.t/input.re @@ -0,0 +1,736 @@ +3; /* - */ +3 /*-*/ +; +3/*-*/ +; +3/*-*/; +/* **** comment */ +/*** comment */ +/** docstring */ +/* comment */ +/** docstring */ +/*** comment */ +/**** comment */ +/***** comment */ +/** */ +/*** */ +/**** */ +/**/ +/***/ +/****/ +/** (** comment *) */ +/** (*** comment *) */ +/* (** comment *) */ +/* (*** comment *) */ +/* *(*** comment *) */ +/* comment **/ +/* comment ***/ +/* comment ****/ +/* comment *****/ +/** + * Multiline + */ +/** Multiline + * + */ +/** + ** + */ + +module JustString = { + include Map.Make(Int32); /* Comment eol include */ +}; + +let testingEndOfLineComments = + [ + "Item 1" /* Comment For First Item */, + "Item 2" /* Comment For Second Item */, + "Item 3" /* Comment For Third Item */, + "Item 4" /* Comment For Fourth Item - but before trailing comma */, + /* Comment after last item in list. */ + ] /* Comment after rbracket */; + +/* But if you place them after the comma at eol, they're preserved as such */ +let testingEndOfLineComments = + [ + "Item 1", /* Comment For First Item */ + "Item 2", /* Comment For Second Item */ + "Item 3", /* Comment For Third Item */ + "Item 4" /* Comment For Fourth Item - but before trailing comma */, + /* Comment after last item in list. */ + ] /* Comment after rbracket */ ; + + +/* The space between ; and comment shoudn't matter */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ + /* Comment after last item in list. */ +]; /* Comment after semi */ + +/* The space between ; and comment shoudn't matter */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ + /* Comment after last item in list. */ +];/* Comment after semi */ + +/* Try again but without other things in the list */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ +]; /* Comment after semi */ + +/* The space between ; and comment shoudn't matter */ +let testPlacementOfTrailingComment = [ + "Item 0" /* */ + /* Comment after last item in list. */ +];/* Comment after semi */ + +let testingEndOfLineComments = [];/* Comment after entire let binding */ + + +/* The following is not yet idempotent */ +/* let myFunction */ +/* withFirstArg /* First arg */ */ +/* andSecondArg => { /* Second Arg */ */ +/* withFirstArg + andSecondArg /* before semi */ ; */ +/* }; */ + +let myFunction + (/* First arg */ + withFirstArg, + /* Second Arg */ + andSecondArg) { + withFirstArg + andSecondArg +}; /* After Semi */ + +type point = { + x: string, /* x field */ + y: string, /* y field */ +}; + +type pointWithManyKindsOfComments = { + /* Line before x */ + x: string, /* x field */ + /* Line before y */ + y: string, /* y field */ + /* Final row of record */ +}; + +type typeParamPointWithComments('a) = { + /* Line before x */ + x: 'a, /* x field */ + /* Line before y */ + y: 'a /* y field */ + /* Final row of record */ +}; + +/* Now, interleaving comments in type params */ +type + /* Type name */ + typeParamPointWithComments2( + /* The a type param */ + 'a, + /* The b type apram */ + 'b) = { + /* Line before x */ + x: 'a, /* x field */ + /* Line before y */ + y: 'a /* y field */ + /* Final row of record */ +}; + +/* The way the last row comment is formatted is suboptimal becuase + * record type definitions do not include enough location information */ +type anotherpoint = { + x: string, /* x field */ + y: string, /* y field */ + /* comment as last row of record */ +}; + +type t = (int, int); /* End of line on t */ +type t2 = + (int, int) /* End of line on (int, int) */ + ; + +type t3 = + (int, int); /* End of line on (int, int) */ + + +type variant = + | X (int, int) /* End of line on X */ + | Y (int, int) /* End of line on Y */ +; /* Comment on entire type def for variant */ + +/* Before let */ +let res = + /* Before switch */ + switch (X (2, 3)) { + /* Above X line */ + | X(_) => "result of X" /* End of arrow and X line */ + /* Above Y line */ + | Y(_) => "result of Y" /* End of arrow and Y line */ + }; /* After final semi in switch */ + +let res = + switch (X (2, 3)) { + | X (0, 0) => /* After X arrow */ + "result of X" /* End of X body line */ + | X (1, 0) /* Before X's arrow */ => + "result of X" /* End of X body line */ + | X (_) => /* After X _ arrow */ + "result of X" /* End of X body line */ + /* Above Y line */ + | Y (_) => + /* Comment above Y body */ + "result of Y" + }; + +type variant2 = + /* Comment above X */ + | X (int, int) /* End of line on X */ + /* Comment above Y */ + | Y (int, int); + +type variant3 = + /* Comment above X */ + | X (int, int) /* End of line on X */ + /* Comment above Y */ + | Y (int, int) /* End of line on Y */ +; + + +type x = { /* not attached *above* x */ + fieldOne : int, + fieldA : int +} /* Attached end of line after x */ +and y = { /* not attached *above* y */ + fieldTwo : int +} /* Attached end of line after y */ +; + +type x2 = { /* not attached *above* x2 */ + fieldOne : int, + fieldA : int +} /* Attached end of line after x2 */ +and y2 = { /* not attached *above* y2 */ + fieldTwo : int +}; + + +let result = + switch (None) { + | Some({fieldOne: 20, fieldA:a})=> /* Where does this comment go? */ + let tmp = 0; + 2 + tmp + | Some {fieldOne: n, fieldA:a} => + /* How about this one */ + let tmp = n; + n + tmp + | None => 20 + }; + +let res = + /* Before switch */ + switch (X (2, 3)) { + /* Above X line */ + | X(_) => "result of X" /* End of arrow and X line */ + /* Above Y line */ + | Y(_) => "result of Y" /* End of arrow and Y line */ + }; + +/* + * Now these end of line comments *should* be retained. + */ +let result = switch (None) { + | Some { + fieldOne: 20, /* end of line */ + fieldA:a /* end of line */ + } => + let tmp = 0; + 2 + tmp + | Some { + fieldOne: n, /* end of line */ + fieldA:a /* end of line */ + } => + let tmp = n; + n + tmp + | None => 20 + }; + +/* + * These end of line comments *should* be retained. + * To get the simple expression eol comment to be retained, we just need to + * implement label breaking eol behavior much like we did with sequences. + * Otherwise, right now they are not idempotent. + */ +let res = + switch ( /* Retain this */ + X (2, 3) + ) + { + /* Above X line */ + | X ( + _, /* retain this */ + _ /* retain this */ + ) => "result of X" + + /* Above Y line */ + | Y(_) => "result of Y" /* End of arrow and Y line */ + }; + + +type optionalTuple = + | OptTup ( + option (( + int, /* First int */ + int /* Second int */ + )) + ); + +type optionTuple = + option (( + int, /* First int */ + int /* Second int */ + )); + +type intPair = ( + int, /* First int */ + int /* Second int */ +); +type intPair2 = ( + /* First int */ + int, + /* Second int */ + int +); + +let result = { + /**/ + (+)(2,3) +}; + +/* This is not yet idempotent */ +/* { */ +/* /**/ */ +/* (+) 2 3 */ +/* }; */ + +let a = (); +for (i in 0 to 10) { + /* bla */ + a +}; + +if (true) { + /* hello */ + () +}; + +type color = + | Red(int) /* After red end of line */ + | Black(int) /* After black end of line */ + | Green(int) /* After green end of line */ +; /* On next line after color type def */ + +let blahCurriedX(x) = + fun + | Red(10) + | Black(20) + | Green(10) => 1 /* After or pattern green */ + | Red(x) => 0 /* After red */ + | Black(x) => 0 /* After black */ + | Green(x) => 0 /* After second green */ +; /* On next line after blahCurriedX def */ + +let name_equal(x,y) { x == y }; + +let equal(i1,i2) = + i1.contents === i2.contents && true; /* most unlikely first */ + +let equal(i1,i2) = + compare(compare(0,0),compare(1,1)); /* END OF LINE HERE */ + +let tuple_equal((i1, i2)) = i1 == i2; + +let tuple_equal((csu, mgd)) = + /* Some really long comments, see https://github.com/facebook/reason/issues/811 */ + tuple_equal((csu, mgd)); + +/** Comments inside empty function bodies + * See https://github.com/facebook/reason/issues/860 + */ +let fun_def_comment_inline = () => { /* */ }; + +let fun_def_comment_newline = () => { + /* */ +}; + +let fun_def_comment_long = () => { /* longer comment inside empty function body */}; + + +let trueThing = true; + +for (i in 0 to 1) { + /* comment */ + print_newline(); +}; + +while (trueThing) { + /* comment */ + print_newline(); +}; + +if (trueThing) { + /* comment */ + print_newline() +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +} else { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +} else { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); + /* Comment after final print */ +}; + + + +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +} else { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before if test */ +if (trueThing) { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ +} else { + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment before print */ + print_newline(); /* eol print */ + /* Comment after print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + +/* Comment before while test */ +while (trueThing) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + +/* Comment before for test */ +for (i in 0 to 100) { + /* Comment before print */ + print_newline(); /* eol */ + /* Comment after final print */ +}; + + +let f = (a, b, c, d) => a + b + c + d; + +while(trueThing) { + f( + /* a */ + 1, + /* b */ + 2, + /* c */ + 3, + /* d */ + 4 + /* does work */ + ); +}; +while(trueThing) { + f( + /* a */ + 1, + /* b */ + 2, + /* c */ + 3, + /* d */ + 4 /* does work */ + ); +}; + +ignore((_really, _long, _printWidth, _exceeded, _here) => { + /* First comment */ + let x = 0; + x + x; + /* Closing comment */ +}); + +ignore((_xxx, _yyy) => { + /* First comment */ + let x = 0; + x + x; + /* Closing comment */ +}); + +type tester('a, 'b) = | TwoArgsConstructor('a, 'b) | OneTupleArgConstructor(('a, 'b)); +let callFunctionTwoArgs = (a, b) => (); +let callFunctionOneTuple = (tuple) => (); + +let y = TwoArgsConstructor( + 1, /*eol1*/ + 2 /* eol2 */ +); + +let y = callFunctionTwoArgs( + 1, /*eol1*/ + 2 /* eol2 */ +); + +let y = OneTupleArgConstructor(( + 1, /*eol1*/ + 2 /* eol2 */ +)); + +let y = callFunctionOneTuple(( + 1, /*eol1*/ + 2 /* eol2 */ +)); + + +type polyRecord('a, 'b) = {fieldOne: 'a, fieldTwo: 'b}; + +let r = { + fieldOne: 1, /*eol1*/ + fieldTwo: 2 /* eol2 */ +}; + +let r = { + fieldOne: 1, /*eol1*/ + fieldTwo: 2, /* eol2 with trailing comma */ +}; + + +let y = TwoArgsConstructor( + "1", /*eol1*/ + "2" /* eol2 */ +); + +let y = callFunctionTwoArgs( + "1", /*eol1*/ + "2" /* eol2 */ +); + +let y = OneTupleArgConstructor(( + "1", /*eol1*/ + "2" /* eol2 */ +)); + +let y = callFunctionOneTuple(( + "1", /*eol1*/ + "2" /* eol2 */ +)); + + +let r = { + fieldOne: "1", /*eol1*/ + fieldTwo: "2" /* eol2 */ +}; + +let r = { + fieldOne: "1", /*eol1*/ + fieldTwo: "2", /* eol2 with trailing comma */ +}; + +let identifier = "hello"; + +let y = TwoArgsConstructor( + identifier, /*eol1*/ + identifier /* eol2 */ +); + +let y = callFunctionTwoArgs( + identifier , /*eol1*/ + identifier /* eol2 */ +); + +let y = OneTupleArgConstructor(( + identifier , /*eol1*/ + identifier /* eol2 */ +)); + +let y = callFunctionOneTuple(( + identifier , /*eol1*/ + identifier /* eol2 */ +)); + + +let r = { + fieldOne: identifier, /*eol1*/ + fieldTwo: identifier /* eol2 */ +}; + +let r = { + fieldOne: identifier, /*eol1*/ + fieldTwo: identifier, /* eol2 with trailing comma */ +}; + + +let y = TwoArgsConstructor( + identifier : string, /*eol1*/ + identifier : string/* eol2 */ +); + +let y = callFunctionTwoArgs( + identifier : string , /*eol1*/ + identifier : string /* eol2 */ +); + +let y = OneTupleArgConstructor(( + identifier : string , /*eol1*/ + identifier : string /* eol2 */ +)); + +let y = callFunctionOneTuple(( + identifier : string , /*eol1*/ + identifier : string /* eol2 */ +)); + + +let r = { + fieldOne: (identifier : string), /*eol1*/ + fieldTwo: (identifier : string) /* eol2 */ +}; + +let r = { + fieldOne: (identifier : string), /*eol1*/ + fieldTwo: (identifier : string), /* eol2 with trailing comma */ +}; + +/** doc comment */ +[@bs.send] +external url : t => string = ""; + +/** + * Short multiline doc comment + */ +[@bs.send] +external url : t => string = ""; + +/** Longer doc comment before an attribute on an external. */ +[@bs.send] +external url : t => string = ""; + +/* normal comment */ +[@bs.send] external url : t => string = ""; + +/** doc type */ +type q = {a: int, b: string}; + +/** doc let */ +let letter : q = {a: 42, b: "answer"}; diff --git a/test/4.12/reasonComments-re.t/run.t b/test/4.12/reasonComments-re.t/run.t new file mode 100644 index 000000000..6e82e63bc --- /dev/null +++ b/test/4.12/reasonComments-re.t/run.t @@ -0,0 +1,35 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", lines 536-548, characters 18-1: + 536 | ..................{ + 537 | f( + 538 | /* a */ + 539 | 1, + 540 | /* b */ + ... + 545 | 4, + 546 | /* does work */ + 547 | ); + 548 | }. + Warning 10 [non-unit-statement]: this expression should have type unit. + File "formatted.re", lines 549-560, characters 18-1: + 549 | ..................{ + 550 | f( + 551 | /* a */ + 552 | 1, + 553 | /* b */ + ... + 557 | /* d */ + 558 | 4 /* does work */ + 559 | ); + 560 | }. + Warning 10 [non-unit-statement]: this expression should have type unit. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.12/type-jsx.t/input.re b/test/4.12/type-jsx.t/input.re new file mode 100644 index 000000000..38c2ac8a7 --- /dev/null +++ b/test/4.12/type-jsx.t/input.re @@ -0,0 +1,458 @@ +type component = {displayName: string}; + +module Bar = { + let createElement(~c=?,~children,()) {displayName: "test"}; +}; + +module Nesting = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Much = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Foo = { + let createElement(~a=?,~b=?,~children,()) {displayName: "test"}; +}; + +module One = { + let createElement(~test=?,~foo=?,~children,()) {displayName: "test"}; + + let createElementobvioustypo(~test,~children,()) {displayName: "test"}; +}; + +module Two = { + let createElement(~foo=?,~children,()) {displayName: "test"}; +}; + +module Sibling = { + let createElement(~foo=?,~children : list(component),()) = {displayName: "test"}; +}; + +module Test = { + let createElement(~yo=?,~children,()) {displayName: "test"}; +}; + +module So = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Foo2 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Text = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Exp = { + let createElement(~children,()) {displayName: "test"}; +}; + +module Pun = { + let createElement(~intended=?,~children,()) {displayName: "test"}; +}; + +module Namespace = { + module Foo = { + let createElement(~intended=?,~anotherOptional as x=100,~children,()) {displayName: "test"}; + }; +}; + +module Optional1 = { + let createElement(~required,~children,()) { + switch (required) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + +module Optional2 = { + let createElement(~optional=?,~children,()) { + switch (optional) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + +module DefaultArg = { + let createElement(~default=Some("foo"),~children,()) { + switch (default) { + | Some(a) => {displayName: a} + | None => {displayName: "nope"} + }; + }; +}; + + +module LotsOfArguments = { + let createElement(~argument1=?,~argument2=?,~argument3=?,~argument4=?,~argument5=?,~argument6=?,~children,()) {displayName: "test"}; +}; + +let div(~argument1=?,~children,()) { + displayName: "test" +}; + +module List1 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module List2 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module List3 = { + let createElement(~children,()) {displayName: "test"}; +}; + +module NotReallyJSX = { + let createElement(~foo,~bar,children) {displayName: "test"}; +}; + +let notReallyJSX(~foo,~bar,children) { + displayName: "test" +}; + +let fakeRender (el:component) { + el.displayName +}; + +/* end of setup */ + +let (/><)(a,b) = a + b; +let (><)(a,b) = a + b; +let (/>) = fun(a,b) => a + b; +let ( ><\/ ) = fun(a,b) => a + b; + +let tag1 = 5 />< 6; +let tag2 = 5 >< 7; +let tag3 = 5 /> 7; +let tag4 = 5 ><\/ 7; + +let b = 2; +let selfClosing = ; +let selfClosing2 = ; +let selfClosing3 = + ; +let a = a + 2) /> ; +let a3 = ; +let a4 = ; +let a5 = "testing a string here"; +let a6 = + + + "testing a string here" + "another string" ( 2 + 4 ) + ; +let intended = true; +let punning = ; +let namespace = ; +let c = ; +let d = ; + +let spaceBefore = ; +let spaceBefore2 = ; +let siblingNotSpaced = ; +let jsxInList = [ ]; +let jsxInList2 = [ ]; +let jsxInListA = [ ]; +let jsxInListB = [ ]; +let jsxInListC = [ ]; +let jsxInListD = [ ]; +let jsxInList3 = [ , , ]; +let jsxInList4 = [ , , ]; +let jsxInList5 = [ , ]; +let jsxInList6 = [ , ]; +let jsxInList7 = [ , ]; +let jsxInList8 = [ , ]; +let testFunc(b) = b; +let jsxInFnCall = testFunc (); +let lotsOfArguments = ; +let lowerCase =
; + +let b = 0; +let d = 0; +/* + * Should pun the first example: + */ +let a = 5; +let a = 5; +let a = 5; +let a = 0.55; +let a = [@JSX] Foo.createElement(~children=[],()); +let ident = {a}; +let fragment1 = <> ; +let fragment2 = <> ; +let fragment3 = <> ; +let fragment4 = <> ; +let fragment5 = <> ; +let fragment6 = <> ; +let fragment7 = <> ; +let fragment8 = <> ; +let fragment9 = <> 2 2 2 2 ; +let fragment10 = <>2.2 3.2 4.6 1.2 ; +let fragment11 = <>"str"; +let fragment12 = <>(6 + 2) (6 + 2) (6 + 2); +let fragment13 = <>fragment11 fragment11; +let listOfItems1 = 1 2 3 4 5; +let listOfItems2 = 1.0 2.8 3.8 4.0 5.1; +let listOfItems3 = fragment11 fragment11; + + + +/* + * Several sequential simple jsx expressions must be separated with a space. + */ +let thisIsRight(a,b) = (); +let tagOne = fun(~children,()) => (); +let tagTwo = fun(~children,()) => (); +/* thisIsWrong ; */ +thisIsRight(,); + +/* thisIsWrong ; */ +thisIsRight( , ); + + +let a = fun(~children,()) => (); +let b = fun(~children,()) => (); + +let thisIsOkay = + + + + ; + +let thisIsAlsoOkay = + + + ; + + +/* Doesn't make any sense, but suppose you defined an + infix operator to compare jsx */ + < ; + > ; + + < ; + > ; + +let listOfListOfJsx = [<> ]; +let listOfListOfJsx = [<> ]; +let listOfListOfJsx = [<> , <> ]; +let listOfListOfJsx = [<> , <> , ...listOfListOfJsx]; + + +let sameButWithSpaces = [ <> ]; +let sameButWithSpaces = [ <> ]; +let sameButWithSpaces = [ <> , <> ]; +let sameButWithSpaces = [ <> , <> , ...sameButWithSpaces]; + +/* + * Test named tag right next to an open bracket. + */ + +let listOfJsx = []; +let listOfJsx = [ ]; +let listOfJsx = [, ]; +let listOfJsx = [, , ...listOfJsx]; + + +let sameButWithSpaces = []; +let sameButWithSpaces = []; +let sameButWithSpaces = [, ]; +let sameButWithSpaces = [, , ...sameButWithSpaces]; + +/** + * Test no conflict with polymorphic variant types. + */ +type thisType = [`Foo | `Bar]; +type t('a) = [< thisType ] as 'a; + +let asd = [@JSX] [@foo] One.createElement(~test=true, ~foo=2, ~children=["a", "b"],()); +let asd2 = [@JSX] [@foo] One.createElementobvioustypo(~test=false, ~children=["a", "b"],()); + +let span(~test : bool,~foo : int,~children,()) = 1; +let asd = [@JSX] [@foo] span(~test=true, ~foo=2, ~children=["a", "b"],()); +/* "video" call doesn't end with a list, so the expression isn't converted to JSX */ +let video(~test: bool,children) = children; +let asd2 = [@JSX] [@foo] video(~test=false,10); + + +let div(~children) = 1; +([@JSX] (((fun () => div) ())(~children=[]))); + +let myFun () { + <> + + + + + + + + + + + + ; + +}; + +let myFun () { +<> +; +}; + +let myFun () { + <> + + + + + + + + + + + + ; +}; + +/** + * Children should wrap without forcing attributes to. + */ + + + + + +; + +/** + * Failing test cases: + */ +/* let res = ) > */ +/* */ +/* ; */ + +/* let res = ) />; */ +let zzz = Some("oh hai"); +/* this should be the only test that generates a warning. We're explicitly testing for this */ +let optionalCallSite = ; +fakeRender(optionalCallSite); +let optionalArgument = ; +fakeRender(optionalArgument); +let optionalArgument = ; +fakeRender(optionalArgument); +let defaultArg = ; +fakeRender(defaultArg); +let defaultArg = ; +fakeRender(defaultArg); + +([@JSX][@bla] NotReallyJSX.createElement([],~foo=1,~bar=2)); +([@bla][@JSX] NotReallyJSX.createElement(~foo=1,[],~bar=2)); +([@JSX][@bla] notReallyJSX([],~foo=1)); +([@bla][@JSX] notReallyJSX(~foo=1,[],~bar=2)); + +/* children can be at any position */ +([@JSX] span(~children=[],~test=true,~foo=2,())); + +([@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); + +/* preserve some other attributes too! */ +([@JSX][@bla] span(~children=[],~test=true,~foo=2,())); +([@bla][@JSX] span(~children=[],~test=true,~foo=2,())); + +([@JSX][@bla] Optional1.createElement(~children=[],~required=Some("hi"),())); +([@bla][@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); + +/* Overeager JSX punning #1099 */ +module Metal = { + let fiber = "fiber"; +}; + +module OverEager = { + let createElement(~fiber,~children,()) {displayName: "test"}; +}; + +let element = ; + +type style = { + width: int, + height: int, + paddingTop: int, + paddingLeft: int, + paddingRight: int, + paddingBottom: int +}; + +module Window = { + let createElement(~style,~children,()) {displayName: "window"}; +}; + +let w = + ; + + +let foo = None; + +let g = ; + +/* https://github.com/facebook/reason/issues/1428 */ + ...element ; + + ...((a) => 1) ; + + ... ; + + ...[|a|] ; + + ...(1, 2) ; + +module Foo3 = { + let createElement = (~bar, ~children, ()) => (); +}; + + />; + +let onClickHandler = () => (); + +let div = (~onClick, ~children, ()) => (); + +
<> "foobar"
; + +/* + * This is identical to just having "foobar" as a single JSX child (which means + * it's in a list). + */ +let yetAnotherDiv =
... <> "foobar"
; + +let tl = []; + +/* + * Spreading a list that has an identifier/expression as its tail. This should + * preserve the spread and preserve the braces. [list] is not considered + * simple for the purposes of spreading into JSX, or as a child. + */ +
...{[yetAnotherDiv, ...tl]}
; + +/* + * This is equivalent to having no children. + */ +
...{[]}
; diff --git a/test/4.12/type-jsx.t/run.t b/test/4.12/type-jsx.t/run.t new file mode 100644 index 000000000..97605e669 --- /dev/null +++ b/test/4.12/type-jsx.t/run.t @@ -0,0 +1,15 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + File "formatted.re", line 460, characters 23-26: + 460 | ; + ^^^ + Warning 43 [nonoptional-label]: the label required is not optional. + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/4.12/typecheck-let-ops.t b/test/4.12/typecheck-let-ops.t new file mode 100644 index 000000000..a90d13d64 --- /dev/null +++ b/test/4.12/typecheck-let-ops.t @@ -0,0 +1,31 @@ + $ cat > input.ml < open struct + > type t = string + > end + > + > let (let+) x f = List.map f x + > + > let (and+) = List.map2 (fun x y -> x,y) + > + > let x = + > let+ x = [2] + > and+ y = [3] + > in + > x, y + > + > let y = + > let+ x = [2] in + > x + > EOF + +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/README.md b/test/README.md index 3e1fa9deb..c2a3fd35d 100644 --- a/test/README.md +++ b/test/README.md @@ -1,6 +1,8 @@ # refmt cram test suite -This folder contains cram tests from dune. +This folder contains dune's cram tests. + +More information on how they work and how to create them in [dune's documentation](https://dune.readthedocs.io/en/stable/tests.html#cram-tests). ## Run them locally use @@ -32,4 +34,24 @@ esy dune build @cram-test-name --auto-promote # for example: esy dune build @assert ``` -More information on how they work and how to create them in [dune's documentation](https://dune.readthedocs.io/en/stable/tests.html#cram-tests) +## Testing a specific version of OCaml + +Some tests are specifically designed to test a specific version of OCaml. To run them, you have a few options: + +### Install an specific OCaml version with esy + +Make sure the OCaml's version is between the range of the `ocaml` field in esy.json (`>= 4.2.0 < 4.15.0`). + +1. Install the specific version you want with: `esy add ocaml@{{ ocaml_version }}` +2. Run the test with: `esy dune runtest` + +### Setup the local enviroment with opam + +The opam workflow is only tested in CI and isn't needed for development, but can become handy since you can install many switches with different versions of OCaml and load them when needed. + +Using 4.12 as an example: + +1. Create the switch: `opam switch create reason-dev-4.12 -y --deps-only --with-test 4.12.0` +2. Install dependencies (this only needs to be done once) `opam install . --deps-only --with-test` +3. Load env variables for your switch `eval $(opam env --switch=reason-dev-4.12 --set-switch)` +4. Run the test with: `opam exec -- dune runtest` diff --git a/test/arityConversion.t/arity.txt b/test/arityConversion.t/arity.txt new file mode 100644 index 000000000..a96cf4568 --- /dev/null +++ b/test/arityConversion.t/arity.txt @@ -0,0 +1,7 @@ +And +TupleConstructor +Or +M.TupleConstructorInModule +TupleConstructor2 +.TupleConstructor3 +M.TupleConstructor3 diff --git a/test/arityConversion.t/input.ml b/test/arityConversion.t/input.ml new file mode 100644 index 000000000..d464f9172 --- /dev/null +++ b/test/arityConversion.t/input.ml @@ -0,0 +1,43 @@ +Some (1, 2, 3) + +type bcd = TupleConstructor of (int * int) | MultiArgumentsConstructor of int * int + +let a = TupleConstructor(1, 2) +let b = MultiArgumentsConstructor(1, 2) + +module Test = struct + type a = | And of (int * int) | Or of (int * int) +end;; + +let _ = Test.And (1, 2) +let _ = Test.Or (1, 2) +let _ = Some 1;; + +Test.And (1, 2);; +Test.Or (1, 2);; +Some 1;; + +module M = struct + type t = TupleConstructorInModule of (int * int) + type t2 = TupleConstructor2 of (int * int) + type t3 = TupleConstructor3 of (int * int) +end + +type t2 = TupleConstructor2 of (int * int) +type t3 = TupleConstructor3 of (int * int) + +let _ = M.TupleConstructorInModule (1,2) + +let _ = M.TupleConstructor2 (1,2) +let _ = TupleConstructor2 (1,2) + +let _ = M.TupleConstructor3 (1,2) +let _ = TupleConstructor3 (1,2);; + +M.TupleConstructorInModule (1,2);; + +M.TupleConstructor2 (1,2);; +TupleConstructor2 (1,2);; + +M.TupleConstructor3 (1,2);; +TupleConstructor3 (1,2);; diff --git a/test/arityConversion.t/run.t b/test/arityConversion.t/run.t new file mode 100644 index 000000000..26ea2686c --- /dev/null +++ b/test/arityConversion.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --heuristics-file ./arity.txt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/assert.t/run.t b/test/assert.t/run.t index 2dfad41bd..c0493bb26 100644 --- a/test/assert.t/run.t +++ b/test/assert.t/run.t @@ -1,5 +1,5 @@ Format assertions - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re switch (true) { | true => () | false => assert(false) diff --git a/test/attributes-rei.t/input.rei b/test/attributes-rei.t/input.rei new file mode 100644 index 000000000..b573f3793 --- /dev/null +++ b/test/attributes-rei.t/input.rei @@ -0,0 +1,73 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +[@ocaml.text "Floating comment text should be removed"]; +let test : int; + +/** + * Attributes with doc/text attributes should be stripped. They're left over from a + * conversion from ML likely. + * ---------------------- + */ + +[@ocaml.doc "Floating doc text should be removed"]; + + +/** + * #990: don't strip attributes in interface files + */ +[@bs.val] +let x: int; + +type t('a); + +type reactClass; + +type reactElement; + +[@bs.val] [@bs.module "React"] +external createClassInternalHack : (t('classSpec)) => reactClass = "createClass"; + +[@bs.send.pipe : array('a)] external map: [@bs] (('a) => 'b) => array('b) = ""; + +[@bs.send.pipe : array('a)] external map: [@bs] (('a) => 'b) => array('b); + +[@bs.val] [@bs.module "react"] +external createClassInternalHack : (t('classSpec)) => reactClass = + "createClass"; + +[@bs.val] [@bs.module "react"] [@bs.splice] +external createCompositeElementInternalHack : + (reactClass, t({.. reasonProps : 'props}), array(reactElement)) => reactElement = + "createElement"; + + +/* Record item attributes */ + +type t_ = { + /** Comment attribute on record item */ + x: int +}; + +type tt = { + [@attr "on record field"] + x: int +}; + +type ttt = { + [@attr "on record field"] + x: [@attr "on type itself"] int +}; + +type tttt = { + /** Comment attribute on record item */ + x: int, + [@regularAttribute "on next item"] + y: int +}; + +type ttttt = [@attr "moved to first row"] { + [@attr] + x: int +}; + +module Foo: { [@someattr] let foo: int => int; }; diff --git a/test/attributes-rei.t/run.t b/test/attributes-rei.t/run.t new file mode 100644 index 000000000..3fb251551 --- /dev/null +++ b/test/attributes-rei.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.rei > ./formatted.rei + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf formatted.rei + +Format the formatted file back + $ refmt --print re ./formatted.rei > ./formatted_back.rei + +Ensure idempotency: first format and second format are the same + $ diff formatted.rei formatted_back.rei diff --git a/test/backportSyntax.t/input.re b/test/backportSyntax.t/input.re new file mode 100644 index 000000000..ff11b9cfa --- /dev/null +++ b/test/backportSyntax.t/input.re @@ -0,0 +1,21 @@ + +let (let.opt) = (x, f) => switch x { | None => None | Some(x) => f(x) }; +let (let.&opt) = (x, f) => switch x { | None => None | Some(x) => Some(f(x)) }; +let (and.opt) = (a, b) => switch (a, b) { | (Some(a), Some(b)) => Some((a, b)) | _ => None }; + +let x = { + let.opt a = Some(1); + let.opt b = Some(2) + and.opt c = Some(3) + and.opt d = Some(4); + Some((a, b, c, d)) +} +let y = { + let.opt a = Some(1) + and.opt b = None + and.opt c = Some(4); + Some((a, b, c)) +} +assert(x == Some((1,2,3,4))); +assert(y == None); +print_endline("Success") diff --git a/test/backportSyntax.t/run.t b/test/backportSyntax.t/run.t new file mode 100644 index 000000000..a510abd7a --- /dev/null +++ b/test/backportSyntax.t/run.t @@ -0,0 +1,6 @@ + $ refmt ./input.re --print binary > ./output.bin + + $ ocamlc -impl ./output.bin -o ./out + + $ ./out + Success diff --git a/test/basic.t/input.re b/test/basic.t/input.re new file mode 100644 index 000000000..132ef7e4f --- /dev/null +++ b/test/basic.t/input.re @@ -0,0 +1,142 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +let x1 = () => 1; +let x2 = (a) => 1; +let x3 = (a: int, b) => 1; +let x4 = ((a,b)) => 1; +let x5 = fun (a,b): int => 1; +let x6 = (~x, ~y) => 1; +let x7 = (~x: int, ~y: string) => 1; +let x8 = (~x=5, ~y=?, ~z: option(string)=?, ()) => 1; + +type a = int; +type b = float; +type c = string; +type t1 = (a) => b; +type t2 = (a, b) => c; +type t3 = ((a, b)) => c; +type t4 = (~x: int, ~y: string) => c; +type t5 = (~x: a=?) => b; +type tf = (int => int) => string; +type tNested2 = ((int => int)) => string; +type tNested3 = ((int => int) => int) => string; +type tNested4 = (int, int) => string; +type tNested5 = ((int, int)) => string; + +type t6 = int; +type t7('a) = list('a); +type t8('a, 'b) = (list('a), 'b); +type t9 = t8(string, int); + +class type restricted_point_type = { + pub get_x: int; + pub bump: unit; +}; +class type t10('a) = { + pub thing: 'a; +}; +class type t11('a, 'b) = { + pub thing: ('a, list('b)) +}; + +module MyFirstModule = { + let x = 0; + type i = int + and n = string; +}; + +module type HasTT = { + type tt; +}; + +module SubModule: HasTT = { + type tt = int; +}; + +module type HasEmbeddedHasTT = { + module SubModuleThatHasTT = SubModule; +}; + +module type HasPolyType = {type t('a);}; +module type HasDoublePoly = {type m('b, 'c);}; + +module type HasDestructivelySubstitutedPolyType = + HasPolyType with type t('a) := list('a); + +module type HasDestructivelySubstitutedSubPolyModule = { + /* Cannot perform destructive substitution on submodules! */ + /* module X: HasPolyType with type t := list (int, int); */ + module X: HasDestructivelySubstitutedPolyType; +}; + +module type HasSubPolyModule = { + /* Cannot perform destructive substitution on submodules! */ + /* module X: HasPolyType with type t := list (int, int); */ + module X: HasPolyType; +}; + +module EmbedsSubPolyModule: HasSubPolyModule = { + module X = { + type t('a) = list('a); + }; +}; + +module InliningSig: {let x: int; let y:int;} = { + let x = 10; + let y = 20; +}; + +module MyFunctor = fun (M: HasTT) => { + type reexportedTT = M.tt; + let someValue = 1000; +}; + +module MyFunctorResult = MyFunctor ({type tt = string;}); +module type ASig = {let a:int;}; +module type BSig = {let b:int;}; +module CurriedSugar (A:ASig, B:BSig) { + let result = A.a + B.b; +}; + +type withThreeFields = { + name: string, + age: int, + occupation: string +}; + +let testRecord = { + name: "joe", + age: 20, + occupation: "engineer" +}; + +let makeRecordBase () {name: "Joe", age: 30, occupation: "Engineer"}; + + +type t = + | A + | B(int) + | C(int, int) + | D((int, int)); + +type foo = {x:int}; +let result = Some {x:1}; + + +type tt1 = A(int) | B(bool, string); + +type tt2 = A(int) | B((bool, string)); + +type tt3 = [ `A(int) | `B(bool, string) | `C]; + +type tt4 = [ `A(int) | `B((bool, string)) | `C]; + +let (==) = 0; + +let (===) = 0; + +let (!=) = 0; + +let (!==) = 0; + +type foobar(_) = | Foo('a): foobar(unit); diff --git a/test/basic.t/run.t b/test/basic.t/run.t new file mode 100644 index 000000000..1ba7f761e --- /dev/null +++ b/test/basic.t/run.t @@ -0,0 +1,63 @@ +See the typed tree from ./input.re + $ cat ./input.re | typedtree_printer + let x1: unit => int; + let x2: 'a => int; + let x3: (int, 'a) => int; + let x4: (('a, 'b)) => int; + let x5: ('a, 'b) => int; + let x6: (~x: 'a, ~y: 'b) => int; + let x7: (~x: int, ~y: string) => int; + let x8: (~x: int=?, ~y: 'a=?, ~z: string=?, unit) => int; + type a = int; + type b = float; + type c = string; + type t1 = a => b; + type t2 = (a, b) => c; + type t3 = ((a, b)) => c; + type t4 = (~x: int, ~y: string) => c; + type t5 = (~x: a=?) => b; + type tf = (int => int) => string; + type tNested2 = (int => int) => string; + type tNested3 = ((int => int) => int) => string; + type tNested4 = (int, int) => string; + type tNested5 = ((int, int)) => string; + type t6 = int; + type t7('a) = list('a); + type t8('a, 'b) = (list('a), 'b); + type t9 = t8(string, int); + class type restricted_point_type = { pub bump: unit; pub get_x: int }; + class type t10 ('a) = { pub thing: 'a }; + class type t11 ('a, 'b) = { pub thing: ('a, list('b)) }; + module MyFirstModule: { let x: int; type i = int and n = string; }; + module type HasTT = { type tt; }; + module SubModule: HasTT; + module type HasEmbeddedHasTT = { module SubModuleThatHasTT = SubModule; }; + module type HasPolyType = { type t('a); }; + module type HasDoublePoly = { type m('b, 'c); }; + module type HasDestructivelySubstitutedPolyType = { }; + module type HasDestructivelySubstitutedSubPolyModule = + { module X: HasDestructivelySubstitutedPolyType; }; + module type HasSubPolyModule = { module X: HasPolyType; }; + module EmbedsSubPolyModule: HasSubPolyModule; + module InliningSig: { let x: int; let y: int; }; + module MyFunctor: + (M : HasTT) => { type reexportedTT = M.tt; let someValue: int; }; + module MyFunctorResult: { type reexportedTT = string; let someValue: int; }; + module type ASig = { let a: int; }; + module type BSig = { let b: int; }; + module CurriedSugar: (A : ASig) => (B : BSig) => { let result: int; }; + type withThreeFields = { name: string, age: int, occupation: string, }; + let testRecord: withThreeFields; + let makeRecordBase: unit => withThreeFields; + type t = A | B(int) | C(int, int) | D((int, int)); + type foo = { x: int, }; + let result: option(foo); + type tt1 = A(int) | B(bool, string); + type tt2 = A(int) | B((bool, string)); + type tt3 = [ `A(int) | `B(bool, string) | `C ]; + type tt4 = [ `A(int) | `B(bool, string) | `C ]; + let ( == ): int; + let ( === ): int; + let ( != ): int; + let ( !== ): int; + type foobar(_) = Foo('a): foobar(unit); diff --git a/test/basicStructures.t/run.t b/test/basicStructures.t/run.t index f0ebb524b..cf6d3175e 100644 --- a/test/basicStructures.t/run.t +++ b/test/basicStructures.t/run.t @@ -1,5 +1,5 @@ Format basicStructures - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ let run = () => { diff --git a/test/basics.t/input.re b/test/basics.t/input.re new file mode 100644 index 000000000..18ef43ad9 --- /dev/null +++ b/test/basics.t/input.re @@ -0,0 +1,98 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +let l = [1,2,3] |> List.map (i => i+1, _) |> List.filter (i => i>0, _); + +let l = (i => i+1) |> List.map(_, [1,2,3]); + +let x = List.length(_); + +let nested = x => List.length(_); + +let incr = (~v) => v+1; + +let l1 = [1,2,3] |> List.map(incr(~v=_)) |> List.length; + +let l2 = [1,2,3] |> List.map(incr(~v =_)) |> List.length; + +let a1 = [|1, 2, 3|] |> Array.get(_, 1); + +let s1 = "roses are red" |> String.get(_, 4); + +let optParam = (~v=?, ()) => v == None ? 0 : 1; + +let l1 = + [Some(1), None, Some(2)] |> List.map(optParam(~v=?_, ())) |> List.length; + +let l2 = + [Some(1), None, Some(2)] |> List.map(optParam(~v =?_, ())) |> List.length; + +let argIsUnderscore1 = _ => 34; + +let argIsUnderscore2 = (_ => 34); + +let argIsUnderscore3 = _ : int => 34; + +let argIsUnderscore4 = (_ : int => 34); + +let argIsUnderscore5 = (_: int) => 34; + +let argIsUnderscore6 = ((_: int) => 34); + +type reasonXyz = + | X + | Y(int,int,int) + | Z(int,int) + | Q + | R; + +type reasonXyzWithOf = + | X + | Y(int,int,int) + | Z(int,int) + | Q + | R; + +let reasonBarAs = fun + | ((Y(_) | Z(_)) as t, _) => {let _ = t; true} + | _ => false; + +let reasonDoubleBar = fun + | X | Y(_,_,_) | Z(_,_) | Q => true + | _ => false; + +let reasonDoubleBarNested = fun + | X | Y(_,_,_) | (Z(_,_) | Q) => true + | _ => false; + + +/* Liberal use of the Any pattern being compatible with multiple + arguments */ +let reasonDoubleBarAnyPatterns = fun + | X | Y(_) | Z(_) | Q => true + | _ => false; + +let reasonDoubleBarNestedAnyPatterns = fun + | X | Y(_) | (Z(_) | Q) => true + | _ => false; + +let (\+) = (+); + +let a = 2.0 ** 4.0; + +let (\===) = (===); + +let expectedPrecendence = 1 + 1 \=== 1 + 1 && 1 + 1 \!== 1 + 1; + +let expectedPrecendence = 1 \+ 1 \=== 1 \+ 1 && 1 \+ 1 \!== 1 \+ 1; + +module X: {let x: (~x: unit=?, unit) => unit;} = { + let x(~x=(),()) = (); +}; + +let display (~message=("hello": string), ~person: string="Reason", time: float) = 1; + +let not = (x, y) => x + y; + +let added: int = not(1, 2); + +let better = foo => !foo ? 42 : not(41, 2); diff --git a/test/basics.t/run.t b/test/basics.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/basics.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/basics_no_semi.t/input.re b/test/basics_no_semi.t/input.re new file mode 100644 index 000000000..c84c95812 --- /dev/null +++ b/test/basics_no_semi.t/input.re @@ -0,0 +1,88 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +let l = [1,2,3] |> List.map (i => i+1, _) |> List.filter (i => i>0, _) + +let l = (i => i+1) |> List.map(_, [1,2,3]) + +let x = List.length(_) + +let nested = x => List.length(_) + +let incr = (~v) => v+1 + +let l1 = [1,2,3] |> List.map(incr(~v=_)) |> List.length + +let l2 = [1,2,3] |> List.map(incr(~v =_)) |> List.length + +let optParam = (~v=?, ()) => v == None ? 0 : 1 + +let l1 = + [Some(1), None, Some(2)] |> List.map(optParam(~v=?_, ())) |> List.length + +let l2 = + [Some(1), None, Some(2)] |> List.map(optParam(~v =?_, ())) |> List.length + +let argIsUnderscore1 = _ => 34 + +let argIsUnderscore2 = (_ => 34) + +let argIsUnderscore3 = _ : int => 34 + +let argIsUnderscore4 = (_ : int => 34) + +let argIsUnderscore5 = (_: int) => 34 + +let argIsUnderscore6 = ((_: int) => 34) + +type reasonXyz = + | X + | Y(int,int,int) + | Z(int,int) + | Q + | R + +type reasonXyzWithOf = + | X + | Y(int,int,int) + | Z(int,int) + | Q + | R + +let reasonBarAs = fun + | ((Y(_) | Z(_)) as t, _) => {let _ = t; true} + | _ => false + +let reasonDoubleBar = fun + | X | Y(_,_,_) | Z(_,_) | Q => true + | _ => false + +let reasonDoubleBarNested = fun + | X | Y(_,_,_) | (Z(_,_) | Q) => true + | _ => false + + +/* Liberal use of the Any pattern being compatible with multiple + arguments */ +let reasonDoubleBarAnyPatterns = fun + | X | Y(_) | Z(_) | Q => true + | _ => false + +let reasonDoubleBarNestedAnyPatterns = fun + | X | Y(_) | (Z(_) | Q) => true + | _ => false + +let (\+) = (+) + +let a = 2.0 ** 4.0 + +let (\===) = (===) + +let expectedPrecendence = 1 + 1 \=== 1 + 1 && 1 + 1 \!== 1 + 1 + +let expectedPrecendence = 1 \+ 1 \=== 1 \+ 1 && 1 \+ 1 \!== 1 \+ 1 + +module X: {let x: (~x: unit=?, unit) => unit} = { + let x(~x=(),()) = () +} + +let display (~message=("hello": string), ~person: string="Reason", time: float) = 1 diff --git a/test/basics_no_semi.t/run.t b/test/basics_no_semi.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/basics_no_semi.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/bigarray.t/run.t b/test/bigarray.t/run.t index 501cd1b6e..f464bba67 100644 --- a/test/bigarray.t/run.t +++ b/test/bigarray.t/run.t @@ -1,5 +1,5 @@ Format bigarray - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re my_big_array3.{ reallyLongStringThatWillDefinitelyBreakLine }; diff --git a/test/bigarraySyntax.t/input.re b/test/bigarraySyntax.t/input.re new file mode 100644 index 000000000..e6b9a4d4a --- /dev/null +++ b/test/bigarraySyntax.t/input.re @@ -0,0 +1,27 @@ +/* https://github.com/facebook/reason/issues/2038 */ +let my_big_array1 = + Bigarray.Array1.create(Bigarray.float32, Bigarray.c_layout, 20); + +my_big_array1.{1}; + +my_big_array1.{1} = 1.0; + +let my_big_array2 = + Bigarray.Array2.create(Bigarray.float32, Bigarray.c_layout, 20, 20); + +my_big_array2.{1, 2}; + +my_big_array2.{1, 2} = 1.0; + +let my_big_array3 = + Bigarray.Array3.create(Bigarray.float32, Bigarray.c_layout, 20, 20, 20); + +my_big_array3.{1, 2, 3}; + +my_big_array3.{1, 2, 3} = 1.0; + +let reallyLongStringThatWillDefinitelyBreakLine = 0; + +my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine}; + +my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine} = 3.0; diff --git a/test/bigarraySyntax.t/run.t b/test/bigarraySyntax.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/bigarraySyntax.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/bucklescript.t/run.t b/test/bucklescript.t/run.t index 2967c0323..0c5b55994 100644 --- a/test/bucklescript.t/run.t +++ b/test/bucklescript.t/run.t @@ -1,5 +1,5 @@ Format bucklescript - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re bla #= 10; bla #= Some(10); diff --git a/test/class.t/input.re b/test/class.t/input.re new file mode 100644 index 000000000..75c6c63a1 --- /dev/null +++ b/test/class.t/input.re @@ -0,0 +1,36 @@ +class aClass1(x) { + /* one value parameter x */ + pub a1 = 0; + pub a2() = 0; + pub a3(x,y) = x + y; + pub a4(x,y) { + let result = x + y; + print_endline(" x + y = " ++ string_of_int(x) ++ " + " ++ string_of_int(y) ++ " = " ++ string_of_int(result)); + result + }; +}; +class aClass2(x) { +}; +class aClass3(x: (int => int)) { +}; +class aClass4(x: (int => int => int)) { +}; +class aClass5(x: (int => (int => int))) { +}; +class aClass6(x: ((int => int) => int)) { +}; +class aClass7(x: ((int, int) => int)) { +}; + +class labeledClass1(~x) { +}; +class labeledClass2(~x: ((~y:int) => int)) { +}; +class labeledClass3(~x: ((~y:int) => int => int)) { +}; +class labeledClass4(~x: ((~y:int) => (int => int))) { +}; +class labeledClass5(~x: (((~y:int) => int) => int)) { +}; +class labeledClass6(~x: ((~y:(int, int)) => int)) { +}; diff --git a/test/class.t/run.t b/test/class.t/run.t new file mode 100644 index 000000000..e303dbb4f --- /dev/null +++ b/test/class.t/run.t @@ -0,0 +1,22 @@ +See the typed tree from ./input.re + $ cat ./input.re | typedtree_printer + class aClass1 : + ('a) => + { + pub a1: int; + pub a2: unit => int; + pub a3: (int, int) => int; + pub a4: (int, int) => int + }; + class aClass2 : ('a) => { }; + class aClass3 : (int, int) => { }; + class aClass4 : (int, int, int) => { }; + class aClass5 : (int, int, int) => { }; + class aClass6 : (int => int, int) => { }; + class aClass7 : (int, int, int) => { }; + class labeledClass1 : ('a) => { }; + class labeledClass2 : (~x: int, int) => { }; + class labeledClass3 : (~x: int, int, int) => { }; + class labeledClass4 : (~x: int, int, int) => { }; + class labeledClass5 : ((~y: int) => int, int) => { }; + class labeledClass6 : (~x: (int, int), int) => { }; diff --git a/test/class_types.t/run.t b/test/class_types.t/run.t index 47619408f..716dfe3cf 100644 --- a/test/class_types.t/run.t +++ b/test/class_types.t/run.t @@ -1,5 +1,5 @@ Format class and class type - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re class type _module ('provider_impl) = {}; type t; class type bzz = { diff --git a/test/comments-ml.t/input.ml b/test/comments-ml.t/input.ml new file mode 100644 index 000000000..b710320fc --- /dev/null +++ b/test/comments-ml.t/input.ml @@ -0,0 +1,128 @@ +(* **** comment *) +(*** comment *) +(** docstring *) +(* comment *) +(** docstring *) +(*** comment *) +(**** comment *) +(***** comment *) + +(*** *) +(**** *) + +(***) +(****) + + + +(* (** comment *) *) +(* (*** comment *) *) +(* *(*** comment *) *) + +(* comment **) +(* comment ***) +(* comment ****) +(* comment *****) + +let testingNotQuiteEndOfLineComments = [ + "Item 1"(* Comment For First Item *); + "Item 2" (* Comment For Second Item *); + "Item 3" (* Comment For Third Item *) ; + "Item 4" (* Comment For Fourth Item - but no semi *) + (* Comment after last item in list. *) +] (* Comment after list bracket *) + +let testingEndOfLineComments = [ + "Item 1";(* Comment For First Item *) + "Item 2"; (* Comment For Second Item *) + "Item 3"; (* Comment For Third Item *) + "Item 4" (* Comment For Fourth Item - but before semi *); + (* Comment after last item in list. *) +] (* Comment after list bracket *) + +(* This time no space between bracket and comment *) +let testingEndOfLineComments = [ +](* Comment after list bracket *) + + +type t = int * int (* End of line on t *) + +type t22 = (* End of t22 line on type t22 = *) + int * int + + +type variant = + (* Comment above X *) + | X of int (* End of line on X *) + (* Comment above Y *) + | Y of int (* End of line on Y *) +(* Comment on entire type def for variant *) + + +type x = { (* not attached *above* x *) + fieldOne : int +} (* Attached end of line after x *) +and y = { (* not attached *above* y *) + fieldTwo : int +} (* Attached end of line after y *) + + +let result = match X 3 with + | X x -> (* Where does this comment go? *) + let tmp = x in + x + tmp + | Y x -> + (* How about this one *) + let tmp = x in + x + tmp + +let result = match None with + | Some {fieldOne = 20} -> (* Where does this comment go? *) + let tmp = 0 in + 2 + tmp + | Some {fieldOne = n} -> + (* How about this one *) + let tmp = n in + n + tmp + | None -> 20 + +type pointWithManyKindsOfComments = { + (* Line before x *) + x: string; (* x field *) + (* Line before y *) + y: string; (* y field *) + (* Final row of record *) +} + +type 'a typeParamPointWithComments = { + (* Line before x *) + x: 'a; (* x field *) + (* Line before y *) + y: 'a (* y field *) + (* Final row of record *) +} + + +let name_equal x y = x = y + +let equal i1 i2 = + i1.contents == i2.contents && true (* most unlikely first *) + +let equal i1 i2 = + compare (compare 0 0) (compare 1 1) (* END OF LINE HERE *) + + + +module Temp = struct + let v = true + let logIt str () = print_string str +end + +let store_attributes arg = + let attributes_file = "test" in + let proc_name = attributes_file ^ ".proc" in + let should_write = (* only overwrite defined procedures *) + Temp.v || + not (Temp.v) in + if should_write then + Temp.logIt proc_name () diff --git a/test/comments-ml.t/run.t b/test/comments-ml.t/run.t new file mode 100644 index 000000000..19671337b --- /dev/null +++ b/test/comments-ml.t/run.t @@ -0,0 +1,18 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + refmt: FILENAMES... arguments: no `./input.re' file + Usage: refmt [OPTION]... [FILENAMES]... + Try `refmt --help' for more information. + [1] + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re + 0a1 + > + [1] diff --git a/test/comments-mli.t/input.mli b/test/comments-mli.t/input.mli new file mode 100644 index 000000000..3c749db48 --- /dev/null +++ b/test/comments-mli.t/input.mli @@ -0,0 +1,41 @@ +(* **** comment *) +(*** comment *) +(** docstring *) +(* comment *) +(** docstring *) +(*** comment *) +(**** comment *) +(***** comment *) + +(** *) +(*** *) +(**** *) + +(***) +(****) + + + +(** (** comment *) *) +(** (*** comment *) *) + +(* (** comment *) *) +(* (*** comment *) *) +(* *(*** comment *) *) + +(* comment **) +(* comment ***) +(* comment ****) +(* comment *****) + +(** + * Multiline + *) + +(** Multiline + * + *) + +(** + ** + *) diff --git a/test/comments-mli.t/run.t b/test/comments-mli.t/run.t new file mode 100644 index 000000000..1f24e40e3 --- /dev/null +++ b/test/comments-mli.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.mli > ./formatted.rei + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -intf formatted.rei + +Format the formatted file back + $ refmt --print re ./formatted.rei > ./formatted_back.rei + +Ensure idempotency: first format and second format are the same + $ diff formatted.rei formatted_back.rei diff --git a/test/dune b/test/dune index 4e984ad48..186f5a9d5 100644 --- a/test/dune +++ b/test/dune @@ -1,7 +1,8 @@ -(cram - ; We want to rely on refmt from src, here we tell dune where to find - ; the executable so is available in the tests under - ; `_build/default/src/refmt/refmt_impl.exe` - (deps %{project_root}/src/refmt/refmt_impl.exe)) +(env + (_ + (env-vars + (REFMT_PRINT_WIDTH 50)))) -(data_only_dirs failing) +(cram + (applies_to * \ lib) + (deps %{bin:ocamlc} %{bin:refmt} %{bin:typedtree_printer} %{bin:rtop})) diff --git a/test/emptyFileComment.t/run.t b/test/emptyFileComment.t/run.t index 6acec72b2..8fcb9da22 100644 --- a/test/emptyFileComment.t/run.t +++ b/test/emptyFileComment.t/run.t @@ -1,3 +1,3 @@ Format empty file comment - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re // file with just a single line comment diff --git a/test/escapesInStrings.t/run.t b/test/escapesInStrings.t/run.t index c5b7b890a..e68366deb 100644 --- a/test/escapesInStrings.t/run.t +++ b/test/escapesInStrings.t/run.t @@ -1,5 +1,5 @@ Format escapes in strings - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ /* diff --git a/test/extensions.t/run.t b/test/extensions.t/run.t index 17f1f283f..2dc98766b 100644 --- a/test/extensions.t/run.t +++ b/test/extensions.t/run.t @@ -1,5 +1,5 @@ Format extensions - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Extension sugar */ [%extend open M]; diff --git a/test/externals.t/run.t b/test/externals.t/run.t index 0488d0647..91a7a9cbf 100644 --- a/test/externals.t/run.t +++ b/test/externals.t/run.t @@ -1,5 +1,5 @@ Format externals - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /** * Tests external formatting. */ diff --git a/test/firstClassModules.t/run.t b/test/firstClassModules.t/run.t index c4dbf5366..4ad6da514 100644 --- a/test/firstClassModules.t/run.t +++ b/test/firstClassModules.t/run.t @@ -1,5 +1,5 @@ Format first class modules - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re module Modifier = ( val Db.Hashtbl.create(): Db.Sig with type t = Mods.t diff --git a/test/fixme.t/run.t b/test/fixme.t/run.t index f6409cb21..da9fcfbb5 100644 --- a/test/fixme.t/run.t +++ b/test/fixme.t/run.t @@ -1,5 +1,5 @@ Format fixme - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /** * Problem: In thise example, the comment should have a space after it. */ diff --git a/test/functionInfix.t/run.t b/test/functionInfix.t/run.t index 786a3a469..0b8c2baaa 100644 --- a/test/functionInfix.t/run.t +++ b/test/functionInfix.t/run.t @@ -1,5 +1,5 @@ Format function infix - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re let entries = ref([]); let all = ref(0); diff --git a/test/general-syntax-re.t/run.t b/test/general-syntax-re.t/run.t index 99f39fe0b..2d62820ef 100644 --- a/test/general-syntax-re.t/run.t +++ b/test/general-syntax-re.t/run.t @@ -1,5 +1,5 @@ Format general implementation syntax - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ [@autoFormat diff --git a/test/general-syntax-rei.t/run.t b/test/general-syntax-rei.t/run.t index 19387e57a..7a0ef630b 100644 --- a/test/general-syntax-rei.t/run.t +++ b/test/general-syntax-rei.t/run.t @@ -1,5 +1,5 @@ Format general interface syntax - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.rei + $ refmt ./input.rei /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ /** diff --git a/test/features403.t/input.re b/test/generics.t/input.re similarity index 100% rename from test/features403.t/input.re rename to test/generics.t/input.re diff --git a/test/features403.t/run.t b/test/generics.t/run.t similarity index 93% rename from test/features403.t/run.t rename to test/generics.t/run.t index 1313fad72..ea1c09af0 100644 --- a/test/features403.t/run.t +++ b/test/generics.t/run.t @@ -1,5 +1,5 @@ Format features from OCaml 4.03 - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re type t = | A({a: int}) | B; diff --git a/test/if.t/run.t b/test/if.t/run.t index 93a43f3c3..933226dfb 100644 --- a/test/if.t/run.t +++ b/test/if.t/run.t @@ -1,5 +1,5 @@ Format if statements - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ let logTSuccess = self => diff --git a/test/imperative.t/input.re b/test/imperative.t/input.re new file mode 100644 index 000000000..91e314398 --- /dev/null +++ b/test/imperative.t/input.re @@ -0,0 +1,76 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +/* + * Syntax and fallback syntax. + + * vim: set ft=reason: + */ +switch (while (true) { + (); + }) { + | _ => () +}; + +try (while (true) { + (); + }) { + | _ => () +}; + +switch (for (i in 0 to 10) { + (); + }) { + | _ => () +}; + +try (for (i in 0 to 10) { + (); + }) { + | _ => () +}; + + +switch ( + if (true) {print_string("switching on true");} else {print_string("switching on false");} +) { + | _ => () +}; + +try (for (i in 0 to 10) { + (); + }) { + | _ => () +}; + + +let result = while (false) { + (); + } == () ? false : true; + +switch ( + try ( + try () { | _ => () } + ) { + | _ => () + } +) { + | () => () +}; + +let shouldStillLoop = {contents: false}; + +while (shouldStillLoop.contents) { + print_string("You're in a while loop"); + print_newline(); +}; + +while { + shouldStillLoop.contents = false; + shouldStillLoop.contents; + } { + print_string("Will never loop"); +}; + +while ((shouldStillLoop := false) == ()) { + print_string("Forever in the loop"); +}; diff --git a/test/imperative.t/run.t b/test/imperative.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/imperative.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/infix.t/run.t b/test/infix.t/run.t index 07eecaa89..9725da45e 100644 --- a/test/infix.t/run.t +++ b/test/infix.t/run.t @@ -1,5 +1,5 @@ Format infix operators - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ /* - A good way to test if formatting of infix operators groups precedences diff --git a/test/inlineRecord.t/input.re b/test/inlineRecord.t/input.re new file mode 100644 index 000000000..6def8d80f --- /dev/null +++ b/test/inlineRecord.t/input.re @@ -0,0 +1,11 @@ +type t0 = T0 { t0 : int }; +type t1 = + | A { x : int } + | B + | C { c1 : string, c2 : string }; + +/* GADT */ +type t2(_) = + | D { x : int } : t2(int) + | E { f : int => int } : t2(int => int) + | F(unit) : t2(unit); diff --git a/test/inlineRecord.t/run.t b/test/inlineRecord.t/run.t new file mode 100644 index 000000000..69829329a --- /dev/null +++ b/test/inlineRecord.t/run.t @@ -0,0 +1,8 @@ +See the typed tree from ./input.re + $ cat ./input.re | typedtree_printer + type t0 = T0({ t0: int, }); + type t1 = A({ x: int, }) | B | C({ c1: string, c2: string, }); + type t2(_) = + D({ x: int, }): t2(int) + | E({ f: int => int, }): t2(int => int) + | F(unit): t2(unit); diff --git a/test/jsx.t/run.t b/test/jsx.t/run.t index c916ba9c5..01f2990e9 100644 --- a/test/jsx.t/run.t +++ b/test/jsx.t/run.t @@ -1,5 +1,5 @@ Format JSX - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re let x = 1 (* After or pattern green *) + | Red x -> 0 (* After red *) + | Black x -> 0 (* After black *) + | Green x -> 0 (* After second green *) +(* On next line after blahCurriedX def *) + + +(* EOL comments wrap because other elements break first (in this example + "mutable" causes breaks. We either need: + 1. To prevent wrapping of anything inside of eol comments attachments. + 2. Losslessly wrap eol comments. +*) +(* This example illustrates the above issue, but isn't een idempotent due to the issue. *) +(* type cfg = { *) +(* node_id : int ref; *) +(* node_list : int list ref; *) +(* name_pdesc_tbl : (int, (int, int) Hashtbl.t) Hashtbl.t; (** Map proc name to procdesc *) *) +(* mutable priority_set : (int, int) Hashtbl.t (** set of function names to be analyzed first *) *) +(* } *) +(* *) +(* *) diff --git a/test/knownMlIssues.t/run.t b/test/knownMlIssues.t/run.t new file mode 100644 index 000000000..0df9d0c99 --- /dev/null +++ b/test/knownMlIssues.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/knownReIssues.t/input.re b/test/knownReIssues.t/input.re new file mode 100644 index 000000000..2c96b3005 --- /dev/null +++ b/test/knownReIssues.t/input.re @@ -0,0 +1,23 @@ +/** + Issue 940: https://github.com/facebook/reason/issues/940 + The parens in the exception match case with an alias, + are required for correct parsing: + i.e. (Sys_error _ as exc) instead of Sys_error _ as exc + The latter doesn't type-check with Error: Unbound value exc. + Warning 11 (unused match case) is also triggered. + */ +let f () = raise(Sys_error("error")); + +switch (f ()) { +| x => () +| exception (Sys_error(_) as exc) => raise(exc) +}; + +exception Foo(string); + +let g () = raise(Foo("bar errors")); + +switch (g ()) { +| x => () +| exception Foo(f) => raise (Foo(f)) +}; diff --git a/test/knownReIssues.t/run.t b/test/knownReIssues.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/knownReIssues.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/lazy.t/input.re b/test/lazy.t/input.re new file mode 100644 index 000000000..19c357dd2 --- /dev/null +++ b/test/lazy.t/input.re @@ -0,0 +1,27 @@ +let myComputation = lazy { + let tmp = 10; + let tmp2 = 20; + tmp + tmp2; +}; + +type myRecord = {myRecordField: int}; + +let operateOnLazyValue (lazy {myRecordField}) { + let tmp = myRecordField; + tmp + tmp; +}; + +let result = operateOnLazyValue (lazy {myRecordField: 100}); + +type box('a) = Box('a); + +let lazy thisIsActuallyAPatternMatch = lazy (200); +let tmp: int = thisIsActuallyAPatternMatch; +let (lazy (Box(i)), x) = (lazy (Box(200)), 100); +let tmp: int = i; + +let myComputation = lazy (200); + +let reallyLoooooooooooooongIdentifierThatSpansMoreThan50Cols = 200; + +let foo = lazy(reallyLoooooooooooooongIdentifierThatSpansMoreThan50Cols) diff --git a/test/lazy.t/run.t b/test/lazy.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/lazy.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/letop.t/input.re b/test/letop.t/input.re new file mode 100644 index 000000000..43451382d --- /dev/null +++ b/test/letop.t/input.re @@ -0,0 +1,28 @@ +let (let.opt) = (x, f) => switch x { | None => None | Some(x) => f(x) }; +let (let.&opt) = (x, f) => switch x { | None => None | Some(x) => Some(f(x)) }; + +let z = { + let.opt a = Some(2); + let.&opt b = Some(5); + a + b +} + +let (let./\/) = (x, f) => switch x { | None => None | Some(x) => f(x) }; +let (let.&/\*) = (x, f) => switch x { | None => None | Some(x) => Some(f(x)) }; + +/* Test syntax that could potentially conflict with comments */ +let z = { + let./\/ a = Some(2); + let.&/\* b = Some(5); + a + b +} + +let _ = { + let.opt _ = Some("a"); + + let.opt _ = Some("c"); + + // hello + + None; +}; diff --git a/test/letop.t/run.t b/test/letop.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/letop.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/lib/dune b/test/lib/dune new file mode 100644 index 000000000..8c64d49ef --- /dev/null +++ b/test/lib/dune @@ -0,0 +1,11 @@ +(rule + (targets typedtreePrinter.ml) + (deps typedtreePrinter.cppo.ml) + (action + (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets}))) + +(executable + (public_name typedtree_printer) + (name typedtreePrinter) + (package rtop) + (libraries reason)) diff --git a/test/lib/typedtreePrinter.cppo.ml b/test/lib/typedtreePrinter.cppo.ml new file mode 100644 index 000000000..00cc7ade4 --- /dev/null +++ b/test/lib/typedtreePrinter.cppo.ml @@ -0,0 +1,59 @@ +(* + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + + +(** + * See `testOprint.js` for how this gets run. + * + * In order to test our outcome printer, we parse & typecheck the code provided on stdin. + * That gives us a `Typedtree` (like an AST but with all the types included), which includes + * the `signature` type of the module we just processed. + * From there, `Printtyp` will helpfully convert the `signature` into something that our + * outcome printer can handle. + * + * Outcome printers are mostly used with Repl's like utop or tools like Merlin, so there's + * not a super easy path to "test it out", but this setup is hopefully not too complicated. + *) + +open Reason_omp + +module Convert = Reason_omp.Convert (Reason_omp.OCaml_411) (Reason_omp.OCaml_current) +module ConvertBack = Reason_omp.Convert (Reason_omp.OCaml_current) (Reason_omp.OCaml_411) + +let main () = + let filename = "./TestTest.ml" in + let modulename = "TestTest" in + + let lexbuf = Reason_toolchain.setup_lexbuf true filename in + let impl = Reason_toolchain.RE.implementation in + +#if OCAML_VERSION >= (4,9,0) + Compmisc.init_path (); +#else + Compmisc.init_path false; +#endif + Env.set_unit_name modulename; + + let ast = impl lexbuf in + let ast = Convert.copy_structure ast in + let env = Compmisc.initial_env() in +#if OCAML_VERSION >= (4,13,0) + let { Typedtree.structure = typedtree; _ } = +#else + let (typedtree, _) = +#endif + Typemod.type_implementation modulename modulename modulename env ast in + let tree = Printtyp.tree_of_signature typedtree.Typedtree.str_type in + let phrase = (Ast_411.Outcometree.Ophr_signature + (List.map (fun item -> (ConvertBack.copy_out_sig_item item, None)) tree) + ) in + let fmt = Format.str_formatter in + Reason_oprint.print_out_phrase fmt phrase; + let result = Format.flush_str_formatter () in + print_string result + +let () = main () diff --git a/test/lineComments.t/run.t b/test/lineComments.t/run.t index ca2bf8504..31bdcdfda 100644 --- a/test/lineComments.t/run.t +++ b/test/lineComments.t/run.t @@ -1,5 +1,5 @@ Format line comments - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re 3; // - 3; //- diff --git a/test/mlVariants.t/input.ml b/test/mlVariants.t/input.ml new file mode 100644 index 000000000..603edee27 --- /dev/null +++ b/test/mlVariants.t/input.ml @@ -0,0 +1,26 @@ +(* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. *) + +type polyVariantsInMl = [ + | `IntTuple of (int * int) + | `StillAnIntTuple of (int * int) +] + + + +let intTuple = `IntTuple (1, 2) +let stillAnIntTuple = `StillAnIntTuple (4, 5) +let sumThem = function + | `IntTuple (x, y) -> x + y + | `StillAnIntTuple (a, b) -> a + b + +type nonrec t = A of int | B of bool + +type s = [ `Poly ] + +let x = (`Poly: s) + +(* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, + * duplicating the core_type. + * https://caml.inria.fr/mantis/view.php?id=7758 + * https://caml.inria.fr/mantis/view.php?id=7344 *) +let x : s = `Poly diff --git a/test/mlVariants.t/run.t b/test/mlVariants.t/run.t new file mode 100644 index 000000000..0df9d0c99 --- /dev/null +++ b/test/mlVariants.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.ml > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/modules.t/run.t b/test/modules.t/run.t index b29e8cf0d..b28898cd2 100644 --- a/test/modules.t/run.t +++ b/test/modules.t/run.t @@ -1,5 +1,5 @@ Format modules - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ let run = () => { diff --git a/test/modules_no_semi.t/run.t b/test/modules_no_semi.t/run.t index 731200271..388d7f2ef 100644 --- a/test/modules_no_semi.t/run.t +++ b/test/modules_no_semi.t/run.t @@ -1,5 +1,5 @@ Format modules no semi - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ let run = () => { diff --git a/test/mutation.t/input.re b/test/mutation.t/input.re new file mode 100644 index 000000000..a3da001e7 --- /dev/null +++ b/test/mutation.t/input.re @@ -0,0 +1,49 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +/** + * Testing mutations. + */ +let holdsAUnit = ref(); + +let holdsABool = ref(false); + +let holdsAnInt = ref(0); + +let holdsAHoldsABool = ref(ref(true)); + +let () = holdsAUnit := holdsABool := false; + +/* Should be parsed as: */ +/* And so they should both be printed the same */ +let () = holdsAUnit := (holdsABool := false); + +/* + * The following: + * + * something = x := e + * + * Should be parsed as: + * + * something = (x := e) + */ +holdsAUnit.contents = holdsAnInt := 0; + +holdsABool.contents = holdsAnInt.contents == 100; + +let numberToSwitchOn = 100; + +switch (numberToSwitchOn) { + | -3 + | -2 + | -1 => () + | 0 => holdsAUnit.contents = () + | 1 => holdsAUnit.contents = holdsAnInt := 0 + | 2 => true ? holdsAUnit.contents = () : holdsABool.contents ? () : () + | 3 => true ? holdsAUnit := () : holdsABool.contents ? () : () + | 4 => true ? holdsAnInt := 40 : () + | 5 => holdsAnInt := 40 + | _ => () +}; + +let mutativeFunction = fun | Some(x) => holdsAUnit.contents = () + | None => holdsAUnit := (); diff --git a/test/mutation.t/run.t b/test/mutation.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/mutation.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/object.t/run.t b/test/object.t/run.t index 8b7285118..2b1738d9b 100644 --- a/test/object.t/run.t +++ b/test/object.t/run.t @@ -1,5 +1,5 @@ Format objects - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ type t = {.}; diff --git a/test/ocaml_identifiers.t/run.t b/test/ocaml_identifiers.t/run.t index 7211cb375..1f52cfca3 100644 --- a/test/ocaml_identifiers.t/run.t +++ b/test/ocaml_identifiers.t/run.t @@ -1,5 +1,5 @@ Format OCaml identifiers file - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.ml --print re + $ refmt ./input.ml --print re /* Type names (supported with PR#2342) */ module T = { type pub_ = unit; diff --git a/test/oo.t/input.re b/test/oo.t/input.re new file mode 100644 index 000000000..6d74cb66a --- /dev/null +++ b/test/oo.t/input.re @@ -0,0 +1,334 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +class virtual stack('a)(init) { + /* + * The "as this" is implicit and will be formatted away. + */ + as this; + val virtual dummy : unit; + val mutable v : list('a) = init; + + pub virtual implementMe: (int) => int; + pub pop = + switch (v) { + | [hd, ...tl] => { + v = tl; + Some(hd); + } + | [] => None + }; + + pub push(hd) {v = [hd, ...v]}; + initializer { + print_string("initializing object"); + }; + pub explicitOverrideTest(a) { a + 1 }; + pri explicitOverrideTest2(a) { a + 1 }; +}; + +let tmp = { + /** + * comment here. + */ + as this; + val x = 10; +}; + +/** + * Comment on stackWithAttributes. + */ +[@thisShouldntBeFormattedAway] +class virtual stackWithAttributes('a)(init) +/* Before class */ +{ + + /* The "as this" should not be formatted away because attributes. */ + + as [@thisShouldntBeFormattedAway] this; + /* Before floatting attribute */ + [@floatingAttribute]; + /* Virtual member */ + [@itemAttr1] + val virtual dummy : unit; + [@itemAttr2] + val mutable v : list('a) = init; + + pub virtual implementMe: (int) => int; + pub pop = + switch (v) { + | [hd, ...tl] => { + v = tl; + Some(hd); + } + | [] => None + }; + + pub push(hd) {v = [hd, ...v]}; + initializer { + print_string("initializing object"); + }; +} +; + +class extendedStack('a)(init) { + inherit (class stack('a))(init); + val dummy = (); + pub implementMe(i) = i; +}; + +class extendedStackAcknowledgeOverride('a)(init) { + inherit (class stack('a))(init); + val dummy = (); + pub implementMe(i) { i + 1 }; + pub! explicitOverrideTest(a) { a + 2 }; + pri! explicitOverrideTest2(a) { a + 2 }; +}; + +let inst = new extendedStack([1, 2]); + +/** + * Recursive classes. + */ +/* + * First recursive class. + */ +class firstRecursiveClass(init) { + val v = init; +} +/* + * Second recursive class. + */ +and secondRecursiveClass(init) { + val v = init; +}; + + + +/** + * For now, mostly for historic reasons, the syntax for type + * definitions/annotations on anonymous objects are different than + * "class_instance_type". That needn't be the case. The only challenge is that + * whatever we do, there is a slight challenge in avoiding conflicts with + * records. Clearly {x:int, y:int} will conflict. However, open object types in + * the form of {.. x:int, y:int} do not conflict. The only thing that must be + * resolved is closed object types and records. you could have a special token + * that means "closed". {. x: int, y:int}. If only closed object types would be + * optimized in the same way that records are, records could just be replaced + * with closed object types. + */ +/** + * Anonymous objects. + */ + +type closedObj = {.}; + +let (<..>)(a,b) = a + b; +let five = 2 <..> 3; + +type nestedObj = {. bar : {. a: int}}; + +let (>>)(a,b) = a > b; + +let bigger = 3 >> 2; + +type typeDefForClosedObj = {. x: int, y:int}; +type typeDefForOpenObj('a) = {.. x:int, y:int} as 'a; +let anonClosedObject: {. x:int, y:int} = { + pub x { 0 }; + pub y { 0 }; +}; + +let onlyHasX = {pub x = 0}; +let xs: list({. x:int}) = [onlyHasX, anonClosedObject :> {. x: int}]; + +let constrainedAndCoerced = + ([anonClosedObject, anonClosedObject] : list({. x:int, y:int}) :> list({. x:int})); + +/* If one day, unparenthesized type constraints are allowed on the RHS of a + * record value, we're going to have to be careful here because >} is parsed as + * a separate kind of token (for now). Any issues would likely be caught in the + * idempotent test case. + */ +let xs: ref({. x:int}) = {contents: (anonClosedObject :> {. x: int})}; + +let coercedReturn = { + let tmp = anonClosedObject; + (tmp :> {. x: int}) +}; + +let acceptsOpenAnonObjAsArg (o: {.. x: int, y:int}) = o#x + o#y; +let acceptsClosedAnonObjAsArg (o: {. x: int, y:int}) = o#x + o#y; +let res = acceptsOpenAnonObjAsArg { + pub x = 0; + pub y = 10; +}; + +let res = acceptsOpenAnonObjAsArg { + pub x = 0; + pub y = 10; + pub z = 10; +}; + +let res = acceptsClosedAnonObjAsArg { + pub x = 0; + pub y = 10; +}; + +/* TODO: Unify class constructor return values with function return values */ +class myClassWithAnnotatedReturnType(init) : {pub x : int; pub y : int} { + pub x = ( init : int ); + pub y = init; +}; +/** + * May include a trailing semi after type row. + */ +class myClassWithAnnotatedReturnType2(init):{pub x : int; pub y : int;} { + pub x = ( init : int ); + pub y = init; +}; + +/** + * May use equals sign, and may include colon if so. + */ +class myClassWithAnnotatedReturnType3(init):{pub x : int; pub y : int;} { + pub x = ( init : int ); + pub y:int = init; +}; + +/** + * The one difference between class_constructor_types and expression + * constraints, is that we have to include the prefix word "new" before the + * final component of any arrow. This isn't required when annotating just the + * return value with ": foo ". + * This is only to temporarily work around a parsing conflict. (Can't tell if + * in the final arrow component it should begin parsing a non_arrowed_core_type + * or a class_instance_type). A better solution, would be to include + * class_instance_type as *part* of core_type, but then fail when it is + * observed in the non-last arrow position, or if a non_arrowed_core_type + * appears in the last arrow position. + * + * class_instance_type wouldn't always fail if parsed as any "core type" + * everywhere else in the grammar. + * + * Once nuance to that would be making a parse rule for "type application", and + * deferring whether or not that becomes a Pcty_constr or a Ptyp_constr. (The + * same for type identifiers and extensions.) + */ +class myClassWithAnnotatedReturnType3_annotated_constructor : + (int) => {pub x : int; pub y : int;} = + (init) => { + pub x = ( init : int ); + pub y:int = init; + }; + +class tupleClass('a,'b) (init: ('a, 'b)) { + pub pr = init; +}; + +module HasTupleClasses : { + /** + * exportedClass. + */ + class exportedClass: (int) => {pub x : int; pub y : int}; + /** + * anotherExportedClass. + */ + class anotherExportedClass('a,'b) : (('a, 'b)) => {pub pr: ('a, 'b)}; +} = { + /** + * exportedClass. + */ + class exportedClass = myClassWithAnnotatedReturnType3; + + /** + * anotherExportedClass. + */ + class anotherExportedClass('a,'b) = (class tupleClass('a,'b)); +}; + +class intTuples = (class tupleClass(int,int)); + +class intTuplesHardcoded = (class tupleClass(int,int))((8, 8)); + +/** + * Note that the inner tupleClass doesn't have the "class" prefix because + * they're not kinds of classes - they're types of *values*. + * The parens here shouldn't be required. + */ +class intTuplesTuples = ( + class tupleClass( + (tupleClass(int,int)), + (tupleClass(int,int)) + ) +); + +let x: tupleClass(int,int) = {pub pr = (10, 10);}; + +let x: #tupleClass(int,int) = x; + +let incrementMyClassInstance: (int, #tupleClass(int,int)) => #tupleClass(int,int) = + (i,inst) => { + let (x, y) = inst#pr; + {pub pr = (x + i, y + i);}; + }; + +class myClassWithNoTypeParams = {}; +/** + * The #myClassWithNoTypeParams should be treated as "simple" + */ +type optionalMyClassSubtype('a) = option(#myClassWithNoTypeParams) as 'a; + + + +/** + * Remember, "class type" is really "class_instance_type" (which is the type of + * what is returned from the constructor). + * + * And when defining a class: + * + * addablePoint is the "class instance type" type generated in scope which is + * the closed object type of the return value of the constructor. + * + * #addablePoint is the extensible form of addablePoint (anything that + * adheres to the "interface.") + */ +class type addablePointClassType = { + pub x: int; + pub y: int; + pub add: (addablePointClassType, addablePointClassType) => int; +}; + +/** + * Class constructor types can be annotated. + */ +class addablePoint: (int) => addablePointClassType = fun(init) => { + as self; + pub add (one: addablePointClassType, two:addablePointClassType) = + one#x + two#x + one#y + two#x; + pub x = (init : int); + pub y = init; +}; + +class addablePoint2 = (fun(init) => { + as self; + pub add (one: addablePointClassType, two:addablePointClassType) = + one#x + two#x + one#y + two#x; + pub x = (init : int); + pub y = init; +} : (int) => addablePointClassType); + +module type T = { + class virtual cl('a) : {} + and cl2 : {}; +}; + +let privacy = { + pri x(c) = 5 + c; +}; + +module Js = { + type t('a); +}; + +/* supports trailing comma */ +type stream('a) = {. "observer": ('a => unit) => unit,}; diff --git a/test/oo.t/run.t b/test/oo.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/oo.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/patternMatching.t/input.re b/test/patternMatching.t/input.re new file mode 100644 index 000000000..7e771c447 --- /dev/null +++ b/test/patternMatching.t/input.re @@ -0,0 +1,266 @@ +type point = {x: int, y: int}; + +let id(x) = x; + +type myVariant = + | TwoCombos(inner, inner) + | Short + | AlsoHasARecord(int, int, point) +and inner = + | Unused + | HeresTwoConstructorArguments(int, int); + +let computeTuple(a,b,c,d,e,f,g,h) = ( + a + b, + c + d, + e + f, + g + h +); + +let res = + switch (TwoCombos(Unused,Unused)) { + | TwoCombos + (HeresTwoConstructorArguments(x,y), + HeresTwoConstructorArguments(a,b)) => + (x, y, a, b) + | TwoCombos + (_, + _) => (0, 0, 0, 0) + | Short + | AlsoHasARecord (300,_,_) => ( + 100000, + 100000, + 100000, + 100000 + ) + | AlsoHasARecord (firstItem, two, {x, y}) => + computeTuple(firstItem,firstItem,firstItem,firstItem,firstItem,two,two,two) + }; + +/** + * Match bodies may include sequence expressions, but without the `{}` + * braces required. + */ +let res = + switch (TwoCombos(Unused,Unused)) { + | TwoCombos + (HeresTwoConstructorArguments(x,y), + HeresTwoConstructorArguments(a,b)) => { + let ret = (x, y, a, b); + ret; + } + | TwoCombos (_,_) => + /** + * See, no braces required - saves indentation as well! + */ + let ret = (0, 0, 0, 0); + ret; + | Short + | AlsoHasARecord (300,_,_) => + /** + * And no final semicolon is required. + */ + let ret = ( + 100000, + 100000, + 100000, + 100000 + ); + ret + | AlsoHasARecord(firstItem,two,{x, y}) => + computeTuple(firstItem,firstItem,firstItem,firstItem,firstItem,two,two,two) + }; + + + +/** + * Ensure that nested Pexp_functions are correctly wrapped in parens. + * + */ +let res = + switch (TwoCombos(Unused,Unused)) { + | TwoCombos + (HeresTwoConstructorArguments(x,y), + HeresTwoConstructorArguments(a,b)) => + (fun + | Some(x) => x + 1 + | None => 0) + | TwoCombos + (_, + _) => + let x = + (fun + | Some(x) => x + 1 + | None => 0); + x; + | Short + | AlsoHasARecord(300,_,_) => id ((fun + | Some(x) => x + 1 + | None => 0)) + | AlsoHasARecord(firstItem,two,{x, y}) => + id ((fun + | Some(x) => x + 1 + | None => 0)); + }; + +/* test (), which is sugar for (()) */ +switch (Some(())) { +| Some(()) => 1 +| _ => 2 +}; +switch (Some(())) { +| Some() => 1 +| _ => 2 +}; +switch (Some()) { +| Some(()) => 1 +| _ => 2 +}; +switch (Some()) { +| Some() => 1 +| _ => 2 +}; + +type foo = Foo(unit); +switch (Foo(())) { +| Foo(()) => 1 +}; +switch (Foo(())) { +| Foo() => 1 +}; +switch (Foo()) { +| Foo(()) => 1 +}; +switch (Foo()) { +| Foo() => 1 +}; + +switch (()) { +| (()) => 1 +}; +switch (()) { +| () => 1 +}; +switch () { +| (()) => 1 +}; +switch () { +| () => 1 +}; + +switch (Some(1)) { +| Some(1) => 1 +| None => 2 +| _ => 3 +}; + +let myInt = 100; +/* Numeric ranges are rejected by the type checker, but validly parsed so drop + * this in an annotation to test the parsing. */ +[@something? 1 .. 2] +let rangeInt = 0; + +let myChar = 'x'; +let rangeChar = + switch(myChar) { + | 'a'..'b' => "a to b" + | 'b' .. 'z' => "b to z" + | c => "something else" + }; + +/* with parens around direct list pattern in constructor pattern */ +switch (None) { +| Some([]) => () +| Some([_]) when true => () +| Some([x]) => () +| Some([x, ...xs]) when true => () +| Some([x, y, z]) => () +| _ => () +}; + +/* no parens around direct list pattern in constructor pattern (sugar) */ +switch (None) { +| Some [] => () +| Some [_] when true => () +| Some [x] => () +| Some [x, ...xs] when true => () +| Some [x, y, z] => () +| _ => () +}; + +/* with parens around direct array pattern in constructor pattern */ +switch (None) { +| Some([| |]) => "empty" +| Some([| _ |]) when true => "one any" +| Some([| a |]) => "one" +| Some([| a, b |]) => "two" +| _ => "many" +}; + +/* no parens around direct array pattern in constructor pattern (sugar) */ +switch (None) { +| Some [||] => "empty" +| Some [|_|] when true => "one any" +| Some [|a|] => "one" +| Some [|a, b|] => "two" +| _ => "many" +}; + +/* parens around direct record pattern in constructor pattern */ +switch (None) { +| Some({x}) when true => () +| Some({x, y}) => () +| _ => () +}; + +/* no parens around direct record pattern in constructor pattern (sugar) */ +switch (None) { +| Some {x} when true => () +| Some {x, y} => () +| _ => () +}; + +switch (None) { +| Some([|someSuperLongString, thisShouldBreakTheLine|]) => () +| _ => () +}; + +switch (None) { +| Some((someSuperLongString, thisShouldBreakTheLine)) => () +| _ => () +}; + +switch (None) { +| Some([someSuperLongString, thisShouldBreakTheLine]) => () +| Some([someSuperLongString, ...es6ListSugarLikeSyntaxWhichIsSuperLong]) when true === true => () +| Some([someSuperLongString, ...es6ListSugarLikeSyntaxWhichIsSuperLong]) => () +| _ => () +} + + + +type aOrB = A(int) | B(int); +let ((nestedAnnotation: int) : int) = 0; +let ((A(i) | B(i): aOrB)) = A(0); + + +type test_foo = + | VariantType1 + | VariantType2 + +let branch_with_variant_and_annotation = + fun + | (VariantType1: test_foo) => true + | VariantType2 => false; + +type intRange = { + from: option(string), + to_: option(string) +} + +type optIntRange = option(intRange) + +let optIntRangeOfIntRange = + fun + | ({from: None, to_: None}: intRange) => (None: optIntRange) + | {from, to_} => Some({from, to_}); diff --git a/test/patternMatching.t/run.t b/test/patternMatching.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/patternMatching.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/pervasive.t/input.mli b/test/pervasive.t/input.mli new file mode 100644 index 000000000..7a6400e32 --- /dev/null +++ b/test/pervasive.t/input.mli @@ -0,0 +1,5 @@ +val ( = ) : 'a -> 'a -> bool + +val ( <> ) : 'a -> 'a -> bool + +val not : bool -> bool \ No newline at end of file diff --git a/test/pervasive.t/run.t b/test/pervasive.t/run.t new file mode 100644 index 000000000..1f24e40e3 --- /dev/null +++ b/test/pervasive.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.mli > ./formatted.rei + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -intf formatted.rei + +Format the formatted file back + $ refmt --print re ./formatted.rei > ./formatted_back.rei + +Ensure idempotency: first format and second format are the same + $ diff formatted.rei formatted_back.rei diff --git a/test/pexpFun.t/run.t b/test/pexpFun.t/run.t index be6e8e8bb..ce4479c61 100644 --- a/test/pexpFun.t/run.t +++ b/test/pexpFun.t/run.t @@ -1,5 +1,5 @@ Format function expressipns (pexpFun) - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re let x = switch (x) { | Bar => diff --git a/test/pipeFirst.t/run.t b/test/pipeFirst.t/run.t index 64c2ae2d8..52e54c672 100644 --- a/test/pipeFirst.t/run.t +++ b/test/pipeFirst.t/run.t @@ -1,5 +1,5 @@ Format pipe first (->) - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re foo->f->g->h; bar->f->g->h; diff --git a/test/polymorphism.t/run.t b/test/polymorphism.t/run.t index 7ff54e1c4..e76a398a6 100644 --- a/test/polymorphism.t/run.t +++ b/test/polymorphism.t/run.t @@ -1,5 +1,5 @@ Format polymoprhism - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ let run = () => { diff --git a/test/print-width-env.t b/test/print-width-env.t index 3511b01b8..e64e0c39d 100644 --- a/test/print-width-env.t +++ b/test/print-width-env.t @@ -4,12 +4,12 @@ Create a file with a long line > EOF Set the print width to 120 characters via env "REFMT_PRINT_WIDTH" - $ REFMT_PRINT_WIDTH=120 ../src/refmt/refmt_impl.exe test.re + $ REFMT_PRINT_WIDTH=120 refmt test.re let initialState = uiStateFromValidated(~ownership=RemoteData.NotAsked, ~limits=initialLimits, SiteAuditSettings.default); Set the print width to 80 characters via env "REFMT_PRINT_WIDTH" - $ REFMT_PRINT_WIDTH=80 ../src/refmt/refmt_impl.exe test.re + $ REFMT_PRINT_WIDTH=80 refmt test.re let initialState = uiStateFromValidated( ~ownership=RemoteData.NotAsked, diff --git a/test/reasonComments-rei.t/input.rei b/test/reasonComments-rei.t/input.rei new file mode 100644 index 000000000..dcfdb5b28 --- /dev/null +++ b/test/reasonComments-rei.t/input.rei @@ -0,0 +1,3 @@ +module JustString : { + include Map.S; /* Comment eol include */ +}; diff --git a/test/reasonComments-rei.t/run.t b/test/reasonComments-rei.t/run.t new file mode 100644 index 000000000..4082a3503 --- /dev/null +++ b/test/reasonComments-rei.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.rei > ./formatted.rei + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -intf formatted.rei + +Format the formatted file back + $ refmt --print re ./formatted.rei > ./formatted_back.rei + +Ensure idempotency: first format and second format are the same + $ diff formatted.rei formatted_back.rei diff --git a/test/rtopIntegration.t b/test/rtopIntegration.t new file mode 100644 index 000000000..1a70c76a8 --- /dev/null +++ b/test/rtopIntegration.t @@ -0,0 +1,17 @@ +# Context: https://github.com/reasonml/reason/pull/674 + +# We can't directly call `rtop -stdin` because it circumvents what we're trying to +# test. See rtop.sh for the reason. We want to make sure utop's reason +# integration is legit, + +# `utop -stdin` wouldn't work because it somehow processes the code before +# invoking the reason plugin, so `echo someReasonCode | utop -stdin` would +# always error. + +# Given the above, we're gonna test that utop integration works by piping code +# into it and asserting the existence of some output. + $ echo "let f = a => a;" | rtop | grep -o "let f: 'a => 'a = ;" + let f: 'a => 'a = ; + + $ echo "let f = (a) => 1 + \"hi\";" | rtop | grep -o "This expression has type string but an expression was expected of type" + This expression has type string but an expression was expected of type diff --git a/test/sequences.t/input.re b/test/sequences.t/input.re new file mode 100644 index 000000000..151ec035f --- /dev/null +++ b/test/sequences.t/input.re @@ -0,0 +1,81 @@ +/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ + +/** + * Testing Sequences. + */ +let result = { + let twenty = 20; + let result = twenty; + result; +}; + +/* Final semicolon is not required */ +let result = { + let twenty = result; + twenty +}; +let anInt = result + 20; + +let twenty = 20; + +/** + * Each of these are a sequence with a single item - they will be + * printed in reduced form because sequences are a *parse* time construct. + * To ensure these are parsed correctly, adding to an integer. + */ +let result = 0 + {twenty}; +let result = 0 + {twenty;}; +let result = 0 + twenty; + +let unitValue = (); +/* While loops/for loops merely accept a "simple expression" (which means + * it is either a simple token or balanced with parens/braces). However, + * the formatter ensures that the bodies are printed in "sequence" form even if + * it's not required. + */ +while (false) unitValue; +while (false) { + print_string("test") +}; +while (false) { + print_string("test"); +}; + +type myRecord = { + number: int +}; +let x = {number:20}; +let number = 20; +/* + * The (mild) consequence of not requiring a final semi in a sequence, + * is that we can no longer "pun" a single field record (which would) + * be very rare anyways. + */ +let cannotPunASingleFieldRecord = {number: number}; +let fourty = 20 + cannotPunASingleFieldRecord.number; +let thisIsASequenceNotPunedRecord = {number}; +let fourty = 20 + thisIsASequenceNotPunedRecord; + + + +type recordType = {a: int, b: int, c: int}; +let a = 0; +let b = 0; +let c = 0; +/* All of these will be printed as punned because they have more than one field. */ +let firstFieldPunned = { + a: a, + b, + c: c +}; +let sndFieldPunned = { + a, + b: b, + c: c +}; +let thirdFieldPunned = { + a: a, + b: b, + c +}; +let singlePunAcceptedIfExtended = {...firstFieldPunned, a}; diff --git a/test/sequences.t/run.t b/test/sequences.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/sequences.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/sharpop.t/run.t b/test/sharpop.t/run.t index 8bac009a1..585a1f60a 100644 --- a/test/sharpop.t/run.t +++ b/test/sharpop.t/run.t @@ -1,5 +1,5 @@ Format sharp operator - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re foo #= bar[0]; foo##bar[0] = 3; diff --git a/test/singleLineCommentEof.t/run.t b/test/singleLineCommentEof.t/run.t index 1aed4663d..5fec6a04b 100644 --- a/test/singleLineCommentEof.t/run.t +++ b/test/singleLineCommentEof.t/run.t @@ -1,3 +1,3 @@ Format single line comment at the end of the file - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re // let x = 1 diff --git a/test/testUtils.t/run.t b/test/testUtils.t/run.t index 4526b9775..57f189cb5 100644 --- a/test/testUtils.t/run.t +++ b/test/testUtils.t/run.t @@ -1,5 +1,5 @@ Format test utils - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ let printSection = s => { diff --git a/test/trailing.t/run.t b/test/trailing.t/run.t index 716e85daa..f28bd1786 100644 --- a/test/trailing.t/run.t +++ b/test/trailing.t/run.t @@ -1,5 +1,5 @@ Format trailing - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re let x = {"obj": obj}; let x = {"key": key, "keyTwo": keyTwo}; diff --git a/test/trailingSpaces.t/run.t b/test/trailingSpaces.t/run.t index b924b9e2a..e72973b79 100644 --- a/test/trailingSpaces.t/run.t +++ b/test/trailingSpaces.t/run.t @@ -1,5 +1,5 @@ Format trailing spaces - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ module M = diff --git a/test/type-pipeFirst.t/input.re b/test/type-pipeFirst.t/input.re new file mode 100644 index 000000000..13d1c6326 --- /dev/null +++ b/test/type-pipeFirst.t/input.re @@ -0,0 +1,168 @@ +let (|.) = (x, y) => x + y; + +let a = 1; +let b = 2; +let c = 3; + +/* parses as 10 < (a->b->c) */ +let t1: bool = 10 < a->b->c; + +type coordinate = {x: int, y: int}; +let coord = {x: 1, y: 1}; + +/* parses as (coord.x)->a->b->c */ +let t2: int = coord.x->a->b->c; + +let (|.) = (x, y) => x || y; + +let a = true; +let b = false; +let c = true; + +/* parses as !(a->b->c) */ +let t3: bool = !a->b->c; + +/* parse pipe first with underscore application correct */ +let doStuff = (a: int, b: int, c: int): int => { + a + 2 * b + 3 * c; +}; + +let (|.) = (a, f) => f(a); + +let t4: int = 5->doStuff(1, _, 7); +let t5: int = 5->doStuff(1, _, 7)->doStuff(1, _, 7); + +module Foo = { + let createElement = (~children, ()) => + List.hd(children) ++ "test"; + + let map = (xs, f) => List.map(f, xs); + + let plusOne = x => x + 1; + + let toString = lst => + List.fold_left( + (acc, curr) => + acc ++ (string_of_int(curr)), + "", + lst + ); +}; + +let items = [1, 2, 3]; + +let t6: string = + {items->Foo.map(Foo.plusOne)->Foo.toString} ; + +type saveStatus = + | Pristine + | Saved + | Saving + | Unsaved; + +let saveStatus = Pristine; + +let t7: string = + + { + ( + switch (saveStatus) { + | Pristine => [0] + | Saved => [1] + | Saving => [2] + | Unsaved => [3] + } + ) + ->Foo.map(Foo.plusOne) + ->Foo.toString + } + ; + +let genItems = (f) => List.map(f, items); + +let t8: string = + + {genItems(Foo.plusOne)->Foo.toString} + ; + +let blocks = [1, 2, 3]; + +let t9: string = + + blocks->(b => Foo.toString(b)) + ; + +let foo = (xs) => List.concat([xs, xs]); + +let t10: string = + + {blocks->foo->Foo.map(Foo.plusOne)->Foo.toString} + ; + +let t11: string = + + {blocks->foo->Foo.map(Foo.plusOne)->Foo.map(Foo.plusOne)->Foo.toString} + ; + +let title = "los pilares de la tierra"; + +let t12: string = + (title === "" ? [1, 2, 3]: blocks)->Foo.toString + +type change = + | Change(list(int)); + +type this = { + send: change => string +}; + +let change = x => Change(x); + +let self = { + send: x => + switch (x) { + | Change(xs) => Foo.toString(xs) + }, +}; + +let urlToRoute = (x) => [x, x, x]; + +let t13: string = urlToRoute(1)->change->(self.send); + +module FooLabeled = { + let createElement = (~children, ()) => + List.hd(children) ++ "test"; + + let map = (xs, ~f) => List.map(f, xs); + + let plusOne = x => x + 1; + + let toString = lst => + List.fold_left( + (acc, curr) => + acc ++ (string_of_int(curr)), + "", + lst + ); +}; + +let t14: string = + {items->FooLabeled.map(~f=FooLabeled.plusOne)->FooLabeled.toString} ; + +let c = (a, b) => a + b; +let a = 1; +let b = 2; +let t: int = a->(b->c); + +module Div = { + let createElement = (~children, ()) => + List.hd(children) ++ "test"; +}; + +let url = "reason"; +let suffix = ".com"; + +let parse = (a, b) => a ++ b; + +let t15: string = +
{url->parse(suffix, _)}
; diff --git a/test/type-pipeFirst.t/run.t b/test/type-pipeFirst.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/type-pipeFirst.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/typeDeclarations.t/run.t b/test/typeDeclarations.t/run.t index d7591c964..baa4ea052 100644 --- a/test/typeDeclarations.t/run.t +++ b/test/typeDeclarations.t/run.t @@ -1,5 +1,5 @@ Format type declarations - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* === test wrapping for arrows === */ type foo = option(int => int); type foo = option((int, int) => int); diff --git a/test/typeParameters.t/input.re b/test/typeParameters.t/input.re new file mode 100644 index 000000000..a4ca9c32c --- /dev/null +++ b/test/typeParameters.t/input.re @@ -0,0 +1,80 @@ +/** + * Testing type parameters. + */ + +type threeThings<'t> = ('t, 't, 't); +type listOf<'t> = list<'t>; + +type underscoreParam<_> = Underscored; +type underscoreParamCovariance<+_> = Underscored; +type underscoreParamContravariance<-_> = Underscored; + +type tickParamCovariance<+'a> = Underscored; +type tickParamContravariance<-'a> = Underscored; + +let x : option > = None; +type myFunctionType<'a> = (list<('a, 'a)>, int => option >); +let funcAnnoted = (~a: list=[0, 1, ], ()) => a; + + + +/** + * Syntax that would be likely to conflict with lexing parsing of < > syntax. + */ + +let zero = 0; +let isGreaterThanNegFive = zero > - 5; +let isGreaterThanNegFive2 = zero > -5; +let isGreaterThanNegFive3 = zero >(-5); + +let isGreaterThanEqNegFive = zero >= -5; +let isGreaterThanEqNegFive2 = zero >= -5; +let isGreaterThanEqNegFive3 = zero >=(-5); + +let (>>=) = (a, b) => a >= b; + +let isSuperGreaterThanEqNegFive = zero >>= - 5; +let isSuperGreaterThanEqNegFive2 = zero >>= -5; +let isSuperGreaterThanEqNegFive3 = zero >>= (-5); + +let jsx= (~children, ()) => 0; + +type t<'a> = 'a; +let optionArg = (~arg:option>=?, ()) => arg; +let optionArgList = (~arg:option>>=?, ()) => arg; +let defaultJsxArg = (~arg:t(int)=, ()) => arg; +let defaultFalse = (~arg:t=!true, ()) => arg; +/* Doesn't work on master either let defaultTrue = (~arg:t= !!true) => arg; */ + +/** + * Things likely to conflict or impact precedence. + */ +let neg=-1; +let tru=!false; +let x = + "arbitrary" === "example" + && "how long" >= "can you get" + && "seriously" <= "what is the line length"; + +let z = 0; +module Conss = { + let (>-) = (a, b) => a + b; + let four = 3 >- 1; + let two = 3 >- -1; + let four' = 3 >- - - 1; + + let tr = 3 > - 1; + let tr' = 3 > - -1; + let tr'' = 3 > - - - 1; +} + +module Idents = { + let (>-) = (a, b) => a + b; + let four = z >- z; + let two = z >- -z; + let four' = z >- - - z; + + let tr = z > - z; + let tr' = z > - -z; + let tr'' = z > - - - z; +} diff --git a/test/typeParameters.t/run.t b/test/typeParameters.t/run.t new file mode 100644 index 000000000..df08f6c0b --- /dev/null +++ b/test/typeParameters.t/run.t @@ -0,0 +1,11 @@ +Format basic + $ refmt --print re ./input.re > ./formatted.re + +Type-check basics + $ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re + +Format the formatted file back + $ refmt --print re ./formatted.re > ./formatted_back.re + +Ensure idempotency: first format and second format are the same + $ diff formatted.re formatted_back.re diff --git a/test/uncurried.t/run.t b/test/uncurried.t/run.t index 11a5bd5f5..a4d347b3c 100644 --- a/test/uncurried.t/run.t +++ b/test/uncurried.t/run.t @@ -1,5 +1,5 @@ Format uncurried - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re f(.); [@attr] diff --git a/test/variants.t/run.t b/test/variants.t/run.t index 3cb2638b7..e0e57e394 100644 --- a/test/variants.t/run.t +++ b/test/variants.t/run.t @@ -1,5 +1,5 @@ Format variants - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ module LocalModule = { diff --git a/test/version.t b/test/version.t index a09478870..80a42082e 100644 --- a/test/version.t +++ b/test/version.t @@ -1,3 +1,3 @@ -Ensures refmt_iml.exe is in the right place - $ ../src/refmt/refmt_impl.exe --version; +Ensures refmt is in the right place + $ refmt --version Reason 3.7.0 @ b66ed1b diff --git a/test/whitespace-re.t/run.t b/test/whitespace-re.t/run.t index 6148841bf..83cc6f0c1 100644 --- a/test/whitespace-re.t/run.t +++ b/test/whitespace-re.t/run.t @@ -1,5 +1,5 @@ Format whitespace in .re files - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re module Test = { open Belt; open React; diff --git a/test/whitespace-rei.t/run.t b/test/whitespace-rei.t/run.t index c525e0e7c..f35d5f832 100644 --- a/test/whitespace-rei.t/run.t +++ b/test/whitespace-rei.t/run.t @@ -1,5 +1,5 @@ Format whitespace in .rei files - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.rei + $ refmt ./input.rei /** Interleave whitespace intelligently in signatures */ /* a */ diff --git a/test/wrapping-re.t/run.t b/test/wrapping-re.t/run.t index 0b3f74c03..e0dff470e 100644 --- a/test/wrapping-re.t/run.t +++ b/test/wrapping-re.t/run.t @@ -1,5 +1,5 @@ Format wrapping in .re files - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.re + $ refmt ./input.re /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ /* Run the formatting pretty printer with width 50 */ diff --git a/test/wrapping-rei.t/run.t b/test/wrapping-rei.t/run.t index fcf7a5ceb..db8a10cd8 100644 --- a/test/wrapping-rei.t/run.t +++ b/test/wrapping-rei.t/run.t @@ -1,5 +1,5 @@ Format wrapping in .rei files - $ ../../src/refmt/refmt_impl.exe --print-width 50 ./input.rei + $ refmt ./input.rei /* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ let named: (~a: int, ~b: int) => int; From e745752b8c6a8f3af2a89505b41989b95ca5b342 Mon Sep 17 00:00:00 2001 From: David Sancho Date: Sat, 25 Mar 2023 00:51:15 +0100 Subject: [PATCH 13/20] Remove old CI and test.sh (#2705) * Remove old tests * Remove miscTests * Remove azure * Remove CircleCI --- .ci/build-platform.yml | 82 - .ci/cross-release.yml | 34 - .ci/esy-build-steps.yml | 15 - .ci/opam-build-steps.yml | 40 - .ci/pipelines-release.js | 114 - .ci/release-platform-setup.yml | 16 - .ci/release-postinstall.js | 176 - .ci/utils/create-docs.yml | 16 - .ci/utils/publish-build-cache.yml | 37 - .ci/utils/restore-build-cache.yml | 101 - .ci/utils/use-esy.yml | 5 - .ci/utils/use-node.yml | 7 - .circleci/config.yml | 210 -- formatTest/.gitignore | 4 - formatTest/customMLFiles/README | 1 - .../errorTests/expected_output/comments1.re | 2 - .../expected_output/comments1.re.4.08.0 | 5 - .../expected_output/comments1.re.4.09.0 | 5 - .../expected_output/lowercase_module.re | 2 - .../lowercase_module.re.4.08.0 | 5 - .../lowercase_module.re.4.09.0 | 5 - .../expected_output/lowercase_module_rec.re | 2 - .../lowercase_module_rec.re.4.08.0 | 5 - .../lowercase_module_rec.re.4.09.0 | 5 - .../errorTests/expected_output/reserved.re | 2 - .../expected_output/reservedField.re | 2 - .../expected_output/reservedField.re.4.08.0 | 5 - .../expected_output/reservedField.re.4.09.0 | 5 - .../expected_output/reservedRecord.re | 2 - .../expected_output/reservedRecord.re.4.08.0 | 5 - .../expected_output/reservedRecord.re.4.09.0 | 5 - .../expected_output/reservedRecordPunned.re | 2 - .../reservedRecordPunned.re.4.08.0 | 5 - .../reservedRecordPunned.re.4.09.0 | 5 - .../expected_output/reservedRecordTy | 2 - .../expected_output/reservedRecordType.re | 2 - .../reservedRecordType.re.4.08.0 | 5 - .../reservedRecordType.re.4.09.0 | 5 - .../reservedRecordTypePunned.re | 2 - .../reservedRecordTypePunned.re.4.08.0 | 5 - .../reservedRecordTypePunned.re.4.09.0 | 5 - .../errorTests/expected_output/syntaxError.re | 2 - .../expected_output/syntaxError.re.4.07.1 | 2 - .../expected_output/syntaxError.re.4.08.0 | 5 - .../expected_output/syntaxError.re.4.09.0 | 5 - formatTest/errorTests/input/comments1.re | 1 - .../errorTests/input/lowercase_module.re | 1 - .../errorTests/input/lowercase_module_rec.re | 1 - formatTest/errorTests/input/reservedField.re | 1 - formatTest/errorTests/input/reservedRecord.re | 1 - .../errorTests/input/reservedRecordPunned.re | 1 - .../errorTests/input/reservedRecordType.re | 1 - .../input/reservedRecordTypePunned.re | 1 - formatTest/errorTests/input/syntaxError.re | 1 - .../expected_output/assert.crlf.re | 23 - .../idempotentTests/input/assert.crlf.re | 17 - .../oprintTests/expected_output/basic.re | 61 - .../oprintTests/expected_output/class.re | 20 - .../expected_output/inlineRecord.re | 6 - formatTest/oprintTests/input/basic.re | 142 - formatTest/oprintTests/input/class.re | 36 - formatTest/oprintTests/input/inlineRecord.re | 11 - formatTest/test.sh | 553 ---- .../expected_output/arityConversion.re | 54 - .../expected_output/attributes.4.04.0.re | 21 - .../expected_output/attributes.re | 825 ----- .../expected_output/attributes.rei | 82 - .../expected_output/basics.re | 137 - .../expected_output/basics_no_semi.re | 127 - .../expected_output/bigarraySyntax.re | 50 - .../expected_output/comments.re | 129 - .../expected_output/comments.rei | 39 - .../expected_output/comments.rei.4.07.0 | 39 - .../expected_output/comments.rei.4.07.1 | 39 - .../expected_output/comments.rei.4.08.0 | 39 - .../expected_output/comments.rei.4.09.0 | 39 - .../expected_output/features406.4.06.0.re | 27 - .../expected_output/features408.4.08.0.re | 19 - .../expected_output/features408.4.08.0.rei | 22 - .../expected_output/imperative.re | 95 - .../typeCheckedTests/expected_output/jsx.re | 584 ---- .../expected_output/knownMlIssues.re | 32 - .../expected_output/knownReIssues.re | 23 - .../typeCheckedTests/expected_output/lazy.re | 38 - .../typeCheckedTests/expected_output/letop.re | 44 - .../expected_output/mlSyntax.re | 115 - .../expected_output/mlVariants.re | 27 - .../expected_output/mlVariants.re.4.06.0 | 27 - .../expected_output/mlVariants.re.4.06.1 | 27 - .../expected_output/mlVariants.re.4.07.0 | 27 - .../expected_output/mlVariants.re.4.07.1 | 27 - .../expected_output/mlVariants.re.4.08.0 | 27 - .../expected_output/mlVariants.re.4.09.0 | 27 - .../expected_output/mutation.re | 57 - .../expected_output/newAST.4.06.0.re | 35 - .../typeCheckedTests/expected_output/oo.re | 433 --- .../expected_output/patternMatching.re | 312 -- .../expected_output/pervasive.rei | 5 - .../expected_output/pipeFirst.re | 183 -- .../expected_output/reasonComments.re | 756 ----- .../expected_output/reasonComments.rei | 3 - .../expected_output/sequences.re | 87 - .../specificMLSyntax.4.04.0.re | 15 - .../expected_output/trailing.re | 282 -- .../expected_output/typeParameters.re | 87 - formatTest/typeCheckedTests/input/arity.txt | 7 - .../typeCheckedTests/input/arityConversion.ml | 43 - .../input/attributes.4.04.0.re | 20 - .../typeCheckedTests/input/attributes.re | 664 ---- .../typeCheckedTests/input/attributes.rei | 73 - formatTest/typeCheckedTests/input/basics.re | 98 - .../typeCheckedTests/input/basics_no_semi.re | 88 - .../typeCheckedTests/input/bigarraySyntax.re | 27 - formatTest/typeCheckedTests/input/comments.ml | 128 - .../typeCheckedTests/input/comments.mli | 41 - .../input/features406.4.06.0.ml | 18 - .../input/features408.4.08.0.ml | 17 - .../input/features408.4.08.0.mli | 20 - .../typeCheckedTests/input/imperative.re | 76 - formatTest/typeCheckedTests/input/jsx.re | 458 --- .../typeCheckedTests/input/knownMlIssues.ml | 35 - .../typeCheckedTests/input/knownReIssues.re | 23 - formatTest/typeCheckedTests/input/lazy.re | 27 - formatTest/typeCheckedTests/input/letop.re | 28 - formatTest/typeCheckedTests/input/mlSyntax.ml | 86 - .../typeCheckedTests/input/mlVariants.ml | 26 - formatTest/typeCheckedTests/input/mutation.re | 49 - .../typeCheckedTests/input/newAST.4.06.0.re | 37 - formatTest/typeCheckedTests/input/oo.re | 334 -- .../typeCheckedTests/input/patternMatching.re | 266 -- .../typeCheckedTests/input/pervasive.mli | 5 - .../typeCheckedTests/input/pipeFirst.re | 168 - .../typeCheckedTests/input/reasonComments.re | 736 ----- .../typeCheckedTests/input/reasonComments.rei | 3 - .../typeCheckedTests/input/sequences.re | 81 - .../input/specificMLSyntax.4.04.0.ml | 14 - formatTest/typeCheckedTests/input/trailing.re | 182 -- .../typeCheckedTests/input/typeParameters.re | 80 - .../unit_tests/expected_output/assert.re | 23 - .../expected_output/basicStructures.re | 852 ----- .../unit_tests/expected_output/bigarray.re | 39 - .../expected_output/bucklescript.re | 124 - .../unit_tests/expected_output/class_types.re | 38 - .../expected_output/emptyFileComment.re | 1 - .../expected_output/escapesInStrings.re | 15 - .../unit_tests/expected_output/extensions.re | 376 --- .../unit_tests/expected_output/externals.re | 34 - .../unit_tests/expected_output/features403.re | 46 - .../expected_output/firstClassModules.re | 100 - .../unit_tests/expected_output/fixme.re | 9 - .../expected_output/functionInfix.re | 60 - formatTest/unit_tests/expected_output/if.re | 222 -- .../unit_tests/expected_output/infix.re | 1326 -------- formatTest/unit_tests/expected_output/jsx.re | 727 ----- .../unit_tests/expected_output/jsx_functor.re | 41 - .../expected_output/lineComments.re | 762 ----- .../unit_tests/expected_output/modules.re | 646 ---- .../expected_output/modules_no_semi.re | 651 ---- .../unit_tests/expected_output/object.re | 85 - .../expected_output/ocaml_identifiers.re | 111 - .../unit_tests/expected_output/pexpFun.re | 89 - .../unit_tests/expected_output/pipeFirst.re | 213 -- .../expected_output/polymorphism.re | 113 - .../unit_tests/expected_output/sharpop.re | 23 - .../expected_output/singleLineCommentEof.re | 1 - .../unit_tests/expected_output/syntax.re | 1462 --------- .../unit_tests/expected_output/syntax.rei | 48 - .../unit_tests/expected_output/testUtils.re | 9 - .../unit_tests/expected_output/trailing.re | 31 - .../expected_output/trailingSpaces.re | 7 - .../expected_output/typeDeclarations.re | 128 - .../unit_tests/expected_output/uncurried.re | 195 -- .../unit_tests/expected_output/variants.re | 692 ---- .../unit_tests/expected_output/whitespace.re | 496 --- .../unit_tests/expected_output/whitespace.rei | 274 -- .../expected_output/wrappingTest.re | 2900 ----------------- .../expected_output/wrappingTest.rei | 70 - formatTest/unit_tests/input/arity.txt | 0 formatTest/unit_tests/input/assert.re | 17 - .../unit_tests/input/basicStructures.re | 698 ---- formatTest/unit_tests/input/bigarray.re | 13 - formatTest/unit_tests/input/bucklescript.re | 95 - formatTest/unit_tests/input/class_types.re | 37 - .../unit_tests/input/emptyFileComment.re | 1 - .../unit_tests/input/escapesInStrings.re | 15 - formatTest/unit_tests/input/extensions.re | 374 --- formatTest/unit_tests/input/externals.re | 27 - formatTest/unit_tests/input/features403.re | 32 - .../unit_tests/input/firstClassModules.re | 50 - formatTest/unit_tests/input/fixme.re | 9 - formatTest/unit_tests/input/functionInfix.re | 65 - formatTest/unit_tests/input/if.re | 206 -- formatTest/unit_tests/input/infix.re | 1013 ------ formatTest/unit_tests/input/jsx.re | 580 ---- formatTest/unit_tests/input/jsx_functor.re | 33 - formatTest/unit_tests/input/lineComments.re | 739 ----- formatTest/unit_tests/input/modules.re | 490 --- .../unit_tests/input/modules_no_semi.re | 501 --- formatTest/unit_tests/input/object.re | 82 - .../unit_tests/input/ocaml_identifiers.ml | 95 - formatTest/unit_tests/input/pexpFun.re | 77 - formatTest/unit_tests/input/pipeFirst.re | 174 - formatTest/unit_tests/input/polymorphism.re | 83 - formatTest/unit_tests/input/sharpop.re | 23 - .../unit_tests/input/singleLineCommentEof.re | 1 - formatTest/unit_tests/input/syntax.re | 1278 -------- formatTest/unit_tests/input/syntax.rei | 41 - formatTest/unit_tests/input/testUtils.re | 9 - formatTest/unit_tests/input/trailing.re | 73 - formatTest/unit_tests/input/trailingSpaces.re | 6 - .../unit_tests/input/typeDeclarations.re | 62 - formatTest/unit_tests/input/uncurried.re | 178 - formatTest/unit_tests/input/variants.re | 429 --- formatTest/unit_tests/input/whitespace.re | 464 --- formatTest/unit_tests/input/whitespace.rei | 276 -- formatTest/unit_tests/input/wrappingTest.re | 1984 ----------- formatTest/unit_tests/input/wrappingTest.rei | 60 - miscTests/backportSyntaxTests.sh | 13 - miscTests/backport_syntax_tests/basic.re | 21 - .../reactjs_jsx_ppx_tests/expected_v2_1.re | 228 -- .../reactjs_jsx_ppx_tests/expected_v2_2.re | 229 -- miscTests/reactjs_jsx_ppx_tests/test1.re | 153 - miscTests/reactjs_jsx_ppx_tests/test2.re | 153 - miscTests/rtopIntegrationTest.sh | 35 - 224 files changed, 35132 deletions(-) delete mode 100644 .ci/build-platform.yml delete mode 100644 .ci/cross-release.yml delete mode 100644 .ci/esy-build-steps.yml delete mode 100644 .ci/opam-build-steps.yml delete mode 100644 .ci/pipelines-release.js delete mode 100644 .ci/release-platform-setup.yml delete mode 100644 .ci/release-postinstall.js delete mode 100644 .ci/utils/create-docs.yml delete mode 100644 .ci/utils/publish-build-cache.yml delete mode 100644 .ci/utils/restore-build-cache.yml delete mode 100644 .ci/utils/use-esy.yml delete mode 100644 .ci/utils/use-node.yml delete mode 100644 .circleci/config.yml delete mode 100644 formatTest/.gitignore delete mode 100644 formatTest/customMLFiles/README delete mode 100644 formatTest/errorTests/expected_output/comments1.re delete mode 100644 formatTest/errorTests/expected_output/comments1.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/comments1.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/lowercase_module.re delete mode 100644 formatTest/errorTests/expected_output/lowercase_module.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/lowercase_module.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/lowercase_module_rec.re delete mode 100644 formatTest/errorTests/expected_output/lowercase_module_rec.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/lowercase_module_rec.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/reserved.re delete mode 100644 formatTest/errorTests/expected_output/reservedField.re delete mode 100644 formatTest/errorTests/expected_output/reservedField.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/reservedField.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecord.re delete mode 100644 formatTest/errorTests/expected_output/reservedRecord.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecord.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecordPunned.re delete mode 100644 formatTest/errorTests/expected_output/reservedRecordPunned.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecordPunned.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecordTy delete mode 100644 formatTest/errorTests/expected_output/reservedRecordType.re delete mode 100644 formatTest/errorTests/expected_output/reservedRecordType.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecordType.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecordTypePunned.re delete mode 100644 formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.09.0 delete mode 100644 formatTest/errorTests/expected_output/syntaxError.re delete mode 100644 formatTest/errorTests/expected_output/syntaxError.re.4.07.1 delete mode 100644 formatTest/errorTests/expected_output/syntaxError.re.4.08.0 delete mode 100644 formatTest/errorTests/expected_output/syntaxError.re.4.09.0 delete mode 100644 formatTest/errorTests/input/comments1.re delete mode 100644 formatTest/errorTests/input/lowercase_module.re delete mode 100644 formatTest/errorTests/input/lowercase_module_rec.re delete mode 100644 formatTest/errorTests/input/reservedField.re delete mode 100644 formatTest/errorTests/input/reservedRecord.re delete mode 100644 formatTest/errorTests/input/reservedRecordPunned.re delete mode 100644 formatTest/errorTests/input/reservedRecordType.re delete mode 100644 formatTest/errorTests/input/reservedRecordTypePunned.re delete mode 100644 formatTest/errorTests/input/syntaxError.re delete mode 100644 formatTest/idempotentTests/expected_output/assert.crlf.re delete mode 100644 formatTest/idempotentTests/input/assert.crlf.re delete mode 100644 formatTest/oprintTests/expected_output/basic.re delete mode 100644 formatTest/oprintTests/expected_output/class.re delete mode 100644 formatTest/oprintTests/expected_output/inlineRecord.re delete mode 100644 formatTest/oprintTests/input/basic.re delete mode 100644 formatTest/oprintTests/input/class.re delete mode 100644 formatTest/oprintTests/input/inlineRecord.re delete mode 100755 formatTest/test.sh delete mode 100644 formatTest/typeCheckedTests/expected_output/arityConversion.re delete mode 100644 formatTest/typeCheckedTests/expected_output/attributes.4.04.0.re delete mode 100644 formatTest/typeCheckedTests/expected_output/attributes.re delete mode 100644 formatTest/typeCheckedTests/expected_output/attributes.rei delete mode 100644 formatTest/typeCheckedTests/expected_output/basics.re delete mode 100644 formatTest/typeCheckedTests/expected_output/basics_no_semi.re delete mode 100644 formatTest/typeCheckedTests/expected_output/bigarraySyntax.re delete mode 100644 formatTest/typeCheckedTests/expected_output/comments.re delete mode 100644 formatTest/typeCheckedTests/expected_output/comments.rei delete mode 100644 formatTest/typeCheckedTests/expected_output/comments.rei.4.07.0 delete mode 100644 formatTest/typeCheckedTests/expected_output/comments.rei.4.07.1 delete mode 100644 formatTest/typeCheckedTests/expected_output/comments.rei.4.08.0 delete mode 100644 formatTest/typeCheckedTests/expected_output/comments.rei.4.09.0 delete mode 100644 formatTest/typeCheckedTests/expected_output/features406.4.06.0.re delete mode 100644 formatTest/typeCheckedTests/expected_output/features408.4.08.0.re delete mode 100644 formatTest/typeCheckedTests/expected_output/features408.4.08.0.rei delete mode 100644 formatTest/typeCheckedTests/expected_output/imperative.re delete mode 100644 formatTest/typeCheckedTests/expected_output/jsx.re delete mode 100644 formatTest/typeCheckedTests/expected_output/knownMlIssues.re delete mode 100644 formatTest/typeCheckedTests/expected_output/knownReIssues.re delete mode 100644 formatTest/typeCheckedTests/expected_output/lazy.re delete mode 100644 formatTest/typeCheckedTests/expected_output/letop.re delete mode 100644 formatTest/typeCheckedTests/expected_output/mlSyntax.re delete mode 100644 formatTest/typeCheckedTests/expected_output/mlVariants.re delete mode 100644 formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.0 delete mode 100644 formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.1 delete mode 100644 formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.0 delete mode 100644 formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.1 delete mode 100644 formatTest/typeCheckedTests/expected_output/mlVariants.re.4.08.0 delete mode 100644 formatTest/typeCheckedTests/expected_output/mlVariants.re.4.09.0 delete mode 100644 formatTest/typeCheckedTests/expected_output/mutation.re delete mode 100644 formatTest/typeCheckedTests/expected_output/newAST.4.06.0.re delete mode 100644 formatTest/typeCheckedTests/expected_output/oo.re delete mode 100644 formatTest/typeCheckedTests/expected_output/patternMatching.re delete mode 100644 formatTest/typeCheckedTests/expected_output/pervasive.rei delete mode 100644 formatTest/typeCheckedTests/expected_output/pipeFirst.re delete mode 100644 formatTest/typeCheckedTests/expected_output/reasonComments.re delete mode 100644 formatTest/typeCheckedTests/expected_output/reasonComments.rei delete mode 100644 formatTest/typeCheckedTests/expected_output/sequences.re delete mode 100644 formatTest/typeCheckedTests/expected_output/specificMLSyntax.4.04.0.re delete mode 100644 formatTest/typeCheckedTests/expected_output/trailing.re delete mode 100644 formatTest/typeCheckedTests/expected_output/typeParameters.re delete mode 100644 formatTest/typeCheckedTests/input/arity.txt delete mode 100644 formatTest/typeCheckedTests/input/arityConversion.ml delete mode 100644 formatTest/typeCheckedTests/input/attributes.4.04.0.re delete mode 100644 formatTest/typeCheckedTests/input/attributes.re delete mode 100644 formatTest/typeCheckedTests/input/attributes.rei delete mode 100644 formatTest/typeCheckedTests/input/basics.re delete mode 100644 formatTest/typeCheckedTests/input/basics_no_semi.re delete mode 100644 formatTest/typeCheckedTests/input/bigarraySyntax.re delete mode 100644 formatTest/typeCheckedTests/input/comments.ml delete mode 100644 formatTest/typeCheckedTests/input/comments.mli delete mode 100644 formatTest/typeCheckedTests/input/features406.4.06.0.ml delete mode 100644 formatTest/typeCheckedTests/input/features408.4.08.0.ml delete mode 100644 formatTest/typeCheckedTests/input/features408.4.08.0.mli delete mode 100644 formatTest/typeCheckedTests/input/imperative.re delete mode 100644 formatTest/typeCheckedTests/input/jsx.re delete mode 100644 formatTest/typeCheckedTests/input/knownMlIssues.ml delete mode 100644 formatTest/typeCheckedTests/input/knownReIssues.re delete mode 100644 formatTest/typeCheckedTests/input/lazy.re delete mode 100644 formatTest/typeCheckedTests/input/letop.re delete mode 100644 formatTest/typeCheckedTests/input/mlSyntax.ml delete mode 100644 formatTest/typeCheckedTests/input/mlVariants.ml delete mode 100644 formatTest/typeCheckedTests/input/mutation.re delete mode 100644 formatTest/typeCheckedTests/input/newAST.4.06.0.re delete mode 100644 formatTest/typeCheckedTests/input/oo.re delete mode 100644 formatTest/typeCheckedTests/input/patternMatching.re delete mode 100644 formatTest/typeCheckedTests/input/pervasive.mli delete mode 100644 formatTest/typeCheckedTests/input/pipeFirst.re delete mode 100644 formatTest/typeCheckedTests/input/reasonComments.re delete mode 100644 formatTest/typeCheckedTests/input/reasonComments.rei delete mode 100644 formatTest/typeCheckedTests/input/sequences.re delete mode 100644 formatTest/typeCheckedTests/input/specificMLSyntax.4.04.0.ml delete mode 100644 formatTest/typeCheckedTests/input/trailing.re delete mode 100644 formatTest/typeCheckedTests/input/typeParameters.re delete mode 100644 formatTest/unit_tests/expected_output/assert.re delete mode 100644 formatTest/unit_tests/expected_output/basicStructures.re delete mode 100644 formatTest/unit_tests/expected_output/bigarray.re delete mode 100644 formatTest/unit_tests/expected_output/bucklescript.re delete mode 100644 formatTest/unit_tests/expected_output/class_types.re delete mode 100644 formatTest/unit_tests/expected_output/emptyFileComment.re delete mode 100644 formatTest/unit_tests/expected_output/escapesInStrings.re delete mode 100644 formatTest/unit_tests/expected_output/extensions.re delete mode 100644 formatTest/unit_tests/expected_output/externals.re delete mode 100644 formatTest/unit_tests/expected_output/features403.re delete mode 100644 formatTest/unit_tests/expected_output/firstClassModules.re delete mode 100644 formatTest/unit_tests/expected_output/fixme.re delete mode 100644 formatTest/unit_tests/expected_output/functionInfix.re delete mode 100644 formatTest/unit_tests/expected_output/if.re delete mode 100644 formatTest/unit_tests/expected_output/infix.re delete mode 100644 formatTest/unit_tests/expected_output/jsx.re delete mode 100644 formatTest/unit_tests/expected_output/jsx_functor.re delete mode 100644 formatTest/unit_tests/expected_output/lineComments.re delete mode 100644 formatTest/unit_tests/expected_output/modules.re delete mode 100644 formatTest/unit_tests/expected_output/modules_no_semi.re delete mode 100644 formatTest/unit_tests/expected_output/object.re delete mode 100644 formatTest/unit_tests/expected_output/ocaml_identifiers.re delete mode 100644 formatTest/unit_tests/expected_output/pexpFun.re delete mode 100644 formatTest/unit_tests/expected_output/pipeFirst.re delete mode 100644 formatTest/unit_tests/expected_output/polymorphism.re delete mode 100644 formatTest/unit_tests/expected_output/sharpop.re delete mode 100644 formatTest/unit_tests/expected_output/singleLineCommentEof.re delete mode 100644 formatTest/unit_tests/expected_output/syntax.re delete mode 100644 formatTest/unit_tests/expected_output/syntax.rei delete mode 100644 formatTest/unit_tests/expected_output/testUtils.re delete mode 100644 formatTest/unit_tests/expected_output/trailing.re delete mode 100644 formatTest/unit_tests/expected_output/trailingSpaces.re delete mode 100644 formatTest/unit_tests/expected_output/typeDeclarations.re delete mode 100644 formatTest/unit_tests/expected_output/uncurried.re delete mode 100644 formatTest/unit_tests/expected_output/variants.re delete mode 100644 formatTest/unit_tests/expected_output/whitespace.re delete mode 100644 formatTest/unit_tests/expected_output/whitespace.rei delete mode 100644 formatTest/unit_tests/expected_output/wrappingTest.re delete mode 100644 formatTest/unit_tests/expected_output/wrappingTest.rei delete mode 100644 formatTest/unit_tests/input/arity.txt delete mode 100644 formatTest/unit_tests/input/assert.re delete mode 100644 formatTest/unit_tests/input/basicStructures.re delete mode 100644 formatTest/unit_tests/input/bigarray.re delete mode 100644 formatTest/unit_tests/input/bucklescript.re delete mode 100644 formatTest/unit_tests/input/class_types.re delete mode 100644 formatTest/unit_tests/input/emptyFileComment.re delete mode 100755 formatTest/unit_tests/input/escapesInStrings.re delete mode 100644 formatTest/unit_tests/input/extensions.re delete mode 100644 formatTest/unit_tests/input/externals.re delete mode 100644 formatTest/unit_tests/input/features403.re delete mode 100644 formatTest/unit_tests/input/firstClassModules.re delete mode 100644 formatTest/unit_tests/input/fixme.re delete mode 100644 formatTest/unit_tests/input/functionInfix.re delete mode 100644 formatTest/unit_tests/input/if.re delete mode 100644 formatTest/unit_tests/input/infix.re delete mode 100644 formatTest/unit_tests/input/jsx.re delete mode 100644 formatTest/unit_tests/input/jsx_functor.re delete mode 100644 formatTest/unit_tests/input/lineComments.re delete mode 100644 formatTest/unit_tests/input/modules.re delete mode 100644 formatTest/unit_tests/input/modules_no_semi.re delete mode 100644 formatTest/unit_tests/input/object.re delete mode 100644 formatTest/unit_tests/input/ocaml_identifiers.ml delete mode 100644 formatTest/unit_tests/input/pexpFun.re delete mode 100644 formatTest/unit_tests/input/pipeFirst.re delete mode 100644 formatTest/unit_tests/input/polymorphism.re delete mode 100644 formatTest/unit_tests/input/sharpop.re delete mode 100644 formatTest/unit_tests/input/singleLineCommentEof.re delete mode 100644 formatTest/unit_tests/input/syntax.re delete mode 100644 formatTest/unit_tests/input/syntax.rei delete mode 100644 formatTest/unit_tests/input/testUtils.re delete mode 100644 formatTest/unit_tests/input/trailing.re delete mode 100755 formatTest/unit_tests/input/trailingSpaces.re delete mode 100644 formatTest/unit_tests/input/typeDeclarations.re delete mode 100644 formatTest/unit_tests/input/uncurried.re delete mode 100644 formatTest/unit_tests/input/variants.re delete mode 100644 formatTest/unit_tests/input/whitespace.re delete mode 100644 formatTest/unit_tests/input/whitespace.rei delete mode 100644 formatTest/unit_tests/input/wrappingTest.re delete mode 100644 formatTest/unit_tests/input/wrappingTest.rei delete mode 100755 miscTests/backportSyntaxTests.sh delete mode 100644 miscTests/backport_syntax_tests/basic.re delete mode 100644 miscTests/reactjs_jsx_ppx_tests/expected_v2_1.re delete mode 100644 miscTests/reactjs_jsx_ppx_tests/expected_v2_2.re delete mode 100644 miscTests/reactjs_jsx_ppx_tests/test1.re delete mode 100644 miscTests/reactjs_jsx_ppx_tests/test2.re delete mode 100755 miscTests/rtopIntegrationTest.sh diff --git a/.ci/build-platform.yml b/.ci/build-platform.yml deleted file mode 100644 index cd833fdc7..000000000 --- a/.ci/build-platform.yml +++ /dev/null @@ -1,82 +0,0 @@ -parameters: - platform: "macOS" - vmImage: "macOS-10.13" - -jobs: - - job: ${{ parameters.platform }} - pool: - vmImage: ${{ parameters.vmImage }} - demands: node.js - timeoutInMinutes: 120 # This is mostly for Windows - steps: - - powershell: $Env:Path - continueOnError: true - condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: "Print env in powershell" - # Needed so that the mingw tar doesn't shadow the system tar. See - # pipelines.yaml. We need windows bsdtar from system32, not the mingw - # one. Note powershell doesn't need escaping of backslashes. - - powershell: Write-Host "##vso[task.setvariable variable=PATH;]C:\Program Files\Git\bin;C:\Windows\system32;${env:PATH}" - continueOnError: true - condition: eq(variables['AGENT.OS'], 'Windows_NT') - displayName: "Make sure C:/Program Files/Git/bin and windows/system32 is at front of path if windows" - - powershell: $Env:Path - continueOnError: true - condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: "Print env in powershell" - - powershell: get-command tar - continueOnError: true - condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: "Print where tar is located" - - powershell: tar --help - continueOnError: true - condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: "Print tar help" - - bash: | - # COMPUTE THE ESY INSTALL CACHE LOCATION AHEAD OF TIME - DESIRED_LEN="86" - HOME_ESY3="$HOME/.esy/3" - HOME_ESY3_LEN=${#HOME_ESY3} - NUM_UNDERS=$(echo "$(($DESIRED_LEN-$HOME_ESY3_LEN))") - UNDERS=$(bash -c "printf '_%.0s' {1..${NUM_UNDERS}}") - THE_ESY__CACHE_INSTALL_PATH=${HOME_ESY3}${UNDERS}/i - if [ "$AGENT_OS" == "Windows_NT" ]; then - THE_ESY__CACHE_INSTALL_PATH=$( cygpath --mixed --absolute "$THE_ESY__CACHE_INSTALL_PATH") - fi - echo "THE_ESY__CACHE_INSTALL_PATH: $THE_ESY__CACHE_INSTALL_PATH" - # This will be exposed as an env var ESY__CACHE_INSTALL_PATH, or an - # Azure var esy__cache_install_path - echo "##vso[task.setvariable variable=esy__cache_install_path]$THE_ESY__CACHE_INSTALL_PATH" - # - bash: | - # which esy - # echo "$( which esy )" - # echo "##vso[task.setvariable variable=esy_bin_location]$(which esy)" - # displayName: "Find esy binary" - # - bash: echo ${ESY_BIN_LOCATION} - # displayName: "Print esy bin location" - - bash: env - displayName: "Print environment" - - template: utils/use-node.yml - - template: utils/use-esy.yml - - script: "esy install" - displayName: "esy install" - - template: utils/restore-build-cache.yml - - script: "esy build" - displayName: "esy build" - - template: utils/create-docs.yml - - script: "esy test" - displayName: "Test command" - - script: "esy b dune runtest -p reason,rtop" - displayName: "Cram tests command" - - powershell: esy x env - continueOnError: true - condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: "Print exported env in powershell" - - script: "esy release" - displayName: "esy release" - - template: utils/publish-build-cache.yml - - task: PublishBuildArtifacts@1 - displayName: "Publish Artifact: ${{ parameters.platform }}" - inputs: - PathtoPublish: "_release" - ArtifactName: ${{ parameters.platform }} diff --git a/.ci/cross-release.yml b/.ci/cross-release.yml deleted file mode 100644 index cb4651575..000000000 --- a/.ci/cross-release.yml +++ /dev/null @@ -1,34 +0,0 @@ -steps: - - template: utils/use-node.yml - - - script: "mkdir _release" - displayName: "Create _release dir" - - - template: release-platform-setup.yml - parameters: - platform: "Linux" - folder: "platform-linux" - - - template: release-platform-setup.yml - parameters: - platform: "macOS" - folder: "platform-darwin" - - - template: release-platform-setup.yml - parameters: - platform: "Windows" - folder: "platform-windows-x64" - - - script: "node .ci/pipelines-release.js" - displayName: "node .ci/pipelines-release.js" - continueOnError: true - - - script: "npm pack ." - displayName: "npm pack" - workingDirectory: "_release" - - - task: PublishBuildArtifacts@1 - displayName: "Publish Artifact: Release" - inputs: - PathtoPublish: "_release" - ArtifactName: Release diff --git a/.ci/esy-build-steps.yml b/.ci/esy-build-steps.yml deleted file mode 100644 index 7c63d636e..000000000 --- a/.ci/esy-build-steps.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Cross-platform set of build steps for building esy projects - -steps: - - template: utils/use-node.yml - - template: utils/use-esy.yml - - template: utils/restore-build-cache.yml - - script: esy install - displayName: 'esy install' - - script: esy build - displayName: 'esy build' - - template: utils/publish-build-cache.yml - - script: esy x refmt --version - displayName: 'esy x refmt --version' - # Run tests or any additional steps here - # - script: esy b dune runtest diff --git a/.ci/opam-build-steps.yml b/.ci/opam-build-steps.yml deleted file mode 100644 index 76d440f06..000000000 --- a/.ci/opam-build-steps.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Shared steps for building OPAM projects - -steps: - - task: NodeTool@0 - inputs: - versionSpec: '8.9' - - script: brew install gpatch - displayName: 'brew install gpatch' - - script: brew install opam - displayName: 'brew install opam' - - script: opam --version - displayName: 'Check opam version' - - script: opam init --bare --auto-setup --dot-profile=~/.bash_profile - displayName: 'opam init' - - script: opam remote add ocamlorg https://opam.ocaml.org || true - displayName: 'opam remote add ocamlorg' - - script: opam remove default || true - displayName: 'opam remove default' - - script: opam update - displayName: 'opam update' - - script: opam switch create $(OCAML_VERSION) - displayName: 'Use OCaml version: $(OCAML_VERSION)' - - script: opam install -y dune - displayName: 'opam install -y dune' - - script: opam install -y menhir - displayName: 'opam install -y menhir' - - script: opam install -y utop - displayName: 'opam install -y utop' - - script: make clean-for-ci - displayName: 'make clean-for-ci' - - script: opam pin add -y reason . - displayName: "opam pin add -y reason ." - - script: opam pin add -y rtop . - displayName: "opam pin add -y rtop ." - - script: eval $(opam env); make test-ci - displayName: "make test-ci" - - script: eval $(opam env); dune runtest - displayName: "dune runtest" - - script: git diff --exit-code - displayName: "Check git is clean" diff --git a/.ci/pipelines-release.js b/.ci/pipelines-release.js deleted file mode 100644 index 0f75a7a07..000000000 --- a/.ci/pipelines-release.js +++ /dev/null @@ -1,114 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -console.log("Creating package.json"); - -// From the project root pwd -const mainPackageJsonPath = - fs.existsSync('esy.json') ? - 'esy.json' : 'package.json'; - -const exists = fs.existsSync(mainPackageJsonPath); -if (!exists) { - console.error("No package.json or esy.json at " + mainPackageJsonPath); - process.exit(1); -} -// Now require from this script's location. -const mainPackageJson = require(path.join('..', mainPackageJsonPath)); -const bins = - Array.isArray(mainPackageJson.esy.release.bin) ? - mainPackageJson.esy.release.bin.reduce( - (acc, curr) => Object.assign({ [curr]: "bin/" + curr }, acc), - {} - ) : - Object.keys(mainPackageJson.esy.release.bin).reduce( - (acc, currKey) => Object.assign({ [currKey]: "bin/" + mainPackageJson.esy.release.bin[currKey] }, acc), - {} - ); - -const rewritePrefix = - mainPackageJson.esy && - mainPackageJson.esy.release && - mainPackageJson.esy.release.rewritePrefix; - -const packageJson = JSON.stringify( - { - name: mainPackageJson.name, - version: mainPackageJson.version, - license: mainPackageJson.license, - description: mainPackageJson.description, - repository: mainPackageJson.repository, - scripts: { - postinstall: - rewritePrefix ? - "node -e \"process.env.ESY_RELEASE_REWRITE_PREFIX=true.toString(); require('./postinstall.js')\"" : - "node ./postinstall.js" - }, - bin: bins, - files: [ - "_export/", - "bin/", - "postinstall.js", - "esyInstallRelease.js", - "platform-linux/", - "platform-darwin/", - "platform-windows-x64/" - ] - }, - null, - 2 -); - -fs.writeFileSync( - path.join(__dirname, "..", "_release", "package.json"), - packageJson, - { - encoding: "utf8" - } -); - -try { - console.log("Copying LICENSE"); - fs.copyFileSync( - path.join(__dirname, "..", "LICENSE"), - path.join(__dirname, "..", "_release", "LICENSE") - ); -} catch (e) { - console.warn("No LICENSE found"); -} - -console.log("Copying README.md"); -fs.copyFileSync( - path.join(__dirname, "..", "README.md"), - path.join(__dirname, "..", "_release", "README.md") -); - -console.log("Copying postinstall.js"); -fs.copyFileSync( - path.join(__dirname, "release-postinstall.js"), - path.join(__dirname, "..", "_release", "postinstall.js") -); - -console.log("Creating placeholder files"); -const placeholderFile = `:; echo "You need to have postinstall enabled"; exit $? -@ECHO OFF -ECHO You need to have postinstall enabled`; -fs.mkdirSync(path.join(__dirname, "..", "_release", "bin")); - -Object.keys(bins).forEach( - name => { - if(bins[name]) { - const binPath = path.join( - __dirname, - "..", - "_release", - bins[name] - ); - fs.writeFileSync(binPath, placeholderFile); - fs.chmodSync(binPath, 0777); - } else { - console.log("bins[name] name=" + name + " was empty. Weird."); - console.log(bins); - } - } -); diff --git a/.ci/release-platform-setup.yml b/.ci/release-platform-setup.yml deleted file mode 100644 index 38a978195..000000000 --- a/.ci/release-platform-setup.yml +++ /dev/null @@ -1,16 +0,0 @@ -parameters: - platform: "macOS" - folder: "platform-darwin" - -steps: - - task: DownloadBuildArtifacts@0 - displayName: "Download ${{ parameters.platform }} Artifacts" - inputs: - artifactName: ${{ parameters.platform }} - downloadPath: $(Build.StagingDirectory) - - - script: "mkdir _release/${{ parameters.folder }}" - displayName: "Create _release/${{ parameters.folder }}" - - - script: "cp -r $(Build.StagingDirectory)/${{ parameters.platform }}/ _release/${{ parameters.folder }}" - displayName: "cp ${{ parameters.platform }}" diff --git a/.ci/release-postinstall.js b/.ci/release-postinstall.js deleted file mode 100644 index 4c06c223c..000000000 --- a/.ci/release-postinstall.js +++ /dev/null @@ -1,176 +0,0 @@ -/** - * release-postinstall.js - * - * XXX: We want to keep this script installable at least with node 4.x. - * - * This script is bundled with the `npm` package and executed on release. - * Since we have a 'fat' NPM package (with all platform binaries bundled), - * this postinstall script extracts them and puts the current platform's - * bits in the right place. - */ - -var path = require("path"); -var cp = require("child_process"); -var fs = require("fs"); -var os = require("os"); -var platform = process.platform; - -var packageJson = require("./package.json"); -var binariesToCopy = Object.keys(packageJson.bin) - .map(function(name) { - return packageJson.bin[name]; - }) - .concat(["esyInstallRelease.js"]); -var foldersToCopy = ["bin", "_export"]; - -function copyRecursive(srcDir, dstDir) { - var results = []; - var list = fs.readdirSync(srcDir); - var src, dst; - list.forEach(function(file) { - src = path.join(srcDir, file); - dst = path.join(dstDir, file); - - var stat = fs.statSync(src); - if (stat && stat.isDirectory()) { - try { - fs.mkdirSync(dst); - } catch (e) { - console.log("directory already exists: " + dst); - console.error(e); - } - results = results.concat(copyRecursive(src, dst)); - } else { - try { - fs.writeFileSync(dst, fs.readFileSync(src)); - } catch (e) { - console.log("could't copy file: " + dst); - console.error(e); - } - results.push(src); - } - }); - return results; -} - -/** - * Since os.arch returns node binary's target arch, not - * the system arch. - * Credits: https://github.com/feross/arch/blob/af080ff61346315559451715c5393d8e86a6d33c/index.js#L10-L58 - */ - -function arch() { - /** - * The running binary is 64-bit, so the OS is clearly 64-bit. - */ - if (process.arch === "x64") { - return "x64"; - } - - /** - * All recent versions of Mac OS are 64-bit. - */ - if (process.platform === "darwin") { - return "x64"; - } - - /** - * On Windows, the most reliable way to detect a 64-bit OS from within a 32-bit - * app is based on the presence of a WOW64 file: %SystemRoot%\SysNative. - * See: https://twitter.com/feross/status/776949077208510464 - */ - if (process.platform === "win32") { - var useEnv = false; - try { - useEnv = !!( - process.env.SYSTEMROOT && fs.statSync(process.env.SYSTEMROOT) - ); - } catch (err) {} - - var sysRoot = useEnv ? process.env.SYSTEMROOT : "C:\\Windows"; - - // If %SystemRoot%\SysNative exists, we are in a WOW64 FS Redirected application. - var isWOW64 = false; - try { - isWOW64 = !!fs.statSync(path.join(sysRoot, "sysnative")); - } catch (err) {} - - return isWOW64 ? "x64" : "x86"; - } - - /** - * On Linux, use the `getconf` command to get the architecture. - */ - if (process.platform === "linux") { - var output = cp.execSync("getconf LONG_BIT", { encoding: "utf8" }); - return output === "64\n" ? "x64" : "x86"; - } - - /** - * If none of the above, assume the architecture is 32-bit. - */ - return "x86"; -} - -// implementing it b/c we don't want to depend on fs.copyFileSync which appears -// only in node@8.x -function copyFileSync(sourcePath, destPath) { - var data; - try { - data = fs.readFileSync(sourcePath); - } catch (e) { - console.log("Couldn't find " + sourcePath + " trying with .exe"); - data = fs.readFileSync(sourcePath + ".exe"); - sourcePath = sourcePath + ".exe"; - } - var stat = fs.statSync(sourcePath); - fs.writeFileSync(destPath, data); - fs.chmodSync(destPath, stat.mode); -} - -var copyPlatformBinaries = platformPath => { - var platformBuildPath = path.join(__dirname, "platform-" + platformPath); - - foldersToCopy.forEach(folderPath => { - var sourcePath = path.join(platformBuildPath, folderPath); - var destPath = path.join(__dirname, folderPath); - - copyRecursive(sourcePath, destPath); - }); - - binariesToCopy.forEach(binaryPath => { - var sourcePath = path.join(platformBuildPath, binaryPath); - var destPath = path.join(__dirname, binaryPath); - if (fs.existsSync(destPath)) { - fs.unlinkSync(destPath); - } - copyFileSync(sourcePath, destPath); - fs.chmodSync(destPath, 0777); - }); -}; - -try { - fs.mkdirSync("_export"); -} catch (e) { - console.log("Could not create _export folder"); -} - -switch (platform) { - case "win32": - if (arch() !== "x64") { - console.warn("error: x86 is currently not supported on Windows"); - process.exit(1); - } - - copyPlatformBinaries("windows-x64"); - break; - case "linux": - case "darwin": - copyPlatformBinaries(platform); - break; - default: - console.warn("error: no release built for the " + platform + " platform"); - process.exit(1); -} - -require("./esyInstallRelease"); diff --git a/.ci/utils/create-docs.yml b/.ci/utils/create-docs.yml deleted file mode 100644 index 90d009719..000000000 --- a/.ci/utils/create-docs.yml +++ /dev/null @@ -1,16 +0,0 @@ -# These steps are only run on Linux -steps: - - script: "esy doc" - displayName: "Build docs" - condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) - - - script: echo '##vso[task.setvariable variable=docsPath]'$(esy echo '#{self.target_dir}/default/_doc/_html') - displayName: "Save docsPath in variable" - condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) - - - task: PublishBuildArtifacts@1 - displayName: "Publish Artifact: Docs" - condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) - inputs: - PathtoPublish: $(docsPath) - ArtifactName: Docs diff --git a/.ci/utils/publish-build-cache.yml b/.ci/utils/publish-build-cache.yml deleted file mode 100644 index 2d496042b..000000000 --- a/.ci/utils/publish-build-cache.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Steps for publishing project cache - -steps: - - bash: 'mkdir -p $(Build.StagingDirectory)' - condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI')) - displayName: '[Cache][Publish] Create cache directory' - - # continueOnError because on windows it has a permission denied error but the - # export succeeds. - - script: "esy export-dependencies" - continueOnError: true - condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI')) - displayName: "esy export-dependencies" - - - bash: pwd && ls _export/* && mv _export '$(Build.StagingDirectory)' && ls '$(Build.StagingDirectory)/_export/' - condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI')) - displayName: '[Cache][Publish] move export to staging dir' - - # - bash: cd $ESY__CACHE_INSTALL_PATH && tar -czf $(Build.StagingDirectory)/esy-cache.tar . - # workingDirectory: '' - # condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI')) - # displayName: '[Cache][Publish] Tar esy cache directory' - - # - bash: 'cd $(ESY__NPM_ROOT) && tar -czf $(Build.StagingDirectory)/npm-cache.tar .' - # condition: and(succeeded(), eq(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])) - # displayName: '[Cache][Publish] Tar npm cache directory' - - - task: PublishBuildArtifacts@1 - displayName: '[Cache][Publish] Upload tarball' - condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI')) - # TODO: The CI Build caches are pulled down by the last successful buildID - # for the target branch. - inputs: - pathToPublish: '$(Build.StagingDirectory)' - artifactName: 'cache-$(Agent.OS)-install' - parallel: true - parallelCount: 8 diff --git a/.ci/utils/restore-build-cache.yml b/.ci/utils/restore-build-cache.yml deleted file mode 100644 index e0e897a5c..000000000 --- a/.ci/utils/restore-build-cache.yml +++ /dev/null @@ -1,101 +0,0 @@ -# Steps for restoring project cache - -steps: - - bash: 'mkdir -p $(Build.StagingDirectory)' - condition: and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch']))) - displayName: '[Cache][Publish] Create cache directory' - - # TODO: This can be done in parallel with installing node, and esy - # (which would save a bunch of time on windows) - - task: Bash@3 - condition: and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch']))) - displayName: '[Cache][Restore] Restoring build cache using REST API' - continueOnError: true - inputs: - targetType: 'inline' # Optional. Options: filePath, inline - script: | - # If org name is reasonml then REST_BASE will be: https://dev.azure.com/reasonml/ - REST_BASE="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}" - PROJ="$SYSTEM_TEAMPROJECT" - ART_NAME="cache-${AGENT_OS}-install" - fetchLatestBuild() { - PREFIX="branchName=refs%2Fheads%2F" - BRANCH=${PREFIX}${SYSTEM_PULLREQUEST_TARGETBRANCH} - FILTER='deletedFilter=excludeDeleted&statusFilter=completed&resultFilter=succeeded' - LATEST='queryOrder=finishTimeDescending&$top=1' - REST_BUILDS="$REST_BASE/$PROJ/_apis/build/builds?${FILTER}&${BRANCH}&${LATEST}&api-version=4.1" - echo "Rest call for builds: $REST_BUILDS" - REST_BUILDS_RESP=$(curl "$REST_BUILDS") - if [[ $REST_BUILDS_RESP =~ (\"web\":\{\"href\":\")([^\"]*) ]]; then LATEST_BUILD_PAGE="${BASH_REMATCH[2]}"; else LATEST_BUILD_PAGE=""; fi - if [[ $REST_BUILDS_RESP =~ (\"badge\":\{\"href\":\")([^\"]*) ]]; then LATEST_BUILD_BADGE="${BASH_REMATCH[2]}"; else LATEST_BUILD_BADGE=""; fi - if [[ $REST_BUILDS_RESP =~ (\"id\":)([^,]*) ]]; then LATEST_BUILD_ID="${BASH_REMATCH[2]}"; else LATEST_BUILD_ID=""; fi - } - fetchLatestBuild - fetchArtifactURL() { - REST_ART="$REST_BASE/$PROJ/_apis/build/builds/$LATEST_BUILD_ID/artifacts?artifactName=$ART_NAME&api-version=4.1" - echo "Rest call for artifacts: $REST_ART" - if [[ $(curl $REST_ART) =~ (downloadUrl\":\")([^\"]*) ]]; then LATEST_ART_URL="${BASH_REMATCH[2]}"; else LATEST_ART_URL=""; fi - } - downloadArtifactAndContinue() { - if [ -z "$LATEST_ART_URL" ] - then - echo "No latest artifact for merge-target branch found at URL $REST_ART" - else - curl "$LATEST_ART_URL" > "${BUILD_STAGINGDIRECTORY}/$ART_NAME.zip" - PROJECT_DIR=$PWD - cd $BUILD_STAGINGDIRECTORY - unzip "$ART_NAME.zip" - echo "Using Dependency cache for buildID: $LATEST_BUILD_ID" - echo "Build log for build that produced the cache: $LATEST_BUILD_PAGE" - echo "Build badge for build that produced the cache: $LATEST_BUILD_BADGE" - echo "Build artifact from build that produced the cache: $LATEST_ART_URL" - echo "Restoring build cache into:" - mkdir -p $ESY__CACHE_INSTALL_PATH - echo $ESY__CACHE_INSTALL_PATH - echo "##vso[task.setvariable variable=esy_export_dir_to_import]${BUILD_STAGINGDIRECTORY}/${ART_NAME}/_export" - if [[ -d ${ART_NAME}/_export ]]; then - echo "Cached builds to import from ${ART_NAME}/_export in next CI step" - ls ${ART_NAME}/_export - mv ${ART_NAME}/_export ${PROJECT_DIR}/_export - else - echo "No _export directory to import from build cache" - echo "Here's the contents of build cache:" - find ${BUILD_STAGINGDIRECTORY} - fi - fi - } - fetchArtifactURL - downloadArtifactAndContinue - - - powershell: esy.cmd import-dependencies - continueOnError: true - condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: "esy import-dependencies if windows (build cache from CI cache)" - - - bash: esy import-dependencies - continueOnError: true - condition: and(ne(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: "esy import-dependencies if not windows (build cache from CI cache)" - - # Remove as soon as https://github.com/esy/esy/pull/969 is resolved. - # For now, windows won't use build cache for problematic package. - - task: Bash@3 - continueOnError: true - condition: and(eq(variables['AGENT.OS'], 'Windows_NT'), and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch'])))) - displayName: 'Remove ocamlfind prebuilts if on Windows' - inputs: - targetType: 'inline' # Optional. Options: filePath, inline - script: | - ls ${ESY__CACHE_INSTALL_PATH} - rm -r ${ESY__CACHE_INSTALL_PATH}/opam__s__ocamlfind* - - - bash: 'rm -rf _import' - continueOnError: true - condition: and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch']))) - displayName: 'Remove import directory' - - - bash: 'rm -rf *' - continueOnError: true - workingDirectory: '$(Build.StagingDirectory)' - condition: and(eq(variables['Build.Reason'], 'PullRequest'), and(succeeded(), ne(variables['Build.SourceBranch'], variables['System.PullRequest.TargetBranch']))) - displayName: '[Cache][Restore] Clean up staging dir' diff --git a/.ci/utils/use-esy.yml b/.ci/utils/use-esy.yml deleted file mode 100644 index 392c3bdd2..000000000 --- a/.ci/utils/use-esy.yml +++ /dev/null @@ -1,5 +0,0 @@ -# steps to install esy globally - -steps: - - script: "npm install -g esy@latest" - displayName: "install esy" diff --git a/.ci/utils/use-node.yml b/.ci/utils/use-node.yml deleted file mode 100644 index c4ecccb45..000000000 --- a/.ci/utils/use-node.yml +++ /dev/null @@ -1,7 +0,0 @@ -# steps to use node on agent - -steps: - - task: NodeTool@0 - displayName: "Use Node 12.x" - inputs: - versionSpec: 12.x diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 88d5ea71e..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,210 +0,0 @@ -common_cache_key: &common_cache_key - key: dependency-cache-{{ .Branch }}-{{ checksum "../ocaml-version" }}-{{ checksum ".circleci/config.yml" }}-{{ checksum "reason.opam" }}-{{ checksum "rtop.opam" }} - -esy_cache_key: &esy_cache_key - key: esy-cache-{{ checksum "esy.json" }}-{{ checksum "esy.lock/index.json" }}-{{ checksum ".circleci/config.yml" }} - -esy_post_build_cache_key: &esy_post_build_cache_key - key: esy-post-build-cache-{{ checksum "esy.json" }}-{{ checksum "esy.lock/index.json" }}-{{ checksum ".circleci/config.yml" }} - -common_steps: &common_steps - steps: - - run: - name: "Install npm" - command: | - sudo apt update - sudo apt install -y nodejs npm - mkdir -p ~/.npm-global - npm config set prefix $NPM_CONFIG_PREFIX - - checkout - - run: - name: "Note OCAML_VERSION for cache" - command: echo $OCAML_VERSION > ../ocaml-version - - restore_cache: - <<: *common_cache_key - - run: - name: "Initialize opam" - command: | - sudo apt install -y m4 - opam remote set-url default https://opam.ocaml.org - - run: - name: "Install deps" - command: | - sudo apt install -y pkg-config libncurses5-dev - opam update - opam install -y dune menhir utop - - run: - name: 'Clean' - command: make clean-for-ci - - save_cache: - <<: *common_cache_key - paths: - - ~/.opam - - ~/.npm-global - - run: - name: 'opam pin' - command: | - opam pin add -y reason . - opam pin add -y rtop . - - run: - name: 'Test' - command: | - eval `opam config env` - make test-ci - - run: - name: 'Cram test' - command: | - eval `opam config env` - dune runtest - - run: - name: 'Check git is clean' - command: git diff --exit-code - -version: 2 -jobs: - 4.03.0: - docker: - - image: ocaml/opam:debian-ocaml-4.03 - environment: - - TERM: dumb - - OCAML_VERSION: "4.03.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.04.0: - docker: - - image: ocaml/opam:debian-ocaml-4.04 - environment: - - TERM: dumb - - OCAML_VERSION: "4.04.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.06.1: - docker: - - image: ocaml/opam:debian-ocaml-4.06 - environment: - - TERM: dumb - - OCAML_VERSION: "4.06.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.07.0: - docker: - - image: ocaml/opam:debian-ocaml-4.07 - environment: - - TERM: dumb - - OCAML_VERSION: "4.07.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.08.0: - docker: - - image: ocaml/opam:debian-ocaml-4.08 - environment: - - TERM: dumb - - OCAML_VERSION: "4.08.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.09.0: - docker: - - image: ocaml/opam:debian-ocaml-4.09 - environment: - - TERM: dumb - - OCAML_VERSION: "4.09.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.10.0: - docker: - - image: ocaml/opam:debian-ocaml-4.10 - environment: - - TERM: dumb - - OCAML_VERSION: "4.10.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.12.0: - docker: - - image: ocaml/opam:debian-ocaml-4.12 - environment: - - TERM: dumb - - OCAML_VERSION: "4.12.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.13.0: - docker: - - image: ocaml/opam:debian-ocaml-4.13 - environment: - - TERM: dumb - - OCAML_VERSION: "4.13.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - 4.14.0: - docker: - - image: ocaml/opam:debian-ocaml-4.14 - environment: - - TERM: dumb - - OCAML_VERSION: "4.14.x" - - NPM_CONFIG_PREFIX: "~/.npm-global" - <<: *common_steps - esy_build: - docker: - - image: ocaml/opam:debian-ocaml-4.12 - environment: - - TERM: dumb - - NPM_CONFIG_PREFIX: "~/.npm-global" - steps: - - checkout - - run: - name: "Install npm" - command: | - curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - - sudo apt update - sudo apt install -y nodejs - mkdir -p ~/.npm-global - npm config set prefix $NPM_CONFIG_PREFIX - - run: - name: "Install m4" - command: | - sudo apt install -y m4 - - restore_cache: - <<: *esy_cache_key - - restore_cache: - <<: *esy_post_build_cache_key - - run: - name: "Install esy" - command: npm install -g esy@latest - - run: - name: 'Clean' - command: make clean-for-ci - - run: - name: 'esy install' - command: ~/.npm-global/bin/esy install - - save_cache: - <<: *esy_cache_key - paths: - - ~/.npm-global - - ~/.esy - - run: - name: 'esy build' - command: | - ~/.npm-global/bin/esy build - ~/.npm-global/bin/esy x refmt --version - # Use both pre and post build caches so that we're more likely - # to have dependencies cached. `esy build` is more likely to fail, - # so this will make the push that fixes the build faster - - save_cache: - <<: *esy_post_build_cache_key - paths: - - ~/.esy - -workflows: - version: 2 - build-deploy: - jobs: - - 4.03.0 - - 4.04.0 - - 4.06.1 - - 4.07.0 - - 4.08.0 - - 4.09.0 - - 4.10.0 - - 4.12.0 - - 4.13.0 - - 4.14.0 - - esy_build diff --git a/formatTest/.gitignore b/formatTest/.gitignore deleted file mode 100644 index 6d89e3c27..000000000 --- a/formatTest/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -typeCheckedTests/*.out -typeCheckedTests/*.cmo -typeCheckedTests/*.cmi -oprintTests/**/*.cmi diff --git a/formatTest/customMLFiles/README b/formatTest/customMLFiles/README deleted file mode 100644 index 2d0273919..000000000 --- a/formatTest/customMLFiles/README +++ /dev/null @@ -1 +0,0 @@ -This directory is for users who want to test formatting their custom ML files. \ No newline at end of file diff --git a/formatTest/errorTests/expected_output/comments1.re b/formatTest/errorTests/expected_output/comments1.re deleted file mode 100644 index 673de8a2e..000000000 --- a/formatTest/errorTests/expected_output/comments1.re +++ /dev/null @@ -1,2 +0,0 @@ -File "comments1.re", line 1, characters 0-2: -Error: Comment not terminated diff --git a/formatTest/errorTests/expected_output/comments1.re.4.08.0 b/formatTest/errorTests/expected_output/comments1.re.4.08.0 deleted file mode 100644 index 87d2983fb..000000000 --- a/formatTest/errorTests/expected_output/comments1.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "comments1.re", line 1, characters 0-2: -1 | /* this is an unterminated comment - ^^ -Error: Comment not terminated - diff --git a/formatTest/errorTests/expected_output/comments1.re.4.09.0 b/formatTest/errorTests/expected_output/comments1.re.4.09.0 deleted file mode 100644 index 87d2983fb..000000000 --- a/formatTest/errorTests/expected_output/comments1.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "comments1.re", line 1, characters 0-2: -1 | /* this is an unterminated comment - ^^ -Error: Comment not terminated - diff --git a/formatTest/errorTests/expected_output/lowercase_module.re b/formatTest/errorTests/expected_output/lowercase_module.re deleted file mode 100644 index fa00d3d62..000000000 --- a/formatTest/errorTests/expected_output/lowercase_module.re +++ /dev/null @@ -1,2 +0,0 @@ -File "lowercase_module.re", line 1, characters 7-16: -Error: Module names must start with an uppercase letter. diff --git a/formatTest/errorTests/expected_output/lowercase_module.re.4.08.0 b/formatTest/errorTests/expected_output/lowercase_module.re.4.08.0 deleted file mode 100644 index 55a5abdf3..000000000 --- a/formatTest/errorTests/expected_output/lowercase_module.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "lowercase_module.re", line 1, characters 7-16: -1 | module lowercase = {}; - ^^^^^^^^^ -Error: Module names must start with an uppercase letter. - diff --git a/formatTest/errorTests/expected_output/lowercase_module.re.4.09.0 b/formatTest/errorTests/expected_output/lowercase_module.re.4.09.0 deleted file mode 100644 index 55a5abdf3..000000000 --- a/formatTest/errorTests/expected_output/lowercase_module.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "lowercase_module.re", line 1, characters 7-16: -1 | module lowercase = {}; - ^^^^^^^^^ -Error: Module names must start with an uppercase letter. - diff --git a/formatTest/errorTests/expected_output/lowercase_module_rec.re b/formatTest/errorTests/expected_output/lowercase_module_rec.re deleted file mode 100644 index dd1feaf5d..000000000 --- a/formatTest/errorTests/expected_output/lowercase_module_rec.re +++ /dev/null @@ -1,2 +0,0 @@ -File "lowercase_module_rec.re", line 1, characters 11-20: -Error: Module names must start with an uppercase letter. diff --git a/formatTest/errorTests/expected_output/lowercase_module_rec.re.4.08.0 b/formatTest/errorTests/expected_output/lowercase_module_rec.re.4.08.0 deleted file mode 100644 index b73a751da..000000000 --- a/formatTest/errorTests/expected_output/lowercase_module_rec.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "lowercase_module_rec.re", line 1, characters 11-20: -1 | module rec lowercase = {}; - ^^^^^^^^^ -Error: Module names must start with an uppercase letter. - diff --git a/formatTest/errorTests/expected_output/lowercase_module_rec.re.4.09.0 b/formatTest/errorTests/expected_output/lowercase_module_rec.re.4.09.0 deleted file mode 100644 index b73a751da..000000000 --- a/formatTest/errorTests/expected_output/lowercase_module_rec.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "lowercase_module_rec.re", line 1, characters 11-20: -1 | module rec lowercase = {}; - ^^^^^^^^^ -Error: Module names must start with an uppercase letter. - diff --git a/formatTest/errorTests/expected_output/reserved.re b/formatTest/errorTests/expected_output/reserved.re deleted file mode 100644 index df0298100..000000000 --- a/formatTest/errorTests/expected_output/reserved.re +++ /dev/null @@ -1,2 +0,0 @@ -File "reserved.re", line 1, characters 11-15: -Error: type is a reserved keyword, it cannot be used as an identifier. Try 'type_' instead diff --git a/formatTest/errorTests/expected_output/reservedField.re b/formatTest/errorTests/expected_output/reservedField.re deleted file mode 100644 index 31fe0bae8..000000000 --- a/formatTest/errorTests/expected_output/reservedField.re +++ /dev/null @@ -1,2 +0,0 @@ -File "reservedField.re", line 1, characters 11-15: -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead diff --git a/formatTest/errorTests/expected_output/reservedField.re.4.08.0 b/formatTest/errorTests/expected_output/reservedField.re.4.08.0 deleted file mode 100644 index b78ce1610..000000000 --- a/formatTest/errorTests/expected_output/reservedField.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedField.re", line 1, characters 11-15: -1 | let x = {< type >}; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedField.re.4.09.0 b/formatTest/errorTests/expected_output/reservedField.re.4.09.0 deleted file mode 100644 index b78ce1610..000000000 --- a/formatTest/errorTests/expected_output/reservedField.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedField.re", line 1, characters 11-15: -1 | let x = {< type >}; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecord.re b/formatTest/errorTests/expected_output/reservedRecord.re deleted file mode 100644 index bcc5d8fc5..000000000 --- a/formatTest/errorTests/expected_output/reservedRecord.re +++ /dev/null @@ -1,2 +0,0 @@ -File "reservedRecord.re", line 1, characters 24-28: -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead diff --git a/formatTest/errorTests/expected_output/reservedRecord.re.4.08.0 b/formatTest/errorTests/expected_output/reservedRecord.re.4.08.0 deleted file mode 100644 index b886504a0..000000000 --- a/formatTest/errorTests/expected_output/reservedRecord.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecord.re", line 1, characters 24-28: -1 | let foo = { foo: "bar", type: "qux" }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecord.re.4.09.0 b/formatTest/errorTests/expected_output/reservedRecord.re.4.09.0 deleted file mode 100644 index b886504a0..000000000 --- a/formatTest/errorTests/expected_output/reservedRecord.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecord.re", line 1, characters 24-28: -1 | let foo = { foo: "bar", type: "qux" }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecordPunned.re b/formatTest/errorTests/expected_output/reservedRecordPunned.re deleted file mode 100644 index 0988fd65d..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordPunned.re +++ /dev/null @@ -1,2 +0,0 @@ -File "reservedRecordPunned.re", line 1, characters 22-26: -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead diff --git a/formatTest/errorTests/expected_output/reservedRecordPunned.re.4.08.0 b/formatTest/errorTests/expected_output/reservedRecordPunned.re.4.08.0 deleted file mode 100644 index ffb5bedd0..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordPunned.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecordPunned.re", line 1, characters 22-26: -1 | let foo = { ...other, type }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecordPunned.re.4.09.0 b/formatTest/errorTests/expected_output/reservedRecordPunned.re.4.09.0 deleted file mode 100644 index ffb5bedd0..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordPunned.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecordPunned.re", line 1, characters 22-26: -1 | let foo = { ...other, type }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecordTy b/formatTest/errorTests/expected_output/reservedRecordTy deleted file mode 100644 index 30e716113..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordTy +++ /dev/null @@ -1,2 +0,0 @@ -File "reservedRecordTypePunned.re", line 1, characters 11-15: -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead diff --git a/formatTest/errorTests/expected_output/reservedRecordType.re b/formatTest/errorTests/expected_output/reservedRecordType.re deleted file mode 100644 index 238150d0a..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordType.re +++ /dev/null @@ -1,2 +0,0 @@ -File "reservedRecordType.re", line 1, characters 11-15: -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead diff --git a/formatTest/errorTests/expected_output/reservedRecordType.re.4.08.0 b/formatTest/errorTests/expected_output/reservedRecordType.re.4.08.0 deleted file mode 100644 index d2e1f1392..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordType.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecordType.re", line 1, characters 11-15: -1 | type x = { type: string }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecordType.re.4.09.0 b/formatTest/errorTests/expected_output/reservedRecordType.re.4.09.0 deleted file mode 100644 index d2e1f1392..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordType.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecordType.re", line 1, characters 11-15: -1 | type x = { type: string }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecordTypePunned.re b/formatTest/errorTests/expected_output/reservedRecordTypePunned.re deleted file mode 100644 index 30e716113..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordTypePunned.re +++ /dev/null @@ -1,2 +0,0 @@ -File "reservedRecordTypePunned.re", line 1, characters 11-15: -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead diff --git a/formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.08.0 b/formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.08.0 deleted file mode 100644 index 0bb234efd..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecordTypePunned.re", line 1, characters 11-15: -1 | type x = { type }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.09.0 b/formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.09.0 deleted file mode 100644 index 0bb234efd..000000000 --- a/formatTest/errorTests/expected_output/reservedRecordTypePunned.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "reservedRecordTypePunned.re", line 1, characters 11-15: -1 | type x = { type }; - ^^^^ -Error: type is a reserved keyword, it cannot be used as an identifier. Try `type_` or `_type` instead - diff --git a/formatTest/errorTests/expected_output/syntaxError.re b/formatTest/errorTests/expected_output/syntaxError.re deleted file mode 100644 index be168bfc8..000000000 --- a/formatTest/errorTests/expected_output/syntaxError.re +++ /dev/null @@ -1,2 +0,0 @@ -File "syntaxError.re", line 1, characters 9-10: -Error: Syntax error diff --git a/formatTest/errorTests/expected_output/syntaxError.re.4.07.1 b/formatTest/errorTests/expected_output/syntaxError.re.4.07.1 deleted file mode 100644 index be168bfc8..000000000 --- a/formatTest/errorTests/expected_output/syntaxError.re.4.07.1 +++ /dev/null @@ -1,2 +0,0 @@ -File "syntaxError.re", line 1, characters 9-10: -Error: Syntax error diff --git a/formatTest/errorTests/expected_output/syntaxError.re.4.08.0 b/formatTest/errorTests/expected_output/syntaxError.re.4.08.0 deleted file mode 100644 index 3ee84cb3c..000000000 --- a/formatTest/errorTests/expected_output/syntaxError.re.4.08.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "syntaxError.re", line 1, characters 9-10: -1 | try (bad); - ^ -Error: Syntax error - diff --git a/formatTest/errorTests/expected_output/syntaxError.re.4.09.0 b/formatTest/errorTests/expected_output/syntaxError.re.4.09.0 deleted file mode 100644 index 3ee84cb3c..000000000 --- a/formatTest/errorTests/expected_output/syntaxError.re.4.09.0 +++ /dev/null @@ -1,5 +0,0 @@ -File "syntaxError.re", line 1, characters 9-10: -1 | try (bad); - ^ -Error: Syntax error - diff --git a/formatTest/errorTests/input/comments1.re b/formatTest/errorTests/input/comments1.re deleted file mode 100644 index aeff9db2c..000000000 --- a/formatTest/errorTests/input/comments1.re +++ /dev/null @@ -1 +0,0 @@ -/* this is an unterminated comment diff --git a/formatTest/errorTests/input/lowercase_module.re b/formatTest/errorTests/input/lowercase_module.re deleted file mode 100644 index 48182e2f0..000000000 --- a/formatTest/errorTests/input/lowercase_module.re +++ /dev/null @@ -1 +0,0 @@ -module lowercase = {}; diff --git a/formatTest/errorTests/input/lowercase_module_rec.re b/formatTest/errorTests/input/lowercase_module_rec.re deleted file mode 100644 index d58f3cc4c..000000000 --- a/formatTest/errorTests/input/lowercase_module_rec.re +++ /dev/null @@ -1 +0,0 @@ -module rec lowercase = {}; diff --git a/formatTest/errorTests/input/reservedField.re b/formatTest/errorTests/input/reservedField.re deleted file mode 100644 index a02785d99..000000000 --- a/formatTest/errorTests/input/reservedField.re +++ /dev/null @@ -1 +0,0 @@ -let x = {< type >}; diff --git a/formatTest/errorTests/input/reservedRecord.re b/formatTest/errorTests/input/reservedRecord.re deleted file mode 100644 index 99ecc393b..000000000 --- a/formatTest/errorTests/input/reservedRecord.re +++ /dev/null @@ -1 +0,0 @@ -let foo = { foo: "bar", type: "qux" }; diff --git a/formatTest/errorTests/input/reservedRecordPunned.re b/formatTest/errorTests/input/reservedRecordPunned.re deleted file mode 100644 index 2b51815f4..000000000 --- a/formatTest/errorTests/input/reservedRecordPunned.re +++ /dev/null @@ -1 +0,0 @@ -let foo = { ...other, type }; diff --git a/formatTest/errorTests/input/reservedRecordType.re b/formatTest/errorTests/input/reservedRecordType.re deleted file mode 100644 index 05dc8dc82..000000000 --- a/formatTest/errorTests/input/reservedRecordType.re +++ /dev/null @@ -1 +0,0 @@ -type x = { type: string }; diff --git a/formatTest/errorTests/input/reservedRecordTypePunned.re b/formatTest/errorTests/input/reservedRecordTypePunned.re deleted file mode 100644 index e3960b4ef..000000000 --- a/formatTest/errorTests/input/reservedRecordTypePunned.re +++ /dev/null @@ -1 +0,0 @@ -type x = { type }; diff --git a/formatTest/errorTests/input/syntaxError.re b/formatTest/errorTests/input/syntaxError.re deleted file mode 100644 index 8508126bf..000000000 --- a/formatTest/errorTests/input/syntaxError.re +++ /dev/null @@ -1 +0,0 @@ -try (bad); diff --git a/formatTest/idempotentTests/expected_output/assert.crlf.re b/formatTest/idempotentTests/expected_output/assert.crlf.re deleted file mode 100644 index 136ae43bb..000000000 --- a/formatTest/idempotentTests/expected_output/assert.crlf.re +++ /dev/null @@ -1,23 +0,0 @@ -switch (true) { -| true => () -| false => assert(false) -| _ => assert(false) -}; - -let root = { - let root = Doc.rootNode(doc); - assert(root.type_ == "expression"); - assert(Node.namedChildCount(root) == 1); - assert(Node.childCount(root) == 1); - assert( - Point.toString(root.startPoint) - == "(Point.t {:row 0 :column 0})", - ); - assert( - Point.toString(root.endPoint) - == "(Point.t {:row 0 :column 9})", - ); - root; -}; - -assert(theTruth()); diff --git a/formatTest/idempotentTests/input/assert.crlf.re b/formatTest/idempotentTests/input/assert.crlf.re deleted file mode 100644 index cb6d21f0a..000000000 --- a/formatTest/idempotentTests/input/assert.crlf.re +++ /dev/null @@ -1,17 +0,0 @@ -switch(true) { - | true => () - | false => assert(false) - | _ => assert false -}; - -let root = { - let root = Doc.rootNode(doc); - assert (root.type_ == "expression"); - assert (Node.namedChildCount(root) == 1); - assert (Node.childCount(root) == 1); - assert (Point.toString(root.startPoint) == "(Point.t {:row 0 :column 0})"); - assert (Point.toString(root.endPoint) == "(Point.t {:row 0 :column 9})"); - root; -}; - -assert(theTruth()); diff --git a/formatTest/oprintTests/expected_output/basic.re b/formatTest/oprintTests/expected_output/basic.re deleted file mode 100644 index 5980b4813..000000000 --- a/formatTest/oprintTests/expected_output/basic.re +++ /dev/null @@ -1,61 +0,0 @@ -let x1: unit => int; -let x2: 'a => int; -let x3: (int, 'a) => int; -let x4: (('a, 'b)) => int; -let x5: ('a, 'b) => int; -let x6: (~x: 'a, ~y: 'b) => int; -let x7: (~x: int, ~y: string) => int; -let x8: (~x: int=?, ~y: 'a=?, ~z: string=?, unit) => int; -type a = int; -type b = float; -type c = string; -type t1 = a => b; -type t2 = (a, b) => c; -type t3 = ((a, b)) => c; -type t4 = (~x: int, ~y: string) => c; -type t5 = (~x: a=?) => b; -type tf = (int => int) => string; -type tNested2 = (int => int) => string; -type tNested3 = ((int => int) => int) => string; -type tNested4 = (int, int) => string; -type tNested5 = ((int, int)) => string; -type t6 = int; -type t7('a) = list('a); -type t8('a, 'b) = (list('a), 'b); -type t9 = t8(string, int); -class type restricted_point_type = { pub bump: unit; pub get_x: int }; -class type t10 ('a) = { pub thing: 'a }; -class type t11 ('a, 'b) = { pub thing: ('a, list('b)) }; -module MyFirstModule: { let x: int; type i = int and n = string; }; -module type HasTT = { type tt; }; -module SubModule: HasTT; -module type HasEmbeddedHasTT = { module SubModuleThatHasTT = SubModule; }; -module type HasPolyType = { type t('a); }; -module type HasDoublePoly = { type m('b, 'c); }; -module type HasDestructivelySubstitutedPolyType = { }; -module type HasDestructivelySubstitutedSubPolyModule = - { module X: HasDestructivelySubstitutedPolyType; }; -module type HasSubPolyModule = { module X: HasPolyType; }; -module EmbedsSubPolyModule: HasSubPolyModule; -module InliningSig: { let x: int; let y: int; }; -module MyFunctor: - (M : HasTT) => { type reexportedTT = M.tt; let someValue: int; }; -module MyFunctorResult: { type reexportedTT = string; let someValue: int; }; -module type ASig = { let a: int; }; -module type BSig = { let b: int; }; -module CurriedSugar: (A : ASig) => (B : BSig) => { let result: int; }; -type withThreeFields = { name: string, age: int, occupation: string, }; -let testRecord: withThreeFields; -let makeRecordBase: unit => withThreeFields; -type t = A | B(int) | C(int, int) | D((int, int)); -type foo = { x: int, }; -let result: option(foo); -type tt1 = A(int) | B(bool, string); -type tt2 = A(int) | B((bool, string)); -type tt3 = [ `A(int) | `B(bool, string) | `C ]; -type tt4 = [ `A(int) | `B(bool, string) | `C ]; -let ( == ): int; -let ( === ): int; -let ( != ): int; -let ( !== ): int; -type foobar(_) = Foo('a): foobar(unit); diff --git a/formatTest/oprintTests/expected_output/class.re b/formatTest/oprintTests/expected_output/class.re deleted file mode 100644 index 6d019dbc9..000000000 --- a/formatTest/oprintTests/expected_output/class.re +++ /dev/null @@ -1,20 +0,0 @@ -class aClass1 : - ('a) => - { - pub a1: int; - pub a2: unit => int; - pub a3: (int, int) => int; - pub a4: (int, int) => int - }; -class aClass2 : ('a) => { }; -class aClass3 : (int, int) => { }; -class aClass4 : (int, int, int) => { }; -class aClass5 : (int, int, int) => { }; -class aClass6 : (int => int, int) => { }; -class aClass7 : (int, int, int) => { }; -class labeledClass1 : ('a) => { }; -class labeledClass2 : (~x: int, int) => { }; -class labeledClass3 : (~x: int, int, int) => { }; -class labeledClass4 : (~x: int, int, int) => { }; -class labeledClass5 : ((~y: int) => int, int) => { }; -class labeledClass6 : (~x: (int, int), int) => { }; diff --git a/formatTest/oprintTests/expected_output/inlineRecord.re b/formatTest/oprintTests/expected_output/inlineRecord.re deleted file mode 100644 index fa2369a72..000000000 --- a/formatTest/oprintTests/expected_output/inlineRecord.re +++ /dev/null @@ -1,6 +0,0 @@ -type t0 = T0({ t0: int, }); -type t1 = A({ x: int, }) | B | C({ c1: string, c2: string, }); -type t2(_) = - D({ x: int, }): t2(int) - | E({ f: int => int, }): t2(int => int) - | F(unit): t2(unit); diff --git a/formatTest/oprintTests/input/basic.re b/formatTest/oprintTests/input/basic.re deleted file mode 100644 index 132ef7e4f..000000000 --- a/formatTest/oprintTests/input/basic.re +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let x1 = () => 1; -let x2 = (a) => 1; -let x3 = (a: int, b) => 1; -let x4 = ((a,b)) => 1; -let x5 = fun (a,b): int => 1; -let x6 = (~x, ~y) => 1; -let x7 = (~x: int, ~y: string) => 1; -let x8 = (~x=5, ~y=?, ~z: option(string)=?, ()) => 1; - -type a = int; -type b = float; -type c = string; -type t1 = (a) => b; -type t2 = (a, b) => c; -type t3 = ((a, b)) => c; -type t4 = (~x: int, ~y: string) => c; -type t5 = (~x: a=?) => b; -type tf = (int => int) => string; -type tNested2 = ((int => int)) => string; -type tNested3 = ((int => int) => int) => string; -type tNested4 = (int, int) => string; -type tNested5 = ((int, int)) => string; - -type t6 = int; -type t7('a) = list('a); -type t8('a, 'b) = (list('a), 'b); -type t9 = t8(string, int); - -class type restricted_point_type = { - pub get_x: int; - pub bump: unit; -}; -class type t10('a) = { - pub thing: 'a; -}; -class type t11('a, 'b) = { - pub thing: ('a, list('b)) -}; - -module MyFirstModule = { - let x = 0; - type i = int - and n = string; -}; - -module type HasTT = { - type tt; -}; - -module SubModule: HasTT = { - type tt = int; -}; - -module type HasEmbeddedHasTT = { - module SubModuleThatHasTT = SubModule; -}; - -module type HasPolyType = {type t('a);}; -module type HasDoublePoly = {type m('b, 'c);}; - -module type HasDestructivelySubstitutedPolyType = - HasPolyType with type t('a) := list('a); - -module type HasDestructivelySubstitutedSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int); */ - module X: HasDestructivelySubstitutedPolyType; -}; - -module type HasSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int); */ - module X: HasPolyType; -}; - -module EmbedsSubPolyModule: HasSubPolyModule = { - module X = { - type t('a) = list('a); - }; -}; - -module InliningSig: {let x: int; let y:int;} = { - let x = 10; - let y = 20; -}; - -module MyFunctor = fun (M: HasTT) => { - type reexportedTT = M.tt; - let someValue = 1000; -}; - -module MyFunctorResult = MyFunctor ({type tt = string;}); -module type ASig = {let a:int;}; -module type BSig = {let b:int;}; -module CurriedSugar (A:ASig, B:BSig) { - let result = A.a + B.b; -}; - -type withThreeFields = { - name: string, - age: int, - occupation: string -}; - -let testRecord = { - name: "joe", - age: 20, - occupation: "engineer" -}; - -let makeRecordBase () {name: "Joe", age: 30, occupation: "Engineer"}; - - -type t = - | A - | B(int) - | C(int, int) - | D((int, int)); - -type foo = {x:int}; -let result = Some {x:1}; - - -type tt1 = A(int) | B(bool, string); - -type tt2 = A(int) | B((bool, string)); - -type tt3 = [ `A(int) | `B(bool, string) | `C]; - -type tt4 = [ `A(int) | `B((bool, string)) | `C]; - -let (==) = 0; - -let (===) = 0; - -let (!=) = 0; - -let (!==) = 0; - -type foobar(_) = | Foo('a): foobar(unit); diff --git a/formatTest/oprintTests/input/class.re b/formatTest/oprintTests/input/class.re deleted file mode 100644 index 75c6c63a1..000000000 --- a/formatTest/oprintTests/input/class.re +++ /dev/null @@ -1,36 +0,0 @@ -class aClass1(x) { - /* one value parameter x */ - pub a1 = 0; - pub a2() = 0; - pub a3(x,y) = x + y; - pub a4(x,y) { - let result = x + y; - print_endline(" x + y = " ++ string_of_int(x) ++ " + " ++ string_of_int(y) ++ " = " ++ string_of_int(result)); - result - }; -}; -class aClass2(x) { -}; -class aClass3(x: (int => int)) { -}; -class aClass4(x: (int => int => int)) { -}; -class aClass5(x: (int => (int => int))) { -}; -class aClass6(x: ((int => int) => int)) { -}; -class aClass7(x: ((int, int) => int)) { -}; - -class labeledClass1(~x) { -}; -class labeledClass2(~x: ((~y:int) => int)) { -}; -class labeledClass3(~x: ((~y:int) => int => int)) { -}; -class labeledClass4(~x: ((~y:int) => (int => int))) { -}; -class labeledClass5(~x: (((~y:int) => int) => int)) { -}; -class labeledClass6(~x: ((~y:(int, int)) => int)) { -}; diff --git a/formatTest/oprintTests/input/inlineRecord.re b/formatTest/oprintTests/input/inlineRecord.re deleted file mode 100644 index 6def8d80f..000000000 --- a/formatTest/oprintTests/input/inlineRecord.re +++ /dev/null @@ -1,11 +0,0 @@ -type t0 = T0 { t0 : int }; -type t1 = - | A { x : int } - | B - | C { c1 : string, c2 : string }; - -/* GADT */ -type t2(_) = - | D { x : int } : t2(int) - | E { f : int => int } : t2(int => int) - | F(unit) : t2(unit); diff --git a/formatTest/test.sh b/formatTest/test.sh deleted file mode 100755 index 1aa3867f6..000000000 --- a/formatTest/test.sh +++ /dev/null @@ -1,553 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2015-present, Facebook, Inc. All rights reserved. - -set -eu - -WARNING='\033[0;31m' -SUCCESS='\033[0;32m' -NOTICE='\033[0;33m' -INFO='' -DEBUG='' -RESET='\033[0m' -VERBOSE=${VERBOSE:-} -OCAML_VERSION=`echo $(ocaml -version) | egrep -o '[0-9]+.[0-9]+.[0-9]+' | head -1` -OCAML_VERSION=${OCAML_VERSION:-"4.06.2"} - -case ${OCAML_VERSION} in -4.08.*) OCAML_VERSION=4.08.0;; -4.09.*|4.10.*|4.11.*|4.12.*|4.13.*|4.14.*) OCAML_VERSION=4.09.0;; # Outputs from OCaml 4.10 / 4.11 are exepected to be the same as OCaml 4.09 -esac - -unameOut="$(uname -s)" -# Create paths of shape C:/ not /c/ form, so use pwd -W on windows bash. -case "${unameOut}" in - MINGW*) DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -W )";; - *) DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -esac - -case "${unameOut}" in - MINGW*) REFMT_NAME_FOR_OCAML=$(cygpath --mixed --absolute $(which refmt.exe));; - *) REFMT_NAME_FOR_OCAML="refmt" -esac - - - -# for better visual diffing in the terminal, try https://github.com/jeffkaufman/icdiff -if hash icdiff 2> /dev/null; then - DIFF="icdiff" -elif hash git 2> /dev/null; then - # Pass core.safecrlf=false to avoid warnings on windows - DIFF="git -c core.safecrlf=false --no-pager diff --no-index" -else - DIFF="eval diff --unchanged-line-format='' --new-line-format=':%dn: %L' --old-line-format=':%dn: %L'" -fi - -UNIT_TEST_INPUT=$DIR/unit_tests/input - -UNIT_TEST_OUTPUT=$DIR/unit_tests/actual_output - -UNIT_TEST_EXPECTED_OUTPUT=$DIR/unit_tests/expected_output - -IDEMPOTENT_TEST_INPUT=$DIR/idempotentTests/input - -IDEMPOTENT_TEST_OUTPUT=$DIR/idempotentTests/actual_output - -IDEMPOTENT_TEST_EXPECTED_OUTPUT=$DIR/idempotentTests/expected_output - -TYPE_TEST_INPUT=$DIR/typeCheckedTests/input - -TYPE_TEST_OUTPUT=$DIR/typeCheckedTests/actual_output - -TYPE_TEST_EXPECTED_OUTPUT=$DIR/typeCheckedTests/expected_output - - -ERROR_TEST_INPUT=$DIR/errorTests/input - -ERROR_TEST_OUTPUT=$DIR/errorTests/actual_output - -ERROR_TEST_EXPECTED_OUTPUT=$DIR/errorTests/expected_output - - -OPRINT_TEST_INPUT=$DIR/oprintTests/input - -OPRINT_TEST_OUTPUT=$DIR/oprintTests/actual_output - -OPRINT_TEST_EXPECTED_OUTPUT=$DIR/oprintTests/expected_output - -OPRINT_TEST_INTF_OUTPUT=$DIR/oprintTests/intf_output - - -FAILED_TESTS=$DIR/failed_tests - -function info() { - printf "${INFO}$1${RESET}\n" -} - -function debug() { - if [ ! -z "$VERBOSE" ]; then - printf "${DEBUG}$1${RESET}\n" - fi -} - -function notice() { - printf "${NOTICE}$1${RESET}\n" -} - -function success() { - printf "${SUCCESS}$1${RESET}" -} - -function output() { - printf "$1\n" -} - -function warning() { - printf "${WARNING}$1${RESET}\n" -} - -function version() { - echo "$@" | awk -F . '{ printf("%03d%03d%03d\n", $1, $2, $3); }'; -} - -function setup_test_dir() { - echo "Setting up test dirs actual_output alongside the tests' expected_output" - mkdir -p $UNIT_TEST_OUTPUT $IDEMPOTENT_TEST_OUTPUT $TYPE_TEST_OUTPUT $ERROR_TEST_OUTPUT $OPRINT_TEST_OUTPUT $OPRINT_TEST_INTF_OUTPUT - touch $FAILED_TESTS -} - -setup_test_dir - -set +e - -function stdin_test() { - INPUT_FILE=$1 - OUTPUT_FILE=$2 - EXPECTED_OUTPUT_FILE=$3 - # explicitly pass in heuristics file because idempotent tests read from output directory - HEURISTICS_FILE=$4 - if [[ -z "${5-}" ]]; then - EXTRA_FLAGS='--interface false --parse re' - else - EXTRA_FLAGS="$5" - fi - - FILENAME=$(basename $INPUT_FILE) - FILEEXT="${FILENAME##*.}" - - if [[ $FILEEXT = "re" ]]; then - cat $INPUT_FILE | refmt $EXTRA_FLAGS --print-width 50 --print re 2>&1 > $OUTPUT_FILE - elif [[ $FILEEXT = "rei" ]]; then - cat $INPUT_FILE | refmt --interface true --print-width 50 --parse re --print re 2>&1 > $OUTPUT_FILE - elif [[ $FILEEXT = "ml" ]]; then - cat $INPUT_FILE | refmt --heuristics-file $HEURISTICS_FILE --interface false --print-width 50 --parse ml --print re 2>&1 > $OUTPUT_FILE - elif [[ $FILEEXT = "mli" ]]; then - cat $INPUT_FILE | refmt --heuristics-file $HEURISTICS_FILE --interface true --print-width 50 --parse ml --print re 2>&1 > $OUTPUT_FILE - else - warning " ⊘ FAILED --use-stdin \n" - info " Cannot determine default implementation parser for extension ${FILEEXT}" - return 1 - fi - - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED --use-stdin \n" - info " There was an error when testing --use-stdin" - info " for input file $INPUT_FILE" - info " and output file $OUTPUT_FILE${RESET}" - echo "" - return 1 - fi - - debug " Comparing --use-stdin results: diff $EXPECTED_OUTPUT_FILE $OUTPUT_FILE" - $DIFF $EXPECTED_OUTPUT_FILE $OUTPUT_FILE - - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED --use-stdin \n" - info " ${INFO}$OUTPUT_FILE${RESET}" - info " doesn't match expected output" - info " ${INFO}$EXPECTED_OUTPUT_FILE${RESET}" - echo "" - return 1 - fi - return 0 -} - -function unit_test() { - FILE=$1 - INPUT=$2 - OUTPUT=$3 - EXPECTED_OUTPUT=$4 - - FILENAME=$(basename $FILE) - FILEEXT="${FILENAME##*.}" - - - OUTPUT_NOT_GENERATED="0" - info "Unit Test: $FILE" - if [ "$(basename $FILE)" != "$(basename $FILE .ml)" ] || [ "$(basename $FILE)" != "$(basename $FILE .mli)" ]; then - if [ "$(basename $FILE)" != "$(basename $FILE .ml)" ]; then - SUFFIX=".re" - REFILE="$(basename $FILE .ml)$SUFFIX" - else - SUFFIX=".rei" - REFILE="$(basename $FILE .mli)$SUFFIX" - fi - - BASE_NAME=$(echo $FILE | cut -d '.' -f 1) - MIN_VERSION=$(basename $FILE $SUFFIX | cut -d '.' -f 2-4) - - if [ "$MIN_VERSION" != "$BASE_NAME" ] && [ "$(version "$OCAML_VERSION")" -lt "$(version "$MIN_VERSION")" ] - then - notice " ☒ IGNORED REFMT STEP: Requires OCaml >= $MIN_VERSION" - OUTPUT_NOT_GENERATED=1 - else - debug "refmt --heuristics-file $INPUT/arity.txt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$REFILE" - refmt --heuristics-file $INPUT/arity.txt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$REFILE - if ! [[ $? -eq 0 ]]; then - warning " ⊘ TEST FAILED CONVERTING ML TO RE\n" - return 1 - fi - FILE=$REFILE - fi - - else - debug " 'refmt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$FILE'" - refmt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$FILE - fi - - OFILE="${FILE}" - VERSION_SPECIFIC_FILE="${FILE}.${OCAML_VERSION}" - if [ -f "${EXPECTED_OUTPUT}/${VERSION_SPECIFIC_FILE}" ]; then - echo "Found test file specific to version ${OCAML_VERSION}..." - OFILE="${VERSION_SPECIFIC_FILE}" - fi - - if [ "$OUTPUT_NOT_GENERATED" == "0" ]; then - debug " Comparing results: diff $EXPECTED_OUTPUT/$OFILE $OUTPUT/$FILE" - - $DIFF $EXPECTED_OUTPUT/$OFILE $OUTPUT/$FILE - - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED\n" - info " ${INFO}$OUTPUT/$FILE${RESET}" - info " doesn't match expected output" - info " ${INFO}$EXPECTED_OUTPUT/$OFILE${RESET}" - info "" - info " To approve the changes run:" - info " cp $OUTPUT/$FILE $EXPECTED_OUTPUT/$OFILE" - echo "" - return 1 - fi - - debug "Testing --use-stdin" - stdin_test $INPUT/$1 $OUTPUT/$FILE $EXPECTED_OUTPUT/$OFILE $INPUT/arity.txt - - if ! [[ $? -eq 0 ]]; then - return 1 - else - success " ☑ PASS" - echo "" - fi - fi -} - -function idempotent_test() { - FILE=$1 - INPUT=$2 - OUTPUT=$3 - EXTRA_FLAGS=${5-} - - FILENAME=$(basename $FILE) - FILEEXT="${FILENAME##*.}" - - info "Idempotent Test: $FILE" - OUTPUT_NOT_GENERATED=0 - if [ "$(basename $FILE)" != "$(basename $FILE .ml)" ] || [ "$(basename $FILE)" != "$(basename $FILE .mli)" ]; then - if [ "$(basename $FILE)" != "$(basename $FILE .ml)" ]; then - SUFFIX=".re" - REFILE="$(basename $FILE .ml)$SUFFIX" - else - SUFFIX=".rei" - REFILE="$(basename $FILE .mli)$SUFFIX" - fi - - BASE_NAME=$(echo $FILE | cut -d '.' -f 1) - MIN_VERSION=$(basename $FILE $SUFFIX | cut -d '.' -f 2-4) - - if [ "$MIN_VERSION" != "$BASE_NAME" ] && [ "$(version "$OCAML_VERSION")" -lt "$(version "$MIN_VERSION")" ] - then - notice " ☒ IGNORED REFMT STEP: Requires OCaml >= $MIN_VERSION" - OUTPUT_NOT_GENERATED="1" - else - debug " Converting $FILE to $REFILE:" - - debug " Formatting Once: refmt $EXTRA_FLAGS --heuristics-file $INPUT/arity.txt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$REFILE" - refmt --heuristics-file $INPUT/arity.txt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$REFILE - if ! [[ $? -eq 0 ]]; then - warning "⊘ FAILED\n" - return 1 - fi - FILE=$REFILE - debug " Generating output again: refmt $EXTRA_FLAGS --print-width 50 --print re $OUTPUT/$FILE 2>&1 > $OUTPUT/$FILE.formatted" - refmt --print-width 50 --print re $OUTPUT/$FILE 2>&1 > $OUTPUT/$FILE.formatted - fi - else - debug " Formatting Once: 'refmt $EXTRA_FLAGS --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$FILE'" - refmt $EXTRA_FLAGS --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$FILE - - debug " Generating output again: refmt $EXTRA_FLAGS --print-width 50 --print re $OUTPUT/$FILE 2>&1 > $OUTPUT/$FILE.formatted" - refmt $EXTRA_FLAGS --print-width 50 --print re $OUTPUT/$FILE 2>&1 > $OUTPUT/$FILE.formatted - fi - - if [ "$OUTPUT_NOT_GENERATED" == "0" ]; then - $DIFF $OUTPUT/$FILE $OUTPUT/$FILE.formatted - if ! [[ $? -eq 0 ]]; then - warning "⊘ FAILED\n" - info " ${INFO}$OUTPUT/$FILE.formatted${RESET}\n" - info " is not same as" - info " ${INFO}$OUTPUT/$FILE${RESET}" - return 1 - fi - - debug "Testing --use-stdin" - stdin_test $INPUT/$1 $OUTPUT/$FILE $OUTPUT/$FILE $INPUT/arity.txt "$EXTRA_FLAGS" - - if ! [[ $? -eq 0 ]]; then - return 1 - else - stdin_test $OUTPUT/$FILE $OUTPUT/$FILE.formatted $OUTPUT/$FILE $INPUT/arity.txt "$EXTRA_FLAGS" - if ! [[ $? -eq 0 ]]; then - return 1 - else - success " ☑ PASS" - echo - fi - fi - fi -} - -function typecheck_test() { - FILE=$(basename $1) - INPUT=$2 - OUTPUT=$3 - - info "Typecheck Test: $1" - - if [ "$FILE" != "$(basename $FILE .ml)" ] || [ "$FILE" != "$(basename $FILE .mli)" ]; then - if [ "$FILE" != "$(basename $FILE .ml)" ]; then - SUFFIX=".re" - REFILE="$(basename $FILE .ml)$SUFFIX" - else - SUFFIX=".rei" - REFILE="$(basename $FILE .mli)$SUFFIX" - fi - - BASE_NAME=$(echo $FILE | cut -d '.' -f 1) - MIN_VERSION=$(basename $FILE $SUFFIX | cut -d '.' -f 2-4) - - if [ "$MIN_VERSION" != "$BASE_NAME" ] && [ "$(version "$OCAML_VERSION")" -lt "$(version "$MIN_VERSION")" ] - then - notice " ☒ IGNORED REFMT STEP: Requires OCaml >= $MIN_VERSION" - else - debug " Converting $FILE to $REFILE:" - debug "refmt --heuristics-file $INPUT/arity.txt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$REFILE" - refmt --heuristics-file $INPUT/arity.txt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$REFILE - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED\n" - return 1 - fi - FILE=$REFILE - fi - else - debug " Formatting: refmt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$FILE" - refmt --print-width 50 --print re $INPUT/$FILE 2>&1 > $OUTPUT/$FILE - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED\n" - return 1 - fi - fi - - if [ "$FILE" != "$(basename $FILE .re)" ]; then - SUFFIX=".re" - COMPILE_FLAGS="-intf-suffix .rei -impl" - else - SUFFIX=".rei" - COMPILE_FLAGS="-intf" - fi - - BASE_NAME=$(echo $FILE | cut -d '.' -f 1) - MIN_VERSION=$(basename $FILE $SUFFIX | cut -d '.' -f 2-4) - - if [ "$MIN_VERSION" != "$BASE_NAME" ] && [ "$(version "$OCAML_VERSION")" -lt "$(version "$MIN_VERSION")" ] - then - notice " ☒ IGNORED COMPILATION STEP: Requires OCaml >= $MIN_VERSION" - else - debug " Compiling: ocamlc -c -pp $REFMT_NAME_FOR_OCAML $COMPILE_FLAGS $OUTPUT/$FILE" - ocamlc -c -pp "$REFMT_NAME_FOR_OCAML --print binary" $COMPILE_FLAGS "$OUTPUT/$FILE" - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED\n" - return 1 - fi - fi - - success " ☑ PASS" - echo -} - -function oprint_test() { - FILE=$1 - INPUT=$2 - OUTPUT=$3 - EXPECTED_OUTPUT=$4 - INTF_OUTPUT=$5 - - FILENAME=$(basename $FILE) - FILEEXT="${FILENAME##*.}" - - - info "Outcome Printer Test: $FILE" - - debug " 'cat $FILE | testOprint $INPUT/$FILE 2>&1 > $OUTPUT/$FILE'" - cat $INPUT/$FILE | testOprint $INPUT/$FILE 2>&1 > $OUTPUT/$FILE - - debug " 'cp $OUTPUT/$FILE $INTF_OUTPUT/$(basename $FILE .re).rei" - cp $OUTPUT/$FILE $INTF_OUTPUT/$(basename $FILE .re).rei - - - OFILE="${FILE}" - VERSION_SPECIFIC_FILE="${FILE}.${OCAML_VERSION}" - if [ -f "${EXPECTED_OUTPUT}/${VERSION_SPECIFIC_FILE}" ]; then - echo "Found test file specific to version ${OCAML_VERSION}..." - OFILE="${VERSION_SPECIFIC_FILE}" - fi - - debug " Comparing results: diff $EXPECTED_OUTPUT/$OFILE $OUTPUT/$FILE" - - $DIFF $EXPECTED_OUTPUT/$OFILE $OUTPUT/$FILE - - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED\n" - info " ${INFO}$OUTPUT/$FILE${RESET}" - info " doesn't match expected output" - info " ${INFO}$EXPECTED_OUTPUT/$OFILE${RESET}" - info "" - info " To approve the changes run:" - info " cp $OUTPUT/$FILE $EXPECTED_OUTPUT/$OFILE" - echo "" - return 1 - fi - - if ! [[ $? -eq 0 ]]; then - return 1 - else - success " ☑ PASS" - echo - fi -} - -function error_test() { - FILE=$1 - INPUT=$2 - OUTPUT=$3 - EXPECTED_OUTPUT=$4 - - info "Error Test: $FILE" - if [ "$(basename $FILE)" != "$(basename $FILE .ml)" ] || [ "$(basename $FILE)" != "$(basename $FILE .mli)" ]; then - warning " ⊘ FAILED: .ml files should not need to be run against error tests. \n" - return 1 - else - debug " 'refmt --print-width 50 --print re $INPUT/$FILE &> $OUTPUT/$FILE'" - # ensure errors are not absolute filepaths - cd $INPUT - refmt --print-width 50 --print re $(basename $FILE) &> $OUTPUT/$FILE - cd - > /dev/null - fi - - OFILE="${FILE}" - VERSION_SPECIFIC_FILE="${FILE}.${OCAML_VERSION}" - if [ -f "${EXPECTED_OUTPUT}/${VERSION_SPECIFIC_FILE}" ]; then - echo "Found test file specific to version ${OCAML_VERSION}..." - OFILE="${VERSION_SPECIFIC_FILE}" - fi - - debug " Comparing results: diff $EXPECTED_OUTPUT/$OFILE $OUTPUT/$FILE" - - $DIFF $EXPECTED_OUTPUT/$OFILE $OUTPUT/$FILE - - if ! [[ $? -eq 0 ]]; then - warning " ⊘ FAILED\n" - info " ${INFO}$OUTPUT/$FILE${RESET}" - info " doesn't match expected output" - info " ${INFO}$EXPECTED_OUTPUT/$OFILE${RESET}" - info "" - info " To approve the changes run:" - info " cp $OUTPUT/$FILE $EXPECTED_OUTPUT/$OFILE" - echo "" - return 1 - fi - - success " ☑ PASS" - echo -} - - -cd $OPRINT_TEST_INPUT && find . -type f \( -name "*.re*" -or -name "*.ml*" \) | while read file; do - oprint_test $file $OPRINT_TEST_INPUT $OPRINT_TEST_OUTPUT $OPRINT_TEST_EXPECTED_OUTPUT $OPRINT_TEST_INTF_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed unit_test" >> $FAILED_TESTS - fi - - idempotent_test $file $OPRINT_TEST_OUTPUT $OPRINT_TEST_INTF_OUTPUT $OPRINT_TEST_EXPECTED_OUTPUT '-i true --parse re' - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed idempotent_test" >> $FAILED_TESTS - fi -done - -cd $UNIT_TEST_INPUT && find . -type f \( -name "*.re*" -or -name "*.ml*" \) | while read file; do - unit_test $file $UNIT_TEST_INPUT $UNIT_TEST_OUTPUT $UNIT_TEST_EXPECTED_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed unit_test" >> $FAILED_TESTS - fi - - idempotent_test $file $UNIT_TEST_INPUT $UNIT_TEST_OUTPUT $UNIT_TEST_EXPECTED_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed idempotent_test" >> $FAILED_TESTS - fi -done - -cd $IDEMPOTENT_TEST_INPUT && find . -type f \( -name "*.re*" -or -name "*.ml*" \) | while read file; do - idempotent_test $file $IDEMPOTENT_TEST_INPUT $IDEMPOTENT_TEST_OUTPUT $IDEMPOTENT_TEST_EXPECTED_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed idempotent_test" >> $FAILED_TESTS - fi -done - -cd $TYPE_TEST_INPUT -find . -type f \( -name "*.re*" -or -name "*.ml*" \) | sort | while read file; do - typecheck_test $file $TYPE_TEST_INPUT $TYPE_TEST_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed typecheck_test" >> $FAILED_TESTS - fi - unit_test $file $TYPE_TEST_INPUT $TYPE_TEST_OUTPUT $TYPE_TEST_EXPECTED_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed unit_test" >> $FAILED_TESTS - fi - idempotent_test $file $TYPE_TEST_INPUT $TYPE_TEST_OUTPUT $TYPE_TEST_EXPECTED_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed idempotent_test" >> $FAILED_TESTS - fi -done - -cd $ERROR_TEST_INPUT && find . -type f \( -name "*.re*" -or -name "*.ml*" \) | while read file; do - error_test $file $ERROR_TEST_INPUT $ERROR_TEST_OUTPUT $ERROR_TEST_EXPECTED_OUTPUT - if ! [[ $? -eq 0 ]]; then - echo "$file -- failed error_test" >> $FAILED_TESTS - fi -done - -if [[ -s $FAILED_TESTS ]]; then - warning "Failed tests:" - cat $FAILED_TESTS - exit 1 -fi - -exit 0 diff --git a/formatTest/typeCheckedTests/expected_output/arityConversion.re b/formatTest/typeCheckedTests/expected_output/arityConversion.re deleted file mode 100644 index a725636be..000000000 --- a/formatTest/typeCheckedTests/expected_output/arityConversion.re +++ /dev/null @@ -1,54 +0,0 @@ -Some((1, 2, 3)); - -type bcd = - | TupleConstructor((int, int)) - | MultiArgumentsConstructor(int, int); - -let a = TupleConstructor((1, 2)); -let b = - [@implicit_arity] - MultiArgumentsConstructor(1, 2); - -module Test = { - type a = - | And((int, int)) - | Or((int, int)); -}; - -let _ = Test.And((1, 2)); -let _ = Test.Or((1, 2)); -let _ = Some(1); - -Test.And((1, 2)); -Test.Or((1, 2)); -Some(1); - -module M = { - type t = - | TupleConstructorInModule((int, int)); - type t2 = - | TupleConstructor2((int, int)); - type t3 = - | TupleConstructor3((int, int)); -}; - -type t2 = - | TupleConstructor2((int, int)); -type t3 = - | TupleConstructor3((int, int)); - -let _ = M.TupleConstructorInModule((1, 2)); - -let _ = M.TupleConstructor2((1, 2)); -let _ = TupleConstructor2((1, 2)); - -let _ = M.TupleConstructor3((1, 2)); -let _ = TupleConstructor3((1, 2)); - -M.TupleConstructorInModule((1, 2)); - -M.TupleConstructor2((1, 2)); -TupleConstructor2((1, 2)); - -M.TupleConstructor3((1, 2)); -TupleConstructor3((1, 2)); diff --git a/formatTest/typeCheckedTests/expected_output/attributes.4.04.0.re b/formatTest/typeCheckedTests/expected_output/attributes.4.04.0.re deleted file mode 100644 index 26a69c9e2..000000000 --- a/formatTest/typeCheckedTests/expected_output/attributes.4.04.0.re +++ /dev/null @@ -1,21 +0,0 @@ -/* Pexp_letexception with attributes */ -let () = { - [@attribute] - exception E; - raise(E); -}; - -/** Different payloads **/ - -/* Empty signature */ - -[@haha:] -let x = 5; - -/* signature_item */ -[@haha: let x: option(int)] -let x = 5; - -/* Signature */ -[@haha: type t; let x: option(t)] -let x = 5; diff --git a/formatTest/typeCheckedTests/expected_output/attributes.re b/formatTest/typeCheckedTests/expected_output/attributes.re deleted file mode 100644 index 2f25d7945..000000000 --- a/formatTest/typeCheckedTests/expected_output/attributes.re +++ /dev/null @@ -1,825 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ -/** - * Generally, dangling attributes [@..] apply to everything to the left of it, - * up until a comma, equals asignment, arrow, bar, or infix symbol (+/-) or - * prefix. - * - * This has a nice side effect when printing the terms: - * If a node has attributes attached to it, - */; - -/**Floating comment text should be removed*/; - -/** - * Core language features: - * ---------------------- - */; - -/**Floating doc text should be removed*/; - -/**removed text on type def*/ -[@itemAttributeOnTypeDef] -type itemText = int; -type nodeText = /**removed text on item*/ int; -/**removed text on type def*/ -[@itemAttributeOnTypeDef] -type nodeAndItemText = - /**removed text on item*/ int; - -/**removed doc on type def*/ -[@itemAttributeOnTypeDef] -type itemDoc = int; -[@itemAttributeOnTypeDef] -type nodeDoc = /**removed text on item*/ int; -/**removed doc on type def*/ -[@itemAttributeOnTypeDef] -type nodeAndItemDoc = - /**removed text on item*/ int; - -[@itemAttributeOnTypeDef] -type x = int; -type attributedInt = [@onTopLevelTypeDef] int; - -[@itemAttributeOnTypeDef] -type attributedIntsInTuple = ( - [@onInt] int, - [@onFloat] float, -); - -type myDataType('x, 'y) = - | MyDataType('x, 'y); - -type myType = - [@onEntireType] - myDataType( - [@onOptionInt] option(int), - [@onOption] option(float), - ); - -let thisInst: myType = - [@attOnEntireDatatype] - MyDataType(Some(10), Some(10.0)); - -let thisInst: myType = - [@attOnEntireDatatype] - MyDataType( - [@onFirstParam] Some(10), - Some(10.0), - ); - -let x = [@onHello] "hello"; -let x = [@onHello] "hello"; - -let x = "hello" ++ [@onGoodbye] "goodbye"; -let x = [@onHello] "hello" ++ "goodbye"; -let x = [@onHello] "hello" ++ "goodbye"; -let x = "hello" ++ [@onGoodbye] "goodbye"; -let x = [@onEverything] ("hello" ++ "goodbye"); - -let x = 10 + [@on20] 20; -let x = 10 + [@on20] 20; -let x = [@on10] 10 + 20; -let x = [@on10] 10 + 20; -let x = [@attrEverything] (10 + 20); - -let x = 10 - [@on20] 20; -let x = 10 - [@on20] 20; -let x = [@on10] 10 - 20; -let x = [@on10] 10 - 20; -let x = [@attrEntireEverything] (10 - 20); - -let x = true && [@onFalse] false; -let x = true && [@onFalse] false; -let x = [@onTrue] true && false; -let x = [@onTrue] true && false; -let x = [@attrEverything] (true && false); - -/* now make sure to try with variants (tagged and `) */ - -/** - * How attribute parsings respond to other syntactic constructs. - */ -let add = a => - [@onRet] - { - a; - }; -let add = a => [@onRet] a; -let add = [@onEntireFunction] (a => a); - -let res = - if (true) {false} else {[@onFalse] false}; -let res = - [@onEntireIf] (if (true) {false} else {false}); - -let add = (a, b) => - [@onEverything] ([@onA] a + b); -let add = (a, b) => - [@onEverything] ([@onA] a + [@onB] b); -let add = (a, b) => a + [@onB] b; - -let both = [@onEntireFunction] (a => a); -let both = (a, b) => - [@onEverything] ([@onA] a && b); -let both = (a, b) => - [@onA] a && [@onB] [@onB] b; -let both = (a, b) => [@onEverything] (a && b); - -let thisVal = 10; -let x = - 20 - + (- [@onFunctionCall] add(thisVal, thisVal)); -let x = - [@onEverything] - (20 + (- add(thisVal, thisVal))); -let x = - - [@onFunctionCall] add(thisVal, thisVal); -let x = - [@onEverything] (- add(thisVal, thisVal)); - -let bothTrue = (x, y) => {contents: x && y}; -let something = - [@onEverythingToRightOfEquals] - (bothTrue(true, true))^; -let something = - ([@onlyOnArgumentToBang] bothTrue(true, true)) - ^; - -let res = - [@appliesToEntireFunctionApplication] - add(2, 4); -[@appliesToEntireFunctionApplication] -add(2, 4); - -let myObj = {pub p = () => {pub z = () => 10}}; - -let result = - [@onSecondSend] - ([@attOnFirstSend] myObj#p())#z(); - -[@onRecordFunctions] -type recordFunctions = { - p: unit => [@onUnit] recordFunctions, - q: [@onArrow] (unit => unit), -} -[@onUnusedType] -and unusedType = unit; -[@onMyRecord] -let rec myRecord = { - p: () => myRecord, - q: () => (), -} -[@onUnused] -and unused = (); -let result = - [@onSecondSend] - ([@attOnFirstSend] myRecord.p()).q(); - -[@onVariantType] -type variantType = - | [@onInt] Foo(int) - | Bar([@onInt] int) - | Baz; - -[@onVariantType] -type gadtType('x) = - | Foo(int): [@onFirstRow] gadtType(int) - | Bar([@onInt] int) - : [@onSecondRow] gadtType(unit) - | Baz: [@onThirdRow] gadtType([@onUnit] unit); - -[@floatingTopLevelStructureItem hello]; -[@itemAttributeOnEval] -print_string("hello"); - -[@itemAttrOnFirst] -let firstBinding = "first" -[@itemAttrOnSecond] -and secondBinding = "second"; - -/** - * Let bindings. - * ---------------------- - */ -let showLets = () => - [@onOuterLet] - { - let tmp = 20; - [@onFinalLet] - { - let tmpTmp = tmp + tmp; - tmpTmp + tmpTmp; - }; - }; - -/** - * Classes: - * ------------ - */ -/** - * In curried sugar, the class_expr attribute will apply to the return. - */ -[@moduleItemAttribute] -class boxA ('a) (init: 'a) = - [@onReturnClassExpr] { - /**Floating comment text should be removed*/; - /**Floating comment text should be removed*/; - pub pr = init + init + init; - }; - -/** - * In non-curried sugar, the class_expr still sticks to "the simple thing". - */ -class boxB ('a) (init: 'a) = - [@stillOnTheReturnBecauseItsSimple] { - pub pr = init + init + init; - }; - -/* To be able to put an attribute on just the return in that case, use - * parens. */ -[@onBoxC - x; - y -] -class boxC ('a) = - [@onEntireFunction] ( - fun (init: 'a) => - [@onReturnClassExpr] { - pub pr = init + init + init; - } - ); - -[@moduleItemAttribute onTheTupleClassItem] -class tupleClass ('a, 'b) (init: ('a, 'b)) = { - let one = [@exprAttr ten] 10; - let two = [@exprAttr twenty] 20 - and three = [@exprAttr thirty] 30; - [@pr prMember] pub pr = one + two + three; -}; - -[@structureItem] -class type addablePointClassType = { - /**Floating comment text should be removed*/; - /**Floating comment text should be removed*/; - pub x: int; - pub y: int; - pub add: - ( - addablePointClassType, - addablePointClassType - ) => - int; -} -[@structureItem] -and anotherClassType = { - pub foo: int; - pub bar: int; -}; - -class type _x = - [@bs] - { - pub height: int; - }; - -class type _y = { - [@bs.set] - pub height: int; -}; - -[@attr] -class type _z = { - pub height: int; -}; - -module NestedModule = { - [@floatingNestedStructureItem hello]; -}; -[@structureItem] -module type HasAttrs = { - [@onTypeDef] - type t = int; - [@floatingNestedSigItem hello]; - [@sigItem] - class type foo = { - pub foo: int; - pub bar: int; - }; - [@sigItem] - class fooBar: (int) => foo; - /**Floating comment text should be removed*/; - /**Floating comment text should be removed*/; -}; - -type s = - | S(string); - -let S([@onStr] str) = S([@onHello] "hello"); -let [@onConstruction] S(str) = - [@onConstruction] S("hello"); - -type xy = - | X(string) - | Y(string); - -let myFun = - ( - [@onConstruction] X(hello) | - [@onConstruction] Y(hello), - ) => hello; -let myFun = - ( - X([@onHello] hello) | Y([@onHello] hello), - ) => hello; - -/* Another bug: Cannot have an attribute on or pattern - let myFun = fun ((X(hello) | Y(hello)) [@onOrPattern]) => hello; - */ - -/* Bucklescript FFI item attributes */ - -[@bs.val] -external imul: (int, int) => int = "Math.imul"; - -module Js = { - type t('a); -}; - -type classAttributesOnKeys = { - . - [@bs.set] key1: string, - /* The follow two are the same */ - [@bs.get - { - null; - } - ] - key2: [@onType2] Js.t(int), - [@bs.get - { - null; - } - ] - key3: [@onType2] Js.t(int), - key4: Js.t([@justOnInt] int), -}; - -/* extensible variants */ -type attr = ..; - -[@block] -type attr += - | [@tag1] [@tag2] Str - | [@tag3] Float; - -type reconciler('props) = ..; - -[@onVariantType] -type reconciler('props) += - | Foo(int): [@onFirstRow] reconciler(int) - | Bar([@onInt] int): [@onSecondRow] - reconciler(unit) - | [@baz] - Baz: [@onThirdRow] - reconciler([@onUnit] unit); - -type water = ..; - -type water += - pri - | [@foo] [@foo2] MineralWater - | SpringWater; - -type cloud = string; - -type water += - pri - | [@h2o] PreparedWater - | [@nature] RainWater(cloud) - | [@toxic] - MeltedSnowWaterFromNuclearWastelandWithALineBreakBecauseTheNameIsSoLong; - -/* reasonreact */ -type element; - -type reactElement; - -type reactClass; - -/* "react-dom" shouldn't spread the attribute over multiple lines */ -[@bs.val] [@bs.module "react-dom"] -external render: (reactElement, element) => unit = - "render"; - -[@bs.module "f"] external f: int => int = "f"; - -[@bs.val] [@bs.module "react"] [@bs.splice] -external createCompositeElementInternalHack: - ( - reactClass, - {.. "reasonProps": 'props}, - array(reactElement) - ) => - reactElement = - "createElement"; - -external add_nat: (int, int) => int = - "add_nat_bytecode" "add_nat_native"; - -[@bs.module "Bar"] -[@ocaml.deprecated - "Use bar instead. It's a much cooler function. This string needs to be a little long" -] -external foo: bool => bool; - -/* Attributes on an entire polymorphic variant leaf */ -[@bs.module "fs"] -external readFileSync: - ( - ~name: string, - [@bs.string] [ - | `utf8 - | [@bs.as "ascii"] `my_name - ] - ) => - string; - -[@bs.module "fs"] -external readFileSync2: - ( - ~name: string, - [@bs.string] [ - | [@bs.as "ascii"] `utf8 - | [@bs.as "ascii"] `my_name - ] - ) => - string; - -/* Ensure that attributes on extensions are printed */ -[@test [@attr] [%%extension]]; - -external debounce: - (int, [@bs.meth] unit) => unit; - -external debounce: (int, [@bs.meth] unit) => unit = - "debounce"; - -external debounce: - (int, [@bs.meth] unit) => unit; - -external debounce: - int => [@bs.meth] (unit => unit); - -external debounce: - (int, [@bs.meth] (unit => unit)) => - [@bs.meth] (unit => unit); - -external debounce: - ( - int, - [@bs.meth] (unit => unit), - [@bs.meth] (unit => unit) - ) => - [@bs.meth] (unit => unit); - -external debounce: - ( - int, - [@bs.meth] (unit => unit), - [@bs.meth] ( - unit => [@bs.meth] (unit => unit) - ) - ) => - [@bs.meth] (unit => unit); - -let x = "hi"; - -let res = - switch (x) { - | _ => - [@attr] - open String; - open Array; - concat; - index_from; - }; - -let res = - switch (x) { - | _ => [@attr] String.(Array.(concat)) - }; - -/* GADT */ -type value = - | [@foo] VBool'(bool): [@bar] value - | VInt'(int): value; - -/** Different payloads **/ - -/* Empty structure */ -[@haha] -let x = 5; - -/* Expression structure */ -[@haha "hello world"] -let x = 5; - -/* structure_item */ -[@haha let x = 5] -let x = 5; - -/* structure */ -[@haha - let x = 5; - module X = {} -] -let x = 5; - -/* Pattern */ -[@haha? Some(_)] -let x = 5; - -/* Type */ -[@haha: option(int)] -let x = 5; - -/* Record item attributes */ - -type t_ = { - /** Comment attribute on record item */ - x: int, -}; - -type tt = { - [@attr "on record field"] - x: int, -}; - -type ttt = { - [@attr "on record field"] - x: [@attr "on type itself"] int, -}; - -type tttt = { - /** Comment attribute on record item */ - x: int, - [@regularAttribute "on next item"] - y: int, -}; - -type ttttt = { - [@attr "moved to first row"] [@attr] - x: int, -}; - -type tttttt = { - [@attr "testing with mutable field"] - mutable x: int, -}; - -let tmp = - /** On if statement */ - (if (true) {true} else {false}); - -type foo = - option( - [@foo - [ - "how does this break", - "when long enough", - ] - ] ( - [@bar] (int => int), - [@baz] (int => int), - ), - ); - -module Callbacks = { - let cb = () => 1 + 1; -}; - -let test = { - let _x = 1; - [@attr1] - open Callbacks; - let _s = "hello" ++ "!"; - [@attr2] Callbacks.("hello" ++ "!"); -}; - -[@test.call string => string] -let processCommandItem = 12; - -module type Foo = { - [@someattr] - let foo: int => int; -}; - -[@bs.deriving abstract] -type t = { - /** Position (in the pre-change coordinate system) where the change ended. */ - [@bs.as "to"] [@bar] - to_: string, -}; - -[@bs.deriving abstract] -type editorConfiguration = { - /** Determines whether horizontal cursor movement through right-to-left (Arabic, Hebrew) text - is visual (pressing the left arrow moves the cursor left) - or logical (pressing the left arrow moves to the next lower index in the string, which is visually right in right-to-left text). - The default is false on Windows, and true on other platforms. */ - [@bs.optional] - rtlMoveVisually: bool, -}; - -module Fmt = { - let barBaz = () => (); - - type record = {x: int}; -}; - -Fmt.([@foo] barBaz()); -Fmt.([@foo] {x: 1}); -Fmt.([@foo] [1, 2, 3]); -Fmt.([@foo] (1, 2, 3)); -Fmt.([@foo] {val x = 10}); - -/** - * Attributes are associate with the identifier, function call, constructor - * appcation or constructor application pattern in front of it - up until a - * type constraint, an | (or) or an 'as'. - */ - -let punnned_lbl_a = (~lbl as [@ATTR] lbl) => lbl; -let punnned_lbl_b = (~lbl as [@ATTR] (lbl: int)) => lbl; -let punnned_lbl_c = - (~lbl as [@ATTR] [@ATTR2] lbl) => lbl; -let punnned_lbl_d = - (~lbl as [@ATTR] ([@ATTR2] lbl: int)) => lbl; -let punnned_lbl_e = - (~lbl as [@ATTR] [@ATTR2] (lbl: int)) => lbl; - -let punnned_lbl_f = (~lbl as [@ATTR] lbl: int) => lbl; -let punnned_lbl_g = (~lbl as [@ATTR] lbl: int) => lbl; -let punnned_lbl_h = (~lbl as [@ATTR] (lbl: int)) => lbl; -/** Attributes have lower precedence than type constraint. The following should - * be printed identically. */ -let punnned_lbl_i = (~lbl as [@ATTR] lbl: int) => lbl; -let punnned_lbl_i' = - (~lbl as [@ATTR] (lbl: int)) => lbl; - -let nonpunned_lbla = - (~lbl as [@ATTR] lblNonpunned) => lblNonpunned; -let nonpunned_lbl_b = - (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; -let nonpunned_lbl_c = - (~lbl as [@ATTR] [@ATTR2] lblNonpunned) => lblNonpunned; -let nonpunned_lbl_d = - ( - ~lbl as - [@ATTR] ([@ATTR2] lblNonpunned: int), - ) => lblNonpunned; -let nonpunned_lbl_e = - ( - ~lbl as - [@ATTR] [@ATTR2] (lblNonpunned: int), - ) => lblNonpunned; - -let nonpunned_lbl_f = - (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; -let nonpunned_lbl_g = - (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; -let nonpunned_lbl_h = - (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; - -let nonpunned_lbl_i = - (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; -let nonpunned_lbl_i' = - (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; - -let defaulted_punnned_lbl_a = - (~lbl as [@ATTR] lbl=0, ()) => lbl; -let defaulted_punnned_lbl_b = - (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; -let defaulted_punnned_lbl_c = - (~lbl as [@ATTR] [@ATTR2] lbl=0, ()) => lbl; -let defaulted_punnned_lbl_d = - (~lbl as [@ATTR] ([@ATTR2] lbl: int)=0, ()) => lbl; -let defaulted_punnned_lbl_e = - (~lbl as [@ATTR] [@ATTR2] (lbl: int)=0, ()) => lbl; - -let defaulted_punnned_lbl_f = - (~lbl as [@ATTR] lbl: int=0, ()) => lbl; -let defaulted_punnned_lbl_g = - (~lbl as [@ATTR] lbl: int=0, ()) => lbl; -let defaulted_punnned_lbl_h = - (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; -/** Attributes have lower precedence than type constraint. The following should - * be printed identically. */ -let defaulted_punnned_lbl_i = - (~lbl as [@ATTR] lbl: int=0, ()) => lbl; -let defaulted_punnned_lbl_i' = - (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; - -let defaulted_nonpunned_lbla = - (~lbl as [@ATTR] lblNonpunned=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_b = - (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_c = - ( - ~lbl as [@ATTR] [@ATTR2] lblNonpunned=0, - (), - ) => lblNonpunned; -let defaulted_nonpunned_lbl_d = - ( - ~lbl as [@ATTR] ([@ATTR2] lblNonpunned: int)=0, - (), - ) => lblNonpunned; -let defaulted_nonpunned_lbl_e = - ( - ~lbl as [@ATTR] [@ATTR2] (lblNonpunned: int)=0, - (), - ) => lblNonpunned; - -let defaulted_nonpunned_lbl_f = - (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_g = - (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_h = - (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; - -let defaulted_nonpunned_lbl_i = - (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_i' = - (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; - -/* Won't parse: let [@attr] x1 : int = xInt; */ -let xInt = 0; - -/** - Attribute on the pattern node inside of constraint - pattern ( - Ppat_constraint( - pattern(@xxx, Ppat_var "x"), - coretype - ) - ) - This will get sugared to `let ([@attr] x2) : int = xInt` -*/ -let ([@attr] x2): int = xInt; -/** - Attribute on the pattern holding the constraint: - pattern( - @xxx - Ppat_constraint( - pattern(Pexpident "x"), - coretype - ) - ) -*/ -let [@attr] (x3: int) = xInt; -let [@attr] ([@attr0] x4: int) = xInt; -let [@attr] ([@attr0] x5: int) = xInt; - -type eitherOr('a, 'b) = - | Either('a) - | Or('b); -let [@attr] Either(a) | Or(a) = Either("hi"); -// Can drop the the parens around Either. -let [@attr] Either(a) | Or(a) = Either("hi"); -// Can drop the parens around Or. -let Either(b) | [@attr] Or(b) = Either("hi"); -// Should keep the parens around both -let [@attr] (Either(a) | Or(a)) = Either("hi"); - -// Should keep the parens -let [@attr] (_x as xAlias) = 10; -// Should drop the parens -let [@attr] _x as xAlias' = 10; - -/** - Attribute on the expression node inside of constraint - expression( - Pexp_constraint( - expression(@xxx, Pexpident "x"), - coretype - ) - ) -*/ -let _ = ([@xxx] xInt: int); // This should format the same -let _ = ([@xxx] xInt: int); // This should format the same - -/** - Attribute on the expression holding the constraint: - expression( - @xxx - Pexp_constraint( - expression(Pexpident "x"), - coretype - ) - ) -*/ -let _ = [@xxx] (xInt: int); // This should format the same - -[@foo? [@attr] (x: int)]; -[@foo? [@attr] ([@bar] x: int)]; -[@foo? [@attr] (Either("hi") | Or("hi"))]; diff --git a/formatTest/typeCheckedTests/expected_output/attributes.rei b/formatTest/typeCheckedTests/expected_output/attributes.rei deleted file mode 100644 index f1acc5f56..000000000 --- a/formatTest/typeCheckedTests/expected_output/attributes.rei +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/**Floating comment text should be removed*/; -let test: int; - -/** - * Attributes with doc/text attributes should be stripped. They're left over from a - * conversion from ML likely. - * ---------------------- - */; - -/**Floating doc text should be removed*/; - -/** - * #990: don't strip attributes in interface files - */ -[@bs.val] -let x: int; - -type t('a); - -type reactClass; - -type reactElement; - -[@bs.val] [@bs.module "React"] -external createClassInternalHack: - t('classSpec) => reactClass = - "createClass"; - -[@bs.send.pipe: array('a)] -external map: (. ('a => 'b)) => array('b); - -[@bs.send.pipe: array('a)] -external map: (. ('a => 'b)) => array('b); - -[@bs.val] [@bs.module "react"] -external createClassInternalHack: - t('classSpec) => reactClass = - "createClass"; - -[@bs.val] [@bs.module "react"] [@bs.splice] -external createCompositeElementInternalHack: - ( - reactClass, - t({.. reasonProps: 'props}), - array(reactElement) - ) => - reactElement = - "createElement"; - -/* Record item attributes */ - -type t_ = { - /** Comment attribute on record item */ - x: int, -}; - -type tt = { - [@attr "on record field"] - x: int, -}; - -type ttt = { - [@attr "on record field"] - x: [@attr "on type itself"] int, -}; - -type tttt = { - /** Comment attribute on record item */ - x: int, - [@regularAttribute "on next item"] - y: int, -}; - -type ttttt = { - [@attr "moved to first row"] [@attr] - x: int, -}; - -module Foo: {[@someattr] - let foo: int => int;}; diff --git a/formatTest/typeCheckedTests/expected_output/basics.re b/formatTest/typeCheckedTests/expected_output/basics.re deleted file mode 100644 index 0622c6f59..000000000 --- a/formatTest/typeCheckedTests/expected_output/basics.re +++ /dev/null @@ -1,137 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let l = - [1, 2, 3] - |> List.map(i => i + 1, _) - |> List.filter(i => i > 0, _); - -let l = (i => i + 1) |> List.map(_, [1, 2, 3]); - -let x = List.length(_); - -let nested = x => List.length(_); - -let incr = (~v) => v + 1; - -let l1 = - [1, 2, 3] - |> List.map(incr(~v=_)) - |> List.length; - -let l2 = - [1, 2, 3] - |> List.map(incr(~v=_)) - |> List.length; - -let a1 = [|1, 2, 3|] |> Array.get(_, 1); - -let s1 = "roses are red" |> String.get(_, 4); - -let optParam = (~v=?, ()) => v == None ? 0 : 1; - -let l1 = - [Some(1), None, Some(2)] - |> List.map(optParam(~v=?_, ())) - |> List.length; - -let l2 = - [Some(1), None, Some(2)] - |> List.map(optParam(~v=?_, ())) - |> List.length; - -let argIsUnderscore1 = _ => 34; - -let argIsUnderscore2 = _ => 34; - -let argIsUnderscore3 = _: int => 34; - -let argIsUnderscore4 = _: int => 34; - -let argIsUnderscore5 = (_: int) => 34; - -let argIsUnderscore6 = (_: int) => 34; - -type reasonXyz = - | X - | Y(int, int, int) - | Z(int, int) - | Q - | R; - -type reasonXyzWithOf = - | X - | Y(int, int, int) - | Z(int, int) - | Q - | R; - -let reasonBarAs = - fun - | ((Y(_) | Z(_)) as t, _) => { - let _ = t; - true; - } - | _ => false; - -let reasonDoubleBar = - fun - | X - | Y(_, _, _) - | Z(_, _) - | Q => true - | _ => false; - -let reasonDoubleBarNested = - fun - | X - | Y(_, _, _) - | Z(_, _) - | Q => true - | _ => false; - -/* Liberal use of the Any pattern being compatible with multiple - arguments */ -let reasonDoubleBarAnyPatterns = - fun - | X - | Y(_) - | Z(_) - | Q => true - | _ => false; - -let reasonDoubleBarNestedAnyPatterns = - fun - | X - | Y(_) - | Z(_) - | Q => true - | _ => false; - -let (\+) = (+); - -let a = 2.0 ** 4.0; - -let (\===) = (===); - -let expectedPrecendence = - 1 + 1 \=== 1 + 1 && 1 + 1 !== 1 + 1; - -let expectedPrecendence = - 1 \+ 1 \=== 1 \+ 1 && 1 \+ 1 !== 1 \+ 1; - -module X: {let x: (~x: unit=?, unit) => unit;} = { - let x = (~x=(), ()) => (); -}; - -let display = - ( - ~message=("hello": string), - ~person: string="Reason", - time: float, - ) => 1; - -let not = (x, y) => x + y; - -let added: int = not(1, 2); - -let better = foo => !foo ? 42 : not(41, 2); diff --git a/formatTest/typeCheckedTests/expected_output/basics_no_semi.re b/formatTest/typeCheckedTests/expected_output/basics_no_semi.re deleted file mode 100644 index 31c651ee8..000000000 --- a/formatTest/typeCheckedTests/expected_output/basics_no_semi.re +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let l = - [1, 2, 3] - |> List.map(i => i + 1, _) - |> List.filter(i => i > 0, _); - -let l = (i => i + 1) |> List.map(_, [1, 2, 3]); - -let x = List.length(_); - -let nested = x => List.length(_); - -let incr = (~v) => v + 1; - -let l1 = - [1, 2, 3] - |> List.map(incr(~v=_)) - |> List.length; - -let l2 = - [1, 2, 3] - |> List.map(incr(~v=_)) - |> List.length; - -let optParam = (~v=?, ()) => v == None ? 0 : 1; - -let l1 = - [Some(1), None, Some(2)] - |> List.map(optParam(~v=?_, ())) - |> List.length; - -let l2 = - [Some(1), None, Some(2)] - |> List.map(optParam(~v=?_, ())) - |> List.length; - -let argIsUnderscore1 = _ => 34; - -let argIsUnderscore2 = _ => 34; - -let argIsUnderscore3 = _: int => 34; - -let argIsUnderscore4 = _: int => 34; - -let argIsUnderscore5 = (_: int) => 34; - -let argIsUnderscore6 = (_: int) => 34; - -type reasonXyz = - | X - | Y(int, int, int) - | Z(int, int) - | Q - | R; - -type reasonXyzWithOf = - | X - | Y(int, int, int) - | Z(int, int) - | Q - | R; - -let reasonBarAs = - fun - | ((Y(_) | Z(_)) as t, _) => { - let _ = t; - true; - } - | _ => false; - -let reasonDoubleBar = - fun - | X - | Y(_, _, _) - | Z(_, _) - | Q => true - | _ => false; - -let reasonDoubleBarNested = - fun - | X - | Y(_, _, _) - | Z(_, _) - | Q => true - | _ => false; - -/* Liberal use of the Any pattern being compatible with multiple - arguments */ -let reasonDoubleBarAnyPatterns = - fun - | X - | Y(_) - | Z(_) - | Q => true - | _ => false; - -let reasonDoubleBarNestedAnyPatterns = - fun - | X - | Y(_) - | Z(_) - | Q => true - | _ => false; - -let (\+) = (+); - -let a = 2.0 ** 4.0; - -let (\===) = (===); - -let expectedPrecendence = - 1 + 1 \=== 1 + 1 && 1 + 1 !== 1 + 1; - -let expectedPrecendence = - 1 \+ 1 \=== 1 \+ 1 && 1 \+ 1 !== 1 \+ 1; - -module X: {let x: (~x: unit=?, unit) => unit;} = { - let x = (~x=(), ()) => (); -}; - -let display = - ( - ~message=("hello": string), - ~person: string="Reason", - time: float, - ) => 1; diff --git a/formatTest/typeCheckedTests/expected_output/bigarraySyntax.re b/formatTest/typeCheckedTests/expected_output/bigarraySyntax.re deleted file mode 100644 index 3d47fa0a4..000000000 --- a/formatTest/typeCheckedTests/expected_output/bigarraySyntax.re +++ /dev/null @@ -1,50 +0,0 @@ -/* https://github.com/facebook/reason/issues/2038 */ -let my_big_array1 = - Bigarray.Array1.create( - Bigarray.float32, - Bigarray.c_layout, - 20, - ); - -my_big_array1.{1}; - -my_big_array1.{1} = 1.0; - -let my_big_array2 = - Bigarray.Array2.create( - Bigarray.float32, - Bigarray.c_layout, - 20, - 20, - ); - -my_big_array2.{1, 2}; - -my_big_array2.{1, 2} = 1.0; - -let my_big_array3 = - Bigarray.Array3.create( - Bigarray.float32, - Bigarray.c_layout, - 20, - 20, - 20, - ); - -my_big_array3.{1, 2, 3}; - -my_big_array3.{1, 2, 3} = 1.0; - -let reallyLongStringThatWillDefinitelyBreakLine = 0; - -my_big_array3.{ - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine -}; - -my_big_array3.{ - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine -} = 3.0; diff --git a/formatTest/typeCheckedTests/expected_output/comments.re b/formatTest/typeCheckedTests/expected_output/comments.re deleted file mode 100644 index ace4ee3f0..000000000 --- a/formatTest/typeCheckedTests/expected_output/comments.re +++ /dev/null @@ -1,129 +0,0 @@ -/* **** comment */ -/*** comment */ -/** docstring */; -/* comment */ -/** docstring */; -/*** comment */ -/**** comment */ -/***** comment */ - -/*** */ -/**** */ - -/***/ -/****/ - -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ - -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ - -let testingNotQuiteEndOfLineComments = [ - "Item 1" /* Comment For First Item */, - "Item 2" /* Comment For Second Item */, - "Item 3" /* Comment For Third Item */, - "Item 4" /* Comment For Fourth Item - but no semi */ - /* Comment after last item in list. */ -]; /* Comment after list bracket */ - -let testingEndOfLineComments = [ - "Item 1", /* Comment For First Item */ - "Item 2", /* Comment For Second Item */ - "Item 3", /* Comment For Third Item */ - "Item 4" /* Comment For Fourth Item - but before semi */, - /* Comment after last item in list. */ -]; /* Comment after list bracket */ - -/* This time no space between bracket and comment */ -let testingEndOfLineComments = []; /* Comment after list bracket */ - -type t = (int, int); /* End of line on t */ - -type t22 = - /* End of t22 line on type t22 = */ - (int, int); - -type variant = - /* Comment above X */ - | X(int) /* End of line on X */ - /* Comment above Y */ - | Y(int); /* End of line on Y */ -/* Comment on entire type def for variant */ - -type x = { - /* not attached *above* x */ - fieldOne: int, -} /* Attached end of line after x */ -and y = { - /* not attached *above* y */ - fieldTwo: int, -}; /* Attached end of line after y */ - -let result = - switch (X(3)) { - | X(x) => - /* Where does this comment go? */ - let tmp = x; - x + tmp; - | Y(x) => - /* How about this one */ - let tmp = x; - x + tmp; - }; - -let result = - switch (None) { - | Some({fieldOne: 20}) => - /* Where does this comment go? */ - let tmp = 0; - 2 + tmp; - | Some({fieldOne: n}) => - /* How about this one */ - let tmp = n; - n + tmp; - | None => 20 - }; - -type pointWithManyKindsOfComments = { - /* Line before x */ - x: string, /* x field */ - /* Line before y */ - y: string /* y field */ - /* Final row of record */ -}; - -type typeParamPointWithComments('a) = { - /* Line before x */ - x: 'a, /* x field */ - /* Line before y */ - y: 'a /* y field */ - /* Final row of record */ -}; - -let name_equal = (x, y) => x == y; - -let equal = (i1, i2) => - i1.contents === i2.contents && true; /* most unlikely first */ - -let equal = (i1, i2) => - compare(compare(0, 0), compare(1, 1)); /* END OF LINE HERE */ - -module Temp = { - let v = true; - let logIt = (str, ()) => print_string(str); -}; - -let store_attributes = arg => { - let attributes_file = "test"; - let proc_name = attributes_file ++ ".proc"; - let should_write = - /* only overwrite defined procedures */ - Temp.v || !Temp.v; - if (should_write) { - Temp.logIt(proc_name, ()); - }; -}; diff --git a/formatTest/typeCheckedTests/expected_output/comments.rei b/formatTest/typeCheckedTests/expected_output/comments.rei deleted file mode 100644 index c6f7d5851..000000000 --- a/formatTest/typeCheckedTests/expected_output/comments.rei +++ /dev/null @@ -1,39 +0,0 @@ -/* **** comment */ -/*** comment */ -/*** docstring */ -/* comment */ -/*** docstring */ -/*** comment */ -/**** comment */ -/***** comment */ - -/** */; -/*** */ -/**** */ - -/***/ -/****/ - -/** (** comment *) */; -/** (*** comment *) */; - -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ - -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ - -/** - * Multiline - */; - -/** Multiline - * - */; - -/** - ** - */; diff --git a/formatTest/typeCheckedTests/expected_output/comments.rei.4.07.0 b/formatTest/typeCheckedTests/expected_output/comments.rei.4.07.0 deleted file mode 100644 index 0d0f98b81..000000000 --- a/formatTest/typeCheckedTests/expected_output/comments.rei.4.07.0 +++ /dev/null @@ -1,39 +0,0 @@ -/* **** comment */ -/*** comment */ -/** docstring */; -/* comment */ -/** docstring */; -/*** comment */ -/**** comment */ -/***** comment */ - -/** */; -/*** */ -/**** */ - -/***/ -/****/ - -/** (** comment *) */; -/** (*** comment *) */; - -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ - -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ - -/** - * Multiline - */; - -/** Multiline - * - */; - -/** - ** - */; diff --git a/formatTest/typeCheckedTests/expected_output/comments.rei.4.07.1 b/formatTest/typeCheckedTests/expected_output/comments.rei.4.07.1 deleted file mode 100644 index 0d0f98b81..000000000 --- a/formatTest/typeCheckedTests/expected_output/comments.rei.4.07.1 +++ /dev/null @@ -1,39 +0,0 @@ -/* **** comment */ -/*** comment */ -/** docstring */; -/* comment */ -/** docstring */; -/*** comment */ -/**** comment */ -/***** comment */ - -/** */; -/*** */ -/**** */ - -/***/ -/****/ - -/** (** comment *) */; -/** (*** comment *) */; - -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ - -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ - -/** - * Multiline - */; - -/** Multiline - * - */; - -/** - ** - */; diff --git a/formatTest/typeCheckedTests/expected_output/comments.rei.4.08.0 b/formatTest/typeCheckedTests/expected_output/comments.rei.4.08.0 deleted file mode 100644 index 0d0f98b81..000000000 --- a/formatTest/typeCheckedTests/expected_output/comments.rei.4.08.0 +++ /dev/null @@ -1,39 +0,0 @@ -/* **** comment */ -/*** comment */ -/** docstring */; -/* comment */ -/** docstring */; -/*** comment */ -/**** comment */ -/***** comment */ - -/** */; -/*** */ -/**** */ - -/***/ -/****/ - -/** (** comment *) */; -/** (*** comment *) */; - -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ - -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ - -/** - * Multiline - */; - -/** Multiline - * - */; - -/** - ** - */; diff --git a/formatTest/typeCheckedTests/expected_output/comments.rei.4.09.0 b/formatTest/typeCheckedTests/expected_output/comments.rei.4.09.0 deleted file mode 100644 index 0d0f98b81..000000000 --- a/formatTest/typeCheckedTests/expected_output/comments.rei.4.09.0 +++ /dev/null @@ -1,39 +0,0 @@ -/* **** comment */ -/*** comment */ -/** docstring */; -/* comment */ -/** docstring */; -/*** comment */ -/**** comment */ -/***** comment */ - -/** */; -/*** */ -/**** */ - -/***/ -/****/ - -/** (** comment *) */; -/** (*** comment *) */; - -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ - -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ - -/** - * Multiline - */; - -/** Multiline - * - */; - -/** - ** - */; diff --git a/formatTest/typeCheckedTests/expected_output/features406.4.06.0.re b/formatTest/typeCheckedTests/expected_output/features406.4.06.0.re deleted file mode 100644 index 1ef225e53..000000000 --- a/formatTest/typeCheckedTests/expected_output/features406.4.06.0.re +++ /dev/null @@ -1,27 +0,0 @@ -module EM = { - /** Exception */ - - exception E(int, int); -}; - -/* Pcl_open */ -class x = { - open EM; - as self; -}; - -module OM = { - type t; -}; - -class y = { - open EM; - open OM; - as self; -}; - -module type S = { - type t = pri ..; - type t += - | Foo; -}; diff --git a/formatTest/typeCheckedTests/expected_output/features408.4.08.0.re b/formatTest/typeCheckedTests/expected_output/features408.4.08.0.re deleted file mode 100644 index e1a9631b7..000000000 --- a/formatTest/typeCheckedTests/expected_output/features408.4.08.0.re +++ /dev/null @@ -1,19 +0,0 @@ -open { - type t = string; - }; - -let (let+) = (x, f) => List.map(f, x); - -let (and+) = List.map2((x, y) => (x, y)); - -let x = { - let+ x = [2] - and+ y = [3]; - - (x, y); -}; - -let y = { - let+ x = [2]; - x; -}; diff --git a/formatTest/typeCheckedTests/expected_output/features408.4.08.0.rei b/formatTest/typeCheckedTests/expected_output/features408.4.08.0.rei deleted file mode 100644 index ae50e8341..000000000 --- a/formatTest/typeCheckedTests/expected_output/features408.4.08.0.rei +++ /dev/null @@ -1,22 +0,0 @@ -module X: {type t;}; - -module M := X; - -[@attr] -module N := X; - -type y = int; - -type z = int; - -type t = int; - -type x := y; - -[@attr1] -type y := z -[@attr2] -and w := t; - -type x' = | -and y' = |; diff --git a/formatTest/typeCheckedTests/expected_output/imperative.re b/formatTest/typeCheckedTests/expected_output/imperative.re deleted file mode 100644 index cee9f989d..000000000 --- a/formatTest/typeCheckedTests/expected_output/imperative.re +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/* - * Syntax and fallback syntax. - - * vim: set ft=reason: - */ -switch ( - while (true) { - (); - } -) { -| _ => () -}; - -try( - while (true) { - (); - } -) { -| _ => () -}; - -switch ( - for (i in 0 to 10) { - (); - } -) { -| _ => () -}; - -try( - for (i in 0 to 10) { - (); - } -) { -| _ => () -}; - -switch ( - if (true) { - print_string("switching on true"); - } else { - print_string("switching on false"); - } -) { -| _ => () -}; - -try( - for (i in 0 to 10) { - (); - } -) { -| _ => () -}; - -let result = - ( - while (false) { - (); - } - ) - == () - ? false : true; - -switch ( - try( - try() { - | _ => () - } - ) { - | _ => () - } -) { -| () => () -}; - -let shouldStillLoop = {contents: false}; - -while (shouldStillLoop.contents) { - print_string("You're in a while loop"); - print_newline(); -}; - -while ({ - shouldStillLoop.contents = false; - shouldStillLoop.contents; - }) { - print_string("Will never loop"); -}; - -while ((shouldStillLoop := false) == ()) { - print_string("Forever in the loop"); -}; diff --git a/formatTest/typeCheckedTests/expected_output/jsx.re b/formatTest/typeCheckedTests/expected_output/jsx.re deleted file mode 100644 index 9a00b4d76..000000000 --- a/formatTest/typeCheckedTests/expected_output/jsx.re +++ /dev/null @@ -1,584 +0,0 @@ -type component = {displayName: string}; - -module Bar = { - let createElement = (~c=?, ~children, ()) => { - displayName: "test", - }; -}; - -module Nesting = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module Much = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module Foo = { - let createElement = - (~a=?, ~b=?, ~children, ()) => { - displayName: "test", - }; -}; - -module One = { - let createElement = - (~test=?, ~foo=?, ~children, ()) => { - displayName: "test", - }; - - let createElementobvioustypo = - (~test, ~children, ()) => { - displayName: "test", - }; -}; - -module Two = { - let createElement = (~foo=?, ~children, ()) => { - displayName: "test", - }; -}; - -module Sibling = { - let createElement = - (~foo=?, ~children: list(component), ()) => { - displayName: "test", - }; -}; - -module Test = { - let createElement = (~yo=?, ~children, ()) => { - displayName: "test", - }; -}; - -module So = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module Foo2 = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module Text = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module Exp = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module Pun = { - let createElement = - (~intended=?, ~children, ()) => { - displayName: "test", - }; -}; - -module Namespace = { - module Foo = { - let createElement = - ( - ~intended=?, - ~anotherOptional as x=100, - ~children, - (), - ) => { - displayName: "test", - }; - }; -}; - -module Optional1 = { - let createElement = (~required, ~children, ()) => { - switch (required) { - | Some(a) => {displayName: a} - | None => {displayName: "nope"} - }; - }; -}; - -module Optional2 = { - let createElement = - (~optional=?, ~children, ()) => { - switch (optional) { - | Some(a) => {displayName: a} - | None => {displayName: "nope"} - }; - }; -}; - -module DefaultArg = { - let createElement = - (~default=Some("foo"), ~children, ()) => { - switch (default) { - | Some(a) => {displayName: a} - | None => {displayName: "nope"} - }; - }; -}; - -module LotsOfArguments = { - let createElement = - ( - ~argument1=?, - ~argument2=?, - ~argument3=?, - ~argument4=?, - ~argument5=?, - ~argument6=?, - ~children, - (), - ) => { - displayName: "test", - }; -}; - -let div = (~argument1=?, ~children, ()) => { - displayName: "test", -}; - -module List1 = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module List2 = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module List3 = { - let createElement = (~children, ()) => { - displayName: "test", - }; -}; - -module NotReallyJSX = { - let createElement = (~foo, ~bar, children) => { - displayName: "test", - }; -}; - -let notReallyJSX = (~foo, ~bar, children) => { - displayName: "test", -}; - -let fakeRender = (el: component) => { - el.displayName; -}; - -/* end of setup */ - -let (/><) = (a, b) => a + b; -let (><) = (a, b) => a + b; -let (/>) = (a, b) => a + b; -let (> a + b; - -let tag1 = 5 />< 6; -let tag2 = 5 >< 7; -let tag3 = 5 /> 7; -let tag4 = 5 >; -let selfClosing2 = ; -let selfClosing3 = - ; -let a = a + 2} /> ; -let a3 = ; -let a4 = - - - - ; -let a5 = "testing a string here" ; -let a6 = - - "testing a string here" - - "another string" - - {2 + 4} - ; -let intended = true; -let punning = ; -let namespace = ; -let c = ; -let d = ; - -let spaceBefore = - ; -let spaceBefore2 = ; -let siblingNotSpaced = - ; -let jsxInList = []; -let jsxInList2 = []; -let jsxInListA = []; -let jsxInListB = []; -let jsxInListC = []; -let jsxInListD = []; -let jsxInList3 = [, , ]; -let jsxInList4 = [, , ]; -let jsxInList5 = [, ]; -let jsxInList6 = [, ]; -let jsxInList7 = [, ]; -let jsxInList8 = [, ]; -let testFunc = b => b; -let jsxInFnCall = testFunc(); -let lotsOfArguments = - - - ; -let lowerCase =
; - -let b = 0; -let d = 0; -/* - * Should pun the first example: - */ -let a = 5 ; -let a = 5 ; -let a = 5 ; -let a = 0.55 ; -let a = ; -let ident = a ; -let fragment1 = <> ; -let fragment2 = <> ; -let fragment3 = <> ; -let fragment4 = <> ; -let fragment5 = <> ; -let fragment6 = <> ; -let fragment7 = <> ; -let fragment8 = <> ; -let fragment9 = <> 2 2 2 2 ; -let fragment10 = <> 2.2 3.2 4.6 1.2 ; -let fragment11 = <> "str" ; -let fragment12 = <> {6 + 2} {6 + 2} {6 + 2} ; -let fragment13 = <> fragment11 fragment11 ; -let listOfItems1 = 1 2 3 4 5 ; -let listOfItems2 = - 1.0 2.8 3.8 4.0 5.1 ; -let listOfItems3 = - fragment11 fragment11 ; - -/* - * Several sequential simple jsx expressions must be separated with a space. - */ -let thisIsRight = (a, b) => (); -let tagOne = (~children, ()) => (); -let tagTwo = (~children, ()) => (); -/* thisIsWrong ; */ -thisIsRight(, ); - -/* thisIsWrong ; */ -thisIsRight(, ); - -let a = (~children, ()) => (); -let b = (~children, ()) => (); - -let thisIsOkay = - ; - -let thisIsAlsoOkay = - ; - -/* Doesn't make any sense, but suppose you defined an - infix operator to compare jsx */ - < ; - > ; - - < ; - > ; - -let listOfListOfJsx = [<> ]; -let listOfListOfJsx = [<> ]; -let listOfListOfJsx = [ - <> , - <> , -]; -let listOfListOfJsx = [ - <> , - <> , - ...listOfListOfJsx, -]; - -let sameButWithSpaces = [<> ]; -let sameButWithSpaces = [<> ]; -let sameButWithSpaces = [ - <> , - <> , -]; -let sameButWithSpaces = [ - <> , - <> , - ...sameButWithSpaces, -]; - -/* - * Test named tag right next to an open bracket. - */ - -let listOfJsx = []; -let listOfJsx = []; -let listOfJsx = [, ]; -let listOfJsx = [ - , - , - ...listOfJsx, -]; - -let sameButWithSpaces = []; -let sameButWithSpaces = []; -let sameButWithSpaces = [, ]; -let sameButWithSpaces = [ - , - , - ...sameButWithSpaces, -]; - -/** - * Test no conflict with polymorphic variant types. - */ -type thisType = [ | `Foo | `Bar]; -type t('a) = [< thisType] as 'a; - -let asd = - [@foo] "a" "b" ; -let asd2 = - [@foo] - - "a" - "b" - ; - -let span = - (~test: bool, ~foo: int, ~children, ()) => 1; -let asd = - [@foo] "a" "b" ; -/* "video" call doesn't end with a list, so the expression isn't converted to JSX */ -let video = (~test: bool, children) => children; -let asd2 = [@foo] [@JSX] video(~test=false, 10); - -let div = (~children) => 1; -[@JSX] ((() => div)())(~children=[]); - -let myFun = () => { - <> - - - - - - - - - - - - ; -}; - -let myFun = () => { - <> ; -}; - -let myFun = () => { - <> - - - - - - - - - - - - ; -}; - -/** - * Children should wrap without forcing attributes to. - */ - - - - - -; - -/** - * Failing test cases: - */ -/* let res = ) > */ -/* */ -/* ; */ - -/* let res = ) />; */ -let zzz = Some("oh hai"); -/* this should be the only test that generates a warning. We're explicitly testing for this */ -let optionalCallSite = - ; -fakeRender(optionalCallSite); -let optionalArgument = ; -fakeRender(optionalArgument); -let optionalArgument = - ; -fakeRender(optionalArgument); -let defaultArg = ; -fakeRender(defaultArg); -let defaultArg = ; -fakeRender(defaultArg); - -([@bla] - [@JSX] - NotReallyJSX.createElement([], ~foo=1, ~bar=2)); -([@bla] - [@JSX] - NotReallyJSX.createElement(~foo=1, [], ~bar=2)); -([@bla] [@JSX] notReallyJSX([], ~foo=1)); -([@bla] [@JSX] notReallyJSX(~foo=1, [], ~bar=2)); - -/* children can be at any position */ -; - -; - -/* preserve some other attributes too! */ -([@bla] ); -([@bla] ); - -([@bla] ); -([@bla] ); - -/* Overeager JSX punning #1099 */ -module Metal = { - let fiber = "fiber"; -}; - -module OverEager = { - let createElement = (~fiber, ~children, ()) => { - displayName: "test", - }; -}; - -let element = ; - -type style = { - width: int, - height: int, - paddingTop: int, - paddingLeft: int, - paddingRight: int, - paddingBottom: int, -}; - -module Window = { - let createElement = (~style, ~children, ()) => { - displayName: "window", - }; -}; - -let w = - ; - -let foo = None; - -let g = ; - -/* https://github.com/facebook/reason/issues/1428 */ - ...element ; - - ...{a => 1} ; - - ... ; - - ...[|a|] ; - - ...(1, 2) ; - -module Foo3 = { - let createElement = (~bar, ~children, ()) => - (); -}; - -} />; - -let onClickHandler = () => (); - -let div = (~onClick, ~children, ()) => (); - -
- <> "foobar" -
; - -/* - * This is identical to just having "foobar" as a single JSX child (which means - * it's in a list). - */ -let yetAnotherDiv = -
"foobar"
; - -let tl = []; - -/* - * Spreading a list that has an identifier/expression as its tail. This should - * preserve the spread and preserve the braces. [list] is not considered - * simple for the purposes of spreading into JSX, or as a child. - */ -
- ...{[yetAnotherDiv, ...tl]} -
; - -/* - * This is equivalent to having no children. - */ -
; diff --git a/formatTest/typeCheckedTests/expected_output/knownMlIssues.re b/formatTest/typeCheckedTests/expected_output/knownMlIssues.re deleted file mode 100644 index b5c2a7af9..000000000 --- a/formatTest/typeCheckedTests/expected_output/knownMlIssues.re +++ /dev/null @@ -1,32 +0,0 @@ -/* [x] fixed */ -type t2 = (int, int); /* attributed to entire type not binding */ - -type color = - | Red(int) /* After red */ - | Black(int) /* After black */ - | Green(int); /* Does not remain here */ - -let blahCurriedX = x => - fun - | Red(10) - | Black(20) - | Green(10) => 1 /* After or pattern green */ - | Red(x) => 0 /* After red */ - | Black(x) => 0 /* After black */ - | Green(x) => 0; /* After second green */ -/* On next line after blahCurriedX def */ - -/* EOL comments wrap because other elements break first (in this example - "mutable" causes breaks. We either need: - 1. To prevent wrapping of anything inside of eol comments attachments. - 2. Losslessly wrap eol comments. - */ -/* This example illustrates the above issue, but isn't een idempotent due to the issue. */ -/* type cfg = { */ -/* node_id : int ref; */ -/* node_list : int list ref; */ -/* name_pdesc_tbl : (int, (int, int) Hashtbl.t) Hashtbl.t; (** Map proc name to procdesc *) */ -/* mutable priority_set : (int, int) Hashtbl.t (** set of function names to be analyzed first *) */ -/* } */ -/* */ -/* */ diff --git a/formatTest/typeCheckedTests/expected_output/knownReIssues.re b/formatTest/typeCheckedTests/expected_output/knownReIssues.re deleted file mode 100644 index 60e77946e..000000000 --- a/formatTest/typeCheckedTests/expected_output/knownReIssues.re +++ /dev/null @@ -1,23 +0,0 @@ -/** - Issue 940: https://github.com/facebook/reason/issues/940 - The parens in the exception match case with an alias, - are required for correct parsing: - i.e. (Sys_error _ as exc) instead of Sys_error _ as exc - The latter doesn't type-check with Error: Unbound value exc. - Warning 11 (unused match case) is also triggered. - */ -let f = () => raise(Sys_error("error")); - -switch (f()) { -| x => () -| exception (Sys_error(_) as exc) => raise(exc) -}; - -exception Foo(string); - -let g = () => raise(Foo("bar errors")); - -switch (g()) { -| x => () -| exception (Foo(f)) => raise(Foo(f)) -}; diff --git a/formatTest/typeCheckedTests/expected_output/lazy.re b/formatTest/typeCheckedTests/expected_output/lazy.re deleted file mode 100644 index 6161ee0c6..000000000 --- a/formatTest/typeCheckedTests/expected_output/lazy.re +++ /dev/null @@ -1,38 +0,0 @@ -let myComputation = - lazy({ - let tmp = 10; - let tmp2 = 20; - tmp + tmp2; - }); - -type myRecord = {myRecordField: int}; - -let operateOnLazyValue = (lazy {myRecordField}) => { - let tmp = myRecordField; - tmp + tmp; -}; - -let result = - operateOnLazyValue( - lazy({myRecordField: 100}), - ); - -type box('a) = - | Box('a); - -let lazy thisIsActuallyAPatternMatch = lazy(200); -let tmp: int = thisIsActuallyAPatternMatch; -let (lazy (Box(i)), x) = ( - lazy(Box(200)), - 100, -); -let tmp: int = i; - -let myComputation = lazy(200); - -let reallyLoooooooooooooongIdentifierThatSpansMoreThan50Cols = 200; - -let foo = - lazy( - reallyLoooooooooooooongIdentifierThatSpansMoreThan50Cols - ); diff --git a/formatTest/typeCheckedTests/expected_output/letop.re b/formatTest/typeCheckedTests/expected_output/letop.re deleted file mode 100644 index fad703713..000000000 --- a/formatTest/typeCheckedTests/expected_output/letop.re +++ /dev/null @@ -1,44 +0,0 @@ -let (let.opt) = (x, f) => - switch (x) { - | None => None - | Some(x) => f(x) - }; -let (let.&opt) = (x, f) => - switch (x) { - | None => None - | Some(x) => Some(f(x)) - }; - -let z = { - let.opt a = Some(2); - let.&opt b = Some(5); - a + b; -}; - -let (let./\/) = (x, f) => - switch (x) { - | None => None - | Some(x) => f(x) - }; -let ( let.&/\* ) = (x, f) => - switch (x) { - | None => None - | Some(x) => Some(f(x)) - }; - -/* Test syntax that could potentially conflict with comments */ -let z = { - let./\/ a = Some(2); - let.&/\* b = Some(5); - a + b; -}; - -let _ = { - let.opt _ = Some("a"); - - let.opt _ = Some("c"); - - // hello - - None; -}; diff --git a/formatTest/typeCheckedTests/expected_output/mlSyntax.re b/formatTest/typeCheckedTests/expected_output/mlSyntax.re deleted file mode 100644 index 084c07817..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlSyntax.re +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/** - * Testing pattern matching using ml syntax to exercise nesting of cases. - */; - -type xyz = - | X - | Y(int, int, int) - | Z(int, int) - | Q - | R; - -let doubleBar = - fun - | X - | [@implicit_arity] Y(_, _, _) - | [@implicit_arity] Z(_, _) - | Q => true - | _ => false; - -let doubleBarNested = - fun - | X - | [@implicit_arity] Y(_, _, _) - | [@implicit_arity] Z(_, _) - | Q => true - | _ => false; - -/* Liberal use of the Any pattern being compatible with multiple arguments */ -let doubleBarAnyPatterns = - fun - | X - | Y(_) - | Z(_) - | Q => true - | _ => false; - -let doubleBarNestedAnyPatterns = - fun - | X - | Y(_) - | Z(_) - | Q => true - | _ => false; - -type bcd = - | B - | C - | D - | E; -type a = - | A(bcd); -let result = - switch (B) { - | B - | C - | D - | E => () - }; - -let nested_match = - fun - | A(B | C | D | E) => 3; - -let some = Some((1, 2, 3)); - -let (\===) = (==); - -/* Test regression for https://github.com/facebook/Reason/issues/222 */ -let _ = Pervasives.(==); - -let structuralEquality = 1 == 1; - -let physicalInequality = 1 != 2; - -let referentialEquality = 2 === 2; - -let referentialInequality = 2 !== 2; - -let equalityInIf = - if (1 == 1) { - true; - } else { - false; - }; - -let equalityWithIdentifiers = - structuralEquality == referentialEquality; - -let nestedSome = Some((1, 2, Some((1, 2, 3)))); - -let nestedSomeSimple = Some(Some((1, 2, 3))); - -module EM = { - /** Exception */ - - exception E(int, int); -}; - -exception Ealias = EM.E; - -let switc = "match"; -let switch_ = "match"; -let switch__ = "match"; -let pub_ = "method"; -let pub__ = "method"; -let pri_ = "private"; -let pri__ = "private"; - -external private: unit => unit; -external pri_: unit => unit; - -type pub_ = int; -type pub__ = int; diff --git a/formatTest/typeCheckedTests/expected_output/mlVariants.re b/formatTest/typeCheckedTests/expected_output/mlVariants.re deleted file mode 100644 index dba6c3c78..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlVariants.re +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type polyVariantsInMl = [ - | `IntTuple(int, int) - | `StillAnIntTuple(int, int) -]; - -let intTuple = `IntTuple((1, 2)); -let stillAnIntTuple = `StillAnIntTuple((4, 5)); -let sumThem = - fun - | `IntTuple(x, y) => x + y - | `StillAnIntTuple(a, b) => a + b; - -type nonrec t = - | A(int) - | B(bool); - -type s = [ | `Poly]; - -let x: s = `Poly; - -/* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 */ -let x: s = `Poly; diff --git a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.0 b/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.0 deleted file mode 100644 index 2e1204e7a..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.0 +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type polyVariantsInMl = [ - | `IntTuple(int, int) - | `StillAnIntTuple(int, int) -]; - -let intTuple = `IntTuple((1, 2)); -let stillAnIntTuple = `StillAnIntTuple((4, 5)); -let sumThem = - fun - | `IntTuple(x, y) => x + y - | `StillAnIntTuple(a, b) => a + b; - -type nonrec t = - | A(int) - | B(bool); - -type s = [ | `Poly]; - -let x: s = `Poly; - -/* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 */ -let x: s = (`Poly: s); diff --git a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.1 b/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.1 deleted file mode 100644 index 2e1204e7a..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.06.1 +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type polyVariantsInMl = [ - | `IntTuple(int, int) - | `StillAnIntTuple(int, int) -]; - -let intTuple = `IntTuple((1, 2)); -let stillAnIntTuple = `StillAnIntTuple((4, 5)); -let sumThem = - fun - | `IntTuple(x, y) => x + y - | `StillAnIntTuple(a, b) => a + b; - -type nonrec t = - | A(int) - | B(bool); - -type s = [ | `Poly]; - -let x: s = `Poly; - -/* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 */ -let x: s = (`Poly: s); diff --git a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.0 b/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.0 deleted file mode 100644 index 2e1204e7a..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.0 +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type polyVariantsInMl = [ - | `IntTuple(int, int) - | `StillAnIntTuple(int, int) -]; - -let intTuple = `IntTuple((1, 2)); -let stillAnIntTuple = `StillAnIntTuple((4, 5)); -let sumThem = - fun - | `IntTuple(x, y) => x + y - | `StillAnIntTuple(a, b) => a + b; - -type nonrec t = - | A(int) - | B(bool); - -type s = [ | `Poly]; - -let x: s = `Poly; - -/* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 */ -let x: s = (`Poly: s); diff --git a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.1 b/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.1 deleted file mode 100644 index 2e1204e7a..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.07.1 +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type polyVariantsInMl = [ - | `IntTuple(int, int) - | `StillAnIntTuple(int, int) -]; - -let intTuple = `IntTuple((1, 2)); -let stillAnIntTuple = `StillAnIntTuple((4, 5)); -let sumThem = - fun - | `IntTuple(x, y) => x + y - | `StillAnIntTuple(a, b) => a + b; - -type nonrec t = - | A(int) - | B(bool); - -type s = [ | `Poly]; - -let x: s = `Poly; - -/* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 */ -let x: s = (`Poly: s); diff --git a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.08.0 b/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.08.0 deleted file mode 100644 index 2e1204e7a..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.08.0 +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type polyVariantsInMl = [ - | `IntTuple(int, int) - | `StillAnIntTuple(int, int) -]; - -let intTuple = `IntTuple((1, 2)); -let stillAnIntTuple = `StillAnIntTuple((4, 5)); -let sumThem = - fun - | `IntTuple(x, y) => x + y - | `StillAnIntTuple(a, b) => a + b; - -type nonrec t = - | A(int) - | B(bool); - -type s = [ | `Poly]; - -let x: s = `Poly; - -/* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 */ -let x: s = (`Poly: s); diff --git a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.09.0 b/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.09.0 deleted file mode 100644 index 2e1204e7a..000000000 --- a/formatTest/typeCheckedTests/expected_output/mlVariants.re.4.09.0 +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type polyVariantsInMl = [ - | `IntTuple(int, int) - | `StillAnIntTuple(int, int) -]; - -let intTuple = `IntTuple((1, 2)); -let stillAnIntTuple = `StillAnIntTuple((4, 5)); -let sumThem = - fun - | `IntTuple(x, y) => x + y - | `StillAnIntTuple(a, b) => a + b; - -type nonrec t = - | A(int) - | B(bool); - -type s = [ | `Poly]; - -let x: s = `Poly; - -/* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 */ -let x: s = (`Poly: s); diff --git a/formatTest/typeCheckedTests/expected_output/mutation.re b/formatTest/typeCheckedTests/expected_output/mutation.re deleted file mode 100644 index e31b0a060..000000000 --- a/formatTest/typeCheckedTests/expected_output/mutation.re +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/** - * Testing mutations. - */ -let holdsAUnit = ref(); - -let holdsABool = ref(false); - -let holdsAnInt = ref(0); - -let holdsAHoldsABool = ref(ref(true)); - -let () = holdsAUnit := holdsABool := false; - -/* Should be parsed as: */ -/* And so they should both be printed the same */ -let () = holdsAUnit := holdsABool := false; - -/* - * The following: - * - * something = x := e - * - * Should be parsed as: - * - * something = (x := e) - */ -holdsAUnit.contents = holdsAnInt := 0; - -holdsABool.contents = holdsAnInt.contents == 100; - -let numberToSwitchOn = 100; - -switch (numberToSwitchOn) { -| (-3) -| (-2) -| (-1) => () -| 0 => holdsAUnit.contents = () -| 1 => holdsAUnit.contents = holdsAnInt := 0 -| 2 => - true - ? holdsAUnit.contents = () - : holdsABool.contents ? () : () -| 3 => - true - ? holdsAUnit := () - : holdsABool.contents ? () : () -| 4 => true ? holdsAnInt := 40 : () -| 5 => holdsAnInt := 40 -| _ => () -}; - -let mutativeFunction = - fun - | Some(x) => holdsAUnit.contents = () - | None => holdsAUnit := (); diff --git a/formatTest/typeCheckedTests/expected_output/newAST.4.06.0.re b/formatTest/typeCheckedTests/expected_output/newAST.4.06.0.re deleted file mode 100644 index 6d767e348..000000000 --- a/formatTest/typeCheckedTests/expected_output/newAST.4.06.0.re +++ /dev/null @@ -1,35 +0,0 @@ -/* Oinherit (https://github.com/ocaml/ocaml/pull/1118) */ -type t = {. a: string}; - -type t1 = { - . - n: string, - ...t, -}; - -type t2('a) = - { - .. - o: string, - ...t, - } as 'a; - -/* Pcl_open, Pcty_open (https://github.com/ocaml/ocaml/pull/1249) */ -module EM = { - type t; -}; - -module OM = { - type t; -}; - -class x = { - open EM; - as self; -}; - -class y = { - open EM; - open OM; - as self; -}; diff --git a/formatTest/typeCheckedTests/expected_output/oo.re b/formatTest/typeCheckedTests/expected_output/oo.re deleted file mode 100644 index 886c49bf2..000000000 --- a/formatTest/typeCheckedTests/expected_output/oo.re +++ /dev/null @@ -1,433 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -class virtual stack ('a) (init) = { - /* - * The "as this" is implicit and will be formatted away. - */ - val virtual dummy: unit; - val mutable v: list('a) = init; - pub virtual implementMe: int => int; - pub pop = - switch (v) { - | [hd, ...tl] => - v = tl; - Some(hd); - | [] => None - }; - pub push = hd => { - v = [hd, ...v]; - }; - initializer { - print_string("initializing object"); - }; - pub explicitOverrideTest = a => { - a + 1; - }; - pri explicitOverrideTest2 = a => { - a + 1; - }; -}; - -let tmp = { - /** - * comment here. - */; - val x = 10 -}; - -/** - * Comment on stackWithAttributes. - */ -[@thisShouldntBeFormattedAway] -class virtual stackWithAttributes ('a) (init) = { - /* Before class */ - /* The "as this" should not be formatted away because attributes. */ - as [@thisShouldntBeFormattedAway] this; - /* Before floatting attribute */ - [@floatingAttribute]; - /* Virtual member */ - [@itemAttr1] val virtual dummy: unit; - [@itemAttr2] val mutable v: list('a) = init; - pub virtual implementMe: int => int; - pub pop = - switch (v) { - | [hd, ...tl] => - v = tl; - Some(hd); - | [] => None - }; - pub push = hd => { - v = [hd, ...v]; - }; - initializer { - print_string("initializing object"); - }; -}; - -class extendedStack ('a) (init) = { - inherit (class stack('a))(init); - val dummy = (); - pub implementMe = i => i; -}; - -class extendedStackAcknowledgeOverride - ('a) - (init) = { - inherit (class stack('a))(init); - val dummy = (); - pub implementMe = i => { - i + 1; - }; - pub! explicitOverrideTest = a => { - a + 2; - }; - pri! explicitOverrideTest2 = a => { - a + 2; - }; -}; - -let inst = (new extendedStack)([1, 2]); - -/** - * Recursive classes. - */ -/* - * First recursive class. - */ -class firstRecursiveClass (init) = { - val v = init; -} -/* - * Second recursive class. - */ -and secondRecursiveClass (init) = { - val v = init; -}; - -/** - * For now, mostly for historic reasons, the syntax for type - * definitions/annotations on anonymous objects are different than - * "class_instance_type". That needn't be the case. The only challenge is that - * whatever we do, there is a slight challenge in avoiding conflicts with - * records. Clearly {x:int, y:int} will conflict. However, open object types in - * the form of {.. x:int, y:int} do not conflict. The only thing that must be - * resolved is closed object types and records. you could have a special token - * that means "closed". {. x: int, y:int}. If only closed object types would be - * optimized in the same way that records are, records could just be replaced - * with closed object types. - */ -/** - * Anonymous objects. - */ - -type closedObj = {.}; - -let (<..>) = (a, b) => a + b; -let five = 2 <..> 3; - -type nestedObj = {. bar: {. a: int}}; - -let (>>) = (a, b) => a > b; - -let bigger = 3 >> 2; - -type typeDefForClosedObj = { - . - x: int, - y: int, -}; -type typeDefForOpenObj('a) = - { - .. - x: int, - y: int, - } as 'a; -let anonClosedObject: { - . - x: int, - y: int, -} = { - pub x = { - 0; - }; - pub y = { - 0; - } -}; - -let onlyHasX = {pub x = 0}; -let xs: list({. x: int}) = [ - onlyHasX, - (anonClosedObject :> {. x: int}), -]; - -let constrainedAndCoerced = ( - [anonClosedObject, anonClosedObject]: - list({ - . - x: int, - y: int, - }) :> - list({. x: int}) -); - -/* If one day, unparenthesized type constraints are allowed on the RHS of a - * record value, we're going to have to be careful here because >} is parsed as - * a separate kind of token (for now). Any issues would likely be caught in the - * idempotent test case. - */ -let xs: ref({. x: int}) = { - contents: (anonClosedObject :> {. x: int}), -}; - -let coercedReturn = { - let tmp = anonClosedObject; - (tmp :> {. x: int}); -}; - -let acceptsOpenAnonObjAsArg = - ( - o: { - .. - x: int, - y: int, - }, - ) => - o#x + o#y; -let acceptsClosedAnonObjAsArg = - ( - o: { - . - x: int, - y: int, - }, - ) => - o#x + o#y; -let res = - acceptsOpenAnonObjAsArg({ - pub x = 0; - pub y = 10 - }); - -let res = - acceptsOpenAnonObjAsArg({ - pub x = 0; - pub y = 10; - pub z = 10 - }); - -let res = - acceptsClosedAnonObjAsArg({ - pub x = 0; - pub y = 10 - }); - -/* TODO: Unify class constructor return values with function return values */ -class myClassWithAnnotatedReturnType - (init) - : { - pub x: int; - pub y: int; - } = { - pub x: int = init; - pub y = init; -}; -/** - * May include a trailing semi after type row. - */ -class myClassWithAnnotatedReturnType2 - (init) - : { - pub x: int; - pub y: int; - } = { - pub x: int = init; - pub y = init; -}; - -/** - * May use equals sign, and may include colon if so. - */ -class myClassWithAnnotatedReturnType3 - (init) - : { - pub x: int; - pub y: int; - } = { - pub x: int = init; - pub y: int = init; -}; - -/** - * The one difference between class_constructor_types and expression - * constraints, is that we have to include the prefix word "new" before the - * final component of any arrow. This isn't required when annotating just the - * return value with ": foo ". - * This is only to temporarily work around a parsing conflict. (Can't tell if - * in the final arrow component it should begin parsing a non_arrowed_core_type - * or a class_instance_type). A better solution, would be to include - * class_instance_type as *part* of core_type, but then fail when it is - * observed in the non-last arrow position, or if a non_arrowed_core_type - * appears in the last arrow position. - * - * class_instance_type wouldn't always fail if parsed as any "core type" - * everywhere else in the grammar. - * - * Once nuance to that would be making a parse rule for "type application", and - * deferring whether or not that becomes a Pcty_constr or a Ptyp_constr. (The - * same for type identifiers and extensions.) - */ -class myClassWithAnnotatedReturnType3_annotated_constructor: - (int) => - { - pub x: int; - pub y: int; - } = - fun (init) => { - pub x: int = init; - pub y: int = init; - }; - -class tupleClass ('a, 'b) (init: ('a, 'b)) = { - pub pr = init; -}; - -module HasTupleClasses: { - /** - * exportedClass. - */ - class exportedClass: - (int) => - { - pub x: int; - pub y: int; - }; - /** - * anotherExportedClass. - */ - class anotherExportedClass ('a, 'b): - (('a, 'b)) => - { - pub pr: ('a, 'b); - }; -} = { - /** - * exportedClass. - */ - class exportedClass = - class myClassWithAnnotatedReturnType3; - - /** - * anotherExportedClass. - */ - class anotherExportedClass ('a, 'b) = - class tupleClass('a, 'b); -}; - -class intTuples = class tupleClass(int, int); - -class intTuplesHardcoded = - (class tupleClass(int, int))((8, 8)); - -/** - * Note that the inner tupleClass doesn't have the "class" prefix because - * they're not kinds of classes - they're types of *values*. - * The parens here shouldn't be required. - */ -class intTuplesTuples = - class tupleClass( - tupleClass(int, int), - tupleClass(int, int), - ); - -let x: tupleClass(int, int) = { - pub pr = (10, 10) -}; - -let x: #tupleClass(int, int) = x; - -let incrementMyClassInstance: - (int, #tupleClass(int, int)) => - #tupleClass(int, int) = - (i, inst) => { - let (x, y) = inst#pr; - {pub pr = (x + i, y + i)}; - }; - -class myClassWithNoTypeParams = {}; -/** - * The #myClassWithNoTypeParams should be treated as "simple" - */ -type optionalMyClassSubtype('a) = - option(#myClassWithNoTypeParams) as 'a; - -/** - * Remember, "class type" is really "class_instance_type" (which is the type of - * what is returned from the constructor). - * - * And when defining a class: - * - * addablePoint is the "class instance type" type generated in scope which is - * the closed object type of the return value of the constructor. - * - * #addablePoint is the extensible form of addablePoint (anything that - * adheres to the "interface.") - */ -class type addablePointClassType = { - pub x: int; - pub y: int; - pub add: - ( - addablePointClassType, - addablePointClassType - ) => - int; -}; - -/** - * Class constructor types can be annotated. - */ -class addablePoint: - (int) => addablePointClassType = - fun (init) => { - as self; - pub add = - ( - one: addablePointClassType, - two: addablePointClassType, - ) => - one#x + two#x + one#y + two#x; - pub x: int = init; - pub y = init; - }; - -class addablePoint2: - (int) => addablePointClassType = - fun (init) => { - as self; - pub add = - ( - one: addablePointClassType, - two: addablePointClassType, - ) => - one#x + two#x + one#y + two#x; - pub x: int = init; - pub y = init; - }; - -module type T = { - class virtual cl ('a): {} - and cl2: {}; -}; - -let privacy = {pri x = c => 5 + c}; - -module Js = { - type t('a); -}; - -/* supports trailing comma */ -type stream('a) = { - . - "observer": ('a => unit) => unit, -}; diff --git a/formatTest/typeCheckedTests/expected_output/patternMatching.re b/formatTest/typeCheckedTests/expected_output/patternMatching.re deleted file mode 100644 index 2de0a9bd2..000000000 --- a/formatTest/typeCheckedTests/expected_output/patternMatching.re +++ /dev/null @@ -1,312 +0,0 @@ -type point = { - x: int, - y: int, -}; - -let id = x => x; - -type myVariant = - | TwoCombos(inner, inner) - | Short - | AlsoHasARecord(int, int, point) -and inner = - | Unused - | HeresTwoConstructorArguments(int, int); - -let computeTuple = (a, b, c, d, e, f, g, h) => ( - a + b, - c + d, - e + f, - g + h, -); - -let res = - switch (TwoCombos(Unused, Unused)) { - | TwoCombos( - HeresTwoConstructorArguments(x, y), - HeresTwoConstructorArguments(a, b), - ) => ( - x, - y, - a, - b, - ) - | TwoCombos(_, _) => (0, 0, 0, 0) - | Short - | AlsoHasARecord(300, _, _) => ( - 100000, - 100000, - 100000, - 100000, - ) - | AlsoHasARecord(firstItem, two, {x, y}) => - computeTuple( - firstItem, - firstItem, - firstItem, - firstItem, - firstItem, - two, - two, - two, - ) - }; - -/** - * Match bodies may include sequence expressions, but without the `{}` - * braces required. - */ -let res = - switch (TwoCombos(Unused, Unused)) { - | TwoCombos( - HeresTwoConstructorArguments(x, y), - HeresTwoConstructorArguments(a, b), - ) => - let ret = (x, y, a, b); - ret; - | TwoCombos(_, _) => - /** - * See, no braces required - saves indentation as well! - */ - let ret = (0, 0, 0, 0); - ret; - | Short - | AlsoHasARecord(300, _, _) => - /** - * And no final semicolon is required. - */ - let ret = (100000, 100000, 100000, 100000); - ret; - | AlsoHasARecord(firstItem, two, {x, y}) => - computeTuple( - firstItem, - firstItem, - firstItem, - firstItem, - firstItem, - two, - two, - two, - ) - }; - -/** - * Ensure that nested Pexp_functions are correctly wrapped in parens. - * - */ -let res = - switch (TwoCombos(Unused, Unused)) { - | TwoCombos( - HeresTwoConstructorArguments(x, y), - HeresTwoConstructorArguments(a, b), - ) => ( - fun - | Some(x) => x + 1 - | None => 0 - ) - | TwoCombos(_, _) => - let x = ( - fun - | Some(x) => x + 1 - | None => 0 - ); - x; - | Short - | AlsoHasARecord(300, _, _) => - id( - fun - | Some(x) => x + 1 - | None => 0, - ) - | AlsoHasARecord(firstItem, two, {x, y}) => - id( - fun - | Some(x) => x + 1 - | None => 0, - ) - }; - -/* test (), which is sugar for (()) */ -switch (Some()) { -| Some () => 1 -| _ => 2 -}; -switch (Some()) { -| Some () => 1 -| _ => 2 -}; -switch (Some()) { -| Some () => 1 -| _ => 2 -}; -switch (Some()) { -| Some () => 1 -| _ => 2 -}; - -type foo = - | Foo(unit); -switch (Foo()) { -| Foo () => 1 -}; -switch (Foo()) { -| Foo () => 1 -}; -switch (Foo()) { -| Foo () => 1 -}; -switch (Foo()) { -| Foo () => 1 -}; - -switch () { -| () => 1 -}; -switch () { -| () => 1 -}; -switch () { -| () => 1 -}; -switch () { -| () => 1 -}; - -switch (Some(1)) { -| Some(1) => 1 -| None => 2 -| _ => 3 -}; - -let myInt = 100; -/* Numeric ranges are rejected by the type checker, but validly parsed so drop - * this in an annotation to test the parsing. */ -[@something? 1 .. 2] -let rangeInt = 0; - -let myChar = 'x'; -let rangeChar = - switch (myChar) { - | 'a' .. 'b' => "a to b" - | 'b' .. 'z' => "b to z" - | c => "something else" - }; - -/* with parens around direct list pattern in constructor pattern */ -switch (None) { -| Some([]) => () -| Some([_]) when true => () -| Some([x]) => () -| Some([x, ...xs]) when true => () -| Some([x, y, z]) => () -| _ => () -}; - -/* no parens around direct list pattern in constructor pattern (sugar) */ -switch (None) { -| Some([]) => () -| Some([_]) when true => () -| Some([x]) => () -| Some([x, ...xs]) when true => () -| Some([x, y, z]) => () -| _ => () -}; - -/* with parens around direct array pattern in constructor pattern */ -switch (None) { -| Some([||]) => "empty" -| Some([|_|]) when true => "one any" -| Some([|a|]) => "one" -| Some([|a, b|]) => "two" -| _ => "many" -}; - -/* no parens around direct array pattern in constructor pattern (sugar) */ -switch (None) { -| Some([||]) => "empty" -| Some([|_|]) when true => "one any" -| Some([|a|]) => "one" -| Some([|a, b|]) => "two" -| _ => "many" -}; - -/* parens around direct record pattern in constructor pattern */ -switch (None) { -| Some({x}) when true => () -| Some({x, y}) => () -| _ => () -}; - -/* no parens around direct record pattern in constructor pattern (sugar) */ -switch (None) { -| Some({x}) when true => () -| Some({x, y}) => () -| _ => () -}; - -switch (None) { -| Some([| - someSuperLongString, - thisShouldBreakTheLine, - |]) => - () -| _ => () -}; - -switch (None) { -| Some(( - someSuperLongString, - thisShouldBreakTheLine, - )) => - () -| _ => () -}; - -switch (None) { -| Some([ - someSuperLongString, - thisShouldBreakTheLine, - ]) => - () -| Some([ - someSuperLongString, - ...es6ListSugarLikeSyntaxWhichIsSuperLong, - ]) - when true === true => - () -| Some([ - someSuperLongString, - ...es6ListSugarLikeSyntaxWhichIsSuperLong, - ]) => - () -| _ => () -}; - -type aOrB = - | A(int) - | B(int); -let (nestedAnnotation: int): int = 0; -let (A(i) | B(i)): aOrB = A(0); - -type test_foo = - | VariantType1 - | VariantType2; - -let branch_with_variant_and_annotation = - fun - | (VariantType1: test_foo) => true - | VariantType2 => false; - -type intRange = { - from: option(string), - to_: option(string), -}; - -type optIntRange = option(intRange); - -let optIntRangeOfIntRange = - fun - | ({from: None, to_: None}: intRange) => ( - None: optIntRange - ) - | {from, to_} => Some({from, to_}); diff --git a/formatTest/typeCheckedTests/expected_output/pervasive.rei b/formatTest/typeCheckedTests/expected_output/pervasive.rei deleted file mode 100644 index 35ff3d668..000000000 --- a/formatTest/typeCheckedTests/expected_output/pervasive.rei +++ /dev/null @@ -1,5 +0,0 @@ -let (==): ('a, 'a) => bool; - -let (!=): ('a, 'a) => bool; - -let (!): bool => bool; diff --git a/formatTest/typeCheckedTests/expected_output/pipeFirst.re b/formatTest/typeCheckedTests/expected_output/pipeFirst.re deleted file mode 100644 index b06c18017..000000000 --- a/formatTest/typeCheckedTests/expected_output/pipeFirst.re +++ /dev/null @@ -1,183 +0,0 @@ -let (|.) = (x, y) => x + y; - -let a = 1; -let b = 2; -let c = 3; - -/* parses as 10 < (a->b->c) */ -let t1: bool = 10 < a->b->c; - -type coordinate = { - x: int, - y: int, -}; -let coord = {x: 1, y: 1}; - -/* parses as (coord.x)->a->b->c */ -let t2: int = coord.x->a->b->c; - -let (|.) = (x, y) => x || y; - -let a = true; -let b = false; -let c = true; - -/* parses as !(a->b->c) */ -let t3: bool = !a->b->c; - -/* parse pipe first with underscore application correct */ -let doStuff = (a: int, b: int, c: int): int => { - a + 2 * b + 3 * c; -}; - -let (|.) = (a, f) => f(a); - -let t4: int = 5->doStuff(1, _, 7); -let t5: int = - 5->doStuff(1, _, 7)->doStuff(1, _, 7); - -module Foo = { - let createElement = (~children, ()) => - List.hd(children) ++ "test"; - - let map = (xs, f) => List.map(f, xs); - - let plusOne = x => x + 1; - - let toString = lst => - List.fold_left( - (acc, curr) => - acc ++ string_of_int(curr), - "", - lst, - ); -}; - -let items = [1, 2, 3]; - -let t6: string = - - {items->Foo.map(Foo.plusOne)->Foo.toString} - ; - -type saveStatus = - | Pristine - | Saved - | Saving - | Unsaved; - -let saveStatus = Pristine; - -let t7: string = - - {( - switch (saveStatus) { - | Pristine => [0] - | Saved => [1] - | Saving => [2] - | Unsaved => [3] - } - ) - ->Foo.map(Foo.plusOne) - ->Foo.toString} - ; - -let genItems = f => List.map(f, items); - -let t8: string = - - {genItems(Foo.plusOne)->Foo.toString} - ; - -let blocks = [1, 2, 3]; - -let t9: string = - blocks->(b => Foo.toString(b)) ; - -let foo = xs => List.concat([xs, xs]); - -let t10: string = - - {blocks - ->foo - ->Foo.map(Foo.plusOne) - ->Foo.toString} - ; - -let t11: string = - - {blocks - ->foo - ->Foo.map(Foo.plusOne) - ->Foo.map(Foo.plusOne) - ->Foo.toString} - ; - -let title = "los pilares de la tierra"; - -let t12: string = - - (title === "" ? [1, 2, 3] : blocks) - ->Foo.toString - ; - -type change = - | Change(list(int)); - -type this = {send: change => string}; - -let change = x => Change(x); - -let self = { - send: x => - switch (x) { - | Change(xs) => Foo.toString(xs) - }, -}; - -let urlToRoute = x => [x, x, x]; - -let t13: string = - urlToRoute(1)->change->(self.send); - -module FooLabeled = { - let createElement = (~children, ()) => - List.hd(children) ++ "test"; - - let map = (xs, ~f) => List.map(f, xs); - - let plusOne = x => x + 1; - - let toString = lst => - List.fold_left( - (acc, curr) => - acc ++ string_of_int(curr), - "", - lst, - ); -}; - -let t14: string = - - {items - ->FooLabeled.map(~f=FooLabeled.plusOne) - ->FooLabeled.toString} - ; - -let c = (a, b) => a + b; -let a = 1; -let b = 2; -let t: int = a->(b->c); - -module Div = { - let createElement = (~children, ()) => - List.hd(children) ++ "test"; -}; - -let url = "reason"; -let suffix = ".com"; - -let parse = (a, b) => a ++ b; - -let t15: string = -
{url->parse(suffix, _)}
; diff --git a/formatTest/typeCheckedTests/expected_output/reasonComments.re b/formatTest/typeCheckedTests/expected_output/reasonComments.re deleted file mode 100644 index 63b87d939..000000000 --- a/formatTest/typeCheckedTests/expected_output/reasonComments.re +++ /dev/null @@ -1,756 +0,0 @@ -3; /* - */ -3; /*-*/ - -3; /*-*/ - -3 /*-*/; -/* **** comment */ -/*** comment */ -/** docstring */ -/* comment */ -/** docstring */ -/*** comment */ -/**** comment */ -/***** comment */ -/** */ -/*** */ -/**** */ -/**/ -/***/ -/****/ -/** (** comment *) */ -/** (*** comment *) */ -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ -/** - * Multiline - */ -/** Multiline - * - */ -/** - ** - */ -module JustString = { - include Map.Make(Int32); /* Comment eol include */ -}; - -let testingEndOfLineComments = [ - "Item 1" /* Comment For First Item */, - "Item 2" /* Comment For Second Item */, - "Item 3" /* Comment For Third Item */, - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - /* Comment after last item in list. */ -] /* Comment after rbracket */; - -/* But if you place them after the comma at eol, they're preserved as such */ -let testingEndOfLineComments = [ - "Item 1", /* Comment For First Item */ - "Item 2", /* Comment For Second Item */ - "Item 3", /* Comment For Third Item */ - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - /* Comment after last item in list. */ -] /* Comment after rbracket */; - -/* The space between ; and comment shoudn't matter */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ - /* Comment after last item in list. */ -]; /* Comment after semi */ - -/* The space between ; and comment shoudn't matter */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ - /* Comment after last item in list. */ -]; /* Comment after semi */ - -/* Try again but without other things in the list */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ -]; /* Comment after semi */ - -/* The space between ; and comment shoudn't matter */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ - /* Comment after last item in list. */ -]; /* Comment after semi */ - -let testingEndOfLineComments = []; /* Comment after entire let binding */ - -/* The following is not yet idempotent */ -/* let myFunction */ -/* withFirstArg /* First arg */ */ -/* andSecondArg => { /* Second Arg */ */ -/* withFirstArg + andSecondArg /* before semi */ ; */ -/* }; */ - -let myFunction = /* First arg */ - ( - withFirstArg, - /* Second Arg */ - andSecondArg, - ) => { - withFirstArg + andSecondArg; -}; /* After Semi */ - -type point = { - x: string, /* x field */ - y: string /* y field */ -}; - -type pointWithManyKindsOfComments = { - /* Line before x */ - x: string, /* x field */ - /* Line before y */ - y: string /* y field */ - /* Final row of record */ -}; - -type typeParamPointWithComments('a) = { - /* Line before x */ - x: 'a, /* x field */ - /* Line before y */ - y: 'a /* y field */ - /* Final row of record */ -}; - -/* Now, interleaving comments in type params */ -/* Type name */ -type typeParamPointWithComments2 - /* The a type param */ - ( - 'a, - /* The b type apram */ - 'b, - ) = { - /* Line before x */ - x: 'a, /* x field */ - /* Line before y */ - y: 'a /* y field */ - /* Final row of record */ -}; - -/* The way the last row comment is formatted is suboptimal becuase - * record type definitions do not include enough location information */ -type anotherpoint = { - x: string, /* x field */ - y: string /* y field */ - /* comment as last row of record */ -}; - -type t = (int, int); /* End of line on t */ -type t2 = (int, int); /* End of line on (int, int) */ - -type t3 = (int, int); /* End of line on (int, int) */ - -type variant = - | X(int, int) /* End of line on X */ - | Y(int, int); /* End of line on Y */ /* Comment on entire type def for variant */ - -/* Before let */ -let res = - /* Before switch */ - switch (X(2, 3)) { - /* Above X line */ - | X(_) => "result of X" /* End of arrow and X line */ - /* Above Y line */ - | Y(_) => "result of Y" /* End of arrow and Y line */ - }; /* After final semi in switch */ - -let res = - switch (X(2, 3)) { - | X(0, 0) => - /* After X arrow */ - "result of X" /* End of X body line */ - | X(1, 0) /* Before X's arrow */ => "result of X" /* End of X body line */ - | X(_) => - /* After X _ arrow */ - "result of X" /* End of X body line */ - /* Above Y line */ - | Y(_) => - /* Comment above Y body */ - "result of Y" - }; - -type variant2 = - /* Comment above X */ - | X(int, int) /* End of line on X */ - /* Comment above Y */ - | Y(int, int); - -type variant3 = - /* Comment above X */ - | X(int, int) /* End of line on X */ - /* Comment above Y */ - | Y(int, int); /* End of line on Y */ - -type x = { - /* not attached *above* x */ - fieldOne: int, - fieldA: int, -} /* Attached end of line after x */ -and y = { - /* not attached *above* y */ - fieldTwo: int, -}; /* Attached end of line after y */ - -type x2 = { - /* not attached *above* x2 */ - fieldOne: int, - fieldA: int, -} /* Attached end of line after x2 */ -and y2 = { - /* not attached *above* y2 */ - fieldTwo: int, -}; - -let result = - switch (None) { - | Some({fieldOne: 20, fieldA: a}) => - /* Where does this comment go? */ - let tmp = 0; - 2 + tmp; - | Some({fieldOne: n, fieldA: a}) => - /* How about this one */ - let tmp = n; - n + tmp; - | None => 20 - }; - -let res = - /* Before switch */ - switch (X(2, 3)) { - /* Above X line */ - | X(_) => "result of X" /* End of arrow and X line */ - /* Above Y line */ - | Y(_) => "result of Y" /* End of arrow and Y line */ - }; - -/* - * Now these end of line comments *should* be retained. - */ -let result = - switch (None) { - | Some({ - fieldOne: 20, /* end of line */ - fieldA: a /* end of line */ - }) => - let tmp = 0; - 2 + tmp; - | Some({ - fieldOne: n, /* end of line */ - fieldA: a /* end of line */ - }) => - let tmp = n; - n + tmp; - | None => 20 - }; - -/* - * These end of line comments *should* be retained. - * To get the simple expression eol comment to be retained, we just need to - * implement label breaking eol behavior much like we did with sequences. - * Otherwise, right now they are not idempotent. - */ -let res = - switch ( - /* Retain this */ - X(2, 3) - ) { - /* Above X line */ - | X( - _, /* retain this */ - _ /* retain this */ - ) => "result of X" - - /* Above Y line */ - | Y(_) => "result of Y" /* End of arrow and Y line */ - }; - -type optionalTuple = - | OptTup( - option( - ( - int, /* First int */ - int /* Second int */ - ), - ), - ); - -type optionTuple = - option( - ( - int, /* First int */ - int /* Second int */ - ), - ); - -type intPair = ( - int, /* First int */ - int /* Second int */ -); -type intPair2 = ( - /* First int */ - int, - /* Second int */ - int, -); - -let result = - /**/ - { - 2 + 3; - }; - -/* This is not yet idempotent */ -/* { */ -/* /**/ */ -/* (+) 2 3 */ -/* }; */ - -let a = (); -for (i in 0 to 10) { - /* bla */ - a; -}; - -if (true) { - /* hello */ - () -}; - -type color = - | Red(int) /* After red end of line */ - | Black(int) /* After black end of line */ - | Green(int); /* After green end of line */ /* On next line after color type def */ - -let blahCurriedX = x => - fun - | Red(10) - | Black(20) - | Green(10) => 1 /* After or pattern green */ - | Red(x) => 0 /* After red */ - | Black(x) => 0 /* After black */ - | Green(x) => 0; /* After second green */ /* On next line after blahCurriedX def */ - -let name_equal = (x, y) => { - x == y; -}; - -let equal = (i1, i2) => - i1.contents === i2.contents && true; /* most unlikely first */ - -let equal = (i1, i2) => - compare(compare(0, 0), compare(1, 1)); /* END OF LINE HERE */ - -let tuple_equal = ((i1, i2)) => i1 == i2; - -let tuple_equal = ((csu, mgd)) => - /* Some really long comments, see https://github.com/facebook/reason/issues/811 */ - tuple_equal((csu, mgd)); - -/** Comments inside empty function bodies - * See https://github.com/facebook/reason/issues/860 - */ -let fun_def_comment_inline = () => {/* */}; - -let fun_def_comment_newline = () => {/* */}; - -let fun_def_comment_long = () => { - /* longer comment inside empty function body */ -}; - -let trueThing = true; - -for (i in 0 to 1) { - /* comment */ - print_newline(); -}; - -while (trueThing) { - /* comment */ - print_newline(); -}; - -if (trueThing) { - /* comment */ - print_newline(); -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -} else { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -} else { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -} else { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ -} else { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - -let f = (a, b, c, d) => a + b + c + d; - -while (trueThing) { - f( - /* a */ - 1, - /* b */ - 2, - /* c */ - 3, - /* d */ - 4, - /* does work */ - ); -}; -while (trueThing) { - f( - /* a */ - 1, - /* b */ - 2, - /* c */ - 3, - /* d */ - 4 /* does work */ - ); -}; - -ignore( - ( - _really, - _long, - _printWidth, - _exceeded, - _here, - ) => { - /* First comment */ - let x = 0; - x + x; - /* Closing comment */ -}); - -ignore((_xxx, _yyy) => { - /* First comment */ - let x = 0; - x + x; - /* Closing comment */ -}); - -type tester('a, 'b) = - | TwoArgsConstructor('a, 'b) - | OneTupleArgConstructor(('a, 'b)); -let callFunctionTwoArgs = (a, b) => (); -let callFunctionOneTuple = tuple => (); - -let y = - TwoArgsConstructor( - 1, /*eol1*/ - 2 /* eol2 */ - ); - -let y = - callFunctionTwoArgs( - 1, /*eol1*/ - 2 /* eol2 */ - ); - -let y = - OneTupleArgConstructor(( - 1, /*eol1*/ - 2 /* eol2 */ - )); - -let y = - callFunctionOneTuple(( - 1, /*eol1*/ - 2 /* eol2 */ - )); - -type polyRecord('a, 'b) = { - fieldOne: 'a, - fieldTwo: 'b, -}; - -let r = { - fieldOne: 1, /*eol1*/ - fieldTwo: 2 /* eol2 */ -}; - -let r = { - fieldOne: 1, /*eol1*/ - fieldTwo: 2 /* eol2 with trailing comma */ -}; - -let y = - TwoArgsConstructor( - "1", /*eol1*/ - "2" /* eol2 */ - ); - -let y = - callFunctionTwoArgs( - "1", /*eol1*/ - "2" /* eol2 */ - ); - -let y = - OneTupleArgConstructor(( - "1", /*eol1*/ - "2" /* eol2 */ - )); - -let y = - callFunctionOneTuple(( - "1", /*eol1*/ - "2" /* eol2 */ - )); - -let r = { - fieldOne: "1", /*eol1*/ - fieldTwo: "2" /* eol2 */ -}; - -let r = { - fieldOne: "1", /*eol1*/ - fieldTwo: "2" /* eol2 with trailing comma */ -}; - -let identifier = "hello"; - -let y = - TwoArgsConstructor( - identifier, /*eol1*/ - identifier /* eol2 */ - ); - -let y = - callFunctionTwoArgs( - identifier, /*eol1*/ - identifier /* eol2 */ - ); - -let y = - OneTupleArgConstructor(( - identifier, /*eol1*/ - identifier /* eol2 */ - )); - -let y = - callFunctionOneTuple(( - identifier, /*eol1*/ - identifier /* eol2 */ - )); - -let r = { - fieldOne: identifier, /*eol1*/ - fieldTwo: identifier /* eol2 */ -}; - -let r = { - fieldOne: identifier, /*eol1*/ - fieldTwo: identifier /* eol2 with trailing comma */ -}; - -let y = - TwoArgsConstructor( - identifier: string, /*eol1*/ - identifier: string /* eol2 */ - ); - -let y = - callFunctionTwoArgs( - identifier: string, /*eol1*/ - identifier: string /* eol2 */ - ); - -let y = - OneTupleArgConstructor(( - identifier: string, /*eol1*/ - identifier: string /* eol2 */ - )); - -let y = - callFunctionOneTuple(( - identifier: string, /*eol1*/ - identifier: string /* eol2 */ - )); - -let r = { - fieldOne: (identifier: string), /*eol1*/ - fieldTwo: (identifier: string) /* eol2 */ -}; - -let r = { - fieldOne: (identifier: string), /*eol1*/ - fieldTwo: (identifier: string) /* eol2 with trailing comma */ -}; - -/** doc comment */ -[@bs.send] -external url: t => string; - -/** - * Short multiline doc comment - */ -[@bs.send] -external url: t => string; - -/** Longer doc comment before an attribute on an external. */ -[@bs.send] -external url: t => string; - -/* normal comment */ -[@bs.send] external url: t => string; - -/** doc type */ -type q = { - a: int, - b: string, -}; - -/** doc let */ -let letter: q = {a: 42, b: "answer"}; diff --git a/formatTest/typeCheckedTests/expected_output/reasonComments.rei b/formatTest/typeCheckedTests/expected_output/reasonComments.rei deleted file mode 100644 index 86518f5a5..000000000 --- a/formatTest/typeCheckedTests/expected_output/reasonComments.rei +++ /dev/null @@ -1,3 +0,0 @@ -module JustString: { - include Map.S; /* Comment eol include */ -}; diff --git a/formatTest/typeCheckedTests/expected_output/sequences.re b/formatTest/typeCheckedTests/expected_output/sequences.re deleted file mode 100644 index 72b5ad545..000000000 --- a/formatTest/typeCheckedTests/expected_output/sequences.re +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/** - * Testing Sequences. - */ -let result = { - let twenty = 20; - let result = twenty; - result; -}; - -/* Final semicolon is not required */ -let result = { - let twenty = result; - twenty; -}; -let anInt = result + 20; - -let twenty = 20; - -/** - * Each of these are a sequence with a single item - they will be - * printed in reduced form because sequences are a *parse* time construct. - * To ensure these are parsed correctly, adding to an integer. - */ -let result = - 0 - + { - twenty; - }; -let result = - 0 - + { - twenty; - }; -let result = 0 + twenty; - -let unitValue = (); -/* While loops/for loops merely accept a "simple expression" (which means - * it is either a simple token or balanced with parens/braces). However, - * the formatter ensures that the bodies are printed in "sequence" form even if - * it's not required. - */ -while (false) { - unitValue; -}; -while (false) { - print_string("test"); -}; -while (false) { - print_string("test"); -}; - -type myRecord = {number: int}; -let x = {number: 20}; -let number = 20; -/* - * The (mild) consequence of not requiring a final semi in a sequence, - * is that we can no longer "pun" a single field record (which would) - * be very rare anyways. - */ -let cannotPunASingleFieldRecord = { - number: number, -}; -let fourty = - 20 + cannotPunASingleFieldRecord.number; -let thisIsASequenceNotPunedRecord = { - number; -}; -let fourty = 20 + thisIsASequenceNotPunedRecord; - -type recordType = { - a: int, - b: int, - c: int, -}; -let a = 0; -let b = 0; -let c = 0; -/* All of these will be printed as punned because they have more than one field. */ -let firstFieldPunned = {a, b, c}; -let sndFieldPunned = {a, b, c}; -let thirdFieldPunned = {a, b, c}; -let singlePunAcceptedIfExtended = { - ...firstFieldPunned, - a, -}; diff --git a/formatTest/typeCheckedTests/expected_output/specificMLSyntax.4.04.0.re b/formatTest/typeCheckedTests/expected_output/specificMLSyntax.4.04.0.re deleted file mode 100644 index 6cc7f92c8..000000000 --- a/formatTest/typeCheckedTests/expected_output/specificMLSyntax.4.04.0.re +++ /dev/null @@ -1,15 +0,0 @@ -module Foo = { - type t = {name: string}; -}; - -let foo = (Foo.{name}) => (); - -let f = - fun - | Foo.{name} => () - | _ => (); - -let x = {Foo.name: "Reason"}; -let Foo.{name} = x; - -let (Foo.{name}, _) = (x, ()); diff --git a/formatTest/typeCheckedTests/expected_output/trailing.re b/formatTest/typeCheckedTests/expected_output/trailing.re deleted file mode 100644 index 67833739a..000000000 --- a/formatTest/typeCheckedTests/expected_output/trailing.re +++ /dev/null @@ -1,282 +0,0 @@ -let x = 0; -let y = 0; - -[@warning "-8"] -let [|x, y|] = [|0, y|]; -[@warning "-8"] -let [|x, y|] = [|0, y|]; - -[@warning "-8"] -let [| - reallyLongIdentifier, - reallyLongIdentifier2, -|] = [| - 0, - 1, -|]; -[@warning "-8"] -let [| - reallyLongIdentifier_, - reallyLongIdentifier2_, -|] = [| - 0, - 2, -|]; - -let takesUnit = () => (); -let res = takesUnit(); -let wat = 0; - -type t = { - x: int, - y: int, -}; -let p = {contents: 0}; -let {contents: c} = p; -let point = {x: 0, y: 0}; -let point2 = {...point, y: 200}; - -let myTuple = (0, 0); -let (i, j) = myTuple; - -type foo_('a, 'b) = ('a, 'b); -type foo__ = foo_(int, int); -type foo('a, 'b) = - | Foo('a, 'b); -type tupVariant('a, 'b) = - | Tup(('a, 'b)); - -/* Won't wrap so removes trailing comma */ -let noWrap = (a, b) => { - let x = a; - x + x; -}; - -let res = noWrap(0, 0); -let reallyLongIdentifierCausesWrap = 0; -let wrap = noWrap; -let res = - wrap( - reallyLongIdentifierCausesWrap, - reallyLongIdentifierCausesWrap, - ); - -/* Won't wrap so removes trailing comma */ -let noWrap = (~a, ~b) => { - let x = a; - x + x; -}; - -/* Won't wrap so removes trailing comma */ -let noWrap = (~a=0, ~b=0, ()) => { - let x = a; - x + x; -}; - -let res = - noWrap( - ~a=reallyLongIdentifierCausesWrap, - ~b=reallyLongIdentifierCausesWrap, - (), - ); - -/* Won't wrap so removes trailing comma */ -let noWrap = (~a=0, ~b: int=0, ()) => { - let x = a; - x + x; -}; - -let res = - noWrap( - ~a=reallyLongIdentifierCausesWrap, - ~b=reallyLongIdentifierCausesWrap, - (), - ); - -/* Long enough to wrap the args and therefore remove trail */ -let wrap = (long, enough, toWrap, args) => { - let x = long; - x + enough + toWrap + args; -}; - -let takesPattern = (d, Foo(x, y)) => { - /* won't wrap */ - let _ = Foo(y, x); - /* will wrap */ - let ret = - Foo( - y + y + y + y, - x + x + x + x + x + x + x + x + x, - ); - ret; -}; - -let takesPattern = (d, Tup((x, y))) => { - /* won't wrap */ - let _ = Tup((y, x)); - /* will wrap */ - let ret = - Tup(( - y + y + y + y, - x + x + x + x + x + x + x + x + x, - )); - ret; -}; - -let takesPattern = - ( - d, - Tup(( - thisPatternIsSoLongThatThe, - fooWillWrapItself, - )), - ) => { - /* won't wrap */ - let _ = Tup((d, d)); - /* will wrap */ - let ret = - Tup(( - d + d + d + d, - d + d + d + d + d + d + d + d + d, - )); - ret; -}; - -let myFunc = (type t, ()) => (); - -type funcType = (int, int) => int; -type v = - | Func((int, int) => int); - -type params('a, 'b) = ('a, 'b); - -let myList = [2, 3]; - -let yourList = [5, 6, ...myList]; - -class virtual - tupleStack - ( - 'reallyLongIdentifier, - 'anotherReallyLongIdentifier, - ) - (init, init2) = { - val mutable v: - list( - ( - 'reallyLongIdentifier, - 'anotherReallyLongIdentifier, - ), - ) = [ - (init, init2), - ]; - pub virtual implementMe: - (int, int) => (int, int); - initializer { - print_string("initializing object"); - }; -}; - -class extendedStack - ( - 'reallyLongIdentifier, - 'anotherReallyLongIdentifier, - ) - (init, init2) = { - inherit - ( - class tupleStack( - 'reallyLongIdentifier, - 'anotherReallyLongIdentifier, - ) - )( - init, - init2, - ); - pub implementMe = (i, j) => (i, j); -}; - -module type HasType = {type t;}; -module type HasType2 = { - type t; - type q; -}; -module type ReallyReallyReallyLongIdentifierModuleType = { - type t; -}; -module type F = (HasType) => HasType2; -module FInstance = (HasType: HasType) => { - type t = HasType.t; - type q = HasType.t; -}; -module ReallyReallyReallyLongIdentifierModuleName = { - type t = int; -}; -module FResult = - FInstance( - ReallyReallyReallyLongIdentifierModuleName, - ); - -module Component = { - let createElement = (~arg, ~children, ()) => [ - 0, - ]; -}; - -let componentList = []; -let componentList = []; -let componentList = []; -let componentList = []; -let componentList = [ - , - , -]; -let componentList = [ - , - , -]; -let componentList = [ - , - , -]; -let componentList = [ - , - , -]; -let componentList = [ - , - , -]; -let componentList = [ - , - , -]; - -let componentList = [||]; -let componentList = [||]; -let componentList = [||]; -let componentList = [||]; -let componentList = [| - , - , -|]; -let componentList = [| - , - , -|]; -let componentList = [| - , - , -|]; -let componentList = [| - , - , -|]; -let componentList = [| - , - , -|]; -let componentList = [| - , - , -|]; diff --git a/formatTest/typeCheckedTests/expected_output/typeParameters.re b/formatTest/typeCheckedTests/expected_output/typeParameters.re deleted file mode 100644 index 3d97c06da..000000000 --- a/formatTest/typeCheckedTests/expected_output/typeParameters.re +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Testing type parameters. - */ - -type threeThings('t) = ('t, 't, 't); -type listOf('t) = list('t); - -type underscoreParam(_) = - | Underscored; -type underscoreParamCovariance(+_) = - | Underscored; -type underscoreParamContravariance(-_) = - | Underscored; - -type tickParamCovariance(+'a) = - | Underscored; -type tickParamContravariance(-'a) = - | Underscored; - -let x: option(list('a)) = None; -type myFunctionType('a) = ( - list(('a, 'a)), - int => option(list('a)), -); -let funcAnnoted = (~a: list(int)=[0, 1], ()) => a; - -/** - * Syntax that would be likely to conflict with lexing parsing of < > syntax. - */ - -let zero = 0; -let isGreaterThanNegFive = zero > (-5); -let isGreaterThanNegFive2 = zero > (-5); -let isGreaterThanNegFive3 = zero > (-5); - -let isGreaterThanEqNegFive = zero >= (-5); -let isGreaterThanEqNegFive2 = zero >= (-5); -let isGreaterThanEqNegFive3 = zero >= (-5); - -let (>>=) = (a, b) => a >= b; - -let isSuperGreaterThanEqNegFive = zero >>= (-5); -let isSuperGreaterThanEqNegFive2 = zero >>= (-5); -let isSuperGreaterThanEqNegFive3 = zero >>= (-5); - -let jsx = (~children, ()) => 0; - -type t('a) = 'a; -let optionArg = (~arg: option(t(int))=?, ()) => arg; -let optionArgList = - (~arg: option(list(list(int)))=?, ()) => arg; -let defaultJsxArg = (~arg: t(int)=, ()) => arg; -let defaultFalse = (~arg: t(bool)=!true, ()) => arg; -/* Doesn't work on master either let defaultTrue = (~arg:t= !!true) => arg; */ - -/** - * Things likely to conflict or impact precedence. - */ -let neg = (-1); -let tru = !false; -let x = - "arbitrary" === "example" - && "how long" >= "can you get" - && "seriously" <= "what is the line length"; - -let z = 0; -module Conss = { - let (>-) = (a, b) => a + b; - let four = 3 >- 1; - let two = 3 >- (-1); - let four' = 3 >- 1; - - let tr = 3 > (-1); - let tr' = 3 > 1; - let tr'' = 3 > (-1); -}; - -module Idents = { - let (>-) = (a, b) => a + b; - let four = z >- z; - let two = z >- - z; - let four' = z >- - (- z); - - let tr = z > - z; - let tr' = z > - (- z); - let tr'' = z > - (- (- z)); -}; diff --git a/formatTest/typeCheckedTests/input/arity.txt b/formatTest/typeCheckedTests/input/arity.txt deleted file mode 100644 index a96cf4568..000000000 --- a/formatTest/typeCheckedTests/input/arity.txt +++ /dev/null @@ -1,7 +0,0 @@ -And -TupleConstructor -Or -M.TupleConstructorInModule -TupleConstructor2 -.TupleConstructor3 -M.TupleConstructor3 diff --git a/formatTest/typeCheckedTests/input/arityConversion.ml b/formatTest/typeCheckedTests/input/arityConversion.ml deleted file mode 100644 index d464f9172..000000000 --- a/formatTest/typeCheckedTests/input/arityConversion.ml +++ /dev/null @@ -1,43 +0,0 @@ -Some (1, 2, 3) - -type bcd = TupleConstructor of (int * int) | MultiArgumentsConstructor of int * int - -let a = TupleConstructor(1, 2) -let b = MultiArgumentsConstructor(1, 2) - -module Test = struct - type a = | And of (int * int) | Or of (int * int) -end;; - -let _ = Test.And (1, 2) -let _ = Test.Or (1, 2) -let _ = Some 1;; - -Test.And (1, 2);; -Test.Or (1, 2);; -Some 1;; - -module M = struct - type t = TupleConstructorInModule of (int * int) - type t2 = TupleConstructor2 of (int * int) - type t3 = TupleConstructor3 of (int * int) -end - -type t2 = TupleConstructor2 of (int * int) -type t3 = TupleConstructor3 of (int * int) - -let _ = M.TupleConstructorInModule (1,2) - -let _ = M.TupleConstructor2 (1,2) -let _ = TupleConstructor2 (1,2) - -let _ = M.TupleConstructor3 (1,2) -let _ = TupleConstructor3 (1,2);; - -M.TupleConstructorInModule (1,2);; - -M.TupleConstructor2 (1,2);; -TupleConstructor2 (1,2);; - -M.TupleConstructor3 (1,2);; -TupleConstructor3 (1,2);; diff --git a/formatTest/typeCheckedTests/input/attributes.4.04.0.re b/formatTest/typeCheckedTests/input/attributes.4.04.0.re deleted file mode 100644 index 626deb9c5..000000000 --- a/formatTest/typeCheckedTests/input/attributes.4.04.0.re +++ /dev/null @@ -1,20 +0,0 @@ -/* Pexp_letexception with attributes */ -let () = { - [@attribute] exception E; - raise(E) -}; - -/** Different payloads **/ - -/* Empty signature */ - -[@haha: ] -let x = 5; - -/* signature_item */ -[@haha: let x : option(int)] -let x = 5; - -/* Signature */ -[@haha: type t; let x : option(t)] -let x = 5; diff --git a/formatTest/typeCheckedTests/input/attributes.re b/formatTest/typeCheckedTests/input/attributes.re deleted file mode 100644 index c7bbca906..000000000 --- a/formatTest/typeCheckedTests/input/attributes.re +++ /dev/null @@ -1,664 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ -/** - * Generally, dangling attributes [@..] apply to everything to the left of it, - * up until a comma, equals asignment, arrow, bar, or infix symbol (+/-) or - * prefix. - * - * This has a nice side effect when printing the terms: - * If a node has attributes attached to it, - */ - -[@ocaml.text "Floating comment text should be removed"]; - -/** - * Core language features: - * ---------------------- - */ - -[@ocaml.doc "Floating doc text should be removed"]; - -[@itemAttributeOnTypeDef] [@ocaml.text "removed text on type def"] -type itemText = int; -type nodeText = [@ocaml.text "removed text on item"] int; -[@itemAttributeOnTypeDef] -[@ocaml.text "removed text on type def"] -type nodeAndItemText = - [@ocaml.text "removed text on item"] int; - -[@itemAttributeOnTypeDef] [@ocaml.doc "removed doc on type def"] -type itemDoc = int; -[@itemAttributeOnTypeDef] -type nodeDoc = [@ocaml.text "removed text on item"] int; -[@itemAttributeOnTypeDef] [@ocaml.doc "removed doc on type def"] -type nodeAndItemDoc = - [@ocaml.text "removed text on item"] int; - -[@itemAttributeOnTypeDef] -type x = int; -type attributedInt = [@onTopLevelTypeDef] int; - -[@itemAttributeOnTypeDef] -type attributedIntsInTuple = ([@onInt] int, [@onFloat] float); - -type myDataType('x,'y) = | MyDataType('x,'y); - -type myType = - [@onEntireType] - myDataType ([@onOptionInt] option(int), - [@onOption] option(float)); - - -let thisInst : myType = - [@attOnEntireDatatype] MyDataType(Some(10),Some(10.0)); - -let thisInst : myType = - [@attOnEntireDatatype] MyDataType([@onFirstParam] Some(10), Some(10.0)); - -let x = ([@onHello] "hello"); -let x = [@onHello] "hello"; - -let x = "hello" ++ ([@onGoodbye] "goodbye"); -let x = ([@onHello] "hello") ++ "goodbye"; -let x = [@onHello] "hello" ++ "goodbye"; -let x = "hello" ++ [@onGoodbye] "goodbye"; -let x = [@onEverything] ("hello" ++ "goodbye"); - -let x = 10 + ([@on20] 20); -let x = 10 + [@on20] 20; -let x = [@on10] 10 + 20; -let x = ([@on10] 10) + 20; -let x = [@attrEverything] (10 + 20); - -let x = 10 - ([@on20] 20); -let x = 10 - [@on20] 20; -let x = [@on10] 10 - 20; -let x = ([@on10] 10) - 20; -let x = [@attrEntireEverything] (10 - 20); - -let x = true && ([@onFalse] false); -let x = true && [@onFalse] false; -let x = [@onTrue] true && false; -let x = ([@onTrue] true) && false; -let x = [@attrEverything] (true && false); - - -/* now make sure to try with variants (tagged and `) */ - -/** - * How attribute parsings respond to other syntactic constructs. - */ -let add(a) { [@onRet] a }; -let add = fun(a) => [@onRet] a; -let add = [@onEntireFunction] (fun(a) => a); - -let res = if (true) false else [@onFalse] false; -let res = [@onEntireIf] (if (true) false else false); - - -let add(a,b) = [@onEverything] ([@onA] a + b); -let add(a,b) = [@onEverything] ([@onA]a + ([@onB]b)); -let add = (a,b) => a + [@onB]b; - -let both = [@onEntireFunction](fun(a) => a); -let both(a,b) = [@onEverything]([@onA]a && b); -let both(a,b) = [@onA] a && [@onB] ([@onB] b); -let both = fun(a,b) => [@onEverything](a && b); - -let thisVal = 10; -let x = 20 + - [@onFunctionCall] add(thisVal,thisVal); -let x = [@onEverything] (20 + - add(thisVal,thisVal)); -let x = - [@onFunctionCall] add(thisVal,thisVal); -let x = [@onEverything] (- add(thisVal,thisVal)); - - -let bothTrue(x,y) = {contents: x && y}; -let something = [@onEverythingToRightOfEquals](bothTrue(true,true)^); -let something = ([@onlyOnArgumentToBang]bothTrue(true,true))^; - -let res = [@appliesToEntireFunctionApplication] add(2,4); - [@appliesToEntireFunctionApplication]add(2,4); - - -let myObj = { - pub p () = { - pub z () = 10 - }; -}; - -let result = [@onSecondSend]([@attOnFirstSend]myObj#p ())#z (); - -[@onRecordFunctions] -type recordFunctions = { - p: (unit) => ([@onUnit] recordFunctions), - q: [@onArrow] ((unit) => unit) -} -[@onUnusedType] -and unusedType = unit; -[@onMyRecord] -let rec myRecord = { - p: fun () => myRecord, - q: fun () => () -} -[@onUnused] -and unused = (); -let result = [@onSecondSend]([@attOnFirstSend]myRecord.p()).q(); - -[@onVariantType] -type variantType = - [@onInt] | Foo(int) - | Bar ([@onInt] int) - | Baz; - -[@onVariantType] -type gadtType('x) = - | Foo(int) : [@onFirstRow] gadtType(int) - | Bar ([@onInt]int) : [@onSecondRow]gadtType(unit) - | Baz: [@onThirdRow] gadtType ([@onUnit] unit); - -[@floatingTopLevelStructureItem hello]; -[@itemAttributeOnEval] -print_string("hello"); - -[@itemAttrOnFirst] -let firstBinding = "first" -[@itemAttrOnSecond] -and secondBinding = "second"; - -/** - * Let bindings. - * ---------------------- - */ -let showLets () = [@onOuterLet] { - let tmp = 20; - [@onFinalLet] { - let tmpTmp = tmp + tmp; - tmpTmp + tmpTmp; - } -}; - - -/** - * Classes: - * ------------ - */ -/** - * In curried sugar, the class_expr attribute will apply to the return. - */ -[@moduleItemAttribute] -class boxA('a) (init: 'a) = [@onReturnClassExpr] { - [@ocaml.text "Floating comment text should be removed"]; - [@ocaml.doc "Floating comment text should be removed"]; - pub pr = init + init + init; -}; - -/** - * In non-curried sugar, the class_expr still sticks to "the simple thing". - */ -class boxB('a) = - fun (init: 'a) => [@stillOnTheReturnBecauseItsSimple] { - pub pr = init + init + init; - }; - -/* To be able to put an attribute on just the return in that case, use - * parens. */ -[@onBoxC x ; y] -class boxC('a) = [@onEntireFunction] ( - fun (init: 'a) => ( - [@onReturnClassExpr] { - pub pr = init + init + init; - } - ) -); - -[@moduleItemAttribute onTheTupleClassItem;] -class tupleClass('a,'b)(init: ('a, 'b)) { - let one = [@exprAttr ten;] 10; - let two = [@exprAttr twenty;] 20 - and three = [@exprAttr thirty;] 30; - [@pr prMember;] - pub pr = one + two + three; -}; - -[@structureItem] -class type addablePointClassType = { - [@ocaml.text "Floating comment text should be removed"]; - [@ocaml.doc "Floating comment text should be removed"]; - pub x: int; - pub y: int; - pub add: (addablePointClassType, addablePointClassType) => int; -} -[@structureItem] -and anotherClassType = { - pub foo: int; - pub bar: int; -}; - -class type _x = [@bs]{ pub height : int }; - -class type _y { [@bs.set] pub height : int }; - -[@attr] class type _z { pub height : int }; - -module NestedModule { - [@floatingNestedStructureItem hello]; -}; -[@structureItem] -module type HasAttrs = { - [@onTypeDef] - type t = int; - [@floatingNestedSigItem hello]; - [@sigItem] - class type foo = {pub foo: int; pub bar: int;}; - [@sigItem] - class fooBar: (int) => foo; - [@ocaml.text "Floating comment text should be removed"]; - [@ocaml.doc "Floating comment text should be removed"]; -}; - -type s = S(string); - -let S ([@onStr] str) = S ([@onHello]"hello"); -let [@onConstruction](S(str)) = [@onConstruction](S("hello")); - -type xy = | X(string) - | Y(string); - -let myFun = fun ([@onConstruction]X(hello) | [@onConstruction]Y(hello)) => hello; -let myFun = fun (X ([@onHello] hello ) | Y ([@onHello]hello )) => hello; - -/* Another bug: Cannot have an attribute on or pattern -let myFun = fun ((X(hello) | Y(hello)) [@onOrPattern]) => hello; -*/ - -/* Bucklescript FFI item attributes */ - -[@bs.val] -external imul : (int, int) => int = "Math.imul"; - -let module Js { - type t('a); -}; - -type classAttributesOnKeys = { - . - [@bs.set] key1 : string, - - /* The follow two are the same */ - [@bs.get {null}] key2 : [@onType2] Js.t(int), - [@bs.get {null}] key3 : ([@onType2] (Js.t(int))), - - key4 : Js.t ([@justOnInt] int) -}; - -/* extensible variants */ -type attr = ..; - -[@block] -type attr += - [@tag1] [@tag2] | Str - [@tag3] | Float ; - -type reconciler('props) = ..; - -[@onVariantType] -type reconciler('props) += - | Foo(int) : [@onFirstRow] reconciler(int) - | Bar ([@onInt] int) : [@onSecondRow] reconciler(unit) - [@baz] | Baz: [@onThirdRow] reconciler ([@onUnit] unit); - -type water = ..; - -type water += pri [@foo] | [@foo2] MineralWater | SpringWater; - -type cloud = string; - -type water += pri | [@h2o] PreparedWater | [@nature] RainWater(cloud) | [@toxic] MeltedSnowWaterFromNuclearWastelandWithALineBreakBecauseTheNameIsSoLong; - - -/* reasonreact */ -type element; - -type reactElement; - -type reactClass; - -/* "react-dom" shouldn't spread the attribute over multiple lines */ -[@bs.val] [@bs.module "react-dom"] -external render : (reactElement, element) => unit = "render"; - -[@bs.module "f"] -external f : (int) => int = "f"; - -[@bs.val] [@bs.module "react"] [@bs.splice] -external createCompositeElementInternalHack - : (reactClass, Js.t({.. reasonProps : 'props}), array(reactElement)) => reactElement - = "createElement"; - -external add_nat: (int, int) => int = "add_nat_bytecode" "add_nat_native"; - -[@bs.module "Bar"] [@ocaml.deprecated "Use bar instead. It's a much cooler function. This string needs to be a little long"] -external foo : (bool) => bool = ""; - -/* Attributes on an entire polymorphic variant leaf */ -[@bs.module "fs"] -external readFileSync : ( - ~name: string, - [@bs.string] [ - | `utf8 - [@bs.as "ascii"] | `my_name - ] -) => string = ""; - -[@bs.module "fs"] -external readFileSync2 : ( - ~name: string, - [@bs.string] [ - [@bs.as "ascii"] | `utf8 - [@bs.as "ascii"] | `my_name - ]) => string = ""; - -/* Ensure that attributes on extensions are printed */ -[@test - [@attr] - [%%extension] -]; - -external debounce : (int, [@bs.meth] unit) => unit; - -external debounce : (int, [@bs.meth] unit) => unit = "debounce"; - -external debounce : (int, [@bs.meth] unit) => unit = ""; - -external debounce : int => ([@bs.meth] (unit => unit)) = ""; - -external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) = ""; - -external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => unit)) = ""; - -external debounce : int => ([@bs.meth] (unit => unit)) => ([@bs.meth] (unit => [@bs.meth] (unit => unit))) => ([@bs.meth] (unit => unit)) = ""; - - -let x = "hi"; - -let res = switch (x) { -| _ => - [@attr] - { - open String; - open Array; - concat; - index_from; - } -}; - -let res = switch (x) { -| _ => - [@attr] - { - open String; - open Array; - concat; - } -}; - -/* GADT */ -type value = -| [@foo] VBool'(bool): [@bar] value -| VInt'(int): value; - -/** Different payloads **/ - -/* Empty structure */ -[@haha] -let x = 5; - -/* Expression structure */ -[@haha "hello world"] -let x = 5; - -/* structure_item */ -[@haha let x = 5] -let x = 5; - -/* structure */ -[@haha let x = 5; module X = {};] -let x = 5; - -/* Pattern */ -[@haha? Some(_) ] -let x = 5; - -/* Type */ -[@haha: option(int)] -let x = 5; - -/* Record item attributes */ - -type t_ = { - /** Comment attribute on record item */ - x: int -}; - -type tt = { - [@attr "on record field"] - x: int -}; - -type ttt = { - [@attr "on record field"] - x: [@attr "on type itself"] int -}; - -type tttt = { - /** Comment attribute on record item */ - x: int, - [@regularAttribute "on next item"] - y: int -}; - -type ttttt = [@attr "moved to first row"] { - [@attr] - x: int -}; - -type tttttt = { - [@attr "testing with mutable field"] - mutable x: int -}; - - -let tmp = { - /** On if statement */ - if (true) { - true - } else { - false - }; -}; - -type foo = - option( - [@foo ["how does this break", "when long enough"]] ( - [@bar] (int => int), - [@baz] (int => int), - ), - ); - -module Callbacks = { - let cb = () => 1 + 1; -}; - -let test = { - let _x = 1; - [@attr1] - open Callbacks; - let _s = "hello" ++ "!"; - [@attr2] Callbacks.("hello" ++ "!"); -}; - -[@test.call string => string] -let processCommandItem = 12; - -module type Foo = { [@someattr] let foo: int => int;}; - - -[@bs.deriving abstract] - type t = { - /** Position (in the pre-change coordinate system) where the change ended. */ - [@bs.as "to"] [@bar] - to_: string, - }; - -[@bs.deriving abstract] -type editorConfiguration = { - [@bs.optional] - /** Determines whether horizontal cursor movement through right-to-left (Arabic, Hebrew) text - is visual (pressing the left arrow moves the cursor left) - or logical (pressing the left arrow moves to the next lower index in the string, which is visually right in right-to-left text). - The default is false on Windows, and true on other platforms. */ - rtlMoveVisually: bool, -}; - -module Fmt = { - let barBaz = () => (); - - type record = {x: int}; -}; - -Fmt.([@foo] barBaz()); -Fmt.([@foo] {x: 1}); -Fmt.([@foo] [1, 2, 3]); -Fmt.([@foo] (1, 2, 3)); -Fmt.([@foo] {val x = 10}); - - -/** - * Attributes are associate with the identifier, function call, constructor - * appcation or constructor application pattern in front of it - up until a - * type constraint, an | (or) or an 'as'. - */ - -let punnned_lbl_a = (~lbl as [@ATTR] lbl) => lbl; -let punnned_lbl_b = (~lbl as [@ATTR] (lbl: int)) => lbl; -let punnned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lbl)) => lbl; -let punnned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lbl: int)) => lbl; -let punnned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lbl: int))) => lbl; - -let punnned_lbl_f = (~lbl as [@ATTR] lbl: int) => lbl; -let punnned_lbl_g = (~lbl as ([@ATTR] lbl: int)) => lbl; -let punnned_lbl_h = (~lbl as ([@ATTR] (lbl: int))) => lbl; -/** Attributes have lower precedence than type constraint. The following should - * be printed identically. */ -let punnned_lbl_i = (~lbl as [@ATTR] lbl: int) => lbl; -let punnned_lbl_i' = (~lbl as [@ATTR] (lbl: int)) => lbl; - -let nonpunned_lbla = (~lbl as [@ATTR] lblNonpunned) => lblNonpunned; -let nonpunned_lbl_b = (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; -let nonpunned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned)) => lblNonpunned; -let nonpunned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned: int)) => lblNonpunned; -let nonpunned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lblNonpunned: int))) => lblNonpunned; - -let nonpunned_lbl_f = (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; -let nonpunned_lbl_g = (~lbl as ([@ATTR] lblNonpunned: int)) => lblNonpunned; -let nonpunned_lbl_h = (~lbl as ([@ATTR] (lblNonpunned: int))) => lblNonpunned; - -let nonpunned_lbl_i = (~lbl as [@ATTR] lblNonpunned: int) => lblNonpunned; -let nonpunned_lbl_i' = (~lbl as [@ATTR] (lblNonpunned: int)) => lblNonpunned; - -let defaulted_punnned_lbl_a = (~lbl as [@ATTR] lbl=0, ()) => lbl; -let defaulted_punnned_lbl_b = (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; -let defaulted_punnned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lbl)=0, ()) => lbl; -let defaulted_punnned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lbl: int)=0, ()) => lbl; -let defaulted_punnned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lbl: int))=0, ()) => lbl; - -let defaulted_punnned_lbl_f = (~lbl as [@ATTR] lbl: int=0, ()) => lbl; -let defaulted_punnned_lbl_g = (~lbl as ([@ATTR] lbl: int)=0, ()) => lbl; -let defaulted_punnned_lbl_h = (~lbl as ([@ATTR] (lbl: int))=0, ()) => lbl; -/** Attributes have lower precedence than type constraint. The following should - * be printed identically. */ -let defaulted_punnned_lbl_i = (~lbl as [@ATTR] lbl: int=0, ()) => lbl; -let defaulted_punnned_lbl_i' = (~lbl as [@ATTR] (lbl: int)=0, ()) => lbl; - -let defaulted_nonpunned_lbla = (~lbl as [@ATTR] lblNonpunned=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_b = (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_c = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned)=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_d = (~lbl as [@ATTR] ([@ATTR2] lblNonpunned: int)=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_e = (~lbl as [@ATTR] ([@ATTR2] (lblNonpunned: int))=0, ()) => lblNonpunned; - -let defaulted_nonpunned_lbl_f = (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_g = (~lbl as ([@ATTR] lblNonpunned: int)=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_h = (~lbl as ([@ATTR] (lblNonpunned: int))=0, ()) => lblNonpunned; - -let defaulted_nonpunned_lbl_i = (~lbl as [@ATTR] lblNonpunned: int=0, ()) => lblNonpunned; -let defaulted_nonpunned_lbl_i' = (~lbl as [@ATTR] (lblNonpunned: int)=0, ()) => lblNonpunned; - -/* Won't parse: let [@attr] x1 : int = xInt; */ -let xInt = 0; - -/** - Attribute on the pattern node inside of constraint - pattern ( - Ppat_constraint( - pattern(@xxx, Ppat_var "x"), - coretype - ) - ) - This will get sugared to `let ([@attr] x2) : int = xInt` -*/ -let ([@attr] x2 : int) = xInt; -/** - Attribute on the pattern holding the constraint: - pattern( - @xxx - Ppat_constraint( - pattern(Pexpident "x"), - coretype - ) - ) -*/ -let ([@attr] (x3 : int)) = xInt; -let ([@attr] ([@attr0] x4: int)) = xInt; -let ([@attr] (([@attr0] x5): int)) = xInt; - -type eitherOr('a, 'b) = Either('a) | Or('b); -let [@attr] Either(a) | Or(a) = Either("hi"); -// Can drop the the parens around Either. -let ([@attr] Either(a)) | Or(a) = Either("hi"); -// Can drop the parens around Or. -let Either(b) | ([@attr] Or(b)) = Either("hi"); -// Should keep the parens around both -let [@attr] (Either(a) | Or(a)) = Either("hi"); - -// Should keep the parens -let [@attr] (_x as xAlias) = 10; -// Should drop the parens -let ([@attr] _x) as xAlias' = 10; - - -/** - Attribute on the expression node inside of constraint - expression( - Pexp_constraint( - expression(@xxx, Pexpident "x"), - coretype - ) - ) -*/ -let _ = ([@xxx] xInt : int); // This should format the same -let _ = (([@xxx] xInt) : int); // This should format the same - -/** - Attribute on the expression holding the constraint: - expression( - @xxx - Pexp_constraint( - expression(Pexpident "x"), - coretype - ) - ) -*/ -let _ = [@xxx] (xInt : int); // This should format the same - -[@foo? [@attr] (x: int)]; -[@foo? [@attr] ([@bar] x: int)]; -[@foo ? [@attr] (Either("hi") | Or("hi"))]; diff --git a/formatTest/typeCheckedTests/input/attributes.rei b/formatTest/typeCheckedTests/input/attributes.rei deleted file mode 100644 index b573f3793..000000000 --- a/formatTest/typeCheckedTests/input/attributes.rei +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -[@ocaml.text "Floating comment text should be removed"]; -let test : int; - -/** - * Attributes with doc/text attributes should be stripped. They're left over from a - * conversion from ML likely. - * ---------------------- - */ - -[@ocaml.doc "Floating doc text should be removed"]; - - -/** - * #990: don't strip attributes in interface files - */ -[@bs.val] -let x: int; - -type t('a); - -type reactClass; - -type reactElement; - -[@bs.val] [@bs.module "React"] -external createClassInternalHack : (t('classSpec)) => reactClass = "createClass"; - -[@bs.send.pipe : array('a)] external map: [@bs] (('a) => 'b) => array('b) = ""; - -[@bs.send.pipe : array('a)] external map: [@bs] (('a) => 'b) => array('b); - -[@bs.val] [@bs.module "react"] -external createClassInternalHack : (t('classSpec)) => reactClass = - "createClass"; - -[@bs.val] [@bs.module "react"] [@bs.splice] -external createCompositeElementInternalHack : - (reactClass, t({.. reasonProps : 'props}), array(reactElement)) => reactElement = - "createElement"; - - -/* Record item attributes */ - -type t_ = { - /** Comment attribute on record item */ - x: int -}; - -type tt = { - [@attr "on record field"] - x: int -}; - -type ttt = { - [@attr "on record field"] - x: [@attr "on type itself"] int -}; - -type tttt = { - /** Comment attribute on record item */ - x: int, - [@regularAttribute "on next item"] - y: int -}; - -type ttttt = [@attr "moved to first row"] { - [@attr] - x: int -}; - -module Foo: { [@someattr] let foo: int => int; }; diff --git a/formatTest/typeCheckedTests/input/basics.re b/formatTest/typeCheckedTests/input/basics.re deleted file mode 100644 index 18ef43ad9..000000000 --- a/formatTest/typeCheckedTests/input/basics.re +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let l = [1,2,3] |> List.map (i => i+1, _) |> List.filter (i => i>0, _); - -let l = (i => i+1) |> List.map(_, [1,2,3]); - -let x = List.length(_); - -let nested = x => List.length(_); - -let incr = (~v) => v+1; - -let l1 = [1,2,3] |> List.map(incr(~v=_)) |> List.length; - -let l2 = [1,2,3] |> List.map(incr(~v =_)) |> List.length; - -let a1 = [|1, 2, 3|] |> Array.get(_, 1); - -let s1 = "roses are red" |> String.get(_, 4); - -let optParam = (~v=?, ()) => v == None ? 0 : 1; - -let l1 = - [Some(1), None, Some(2)] |> List.map(optParam(~v=?_, ())) |> List.length; - -let l2 = - [Some(1), None, Some(2)] |> List.map(optParam(~v =?_, ())) |> List.length; - -let argIsUnderscore1 = _ => 34; - -let argIsUnderscore2 = (_ => 34); - -let argIsUnderscore3 = _ : int => 34; - -let argIsUnderscore4 = (_ : int => 34); - -let argIsUnderscore5 = (_: int) => 34; - -let argIsUnderscore6 = ((_: int) => 34); - -type reasonXyz = - | X - | Y(int,int,int) - | Z(int,int) - | Q - | R; - -type reasonXyzWithOf = - | X - | Y(int,int,int) - | Z(int,int) - | Q - | R; - -let reasonBarAs = fun - | ((Y(_) | Z(_)) as t, _) => {let _ = t; true} - | _ => false; - -let reasonDoubleBar = fun - | X | Y(_,_,_) | Z(_,_) | Q => true - | _ => false; - -let reasonDoubleBarNested = fun - | X | Y(_,_,_) | (Z(_,_) | Q) => true - | _ => false; - - -/* Liberal use of the Any pattern being compatible with multiple - arguments */ -let reasonDoubleBarAnyPatterns = fun - | X | Y(_) | Z(_) | Q => true - | _ => false; - -let reasonDoubleBarNestedAnyPatterns = fun - | X | Y(_) | (Z(_) | Q) => true - | _ => false; - -let (\+) = (+); - -let a = 2.0 ** 4.0; - -let (\===) = (===); - -let expectedPrecendence = 1 + 1 \=== 1 + 1 && 1 + 1 \!== 1 + 1; - -let expectedPrecendence = 1 \+ 1 \=== 1 \+ 1 && 1 \+ 1 \!== 1 \+ 1; - -module X: {let x: (~x: unit=?, unit) => unit;} = { - let x(~x=(),()) = (); -}; - -let display (~message=("hello": string), ~person: string="Reason", time: float) = 1; - -let not = (x, y) => x + y; - -let added: int = not(1, 2); - -let better = foo => !foo ? 42 : not(41, 2); diff --git a/formatTest/typeCheckedTests/input/basics_no_semi.re b/formatTest/typeCheckedTests/input/basics_no_semi.re deleted file mode 100644 index c84c95812..000000000 --- a/formatTest/typeCheckedTests/input/basics_no_semi.re +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let l = [1,2,3] |> List.map (i => i+1, _) |> List.filter (i => i>0, _) - -let l = (i => i+1) |> List.map(_, [1,2,3]) - -let x = List.length(_) - -let nested = x => List.length(_) - -let incr = (~v) => v+1 - -let l1 = [1,2,3] |> List.map(incr(~v=_)) |> List.length - -let l2 = [1,2,3] |> List.map(incr(~v =_)) |> List.length - -let optParam = (~v=?, ()) => v == None ? 0 : 1 - -let l1 = - [Some(1), None, Some(2)] |> List.map(optParam(~v=?_, ())) |> List.length - -let l2 = - [Some(1), None, Some(2)] |> List.map(optParam(~v =?_, ())) |> List.length - -let argIsUnderscore1 = _ => 34 - -let argIsUnderscore2 = (_ => 34) - -let argIsUnderscore3 = _ : int => 34 - -let argIsUnderscore4 = (_ : int => 34) - -let argIsUnderscore5 = (_: int) => 34 - -let argIsUnderscore6 = ((_: int) => 34) - -type reasonXyz = - | X - | Y(int,int,int) - | Z(int,int) - | Q - | R - -type reasonXyzWithOf = - | X - | Y(int,int,int) - | Z(int,int) - | Q - | R - -let reasonBarAs = fun - | ((Y(_) | Z(_)) as t, _) => {let _ = t; true} - | _ => false - -let reasonDoubleBar = fun - | X | Y(_,_,_) | Z(_,_) | Q => true - | _ => false - -let reasonDoubleBarNested = fun - | X | Y(_,_,_) | (Z(_,_) | Q) => true - | _ => false - - -/* Liberal use of the Any pattern being compatible with multiple - arguments */ -let reasonDoubleBarAnyPatterns = fun - | X | Y(_) | Z(_) | Q => true - | _ => false - -let reasonDoubleBarNestedAnyPatterns = fun - | X | Y(_) | (Z(_) | Q) => true - | _ => false - -let (\+) = (+) - -let a = 2.0 ** 4.0 - -let (\===) = (===) - -let expectedPrecendence = 1 + 1 \=== 1 + 1 && 1 + 1 \!== 1 + 1 - -let expectedPrecendence = 1 \+ 1 \=== 1 \+ 1 && 1 \+ 1 \!== 1 \+ 1 - -module X: {let x: (~x: unit=?, unit) => unit} = { - let x(~x=(),()) = () -} - -let display (~message=("hello": string), ~person: string="Reason", time: float) = 1 diff --git a/formatTest/typeCheckedTests/input/bigarraySyntax.re b/formatTest/typeCheckedTests/input/bigarraySyntax.re deleted file mode 100644 index e6b9a4d4a..000000000 --- a/formatTest/typeCheckedTests/input/bigarraySyntax.re +++ /dev/null @@ -1,27 +0,0 @@ -/* https://github.com/facebook/reason/issues/2038 */ -let my_big_array1 = - Bigarray.Array1.create(Bigarray.float32, Bigarray.c_layout, 20); - -my_big_array1.{1}; - -my_big_array1.{1} = 1.0; - -let my_big_array2 = - Bigarray.Array2.create(Bigarray.float32, Bigarray.c_layout, 20, 20); - -my_big_array2.{1, 2}; - -my_big_array2.{1, 2} = 1.0; - -let my_big_array3 = - Bigarray.Array3.create(Bigarray.float32, Bigarray.c_layout, 20, 20, 20); - -my_big_array3.{1, 2, 3}; - -my_big_array3.{1, 2, 3} = 1.0; - -let reallyLongStringThatWillDefinitelyBreakLine = 0; - -my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine}; - -my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine} = 3.0; diff --git a/formatTest/typeCheckedTests/input/comments.ml b/formatTest/typeCheckedTests/input/comments.ml deleted file mode 100644 index b710320fc..000000000 --- a/formatTest/typeCheckedTests/input/comments.ml +++ /dev/null @@ -1,128 +0,0 @@ -(* **** comment *) -(*** comment *) -(** docstring *) -(* comment *) -(** docstring *) -(*** comment *) -(**** comment *) -(***** comment *) - -(*** *) -(**** *) - -(***) -(****) - - - -(* (** comment *) *) -(* (*** comment *) *) -(* *(*** comment *) *) - -(* comment **) -(* comment ***) -(* comment ****) -(* comment *****) - -let testingNotQuiteEndOfLineComments = [ - "Item 1"(* Comment For First Item *); - "Item 2" (* Comment For Second Item *); - "Item 3" (* Comment For Third Item *) ; - "Item 4" (* Comment For Fourth Item - but no semi *) - (* Comment after last item in list. *) -] (* Comment after list bracket *) - -let testingEndOfLineComments = [ - "Item 1";(* Comment For First Item *) - "Item 2"; (* Comment For Second Item *) - "Item 3"; (* Comment For Third Item *) - "Item 4" (* Comment For Fourth Item - but before semi *); - (* Comment after last item in list. *) -] (* Comment after list bracket *) - -(* This time no space between bracket and comment *) -let testingEndOfLineComments = [ -](* Comment after list bracket *) - - -type t = int * int (* End of line on t *) - -type t22 = (* End of t22 line on type t22 = *) - int * int - - -type variant = - (* Comment above X *) - | X of int (* End of line on X *) - (* Comment above Y *) - | Y of int (* End of line on Y *) -(* Comment on entire type def for variant *) - - -type x = { (* not attached *above* x *) - fieldOne : int -} (* Attached end of line after x *) -and y = { (* not attached *above* y *) - fieldTwo : int -} (* Attached end of line after y *) - - -let result = match X 3 with - | X x -> (* Where does this comment go? *) - let tmp = x in - x + tmp - | Y x -> - (* How about this one *) - let tmp = x in - x + tmp - -let result = match None with - | Some {fieldOne = 20} -> (* Where does this comment go? *) - let tmp = 0 in - 2 + tmp - | Some {fieldOne = n} -> - (* How about this one *) - let tmp = n in - n + tmp - | None -> 20 - -type pointWithManyKindsOfComments = { - (* Line before x *) - x: string; (* x field *) - (* Line before y *) - y: string; (* y field *) - (* Final row of record *) -} - -type 'a typeParamPointWithComments = { - (* Line before x *) - x: 'a; (* x field *) - (* Line before y *) - y: 'a (* y field *) - (* Final row of record *) -} - - -let name_equal x y = x = y - -let equal i1 i2 = - i1.contents == i2.contents && true (* most unlikely first *) - -let equal i1 i2 = - compare (compare 0 0) (compare 1 1) (* END OF LINE HERE *) - - - -module Temp = struct - let v = true - let logIt str () = print_string str -end - -let store_attributes arg = - let attributes_file = "test" in - let proc_name = attributes_file ^ ".proc" in - let should_write = (* only overwrite defined procedures *) - Temp.v || - not (Temp.v) in - if should_write then - Temp.logIt proc_name () diff --git a/formatTest/typeCheckedTests/input/comments.mli b/formatTest/typeCheckedTests/input/comments.mli deleted file mode 100644 index 3c749db48..000000000 --- a/formatTest/typeCheckedTests/input/comments.mli +++ /dev/null @@ -1,41 +0,0 @@ -(* **** comment *) -(*** comment *) -(** docstring *) -(* comment *) -(** docstring *) -(*** comment *) -(**** comment *) -(***** comment *) - -(** *) -(*** *) -(**** *) - -(***) -(****) - - - -(** (** comment *) *) -(** (*** comment *) *) - -(* (** comment *) *) -(* (*** comment *) *) -(* *(*** comment *) *) - -(* comment **) -(* comment ***) -(* comment ****) -(* comment *****) - -(** - * Multiline - *) - -(** Multiline - * - *) - -(** - ** - *) diff --git a/formatTest/typeCheckedTests/input/features406.4.06.0.ml b/formatTest/typeCheckedTests/input/features406.4.06.0.ml deleted file mode 100644 index 4be05c44b..000000000 --- a/formatTest/typeCheckedTests/input/features406.4.06.0.ml +++ /dev/null @@ -1,18 +0,0 @@ -module EM = struct - (** Exception *) - exception E of int * int -end - -(* Pcl_open *) -class x = let open EM in object (self) end - -module OM = struct - type t -end - -class y = let open EM in let open OM in object (self) end - -module type S = sig - type t = private .. - type t += Foo -end diff --git a/formatTest/typeCheckedTests/input/features408.4.08.0.ml b/formatTest/typeCheckedTests/input/features408.4.08.0.ml deleted file mode 100644 index 52e986cae..000000000 --- a/formatTest/typeCheckedTests/input/features408.4.08.0.ml +++ /dev/null @@ -1,17 +0,0 @@ -open struct - type t = string -end - -let (let+) x f = List.map f x - -let (and+) = List.map2 (fun x y -> x,y) - -let x = - let+ x = [2] - and+ y = [3] - in - x, y - -let y = - let+ x = [2] in - x diff --git a/formatTest/typeCheckedTests/input/features408.4.08.0.mli b/formatTest/typeCheckedTests/input/features408.4.08.0.mli deleted file mode 100644 index faf535a98..000000000 --- a/formatTest/typeCheckedTests/input/features408.4.08.0.mli +++ /dev/null @@ -1,20 +0,0 @@ -module X : sig - type t -end - -module M := X - -module N := X [@@attr] - -type y = int - -type z = int - -type t = int - -type x := y - -type y := z [@@attr1] -and w := t [@@attr2] - -type x' = | and y' = | diff --git a/formatTest/typeCheckedTests/input/imperative.re b/formatTest/typeCheckedTests/input/imperative.re deleted file mode 100644 index 91e314398..000000000 --- a/formatTest/typeCheckedTests/input/imperative.re +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/* - * Syntax and fallback syntax. - - * vim: set ft=reason: - */ -switch (while (true) { - (); - }) { - | _ => () -}; - -try (while (true) { - (); - }) { - | _ => () -}; - -switch (for (i in 0 to 10) { - (); - }) { - | _ => () -}; - -try (for (i in 0 to 10) { - (); - }) { - | _ => () -}; - - -switch ( - if (true) {print_string("switching on true");} else {print_string("switching on false");} -) { - | _ => () -}; - -try (for (i in 0 to 10) { - (); - }) { - | _ => () -}; - - -let result = while (false) { - (); - } == () ? false : true; - -switch ( - try ( - try () { | _ => () } - ) { - | _ => () - } -) { - | () => () -}; - -let shouldStillLoop = {contents: false}; - -while (shouldStillLoop.contents) { - print_string("You're in a while loop"); - print_newline(); -}; - -while { - shouldStillLoop.contents = false; - shouldStillLoop.contents; - } { - print_string("Will never loop"); -}; - -while ((shouldStillLoop := false) == ()) { - print_string("Forever in the loop"); -}; diff --git a/formatTest/typeCheckedTests/input/jsx.re b/formatTest/typeCheckedTests/input/jsx.re deleted file mode 100644 index 38c2ac8a7..000000000 --- a/formatTest/typeCheckedTests/input/jsx.re +++ /dev/null @@ -1,458 +0,0 @@ -type component = {displayName: string}; - -module Bar = { - let createElement(~c=?,~children,()) {displayName: "test"}; -}; - -module Nesting = { - let createElement(~children,()) {displayName: "test"}; -}; - -module Much = { - let createElement(~children,()) {displayName: "test"}; -}; - -module Foo = { - let createElement(~a=?,~b=?,~children,()) {displayName: "test"}; -}; - -module One = { - let createElement(~test=?,~foo=?,~children,()) {displayName: "test"}; - - let createElementobvioustypo(~test,~children,()) {displayName: "test"}; -}; - -module Two = { - let createElement(~foo=?,~children,()) {displayName: "test"}; -}; - -module Sibling = { - let createElement(~foo=?,~children : list(component),()) = {displayName: "test"}; -}; - -module Test = { - let createElement(~yo=?,~children,()) {displayName: "test"}; -}; - -module So = { - let createElement(~children,()) {displayName: "test"}; -}; - -module Foo2 = { - let createElement(~children,()) {displayName: "test"}; -}; - -module Text = { - let createElement(~children,()) {displayName: "test"}; -}; - -module Exp = { - let createElement(~children,()) {displayName: "test"}; -}; - -module Pun = { - let createElement(~intended=?,~children,()) {displayName: "test"}; -}; - -module Namespace = { - module Foo = { - let createElement(~intended=?,~anotherOptional as x=100,~children,()) {displayName: "test"}; - }; -}; - -module Optional1 = { - let createElement(~required,~children,()) { - switch (required) { - | Some(a) => {displayName: a} - | None => {displayName: "nope"} - }; - }; -}; - -module Optional2 = { - let createElement(~optional=?,~children,()) { - switch (optional) { - | Some(a) => {displayName: a} - | None => {displayName: "nope"} - }; - }; -}; - -module DefaultArg = { - let createElement(~default=Some("foo"),~children,()) { - switch (default) { - | Some(a) => {displayName: a} - | None => {displayName: "nope"} - }; - }; -}; - - -module LotsOfArguments = { - let createElement(~argument1=?,~argument2=?,~argument3=?,~argument4=?,~argument5=?,~argument6=?,~children,()) {displayName: "test"}; -}; - -let div(~argument1=?,~children,()) { - displayName: "test" -}; - -module List1 = { - let createElement(~children,()) {displayName: "test"}; -}; - -module List2 = { - let createElement(~children,()) {displayName: "test"}; -}; - -module List3 = { - let createElement(~children,()) {displayName: "test"}; -}; - -module NotReallyJSX = { - let createElement(~foo,~bar,children) {displayName: "test"}; -}; - -let notReallyJSX(~foo,~bar,children) { - displayName: "test" -}; - -let fakeRender (el:component) { - el.displayName -}; - -/* end of setup */ - -let (/><)(a,b) = a + b; -let (><)(a,b) = a + b; -let (/>) = fun(a,b) => a + b; -let ( ><\/ ) = fun(a,b) => a + b; - -let tag1 = 5 />< 6; -let tag2 = 5 >< 7; -let tag3 = 5 /> 7; -let tag4 = 5 ><\/ 7; - -let b = 2; -let selfClosing = ; -let selfClosing2 = ; -let selfClosing3 = - ; -let a = a + 2) /> ; -let a3 = ; -let a4 = ; -let a5 = "testing a string here"; -let a6 = - - - "testing a string here" - "another string" ( 2 + 4 ) - ; -let intended = true; -let punning = ; -let namespace = ; -let c = ; -let d = ; - -let spaceBefore = ; -let spaceBefore2 = ; -let siblingNotSpaced = ; -let jsxInList = [ ]; -let jsxInList2 = [ ]; -let jsxInListA = [ ]; -let jsxInListB = [ ]; -let jsxInListC = [ ]; -let jsxInListD = [ ]; -let jsxInList3 = [ , , ]; -let jsxInList4 = [ , , ]; -let jsxInList5 = [ , ]; -let jsxInList6 = [ , ]; -let jsxInList7 = [ , ]; -let jsxInList8 = [ , ]; -let testFunc(b) = b; -let jsxInFnCall = testFunc (); -let lotsOfArguments = ; -let lowerCase =
; - -let b = 0; -let d = 0; -/* - * Should pun the first example: - */ -let a = 5; -let a = 5; -let a = 5; -let a = 0.55; -let a = [@JSX] Foo.createElement(~children=[],()); -let ident = {a}; -let fragment1 = <> ; -let fragment2 = <> ; -let fragment3 = <> ; -let fragment4 = <> ; -let fragment5 = <> ; -let fragment6 = <> ; -let fragment7 = <> ; -let fragment8 = <> ; -let fragment9 = <> 2 2 2 2 ; -let fragment10 = <>2.2 3.2 4.6 1.2 ; -let fragment11 = <>"str"; -let fragment12 = <>(6 + 2) (6 + 2) (6 + 2); -let fragment13 = <>fragment11 fragment11; -let listOfItems1 = 1 2 3 4 5; -let listOfItems2 = 1.0 2.8 3.8 4.0 5.1; -let listOfItems3 = fragment11 fragment11; - - - -/* - * Several sequential simple jsx expressions must be separated with a space. - */ -let thisIsRight(a,b) = (); -let tagOne = fun(~children,()) => (); -let tagTwo = fun(~children,()) => (); -/* thisIsWrong ; */ -thisIsRight(,); - -/* thisIsWrong ; */ -thisIsRight( , ); - - -let a = fun(~children,()) => (); -let b = fun(~children,()) => (); - -let thisIsOkay = - - - - ; - -let thisIsAlsoOkay = - - - ; - - -/* Doesn't make any sense, but suppose you defined an - infix operator to compare jsx */ - < ; - > ; - - < ; - > ; - -let listOfListOfJsx = [<> ]; -let listOfListOfJsx = [<> ]; -let listOfListOfJsx = [<> , <> ]; -let listOfListOfJsx = [<> , <> , ...listOfListOfJsx]; - - -let sameButWithSpaces = [ <> ]; -let sameButWithSpaces = [ <> ]; -let sameButWithSpaces = [ <> , <> ]; -let sameButWithSpaces = [ <> , <> , ...sameButWithSpaces]; - -/* - * Test named tag right next to an open bracket. - */ - -let listOfJsx = []; -let listOfJsx = [ ]; -let listOfJsx = [, ]; -let listOfJsx = [, , ...listOfJsx]; - - -let sameButWithSpaces = []; -let sameButWithSpaces = []; -let sameButWithSpaces = [, ]; -let sameButWithSpaces = [, , ...sameButWithSpaces]; - -/** - * Test no conflict with polymorphic variant types. - */ -type thisType = [`Foo | `Bar]; -type t('a) = [< thisType ] as 'a; - -let asd = [@JSX] [@foo] One.createElement(~test=true, ~foo=2, ~children=["a", "b"],()); -let asd2 = [@JSX] [@foo] One.createElementobvioustypo(~test=false, ~children=["a", "b"],()); - -let span(~test : bool,~foo : int,~children,()) = 1; -let asd = [@JSX] [@foo] span(~test=true, ~foo=2, ~children=["a", "b"],()); -/* "video" call doesn't end with a list, so the expression isn't converted to JSX */ -let video(~test: bool,children) = children; -let asd2 = [@JSX] [@foo] video(~test=false,10); - - -let div(~children) = 1; -([@JSX] (((fun () => div) ())(~children=[]))); - -let myFun () { - <> - - - - - - - - - - - - ; - -}; - -let myFun () { -<> -; -}; - -let myFun () { - <> - - - - - - - - - - - - ; -}; - -/** - * Children should wrap without forcing attributes to. - */ - - - - - -; - -/** - * Failing test cases: - */ -/* let res = ) > */ -/* */ -/* ; */ - -/* let res = ) />; */ -let zzz = Some("oh hai"); -/* this should be the only test that generates a warning. We're explicitly testing for this */ -let optionalCallSite = ; -fakeRender(optionalCallSite); -let optionalArgument = ; -fakeRender(optionalArgument); -let optionalArgument = ; -fakeRender(optionalArgument); -let defaultArg = ; -fakeRender(defaultArg); -let defaultArg = ; -fakeRender(defaultArg); - -([@JSX][@bla] NotReallyJSX.createElement([],~foo=1,~bar=2)); -([@bla][@JSX] NotReallyJSX.createElement(~foo=1,[],~bar=2)); -([@JSX][@bla] notReallyJSX([],~foo=1)); -([@bla][@JSX] notReallyJSX(~foo=1,[],~bar=2)); - -/* children can be at any position */ -([@JSX] span(~children=[],~test=true,~foo=2,())); - -([@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); - -/* preserve some other attributes too! */ -([@JSX][@bla] span(~children=[],~test=true,~foo=2,())); -([@bla][@JSX] span(~children=[],~test=true,~foo=2,())); - -([@JSX][@bla] Optional1.createElement(~children=[],~required=Some("hi"),())); -([@bla][@JSX] Optional1.createElement(~children=[],~required=Some("hi"),())); - -/* Overeager JSX punning #1099 */ -module Metal = { - let fiber = "fiber"; -}; - -module OverEager = { - let createElement(~fiber,~children,()) {displayName: "test"}; -}; - -let element = ; - -type style = { - width: int, - height: int, - paddingTop: int, - paddingLeft: int, - paddingRight: int, - paddingBottom: int -}; - -module Window = { - let createElement(~style,~children,()) {displayName: "window"}; -}; - -let w = - ; - - -let foo = None; - -let g = ; - -/* https://github.com/facebook/reason/issues/1428 */ - ...element ; - - ...((a) => 1) ; - - ... ; - - ...[|a|] ; - - ...(1, 2) ; - -module Foo3 = { - let createElement = (~bar, ~children, ()) => (); -}; - - />; - -let onClickHandler = () => (); - -let div = (~onClick, ~children, ()) => (); - -
<> "foobar"
; - -/* - * This is identical to just having "foobar" as a single JSX child (which means - * it's in a list). - */ -let yetAnotherDiv =
... <> "foobar"
; - -let tl = []; - -/* - * Spreading a list that has an identifier/expression as its tail. This should - * preserve the spread and preserve the braces. [list] is not considered - * simple for the purposes of spreading into JSX, or as a child. - */ -
...{[yetAnotherDiv, ...tl]}
; - -/* - * This is equivalent to having no children. - */ -
...{[]}
; diff --git a/formatTest/typeCheckedTests/input/knownMlIssues.ml b/formatTest/typeCheckedTests/input/knownMlIssues.ml deleted file mode 100644 index 47529ca40..000000000 --- a/formatTest/typeCheckedTests/input/knownMlIssues.ml +++ /dev/null @@ -1,35 +0,0 @@ -(* [x] fixed *) -type t2 = - int * int (* attributed to entire type not binding *) - -type color = - | Red of int (* After red *) - | Black of int (* After black *) - | Green of int (* Does not remain here *) - - -let blahCurriedX x = - function - | Red 10 - | Black 20 - | Green 10 -> 1 (* After or pattern green *) - | Red x -> 0 (* After red *) - | Black x -> 0 (* After black *) - | Green x -> 0 (* After second green *) -(* On next line after blahCurriedX def *) - - -(* EOL comments wrap because other elements break first (in this example - "mutable" causes breaks. We either need: - 1. To prevent wrapping of anything inside of eol comments attachments. - 2. Losslessly wrap eol comments. -*) -(* This example illustrates the above issue, but isn't een idempotent due to the issue. *) -(* type cfg = { *) -(* node_id : int ref; *) -(* node_list : int list ref; *) -(* name_pdesc_tbl : (int, (int, int) Hashtbl.t) Hashtbl.t; (** Map proc name to procdesc *) *) -(* mutable priority_set : (int, int) Hashtbl.t (** set of function names to be analyzed first *) *) -(* } *) -(* *) -(* *) diff --git a/formatTest/typeCheckedTests/input/knownReIssues.re b/formatTest/typeCheckedTests/input/knownReIssues.re deleted file mode 100644 index 2c96b3005..000000000 --- a/formatTest/typeCheckedTests/input/knownReIssues.re +++ /dev/null @@ -1,23 +0,0 @@ -/** - Issue 940: https://github.com/facebook/reason/issues/940 - The parens in the exception match case with an alias, - are required for correct parsing: - i.e. (Sys_error _ as exc) instead of Sys_error _ as exc - The latter doesn't type-check with Error: Unbound value exc. - Warning 11 (unused match case) is also triggered. - */ -let f () = raise(Sys_error("error")); - -switch (f ()) { -| x => () -| exception (Sys_error(_) as exc) => raise(exc) -}; - -exception Foo(string); - -let g () = raise(Foo("bar errors")); - -switch (g ()) { -| x => () -| exception Foo(f) => raise (Foo(f)) -}; diff --git a/formatTest/typeCheckedTests/input/lazy.re b/formatTest/typeCheckedTests/input/lazy.re deleted file mode 100644 index 19c357dd2..000000000 --- a/formatTest/typeCheckedTests/input/lazy.re +++ /dev/null @@ -1,27 +0,0 @@ -let myComputation = lazy { - let tmp = 10; - let tmp2 = 20; - tmp + tmp2; -}; - -type myRecord = {myRecordField: int}; - -let operateOnLazyValue (lazy {myRecordField}) { - let tmp = myRecordField; - tmp + tmp; -}; - -let result = operateOnLazyValue (lazy {myRecordField: 100}); - -type box('a) = Box('a); - -let lazy thisIsActuallyAPatternMatch = lazy (200); -let tmp: int = thisIsActuallyAPatternMatch; -let (lazy (Box(i)), x) = (lazy (Box(200)), 100); -let tmp: int = i; - -let myComputation = lazy (200); - -let reallyLoooooooooooooongIdentifierThatSpansMoreThan50Cols = 200; - -let foo = lazy(reallyLoooooooooooooongIdentifierThatSpansMoreThan50Cols) diff --git a/formatTest/typeCheckedTests/input/letop.re b/formatTest/typeCheckedTests/input/letop.re deleted file mode 100644 index 43451382d..000000000 --- a/formatTest/typeCheckedTests/input/letop.re +++ /dev/null @@ -1,28 +0,0 @@ -let (let.opt) = (x, f) => switch x { | None => None | Some(x) => f(x) }; -let (let.&opt) = (x, f) => switch x { | None => None | Some(x) => Some(f(x)) }; - -let z = { - let.opt a = Some(2); - let.&opt b = Some(5); - a + b -} - -let (let./\/) = (x, f) => switch x { | None => None | Some(x) => f(x) }; -let (let.&/\*) = (x, f) => switch x { | None => None | Some(x) => Some(f(x)) }; - -/* Test syntax that could potentially conflict with comments */ -let z = { - let./\/ a = Some(2); - let.&/\* b = Some(5); - a + b -} - -let _ = { - let.opt _ = Some("a"); - - let.opt _ = Some("c"); - - // hello - - None; -}; diff --git a/formatTest/typeCheckedTests/input/mlSyntax.ml b/formatTest/typeCheckedTests/input/mlSyntax.ml deleted file mode 100644 index e501ecec2..000000000 --- a/formatTest/typeCheckedTests/input/mlSyntax.ml +++ /dev/null @@ -1,86 +0,0 @@ -(* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. *) - -(** - * Testing pattern matching using ml syntax to exercise nesting of cases. - *) - - -type xyz = - | X - | Y of int * int * int - | Z of int * int - | Q - | R - -let doubleBar = function - | X | Y (_, _, _) | Z (_, _) | Q -> true - | _ -> false - -let doubleBarNested = function - | X | Y (_, _, _) | (Z (_, _) | Q) -> true - | _ -> false - - -(* Liberal use of the Any pattern being compatible with multiple arguments *) -let doubleBarAnyPatterns = function - | X | Y _ | Z _ | Q -> true - | _ -> false - -let doubleBarNestedAnyPatterns = function - | X | Y _ | (Z _ | Q) -> true - | _ -> false - -type bcd = B | C | D | E -type a = A of bcd -let result = match B with - | B - | C - | D - | E -> () - -let nested_match = function | A (B | C | D | E) -> 3 - -let some = Some (1, 2, 3) - -let (===) = (=) - -(* Test regression for https://github.com/facebook/Reason/issues/222 *) -let _ = Pervasives.(=) - -let structuralEquality = 1 = 1 - -let physicalInequality = 1 <> 2 - -let referentialEquality = 2 == 2 - -let referentialInequality = 2 != 2 - -let equalityInIf = if 1 = 1 then true else false - -let equalityWithIdentifiers = structuralEquality = referentialEquality - -let nestedSome = Some (1, 2, Some (1, 2, 3)) - -let nestedSomeSimple = Some (Some (1, 2, 3)) - -module EM = struct - (** Exception *) - exception E of int * int -end - -exception Ealias = EM.E - -let switc = "match" -let switch = "match" -let switch_ = "match" -let pub = "method" -let pub_ = "method" -let pri = "private" -let pri_ = "private" - -external private_ : unit -> unit = "" -external pri : unit -> unit = "" - -type pub = int -type pub_ = int - diff --git a/formatTest/typeCheckedTests/input/mlVariants.ml b/formatTest/typeCheckedTests/input/mlVariants.ml deleted file mode 100644 index 603edee27..000000000 --- a/formatTest/typeCheckedTests/input/mlVariants.ml +++ /dev/null @@ -1,26 +0,0 @@ -(* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. *) - -type polyVariantsInMl = [ - | `IntTuple of (int * int) - | `StillAnIntTuple of (int * int) -] - - - -let intTuple = `IntTuple (1, 2) -let stillAnIntTuple = `StillAnIntTuple (4, 5) -let sumThem = function - | `IntTuple (x, y) -> x + y - | `StillAnIntTuple (a, b) -> a + b - -type nonrec t = A of int | B of bool - -type s = [ `Poly ] - -let x = (`Poly: s) - -(* There's a bug in ocaml 4.06 resulting in an extra Pexp_constraint on the `Poly, - * duplicating the core_type. - * https://caml.inria.fr/mantis/view.php?id=7758 - * https://caml.inria.fr/mantis/view.php?id=7344 *) -let x : s = `Poly diff --git a/formatTest/typeCheckedTests/input/mutation.re b/formatTest/typeCheckedTests/input/mutation.re deleted file mode 100644 index a3da001e7..000000000 --- a/formatTest/typeCheckedTests/input/mutation.re +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/** - * Testing mutations. - */ -let holdsAUnit = ref(); - -let holdsABool = ref(false); - -let holdsAnInt = ref(0); - -let holdsAHoldsABool = ref(ref(true)); - -let () = holdsAUnit := holdsABool := false; - -/* Should be parsed as: */ -/* And so they should both be printed the same */ -let () = holdsAUnit := (holdsABool := false); - -/* - * The following: - * - * something = x := e - * - * Should be parsed as: - * - * something = (x := e) - */ -holdsAUnit.contents = holdsAnInt := 0; - -holdsABool.contents = holdsAnInt.contents == 100; - -let numberToSwitchOn = 100; - -switch (numberToSwitchOn) { - | -3 - | -2 - | -1 => () - | 0 => holdsAUnit.contents = () - | 1 => holdsAUnit.contents = holdsAnInt := 0 - | 2 => true ? holdsAUnit.contents = () : holdsABool.contents ? () : () - | 3 => true ? holdsAUnit := () : holdsABool.contents ? () : () - | 4 => true ? holdsAnInt := 40 : () - | 5 => holdsAnInt := 40 - | _ => () -}; - -let mutativeFunction = fun | Some(x) => holdsAUnit.contents = () - | None => holdsAUnit := (); diff --git a/formatTest/typeCheckedTests/input/newAST.4.06.0.re b/formatTest/typeCheckedTests/input/newAST.4.06.0.re deleted file mode 100644 index 198c3f5fc..000000000 --- a/formatTest/typeCheckedTests/input/newAST.4.06.0.re +++ /dev/null @@ -1,37 +0,0 @@ -/* Oinherit (https://github.com/ocaml/ocaml/pull/1118) */ -type t = { - . - a: string -}; - -type t1 = { - . - n: string, - ...t, -}; - -type t2('a) = { - .. - o: string, - ...t, -} as 'a; - -/* Pcl_open, Pcty_open (https://github.com/ocaml/ocaml/pull/1249) */ -module EM = { - type t; -}; - -module OM = { - type t; -}; - -class x = { - open EM; - as self; -}; - -class y = { - open EM; - open OM; - as self; -}; diff --git a/formatTest/typeCheckedTests/input/oo.re b/formatTest/typeCheckedTests/input/oo.re deleted file mode 100644 index 6d74cb66a..000000000 --- a/formatTest/typeCheckedTests/input/oo.re +++ /dev/null @@ -1,334 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -class virtual stack('a)(init) { - /* - * The "as this" is implicit and will be formatted away. - */ - as this; - val virtual dummy : unit; - val mutable v : list('a) = init; - - pub virtual implementMe: (int) => int; - pub pop = - switch (v) { - | [hd, ...tl] => { - v = tl; - Some(hd); - } - | [] => None - }; - - pub push(hd) {v = [hd, ...v]}; - initializer { - print_string("initializing object"); - }; - pub explicitOverrideTest(a) { a + 1 }; - pri explicitOverrideTest2(a) { a + 1 }; -}; - -let tmp = { - /** - * comment here. - */ - as this; - val x = 10; -}; - -/** - * Comment on stackWithAttributes. - */ -[@thisShouldntBeFormattedAway] -class virtual stackWithAttributes('a)(init) -/* Before class */ -{ - - /* The "as this" should not be formatted away because attributes. */ - - as [@thisShouldntBeFormattedAway] this; - /* Before floatting attribute */ - [@floatingAttribute]; - /* Virtual member */ - [@itemAttr1] - val virtual dummy : unit; - [@itemAttr2] - val mutable v : list('a) = init; - - pub virtual implementMe: (int) => int; - pub pop = - switch (v) { - | [hd, ...tl] => { - v = tl; - Some(hd); - } - | [] => None - }; - - pub push(hd) {v = [hd, ...v]}; - initializer { - print_string("initializing object"); - }; -} -; - -class extendedStack('a)(init) { - inherit (class stack('a))(init); - val dummy = (); - pub implementMe(i) = i; -}; - -class extendedStackAcknowledgeOverride('a)(init) { - inherit (class stack('a))(init); - val dummy = (); - pub implementMe(i) { i + 1 }; - pub! explicitOverrideTest(a) { a + 2 }; - pri! explicitOverrideTest2(a) { a + 2 }; -}; - -let inst = new extendedStack([1, 2]); - -/** - * Recursive classes. - */ -/* - * First recursive class. - */ -class firstRecursiveClass(init) { - val v = init; -} -/* - * Second recursive class. - */ -and secondRecursiveClass(init) { - val v = init; -}; - - - -/** - * For now, mostly for historic reasons, the syntax for type - * definitions/annotations on anonymous objects are different than - * "class_instance_type". That needn't be the case. The only challenge is that - * whatever we do, there is a slight challenge in avoiding conflicts with - * records. Clearly {x:int, y:int} will conflict. However, open object types in - * the form of {.. x:int, y:int} do not conflict. The only thing that must be - * resolved is closed object types and records. you could have a special token - * that means "closed". {. x: int, y:int}. If only closed object types would be - * optimized in the same way that records are, records could just be replaced - * with closed object types. - */ -/** - * Anonymous objects. - */ - -type closedObj = {.}; - -let (<..>)(a,b) = a + b; -let five = 2 <..> 3; - -type nestedObj = {. bar : {. a: int}}; - -let (>>)(a,b) = a > b; - -let bigger = 3 >> 2; - -type typeDefForClosedObj = {. x: int, y:int}; -type typeDefForOpenObj('a) = {.. x:int, y:int} as 'a; -let anonClosedObject: {. x:int, y:int} = { - pub x { 0 }; - pub y { 0 }; -}; - -let onlyHasX = {pub x = 0}; -let xs: list({. x:int}) = [onlyHasX, anonClosedObject :> {. x: int}]; - -let constrainedAndCoerced = - ([anonClosedObject, anonClosedObject] : list({. x:int, y:int}) :> list({. x:int})); - -/* If one day, unparenthesized type constraints are allowed on the RHS of a - * record value, we're going to have to be careful here because >} is parsed as - * a separate kind of token (for now). Any issues would likely be caught in the - * idempotent test case. - */ -let xs: ref({. x:int}) = {contents: (anonClosedObject :> {. x: int})}; - -let coercedReturn = { - let tmp = anonClosedObject; - (tmp :> {. x: int}) -}; - -let acceptsOpenAnonObjAsArg (o: {.. x: int, y:int}) = o#x + o#y; -let acceptsClosedAnonObjAsArg (o: {. x: int, y:int}) = o#x + o#y; -let res = acceptsOpenAnonObjAsArg { - pub x = 0; - pub y = 10; -}; - -let res = acceptsOpenAnonObjAsArg { - pub x = 0; - pub y = 10; - pub z = 10; -}; - -let res = acceptsClosedAnonObjAsArg { - pub x = 0; - pub y = 10; -}; - -/* TODO: Unify class constructor return values with function return values */ -class myClassWithAnnotatedReturnType(init) : {pub x : int; pub y : int} { - pub x = ( init : int ); - pub y = init; -}; -/** - * May include a trailing semi after type row. - */ -class myClassWithAnnotatedReturnType2(init):{pub x : int; pub y : int;} { - pub x = ( init : int ); - pub y = init; -}; - -/** - * May use equals sign, and may include colon if so. - */ -class myClassWithAnnotatedReturnType3(init):{pub x : int; pub y : int;} { - pub x = ( init : int ); - pub y:int = init; -}; - -/** - * The one difference between class_constructor_types and expression - * constraints, is that we have to include the prefix word "new" before the - * final component of any arrow. This isn't required when annotating just the - * return value with ": foo ". - * This is only to temporarily work around a parsing conflict. (Can't tell if - * in the final arrow component it should begin parsing a non_arrowed_core_type - * or a class_instance_type). A better solution, would be to include - * class_instance_type as *part* of core_type, but then fail when it is - * observed in the non-last arrow position, or if a non_arrowed_core_type - * appears in the last arrow position. - * - * class_instance_type wouldn't always fail if parsed as any "core type" - * everywhere else in the grammar. - * - * Once nuance to that would be making a parse rule for "type application", and - * deferring whether or not that becomes a Pcty_constr or a Ptyp_constr. (The - * same for type identifiers and extensions.) - */ -class myClassWithAnnotatedReturnType3_annotated_constructor : - (int) => {pub x : int; pub y : int;} = - (init) => { - pub x = ( init : int ); - pub y:int = init; - }; - -class tupleClass('a,'b) (init: ('a, 'b)) { - pub pr = init; -}; - -module HasTupleClasses : { - /** - * exportedClass. - */ - class exportedClass: (int) => {pub x : int; pub y : int}; - /** - * anotherExportedClass. - */ - class anotherExportedClass('a,'b) : (('a, 'b)) => {pub pr: ('a, 'b)}; -} = { - /** - * exportedClass. - */ - class exportedClass = myClassWithAnnotatedReturnType3; - - /** - * anotherExportedClass. - */ - class anotherExportedClass('a,'b) = (class tupleClass('a,'b)); -}; - -class intTuples = (class tupleClass(int,int)); - -class intTuplesHardcoded = (class tupleClass(int,int))((8, 8)); - -/** - * Note that the inner tupleClass doesn't have the "class" prefix because - * they're not kinds of classes - they're types of *values*. - * The parens here shouldn't be required. - */ -class intTuplesTuples = ( - class tupleClass( - (tupleClass(int,int)), - (tupleClass(int,int)) - ) -); - -let x: tupleClass(int,int) = {pub pr = (10, 10);}; - -let x: #tupleClass(int,int) = x; - -let incrementMyClassInstance: (int, #tupleClass(int,int)) => #tupleClass(int,int) = - (i,inst) => { - let (x, y) = inst#pr; - {pub pr = (x + i, y + i);}; - }; - -class myClassWithNoTypeParams = {}; -/** - * The #myClassWithNoTypeParams should be treated as "simple" - */ -type optionalMyClassSubtype('a) = option(#myClassWithNoTypeParams) as 'a; - - - -/** - * Remember, "class type" is really "class_instance_type" (which is the type of - * what is returned from the constructor). - * - * And when defining a class: - * - * addablePoint is the "class instance type" type generated in scope which is - * the closed object type of the return value of the constructor. - * - * #addablePoint is the extensible form of addablePoint (anything that - * adheres to the "interface.") - */ -class type addablePointClassType = { - pub x: int; - pub y: int; - pub add: (addablePointClassType, addablePointClassType) => int; -}; - -/** - * Class constructor types can be annotated. - */ -class addablePoint: (int) => addablePointClassType = fun(init) => { - as self; - pub add (one: addablePointClassType, two:addablePointClassType) = - one#x + two#x + one#y + two#x; - pub x = (init : int); - pub y = init; -}; - -class addablePoint2 = (fun(init) => { - as self; - pub add (one: addablePointClassType, two:addablePointClassType) = - one#x + two#x + one#y + two#x; - pub x = (init : int); - pub y = init; -} : (int) => addablePointClassType); - -module type T = { - class virtual cl('a) : {} - and cl2 : {}; -}; - -let privacy = { - pri x(c) = 5 + c; -}; - -module Js = { - type t('a); -}; - -/* supports trailing comma */ -type stream('a) = {. "observer": ('a => unit) => unit,}; diff --git a/formatTest/typeCheckedTests/input/patternMatching.re b/formatTest/typeCheckedTests/input/patternMatching.re deleted file mode 100644 index d6614ed26..000000000 --- a/formatTest/typeCheckedTests/input/patternMatching.re +++ /dev/null @@ -1,266 +0,0 @@ -type point = {x: int, y: int}; - -let id(x) = x; - -type myVariant = - | TwoCombos(inner, inner) - | Short - | AlsoHasARecord(int, int, point) -and inner = - | Unused - | HeresTwoConstructorArguments(int, int); - -let computeTuple(a,b,c,d,e,f,g,h) = ( - a + b, - c + d, - e + f, - g + h -); - -let res = - switch (TwoCombos(Unused,Unused)) { - | TwoCombos - (HeresTwoConstructorArguments(x,y), - HeresTwoConstructorArguments(a,b)) => - (x, y, a, b) - | TwoCombos - (_, - _) => (0, 0, 0, 0) - | Short - | AlsoHasARecord (300,_,_) => ( - 100000, - 100000, - 100000, - 100000 - ) - | AlsoHasARecord (firstItem, two, {x, y}) => - computeTuple(firstItem,firstItem,firstItem,firstItem,firstItem,two,two,two) - }; - -/** - * Match bodies may include sequence expressions, but without the `{}` - * braces required. - */ -let res = - switch (TwoCombos(Unused,Unused)) { - | TwoCombos - (HeresTwoConstructorArguments(x,y), - HeresTwoConstructorArguments(a,b)) => { - let ret = (x, y, a, b); - ret; - } - | TwoCombos (_,_) => - /** - * See, no braces required - saves indentation as well! - */ - let ret = (0, 0, 0, 0); - ret; - | Short - | AlsoHasARecord (300,_,_) => - /** - * And no final semicolon is required. - */ - let ret = ( - 100000, - 100000, - 100000, - 100000 - ); - ret - | AlsoHasARecord(firstItem,two,{x, y}) => - computeTuple(firstItem,firstItem,firstItem,firstItem,firstItem,two,two,two) - }; - - - -/** - * Ensure that nested Pexp_functions are correctly wrapped in parens. - * - */ -let res = - switch (TwoCombos(Unused,Unused)) { - | TwoCombos - (HeresTwoConstructorArguments(x,y), - HeresTwoConstructorArguments(a,b)) => - (fun - | Some(x) => x + 1 - | None => 0) - | TwoCombos - (_, - _) => - let x = - (fun - | Some(x) => x + 1 - | None => 0); - x; - | Short - | AlsoHasARecord(300,_,_) => id ((fun - | Some(x) => x + 1 - | None => 0)) - | AlsoHasARecord(firstItem,two,{x, y}) => - id ((fun - | Some(x) => x + 1 - | None => 0)); - }; - -/* test (), which is sugar for (()) */ -switch (Some(())) { -| Some(()) => 1 -| _ => 2 -}; -switch (Some(())) { -| Some() => 1 -| _ => 2 -}; -switch (Some()) { -| Some(()) => 1 -| _ => 2 -}; -switch (Some()) { -| Some() => 1 -| _ => 2 -}; - -type foo = Foo(unit); -switch (Foo(())) { -| Foo(()) => 1 -}; -switch (Foo(())) { -| Foo() => 1 -}; -switch (Foo()) { -| Foo(()) => 1 -}; -switch (Foo()) { -| Foo() => 1 -}; - -switch (()) { -| (()) => 1 -}; -switch (()) { -| () => 1 -}; -switch () { -| (()) => 1 -}; -switch () { -| () => 1 -}; - -switch (Some(1)) { -| Some(1) => 1 -| None => 2 -| _ => 3 -}; - -let myInt = 100; -/* Numeric ranges are rejected by the type checker, but validly parsed so drop - * this in an annotation to test the parsing. */ -[@something? 1 .. 2] -let rangeInt = 0; - -let myChar = 'x'; -let rangeChar = - switch(myChar) { - | 'a'..'b' => "a to b" - | 'b' .. 'z' => "b to z" - | c => "something else" - }; - -/* with parens around direct list pattern in constructor pattern */ -switch (None) { -| Some([]) => () -| Some([_]) when true => () -| Some([x]) => () -| Some([x, ...xs]) when true => () -| Some([x, y, z]) => () -| _ => () -}; - -/* no parens around direct list pattern in constructor pattern (sugar) */ -switch (None) { -| Some [] => () -| Some [_] when true => () -| Some [x] => () -| Some [x, ...xs] when true => () -| Some [x, y, z] => () -| _ => () -}; - -/* with parens around direct array pattern in constructor pattern */ -switch (None) { -| Some([| |]) => "empty" -| Some([| _ |]) when true => "one any" -| Some([| a |]) => "one" -| Some([| a, b |]) => "two" -| _ => "many" -}; - -/* no parens around direct array pattern in constructor pattern (sugar) */ -switch (None) { -| Some [||] => "empty" -| Some [|_|] when true => "one any" -| Some [|a|] => "one" -| Some [|a, b|] => "two" -| _ => "many" -}; - -/* parens around direct record pattern in constructor pattern */ -switch (None) { -| Some({x}) when true => () -| Some({x, y}) => () -| _ => () -}; - -/* no parens around direct record pattern in constructor pattern (sugar) */ -switch (None) { -| Some {x} when true => () -| Some {x, y} => () -| _ => () -}; - -switch (None) { -| Some([|someSuperLongString, thisShouldBreakTheLine|]) => () -| _ => () -}; - -switch (None) { -| Some((someSuperLongString, thisShouldBreakTheLine)) => () -| _ => () -}; - -switch (None) { -| Some([someSuperLongString, thisShouldBreakTheLine]) => () -| Some([someSuperLongString, ...es6ListSugarLikeSyntaxWhichIsSuperLong]) when true === true => () -| Some([someSuperLongString, ...es6ListSugarLikeSyntaxWhichIsSuperLong]) => () -| _ => () -} - - - -type aOrB = A(int) | B(int); -let ((nestedAnnotation: int) : int) = 0; -let ((A(i) | B(i): aOrB)) = A(0); - - -type test_foo = - | VariantType1 - | VariantType2 - -let branch_with_variant_and_annotation = - fun - | (VariantType1: test_foo) => true - | VariantType2 => false; - -type intRange = { - from: option(string), - to_: option(string) -} - -type optIntRange = option(intRange) - -let optIntRangeOfIntRange = - fun - | ({from: None, to_: None}: intRange) => (None: optIntRange) - | {from, to_} => Some({from, to_}); diff --git a/formatTest/typeCheckedTests/input/pervasive.mli b/formatTest/typeCheckedTests/input/pervasive.mli deleted file mode 100644 index 7a6400e32..000000000 --- a/formatTest/typeCheckedTests/input/pervasive.mli +++ /dev/null @@ -1,5 +0,0 @@ -val ( = ) : 'a -> 'a -> bool - -val ( <> ) : 'a -> 'a -> bool - -val not : bool -> bool \ No newline at end of file diff --git a/formatTest/typeCheckedTests/input/pipeFirst.re b/formatTest/typeCheckedTests/input/pipeFirst.re deleted file mode 100644 index 13d1c6326..000000000 --- a/formatTest/typeCheckedTests/input/pipeFirst.re +++ /dev/null @@ -1,168 +0,0 @@ -let (|.) = (x, y) => x + y; - -let a = 1; -let b = 2; -let c = 3; - -/* parses as 10 < (a->b->c) */ -let t1: bool = 10 < a->b->c; - -type coordinate = {x: int, y: int}; -let coord = {x: 1, y: 1}; - -/* parses as (coord.x)->a->b->c */ -let t2: int = coord.x->a->b->c; - -let (|.) = (x, y) => x || y; - -let a = true; -let b = false; -let c = true; - -/* parses as !(a->b->c) */ -let t3: bool = !a->b->c; - -/* parse pipe first with underscore application correct */ -let doStuff = (a: int, b: int, c: int): int => { - a + 2 * b + 3 * c; -}; - -let (|.) = (a, f) => f(a); - -let t4: int = 5->doStuff(1, _, 7); -let t5: int = 5->doStuff(1, _, 7)->doStuff(1, _, 7); - -module Foo = { - let createElement = (~children, ()) => - List.hd(children) ++ "test"; - - let map = (xs, f) => List.map(f, xs); - - let plusOne = x => x + 1; - - let toString = lst => - List.fold_left( - (acc, curr) => - acc ++ (string_of_int(curr)), - "", - lst - ); -}; - -let items = [1, 2, 3]; - -let t6: string = - {items->Foo.map(Foo.plusOne)->Foo.toString} ; - -type saveStatus = - | Pristine - | Saved - | Saving - | Unsaved; - -let saveStatus = Pristine; - -let t7: string = - - { - ( - switch (saveStatus) { - | Pristine => [0] - | Saved => [1] - | Saving => [2] - | Unsaved => [3] - } - ) - ->Foo.map(Foo.plusOne) - ->Foo.toString - } - ; - -let genItems = (f) => List.map(f, items); - -let t8: string = - - {genItems(Foo.plusOne)->Foo.toString} - ; - -let blocks = [1, 2, 3]; - -let t9: string = - - blocks->(b => Foo.toString(b)) - ; - -let foo = (xs) => List.concat([xs, xs]); - -let t10: string = - - {blocks->foo->Foo.map(Foo.plusOne)->Foo.toString} - ; - -let t11: string = - - {blocks->foo->Foo.map(Foo.plusOne)->Foo.map(Foo.plusOne)->Foo.toString} - ; - -let title = "los pilares de la tierra"; - -let t12: string = - (title === "" ? [1, 2, 3]: blocks)->Foo.toString - -type change = - | Change(list(int)); - -type this = { - send: change => string -}; - -let change = x => Change(x); - -let self = { - send: x => - switch (x) { - | Change(xs) => Foo.toString(xs) - }, -}; - -let urlToRoute = (x) => [x, x, x]; - -let t13: string = urlToRoute(1)->change->(self.send); - -module FooLabeled = { - let createElement = (~children, ()) => - List.hd(children) ++ "test"; - - let map = (xs, ~f) => List.map(f, xs); - - let plusOne = x => x + 1; - - let toString = lst => - List.fold_left( - (acc, curr) => - acc ++ (string_of_int(curr)), - "", - lst - ); -}; - -let t14: string = - {items->FooLabeled.map(~f=FooLabeled.plusOne)->FooLabeled.toString} ; - -let c = (a, b) => a + b; -let a = 1; -let b = 2; -let t: int = a->(b->c); - -module Div = { - let createElement = (~children, ()) => - List.hd(children) ++ "test"; -}; - -let url = "reason"; -let suffix = ".com"; - -let parse = (a, b) => a ++ b; - -let t15: string = -
{url->parse(suffix, _)}
; diff --git a/formatTest/typeCheckedTests/input/reasonComments.re b/formatTest/typeCheckedTests/input/reasonComments.re deleted file mode 100644 index 6156f3c4a..000000000 --- a/formatTest/typeCheckedTests/input/reasonComments.re +++ /dev/null @@ -1,736 +0,0 @@ -3; /* - */ -3 /*-*/ -; -3/*-*/ -; -3/*-*/; -/* **** comment */ -/*** comment */ -/** docstring */ -/* comment */ -/** docstring */ -/*** comment */ -/**** comment */ -/***** comment */ -/** */ -/*** */ -/**** */ -/**/ -/***/ -/****/ -/** (** comment *) */ -/** (*** comment *) */ -/* (** comment *) */ -/* (*** comment *) */ -/* *(*** comment *) */ -/* comment **/ -/* comment ***/ -/* comment ****/ -/* comment *****/ -/** - * Multiline - */ -/** Multiline - * - */ -/** - ** - */ - -module JustString = { - include Map.Make(Int32); /* Comment eol include */ -}; - -let testingEndOfLineComments = - [ - "Item 1" /* Comment For First Item */, - "Item 2" /* Comment For Second Item */, - "Item 3" /* Comment For Third Item */, - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - /* Comment after last item in list. */ - ] /* Comment after rbracket */; - -/* But if you place them after the comma at eol, they're preserved as such */ -let testingEndOfLineComments = - [ - "Item 1", /* Comment For First Item */ - "Item 2", /* Comment For Second Item */ - "Item 3", /* Comment For Third Item */ - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - /* Comment after last item in list. */ - ] /* Comment after rbracket */ ; - - -/* The space between ; and comment shoudn't matter */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ - /* Comment after last item in list. */ -]; /* Comment after semi */ - -/* The space between ; and comment shoudn't matter */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ - /* Comment after last item in list. */ -];/* Comment after semi */ - -/* Try again but without other things in the list */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ -]; /* Comment after semi */ - -/* The space between ; and comment shoudn't matter */ -let testPlacementOfTrailingComment = [ - "Item 0" /* */ - /* Comment after last item in list. */ -];/* Comment after semi */ - -let testingEndOfLineComments = [];/* Comment after entire let binding */ - - -/* The following is not yet idempotent */ -/* let myFunction */ -/* withFirstArg /* First arg */ */ -/* andSecondArg => { /* Second Arg */ */ -/* withFirstArg + andSecondArg /* before semi */ ; */ -/* }; */ - -let myFunction - (/* First arg */ - withFirstArg, - /* Second Arg */ - andSecondArg) { - withFirstArg + andSecondArg -}; /* After Semi */ - -type point = { - x: string, /* x field */ - y: string, /* y field */ -}; - -type pointWithManyKindsOfComments = { - /* Line before x */ - x: string, /* x field */ - /* Line before y */ - y: string, /* y field */ - /* Final row of record */ -}; - -type typeParamPointWithComments('a) = { - /* Line before x */ - x: 'a, /* x field */ - /* Line before y */ - y: 'a /* y field */ - /* Final row of record */ -}; - -/* Now, interleaving comments in type params */ -type - /* Type name */ - typeParamPointWithComments2( - /* The a type param */ - 'a, - /* The b type apram */ - 'b) = { - /* Line before x */ - x: 'a, /* x field */ - /* Line before y */ - y: 'a /* y field */ - /* Final row of record */ -}; - -/* The way the last row comment is formatted is suboptimal becuase - * record type definitions do not include enough location information */ -type anotherpoint = { - x: string, /* x field */ - y: string, /* y field */ - /* comment as last row of record */ -}; - -type t = (int, int); /* End of line on t */ -type t2 = - (int, int) /* End of line on (int, int) */ - ; - -type t3 = - (int, int); /* End of line on (int, int) */ - - -type variant = - | X (int, int) /* End of line on X */ - | Y (int, int) /* End of line on Y */ -; /* Comment on entire type def for variant */ - -/* Before let */ -let res = - /* Before switch */ - switch (X (2, 3)) { - /* Above X line */ - | X(_) => "result of X" /* End of arrow and X line */ - /* Above Y line */ - | Y(_) => "result of Y" /* End of arrow and Y line */ - }; /* After final semi in switch */ - -let res = - switch (X (2, 3)) { - | X (0, 0) => /* After X arrow */ - "result of X" /* End of X body line */ - | X (1, 0) /* Before X's arrow */ => - "result of X" /* End of X body line */ - | X (_) => /* After X _ arrow */ - "result of X" /* End of X body line */ - /* Above Y line */ - | Y (_) => - /* Comment above Y body */ - "result of Y" - }; - -type variant2 = - /* Comment above X */ - | X (int, int) /* End of line on X */ - /* Comment above Y */ - | Y (int, int); - -type variant3 = - /* Comment above X */ - | X (int, int) /* End of line on X */ - /* Comment above Y */ - | Y (int, int) /* End of line on Y */ -; - - -type x = { /* not attached *above* x */ - fieldOne : int, - fieldA : int -} /* Attached end of line after x */ -and y = { /* not attached *above* y */ - fieldTwo : int -} /* Attached end of line after y */ -; - -type x2 = { /* not attached *above* x2 */ - fieldOne : int, - fieldA : int -} /* Attached end of line after x2 */ -and y2 = { /* not attached *above* y2 */ - fieldTwo : int -}; - - -let result = - switch (None) { - | Some({fieldOne: 20, fieldA:a})=> /* Where does this comment go? */ - let tmp = 0; - 2 + tmp - | Some {fieldOne: n, fieldA:a} => - /* How about this one */ - let tmp = n; - n + tmp - | None => 20 - }; - -let res = - /* Before switch */ - switch (X (2, 3)) { - /* Above X line */ - | X(_) => "result of X" /* End of arrow and X line */ - /* Above Y line */ - | Y(_) => "result of Y" /* End of arrow and Y line */ - }; - -/* - * Now these end of line comments *should* be retained. - */ -let result = switch (None) { - | Some { - fieldOne: 20, /* end of line */ - fieldA:a /* end of line */ - } => - let tmp = 0; - 2 + tmp - | Some { - fieldOne: n, /* end of line */ - fieldA:a /* end of line */ - } => - let tmp = n; - n + tmp - | None => 20 - }; - -/* - * These end of line comments *should* be retained. - * To get the simple expression eol comment to be retained, we just need to - * implement label breaking eol behavior much like we did with sequences. - * Otherwise, right now they are not idempotent. - */ -let res = - switch ( /* Retain this */ - X (2, 3) - ) - { - /* Above X line */ - | X ( - _, /* retain this */ - _ /* retain this */ - ) => "result of X" - - /* Above Y line */ - | Y(_) => "result of Y" /* End of arrow and Y line */ - }; - - -type optionalTuple = - | OptTup ( - option (( - int, /* First int */ - int /* Second int */ - )) - ); - -type optionTuple = - option (( - int, /* First int */ - int /* Second int */ - )); - -type intPair = ( - int, /* First int */ - int /* Second int */ -); -type intPair2 = ( - /* First int */ - int, - /* Second int */ - int -); - -let result = { - /**/ - (+)(2,3) -}; - -/* This is not yet idempotent */ -/* { */ -/* /**/ */ -/* (+) 2 3 */ -/* }; */ - -let a = (); -for (i in 0 to 10) { - /* bla */ - a -}; - -if (true) { - /* hello */ - () -}; - -type color = - | Red(int) /* After red end of line */ - | Black(int) /* After black end of line */ - | Green(int) /* After green end of line */ -; /* On next line after color type def */ - -let blahCurriedX(x) = - fun - | Red(10) - | Black(20) - | Green(10) => 1 /* After or pattern green */ - | Red(x) => 0 /* After red */ - | Black(x) => 0 /* After black */ - | Green(x) => 0 /* After second green */ -; /* On next line after blahCurriedX def */ - -let name_equal(x,y) { x == y }; - -let equal(i1,i2) = - i1.contents === i2.contents && true; /* most unlikely first */ - -let equal(i1,i2) = - compare(compare(0,0),compare(1,1)); /* END OF LINE HERE */ - -let tuple_equal((i1, i2)) = i1 == i2; - -let tuple_equal((csu, mgd)) = - /* Some really long comments, see https://github.com/facebook/reason/issues/811 */ - tuple_equal((csu, mgd)); - -/** Comments inside empty function bodies - * See https://github.com/facebook/reason/issues/860 - */ -let fun_def_comment_inline = () => { /* */ }; - -let fun_def_comment_newline = () => { - /* */ -}; - -let fun_def_comment_long = () => { /* longer comment inside empty function body */}; - - -let trueThing = true; - -for (i in 0 to 1) { - /* comment */ - print_newline(); -}; - -while (trueThing) { - /* comment */ - print_newline(); -}; - -if (trueThing) { - /* comment */ - print_newline() -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -} else { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -} else { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); - /* Comment after final print */ -}; - - - -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -} else { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before if test */ -if (trueThing) { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ -} else { - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment before print */ - print_newline(); /* eol print */ - /* Comment after print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - -/* Comment before while test */ -while (trueThing) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - -/* Comment before for test */ -for (i in 0 to 100) { - /* Comment before print */ - print_newline(); /* eol */ - /* Comment after final print */ -}; - - -let f = (a, b, c, d) => a + b + c + d; - -while(trueThing) { - f( - /* a */ - 1, - /* b */ - 2, - /* c */ - 3, - /* d */ - 4 - /* does work */ - ); -}; -while(trueThing) { - f( - /* a */ - 1, - /* b */ - 2, - /* c */ - 3, - /* d */ - 4 /* does work */ - ); -}; - -ignore((_really, _long, _printWidth, _exceeded, _here) => { - /* First comment */ - let x = 0; - x + x; - /* Closing comment */ -}); - -ignore((_xxx, _yyy) => { - /* First comment */ - let x = 0; - x + x; - /* Closing comment */ -}); - -type tester('a, 'b) = | TwoArgsConstructor('a, 'b) | OneTupleArgConstructor(('a, 'b)); -let callFunctionTwoArgs = (a, b) => (); -let callFunctionOneTuple = (tuple) => (); - -let y = TwoArgsConstructor( - 1, /*eol1*/ - 2 /* eol2 */ -); - -let y = callFunctionTwoArgs( - 1, /*eol1*/ - 2 /* eol2 */ -); - -let y = OneTupleArgConstructor(( - 1, /*eol1*/ - 2 /* eol2 */ -)); - -let y = callFunctionOneTuple(( - 1, /*eol1*/ - 2 /* eol2 */ -)); - - -type polyRecord('a, 'b) = {fieldOne: 'a, fieldTwo: 'b}; - -let r = { - fieldOne: 1, /*eol1*/ - fieldTwo: 2 /* eol2 */ -}; - -let r = { - fieldOne: 1, /*eol1*/ - fieldTwo: 2, /* eol2 with trailing comma */ -}; - - -let y = TwoArgsConstructor( - "1", /*eol1*/ - "2" /* eol2 */ -); - -let y = callFunctionTwoArgs( - "1", /*eol1*/ - "2" /* eol2 */ -); - -let y = OneTupleArgConstructor(( - "1", /*eol1*/ - "2" /* eol2 */ -)); - -let y = callFunctionOneTuple(( - "1", /*eol1*/ - "2" /* eol2 */ -)); - - -let r = { - fieldOne: "1", /*eol1*/ - fieldTwo: "2" /* eol2 */ -}; - -let r = { - fieldOne: "1", /*eol1*/ - fieldTwo: "2", /* eol2 with trailing comma */ -}; - -let identifier = "hello"; - -let y = TwoArgsConstructor( - identifier, /*eol1*/ - identifier /* eol2 */ -); - -let y = callFunctionTwoArgs( - identifier , /*eol1*/ - identifier /* eol2 */ -); - -let y = OneTupleArgConstructor(( - identifier , /*eol1*/ - identifier /* eol2 */ -)); - -let y = callFunctionOneTuple(( - identifier , /*eol1*/ - identifier /* eol2 */ -)); - - -let r = { - fieldOne: identifier, /*eol1*/ - fieldTwo: identifier /* eol2 */ -}; - -let r = { - fieldOne: identifier, /*eol1*/ - fieldTwo: identifier, /* eol2 with trailing comma */ -}; - - -let y = TwoArgsConstructor( - identifier : string, /*eol1*/ - identifier : string/* eol2 */ -); - -let y = callFunctionTwoArgs( - identifier : string , /*eol1*/ - identifier : string /* eol2 */ -); - -let y = OneTupleArgConstructor(( - identifier : string , /*eol1*/ - identifier : string /* eol2 */ -)); - -let y = callFunctionOneTuple(( - identifier : string , /*eol1*/ - identifier : string /* eol2 */ -)); - - -let r = { - fieldOne: (identifier : string), /*eol1*/ - fieldTwo: (identifier : string) /* eol2 */ -}; - -let r = { - fieldOne: (identifier : string), /*eol1*/ - fieldTwo: (identifier : string), /* eol2 with trailing comma */ -}; - -/** doc comment */ -[@bs.send] -external url : t => string = ""; - -/** - * Short multiline doc comment - */ -[@bs.send] -external url : t => string = ""; - -/** Longer doc comment before an attribute on an external. */ -[@bs.send] -external url : t => string = ""; - -/* normal comment */ -[@bs.send] external url : t => string = ""; - -/** doc type */ -type q = {a: int, b: string}; - -/** doc let */ -let letter : q = {a: 42, b: "answer"}; diff --git a/formatTest/typeCheckedTests/input/reasonComments.rei b/formatTest/typeCheckedTests/input/reasonComments.rei deleted file mode 100644 index dcfdb5b28..000000000 --- a/formatTest/typeCheckedTests/input/reasonComments.rei +++ /dev/null @@ -1,3 +0,0 @@ -module JustString : { - include Map.S; /* Comment eol include */ -}; diff --git a/formatTest/typeCheckedTests/input/sequences.re b/formatTest/typeCheckedTests/input/sequences.re deleted file mode 100644 index 151ec035f..000000000 --- a/formatTest/typeCheckedTests/input/sequences.re +++ /dev/null @@ -1,81 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/** - * Testing Sequences. - */ -let result = { - let twenty = 20; - let result = twenty; - result; -}; - -/* Final semicolon is not required */ -let result = { - let twenty = result; - twenty -}; -let anInt = result + 20; - -let twenty = 20; - -/** - * Each of these are a sequence with a single item - they will be - * printed in reduced form because sequences are a *parse* time construct. - * To ensure these are parsed correctly, adding to an integer. - */ -let result = 0 + {twenty}; -let result = 0 + {twenty;}; -let result = 0 + twenty; - -let unitValue = (); -/* While loops/for loops merely accept a "simple expression" (which means - * it is either a simple token or balanced with parens/braces). However, - * the formatter ensures that the bodies are printed in "sequence" form even if - * it's not required. - */ -while (false) unitValue; -while (false) { - print_string("test") -}; -while (false) { - print_string("test"); -}; - -type myRecord = { - number: int -}; -let x = {number:20}; -let number = 20; -/* - * The (mild) consequence of not requiring a final semi in a sequence, - * is that we can no longer "pun" a single field record (which would) - * be very rare anyways. - */ -let cannotPunASingleFieldRecord = {number: number}; -let fourty = 20 + cannotPunASingleFieldRecord.number; -let thisIsASequenceNotPunedRecord = {number}; -let fourty = 20 + thisIsASequenceNotPunedRecord; - - - -type recordType = {a: int, b: int, c: int}; -let a = 0; -let b = 0; -let c = 0; -/* All of these will be printed as punned because they have more than one field. */ -let firstFieldPunned = { - a: a, - b, - c: c -}; -let sndFieldPunned = { - a, - b: b, - c: c -}; -let thirdFieldPunned = { - a: a, - b: b, - c -}; -let singlePunAcceptedIfExtended = {...firstFieldPunned, a}; diff --git a/formatTest/typeCheckedTests/input/specificMLSyntax.4.04.0.ml b/formatTest/typeCheckedTests/input/specificMLSyntax.4.04.0.ml deleted file mode 100644 index e1f0df6fa..000000000 --- a/formatTest/typeCheckedTests/input/specificMLSyntax.4.04.0.ml +++ /dev/null @@ -1,14 +0,0 @@ -module Foo = struct - type t = { name: string } -end - -let foo Foo.{name} = () - -let f = function - | Foo.{name} -> () - | _ -> () - -let x = { Foo.name = "Reason" } -let Foo.{name} = x - -let Foo.{name}, _ = x, () diff --git a/formatTest/typeCheckedTests/input/trailing.re b/formatTest/typeCheckedTests/input/trailing.re deleted file mode 100644 index 9934332cc..000000000 --- a/formatTest/typeCheckedTests/input/trailing.re +++ /dev/null @@ -1,182 +0,0 @@ - -let x = 0; -let y = 0; - -[@warning "-8"] -let [|x, y|] = [|0, y|]; -[@warning "-8"] -let [|x, y,|] = [|0, y,|]; - -[@warning "-8"] -let [|reallyLongIdentifier, reallyLongIdentifier2|] = [|0, 1|]; -[@warning "-8"] -let [|reallyLongIdentifier_, reallyLongIdentifier2_,|] = [|0, 2,|]; - -let takesUnit = () => (); -let res = takesUnit (); -let wat = (0,); - -type t = {x: int, y: int}; -let p = {contents: 0,}; -let {contents:c, } = p; -let point = {x: 0, y: 0}; -let point2 = {...point, y: 200,}; - -let myTuple = (0, 0,); -let (i, j,) = myTuple; - -type foo_('a, 'b) = ('a, 'b); -type foo__ = foo_(int, int,); -type foo('a, 'b, ) = Foo('a, 'b, ); -type tupVariant('a, 'b, ) = Tup(('a, 'b,),); - - -/* Won't wrap so removes trailing comma */ -let noWrap = (a, b,) => { - let x = a; - x + x; -}; - -let res = noWrap(0, 0,); -let reallyLongIdentifierCausesWrap = 0; -let wrap = noWrap; -let res = wrap( - reallyLongIdentifierCausesWrap, - reallyLongIdentifierCausesWrap, -); - -/* Won't wrap so removes trailing comma */ -let noWrap = (~a, ~b,) => { - let x = a; - x + x; -}; - -/* Won't wrap so removes trailing comma */ -let noWrap = (~a=0, ~b=0, (),) => { - let x = a; - x + x; -}; - -let res = noWrap( - ~a=reallyLongIdentifierCausesWrap, - ~b=reallyLongIdentifierCausesWrap, - (), -); - -/* Won't wrap so removes trailing comma */ -let noWrap = (~a=0, ~b:int=0, (),) => { - let x = a; - x + x; -}; - -let res = noWrap( - ~a=reallyLongIdentifierCausesWrap, - ~b=reallyLongIdentifierCausesWrap, - (), -); - -/* Long enough to wrap the args and therefore remove trail */ -let wrap = (long, enough, toWrap, args,) => { - let x = long; - x + enough + toWrap + args; -}; - - -let takesPattern = (d, Foo(x, y,)) => { - /* won't wrap */ - let _ = Foo(y, x,); - /* will wrap */ - let ret = Foo(y + y + y + y, x + x + x + x + x + x + x + x + x,); - ret -}; - -let takesPattern = (d, Tup((x, y,))) => { - /* won't wrap */ - let _ = Tup((y, x,)); - /* will wrap */ - let ret = Tup((y + y + y + y, x + x + x + x + x + x + x + x + x,)); - ret -}; - -let takesPattern = (d, Tup((thisPatternIsSoLongThatThe, fooWillWrapItself,))) => { - /* won't wrap */ - let _ = Tup((d, d,)); - /* will wrap */ - let ret = Tup((d + d + d + d, d + d + d + d + d + d + d + d + d,)); - ret -}; - - -let myFunc = (type t, (),) => (); - -type funcType = (int, int,) => int; -type v = Func ((int, int,) => int,); - -type params('a, 'b,) = ('a, 'b,); - - -let myList = [ - 2, - 3, -]; - -let yourList = [ - 5, - 6, - ...myList, -]; - - -class virtual tupleStack( - 'reallyLongIdentifier, - 'anotherReallyLongIdentifier, - )(init, init2,) { - val mutable v : list(('reallyLongIdentifier, 'anotherReallyLongIdentifier)) = [(init, init2,),]; - pub virtual implementMe: (int, int,) => (int, int); - initializer { - print_string("initializing object"); - }; -}; - -class extendedStack('reallyLongIdentifier, 'anotherReallyLongIdentifier)(init, init2,) { - inherit (class tupleStack('reallyLongIdentifier, 'anotherReallyLongIdentifier,))(init, init2,); - pub implementMe(i, j) = (i, j); -}; - - -module type HasType = {type t;}; -module type HasType2 = {type t; type q;}; -module type ReallyReallyReallyLongIdentifierModuleType = {type t}; -module type F = (HasType,) => HasType2; -module FInstance = (HasType : HasType,) => {type t = HasType.t; type q = HasType.t}; -module ReallyReallyReallyLongIdentifierModuleName = {type t = int;}; -module FResult = FInstance(ReallyReallyReallyLongIdentifierModuleName,); - - -module Component = { - let createElement = (~arg, ~children, ()) => [0]; -}; - -let componentList = []; -let componentList = []; -let componentList = [,]; -let componentList = [,]; -let componentList = [, ]; -let componentList = [, ]; -let componentList = [, , ]; -let componentList = [, , ]; -let componentList = [, , ]; -let componentList = [, , ]; - -let componentList = [||]; -let componentList = [||]; -let componentList = [|,|]; -let componentList = [|,|]; -let componentList = [|, |]; -let componentList = [|, |]; -let componentList = [|, ,|]; -let componentList = [|, ,|]; -let componentList = [|, ,|]; -let componentList = [|, ,|]; - - diff --git a/formatTest/typeCheckedTests/input/typeParameters.re b/formatTest/typeCheckedTests/input/typeParameters.re deleted file mode 100644 index a4ca9c32c..000000000 --- a/formatTest/typeCheckedTests/input/typeParameters.re +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Testing type parameters. - */ - -type threeThings<'t> = ('t, 't, 't); -type listOf<'t> = list<'t>; - -type underscoreParam<_> = Underscored; -type underscoreParamCovariance<+_> = Underscored; -type underscoreParamContravariance<-_> = Underscored; - -type tickParamCovariance<+'a> = Underscored; -type tickParamContravariance<-'a> = Underscored; - -let x : option > = None; -type myFunctionType<'a> = (list<('a, 'a)>, int => option >); -let funcAnnoted = (~a: list=[0, 1, ], ()) => a; - - - -/** - * Syntax that would be likely to conflict with lexing parsing of < > syntax. - */ - -let zero = 0; -let isGreaterThanNegFive = zero > - 5; -let isGreaterThanNegFive2 = zero > -5; -let isGreaterThanNegFive3 = zero >(-5); - -let isGreaterThanEqNegFive = zero >= -5; -let isGreaterThanEqNegFive2 = zero >= -5; -let isGreaterThanEqNegFive3 = zero >=(-5); - -let (>>=) = (a, b) => a >= b; - -let isSuperGreaterThanEqNegFive = zero >>= - 5; -let isSuperGreaterThanEqNegFive2 = zero >>= -5; -let isSuperGreaterThanEqNegFive3 = zero >>= (-5); - -let jsx= (~children, ()) => 0; - -type t<'a> = 'a; -let optionArg = (~arg:option>=?, ()) => arg; -let optionArgList = (~arg:option>>=?, ()) => arg; -let defaultJsxArg = (~arg:t(int)=, ()) => arg; -let defaultFalse = (~arg:t=!true, ()) => arg; -/* Doesn't work on master either let defaultTrue = (~arg:t= !!true) => arg; */ - -/** - * Things likely to conflict or impact precedence. - */ -let neg=-1; -let tru=!false; -let x = - "arbitrary" === "example" - && "how long" >= "can you get" - && "seriously" <= "what is the line length"; - -let z = 0; -module Conss = { - let (>-) = (a, b) => a + b; - let four = 3 >- 1; - let two = 3 >- -1; - let four' = 3 >- - - 1; - - let tr = 3 > - 1; - let tr' = 3 > - -1; - let tr'' = 3 > - - - 1; -} - -module Idents = { - let (>-) = (a, b) => a + b; - let four = z >- z; - let two = z >- -z; - let four' = z >- - - z; - - let tr = z > - z; - let tr' = z > - -z; - let tr'' = z > - - - z; -} diff --git a/formatTest/unit_tests/expected_output/assert.re b/formatTest/unit_tests/expected_output/assert.re deleted file mode 100644 index 136ae43bb..000000000 --- a/formatTest/unit_tests/expected_output/assert.re +++ /dev/null @@ -1,23 +0,0 @@ -switch (true) { -| true => () -| false => assert(false) -| _ => assert(false) -}; - -let root = { - let root = Doc.rootNode(doc); - assert(root.type_ == "expression"); - assert(Node.namedChildCount(root) == 1); - assert(Node.childCount(root) == 1); - assert( - Point.toString(root.startPoint) - == "(Point.t {:row 0 :column 0})", - ); - assert( - Point.toString(root.endPoint) - == "(Point.t {:row 0 :column 9})", - ); - root; -}; - -assert(theTruth()); diff --git a/formatTest/unit_tests/expected_output/basicStructures.re b/formatTest/unit_tests/expected_output/basicStructures.re deleted file mode 100644 index abf0b0e0b..000000000 --- a/formatTest/unit_tests/expected_output/basicStructures.re +++ /dev/null @@ -1,852 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = () => { - TestUtils.printSection("Basic Structures"); -}; - -while (something) { - print_string("You're in a while loop"); - print_newline(); -}; - -for (i in 0 to 5) { - print_int(i); - print_newline(); - for (i in 10 downto 0) { - print_string( - "Counting in reverse direction", - ); - print_newline(); - }; -}; - -for (i in - 0 to - endOfRangeMustBeSimple(expr, soWrap)) { - print_int(i); - print_newline(); - for (i in - theSame(isTrue, ofThe, startOfRange) downto - 0) { - print_string( - "Counting in reverse direction", - ); - print_newline(); - }; -}; - -let x = foo^ ^.bar^; - -let x = foo.bar^; - -let x = foo#bar^; - -let x = foo^.bar^; - -let x = (foo^)#bar^; - -/* Prefix operators: - * ! followed by zero or more appropriate_operator_suffix_chars (see the - * lexer). - * ? or ~ followed by at least one appropriate_operator_suffix_chars. - */ -let x = !(!(!foo)).bar; - -let x = !foo.bar; - -let x = !foo#bar; - -let x = !(!foo).bar; - -let x = !(!foo)#bar; - -let x = !(!foo.bar); - -let x = ?!(!foo.bar); - -let x = ! ?!foo.bar; - -let x = ~!(!foo.bar); - -let x = ! ~!foo.bar; - -let x = ~! ~!foo.bar; - -let x = !!foo.bar; - -let x = !!foo#bar; - -let x = !~foo.bar; - -let x = !~foo#bar; - -let noParensNeeded = !blah.foo.bar; - -let parensNeededAroundFirst = (!blah).foo.bar; - -let parensNeededAroundSecond = (!blah.foo).bar; - -let noParensNeeded = !blah#foo#bar; - -let parensNeededAroundFirst = (!blah)#foo#bar; - -let parensNeededAroundSecond = (!blah#foo)#bar; - -let parensWithSpaceNeededAroundFirst = - (!(!blah))#foo#bar; - -let parensWithSpaceNeededAroundSecond = - (!(!blah#foo))#bar; - -let parensWithSpaceNeededAroundFirst = - (?!(+ blah))#foo#bar; - -let parensWithSpaceNeededAroundSecond = - (?!(+ blah#foo))#bar; - -let x = !(!foo.bar); - -let x = !(!foo#bar); - -let x = (-10); - -let x = (-5.0); - -let x = Some(-10); - -let x = Some(-5.0); - -let lazy x = 10; -let lazy (x: int) = 10; -let lazy [] = 10; -let lazy true = 10; -let lazy #x = 10; -let lazy `Variant = 10; -let lazy `variant = 10; -let lazy '0' .. '9' = 10; -let lazy (lazy true) = 10; -let lazy [%extend] = 10; - -/* Test precedence on access sugar */ -let x = arr^[0]; - -let x = arr^[0]; - -let x = str^.[0]; - -let x = str^.[0]; - -let x = arr^[0] = 1; - -let x = arr^[0] = 1; - -/* Comments */ -/*Below is an empty comment*/ -/**/; -/** IF - *============================================================================ - */; - -let (/++) = (+); /* // indicates the start of a comment, not an infix op */ - -let something = - if (self.ext.logSuccess) { - print_string("Did tap"); - print_newline(); - }; - -let logTapSuccess = self => - if (self.ext.logSuccess) { - print_string("Did tap"); - print_newline(); - } else { - (); - }; - -let logTapSuccess = self => - if (self.ext.logSuccess) { - print_string("Did tap"); - print_newline(); - }; - -(!data).field = true; -(!data).field1.field2 = true; -(!data.field1).field2 = true; -(!data).field1.field2 = true; -(!data.field1).field2 = true; - -let loop = (appTime, frameTime) => { - if (hasSetup.contents) { - setupScene(); - renderIntoTop(); - hasSetup.contents = true; - }; - process(appTime, frameTime); -}; - -/* These parens should be kept around the entire last if/then/else */ -if (something) { - if (somethingElse) {()} else {"blah"}; -}; - -/* These parens should be kept around just the last if/then*/ -if (something) { - if (somethingElse) {()} else {"blah"}; -}; - -/* Parens should be generated to wrap the entire final if then else. - * To test that it's being parsed correclty, should print "one". */ -if (true) { - if (true) { - print_string("one"); - } else { - print_string("two"); - }; -}; - -/* Should print two */ -if (true) { - if (false) { - print_string("one"); - } else { - print_string("two"); - }; -}; - -/* Should not print */ -if (false) { - if (true) { - print_string("one"); - } else { - print_string("two"); - }; -}; - -/* Should wrap (if a > b then a else b). - * printer( - */ -let printIfFirstArgGreater = true; -let result = - if (printIfFirstArgGreater) { - (a, b) => - if (a > b) { - print_string("a > b"); - } else { - print_string("b >= a"); - }; - } else if ({ - (a, b) => - if (a > b) { - print_string("b < a"); - } else { - print_string("a <= b"); - }; - }) { - print_string( - "That could never possibly type check", - ); - print_newline(); - }; - -let myRecord = { - nestedRecord: { - anotherNestedRecord: - (instaComp, displayRect) => - if (Graphics.cgRectIntersectsWithSlop( - defaultCompositeTimerRectSlop, - instaComp.relativeRect, - displayRect, - )) { - IoEligible; - } else { - IoInelibleButTryComposition; - }, - }, -}; - -if (printIfFirstArgGreater) { - (a, b) => - if (a > b) { - print_string("a > b"); - }; -} else { - (a, b) => - if (a > b) { - print_string("b < a"); - }; -}; -/* Should Be Parsed As: Cleary a type error, but at least the parsing makes that clear */ -if (printIfFirstArgGreater) { - (a, b) => - if (a > b) { - print_string("a > b"); - } else { - (a, b) => - if (a > b) { - print_string("b < a"); - }; - }; -}; - -(a, b) => - if (a > b) { - print_string("a > b"); - }; - -/* What you probably wanted was: */ -if (printIfFirstArgGreater) { - (a, b) => - if (a > b) { - print_string("a > b"); - }; -} else { - (a, b) => - if (a > b) { - print_string("b < a"); - }; -}; - -/* Mutative if statement: Not used to evaluate to something. */ -if (10 < 100) { - let msg = "If there was any doubt, 10 is in fact less than 100."; - print_string(msg); -} else { - let msg = "All bets are off."; - print_string(msg); -}; - -if (10 < 100) { - print_string( - "If there was any doubt, 10 is in fact less than 100.", - ); -} else { - print_string("All bets are off."); -}; - -/** TYPE CONSTRAINTS - *============================================================================ - */; -let x: int = 10; -let x: int = 10; -let x: int = 10; -let x: int = (10: int); -/* let (x:int) = (10:string); */ -/* let (x:string) = ("hello":int); */ - -/** TUPLES - *============================================================================ - */; - -/* In Reason, types look like the data they model! Tuples are no exception. */ -type pairOfInts = (int, int); -let letBindingWithTypeConstraint: int = 10; -let (tupleItem: int, withTypeConstraint: int) = ( - 10, - 20, -); - -/* To make sure that tuple field annotations are annotating the entire field */ -let _dummyFunc = x => 10; -let annotatingFuncApplication = ( - _dummyFunc("a"): int, - _dummyFunc("a"): int, -); - -/* Pretty printer might stick the [int] at the label. */ -let annotatingSingleFuncApplication: int = - _dummyFunc("a"); - -/* So lets try a place where it won't */ -let annotatingSingleFuncApplication = { - /* Commenting a let binding. */ - let a = 100; - /* Commenting another let binding. */ - let int = 200; - /* - * This demonstrates why named arguments cannot simply have the form (func - * arg:val) - it is indistinguishable from a type constraint. - */ - 2 + (_dummyFunc(a): int); -}; - -let ( - tupleItem: int, - constrainedWithoutGrouping: int, -) = ( - 10, - 20, -); -let (tupleItem, withOutsideTypeConstraint): ( - int, - int, -) = ( - 10, - 20, -); - -/* Trailing commas */ -let trailingCommaAccepted = (1, 2); -let moreTrailing = (1, 2, 3, 4, 5, 7); - -/** Immutable Lists - * ============================================================================ - */; - -/* Anatomy: -Head- --------- Tail--------- nil: You can't see nil */ -let x: list(int) = [1, 2, 3, 4, 5, 6, 7, 8, 9]; -let hd = "appendedToHead"; -let tl = ["listTo", "append", "to"]; - -/* To push *one* and only *one* item to the front of a list - use [hd, ...tl] */ -let result: list(string) = [hd, ...tl]; - -/* Is the same as writing */ -let result: list(string) = [ - "appendedToHead", - "listTo", - "append", - "to", -]; - -/* To operate on lists, use pattern matching */ -let rec size = - fun - | [] => 0 - | [hd, ...tl] => 1 + size(tl); - -/* Optimize for tail recursion */ -let rec size = (soFar, lst) => - switch (lst) { - | [] => 0 - | [hd, ...tl] => size(soFar + 1, tl) - }; - -let nestedMatch = lstLst => - switch (lstLst) { - | [hd, ...tl] when false => 10 - | [hd, ...tl] => - switch (tl) { - | [] => 0 + 0 - | [tlHd, ...tlTl] => 0 + 1 - } - | [] => 0 - }; - -let nestedMatchWithWhen = lstLst => - switch (lstLst) { - | [hd, ...tl] when false => 10 - | [hd, ...tl] when true => - switch (tl) { - | [] when false => 0 + 0 - | [] when true => 0 + 0 - | [tlHd, ...tlTl] => 0 + 1 - } - | [] => 0 - }; - -/** - * Aliasing with "as" during matches. - */; -type mine = - | MyThing(int) - | YourThing(int); -/* - * Reason parses "as" aliases differently than OCaml. - */ -let ppp = - switch (MyThing(20)) { - | MyThing(x) as ppp - | YourThing(x) as ppp => ppp - }; - -let MyThing(_) as ppp | YourThing(_) as ppp = ppp; - -/* - * in order to achieve the previous example in ocaml, you would have to group - * as: - */ -let ppp = - switch (MyThing(20)) { - | MyThing(x) as ppp - | YourThing(x) as ppp => ppp - }; - -let MyThing(_) as ppp | YourThing(_) as ppp = ppp; -/* - * But this isn't needed in Reason because OR patterns have much lower - * precedence - they should be pretty printed in the same way. - */ - -/* TODO: */ -/* let rec nestedMatch lstLst => match lstLst with { */ -/* hd::tl: match tl with { */ -/* []: 0 + 0, */ -/* tlHd::tlTl: 0 + 1, */ -/* }, */ -/* []: 0 */ -/* }; */ -/* */ - -/** ARRAYS - * ============================================================================ - * Arrays are weird looking. Usually you want lists because they support pattern - * matching - that's why they have nicer syntax - to entice you. But if you want - * random access and better control over memory layout, use arrays. - */; -let emptyArray = [||]; -let arrayWithOne = [|10|]; -let arrayWithTwo = [|10, 10|]; -let secondItem = arrayWithTwo[1]; - -/* Getting And Setting: Yeah, we should really change this */ -/* Get an array item at index 1 */ -let secondItem = arrayWithTwo[1]; -/* Set an array item at index 1 */ -arrayWithTwo[1] = 300; - -/** - * STRINGS - * ============================================================================ - * The language supports mutating strings, but that should not be depended upon. - */; -let myString = "asdf"; -myString.[2] = '9'; /* Replacing a character: I could do without this sugar */ - -/* FUNCTIONS - *============================================================================= - */ - -/* TYPE ANNOTATIONS - * ============================================================================= - */ - -let one = 900; -let two = 10000; -/* Tuple expressions can be annotated without additional paren wrapping */ -let myTuple = (one: int, two: int); -type myTupleType = (int, int); -let myTuple: myTupleType = myTuple; - -/* Anything *outside* of a tuple, must still be annotated within parens. */ -let myTuple: myTupleType = (one: int, two: int); - -/* Now functions that accept a single argument being a tuple look familiar */ -let addValues = (a: int, b: int) => { - a + b; -}; - -let addValues = (a: int, b: int) => { - a + b; -}; - -let myFunction = (a: int, b: int): int => a + b; - -let functionReturnValueType = - (i: int, s: string): (int => int) => - x => x + 1; - -let curriedFormOne = (i: int, s: string) => - s ++ string_of_int(i); - -let curriedFormTwo = - (i: int, x: int): (int, int) => ( - i, - x, -); -/* let nonCurriedFormTwo = fun (i:int, x:int) (:(int, int)) => (i, x); */ - -let curriedFormThree = - (i: int, (a: int, b: int): (int, int)) - : (int, int, int) => ( - i, - a, - b, -); - -/* let nonCurriedFormThree = fun (i:int, (a:int, b:int):(int, int)) (:(int, int, int)) => (i, a, b); */ - -/** TODO: But this, however doesn't work. - * let (myCurriedFunc: int => int) a => a; - * Note: This is likely because only "simple patterns" are accepted as constraints - * in let bindings - that may be easy to change. - */; - -type myFuncType = (int, int) => int; - -let myFunc: myFuncType = (a, b) => a + b; - -let funcWithTypeLocallyAbstractTypes = - ( - type atype, - type btype, - a, - b, - c: (atype, btype) => unit, - ) => - c(a, b); - -/* Checks that function types aren't unnecessary wrapped */ -type a = unit => unit; - -type b = - | Foo(unit => unit) - | Bar(unit => unit, unit => unit, (a, b) => c) - | Baz( - unit => unit, - unit => unit, - (a, b) => c, - ); - -type c = - | Foo((a, b) => unit) - | Bar((a, b) => unit); - -type d = [> | `Foo(unit => unit)]; - -/** - * Records: - *============================================================================= - */; - -type withThreeFields = { - name: string, - age: int, - occupation: string, -}; - -let testRecord = { - name: "joe", - age: 20, - occupation: "engineer", -}; -let anotherRecord = { - ...testRecord, - name: "joe++", - age: testRecord.age + 10, -}; - -let makeRecordBase = () => { - name: "Joe", - age: 30, - occupation: "Engineer", -}; -let anotherRecord = { - /* These parens should be evaporated. */ - ...makeRecordBase(), - name: "joe++", - age: testRecord.age + 10, -}; - -let anotherRecord = { - /* Comments should be correctly placed before ... expression */ - ...makeRecordBase(), - /* Comment after record extension */ - name: "joe++", - age: testRecord.age + 10, -}; - -let anotherRecord = { - /* Currently, type annotations must be wrapped in parens - that's easy to improve */ - ...(makeRecordBase(): withThreeFields), - name: "joe++", - age: testRecord.age + 10, -}; - -let anotherRecord = { - /* This is meaningless, sure */ - ...someArray.[0] = 20, - name: "joe++", - age: testRecord.age + 10, -}; - -let anotherRecord = { - ... - SomeReally.longFunctionCall({ - passingRecordField: 0, - andThisOtherRecordField: 10, - }), - name: "joe++", - age: testRecord.age + 10, -}; - -let anotherRecord = { - ... - SomeReally.longFunctionCall( - withArguments, - thatWrap: bool, - ), - name: "joe++", - age: testRecord.age + 10, -}; - -let anotherRecord = { - ... - SomeReally.longFunctionCall( - withArg, - [ - "and", - "final", - "list", - "that", - "should", - "break", - ], - ), - name: "joe++", - age: testRecord.age + 10, -}; - -/* Record type punning */ -type props = {title: string}; - -type state = unit; - -type component = {props}; - -type component2 = { - props, - state, - updater: unit, -}; - -type component3 = { - props: M.props, - state, -}; - -type mutableComponent = {mutable props}; - -type mutabeleComponent2 = { - mutable props, - mutable state, - style: int, -}; - -/* Don't pun parameterized types */ -type description('props) = { - element: string, - tag: tag('props), -}; - -/* Don't pun types from other modules */ -module Foo = { - type bar = {foo: Baz.foo}; -}; - -/* Don't pun field names that aren't "simple" */ -type foo = { - bar: Baz.bar, - qux, - fooo: Fooo.fooo, -}; - -let moreFoo = { - bar: Baz.bar, - qux, - fooo: Fooo.fooo, -}; - -/* record value punning */ - -let props = {title: "hi"}; -/* no punning available for a single field. Can't tell the difference with a scope + expression */ -let componentA = {props: props}; -/* pun for real */ -let componentB = {props, state: ()}; -/* pun fields with module prefix too */ -let foo = {Foo.foo: foo}; -let bar = {Foo.foo, bar: 1}; -let bar = {bar: 1, Foo.foo}; -let bar = {Foo.foo, Bar.bar}; - -({M.x, y}) => 1; - -switch (foo) { -| {y: 1, M.x} => 2 -}; - -/* Requested in #566 */ -let break_after_equal = - no_break_from_here(some_call(to_here)); - -/* Pexp_letexception */ -let () = { - exception E; - raise(E); -}; - -/* # 1587: don't print fun keyword when printing Pexp_fun in a record expression */ -{contents: () => ((): unit)}; - -/* #1556: Always break nested record/obj */ -let z = { - a: { - b: c, - d: e, - }, - f: g, -}; - -let z = { - a: { - "b": c, - "d": e, - }, - f: g, -}; - -let z = { - a: { - pub b = c; - pub d = e - }, - f: g, -}; - -let z = { - "a": { - "b": c, - "d": e, - }, - "f": g, -}; - -let z = { - "a": { - b: c, - d: e, - }, - "f": g, -}; - -let z = { - "a": { - pub b = c; - pub d = e - }, - "f": g, -}; - -/** - * Unnecessary parens should be removed. - */ -let unitLambda = () => (); -let identifierLambda = a => (); -let underscoreLambda = _ => (); -it("should remove parens", a => { - print_string("did it work?"); - print_string("did it work?"); -}); - -/* https://github.com/facebook/reason/issues/1554 */ -(curNode^)##childNodes; - -foo(preserveBraces => {inCallback}); - -foo(preserveBraces => {inFirstPos}, secondArg); - -foo( - oneArg, - preserveBraces => {inFirstPos}, - secondArg, -); diff --git a/formatTest/unit_tests/expected_output/bigarray.re b/formatTest/unit_tests/expected_output/bigarray.re deleted file mode 100644 index 09526c339..000000000 --- a/formatTest/unit_tests/expected_output/bigarray.re +++ /dev/null @@ -1,39 +0,0 @@ -my_big_array3.{ - reallyLongStringThatWillDefinitelyBreakLine -}; - -my_big_array3.{ - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine -}; - -my_big_array3.{ - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine -}; - -my_big_array3.{ - reallyLongString, - reallyLongString, - reallyLongString, - reallyLongString, - reallyLongString -}; - -my_big_array3.{ - reallyLongStringThatWillDefinitelyBreakLine -} = 3.0; - -my_big_array3.{ - reallyLongStringThatWillDefinitelyBreakLine, - reallyLongStringThatWillDefinitelyBreakLine -} = 3.0; - -my_big_array3.{ - reallyLongString, - reallyLongString, - reallyLongString, - reallyLongString, - reallyLongString -} = 3.0; diff --git a/formatTest/unit_tests/expected_output/bucklescript.re b/formatTest/unit_tests/expected_output/bucklescript.re deleted file mode 100644 index ac88e9821..000000000 --- a/formatTest/unit_tests/expected_output/bucklescript.re +++ /dev/null @@ -1,124 +0,0 @@ -bla #= 10; - -bla #= Some(10); - -bla #= someFunc(Some(10)); - -test##var #= Some(-10); - -obj##.prop; - -obj##.prod := exp; - -preview##style##border -#= Js.string("1px black dashed"); - -(preview##(style##border) #= args)(somenum); - -x##y##z #= xxxx##yyyy##zzzz; - -let result = - js_method_run1((!react)#createElement, foo); - -add(zz##yy, xx##ww); - -/* These should print the same */ -let res = x##y + z##q; /* AST */ -let res = x##y + z##q; /* Minimum parens */ - -/* These should print the same */ -let res = y + z##q##a; /* AST */ -let res = y + z##q##a; /* Min parens */ - -/* Make sure it's actually parsed as left precedence - * and that is maintained when printed */ -let res = z##(q##a); /* AST */ -let res = z##(q##a); /* Min parens */ - -/* These should print the same */ -let res = !x##y; /* AST */ -let res = !x##y; /* Minimum parens */ - -/* These should print the same */ -let res = !z##q##a; /* AST */ -let res = !z##q##a; /* Min parens */ - -/* These should print the same */ -let res = ?!!x##y; /* AST */ -let res = ?!!x##y; /* Minimum parens */ - -/* These should print the same */ -let res = ?!!z##(q##a); /* AST */ -let res = ?!!z##(q##a); /* Min parens */ - -res #= ?!!z##q; -res #= ?!!z##(q##a); - -let result = myFunction(x(y)##z, a(b) #= c); - -(!x)##y##(b##c); - -type a = {. "foo": bar}; - -let a = {"key": 10}; - -let b = { - "nested": { - "objs": { - "are": { - "nice": "<3", - }, - }, - }, -}; - -let c = { - "a": a, - "b": b, - "func": a => a##c #= func(10), -}; - -let d = { - "a": a2, - "b": b, - "func": a => { - "a": (arg1, arg2) => arg1 + arg2, - }, -}; - -let a = {"/foo": 10}; - -let isArrayPolyfill: (. int) => bool = [%bs.raw - "function(a) {return Object.prototype.toString.call(a) === '[object Array]'}" -]; - -this#arrayInObject[count] = 1; - -type y = { - . - [@bs.set no_get] "height": int, - [@bs.set no_get] "width": int, -}; - -type y = { - . - [@foo barbaz] - "heightThatIsASuperLongStringForceBreak": - int => unit, - [@foo barbaz] - "widthThatIsASuperLongStringForceBreak": - int => unit, -}; - -type y = { - . - [@foo barbaz] - "width": - (int, int, int, float, float, float) => unit, - [@foo barbaz] - "height": - (int, int, int, float, float, float) => unit, -}; - -/* https://github.com/facebook/reason/issues/2121 */ -Style.{"container": 3}; diff --git a/formatTest/unit_tests/expected_output/class_types.re b/formatTest/unit_tests/expected_output/class_types.re deleted file mode 100644 index 9d0ecdd8d..000000000 --- a/formatTest/unit_tests/expected_output/class_types.re +++ /dev/null @@ -1,38 +0,0 @@ -class type _module ('provider_impl) = {}; -type t; -class type bzz = { - inherit _module(t); -}; - -class type t = { - as 'a; - constraint 'a = #s; -}; - -/* https://github.com/facebook/reason/issues/2037 */ -class type xt = { - as 'a; -}; - -class x = { - as self; -}; - -class type classWithNoArgType = { - pub x: int; - pub y: int; -}; - -class classWithNoArg = { - pub x = 0; - pub y = 0; -}; - -class type t = { - open M; - as 'a; -}; - -class type t = { - open M; -}; diff --git a/formatTest/unit_tests/expected_output/emptyFileComment.re b/formatTest/unit_tests/expected_output/emptyFileComment.re deleted file mode 100644 index eb2b9c00d..000000000 --- a/formatTest/unit_tests/expected_output/emptyFileComment.re +++ /dev/null @@ -1 +0,0 @@ -// file with just a single line comment diff --git a/formatTest/unit_tests/expected_output/escapesInStrings.re b/formatTest/unit_tests/expected_output/escapesInStrings.re deleted file mode 100644 index 51e486fe1..000000000 --- a/formatTest/unit_tests/expected_output/escapesInStrings.re +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/* - let str = "@[.... some formatting ....@\n\010@."; - */ - -let str = "@[.... some formatting ....@\n\010@."; -let str = {abcd|@[.... some formatting ....@\n\010@.|abcd}; - -let utf8_string = "😁"; - -let keep_representation = "\n -\t . this should be on a new line\ - ^ this should be aligned with the . -"; diff --git a/formatTest/unit_tests/expected_output/extensions.re b/formatTest/unit_tests/expected_output/extensions.re deleted file mode 100644 index a6d5d84d8..000000000 --- a/formatTest/unit_tests/expected_output/extensions.re +++ /dev/null @@ -1,376 +0,0 @@ -/* Extension sugar */ - -[%extend open M]; - -[%extend - module M = {} -]; - -[%extend module type M = {}]; - -type a = [%extend int]; - -let%extend x = "hi"; - -let x = { - let%extend x = (); - ignore(); - [%extend ignore()]; - let%extend x = (); - [%extend return("hi")]; -}; - -let x = { - if%extend (true) {1} else {2}; - switch%extend (None) { - | Some(x) => assert(false) - | None => () - }; - try%extend(raise(Not_found)) { - | Not_found => () - | Invalid_argument(msg) => prerr_endline(msg) - }; -}; - -let x = { - if%extend (true) {1} else {2}; -}; - -let x = { - switch%extend (None) { - | Some(x) => assert(false) - | None => () - }; -}; - -let x = { - try%extend(raise(Not_found)) { - | Not_found => () - | Invalid_argument(msg) => prerr_endline(msg) - }; -}; - -/* At structure level */ - -try%extend() { -| _ => () -}; - -switch%extend () { -| _ => () -}; - -if%extend (true) {1} else {2}; - -for%extend (i in 1 to 10) { - (); -}; - -while%extend (false) { - (); -}; - -[%extend () => ()]; - -fun%extend -| None => () -| Some(1) => (); - -/* In a top-level binding */ - -let x = - try%extend() { - | _ => () - }; - -let x = - switch%extend () { - | _ => () - }; - -let x = if%extend (true) {1} else {2}; - -let x = - for%extend (i in 1 to 10) { - (); - }; - -let x = - while%extend (false) { - (); - }; - -let x = [%extend () => ()]; - -let x = - fun%extend - | None => () - | Some(1) => (); - -/* With two extensions, alone */ - -let x = { - [%extend1 - try%extend2() { - | _ => () - }]; -}; - -let x = { - [%extend1 - switch%extend2 () { - | _ => () - }]; -}; - -let x = { - [%extend1 if%extend2 (true) {1} else {2}]; -}; - -let x = { - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; -}; - -let x = { - [%extend1 - while%extend2 (false) { - (); - }]; -}; - -let x = { - [%extend1 [%extend2 () => ()]]; -}; - -let x = { - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; -}; - -/* With two extensions, first in sequence */ - -let x = { - [%extend1 - try%extend2() { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - switch%extend2 () { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 if%extend2 (true) {1} else {2}]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - while%extend2 (false) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 [%extend2 () => ()]]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; -}; - -/* With two extensions, in sequence */ - -let x = { - ignore(); - [%extend1 - try%extend2() { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - switch%extend2 () { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 if%extend2 (true) {1} else {2}]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - while%extend2 (false) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 [%extend2 () => ()]]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; - ignore(); -}; - -/* With two extensions, second in sequence */ - -let x = { - ignore(); - [%extend1 - try%extend2() { - | _ => () - }]; -}; - -let x = { - ignore(); - [%extend1 - switch%extend2 () { - | _ => () - }]; -}; - -let x = { - ignore(); - [%extend1 if%extend2 (true) {1} else {2}]; -}; - -let x = { - ignore(); - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; -}; - -let x = { - ignore(); - [%extend1 - while%extend2 (false) { - (); - }]; -}; - -let x = { - ignore(); - [%extend1 [%extend2 () => ()]]; -}; - -let x = { - ignore(); - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; -}; - -let _ = - switch%ext (expr) { - | A => - /* Comment under A */ - () - | B => () - }; - -/* comments in presence of extension point syntax #1938 */ -let () = { - /* 1. comment attached to extension */ - [%defer - /* 2. comment attached to expr in extension */ - cleanup()]; - /* 3. comment attached to next expr */ - something_else(); -}; - -/* comments in presence of extension point syntax #1938 */ -let () = { - /* random let binding */ - let x = 1; - /* 1. comment attached to extension */ - [%defer - /* 2. comment attached to expr in extension */ - cleanup()]; - /* 3. comment attached to next expr */ - something_else(); -}; - -let f = [%bs.raw x => x]; - -[%bs.raw x => x]; - -let work = () => { - open Syntax; - let%bind name = x; - name; -}; - -/** header */ -[%raw "console.log(42)"]; - -/* https://github.com/facebook/reason/issues/2032 */ -let predicate = - predicate === Functions.alwaysTrue1 - ? defaultPredicate - : fun%extend - | None => false - | Some(exn) => predicate(exn); - -/* Attributes shoudn't be inlined and always break */ -[@warning "-8"] -let a = 3; diff --git a/formatTest/unit_tests/expected_output/externals.re b/formatTest/unit_tests/expected_output/externals.re deleted file mode 100644 index d02f97a8c..000000000 --- a/formatTest/unit_tests/expected_output/externals.re +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Tests external formatting. - */ -external foo: type_ = "%caml_something_or_other"; - -external multilineStringExtern: int => int = - {| - Did you know you can put whatver you want inside - of an extern? Good luck with the linker though! -|}; - -module Nested = { - external multilineStringExtern: int => int = - {| - Did you know you can put whatver you want inside - of an extern? Good luck with the linker though! - |}; - external multilineStringExternWithTag: - int => int = - {| - Did you know you can put whatver you want inside - of an extern? Good luck with the linker though! - |}; - external multilineStringExtern: int => int = - {| - And this has a newline in it, so will be formatted with { | | } style string|}; - external containsQuote: int => int = - {|This has a quote in it " so will be formatted as { | | } style string|}; - external noIndentation: int => int = - {| -Did you know you can put whatver you want inside -of an extern? Good luck with the linker though! -|}; -}; diff --git a/formatTest/unit_tests/expected_output/features403.re b/formatTest/unit_tests/expected_output/features403.re deleted file mode 100644 index 871a32e7a..000000000 --- a/formatTest/unit_tests/expected_output/features403.re +++ /dev/null @@ -1,46 +0,0 @@ -type t = - | A({a: int}) - | B; - -let f = - fun - | B => 0 - | A({a}) => a; - -type nonrec u('a) = - | Box('a); - -type expr('a) = - | Val({value: 'a}): expr('a) - | Add({ - left: expr(int), - right: expr(int), - }) - : expr(int) - | Is0({test: expr(int)}): expr(bool) - | If({ - pred: expr(bool), - true_branch: expr('a), - false_branch: expr('a), - }) - : expr('a); - -let rec eval: type a. expr(a) => a = - e => - switch (e) { - | Is0({test}) => eval(test) == 0 - | Val({value}) => value - | Add({left, right}) => - eval(left) + eval(right) - | If({pred, true_branch, false_branch}) => - if (eval(pred)) { - eval(true_branch); - } else { - eval(false_branch); - } - }; - -type hlist = - | []: hlist; - -let foo = (type a, type b) => 5; diff --git a/formatTest/unit_tests/expected_output/firstClassModules.re b/formatTest/unit_tests/expected_output/firstClassModules.re deleted file mode 100644 index a5937d38e..000000000 --- a/formatTest/unit_tests/expected_output/firstClassModules.re +++ /dev/null @@ -1,100 +0,0 @@ -module Modifier = ( - val Db.Hashtbl.create(): - Db.Sig with type t = Mods.t -); -module Modifier = ( - val Db.Hashtbl.create(): - Db.Sig with type t = Mods.t -); -module Modifier = ( - val Db.Hashtbl.create(): - Db.Sig with type t = Mods.t -); -module Modifier = ( - val Db.Hashtbl.create(): - Db.Sig with type t = Mods.t -); -module Modifier = (val Db.Hashtbl.create()); -module Modifier = ( - val Db.Hashtbl.create(): - Db.Sig with - type t = Mods.t and - type s = Mods.s and - type z = Mods.z -); - -module Lowercase = (val stuff: lowercase); -module Lowercase = ( - val stuff: Foo.Bar.lowercase -); -module Lowercase = ( - val stuff: - Foo.Bar.lowercase with type t = Mods.t -); - -module T = ( - val (module FirstClass): myLowercaseModule -); - -module Three = (val three: X_int); - -let thing: module Thing = (module MyModule); -let thing: module Foo.Bar.Thing = - (module MyModule); - -let smallThing: module lowercase = (module Mod); -let smallThing: module lowercase = (module Mod); -let smallThing: module Foo.Bar.lowercase = - (module Mod); -let smallThing: module Foo.Bar.lowercase = - (module Mod); - -let f = (module Add: S.Z, x) => Add.add(x); - -let join_iter = - ( - type ta, - type tb, - module A: Sig with type t = ta, - module B: Sig with type t = tb, - module C: Sig with type t = tb, - module D: - Sig with - type t = tb and - type s = tc and - type x = td and - type z = te, - fn, - ) => - fn(A.value + B.value); - -type t = ref(module Console); -type firstClassConsole = (module Console); - -type crossPlatform = - Platform.t( - module Windows, - module Mac, - module Linux, - ); - -type t = ( - module FirstClass, - module SecondClass, -); - -type withAttr = ref([@bar] (module Console)); -type withAttrPlatform = - Platform.t( - [@bar] (module Iphone), - [@foo] (module Ipad), - ); -type tWithAttr = ( - [@foo] (module FirstClass), - [@bar] (module SecondClass), -); - -type t = {m: (module M)}; - -/* https://github.com/facebook/reason/issues/2150 */ -type t('a) = (module Test with type a = 'a); diff --git a/formatTest/unit_tests/expected_output/fixme.re b/formatTest/unit_tests/expected_output/fixme.re deleted file mode 100644 index 40a98c766..000000000 --- a/formatTest/unit_tests/expected_output/fixme.re +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Problem: In thise example, the comment should have a space after it. - */ -let store_attributes = proc_attributes => { - let should_write = - /* only overwrite defined procedures */ proc_attributes.ProcAttributes.is_defined - || not(DB.file_exists(attributes_file)); - should_write; -}; diff --git a/formatTest/unit_tests/expected_output/functionInfix.re b/formatTest/unit_tests/expected_output/functionInfix.re deleted file mode 100644 index ee1576ec5..000000000 --- a/formatTest/unit_tests/expected_output/functionInfix.re +++ /dev/null @@ -1,60 +0,0 @@ -let entries = ref([]); - -let all = ref(0); - -/* - * >>= is left associative, and higher precedence than => - */ -let (>>=) = (a, b) => b(a); - -let fff = (); - -/** Parse tree */ -fff >>= (xx(yy) >>= aa(bb)); - -/* Minimum parenthesis */ -fff >>= xx(yy) >>= aa(bb); - -/* Actually printed parenthesis */ -fff >>= (xx(yy) >>= aa(bb)); - -/** Parse tree */ -fff >>= ((xx => 0) >>= (aa => 10)); - -/* Minimum parenthesis */ -fff >>= ((xx => 0) >>= (aa => 10)); - -/* Actually printed parenthesis */ -fff >>= ((xx => 0) >>= (aa => 10)); - -/** Parse tree */ -fff >>= (xx => 0) >>= (aa => 10); - -/* Minimum parenthesis */ -/* It is very difficult to actually achieve this. */ -fff >>= (xx => 0) >>= (aa => 10); - -/* Actually printed. */ -fff >>= (xx => 0) >>= (aa => 10); - -/** Parse tree */ -fff >>= (xx => 0 >>= ((aa, cc) => 10)); - -/* Minimum parens - grouping the zero */ -/* Difficult to achieve. */ -fff >>= (xx => 0 >>= ((aa, cc) => 10)); - -/* Actually printed parenthesis. */ -fff >>= (xx => 0) >>= ((aa, cc) => 10); - -/* Another way you could also write it it */ -fff >>= (xx => 0) >>= ((aa, cc) => 10); - -/** Parse tree */ -fff >>= (xx => 0); - -/* Minimum parens - grouping the zero */ -fff >>= (xx => 0); - -/* Printed parens - see how more are printed than necessary. */ -fff >>= (xx => 0); diff --git a/formatTest/unit_tests/expected_output/if.re b/formatTest/unit_tests/expected_output/if.re deleted file mode 100644 index c789dedb7..000000000 --- a/formatTest/unit_tests/expected_output/if.re +++ /dev/null @@ -1,222 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let logTSuccess = self => - if (self > other) { - print_string("Did T"); - print_newline(); - } else { - (); - }; -let something = - if (self.ext.logSuccess) { - print_string("Did T"); - print_newline(); - }; - -let logTSuccess = self => - if (self.ext.logSuccess) { - print_string("Did T"); - print_newline(); - } else { - (); - }; - -if (if (x) {true} else {false}) { - true; -} else { - false; -}; - -/* Parens are required around if if it's an argument - this is the same as before. */ -if (callSomeFunction( - if (true) {true} else {false}, - )) { - true; -} else { - false; -}; - -/* Notice that to do something strange, your code must *look* strange. */ -/* That's generally a good thing */ -if (callSomeFunction) { - if (true) {true}; -} else { - false; -}; - -if (callSomeFunction( - { - thisIsAnArgument; - notTheControlFlow; - }, - )) { - thisIsTheControlFlow; -}; - -/* The braces around the test conditions of if statements are not required. - * The only requirement is that the test conditions be "simple". - * The "then" body only need be simple but the parser will print it as a - * sequence (this is a lossless process - nothing changes about the AST). - * - * The else body doesn't even need to be simple (hence the nesting of else if), - * but the printer will print it inside a simple sequence, unless it - * can make it prettier by nesting the else ifs. - * - */ -if (printIfFirstArgGreater) { - simpleThen; -} else { - thisDoesnt(even, have2, be, simple); -}; - -if (if (x) {true} else {false}) { - (); -} else { - (); -}; - -/** TERNARY - *============================================================================ - */ - -let ternaryResult = - something - ? callThisFunction(withThisArg) : thatResult; - -let annotatedTernary = - true && (something ? true : false: bool); - -let annotatedBranch = - true - && (something ? (true: bool) : false: bool); - -/* The following should be... */ -let whatShouldThisBeParsedAs = - something - ? callThisFunction(withThisArg) - : trailingTest ? true : false; - -/* ... it should be parsed as */ -let whatShouldThisBeParsedAs = - something - ? callThisFunction(withThisArg) - : trailingTest ? true : false; - -/* Should *not* be parsed as */ -let whatShouldThisBeParsedAs = - ( - something - ? callThisFunction(withThisArg) - : trailingTest - ) - ? true : false; - -/* the following shoud be... */ -let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks : other; - -/* ideally formatted as - let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks - : other - */ -let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks : other; - -/* but is currently formatted as the following (which is less than desirable) - let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks : other - */ -let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks : other; - -let ternaryResult = - aaaaaa - ? bbbbbbb - : ccccc ? ddddddd : eeeee ? fffffff : ggggg; - -/* Should be parsed as: */ -let ternaryResult = - aaaaaa - ? bbbbbbb - : ccccc ? ddddddd : eeeee ? fffffff : ggggg; - -let ternaryResult = - /* The first Parens *must* be preserved! */ - (x ? y : z) - ? bbbbbbb - : ccccccc - ? ddddddd : eeeeeee ? fffffff : ggggg; - -let ternaryResult = - aaaaaaa - ? bbbbbbb - /* The second Parens *must* be preserved! */ - : (x ? y : z) - ? ddddddd : eeeeeee ? fffffff : ggggg; - -let ternaryResult = - aaaaaaa - ? bbbbbbb - : x - ? y - : z - ? ddddddd - /* The final parent don't need to be preserved */ - : eeeeeee ? fffffff : x ? y : z; - -let addOne = x => x + 1; - -let result = - addOne(0) + 0 > 1 - ? print_string("this wont print") - : print_string("this will"); -/* - * Should be parsed as: - */ -let result = - addOne(0) + 0 > 1 - ? print_string("this wont print") - : print_string("this will"); - -/* - * Try shouldn't be aliased as ternary! - */ -let res = - try(something) { - | true => "hi" - | false => "bye" - }; - -/* - * Many levels of if elseif should be formatted very nicely. - */ -let result = - if (something) { - Console.log("First Branch"); - } else if (anotherThing) { - Console.log("Second Branch"); - } else if (yetAnotherThing) { - Console.log("Third Branch"); - } else { - Console.log("Final Case"); - }; - -/* - * Ternaries are simply switch statements on true/false. It's nice that there - * is a distinction between if and switch (even though if could have just been - * sugar on top of switch) because it allows us to use switching on true/false - * as yet another pun for if/then that should be *preserved* as being distinct - * from if/then (the ternary). - */ -let res = someExpression ? "true" : "false"; - -let pngSuffix = - pixRation > 1 - ? "@" ++ string_of_int(pixRation) ++ "x.png" - : ".png"; diff --git a/formatTest/unit_tests/expected_output/infix.re b/formatTest/unit_tests/expected_output/infix.re deleted file mode 100644 index e01057497..000000000 --- a/formatTest/unit_tests/expected_output/infix.re +++ /dev/null @@ -1,1326 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/* - A good way to test if formatting of infix operators groups precedences - correctly, is to write an expression twice. Once in a form where parenthesis - explicitly group according to the parse tree and write it another time - without any parenthesis. After formatting, the two should be equal - textually. - - Reformatting n > 0 times should be idempotent. - - Our formatting algorithm *could* decide to leave equivalently precedented - infix applications ungrouped in parenthesis (which is what the above test - verifies), but the additional parenthesis is nice. */ -/* < > = all have same precedence level/direction(left) */ -let parseTree = x > y > z < a < b == c == d; - -let minParens = x > y > z < a < b == c == d; - -let formatted = x > y > z < a < b == c == d; - -/* Case with === */ - -let parseTree = x > y > z < a < b === c === d; - -let minParens = x > y > z < a < b === c === d; - -let formatted = x > y > z < a < b === c === d; - -/* < > = all have same precedence level and direction (left) */ -let parseTree = - a1 < a2 < (b1 > b2 > (y == x == z)); - -let minParens = - a1 < a2 < (b1 > b2 > (y == x == z)); - -let formatted = - a1 < a2 < (b1 > b2 > (y == x == z)); - -/* Case with === */ - -let parseTree = - a1 < a2 < (b1 > b2 > (y === x === z)); - -let minParens = - a1 < a2 < (b1 > b2 > (y === x === z)); - -let formatted = - a1 < a2 < (b1 > b2 > (y === x === z)); - -/* !=...(left) same level =(left) is higher than :=(right) */ -let parseTree = - a1 := a2 := b1 == b2 == (y != x != z); - -let minParens = - a1 := a2 := b1 == b2 == (y != x != z); - -let formatted = - a1 := a2 := b1 == b2 == (y != x != z); - -/* Case with === */ - -let parseTree = - a1 := a2 := b1 === b2 === (y !== x !== z); - -let minParens = - a1 := a2 := b1 === b2 === (y !== x !== z); - -let formatted = - a1 := a2 := b1 === b2 === (y !== x !== z); - -/* !=...(left) same level =(left) is higher than :=(right) */ -let parseTree = - a1 := a2 := b1 == (b2 == y != x != z); - -let minParens = - a1 := a2 := b1 == (b2 == y != x != z); - -let formatted = - a1 := a2 := b1 == (b2 == y != x != z); - -/* Case with === */ - -let parseTree = - a1 := a2 := b1 === (b2 === y !== x !== z); - -let minParens = - a1 := a2 := b1 === (b2 === y !== x !== z); - -let formatted = - a1 := a2 := b1 === (b2 === y !== x !== z); - -/* &...(left) is higher than &(right). &(right) is equal to &&(right) */ -let parseTree = - a1 && a2 && b1 & b2 & y &|| x &|| z; - -let minParens = - a1 && a2 && b1 & b2 & y &|| x &|| z; - -let formatted = - a1 && a2 && b1 & b2 & y &|| x &|| z; - -/** - * Now, let's try an example that resembles the above, yet would require - * parenthesis everywhere. - */ -/* &...(left) is higher than &(right). &(right) is equal to &&(right) */ -let parseTree = - ((((a1 && a2) && b1) & b2) & y) &|| (x &|| z); - -let minParens = - ((((a1 && a2) && b1) & b2) & y) &|| (x &|| z); - -let formatted = - ((((a1 && a2) && b1) & b2) & y) &|| (x &|| z); - -/* **...(right) is higher than *...(left) */ -let parseTree = b1 *| b2 *| (y **| (x **| z)); - -let minParens = b1 *| b2 *| (y **| (x **| z)); - -let formatted = b1 *| b2 *| (y **| (x **| z)); - -/* **...(right) is higher than *...(left) */ -let parseTree = - b1 *| b2 *| (y **| (x **| z *| a)); - -let minParens = - b1 *| b2 *| (y **| (x **| z *| a)); - -let formatted = - b1 *| b2 *| (y **| (x **| z *| a)); - -/* |...(left) is higher than ||(right) */ -/* All parens should be removed when formatting n > 0 times */ -let parseTree = b1 || b2 || y |* x |* z; - -let minParens = b1 || b2 || y |* x |* z; - -let formatted = b1 || b2 || y |* x |* z; - -/* Associativity effects how parenthesis should be dropped */ -/* This one *shouldn't* expand into two consecutive infix + */ -first + (second + third); - -/* This one *should* */ -first + second + third; - -/* But that's just because + is left associative. Since & is right associative, - * it's the opposite. */ -/* This one *should* expand into two consecutive infix * */ -first & second & third; - -/* This one *shouldn't* */ -(first & second) & third; - -/* || is basically the same as &/&& */ -first || second || third; - -/* This one *shouldn't* */ -(first || second) || third; - -/* No parens should be added/removed from the following when formatting */ -let seeWhichCharacterHasHigherPrecedence = - (first |> second |> third) ^> fourth; - -let seeWhichCharacterHasHigherPrecedence = - first |> second |> third; - -let seeWhichCharacterHasHigherPrecedence = - first + second + third; - -let comparison = (==); - -/* Why would the following two cases have different grouping? */ -let res = - blah - || DataConstructor(10) - || DataConstructor(10) - && 10; - -let res = - blah - && DataConstructor(10) - && DataConstructor(10) - + 10; - -/* This demonstrates how broken infix pretty printing is: - */ -let curriedComparison = (==)(10); - -let resultOfAdd = 10 + 20 + 40; - -let resultOfAddAndMult = - 10 * 1 + 20 * 1 + 40 * 1; - -let greaterThanAndSubtract = 1 - 2 > 4 + 3; - -let greaterThanAndFunctionCalls = - pred(1) > pred(2); - -let lessThanAndFunctionCalls = - pred(1) < pred(2); - -/* This doesn't type check because it looks like pred - 1 */ -let minusAndInteger = pred - 1; - -let passingMinusOneToFunction = pred(-1); - -let leadingMinusIsCorrectlyNeg = (-1) + 20; - -let leadingMinusIsCorrectlyNeg = 3 > (-1); - -/* Custom infix without labeled args */ -let (|>) = (first, second) => first + second; - -/* Should reformat to actually be placed infix */ -let res = first |> second; - -/* Curried shouldn't place infix */ -let res = (|>)(first); - -/* Custom infix with labeled args */ -let (|>) = (~first, ~second) => first + second; - -/* Should NOT reformat named args to actually be placed infix */ -let res = (|>)(~first, ~second); - -/* Curried shouldn't place infix */ -let res = (|>)(~first); - -/* Custom infix accepting *three* without labeled args */ -let (|>) = (firsfirst, second, third) => - first + second + third; - -/* Should reformat to actually be placed infix if passed two args */ -let res = first |> second; - -let res = (first |> second)(third); - -/* Should NOT reformat to be placed infix if passed all three */ -let res = (|>)(first, second, third); - -/* Same: Curried shouldn't place infix */ -let res = (|>)(first); - -/* In fact, if even just one of the arguments are named, it shouldn't - * be formatted or parsed as infix! */ -(|>)(first, ~second); - -(|>)(~first, second); - -(|>)(first, second, ~third); - -(first |> second)(~third); - -/* Infix has lower precedence than function application */ -first |> second(~third); - -let leftAssocGrouping = first |> second |> third; - -let rightAssocGrouping = - first ^> second ^> third; - -/* It's definitely the caret. */ -let seeWhichCharacterHasHigherPrecedence = - first |> second ^> third; - -let seeWhichCharacterHasHigherPrecedence = - first ^> second |> third; - -let seeWhichCharacterHasHigherPrecedence = - first ^> (second |> third) |> fourth; - -let res = - blah - && DataConstructor(10) - && DataConstructor(10) - + 10; - -/* Should be parsed as */ -let res = - blah - && DataConstructor(10) - && DataConstructor(10) - + 10; - -let (++) = (~label, ~label2) => label + label2; - -let (++) = (~label, ~label2) => label + label2; - -let (++) = (++); - -let (++): int = int = (++); - -(++)(~label=20, ~label2=30) + 40; - -/* Should be parsed as: */ -(++)(~label=20, ~label2=30) + 40; - -/* Great idea! */ -let (==) = (a, b) => a < 0; - -let (==) = (a, b) => a < 0; - -let (==) = (==); - -let (==): int = int = (==); - -let equal = Pervasives.(==); - -let starInfix_makeSureSpacesSurround = ( * ); - -let starInfix_makeSureSpacesSurround = ( *** ); - -/* The following two should be equivalently parsed/printed. */ -let includesACommentCloseInIdentifier = ( **\/ ); - -let includesACommentCloseInIdentifier = ( **\/ ); - -let shouldSimplifyAnythingExceptApplicationAndConstruction = - call("hi") - ++ ( - switch (x) { - | _ => "hi" - } - ) - ++ "yo"; -let shouldRemoveParens = ident + ident + ident; -let shouldRemoveParens = ident ++ ident ++ ident; -let shouldPreserveParens = - ident + (ident + ident); -let shouldPreserveParens = - (ident ++ ident) ++ ident; -/** - * Since ++ is now INFIXOP1, it should have lower priority than INFIXOP2 (which - * includes the single plus sign). That means no parens are required in the - * following scenario even though they'd be required in (ident ++ ident) ++ ident. - */ -let noParensRequired = ident + ident ++ ident; - -/* So in this case, it should format to whatever the previous example formats to. */ -let noParensRequired = ident + ident ++ ident; - -/** - * Everything that was said above should be true of minus sign as well. In - * terms of precedence, plus sign should be treated the same as plus sign - * followed by a dollar sign. And +++ should be treated the same as ++. - * should also be true of plus sign followed by dollar sign for example. - */ - -let shouldRemoveParens = ident - ident - ident; -let shouldPreserveParens = - ident - (ident - ident); -let shouldPreserveParens = - ident +$ (ident +$ ident); -let noParensRequired = ident - ident ++ ident; -let noParensRequired = ident - ident ++ ident; -let noParensRequired = ident +$ ident ++ ident; - -let noParensRequired = ident + ident +++ ident; -let noParensRequired = ident + ident +++ ident; - -/* Parens are required any time you want to make ++ or +++ parse with higher - * priority than + or - */ -let parensRequired = ident + (ident ++ ident); -let parensRequired = ident + (ident +++ ident); -let parensRequired = ident + (ident ++- ident); -let parensRequired = ident +$ (ident ++- ident); - -/* ++ and +++ have the same parsing precedence, so it's right associative. - * Parens are required if you want to group to the left, even when the tokens - * are different.*/ -let parensRequired = (ident ++ ident) +++ ident; -let parensRequired = (ident +++ ident) ++ ident; - -/* Add tests with IF/then mixed with infix/constructor application on left and right sides */ -/** - * Every star or forward slash after the character of an infix operator must be - * escaped. - */ -let ( /\* ) = (a, b) => a + b; - -let x = 12 /-* 23 /-* 12; - -let y = a /\* b; - -let ( !=* ) = (q, r) => q + r; - -let res = q(( !=* ), r); - -let ( !=/\* ) = (q, r) => q + r; - -let res = q(( !=/\* ), r); - -let ( ~* ) = a => a + 1; - -let res = ~*10; - -let res = f - (- x); - -let res = f - (- x); - -let res = - (- x); - -let res = f(- x); - -/** - * Test using almost simple prefix as regular function. - */ -let (!!) = (a, b) => a + b; - -let res = (!!)(20, 40); - -/* The semicolon should be attached to someType */ -let myFunc = - ( - aaaa, - bbbb, - cccc, - dddd, - aaaa, - bbbb, - cccc, - dddd, - aaaa, - ) => [ - blah( - aaaa, - bbbb, - cccc, - dddd, - aaaa, - bbbb, - cccc, - dddd, - aaaa, - ), - ...someType, -]; - -/** - * Testing various fixity. - */ - -/** - * For each of these test cases for imperative updates, we'll test both record - * update, object member update and array update. - */ -let containingObject = { - val mutable y = 0; - val arr = [|true, false, false|]; - val bigArr = "goodThingThisIsntTypeChecked"; - val str = "string"; - pub testCases = () => { - /** - * The lowest precedence token is =, followed by :=, and then ?, then :. - * - * The following text - * - * x.contents = tenaryTest ? ifTrue : ifFalse - * - * Generates the following parse tree: - * - * = - * / \ - * / \ - * record ternary - * - * Because when encountering the ? the parser will shift on the ? instead of - * reducing expr = expr - */ - /** - * Without a + 1 - */ - (x.contents = something ? hello : goodbye); - y = something ? hello : goodbye; - arr[0] = something ? hello : goodbye; - bigArr.{0} = something ? hello : goodbye; - str.[0] = something ? hello : goodbye; - - (x.contents = something) ? hello : goodbye; - (y = something) ? hello : goodbye; - (arr[0] = something) ? hello : goodbye; - (bigArr.{0} = something) ? hello : goodbye; - (str.[0] = something) ? hello : goodbye; - - x.contents = something ? hello : goodbye; - y = something ? hello : goodbye; - arr[0] = something ? hello : goodbye; - bigArr.{0} = something ? hello : goodbye; - str.[0] = something ? hello : goodbye; - - /** - * With a + 1 - */ - ( - x.contents = something + 1 ? hello : goodbye - ); - x := something + 1 ? hello : goodbye; - y = something + 1 ? hello : goodbye; - arr[0] = something + 1 ? hello : goodbye; - bigArr.{0} = something + 1 ? hello : goodbye; - str.[0] = something + 1 ? hello : goodbye; - - (x.contents = something + 1) - ? hello : goodbye; - (x := something + 1) ? hello : goodbye; - (y = something + 1) ? hello : goodbye; - (arr[0] = something + 1) ? hello : goodbye; - (bigArr.{0} = something + 1) - ? hello : goodbye; - (str.[0] = something + 1) ? hello : goodbye; - - x.contents = something + 1 ? hello : goodbye; - x := something + 1 ? hello : goodbye; - y = something + 1 ? hello : goodbye; - arr[0] = something + 1 ? hello : goodbye; - bigArr.{0} = something + 1 ? hello : goodbye; - str.[0] = something + 1 ? hello : goodbye; - - /** - * #NotActuallyAConflict - * Note that there's a difference with how = and := behave. - * We only *simulate* = being an infix identifier for the sake of printing, - * but for parsing it's a little more nuanced. There *isn't* technically a - * shift/reduce conflict in the following that must be resolved via - * precedence ranking: - * - * a + b.c = d - * - * No conflict between reducing a + b.c, and shifting =, like there would - * be if it was := instead of =. That's because the rule for = isn't the - * infix rule with an arbitrary expression on its left - it's something - * much more specific. - * - * (simple_expr) DOT LIDENT EQUAL expression. - * - * So with the way yacc/menhir works, when it sees an equal sign, it knows - * that there is no valid parse where a + b.c is reduced to an expression - * with an = immediately appearing after, so it shifts the equals. - * - * If you replace = with :=, you'd see different behavior. - * - * a + b.c := d - * - * Since := has lower precedence than +, it would be parsed as: - * - * (a + b.c) := d - * - * However, our printing logic will print = assignment with parenthesis: - * - * a + (b.c = d) - * - * Even though they're not needed, because it doesn't know details about - * which rules are valid, we just told it to print = as if it were a valid - * infix identifier. - * - * Another case: - * - * something >>= fun x => x + 1; - * - * Will be printed as: - * - * something >>= (fun x => x + 1); - * - * Because the arrow has lower precedence than >>=, but it wasn't needed because - * - * (something >>= fun x) => x + 1; - * - * Is not a valid parse. Parens around the `=>` weren't needed to prevent - * reducing instead of shifting. To optimize this part, we need a much - * deeper encoding of the parse rules to print parens only when needed. - * - */ - /* The following */ - x - + (something.contents = y); - x + (something = y); - x + something.contents := y; - x + something := y; - - /* Should be parsed as: */ - x + (something.contents = y); /* Because of the #NotActuallyAConflict above */ - x + (something = y); /* Same */ - x + something.contents := y; - x + something := y; - - /* To make the := parse differently, we must use parens */ - x + (something.contents := y); - x + (something := y); - - /** - * Try with || - */ x.contents - || something - + 1 - ? hello : goodbye; - y || something + 1 ? hello : goodbye; - arr[0] || something + 1 ? hello : goodbye; - bigArr.{0} || something + 1 - ? hello : goodbye; - str.[0] || something + 1 ? hello : goodbye; - - x.contents || something + 1 - ? hello : goodbye; - y || something + 1 ? hello : goodbye; - arr[0] || something + 1 ? hello : goodbye; - bigArr.{0} || something + 1 - ? hello : goodbye; - str.[0] || something + 1 ? hello : goodbye; - - x.contents - || (something + 1 ? hello : goodbye); - y || (something + 1 ? hello : goodbye); - arr[0] || (something + 1 ? hello : goodbye); - bigArr.{0} - || (something + 1 ? hello : goodbye); - str.[0] || (something + 1 ? hello : goodbye); - - /** - * Try with && - */ x.contents - && something - + 1 - ? hello : goodbye; - y && something + 1 ? hello : goodbye; - arr[0] && something + 1 ? hello : goodbye; - bigArr.{0} && something + 1 - ? hello : goodbye; - str.[0] && something + 1 ? hello : goodbye; - - x.contents && something + 1 - ? hello : goodbye; - y && something + 1 ? hello : goodbye; - arr[0] && something + 1 ? hello : goodbye; - bigArr.{0} && something + 1 - ? hello : goodbye; - str.[0] && something + 1 ? hello : goodbye; - - x.contents - && (something + 1 ? hello : goodbye); - y && (something + 1 ? hello : goodbye); - arr[0] && (something + 1 ? hello : goodbye); - bigArr.{0} - && (something + 1 ? hello : goodbye); - str.[0] && (something + 1 ? hello : goodbye); - - /** - * See how regular infix operators work correctly. - */ - (x.contents = 2 + 4); - y = 2 + 4; - arr[0] = 2 + 4; - bigArr.{0} = 2 + 4; - str.[0] = 2 + 4; - - (x.contents = 2) + 4; - (y = 2) + 4; - (arr[0] = 2) + 4; - (bigArr.{0} = 2) + 4; - (str.[0] = 2) + 4; - - /** - * Ensures that record update, object field update, and := are all right - * associative. - */ - (x.contents = y.contents = 10); - y = x.contents = 10; - arr[0] = x.contents = 10; - bigArr.{0} = x.contents = 10; - str.[0] = x.contents = 10; - /* Should be the same as */ - x.contents = x.contents = 10; - y = x.contents = 10; - arr[0] = x.contents = 10; - bigArr.{0} = x.contents = 10; - str.[0] = x.contents = 10; - - /** - * Ensures that record update, object field update, and := are all right - * associative. - */ - x := - x := 10; - /* Should be the same as */ - x := x := 10; - - /* By default, without parens*/ - x ? y : z ? a : b; - - /* It is parsed as the following: */ - x ? y : z ? a : b; - - /* Not this: */ - (x ? y : z) ? a : b; - - /** - * ^ - * When rendering the content to the left of the ? we know that we want the - * parser to reduce the thing to the left of the ? when the ? is seen. So we - * look at the expression to the left of ? and discover what precedence level - * it is (token of its rightmost terminal). We then compare it with ? to see - * who would win a shift reduce conflict. We want the term to the left of the ? - * to be reduced. So if it's rightmost terminal isn't higher precedence than ?, - * we wrap it in parens. - */ - ( - /*** - * The following - */ - x.contents = - something - ? x.contents = somethingElse : goodbye - ); - y = something ? y = somethingElse : goodbye; - arr[0] = - something - ? arr[0] = somethingElse : goodbye; - bigArr.{0} = - something - ? bigArr.{0} = somethingElse : goodbye; - str.[0] = - something - ? str.[0] = somethingElse : goodbye; - /* - * Should be parsed as - */ - x.contents = - something - ? x.contents = somethingElse : goodbye; - y = something ? y = somethingElse : goodbye; - arr[0] = - something - ? arr[0] = somethingElse : goodbye; - bigArr.{0} = - something - ? bigArr.{0} = somethingElse : goodbye; - str.[0] = - something - ? str.[0] = somethingElse : goodbye; - - /** And this */ y := - something ? y := somethingElse : goodbye; - arr[0] := - something - ? arr[0] := somethingElse : goodbye; - bigArr.{0} := - something - ? bigArr.{0} := somethingElse : goodbye; - str.[0] := - something - ? str.[0] := somethingElse : goodbye; - - /* Should be parsed as */ - y := something ? y := somethingElse : goodbye; - arr[0] := - something - ? arr[0] := somethingElse : goodbye; - bigArr.{0} := - something - ? bigArr.{0} := somethingElse : goodbye; - str.[0] := - something - ? str.[0] := somethingElse : goodbye; - - /* The following */ - x := - something - ? x.contents = - somethingElse ? goodbye : goodbye - : goodbye; - x := - something - ? arr[0] = - somethingElse ? goodbye : goodbye - : goodbye; - x := - something - ? bigArr.{0} = - somethingElse ? goodbye : goodbye - : goodbye; - x := - something - ? str.[0] = - somethingElse ? goodbye : goodbye - : goodbye; - /* Is parsed as */ - x := - something - ? x.contents = - somethingElse ? goodbye : goodbye - : goodbye; - x := - something - ? arr[0] = - somethingElse ? goodbye : goodbye - : goodbye; - x := - something - ? bigArr.{0} = - somethingElse ? goodbye : goodbye - : goodbye; - x := - something - ? str.[0] = - somethingElse ? goodbye : goodbye - : goodbye; - /* is not the same as */ - x := - something - ? (x.contents = somethingElse) - ? goodbye : goodbye - : goodbye; - x := - something - ? (arr[0] = somethingElse) - ? goodbye : goodbye - : goodbye; - x := - something - ? (bigArr.{0} = somethingElse) - ? goodbye : goodbye - : goodbye; - x := - something - ? (str.[0] = somethingElse) - ? goodbye : goodbye - : goodbye; - - /** - * And - */ - /** These should be parsed the same */ - something - ? somethingElse - : x.contents = somethingElse ? x : z; - something - ? somethingElse - : x.contents = somethingElse ? x : z; - /* Not: */ - something - ? somethingElse - : (x.contents = somethingElse) ? x : z; - ( - something - ? somethingElse - : x.contents = somethingElse - ) - ? x : z; - - /* These should be parsed the same */ - something - ? somethingElse - : x := somethingElse ? x : z; - something - ? somethingElse - : x := somethingElse ? x : z; - /* Not: */ - something - ? somethingElse - : (x := somethingElse) ? x : z; - ( - something - ? somethingElse : x := somethingElse - ) - ? x : z; - - /** These should be parsed the same */ - something - ? somethingElse : y = somethingElse ? x : z; - something - ? somethingElse : y = somethingElse ? x : z; - /* Not: */ - something - ? somethingElse - : (y = somethingElse) ? x : z; - ( - something - ? somethingElse : y = somethingElse - ) - ? x : z; - - /** These should be parsed the same */ - something - ? somethingElse - : arr[0] = somethingElse ? x : arr[0]; - something - ? somethingElse - : arr[0] = somethingElse ? x : arr[0]; - /* Not: */ - something - ? somethingElse - : (arr[0] = somethingElse) ? x : z; - ( - something - ? somethingElse : arr[0] = somethingElse - ) - ? x : z; - - /** These should be parsed the same */ - something - ? somethingElse - : bigArr.{0} = - somethingElse ? x : bigArr.{0}; - something - ? somethingElse - : bigArr.{0} = - somethingElse ? x : bigArr.{0}; - /* Not: */ - something - ? somethingElse - : (bigArr.{0} = somethingElse) ? x : z; - ( - something - ? somethingElse - : bigArr.{0} = somethingElse - ) - ? x : z; - - /** These should be parsed the same */ - something - ? somethingElse - : arr.[0] = somethingElse ? x : arr.[0]; - something - ? somethingElse - : arr.[0] = somethingElse ? x : arr.[0]; - /* Not: */ - something - ? somethingElse - : (str.[0] = somethingElse) ? x : z; - ( - something - ? somethingElse : str.[0] = somethingElse - ) - ? x : z; - - /** - * It creates a totally different meaning when parens group the : - */ - ( - x.contents = - something - ? (x.contents = somethingElse: x) : z - ); - y = something ? (y = somethingElse: x) : z; - arr[0] = - something - ? (arr[0] = somethingElse: x) : z; - bigArr.{0} = - something - ? (bigArr.{0} = somethingElse: x) : z; - str.[0] = - something - ? (str.[0] = somethingElse: x) : z; - - /** - * Various precedence groupings. - */ - true - ? true ? false : false : false; - /* Is the same as */ - true ? true ? false : false : false; - /* - * Just some examples of how prefix will be printed. - */ - - x + (something.contents = y); - - x + (something = y); - - x + something.contents := y; - - x + something := y; - x + (- (something.contents = y)); - x + (- (something = y)); - x + (- something.contents) := y; - x + (- something) := y; - x.contents || something + 1 - ? - hello : goodbye; - bigArr.{0} || - something + 1 - ? hello : goodbye; - let result = - x + (something.contents = y); - - /* Prefix minus is actually sugar for regular function identifier ~-*/ - let result = 2 + (- add(4, 0)); - /* Same as */ - let result = 2 + (- add(4, 0)); - /* Same as */ - let result = 2 + (- add(4, 0)); - - /* That same example but with ppx attributes on the add application */ - let result = 2 + (- [@ppx] add(4, 0)); - /* Same as */ - let result = [@ppx] 2 + (- add(4, 0)); - /* Same as */ - let result = [@ppx] 2 + (- add(4, 0)); - - /* Multiple nested prefixes */ - let result = 2 + (- (- (- add(4, 0)))); - - /* And with attributes */ - let result = - [@onAddApplication] 2 - + (- (- (- add(4, 0)))); - - /** - * TODO: Move all of these test cases to attributes.re. - */ - /* Attribute on the prefix application */ - let res = [@attr] (- something(blah, blah)); - /* Attribute on the regular function application, not prefix */ - let res = [@attr] (- something(blah, blah)); - let attrOnPrefix = [@ppxOnPrefixApp] (-1); - let attrOnPrefix = 5 + (-1); - let result = - [@ppxAttributeOnSugarGetter] arr.[0]; - - /** - * Unary plus/minus has lower precedence than prefix operators: - * And unary plus has same precedence as unary minus. - */ - let res = - (!record); - /* Should be parsed as: */ - let res = - (!record); - /* Although that precedence ranking doesn't likely have any effect in that - * case. */ - /** - * And this - */ - let res = - (+ callThisFunc()); - /* should be parsed as: */ - let res = - (+ callThisFunc()); - - /** - * And this - */ - let res = !(- callThisFunc()); - /* Should be parsed (and should remain printed as: */ - let res = !(- callThisFunc()); - - let res = [@onApplication] (!x); - let res = ![@onX] x; - - let res = ![@onX] x; - [@shouldBeRenderedOnEntireSetField] - (something.contents = "newvalue"); - something.contents = - [@shouldBeRenderedOnString] "newvalue"; - } -}; - -let x = foo |> z; - -let x = foo |> f |> g; - -let x = - foo - |> somelongfunctionname("foo") - |> anotherlongfunctionname("bar", 1) - |> somelongfunction - |> bazasdasdad; - -let code = - JSCodegen.Code.( - create - |> lines( - Requires.( - create - |> import_type( - ~local="Set", - ~source="Set", - ) - |> import_type( - ~local="Map", - ~source="Map", - ) - |> import_type( - ~local="Immutable", - ~source="immutable", - ) - |> require( - ~local="invariant", - ~source="invariant", - ) - |> require( - ~local="Image", - ~source="Image.react", - ) - |> side_effect( - ~source="monkey_patches", - ) - |> render_lines - ), - ) - |> new_line - |> new_line - |> new_line - |> new_line - |> render - ); - -let code = JSCodegen.Code.(create |> render); - -let server = { - let callback = (_conn, req, body) => { - let uri = - req - |> Request.uri - |> Uri.to_string - |> Code.string_of_uri - |> Server.respond - |> Request.uri; - let meth = - req - |> Request.meth - |> Code.string_of_method; - let headers = - req |> Request.headers |> Header.to_string; - body - |> Cohttp_lwt_body.to_string - >|= ( - body => { - Printf.sprintf( - "okokok", - uri, - meth, - headers, - body, - ); - } - ) - >>= ( - body => - Server.respond_string( - ~status, - ~body, - (), - ) - ); - }; - Server.create( - ~mode, - Server.make(~callback, ()), - ); -}; - -let lijst = - List.length @@ - List.map( - s => s ++ " example", - [ - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "ten", - ], - ); - -let example = - true != false - && "a" == "b" - && "arbitrary" === "example" - && "how long" >= "can you get" - && "seriously" <= "what is the line length"; - -if (List.length(files) > 0 - && List.length(otherfiles) < 2) { - (); -}; - -/* Don't clash with jsx edge cases */ -let (=<) = (a, b) => a + b; -let result = x =< y; -let z = x =< y; - -let z = x =< y; - -let (> a - b; -let result = x >) = (a, b) => a + b; -let result = x = b; -let z = x = b; - -let z = x = b; - -/* #1676: Exponentiation should be right-associative */ -let foo = - (100. /. 2.) ** 2. +. (200. /. 2.) ** 2.; -let foo = 100. /. 2. ** 2. +. 200. /. 2. ** 2.; - -let x = y />> f; - -let (/>>) = (a, b) => a + b; - -let x = y />/> f; - -let (/>/>) = (a, b) => a + b; - -let (><) = (a, b) => a + b; - -let x = a >< b; - -let (=-) = (a, b) => a + b; - -let foo = (a, b) => a =- b; - -let (=><) = (a, b) => a + b; -let x = a =>< b; - -let foo = - fun - | None => x >>= y - | Some(x) => x >>= y; - -something ->>= ( - fun - | None => x >>= y - | Some(x) => x >>= y -); - -( - fun - | None => x >>= y - | Some(x) => x >>= y -) ->>= bar; - -something ->>= ( - fun - | None => x >>= y - | Some(x) => x >>= y -); - -something - ? a - >>= ( - fun - | None => x >>= y - | Some(x) => x >>= y - ) - : fun - | None => x >>= y - | Some(x) => x >>= y; - -something - ? a - >>= ( - fun - | None => x >>= y - | Some(x) => x >>= y - ) - : ( - fun - | None => x >>= y - | Some(x) => x >>= y - ) - >>= b; - -let foo = - fun - | None => () - | Some(x) => ( - fun - | None => () - | Some(_) => () - ); - -let foo = - fun - | Some(x) => ( - fun - | None => () - | Some(_) => () - ) - | None => (); - -let predicate = - predicate === Functions.alwaysTrue1 - ? ( - fun - | None => false - | Some(exn) => predicate(exn) - ) - >>= foo - : fun - | None => false - | Some(exn) => predicate(exn); - -let predicate = - predicate === Functions.alwaysTrue1 - ? ( - fun - | None => false - | Some(exn) => predicate(exn) - ) - >>= foo - : bar - >>= ( - fun - | None => false - | Some(exn) => predicate(exn) - ); - -let (>...) = (a, b) => a + b; - -a >... b; - -/* https://github.com/facebook/reason/issues/2169 */ -let not = x => !x; - -let other = x => not(x); - -let derefInsideArray = [|a^|]; - -/* https://github.com/facebook/reason/issues/126 */ -foo^ ^; - -let x = foo^ ^; - -foo ^^ bar; diff --git a/formatTest/unit_tests/expected_output/jsx.re b/formatTest/unit_tests/expected_output/jsx.re deleted file mode 100644 index f1b49f5a1..000000000 --- a/formatTest/unit_tests/expected_output/jsx.re +++ /dev/null @@ -1,727 +0,0 @@ -let x = - ; - -let y = - - updater( - (latestComponentBag, _) => { - let currentActualPath = - Routes.hashOfUri(newUrl); - let pathFromState = - Routes.stateToPath( - latestComponentBag.state, - ); - currentActualPath == pathFromState - ? None - : dispatchEventless( - State.UriNavigated( - currentActualPath, - ), - latestComponentBag, - (), - ); - }, - (), - ) - } - />; - -let z = -
; - -let omega = -
; - -let someArray = -
; - -let tuples = -
; - -let icon = - "sound-off" - | v when v < 0.11 => "sound-min" - | v when v < 0.51 => "sound-med" - | _ => "sound-max" - } - } - />; - -; - -/* punning */ -; - -/* punning for explicitly passed optional */ -; - -/* don't pun explicitly passed optional with module identifier */ -; - -let x =
; - -
; - -foo #= ; - -foo #= ; - -let x = [|
|]; - -let x = [| - ; - -; - -; - -; - -; - -// shouldn't result in a stack overflow -Belt.Option.getWithDefault("")} />; - -
- {ReasonReact.string("BugTest")} -
; - -
- {let left = limit->Int.toString; - {j|$left characters left|j}->React.string} -
; - - - {let uri = "/images/header-background.png"; - } -; - -
- {true - ? { - let foo = "foo"; // don't remove semi - {ReasonReact.string(foo)} ; - } - : - {ReasonReact.string("bar")} - } -
; - -let v = - - - ...{_ => { - let renderX = x => - {let y = x ++ x; -
}; - renderX("foo"); - }} - - ; - -Option.map(x => { - let y = x; - y ++ y; - }) - } -/>; - -Option.map(x => { - let y = x; - y ++ y; - }), - } -/>; - - { - let y = x; - y ++ y; - }), - } -/>; - - { - let y = x; - y ++ y; - }), - } -/>; - - Option.map(x => { - let y = x; - y ++ y; - }), - } -/>; - - {React.string("Hello")} } />; - - {React.string("Hi")} } />; - - - -; - -; - -; diff --git a/formatTest/unit_tests/expected_output/jsx_functor.re b/formatTest/unit_tests/expected_output/jsx_functor.re deleted file mode 100644 index 9127c674b..000000000 --- a/formatTest/unit_tests/expected_output/jsx_functor.re +++ /dev/null @@ -1,41 +0,0 @@ -type elt = - | Text(string) - | Group(list(elt)); - -module X = { - let createElement = (~children=[], ()) => { - Text("x"); - }; -}; - -module Y = { - let createElement = (~children=[], ()) => { - Text("y"); - }; -}; - -module M = - ( - X: (module type of X), - Y: (module type of Y), - ) => { - let createElement = - (~name="M", ~id=0, ~children=[], ()) => { - Group( - [ - Text(name), - Text(string_of_int(id)), - , - , - ] - @ children, - ); - }; -}; - -let _ = - Group([ - , - {Text("A")} , - , - ]); diff --git a/formatTest/unit_tests/expected_output/lineComments.re b/formatTest/unit_tests/expected_output/lineComments.re deleted file mode 100644 index 09513be2e..000000000 --- a/formatTest/unit_tests/expected_output/lineComments.re +++ /dev/null @@ -1,762 +0,0 @@ -3; // - -3; //- - -3; //- - -3 /*-*/; -// **** comment -/*** comment */ -/** docstring */ -// comment -/** docstring */ -/*** comment */ -/**** comment */ -/***** comment */ -/** */ -/*** */ -/**** */ -/**/ -/***/ -/****/ -/** (** comment *) */ -/** (*** comment *) */ -// (** comment *) -// (*** comment *) -// *(*** comment *) -// comment * -// comment ** -// comment *** -// comment **** -/** - * Multiline - */ -/** Multiline - * - */ -/** - ** - */ -module JustString = { - include Map.Make(Int32); // Comment eol include -}; - -let testingEndOfLineComments = [ - "Item 1" /* Comment For First Item */, - "Item 2" /* Comment For Second Item */, - "Item 3" /* Comment For Third Item */, - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - // Comment after last item in list. -] /* Comment after rbracket */; - -// But if you place them after the comma at eol, they're preserved as such -let testingEndOfLineComments = [ - "Item 1", // Comment For First Item - "Item 2", // Comment For Second Item - "Item 3", // Comment For Third Item - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - // Comment after last item in list. -] /* Comment after rbracket */; - -// The space between ; and comment shoudn't matter -let testPlacementOfTrailingComment = [ - "Item 0" // - // Comment after last item in list. -]; // Comment after semi - -// The space between ; and comment shoudn't matter -let testPlacementOfTrailingComment = [ - "Item 0" // - // Comment after last item in list. -]; // Comment after semi - -// Try again but without other things in the list -let testPlacementOfTrailingComment = [ - "Item 0" // -]; // Comment after semi - -// The space between ; and comment shoudn't matter -let testPlacementOfTrailingComment = [ - "Item 0" // - // Comment after last item in list. -]; // Comment after semi - -let testingEndOfLineComments = []; // Comment after entire let binding - -// The following is not yet idempotent -// let myFunction -// withFirstArg // First arg -// andSecondArg => { // Second Arg -// withFirstArg + andSecondArg /* before semi */ ; -// }; - -let myFunction = // First arg - ( - withFirstArg, - // Second Arg - andSecondArg, - ) => { - withFirstArg + andSecondArg; -}; // After Semi - -type point = { - x: string, // x field - y: string // y field -}; - -type pointWithManyKindsOfComments = { - // Line before x - x: string, // x field - // Line before y - y: string // y field - // Final row of record -}; - -type typeParamPointWithComments('a) = { - // Line before x - x: 'a, // x field - // Line before y - y: 'a // y field - // Final row of record -}; - -// Now, interleaving comments in type params -// Type name -type typeParamPointWithComments2 - // The a type param - ( - 'a, - // The b type apram - 'b, - ) = { - // Line before x - x: 'a, // x field - // Line before y - y: 'a // y field - // Final row of record -}; - -/* The way the last row comment is formatted is suboptimal becuase - * record type definitions do not include enough location information */ -type anotherpoint = { - x: string, // x field - y: string // y field - // comment as last row of record -}; - -type t = (int, int); // End of line on t -type t2 = (int, int); // End of line on (int, int) - -type t3 = (int, int); // End of line on (int, int) - -type variant = - | X(int, int) // End of line on X - | Y(int, int); // End of line on Y -// Comment on entire type def for variant - -// Before let -let res = - // Before switch - switch (X(2, 3)) { - // Above X line - | X(_) => "result of X" // End of arrow and X line - // Above Y line - | Y(_) => "result of Y" // End of arrow and Y line - }; // After final semi in switch - -let res = - switch (X(2, 3)) { - | X(0, 0) => - // After X arrow - "result of X" // End of X body line - | X(1, 0) /* Before X's arrow */ => "result of X" // End of X body line - | X(_) => - // After X _ arrow - "result of X" // End of X body line - // Above Y line - | Y(_) => - // Comment above Y body - "result of Y" - }; - -type variant2 = - // Comment above X - | X(int, int) // End of line on X - // Comment above Y - | Y(int, int); - -type variant3 = - // Comment above X - | X(int, int) // End of line on X - // Comment above Y - | Y(int, int); // End of line on Y - -type x = { - // not attached *above* x - fieldOne: int, - fieldA: int, -} // Attached end of line after x -and y = { - // not attached *above* y - fieldTwo: int, -}; // Attached end of line after y - -type x2 = { - // not attached *above* x2 - fieldOne: int, - fieldA: int, -} // Attached end of line after x2 -and y2 = { - // not attached *above* y2 - fieldTwo: int, -}; - -let result = - switch (None) { - | Some({fieldOne: 20, fieldA: a}) => - // Where does this comment go? - let tmp = 0; - 2 + tmp; - | Some({fieldOne: n, fieldA: a}) => - // How about this one - let tmp = n; - n + tmp; - | None => 20 - }; - -let res = - // Before switch - switch (X(2, 3)) { - // Above X line - | X(_) => "result of X" // End of arrow and X line - // Above Y line - | Y(_) => "result of Y" // End of arrow and Y line - }; - -/* - * Now these end of line comments *should* be retained. - */ -let result = - switch (None) { - | Some({ - fieldOne: 20, // end of line - fieldA: a // end of line - }) => - let tmp = 0; - 2 + tmp; - | Some({ - fieldOne: n, // end of line - fieldA: a // end of line - }) => - let tmp = n; - n + tmp; - | None => 20 - }; - -/* - * These end of line comments *should* be retained. - * To get the simple expression eol comment to be retained, we just need to - * implement label breaking eol behavior much like we did with sequences. - * Otherwise, right now they are not idempotent. - */ -let res = - switch ( - // Retain this - X(2, 3) - ) { - // Above X line - | X( - _, // retain this - _ // retain this - ) => "result of X" - - // Above Y line - | Y(_) => "result of Y" // End of arrow and Y line - }; - -type optionalTuple = - | OptTup( - option( - ( - int, // First int - int // Second int - ), - ), - ); - -type optionTuple = - option( - ( - int, // First int - int // Second int - ), - ); - -type intPair = ( - int, // First int - int // Second int -); - -type intPair2 = ( - // First int - int, - // Second int - int, -); - -let result = - /**/ - { - 2 + 3; - }; - -// This is not yet idempotent -// { -// /**/ -// (+) 2 3 -// }; - -let a = (); -for (i in 0 to 10) { - // bla - a; -}; - -if (true) { - // hello - () -}; - -type color = - | Red(int) // After red end of line - | Black(int) // After black end of line - | Green(int); // After green end of line -// On next line after color type def - -let blahCurriedX = x => - fun - | Red(10) - | Black(20) - | Green(10) => 1 // After or pattern green - | Red(x) => 0 // After red - | Black(x) => 0 // After black - | Green(x) => 0; // After second green -// On next line after blahCurriedX def - -let name_equal = (x, y) => { - x == y; -}; - -let equal = (i1, i2) => - i1.contents === i2.contents && true; // most unlikely first - -let equal = (i1, i2) => - compare(compare(0, 0), compare(1, 1)); // END OF LINE HERE - -let tuple_equal = ((i1, i2)) => i1 == i2; - -let tuple_equal = ((csu, mgd)) => - // Some really long comments, see https://github.com/facebook/reason/issues/811 - tuple_equal((csu, mgd)); - -/** Comments inside empty function bodies - * See https://github.com/facebook/reason/issues/860 - */ -let fun_def_comment_inline = () => {/* */}; - -let fun_def_comment_newline = () => { - // -}; - -let fun_def_comment_long = () => { - /* longer comment inside empty function body */ -}; - -let trueThing = true; - -for (i in 0 to 1) { - // comment - print_newline(); -}; - -while (trueThing) { - // comment - print_newline(); -}; - -if (trueThing) { - // comment - print_newline(); -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -} else { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment after final print -} else { - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); - // Comment after final print -}; - -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -} else { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment before print -} else { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); // eol - // Comment before print - print_newline(); // eol - // Comment after final print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); // eol - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); // eol - // Comment before print - print_newline(); // eol - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); // eol - // Comment after final print -}; - -let f = (a, b, c, d) => a + b + c + d; - -while (trueThing) { - f( - // a - 1, - // b - 2, - // c - 3, - // d - 4, - // does work - ); -}; -while (trueThing) { - f( - // a - 1, - // b - 2, - // c - 3, - // d - 4 // does work - ); -}; - -ignore( - ( - _really, - _long, - _printWidth, - _exceeded, - _here, - ) => { - // First comment - let x = 0; - x + x; - // Closing comment -}); - -ignore((_xxx, _yyy) => { - // First comment - let x = 0; - x + x; - // Closing comment -}); - -type tester('a, 'b) = - | TwoArgsConstructor('a, 'b) - | OneTupleArgConstructor(('a, 'b)); -let callFunctionTwoArgs = (a, b) => (); -let callFunctionOneTuple = tuple => (); - -let y = - TwoArgsConstructor( - 1, //eol1 - 2 // eol2 - ); - -let y = - callFunctionTwoArgs( - 1, //eol1 - 2 // eol2 - ); - -let y = - OneTupleArgConstructor(( - 1, //eol1 - 2 // eol2 - )); - -let y = - callFunctionOneTuple(( - 1, //eol1 - 2 // eol2 - )); - -type polyRecord('a, 'b) = { - fieldOne: 'a, - fieldTwo: 'b, -}; - -let r = { - fieldOne: 1, //eol1 - fieldTwo: 2 // eol2 -}; - -let r = { - fieldOne: 1, //eol1 - fieldTwo: 2 // eol2 with trailing comma -}; - -let y = - TwoArgsConstructor( - "1", //eol1 - "2" // eol2 - ); - -let y = - callFunctionTwoArgs( - "1", //eol1 - "2" // eol2 - ); - -let y = - OneTupleArgConstructor(( - "1", //eol1 - "2" // eol2 - )); - -let y = - callFunctionOneTuple(( - "1", //eol1 - "2" // eol2 - )); - -let r = { - fieldOne: "1", //eol1 - fieldTwo: "2" // eol2 -}; - -let r = { - fieldOne: "1", //eol1 - fieldTwo: "2" // eol2 with trailing comma -}; - -let identifier = "hello"; - -let y = - TwoArgsConstructor( - identifier, //eol1 - identifier // eol2 - ); - -let y = - callFunctionTwoArgs( - identifier, //eol1 - identifier // eol2 - ); - -let y = - OneTupleArgConstructor(( - identifier, //eol1 - identifier // eol2 - )); - -let y = - callFunctionOneTuple(( - identifier, //eol1 - identifier // eol2 - )); - -let r = { - fieldOne: identifier, //eol1 - fieldTwo: identifier // eol2 -}; - -let r = { - fieldOne: identifier, //eol1 - fieldTwo: identifier // eol2 with trailing comma -}; - -let y = - TwoArgsConstructor( - identifier: string, //eol1 - identifier: string // eol2 - ); - -let y = - callFunctionTwoArgs( - identifier: string, //eol1 - identifier: string // eol2 - ); - -let y = - OneTupleArgConstructor(( - identifier: string, //eol1 - identifier: string // eol2 - )); - -let y = - callFunctionOneTuple(( - identifier: string, //eol1 - identifier: string // eol2 - )); - -let r = { - fieldOne: (identifier: string), //eol1 - fieldTwo: (identifier: string) // eol2 -}; - -let r = { - fieldOne: (identifier: string), //eol1 - fieldTwo: (identifier: string) // eol2 with trailing comma -}; - -// whitespace interleaving - -// comment1 -// comment2 - -// whitespace above & below - -let r = { - fieldOne: (identifier: string), //eol1 - // c1 - - // c2 - - // c3 - // c4 - - // c5 - fieldTwo: (identifier: string) // eol2 with trailing comma -}; -// trailing - -// trailing whitespace above -// attach - -// last comment diff --git a/formatTest/unit_tests/expected_output/modules.re b/formatTest/unit_tests/expected_output/modules.re deleted file mode 100644 index 717ea6b73..000000000 --- a/formatTest/unit_tests/expected_output/modules.re +++ /dev/null @@ -1,646 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = () => { - TestUtils.printSection("Modules"); -}; - -/** - * Modules: - * ---------------------------------------------------------------------------- - * Modules accomplish the following: - * - Organization of code and data. - * - Basis for separate compilation and fast compile times. - * - Enabled higher order type abstractions that are capable of modelling very - * sophisticated typing relationships between various parts of your code. - * - * Modules are much like records, but much more powerful. Much of modules' - * powers are derived from the fact that they are primarily built up and - * organized at compilation time, instead of runtime. It is this constraint - * that allows modules to be more powerful than simple records. - * - * There are some important ways that modules differ from records: - * - * - Fields are lexically scoped: In the following record: `{x:1, y: x + x}`, - * the reference to `x` does not refer to the record field `x`. This is because - * records fields do not form lexical scopes for the evaluation of other record - * values. Modules, on the other hand do allow fields to reference other - * fields. Appropriately, each field is introduced via the keyword `let`. - */ -module MyFirstModule = { - let x = 0; - let y = x + x; -}; - -let result = MyFirstModule.x + MyFirstModule.y; - -/** - * - A module is introduced with the `module` phrase. - * - A module *must* have a capital letter as its first character. - * - The exported fields of a module must be listed within `{}` braces and each - * exported value binding is specified via a `let` keyword. - */ -/** - * Another way that modules are more powerful than records, is that they may - * also export types. - */ -module MySecondModule = { - type someType = int; - let x = 0; - let y = x + x; -}; - -let myInt: MySecondModule.someType = 100; - -/** Module signatures: - * ---------------------------------------------------------------------------- - * Not only may modules export types, but modules *themselves* can be described - * by types via the `module type` phrase. We call these module types - * "signatures". For example, `MySecondModule` has the following `module type` - * signature: - */ -module type MySecondModuleType = { - type someType = int; - let x: int; - let y: int; -}; - -/** - * Much like how you can ensure that a value is compatible with a specific - * type: - - let myTestVal: int = 10; - - * You can also perform the same type of annotation to ensure that you have - * written code that matches your understanding. For example, `MySecondModule` - * could have been written as: - - module MySecondModule: MySecondModuleType = { - type someType = int; - let x = 0; - let y = x + x; - }; - */ - -/** - * - Modules may be artificially "constrained" so that users of a module see - * fewer details than are actually present. - * - Modules may be combined, merged, and transformed at compile time in ways - * that - * - Because they are more powerful, they may not be passed around at runtime - * as easily as records. - * - * Some additioal benefits to using modules: - * - Modules are a very elegant way to organize large packages of code. - * - Modules are the unit of compilation. Minimal recompilation changes - * - Modules can help you achieve higher degrees of polymorphism than the core - * language. - */ - -let opensAModuleLocally = { - module MyLocalModule = { - type i = int; - let x: i = 10; - }; - /* Notice how local modules names may be used twice and are shadowed */ - module MyLocalModule: MySecondModuleType = { - type someType = int; - let x: someType = 10; - let y: someType = 20; - }; - let tmp = MyLocalModule.x + 22; - tmp + 30; -}; - -module type HasTT = {type tt;}; - -module SubModule: HasTT = { - type tt = int; -}; - -module type HasEmbeddedHasTT = { - module SubModuleThatHasTT = SubModule; -}; - -module type HasPolyType = {type t('a);}; - -module type HasDestructivelySubstitutedPolyType = - HasPolyType with type t('a) := list('a); - -module type HasDestructivelySubstitutedSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int); */ - module X: HasDestructivelySubstitutedPolyType; -}; -module type HasSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int); */ - module X: HasPolyType; -}; - -module EmbedsSubPolyModule: HasSubPolyModule = { - module X = { - type t('a) = list('a); - }; -}; - -module EmbedsDestructivelySubstitutedPolyModule: - HasDestructivelySubstitutedSubPolyModule = { - module X = { - type t = list(int, int); - }; -}; - -module type HasMultiPolyType = { - type substituteThis('a, 'b); - type substituteThat('a, 'b); -}; - -module type HasDestructivelySubstitutedMultiPolyType = - HasMultiPolyType with - type substituteThis('a, 'b) := - Hashtbl.t('a, 'b) and - type substituteThat('a, 'b) := - Hashtbl.t('a, 'b); - -module InliningSig: { - let x: int; - let y: int; -} = { - /* - * Comment inside of signature. - */ - let x = 10; - /* Inline comment inside signature. */ - let y = 20; -}; - -module MyFunctor = (M: HasTT) => { - type reexportedTT = M.tt; - /* Inline comment inside module. */ - /** Following special comment inside module. */ - let someValue = 1000; -}; - -/* Notice how - - Functors no longer require parens around argument. - - A final semicolon is required for module structures. - - We should eliminate both those requirements. See action items 13-14 at the - bottom of this file. [Actually, forgiving the trailing SEMI might not be - such a great idea]. - */ -module MyFunctorResult = - MyFunctor({ - type tt = string; - }); - -module LookNoParensNeeded = - MyFunctor({ - type tt = string; - }); - -module type SigResult = {let result: int;}; - -module type ASig = {let a: int;}; -module type BSig = {let b: int;}; -module AMod = { - let a = 10; -}; -module BMod = { - let b = 10; -}; - -module CurriedSugar = (A: ASig, B: BSig) => { - let result = A.a + B.b; -}; - -/* Right now [CurriedSuperSugar] is parsed as being indistinguishable from - the above. - - module CurriedSuperSugar (A:ASig) (B:BSig): SigResult => ({ - let result = A.a + B.b; - }: SigResult); - - /* Not supported in OCaml OR Reason (Edit: now supported in OCaml for functions) */ - let x = fun (a:foo) :bar => baz; - module x = fun (A:Foo) :Bar => Baz; - - /* Supported in both OCaml and Reason */ - let x (a:foo) :bar => baz; - module x (A:Foo) :Bar => Baz; - - */ -module CurriedSugarWithReturnType = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; -}; - -/* This is parsed as being equivalent to the above example */ -module CurriedSugarWithAnnotatedReturnVal = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; -}; - -module CurriedNoSugar = (A: ASig, B: BSig) => { - let result = A.a + B.b; -}; - -let letsTryThatSyntaxInLocalModuleBindings = () => { - module CurriedSugarWithReturnType = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; - }; - module CurriedSugarWithAnnotatedReturnVal = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; - }; - - module CurriedNoSugar = (A: ASig, B: BSig) => { - let result = A.a + B.b; - }; - - /* - * The following doesn't work in OCaml (LocalModule (struct end)).x isn't even - * parsed! - * - * let thisDoesntWorkInOCaml () = - * module LocalModule(A:sig end) = struct let x = 10 end in - * module Out = (LocalModule (struct end)) in - * let outVal = (LocalModule (struct end)).x in - * let res = Out.x in - * res;; - */ - - module TempModule = - CurriedNoSugar(AMod, BMod); - module TempModule2 = - CurriedSugarWithAnnotatedReturnVal( - AMod, - BMod, - ); - TempModule.result + TempModule2.result; -}; - -module type EmptySig = {}; -module MakeAModule = (X: EmptySig) => { - let a = 10; -}; -module CurriedSugarFunctorResult = - CurriedSugar(AMod, BMod); -module CurriedSugarFunctorResultInline = - CurriedSugar( - { - let a = 10; - }, - { - let b = 10; - }, - ); -module CurriedNoSugarFunctorResult = - CurriedNoSugar(AMod, BMod); -module CurriedNoSugarFunctorResultInline = - CurriedNoSugar( - { - let a = 10; - }, - { - let b = 10; - }, - ); - -module ResultFromNonSimpleFunctorArg = - CurriedNoSugar( - ( - MakeAModule({}) - ), - BMod, - ); - -/* TODO: Functor type signatures should more resemble value signatures */ -let curriedFunc: (int, int) => int = - (a, b) => a + b; -module type FunctorType = - (ASig, BSig) => SigResult; -/* Which is sugar for:*/ -module type FunctorType2 = - (ASig, BSig) => SigResult; - -/* Just for compability with existing OCaml ASTs you can put something other - * than an underscore */ -module type FunctorType3 = - (Blah: ASig, ThisIsIgnored: BSig) => SigResult; - -/* The actual functors themselves now have curried sugar (which the pretty - * printer will enforce as well */ -/* The following: */ -module CurriedSugarWithAnnotation2: - (ASig, BSig) => SigResult = - (A: ASig, B: BSig) => { - let result = A.a + B.b; - }; - -/* Becomes: */ -module CurriedSugarWithAnnotation: - (ASig, BSig) => SigResult = - (A: ASig, B: BSig) => { - let result = A.a + B.b; - }; - -/* "functors" that are not in sugar curried form cannot annotate a return type - * for now, so we settle for: */ -module CurriedSugarWithAnnotationAndReturnAnnotated: - (ASig, BSig) => SigResult = - (A: ASig, B: BSig) => ( - { - let result = A.a + B.b; - }: - SigResult - ); - -module ReturnsAFunctor = - (A: ASig, B: BSig) - : ((ASig, BSig) => SigResult) => - (A: ASig, B: BSig) => { - let result = 10; - }; - -module ReturnsSigResult = - (A: ASig, B: BSig) - : SigResult => { - let result = 10; -}; - -module ReturnsAFunctor2 = - (A: ASig, B: BSig) - : ((ASig, BSig) => SigResult) => - (A: ASig, B: BSig) => { - let result = 10; - }; - -/* - * Recursive modules. - * TODO: Test [Psig_recmodule] - */ -module rec A: { - type t = - | Leaf(string) - | Node(ASet.t); - let compare: (t, t) => int; -} = { - type t = - | Leaf(string) - | Node(ASet.t); - let compare = (t1, t2) => - switch (t1, t2) { - | (Leaf(s1), Leaf(s2)) => - Pervasives.compare(s1, s2) - | (Leaf(_), Node(_)) => 1 - | (Node(_), Leaf(_)) => (-1) - | (Node(n1), Node(n2)) => - ASet.compare(n1, n2) - }; -} -and ASet: Set.S with type elt = A.t = - Set.Make(A); - -/* - * How recursive modules appear in signatures. - */ -module type HasRecursiveModules = { - module rec A: { - type t = - | Leaf(string) - | Node(ASet.t); - let compare: (t, t) => int; - } - and ASet: Set.S with type elt = A.t; -}; - -/* From http://stackoverflow.com/questions/1986374/higher-order-type-constructors-and-functors-in-ocaml */ -module type Type = {type t;}; -module Char = { - type t = char; -}; -module List = (X: Type) => { - type t = list(X.t); -}; -module Maybe = (X: Type) => { - type t = option(X.t); -}; -module Id = (X: Type) => X; -module Compose = - ( - F: (Type) => Type, - G: (Type) => Type, - X: Type, - ) => - F((G(X))); -let l: Compose(List)(Maybe)(Char).t = [ - Some('a'), -]; -module Example2 = (F: (Type) => Type, X: Type) => { - /** - * Note: This is the one remaining syntactic issue where - * modules/functions do not have syntax unified with values. - * It should be: - * - * let iso (a:(Compose Id F X).t): (F X).t => a; - * - */ - let iso = (a: Compose(Id)(F)(X).t): F(X).t => a; -}; - -Printf.printf( - "\nModules And Functors: %n\n", - CurriedNoSugarFunctorResultInline.result, -); - -/* We would have: */ -/* module CurriedSugarWithAnnotation: ASig => BSig => SigResult = - fun (A:ASig) (B:BSig) => {let result = A.a + B.b;; */ - -/* - module Typeahead = React.Create { - type props = {initialCount: int}; - type state = {count: int}; - let getInitialState props => {count: 10}; - let render {props, state} => -
- -
; - }; - */ - -include YourLib.CreateComponent({ - type thing = blahblahblah; - type state = unit; - let getInitialState = _ => (); - let myValue = {recordField: "hello"}; -}); - -module type HasInt = {let x: int;}; - -module MyModule = { - let x = 10; -}; - -let myFirstClass: module HasInt = - (module MyModule); - -let myFirstClassWillBeFormattedAs: module HasInt = - (module MyModule); - -let acceptsAndUnpacksFirstClass = - (module M: HasInt) => - M.x + M.x; - -let acceptsAndUnpacksFirstClass = - (module M: HasInt) => - M.x + M.x; - -module SecondClass = (val myFirstClass); - -module SecondClass2 = ( - val (module MyModule): HasInt -); - -let p = SecondClass.x; - -/* Opening Modules */ -module M = { - module Inner = {}; -}; - -module N = { - open M; - let z = { - M.(34); - }; - let z = { - open M; - 34; - 35; - }; - let z = { - M.(34, 35); - }; - let z = M.(34, 35); - let z = M.(34, 35); - let z = { - M.{}; - }; - let z = M.{}; - let z = M.{}; - let z = { - M.{x: 10}; - }; - let z = { - M.[foo, bar]; - }; - let z = { - M.[foo, bar]; - }; - let z = { - M.{x: 10, y: 20}; - }; - let z = { - M.(M2.(value)); - }; - let z = { - M.(M2.value); - }; - let z = { - open! M; - 34; - }; - let z = { - open! M; - 34; - 35; - }; - let z = { - open! M; - {}; - }; - let z = { - open! M; - {x: 10}; - }; - let z = { - open! M; - [foo, bar]; - }; - let z = { - open! M; - [foo, bar]; - }; - let z = { - open! M; - {x: 10, y: 20}; - }; - let z = { - open! M; - open! M2; - value; - }; - let z = { - open! M; - M2.value; - }; - let y = 44; -}; - -open M; -open M.Inner; -open M; - -module OldModuleSyntax = { - module InnerOldModule = {}; -}; - -module type SigWithModuleTypeOf = { - module type ModuleType; - include (module type of String); - include (module type of Array); -}; - -module type T = t with type t = a => a; -module type T = t with type t = a => a; -module type T = (t with type t = a) => a; - -module X = [%test extension]; -module type T = [%test extension]; - -let foo = - (type a, module X: X_t with type t = a) => X.a; - -let f = - (module M: M with type x = x and type y = y) => M.x; - -let foo = - ( - module X: - X_t with - type t = a and - type s = a and - type z = a, - module Y: Y_t with type t = a, - module Z: Z_t with type t = a, - ) => X.a; - -/* https://github.com/facebook/reason/issues/2028 */ -M.[]; - -module type Event = (module type of { - include ReactEventRe; -}); - -include (Version2: (module type of Version2)); - -/* https://github.com/facebook/reason/issues/2608 */ -module Functor = - (()) - : (module type of {}) => {}; diff --git a/formatTest/unit_tests/expected_output/modules_no_semi.re b/formatTest/unit_tests/expected_output/modules_no_semi.re deleted file mode 100644 index 432bf12fa..000000000 --- a/formatTest/unit_tests/expected_output/modules_no_semi.re +++ /dev/null @@ -1,651 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = () => { - TestUtils.printSection("Modules"); -}; - -/** - * Modules: - * ---------------------------------------------------------------------------- - * Modules accomplish the following: - * - Organization of code and data. - * - Basis for separate compilation and fast compile times. - * - Enabled higher order type abstractions that are capable of modelling very - * sophisticated typing relationships between various parts of your code. - * - * Modules are much like records, but much more powerful. Much of modules' - * powers are derived from the fact that they are primarily built up and - * organized at compilation time, instead of runtime. It is this constraint - * that allows modules to be more powerful than simple records. - * - * There are some important ways that modules differ from records: - * - * - Fields are lexically scoped: In the following record: `{x:1, y: x + x}`, - * the reference to `x` does not refer to the record field `x`. This is because - * records fields do not form lexical scopes for the evaluation of other record - * values. Modules, on the other hand do allow fields to reference other - * fields. Appropriately, each field is introduced via the keyword `let`. - */ -module MyFirstModule = { - let x = 0; - let y = x + x; -}; - -let result = MyFirstModule.x + MyFirstModule.y; - -/** - * - A module is introduced with the `module` phrase. - * - A module *must* have a capital letter as its first character. - * - The exported fields of a module must be listed within `{}` braces and each - * exported value binding is specified via a `let` keyword. - */ -/** - * Another way that modules are more powerful than records, is that they may - * also export types. - */ -module MySecondModule = { - type someType = int; - let x = 0; - let y = x + x; -}; - -let myInt: MySecondModule.someType = 100; - -/** Module signatures: - * ---------------------------------------------------------------------------- - * Not only may modules export types, but modules *themselves* can be described - * by types via the `module type` phrase. We call these module types - * "signatures". For example, `MySecondModule` has the following `module type` - * signature: - */ -module type MySecondModuleType = { - type someType = int; - let x: int; - let y: int; -}; - -/** - * Much like how you can ensure that a value is compatible with a specific - * type: - - let myTestVal: int = 10 - - * You can also perform the same type of annotation to ensure that you have - * written code that matches your understanding. For example, `MySecondModule` - * could have been written as: - - module MySecondModule: MySecondModuleType = { - type someType = int - let x = 0 - let y = x + x - } - */ - -/** - * - Modules may be artificially "constrained" so that users of a module see - * fewer details than are actually present. - * - Modules may be combined, merged, and transformed at compile time in ways - * that - * - Because they are more powerful, they may not be passed around at runtime - * as easily as records. - * - * Some additioal benefits to using modules: - * - Modules are a very elegant way to organize large packages of code. - * - Modules are the unit of compilation. Minimal recompilation changes - * - Modules can help you achieve higher degrees of polymorphism than the core - * language. - */ - -let opensAModuleLocally = { - module MyLocalModule = { - type i = int; - let x: i = 10; - }; - /* Notice how local modules names may be used twice and are shadowed */ - module MyLocalModule: MySecondModuleType = { - type someType = int; - let x: someType = 10; - let y: someType = 20; - }; - let tmp = MyLocalModule.x + 22; - tmp + 30; -}; - -module type HasTT = {type tt;}; - -module SubModule: HasTT = { - type tt = int; -}; - -module type HasEmbeddedHasTT = { - module SubModuleThatHasTT = SubModule; -}; - -module type HasPolyType = {type t('a);}; - -module type HasDestructivelySubstitutedPolyType = - HasPolyType with type t('a) := list('a); - -module type HasDestructivelySubstitutedSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int) */ - module X: HasDestructivelySubstitutedPolyType; -}; -module type HasSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int) */ - module X: HasPolyType; -}; - -module EmbedsSubPolyModule: HasSubPolyModule = { - module X = { - type t('a) = list('a); - }; -}; - -module EmbedsDestructivelySubstitutedPolyModule: - HasDestructivelySubstitutedSubPolyModule = { - module X = { - type t = list(int, int); - }; -}; - -module type HasMultiPolyType = { - type substituteThis('a, 'b); - type substituteThat('a, 'b); -}; - -module type HasDestructivelySubstitutedMultiPolyType = - HasMultiPolyType with - type substituteThis('a, 'b) := - Hashtbl.t('a, 'b) and - type substituteThat('a, 'b) := - Hashtbl.t('a, 'b); - -module InliningSig: { - let x: int; - let y: int; -} = { - /* - * Comment inside of signature. - */ - let x = 10; - /* Inline comment inside signature. */ - let y = 20; -}; - -module MyFunctor = (M: HasTT) => { - type reexportedTT = M.tt; - /* Inline comment inside module. */ - /** Following special comment inside module. */ - let someValue = 1000; -}; - -/* Notice how - - Functors no longer require parens around argument. - - A final semicolon is required for module structures. - - We should eliminate both those requirements. See action items 13-14 at the - bottom of this file. [Actually, forgiving the trailing SEMI might not be - such a great idea]. - */ -module MyFunctorResult = - MyFunctor({ - type tt = string; - }); - -module LookNoParensNeeded = - MyFunctor({ - type tt = string; - }); - -module type SigResult = {let result: int;}; - -module type ASig = {let a: int;}; -module type BSig = {let b: int;}; -module AMod = { - let a = 10; -}; -module BMod = { - let b = 10; -}; - -module CurriedSugar = (A: ASig, B: BSig) => { - let result = A.a + B.b; -}; - -/* Right now [CurriedSuperSugar] is parsed as being indistinguishable from - the above. - - module CurriedSuperSugar (A:ASig) (B:BSig): SigResult => ({ - let result = A.a + B.b - }: SigResult) - - /* Not supported in OCaml OR Reason (Edit: now supported in OCaml for functions) */ - let x = fun (a:foo) :bar => baz - module x = fun (A:Foo) :Bar => Baz - - /* Supported in both OCaml and Reason */ - let x (a:foo) :bar => baz - module x (A:Foo) :Bar => Baz - - */ -module CurriedSugarWithReturnType = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; -}; - -/* This is parsed as being equivalent to the above example */ -module CurriedSugarWithAnnotatedReturnVal = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; -}; - -module CurriedNoSugar = (A: ASig, B: BSig) => { - let result = A.a + B.b; -}; - -let letsTryThatSyntaxInLocalModuleBindings = () => { - module CurriedSugarWithReturnType = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; - }; - module CurriedSugarWithAnnotatedReturnVal = - (A: ASig, B: BSig) - : SigResult => { - let result = A.a + B.b; - }; - - module CurriedNoSugar = (A: ASig, B: BSig) => { - let result = A.a + B.b; - }; - - /* - * The following doesn't work in OCaml (LocalModule (struct end)).x isn't even - * parsed! - * - * let thisDoesntWorkInOCaml () = - * module LocalModule(A:sig end) = struct let x = 10 end in - * module Out = (LocalModule (struct end)) in - * let outVal = (LocalModule (struct end)).x in - * let res = Out.x in - * res - */ - - module TempModule = - CurriedNoSugar(AMod, BMod); - module TempModule2 = - CurriedSugarWithAnnotatedReturnVal( - AMod, - BMod, - ); - TempModule.result + TempModule2.result; -}; - -module type EmptySig = {}; -module MakeAModule = (X: EmptySig) => { - let a = 10; -}; -module CurriedSugarFunctorResult = - CurriedSugar(AMod, BMod); -module CurriedSugarFunctorResultInline = - CurriedSugar( - { - let a = 10; - }, - { - let b = 10; - }, - ); -module CurriedNoSugarFunctorResult = - CurriedNoSugar(AMod, BMod); -module CurriedNoSugarFunctorResultInline = - CurriedNoSugar( - { - let a = 10; - }, - { - let b = 10; - }, - ); - -module ResultFromNonSimpleFunctorArg = - CurriedNoSugar( - ( - MakeAModule({}) - ), - BMod, - ); - -/* TODO: Functor type signatures should more resemble value signatures */ -let curriedFunc: (int, int) => int = - (a, b) => a + b; -module type FunctorType = - (ASig, BSig) => SigResult; -/* Which is sugar for:*/ -module type FunctorType2 = - (ASig, BSig) => SigResult; - -/* Just for compability with existing OCaml ASTs you can put something other - * than an underscore */ -module type FunctorType3 = - (Blah: ASig, ThisIsIgnored: BSig) => SigResult; - -/* The actual functors themselves now have curried sugar (which the pretty - * printer will enforce as well */ -/* The following: */ -module CurriedSugarWithAnnotation2: - (ASig, BSig) => SigResult = - (A: ASig, B: BSig) => { - let result = A.a + B.b; - }; - -/* Becomes: */ -module CurriedSugarWithAnnotation: - (ASig, BSig) => SigResult = - (A: ASig, B: BSig) => { - let result = A.a + B.b; - }; - -/* "functors" that are not in sugar curried form cannot annotate a return type - * for now, so we settle for: */ -module CurriedSugarWithAnnotationAndReturnAnnotated: - (ASig, BSig) => SigResult = - (A: ASig, B: BSig) => ( - { - let result = A.a + B.b; - }: - SigResult - ); - -module ReturnsAFunctor = - (A: ASig, B: BSig) - : ((ASig, BSig) => SigResult) => - (A: ASig, B: BSig) => { - let result = 10; - }; - -module ReturnsSigResult = - (A: ASig, B: BSig) - : SigResult => { - let result = 10; -}; - -module ReturnsAFunctor2 = - (A: ASig, B: BSig) - : ((ASig, BSig) => SigResult) => - (A: ASig, B: BSig) => { - let result = 10; - }; - -/* - * Recursive modules. - * TODO: Test [Psig_recmodule] - */ -module rec A: { - type t = - | Leaf(string) - | Node(ASet.t); - let compare: (t, t) => int; -} = { - type t = - | Leaf(string) - | Node(ASet.t); - let compare = (t1, t2) => - switch (t1, t2) { - | (Leaf(s1), Leaf(s2)) => - Pervasives.compare(s1, s2) - | (Leaf(_), Node(_)) => 1 - | (Node(_), Leaf(_)) => (-1) - | (Node(n1), Node(n2)) => - ASet.compare(n1, n2) - }; -} -and ASet: Set.S with type elt = A.t = - Set.Make(A); - -/* - * How recursive modules appear in signatures. - */ -module type HasRecursiveModules = { - module rec A: { - type t = - | Leaf(string) - | Node(ASet.t); - let compare: (t, t) => int; - } - and ASet: Set.S with type elt = A.t; -}; - -/* From http://stackoverflow.com/questions/1986374/higher-order-type-constructors-and-functors-in-ocaml */ -module type Type = {type t;}; -module Char = { - type t = char; -}; -module List = (X: Type) => { - type t = list(X.t); -}; -module Maybe = (X: Type) => { - type t = option(X.t); -}; -module Id = (X: Type) => X; -module Compose = - ( - F: (Type) => Type, - G: (Type) => Type, - X: Type, - ) => - F((G(X))); -let l: Compose(List)(Maybe)(Char).t = [ - Some('a'), -]; -module Example2 = (F: (Type) => Type, X: Type) => { - /** - * Note: This is the one remaining syntactic issue where - * modules/functions do not have syntax unified with values. - * It should be: - * - * let iso (a:(Compose Id F X).t): (F X).t => a - * - */ - let iso = (a: Compose(Id)(F)(X).t): F(X).t => a; -}; - -Printf.printf( - "\nModules And Functors: %n\n", - CurriedNoSugarFunctorResultInline.result, -); - -/* We would have: */ -/* module CurriedSugarWithAnnotation: ASig => BSig => SigResult = - fun (A:ASig) (B:BSig) => {let result = A.a + B.b} */ - -/* - module Typeahead = React.Create { - type props = {initialCount: int} - type state = {count: int} - let getInitialState props => {count: 10} - let render {props, state} => -
- -
- } - */ - -include YourLib.CreateComponent({ - type thing = blahblahblah; - type state = unit; - let getInitialState = _ => (); - let myValue = {recordField: "hello"}; -}); - -module type HasInt = {let x: int;}; - -module MyModule = { - let x = 10; -}; - -let myFirstClass: module HasInt = - (module MyModule); - -let myFirstClassWillBeFormattedAs: module HasInt = - (module MyModule); - -let acceptsAndUnpacksFirstClass = - (module M: HasInt) => - M.x + M.x; - -let acceptsAndUnpacksFirstClass = - (module M: HasInt) => - M.x + M.x; - -module SecondClass = (val myFirstClass); - -module SecondClass2 = ( - val (module MyModule): HasInt -); - -let p = SecondClass.x; - -/* Opening Modules */ -module M = { - module Inner = {}; -}; - -module N = { - open M; - let z = { - M.(34); - }; - let z = { - open M; - 34; - 35; - }; - let z = { - M.(34, 35); - }; - let z = M.(34, 35); - let z = M.(34, 35); - let z = { - M.{}; - }; - let z = M.{}; - let z = M.{}; - let z = { - M.{x: 10}; - }; - let z = { - M.[foo, bar]; - }; - let z = { - M.[foo, bar]; - }; - let z = { - M.{x: 10, y: 20}; - }; - let z = { - M.(M2.(value)); - }; - let z = { - M.(M2.value); - }; - let z = { - open! M; - 34; - }; - let z = { - open! M; - 34; - 35; - }; - let z = { - open! M; - {}; - }; - let z = { - open! M; - {x: 10}; - }; - let z = { - open! M; - [foo, bar]; - }; - let z = { - open! M; - [foo, bar]; - }; - let z = { - open! M; - {x: 10, y: 20}; - }; - let z = { - open! M; - open! M2; - value; - }; - let z = { - open! M; - M2.value; - }; - let y = 44; -}; - -open M; -open M.Inner; -open M; - -module OldModuleSyntax = { - module InnerOldModule = {}; -}; - -module type SigWithModuleTypeOf = { - module type ModuleType; - include (module type of String); - include (module type of Array); -}; - -module type T = t with type t = a => a; -module type T = t with type t = a => a; -module type T = (t with type t = a) => a; - -module X = [%test extension]; -module type T = [%test extension]; - -let foo = - (type a, module X: X_t with type t = a) => X.a; - -let f = - (module M: M with type x = x and type y = y) => M.x; - -let test = b => { - if (b) { - ignore(); - }; - - while (x) { - compute(); - }; - - try(x()) { - | _ => log() - }; - - switch (test) { - | A => () - | B => () - }; - - for (x in 0 to 10) { - print_int(x); - print_string(" "); - }; - - assert(true); - - lazy(true); - - Fun.ignore(); -}; diff --git a/formatTest/unit_tests/expected_output/object.re b/formatTest/unit_tests/expected_output/object.re deleted file mode 100644 index 38af64c49..000000000 --- a/formatTest/unit_tests/expected_output/object.re +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type t = {.}; - -type t = { - . - u: int, - v: int, -}; - -type t = {.. u: int}; - -type t = {.. u: int}; - -type t = {..}; - -type t = {..}; - -let (<..>) = (a, b) => a + b; -let five = 2 <..> 3; - -type closedObjSugar = { - . - "foo": bar, - "baz": int, -}; - -type openObjSugar = { - .. - "x": int, - "y": int, -}; - -type x = Js.t({.}); - -type y = Js.t({..}); - -/* #1595: always break object rows (>= 2) for readability */ -type o = { - . - a: int, - b: int, -}; - -type o2 = { - .. - a: int, - b: int, -}; - -let obj = {as _; [@foo] val a = 1}; - -/* Oinherit (https://github.com/ocaml/ocaml/pull/1118) */ -type t1 = { - . - n: string, - ...t, -}; - -type t1 = { - .. - n: string, - ...t, -}; - -type g1 = { - . - n: string, - ...t, - ...y, -}; - -type g2 = { - . - n: string, - ...t, - ...y, -}; - -type m1 = {. ...M.t}; -type m2('a) = { - . - n: string, - ...M.t('a), -}; diff --git a/formatTest/unit_tests/expected_output/ocaml_identifiers.re b/formatTest/unit_tests/expected_output/ocaml_identifiers.re deleted file mode 100644 index 78b5ca0b1..000000000 --- a/formatTest/unit_tests/expected_output/ocaml_identifiers.re +++ /dev/null @@ -1,111 +0,0 @@ -/* Type names (supported with PR#2342) */ -module T = { - type pub_ = unit; -}; - -/* Value names (already supported) */ -module V = { - let method = (); -}; - -/* Record fields */ -module R = { - type r = {mutable method_: int}; - - let foo = {method_: 4}; - - let x = foo.method_; - - let () = foo.method_ = 42; - - let y = - switch (foo) { - | {method_: method} => method - }; - - let z = - switch (foo) { - | {method_: 12} => 21 - }; -}; - -/* Class names and instance variables */ -module C = { - class pub_ = { - as _; - }; - - class c = { - as _; - val pub_ = 0; - pub method = () => (); - }; - - class c' = { - as _; - inherit class method; - val! pub_ = 1; - }; -}; - -/* Class types */ -module Ct = { - class type method = { - val method: unit => unit; - }; -}; - -/* Virtual */ -module Cv = { - class virtual method = { - as _; - }; -}; - -/* Object methods */ -module O = { - let o = {as _; pub method = ()}; -}; - -/* Function parameter labels */ -module L = { - let f = (~method_ as method) => - ignore(method); -}; - -/* Module types */ -module type method = {}; - -/* Polymorphic variants (probably ok as-is?) */ -module P = { - type t = [ | `pub_ | `method]; - - let x = `method; - - let () = (`method) => 34; -}; - -type method = string; - -[@some_attr: type_] -[@other_attr: method] -type foo = {method_: method}; - -let f = (~method_ as method) => Js.log(method); - -let x = f(~method_="GET"); - -type marshalFields = {. "switch": string}; - -let testMarshalFields: marshalFields = { - "switch": "switch", -}; - -/* Not an identifier test, but this is testing OCaml -> RE */ -let x = - List.map(y => { - (); - y; - }); - -let newType = (type method, ()) => (); diff --git a/formatTest/unit_tests/expected_output/pexpFun.re b/formatTest/unit_tests/expected_output/pexpFun.re deleted file mode 100644 index 6c3091161..000000000 --- a/formatTest/unit_tests/expected_output/pexpFun.re +++ /dev/null @@ -1,89 +0,0 @@ -let x = - switch (x) { - | Bar => - ReasonReact.UpdateWithSideEffects( - {...state, click: click + 1}, - self => { - let _ = 1; - apply(bar); - }, - "foo", - ) - | Foo => () - }; - -let x = - switch (x) { - | Bar => - ReasonReact.UpdateWithSideEffects( - self => { - let _ = 1; - apply(bar); - }, - ) - | Foo => () - }; - -Mod.Update( - (acc, curr) => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update( - (acc, curr): string => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update( - [@foo] [@bar] (acc, curr) => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update( - [@foo] [@bar] curr => string_of_int(curr), - "", - lst, -); - -Mod.Update( - [@foo] [@bar] [@baz] [@something] [@do] curr => - string_of_int(curr), - "", - lst, -); - -Mod.Update( - ( - acc, - curr, - lkdjf, - lskdfj, - sdfljk, - slkdjf, - skdjf, - sdlkfj, - ): string => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update( - (acc, curr) => string_of_int(curr), - "", - lst, -); diff --git a/formatTest/unit_tests/expected_output/pipeFirst.re b/formatTest/unit_tests/expected_output/pipeFirst.re deleted file mode 100644 index f75535627..000000000 --- a/formatTest/unit_tests/expected_output/pipeFirst.re +++ /dev/null @@ -1,213 +0,0 @@ -foo->f->g->h; - -bar->f->g->h; - -foo(g)->f(a, b)->g(c, d); - -foo->f(); - -compilation -->Plugin.buildAssets -->Js.Json.stringify -->Node.Fs.writeFileAsUtf8Sync(_, path); - -foo -->someLongIdentifier -->otherLongIdentifierWithArgs(a, b, c) -->longIdentWithVeryLongArgs( - aaaaaaaaaaaaaaaaaaaaa, - bbbbbbbbbbbbbbbb, - ccccccccccccc, - ); - -/* with comments */ -compilation -/* first */ -->Plugin.buildAssets /* first trail */ -/* second */ -->Js.Json.stringify /* second trail */ -/* last */ -->Node.Fs.writeFileAsUtf8Sync(_, path); /* last trail */ - -foo->bar->baz >>= monadicFunction |> bind; - -compilation -->Plugin.buildAssets -->Js.Json.stringify -|> Cohttp_lwt_body.to_string ->|= ( - body => - Printf.sprintf( - "okokok", - uri, - meth, - headers, - body, - ) -) ->>= ( - body => - Server.respond_string(~status, ~body, ()) -); - -x + y + foo->bar->baz; -x + y * foo->bar->baz; -x && y || foo->bar->baz; - -x < foo->bar->baz; -foo !== bar->baz; -x |> y >>= foo->bar->baz; -let m = f => foo->bar->f; - -obj##x->foo->bar; - -event->target[0]; - -event->target[0]; - -event->target##value; - -event->target##value; - -event->target##value[0]; - -event->(target##value[0]); - -event->target(foo); - -event->(target(foo)); - -event->target(foo); - -event->(target(foo)); - -foo->bar := baz; - -foo->bar === baz; - -event->target##value(foo); - -event->target##(value(foo)); - -(foo^)->bar; - -location##streets.foo[1]; - -(event->target^)##value; - -event->target^ #= value; - -foo->f(. a, b); -foo->f(. a, b)->g(. c, d); -foo->([@attr] f(. a, b))->([@attr2] f(. a, b)); -foo->f(.); -foo->f(.)->g(.); -foo->([@attr] f(.))->([@attr] g(.)); - -("some-string" ++ "another")->more; -(-1)->foo; -- 1->foo; -!foo->bar; -(!foo)->bar; - -a->(b##c); - -a->b##c; - -( - switch (saveStatus) { - | Pristine => "" - | Saved => "Saved" - | Saving => "Saving" - | Unsaved => "Unsaved" - } -) -->str; - -
- ( - switch (saveStatus) { - | Pristine => "" - | Saved => "Saved" - | Saving => "Saving" - | Unsaved => "Unsaved" - } - ) - ->str -
; - -blocks->(blocks => {"blocks": blocks}); -
- blocks->(blocks => {"blocks": blocks}) -
; - -(state.title == "" ? "untitled" : state.title) -->str; - - - (state.title == "" ? "untitled" : state.title) - ->str -; - -ReasonReact.Router.watchUrl(url => - Route.urlToRoute(url)->ChangeView->(self.send) -); -ReasonReact.Router.watchUrl(url => - Route.urlToRoute(url)->ChangeView->self.send -); - -window->Webapi.Dom.Window.open_( - ~url, - ~name="authWindow", - ~features=params, -); - -window->Webapi.Dom.Window.open_( - ~url, - ~name="authWindow", - () => { - let x = 1; - let y = 2; - x + y; - }, -); - -reactClass->setNavigationOptions( - NavigationOptions.t( - ~title="Title", - ~gesturesEnabled=false, - (), - ), -); - -Foo.Bar.reactClass->setNavigationOptions( - NavigationOptions.t( - ~title="Title", - ~gesturesEnabled=false, - (), - ), -); - -foo##bar -->setNavigationOptions( - NavigationOptions.t( - ~title="Title", - ~gesturesEnabled=false, - (), - ), - ); - -
- {items - ->Belt.Array.map(ReasonReact.string) - ->ReasonReact.array} -
; - -a->(b->c); - -
{T.t("value")->ReasonReact.string}
; - -
{url->a(b, _)}
; -
{url->a(b, _)->a(b, _)}
; - -foo->Option.map(fn(_, arg)); diff --git a/formatTest/unit_tests/expected_output/polymorphism.re b/formatTest/unit_tests/expected_output/polymorphism.re deleted file mode 100644 index c14249c32..000000000 --- a/formatTest/unit_tests/expected_output/polymorphism.re +++ /dev/null @@ -1,113 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = () => { - TestUtils.printSection("Polymorphism"); -}; - -type myType('a) = list('a); -type myTwoParamType('a, 'b) = ('a, 'b); - -type myTupleType = (int, int); -type myPolymorphicTupleType('a) = ('a, 'a); - -type extensible('a) = 'a -constraint 'a = [ | `Base(int)]; - -type intListTranformer = - list(int) => list(int); - -type x = list(int, string); - -module HoldsAType = { - type hasPrime('a, 'b, 'c) = - Hashtbl.t(list('a), list('b)); -}; - -type myType2 = - myTwoParamType(myType(int => int), int) => - int; - -/* Confusing because => looks like part - of the return type signature. */ -let myFunc = - (a: int => int, b: int => int): myType(int) => [ - a(20) + b(30), -]; - -let myFunc = - (a: int => int, b: int => int) - : (myType(int) => myType(int)) => - lst => lst; - -let certainlyRequiresWrapping: - ( - option( - (Mod.handler(p, re), Mod.Types.handler), - ), - option( - ( - Mod.touch( - props, - (props, state), - resource, - ), - (list(Mod.t), list(Mod.t)), - ), - ), - list( - Mod.update( - props, - (props, state), - resource, - ), - ) - ) => - list( - Mod.update( - props, - (props, state), - resource, - ), - ) = - (); - -/* Because of the confusion in the last two examples, I believe we should - switch back to the `=` based syntax. - - let add a b = a + b; - - Pexp_function printing: - - Decide on either: - - let add Some (Hearts n) = n + n - | add Some (Diamonds n) = 0 - | add Some (Spades n) = 0 - | add None = 0 - | _ = 0 - - Or: - let add = x => match x with - | Some (Hearts n) => n + n - | Some (Diamonds n) => 0 - | Some (Spades n) => 0 - | None => 0 - | _ => 0 - - let add = - | Some (Hearts n) => n + n - | Some (Diamonds n) => 0 - | Some (Spades n) => 0 - | None => 0 - | _ => 0 - - let myFunc = (a:int) (b:int) => a + b; */ - -/* Fringe features */ - -/* - /* This parses, but doesn't type check */ - module TryExtendingType = {type t = Hello of string;}; - type TryExtendingType.t += LookANewExtension of string; - */ -"end"; diff --git a/formatTest/unit_tests/expected_output/sharpop.re b/formatTest/unit_tests/expected_output/sharpop.re deleted file mode 100644 index 2c17c48d8..000000000 --- a/formatTest/unit_tests/expected_output/sharpop.re +++ /dev/null @@ -1,23 +0,0 @@ -foo #= bar[0]; - -foo##bar[0] = 3; - -foo##bar[0]##baz[1] = 3; - -foo##bar[0]##baz[1]; - -foo##bar #= bar[0]; - -foo##bar##baz #= bar##baz[0]; - -foo[bar + 1]; - -foo.[bar + 1]; - -foo.{bar + 1}; - -foo.[bar + 1] = 1; - -foo.{bar + 1} = 1; - -foo[bar + 1] = 1; diff --git a/formatTest/unit_tests/expected_output/singleLineCommentEof.re b/formatTest/unit_tests/expected_output/singleLineCommentEof.re deleted file mode 100644 index 18f9b9683..000000000 --- a/formatTest/unit_tests/expected_output/singleLineCommentEof.re +++ /dev/null @@ -1 +0,0 @@ -// let x = 1 diff --git a/formatTest/unit_tests/expected_output/syntax.re b/formatTest/unit_tests/expected_output/syntax.re deleted file mode 100644 index 570d3d9c9..000000000 --- a/formatTest/unit_tests/expected_output/syntax.re +++ /dev/null @@ -1,1462 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -[@autoFormat - let wrap = 80; - let shift = 2 -]; -Modules.run(); -Polymorphism.run(); -Variants.run(); -BasicStructures.run(); - -TestUtils.printSection("General Syntax"); -/* Won't work! */ -/* let matchingFunc a = match a with */ -/* `Thingy x => (print_string "matched thingy x"); x */ -/* | `Other x => (print_string "matched other x"); x;; */ -/* */ -let matchingFunc = a => - switch (a) { - | `Thingy(x) => - print_string("matched thingy x"); - let zz = 10; - zz; - | `Other(x) => - print_string("matched other x"); - x; - }; - -type firstTwoShouldBeGroupedInParens = - (int => int, int) => int; -type allParensCanBeRemoved = - (int, int, int) => int; -type firstTwoShouldBeGroupedAndFirstThree = - ((int => int) => int) => int; -/* Same thing now but with type constructors instead of each int */ -type firstTwoShouldBeGroupedInParens = - (list(int) => list(int), list(int)) => - list(int); -type allParensCanBeRemoved = - (list(int), list(int), list(int)) => - list(int); -type firstTwoShouldBeGroupedAndFirstThree = - ((list(int) => list(int)) => list(int)) => - list(int); - -type myRecordType = { - firstTwoShouldBeGroupedInParens: - (int => int, int) => int, - allParensCanBeRemoved: (int, int, int) => int, - firstTwoShouldBeGroupedAndFirstThree: - ((int => int) => int) => int, -}; - -type firstNamedArgShouldBeGroupedInParens = - (~first: int => int, ~second: int) => int; -type allParensCanBeRemoved = - (~first: int, ~second: int, ~third: int) => int; -type firstTwoShouldBeGroupedAndFirstThree = - (~first: (int => int) => int) => int; - -/* Same thing now, but with type constructors instead of int */ -type firstNamedArgShouldBeGroupedInParens = - ( - ~first: list(int) => list(int), - ~second: list(int) - ) => - list(int); -type allParensCanBeRemoved = - ( - ~first: list(int), - ~second: list(int), - ~third: list(int) - ) => - list(int); -type firstTwoShouldBeGroupedAndFirstThree = - ( - ~first: (list(int) => list(int)) => - list(int) - ) => - list(int); - -type firstNamedArgShouldBeGroupedInParens = - ( - ~first: int => int=?, - ~second: list(int)=? - ) => - int; -/* The arrow necessitates parens around the next two args. The ? isn't what - * makes the parens necessary. */ -type firstNamedArgShouldBeGroupedInParensAndSecondNamedArg = - ( - ~first: int => int=?, - ~second: int => int=? - ) => - int; -type allParensCanBeRemoved = - ( - ~first: int=?, - ~second: int=?, - ~third: int=? - ) => - int; -type firstTwoShouldBeGroupedAndFirstThree = - (~first: (int => int) => int) => int; - -type noParens = - (~one: int, int, int, ~two: int) => int; -type noParensNeeded = - (~one: int, int, int, ~two: int) => int; -type firstNamedArgNeedsParens = - (~one: (int, int) => int, ~two: int) => int; - -/* Now, let's try type aliasing */ -/* Unless wrapped in parens, types between arrows may not be aliased, may not - * themselves be arrows. */ - -type parensRequiredAroundFirstArg = - (list(int) as 'a) => int as 'a; - -type parensRequiredAroundReturnType = - (list(int) as 'a) => (int as 'a); - -type parensRequiredAroundReturnType = - (list(int) as 'a) => (int as 'a) as 'b; - -type noParensNeededWhenInTuple = - (list(int) as 'a, list(int) as 'b) as 'entireThing; - -type myTypeDef('a) = list('a); - -type instatiatedTypeDef = myTypeDef(int) => int; - -/* Test a type attribute for good measure */ -/* We should clean up all of the attribute tagging eventually, but for now, - * let's make it super ugly to get out of the way of all the formatting/parsing - * implementations (fewer conflicts during parsing, fewer edge cases during - * printing). - */ -type something = ( - int, - [@lookAtThisAttribute] int, -); - -type longWrappingTypeDefinitionExample = - M_RK__G.Types.instance( - TGRecognizer.tGFields(unit, unit), - TGRecognizer.tGMethods(unit, unit), - ); - -type semiLongWrappingTypeDefinitionExample = - M_RK__Gesture.Types.instance( - TGRecognizerFinal.tGFields, - TGRecognizerFinal.tGMethods, - ); - -type semiLongWrappingTypeWithConstraint = - M_RK__Gesture.Types.instance( - 'a, - TGRecognizerFinal.tGFields, - TGRecognizerFinal.tGMethods, - ) -constraint 'a = (unit, unit); - -type onelineConstrain = 'a constraint 'a = int; - -/* This must be in trunk but not in this branch of OCaml */ -/* type withNestedRecords = MyConstructor {myField: int} */ - -type colors = - | Red(int) - | Black(int) - | Green(int); - -/* Another approach is to require declared variants to wrap any record */ -/* type myRecord = MyRecord {name: int}; */ -/* let myValue = MyRecord {name: int}; */ -/* This would force importing of the module */ -/* This would also lend itself naturally to pattern matching - and avoid having - to use `.` operator at all since you normally destructure. */ -type nameBlahType = {nameBlah: int}; -let myRecord = {nameBlah: 20}; -let myRecordName = myRecord.nameBlah; - -let {nameBlah}: nameBlahType = {nameBlah: 20}; -print_int(nameBlah); -let {nameBlah: aliasedToThisVar}: nameBlahType = { - nameBlah: 20, -}; -print_int(aliasedToThisVar); - -let desiredFormattingForWrappedLambda: - (int, int, int) => nameBlahType = - /* - - fun is - pre- /firstarg\ - fix /-coupled--\ - |-\ /-to-prefix--\ */ - (curriedArg, anotherArg, lastArg) => { - nameBlah: 10, - }; - -type longerInt = int; -let desiredFormattingForWrappedLambdaWrappedArrow: - (longerInt, longerInt, longerInt) => - nameBlahType = - /* - - fun is - pre- /firstarg\ - fix /-coupled--\ - |-\ /-to-prefix--\ */ - (curriedArg, anotherArg, lastArg) => { - nameBlah: 10, - }; - -let desiredFormattingForWrappedLambdaReturnOnNewLine = - /* - - fun is - pre- /firstarg\ - fix /-coupled--\ - |-\ /-to-prefix--\ */ - (curriedArg, anotherArg, lastArg) => { - nameBlah: 10, -}; - -/* - let is - pre- - fix /-function binding name---\ - |-\ / is coupled to prefix \ */ -let desiredFormattingForWrappedSugar = - (curriedArg, anotherArg, lastArg) => { - nameBlah: 10, -}; - -/* - let is - pre- - fix /-function binding name---\ - |-\ / is coupled to prefix \ */ -let desiredFormattingForWrappedSugarReturnOnNewLine = - (curriedArg, anotherArg, lastArg) => { - nameBlah: 10, -}; - -/* - let : type t1 t2. t1 * t2 list -> t1 = ... - let rec f : 't1 't2. 't1 * 't2 list -> 't1 = - fun (type t1) (type t2) -> (... : t1 * t2 list -> t1) - */ - -type point = { - x: int, - y: int, -}; -type point3D = { - x: int, - y: int, - z: int, -}; -let point2D = {x: 20, y: 30}; - -let point3D: point3D = { - x: 10, - y: 11, - z: 80 /* Optional Comma */ -}; - -let printPoint = (p: point) => { - print_int(p.x); - print_int(p.y); -}; - -let addPoints = (p1: point, p2: point) => { - x: p1.x + p2.x, - y: p1.y + p2.y, -}; - -let res1 = printPoint(point2D); -let res2 = - printPoint({x: point3D.x, y: point3D.y}); - -/* - When () were used to indicate sequences, the parser used seq_expr not only - for grouping sequences, but also to form standard precedences. - /------- sequence_expr ------\ - let res3 = printPoint (addPoints (point2D, point3D)); - - Interestingly, it knew that tuples aren't sequences. - - To move towards semi delimited, semi-terminated, braces-grouped sequences: - while allowing any non-sequence expression to be grouped on parens, we make - an explicit rule that allows one single non-semi ended expression to be - grouped in parens. - - Actually: We will allow an arbitrary number of semi-delimited expressions to - be wrapped in parens, but the braces grouped semi delimited (sequence) - expressions must *also* be terminated with a semicolon. - - This allows the parser to distinguish between - - let x = {a}; /* Record {a:a} */ - let x = {a;}; /* Single item sequence returning identifier {a} */ - */ -let res3 = - printPoint( - addPoints( - point2D, - {x: point3D.x, y: point3D.y}, - ), - ); - -type person = { - age: int, - name: string, -}; -type hiredPerson = { - age: string, - name: string, - dateHired: int, -}; - -let o: person = {name: "bob", age: 10}; - -/* Parens needed? Nope! */ -let o: person = {name: "bob", age: 10}; - -let printPerson = (p: person) => { - let q: person = p; - p.name ++ p.name; -}; - -/* let dontParseMeBro x y:int = x = y;*/ - -/* With this unification, anywhere eyou see `= fun` you can just ommit it */ -let blah = a => a; /* Done */ -let blah = a => a; /* Done (almost) */ - -let blah = (a, b) => a; /* Done */ -let blah = (a, b) => a; /* Done (almost) */ - -/* More than one consecutive pattern must have a single case */ -type blah = {blahBlah: int}; -let blah = (a, {blahBlah}) => a; -let blah = (a, {blahBlah}) => a; - -module TryToExportTwice = { - let myVal = "hello"; -}; - -/* - Unifying top level module syntax with local module syntax is probably a bad - idea at the moment because it makes it more difficult to continue to support - `let .. in` bindings. We can distinguish local modules for `let..in` that - just happen to be defined at the top level (but not exported). - - let MyModule = {let myVal = 20;} in - MyModule.x - - Wait, where would this ever be valid, even if we continued to support - `let..in`? - */ - -let onlyDoingThisTopLevelLetToBypassTopLevelSequence = { - let x = { - print_int(1); - print_int(20); /* Missing trailing SEMI */ - }; - - let x = { - print_int(1); - print_int(20); /* Ensure missing middle SEMI reported well */ - print_int(20); - }; - - let x = { - print_int(1); - print_int(20); - 10; - /* Comment in final position */ - }; /* Missing final SEMI */ - x + x; -}; - -type hasA = {a: int}; -let a = 10; -let returnsASequenceExpressionWithASingleIdentifier = - () => { - a; -}; -let thisReturnsA = () => { - a; -}; -let thisReturnsAAsWell = () => a; - -let recordVal: int = thisReturnsARecord().a; -Printf.printf( - "\nproof that thisReturnsARecord: %n\n", - recordVal, -); -Printf.printf( - "\nproof that thisReturnsA: %n\n", - thisReturnsA(), -); - -/* Pattern matching */ -let blah = arg => - switch (arg) { - /* Comment before Bar */ - | /* Comment between bar/pattern */ Red(_) => 1 - /* Comment Before non-first bar */ - | /* Comment betwen bar/pattern */ Black(_) => 0 - | Green(_) => 0 - }; - -/* Any function that pattern matches a multicase match is interpretted as a - * single arg that is then matched on. Instead of the above `blah` example:*/ - -let blah = - fun - | Red(_) => 1 - | Black(_) => 0 - | Green(_) => 1; - -/* `fun a => a` is read as "a function that maps a to a". Then the */ -/* above example is read: "a function that 'either maps' Red to.. or maps .." */ -/* Thc00f564e first bar is read as "either maps" */ - -/* Curried form is not supported: - let blah x | Red _ => 1 | Black _ => 0; - Theres no sugar rule for dropping => fun, only = fun - */ - -/* let blahCurriedX x => fun /* See, nothing says we can drop the => fun */ */ -/* |(Red x | Black x | Green x) => 1 /* With some effort, we can ammend the sugar rule that would */ */ -/* | Black x => 0 /* Allow us to drop any => fun.. Just need to make pattern matching */ */ -/* | Green x => 0; /* Support that */ */ -/* */ - -let blahCurriedX = x => - fun - | Red(x) - | Black(x) - | Green(x) => 1 /* With some effort, we can ammend the sugar rule that would */ - | Black(x) => 0 /* Allow us to drop any => fun.. Just need to make pattern matching */ - | Green(x) => 0; /* Support that */ - -let sameThingInLocal = { - let blahCurriedX = x => - fun - | Red(x) - | Black(x) - | Green(x) => 1 /* With some effort, we can ammend the sugar rule that would */ - | Black(x) => 0 /* Allow us to drop any => fun.. Just need to make pattern matching */ - | Green(x) => 0; /* Support that */ - blahCurriedX; -}; - -/* This should be parsed/printed exactly as the previous */ -let blahCurriedX = x => - fun - | Red(x) - | Black(x) - | Green(x) => 1 - | Black(x) => 0 - | Green(x) => 0; - -/* Any time there are multiple match cases we require a leading BAR */ - -let v = Red(10); -let Black(x) | Red(x) | Green(x) = v; /* So this NON-function still parses */ - -/* This doesn't parse, however (and it doesn't in OCaml either): - let | Black(x) | Red(x) | Green(x) = v; - */ - -print_int(x); - -/* Scoping: Let sequences. Familiar syntax for lexical ML style scope and - sequences. */ - -let res = { - let a = "a starts out as"; - { - print_string(a); - let a = 20; - print_int(a); - }; - print_string(a); -}; - -let res = { - let a = "first its a string"; - let a = 20; - print_int(a); - print_int(a); - print_int(a); -}; - -let res = { - let a = "a is always a string"; - print_string(a); - let b = 30; - print_int(b); -}; - -/* let result = LyList.map((fun | [] => true | _ => false), []); */ - -/* OTHERWISE: You cannot tell if a is the first match case falling through or - * a curried first arg */ -/* let blah = fun a | patt => 0 | anotherPatt => 1; */ -/* let blah a patt => 0 | anotherPatt => 1; */ - -/*simple pattern EQUALGREATER expr */ -let blah = (a, {blahBlah}) => a; - -/* match_case */ -/* pattern EQUALGREATER expr */ -let blah = - fun - | Red(_) => 1 - | Black(_) => 0 - | Green(_) => 0; - -/* Won't work! */ -/* let arrowFunc = fun a b => print_string "returning aplusb from arrow"; a + b;; */ -let arrowFunc = (a, b) => { - print_string("returning aplusb from arrow"); - a + b; -}; -let add = (a, b) => { - let extra = { - print_string("adding"); - 0; - }; - let anotherExtra = 0; - extra + a + b + anotherExtra; -}; - -print_string(string_of_int(add(4, 34))); - -let dummy = _ => 10; -dummy(res1); -dummy(res2); -dummy(res3); - -/* Some edge cases */ -let myFun = - (firstArg, Red(x) | Black(x) | Green(x)) => - firstArg + x; -let matchesWithWhen = a => - switch (a) { - | Red(x) when 1 > 0 => 10 - | Red(_) => 10 - | Black(x) => 10 - | Green(x) => 10 - }; - -let matchesWithWhen = - fun - | Red(x) when 1 > 0 => 10 - | Red(_) => 10 - | Black(x) => 10 - | Green(x) => 10; - -let matchesOne = (`Red(x)) => 10; - -/* - Typical OCaml would make you *wrap the functions in parens*! This is because it - can't tell if a semicolon is a sequence operator. Even if we had records use - commas to separate fields, - */ -type adders = { - addTwoNumbers: (int, int) => int, - addThreeNumbers: (int, int, int) => int, - addThreeNumbersTupled: - ((int, int, int)) => int, -}; -let myRecordWithFunctions = { - addTwoNumbers: (a, b) => a + b, - addThreeNumbers: (a, b, c) => a + b + c, - addThreeNumbersTupled: ((a, b, c)) => - a + b + c, -}; - -let result = - myRecordWithFunctions.addThreeNumbers( - 10, - 20, - 30, - ); -let result = - myRecordWithFunctions.addThreeNumbersTupled(( - 10, - 20, - 30, - )); - -let lookTuplesRequireParens = (1, 2); -/* let thisDoesntParse = 1, 2; */ -let tupleInsideAParenSequence = { - print_string( - "look, a tuple inside a sequence", - ); - let x = 10; - (x, x); -}; - -let tupleInsideALetSequence = { - print_string( - "look, a tuple inside a sequence", - ); - let x = 10; - (x, x); -}; - -/* We *require* that function return types be wrapped in - parenthesis. In this example, there's no ambiguity */ -let makeIncrementer = (delta: int): (int => int) => - a => a + delta; - -/* We could even force that consistency with let bindings - it's allowed - currently but not forced. - */ -let myAnnotatedValBinding: int = 10; - -/* Class functions (constructors) and methods are unified in the same way */ - -class classWithNoArg = { - pub x = 0; - pub y = 0; -}; - -/* This parses but doesn't type check - class myClass init => object - pub x => init - pub y => init - end; - */ - -let myFunc = (a: int, b: int): (int, int) => ( - a, - b, -); -let myFunc = (a: int, b: int): list(int) => [ - 1, -]; -let myFunc = (a: int, b: int): point => { - x: a, - y: b, -}; -let myFunc = (a: int, b: int): point => { - x: a, - y: b, -}; - -type myThing = (int, int); -type stillARecord = { - name: string, - age: int, -}; - -/* Rebase latest OCaml to get the following: And fixup - `generalized_constructor_arguments` according to master. */ -/* type ('a, 'b) myOtherThing = Leaf {first:'a, second: 'b} | Null; */ -type branch('a, 'b) = { - first: 'a, - second: 'b, -}; -type myOtherThing('a, 'b) = - | Leaf(branch('a, 'b)) - | Null; - -type yourThing = myOtherThing(int, int); - -/* Conveniently - this parses exactly how you would intend! No *need* to wrap - in an extra [], but it doesn't hurt */ -/* FIXME type lookAtThesePolyVariants = list [`Red] ; */ - -/* FIXME type bracketsGroupMultipleParamsAndPrecedence = list (list (list [`Red])); */ - -/* FIXME type youCanWrapExtraIfYouWant = (list [`Red]); */ - -/* FIXME type hereAreMultiplePolyVariants = list [`Red | `Black]; */ -/* FIXME type hereAreMultiplePolyVariantsWithOptionalWrapping = list ([`Red | `Black]); */ - -/* - /* Proposal: ES6 style lambdas: */ - - /* Currying */ - let lookES6Style = (`Red x) (`Black y) => { }; - let lookES6Style (`Red x) (`Black y) => { }; - - /* Matching the single argument */ - let lookES6Style = oneArg => match oneArg with - | `Red x => x - | `Black x => x; - - /* The "trick" to currying that we already have is basically the same - we just - * have to reword it a bit: - * From: - * "Any time you see [let x = fun ...] just replace it with [let x ...]" - * To: - * "Any time you see [let x = ... => ] just replace it with [let x ... => ]" - */ - let lookES6Style oneArg => match oneArg with - | `Red x => x - | `Black x => x; - - */ - -/** Current OCaml Named Arguments. Any aliasing is more than just aliasing! -OCaml allows full on pattern matching of named args. */ -/* - A: let named ~a ~b = aa + bb in - B: let namedAlias ~a:aa ~b:bb = aa + bb in - C: let namedAnnot ~(a:int) ~(b:int) = a + b in - D: let namedAliasAnnot ~a:(aa:int) ~b:(bb:int) = aa + bb in - E: let optional ?a ?b = 10 in - F: let optionalAlias ?a:aa ?b:bb = 10 in - G: let optionalAnnot ?(a:int option) ?(b:int option) = 10 in - H: let optionalAliasAnnot ?a:(aa:int option) ?b:(bb:int option) = 10 in - /* - Look! When a default is provided, annotation causes inferred type of argument - to not be "option" since it's automatically destructured (because we know it - will always be available one way or another.) - */ - I: let defOptional ?(a=10) ?(b=10) = 10 in - J: let defOptionalAlias ?a:(aa=10) ?b:(bb=10) = 10 in - K: let defOptionalAnnot ?(a:int=10) ?(b:int=10) = 10 in - \ \ - \label_let_pattern opt_default: no longer needed in SugarML - - L: let defOptionalAliasAnnot ?a:(aa:int=10) ?b:(bb:int=10) = 10 in - \ \ - \let_pattern: still a useful syntactic building block in SugarML - */ - -/** - * In Reason, the syntax for named args uses double semicolon, since - * the syntax for lists uses ES6 style [], freeing up the ::. - */ - -let a = 10; -let b = 20; - -/*A*/ -let named = (~a, ~b) => a + b; -type named = (~a: int, ~b: int) => int; -/*B*/ -let namedAlias = (~a as aa, ~b as bb) => - aa + bb; -let namedAlias = (~a as aa, ~b as bb) => - aa + bb; -type namedAlias = (~a: int, ~b: int) => int; -/*C*/ -let namedAnnot = (~a: int, ~b: int) => 20; -/*D*/ -let namedAliasAnnot = - (~a as aa: int, ~b as bb: int) => 20; -/*E*/ -let myOptional = (~a=?, ~b=?, ()) => 10; -type named = (~a: int=?, ~b: int=?, unit) => int; -/*F*/ -let optionalAlias = (~a as aa=?, ~b as bb=?, ()) => 10; -/*G*/ -let optionalAnnot = (~a: int=?, ~b: int=?, ()) => 10; -/*H*/ -let optionalAliasAnnot = - (~a as aa: int=?, ~b as bb: int=?, ()) => 10; -/*I: */ -let defOptional = (~a=10, ~b=10, ()) => 10; -type named = (~a: int=?, ~b: int=?, unit) => int; -/*J*/ -let defOptionalAlias = - (~a as aa=10, ~b as bb=10, ()) => 10; -/*K*/ -let defOptionalAnnot = - (~a: int=10, ~b: int=10, ()) => 10; -/*L*/ -let defOptionalAliasAnnot = - (~a as aa: int=10, ~b as bb: int=10, ()) => 10; - -/*M: Invoking them - Punned */ -let resNotAnnotated = named(~a, ~b); -/*N:*/ -let resAnnotated: int = named(~a, ~b); -/*O: Invoking them */ -let resNotAnnotated = named(~a, ~b); -/*P: Invoking them */ -let resAnnotated: int = named(~a, ~b); - -/*Q: Here's why "punning" doesn't work! */ -/* Is b:: punned with a final non-named arg, or is b:: supplied b as one named arg? */ -let b = 20; -let resAnnotated = named(~a, ~b); - -/*R: Proof that there are no ambiguities with return values being annotated */ -let resAnnotated: ty = named(~a, b); - -/*S: Explicitly passed optionals are a nice way to say "use the default value"*/ -let explictlyPassed = - myOptional(~a=?None, ~b=?None); -/*T: Annotating the return value of the entire function call */ -let explictlyPassedAnnotated: int = - myOptional(~a=?None, ~b=?None); -/*U: Explicitly passing optional with identifier expression */ -let a = None; -let explictlyPassed = myOptional(~a?, ~b=?None); -let explictlyPassedAnnotated: int = - myOptional(~a?, ~b=?None); - -let nestedLet = { - let _ = 1; - (); -}; - -let nestedLet = { - let _ = 1; - (); -}; - -let nestedLet = { - let _ = 1; - (); -}; - -let nestedLet = { - let _ = 1; - 2; -}; - -/* - * Showing many combinations of type annotations and named arguments. - */ - -type typeWithNestedNamedArgs = - ( - ~outerOne: (~innerOne: int, ~innerTwo: int) => - int, - ~outerTwo: int - ) => - int; - -type typeWithNestedOptionalNamedArgs = - ( - ~outerOne: (~innerOne: int, ~innerTwo: int) => - int - =?, - ~outerTwo: int=? - ) => - int; - -type typeWithNestedOptionalNamedArgs = - ( - ~outerOne: list(string)=?, - ~outerTwo: int=? - ) => - int; - -let f = - (~tuple="long string to trigger line break") => - (); - -let x = - callSomeFunction( - ~withArg=10, - ~andOtherArg=wrappedArg, - ); - -let res = { - (constraintedSequenceItem: string); - (dontKnowWheYoudWantToActuallyDoThis: string); -}; - -let res = { - ( - butTheyWillBePrintedWithAppropriateSpacing: string - ); - ( - soAsToInstillBestDevelopmentPractices: string - ); -}; - -let x = [ - (eachItemInListCanBeAnnotated: int), - (typeConstraints: float), - ( - tupleConstraints: int, - andNotFunctionInvocations: int, - ), -]; - -let x = [ - (butWeWillPrint: int), - (themAsSpaceSeparated: float), - ( - toInfluenceYour: int, - developmentHabbits: int, - ), -]; - -let newRecord = { - ...(annotatedSpreadRecord: someRec), - x: y, -}; - -let newRecord = { - ...(annotatedSpreadRecord: someRec), - blah: 0, - foo: 1, -}; - -let newRecord = { - ...( - youCanEvenCallMethodsHereAndAnnotate(them): someRec - ), - blah: 0, - foo: 1, -}; - -let newRecord = { - ...( - youCanEvenCallMethodsHereAndAnnotate( - them, - ~named=10, - ): someRec - ), - blah: 0, - foo: 1, -}; - -let something: thing(blah) = aTypeAnnotation; -let something: thing(blah) = thisIsANamedArg; - -let something: thing(blah) = aTypeAnnotation; - -let something: blah = thisIsANamedArg(thing); -let something: blah = typeAnnotation(thing); - -let newRecord = { - ...( - heresAFunctionWithNamedArgs(~argOne=i): annotatedResult - ), - soAsToInstill: 0, - developmentHabbits: 1, -}; - -[@thisIsAThing]; -let x = 10; - -/* Ensure that the parenthesis are preserved here because they are - * important: - */ -let something = - fun - | None => ( - fun - | [] => "emptyList" - | [_, ..._] => "nonEmptyList" - ) - | Some(_) => ( - fun - | [] => "emptyList" - | [_, ..._] => "nonEmptyList" - ); - -/* A | B = X; */ -let A | B = X; - -/* A | (B | C) = X; */ -let A | (B | C) = X; - -/* (A | B) | (C | D) = X; */ -let A | B | (C | D) = X; - -/* A | B | (C | D) = X; */ -let A | B | (C | D) = X; - -/* (A | B) | C = X; */ -let A | B | C = X; - -/* A | B | C = X; */ -let A | B | C = X; - -/** External function declaration - * - */ -external f: int => int = "foo"; - -let x = {contents: 0}; - -let unitVal = x.contents = 210; - -let match = "match"; - -let method = "method"; - -let foo = - (x, ~x as bar, ~z, ~foo as bar, ~foo as z) => { - bar + 2; -}; - -let zzz = myFunc(1, 2, [||]); - -/* 1492 */ -let registerEventHandlers = - ( - ~window: Window.t, - ~mouseDown: - option( - ( - ~button: Events.buttonStateT, - ~state: Events.stateT, - ~x: int, - ~y: int - ) => - unit, - )=?, - (), - ) => 1; - -/* #1320: record destrucuring + renaming */ -let x = ({state as prevState}) => 1; -let x = ({ReasonReact.state as prevState}) => 1; - -/* 1567: optional parens around expr constraint in constructor expression */ -Some(x: int); -Some(x: int); -Some(x, y: int, b); -Some(x, y: int, b); - -foo(~x=-. bar); - -Some(-1, -1, -1); -Some(-1, -1, -1); -Some(-1g, -1G, -1z); -Some(-1g, -1G, -1z); -Some(-0.1, -0.1, -0.1); -Some(-0.1, -0.1, -0.1); -Some(-0.1G, -0.1x, -0.1H); -Some(-0.1G, -0.1x, -0.1H); -Some([@foo] -1, [@foo] -1, [@foo] -1); -Some([@foo] -1z, [@foo] -1z, [@foo] -1z); -Some([@foo] -0.1, [@foo] -0.1, [@foo] -0.1); -Some([@foo] -0.1m, [@foo] -0.1n, [@foo] -0.1p); - -foo(~x=-1, ~y=-2); -foo(~x=-1, ~y=-2); -foo(~x=-. 1, ~y=-. 2); -foo(~x=-. 1, ~y=-. 2); -foo(~x=-1g, ~y=-1G, ~z=-1z); -foo(~x=-1g, ~y=-1G, ~z=-1z); -foo(~x=-0.1G, ~y=-0.1x, ~z=-0.1H); -foo(~x=-0.1G, ~y=-0.1x, ~z=-0.1H); -foo(~x=[@foo] -1, ~y=[@foo] -1, ~z=[@foo] -1); -foo( - ~x=[@foo] -1z, - ~y=[@foo] -1z, - ~z=[@foo] -1z, -); -foo( - ~x=[@foo] -0.1, - ~y=[@foo] -0.1, - ~z=[@foo] -0.1, -); -foo( - ~x=[@foo] -0.1m, - ~y=[@foo] -0.1n, - ~z=[@foo] -0.1p, -); - -/* Smooth formatting of functions with callbacks as arguments */ -funWithCb("text", () => doStuff()); - -funWithCb([@attr] "text", [@myAttr] () => - doStuff() -); - -funWithCb(~text="text", ~f=() => doStuff()); - -funWithCb(~text=[@attr] "text", ~f=[@myAttr] () => - doStuff() -); - -funWithCb(~text="text", ~f=?() => doStuff()); - -funWithCb(~text=[@attr] "text", ~f=?[@myAttr] () => - doStuff() -); - -test("my test", () => { - let x = a + b; - let y = z + c; - x + y; -}); - -test([@attr] "my test", [@attr] () => { - let x = a + b; - let y = z + c; - x + y; -}); - -test(~desc="my test", ~f=() => { - let x = a + b; - let y = z + c; - x + y; -}); - -test(~desc=[@attr] "my test", ~f=[@myAttr] () => { - let x = a + b; - let y = z + c; - x + y; -}); - -test(~desc=?"my test", ~f=?() => { - let x = a + b; - let y = z + c; - x + y; -}); - -test(~desc=?[@attr] "my test", ~f=?[@attr] () => { - let x = a + b; - let y = z + c; - x + y; -}); - -describe("App", () => { - test("math", () => { - Expect.expect(1 + 2) |> toBe(3) - }) -}); - -describe([@attr] "App", [@attr] () => { - test([@attr] "math", [@attr] () => { - Expect.expect(1 + 2) |> toBe(3) - }) -}); - -describe(~text="App", ~f=() => - test(~text="math", ~f=() => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -describe(~text=[@attr] "App", ~f=[@attr] () => - test(~text=[@attr] "math", ~f=[@attr] () => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -describe(~text=?"App", ~f=?() => - test(~text=?"math", ~f=?() => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -describe(~text=?[@attr] "App", ~f=?[@attr] () => - test(~text=?[@attr] "math", ~f=?[@attr] () => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -Thing.map(foo, bar, baz, (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map( - [@attr] foo, bar, baz, [@attr] (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map( - ~a=[@attr] foo, ~b=bar, ~c=?baz, ~f=(abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map( - ~a=foo, - ~b=bar, - ~c=?[@attr] baz, - ~f=[@attr] (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map(~a=foo, ~b=bar, ~c=?baz, ~f=?(abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map( - ~a=foo, - ~b=bar, - ~c=?[@attr] baz, - ~f=?[@attr] (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map( - foo, - bar, - baz, - foo2, - bakjlksjdf, - okokokok, - (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -Thing.map( - foo, - bar, - baz, - foo2, - [@attr] bakjlksjdf, - okokokok, - [@attr] (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -Thing.map( - ~a=foo, - ~b=bar, - ~c=baz, - ~d=foo2, - ~e=bakjlksjdf, - ~f=okokokok, - ~cb=(abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -Thing.map( - ~a=foo, - ~b=bar, - ~c=[@attr] baz, - ~d=foo2, - ~e=bakjlksjdf, - ~f=okokokok, - ~cb=[@attr] (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?bakjlksjdf, - ~f=?okokokok, - ~cb=?(abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?[@attr] bakjlksjdf, - ~f=?okokokok, - ~cb=?[@attr] (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -Thing.map( - foo, - bar, - baz, - (abc, z) => MyModuleBlah.toList(argument), - (abc, z) => MyModuleBlah.toList(argument), -); - -Thing.map( - foo, - bar, - baz, - [@attr] (abc, z) => - MyModuleBlah.toList(argument), - [@attr] (abc, z) => - MyModuleBlah.toList(argument), -); - -Js.Option.andThen((. w) => w#getThing()); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?[@attr] bakjlksjdf, - ~f=?okokokok, - ~cb=?[@attr] - [@attr2] - [@aslkdfjlsdjf] - [@sldkfjlksdjflksjdlkjf] - [@sldkflskjdf] - (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -let result = - F.call(x => { - let x = 123; - let y = 2345; - doStuff(); - }); - -let result = F.call(x => doStuff(x)); - -let () = - x |> Bigarray.Genarray.get(_, [|1, 2, 3, 4|]); - -let () = x |> Bigarray.Array1.get(_, 1); - -let () = x |> Bigarray.Array2.get(_, 1, 2); - -let () = x |> Bigarray.Array3.get(_, 1, 2, 3); - -let x = -. 1; - -let x = (-1); - -let x = 1; - -let x = +. 1; - -let x = (~a: int=(-1)) => a; - -let x = (~a=(-1)) => a; - -let x: float = -. 1; - -let x: int = (-1); - -let x: int = 1; - -let x: float = +. 1; - -foo(~a=?-1); - -/* - https://github.com/facebook/reason/issues/1992 - Pexp_override - */ -let z = {}; -let z = {<>}; - -/* https://github.com/facebook/reason/issues/2056 */ -type foo = (~a: bool=?) => int; - -/* https://github.com/facebook/reason/issues/2070 */ -f(~commit=!build); - -/* https://github.com/facebook/reason/issues/2032 */ -let predicate = - predicate === Functions.alwaysTrue1 - ? defaultPredicate - : fun - | None => false - | Some(exn) => predicate(exn); - -let predicate = - predicate === Functions.alwaysTrue1 - ? fun - | None => false - | Some(exn) => predicate(exn) - : fun - | None => false - | Some(exn) => predicate(exn); - -/* https://github.com/facebook/reason/issues/2125 */ -foo(~a); - -foo(~a: int); - -foo(~a: int); - -foo(~(a :> int)); - -foo(~(a :> int)); - -foo(~a=?Foo.a); - -foo(~a=Foo.a); - -/* https://github.com/facebook/reason/issues/2155#issuecomment-422077648 */ -true ? (Update({...a, b: 1}), None) : x; -true ? {...a, b: 1} : a; -true ? (a, {...a, b: 1}) : a; - -true ? ([x, ...xs]) => f(x, xs) : a; - -/* https://github.com/facebook/reason/issues/2200 */ -foo(~x=(-1) + 2); - -foo(~x=(-1) + 2: int); - -foo(~not); - -let foo = (~not) => (); - -let foo = (~not: string) => (); - -foo(~not: string); - -/* https://github.com/facebook/reason/issues/2141 */ -let testCallNamedArgs = - (foo: (~a: int, ~b: int) => int, a, b) => - foo(~a, ~b); - -let testCallNamedArgs = - (foo: (~a: int, ~b: int=?) => int, a, b) => - foo(~a, ~b); - -let Foo.{name} = bar; -let Foo.Bar.{name} = bar; - -let Foo.[name] = bar; -let Foo.Bar.[name] = bar; - -let Foo.Bar.[] = bar; -let Foo.Bar.[||] = bar; -let Foo.() = foo; - -/* let Foo.(bar, baz) = foo; */ - -let Foo.(exception bar) = baz; - -try({ - let this = try_exp; - let has = hugged; - parens; -}) { -| _ => () -}; - -/* Pcl_open (4.06+) */ -class x = { - open EM; - as self; -}; - -class y = { - open EM; - open OM; - as self; -}; diff --git a/formatTest/unit_tests/expected_output/syntax.rei b/formatTest/unit_tests/expected_output/syntax.rei deleted file mode 100644 index 3cee43a36..000000000 --- a/formatTest/unit_tests/expected_output/syntax.rei +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/** - * Typically the "interface file" is where you would write a ton of - * comments/documentation. - */ -type adders = { - /* - * Adds two numbers together. - */ - addTwoNumbers: (int, int) => int, - /* - * Amazingly, adds *three* numbers together. - */ - addThreeNumbers: (int, int, int) => int, - /* - * Tuple version of previous function. - */ - addThreeNumbersTupled: - ((int, int, int)) => int, -}; - -/** - * Public function. - */ -let myRecordWithFunctions: adders; -/** - * Public result. - */ -let result: int; - -/* https://github.com/facebook/reason/issues/1614 */ -module Event: (module type of { - include ReactEventRe; -}); - -module type Event = (module type of { - include ReactEventRe; -}); - -/* https://github.com/facebook/reason/issues/2169 */ -let not: string => string; - -let other: string => not; - -include - (module type of Bos.Cmd) with - type t = Bos.Cmd.t; diff --git a/formatTest/unit_tests/expected_output/testUtils.re b/formatTest/unit_tests/expected_output/testUtils.re deleted file mode 100644 index f2773a018..000000000 --- a/formatTest/unit_tests/expected_output/testUtils.re +++ /dev/null @@ -1,9 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let printSection = s => { - print_string("\n"); - print_string(s); - print_string("\n---------------------\n"); -}; - -let printLn = s => print_string(s ++ "\n"); diff --git a/formatTest/unit_tests/expected_output/trailing.re b/formatTest/unit_tests/expected_output/trailing.re deleted file mode 100644 index 5b41105e7..000000000 --- a/formatTest/unit_tests/expected_output/trailing.re +++ /dev/null @@ -1,31 +0,0 @@ -let x = {"obj": obj}; - -let x = {"key": key, "keyTwo": keyTwo}; - -let x = {...x, "key": key}; - -let x = {...x, "key": key, "keyTwo": keyTwo}; - -type t = {. "x": int}; - -type t('a) = {.. "x": int} as 'a; - -type t = {. "x": (int, int)}; - -type t('a) = {.. "x": (int, int)} as 'a; - -let x = {"obj": 0}; - -let x = {"key": 0, "keyTwo": 1}; - -let x = {...x, "key": 0}; - -let x = {...x, "key": 0, "keyTwo": 1}; - -type t = {. "x": int}; - -type t('a) = {.. "x": int} as 'a; - -type t = {. "x": (int, int)}; - -type t('a) = {.. "x": (int, int)} as 'a; diff --git a/formatTest/unit_tests/expected_output/trailingSpaces.re b/formatTest/unit_tests/expected_output/trailingSpaces.re deleted file mode 100644 index 2c0dc7a99..000000000 --- a/formatTest/unit_tests/expected_output/trailingSpaces.re +++ /dev/null @@ -1,7 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -module M = - Something.Create({ - type resource1 = MyModule.MySubmodule.t; - type resource2 = MyModule.MySubmodule.t; - }); diff --git a/formatTest/unit_tests/expected_output/typeDeclarations.re b/formatTest/unit_tests/expected_output/typeDeclarations.re deleted file mode 100644 index 0d2299c4c..000000000 --- a/formatTest/unit_tests/expected_output/typeDeclarations.re +++ /dev/null @@ -1,128 +0,0 @@ -/* === test wrapping for arrows === */ -type foo = option(int => int); -type foo = option((int, int) => int); -type foo = option((int => int) => int); -type foo = option((int, int) => int); - -/* tuple */ -type foo = option((int => int, int => int)); -type foo = option((int => int, string)); -type foo = - option((string, int => int, string)); -type foo = option((string, int => int)); - -/* other preceeding/trailing */ -type foo = option(int => int, int => int); -type foo = option(int => int, string); -type foo = option(string, int => int, string); -type foo = option(string, int => int); - -/* preceeding/trailing, more args */ -type foo = - option( - (int, string) => int, - (int, string) => int, - ); -type foo = option((int, string) => int, string); -type foo = - option(string, (int, string) => int, string); -type foo = option(string, (int, string) => int); - -/* others */ -type foo = - option(string, option(int => int), string); -type foo = - option( - string, - option(option(option(int) => int)), - string, - ); -type foo = - option( - string, - option([@foo] option(option(int) => int)), - string, - ); - -/* with attributes */ -type foo = - option([@foo] [@bar] (int => [@baz] int)); -type foo = - option([@foo] (([@bar] int) => [@baz] int)); -type foo = option(int => [@foo] (int => int)); -type foo = option([@foo] ((int => int) => int)); -type foo = option([@foo] ((int, int) => int)); - -/* tuple */ -type foo = - option( - [@foo] ( - [@bar] (int => int), - [@baz] (int => int), - ), - ); -type foo = - option( - [@foo] ([@bar] (int => int), [@baz] string), - ); -type foo = - option( - [@foo] ( - [@bar] string, - [@baz] (int => int), - [@qux] string, - ), - ); -type foo = - option((string, [@foo] (int => int))); - -/* other preceeding/trailing */ -type foo = - option( - [@foo] (int => int), - [@bar] (int => int), - ); -type foo = - option([@foo] (int => int), [@bar] string); -type foo = - option( - [@foo] string, - [@bar] (int => int), - [@baz] string, - ); -type foo = - option([@foo] string, [@bar] (int => int)); - -/* preceeding/trailing, more args */ -type foo = - option( - [@foo] ((int, string) => int), - [@bar] ((int, string) => int), - ); -type foo = - option( - [@foo] ((int, string) => int), - [@bar] string, - ); -type foo = - option( - [@foo] string, - [@bar] ((int, string) => int), - [@baz] string, - ); -type foo = - option( - [@foo] string, - [@bar] ((int, string) => int), - ); - -/* === end test wrapping for arrows === */ - -/* https://github.com/facebook/reason/issues/2073 */ -type a = - array({ - . - "someStringKeyThatCausesLineToBreak": string, - }); - -type b = {punned: [@with_attribute] punned}; diff --git a/formatTest/unit_tests/expected_output/uncurried.re b/formatTest/unit_tests/expected_output/uncurried.re deleted file mode 100644 index 160f3c565..000000000 --- a/formatTest/unit_tests/expected_output/uncurried.re +++ /dev/null @@ -1,195 +0,0 @@ -f(.); - -[@attr] -f(.); - -f(.); - -f(. a, b, c); - -[@attr] -f(. a, b, c); - -f(. a); - -f(. (1, 2)); - -f([@bs] (1, 2)); - -f(. [@bs] (1, 2)); - -f(. (1, 2), (3, 4)); - -f(. [@bs] (1, 2), [@bs] (3, 4)); - -(f(. [@bs] (1, 2)))(. [@bs] (3, 4)); - -f(. "string"); - -f(. "string", "2string"); - -(f(. "string"))(. "2string"); - -(f(. [@bs] "string"))(. [@bs] "2string"); - -f(. 1); - -f(. [@bs] 1); - -f(. { - a: "supersupersupersupersupersuperlong", - b: "supersupersupersupersupersuperlong", -}); - -let f = (. a, b) => a + b; - -let f = [@attr] ((. a, b) => a + b); - -let f = (. a, b) => a + b; - -let f = ("hello", (. b, c) => b + c); - -let f = ("hello", [@attr] ((. b, c) => b + c)); - -let f = ("hello", (. b, c) => b + c); - -let obj: tesla = { - pub drive = (. speed, safe) => (speed, safe); - pub drive2 = - [@attr] ((. speed, safe) => (speed, safe)); - pub park = (.) => (); - pub park2 = [@attr] ((.) => ()) -}; - -type f = (. int, int) => int; - -type f = [@attr] ((. int, int) => int); - -type f = (. int, int) => int; - -type z = (. unit) => unit; - -type z = [@attr] ((. unit) => unit); - -type z = (. unit) => unit; - -type tesla = {. drive: (. int, int) => int}; - -class type _rect = - [@bs] - { - [@bs.set] - pub height: int; - [@bs.set] - pub width: int; - pub draw: unit => unit; - }; - -class type _rect = - [@bs] - { - [@bs.set] - pub height: int; - [@bs.set] - pub width: int; - pub draw: unit => unit; - }; - -funWithCb("text", (.) => doStuff()); - -funWithCb("text", (. test) => doStuff()); - -funWithCb("text", [@attr] (. arg) => doStuff()); - -test(~desc="my test", (.) => { - let x = a + b; - let y = z + c; - x + y; -}); - -test(~desc="my test", [@attr] (. a, b, c) => { - let x = a + b; - let y = z + c; - x + y; -}); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?bakjlksjdf, - ~f=?okokokok, - ~cb=[@attr] (. abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - }, -); - -type f = int => (. int) => unit; - -type f = int => (. int) => unit; - -add(. 2); - -(add(. 2))(. 3); - -add(. 2, [@bs] 3); - -((add(. 2, 3, 4))(. 5, 6, 7))(. 8, 9, 10); - -type timerId; - -[@bs.val] -external setTimeout: - ((. unit) => unit, int) => timerId = - "setTimeout"; - -let id = - setTimeout((.) => Js.log("hello"), 1000); - -let id = - setTimeout(1000, (.) => Js.log("hello")); - -foo([@bs] {val a = 1}); - -foo(. [@bs] {val a = 1}); - -foo(. [@bs] {val a = 1}); - -foo([@attr1] [@bs] [@attr2] {val a = 1}); - -add([@attr] [@bs] [@attr] 1); - -add(. [@attr] [@bs] [@attr] 1); - -add(. [@attr] [@bs] [@attr] 1); - -let a = foo(. foo(. 3)); - -let a = foo(. foo(. 3)); - -(add(1, 2))(. 3, 4); - -(add(1))(. 2, 3, 4); - -(add(1, 2, 3))(. 4); - -let run = - ( - ~dry as [@attr] dry: bool=false, - ~mMap: string=?, - logger, - ) => {}; - -f(. _ => 1); - -f(. a, _ => 1); - -f(. a, (. _) => 1); - -let u = - (. ~f: t, a, b) => { - f(. ~x=a, ~y=b)->Js.log; - f(. ~y=b, ~x=a)->Js.log; - }; diff --git a/formatTest/unit_tests/expected_output/variants.re b/formatTest/unit_tests/expected_output/variants.re deleted file mode 100644 index fa61fd7e0..000000000 --- a/formatTest/unit_tests/expected_output/variants.re +++ /dev/null @@ -1,692 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -module LocalModule = { - type accessedThroughModule = - | AccessedThroughModule; - type accessedThroughModuleWithArg = - | AccessedThroughModuleWith(int) - | AccessedThroughModuleWithTwo(int, int); -}; - -type notTupleVariant = - | NotActuallyATuple(int, int); -type attr = - | A(int); -type attr += - | Point(int, int); -type attr += - | PointA({ - a: int, - b: int, - }); - -type notTupleVariantExtraParens = - | NotActuallyATuple2(int, int); - -type simpleTupleVariant = - | SimpleActuallyATuple((int, int)); - -type tupleVariant = - | ActuallyATuple((int, int)); - -let intTuple = (20, 20); - -let notTupled: notTupleVariant = - NotActuallyATuple(10, 10); - -/* Doesn't work because we've correctly annotated parse tree nodes with explicit_arity! */ -/* let notTupled: notTupleVariant = NotActuallyATuple (10, 10); */ -let funcOnNotActuallyATuple = - (NotActuallyATuple(x, y)) => - x + y; - -/* let funcOnNotActuallyATuple (NotActuallyATuple (x, y)) = x + y; */ -/* let notTupled: notTupleVariant = NotActuallyATuple intTuple; /*Doesn't work! */ */ -/* At least the above acts as proof that there *is* a distinction that is - honored. */ -let simpleTupled: simpleTupleVariant = - SimpleActuallyATuple(10, 10); - -let simpleTupled: simpleTupleVariant = - SimpleActuallyATuple(intTuple); - -/*Works! */ -let NotActuallyATuple(x, y) = - NotActuallyATuple(10, 20); - -/* Doesn't work because we've correctly annotated parse tree nodes with explicit_arity! */ -/* let unfortunatelyThisStillWorks: simpleTupleVariant = SimpleActuallyATuple 10 10; */ -let yesTupled: tupleVariant = - ActuallyATuple(10, 10); - -let yesTupled: tupleVariant = - ActuallyATuple(10, 10); - -let yesTupled: tupleVariant = - ActuallyATuple(intTuple); - -type threeForms = - | FormOne(int) - | FormTwo(int) - | FormThree; - -let doesntCareWhichForm = x => - switch (x) { - | FormOne(q) - | FormTwo(q) => 10 - | FormThree => 20 - }; - -let doesntCareWhichFormAs = x => - switch (x) { - | FormOne(q) as ppp - | FormTwo(q) as ppp => 10 - | FormThree => 20 - }; - -type colorList1 = [ - otherThingInheritedFrom - | `Red - | `Black -]; - -type colorList2 = [ - | `Red - | `Black - | otherThingInheritedFrom -]; - -type colorList3 = [ - bar - | foo - | `Red - | `Black - | foo -]; - -type colorList = [< - | `Red(int, int) &(int) - | `Black&(int, int) &(int) - | `Blue - > `Red `Black -]; - -1 + doesntCareWhichForm(FormOne(10)); - -1 + doesntCareWhichForm(FormTwo(10)); - -1 + doesntCareWhichForm(FormThree); - -/* Destructured matching at function definition */ -let accessDeeply = - (LocalModule.AccessedThroughModule) => 10; - -let accessDeeplyWithArg = - ( - LocalModule.AccessedThroughModuleWith(x) | - LocalModule.AccessedThroughModuleWithTwo( - _, - x, - ), - ) => x; - -/* Destructured matching *not* at function definition */ -let accessDeeply = x => - switch (x) { - | LocalModule.AccessedThroughModule => 10 - | _ => 0 - }; - -let accessDeeplyWithArg = x => - switch (x) { - | LocalModule.AccessedThroughModuleWith(x) => 10 - | _ => 0 - }; - -/* In OCaml's syntax, to capture the wrapped data, you do: - * - * let myFunc x = function | `Blah (p as retVal) -> retVal` - * - * In OCaml's syntax, to capture the entire pattern you do: - * - * let myFunc x = function | `Blah p as retVal -> retVal` - */ -let accessDeeply = x => - switch (x) { - | LocalModule.AccessedThroughModule as ppp => 1 - }; - -let accessDeeplyWithArg = x => - switch (x) { - | LocalModule.AccessedThroughModuleWith( - x as retVal, - ) => - retVal + 1 - | LocalModule.AccessedThroughModuleWithTwo( - x as retVal1, - y as retVal2, - ) => - retVal1 + retVal2 + 1 - }; - -/* Just to show that by default `as` captures much less aggresively */ -let rec accessDeeplyWithArgRecursive = - (x, count) => - switch (x) { - | LocalModule.AccessedThroughModuleWith(x) as entirePattern => - /* It captures the whole pattern */ - if (count > 0) { - 0; - } else { - accessDeeplyWithArgRecursive( - entirePattern, - count - 1, - ); - } - | LocalModule.AccessedThroughModuleWithTwo( - x, - y, - ) as entirePattern => - /* It captures the whole pattern */ - if (count > 0) { - 0; - } else { - accessDeeplyWithArgRecursive( - entirePattern, - count - 1, - ); - } - }; - -accessDeeplyWithArgRecursive( - LocalModule.AccessedThroughModuleWith(10), - 10, -); - -let run = () => { - TestUtils.printSection("Variants"); - Printf.printf("%d %d \n", x, y); -}; - -type combination('a) = - | HeresTwoConstructorArguments(int, int); - -/** But then how do we parse matches in function arguments? */ -/* We must require parenthesis around construction matching in function args only*/ -let howWouldWeMatchFunctionArgs = - (HeresTwoConstructorArguments(x, y)) => - x + y; - -/* How would we annotate said arg? */ -let howWouldWeMatchFunctionArgs = - ( - HeresTwoConstructorArguments(x, y): - combination('wat), - ) => - x + y; - -let matchingTwoCurriedConstructorsInTuple = x => - switch (x) { - | ( - HeresTwoConstructorArguments(x, y), - HeresTwoConstructorArguments(a, b), - ) => - x + y + a + b - }; - -type twoCurriedConstructors = - | TwoCombos( - combination(int), - combination(int), - ); - -let matchingTwoCurriedConstructorInConstructor = - x => - switch (x) { - | TwoCombos( - HeresTwoConstructorArguments(x, y), - HeresTwoConstructorArguments(a, b), - ) => - a + b + x + y - }; - -type twoCurriedConstructorsPolyMorphic('a) = - | TwoCombos( - combination('a), - combination('a), - ); - -/* Matching records */ -type pointRecord = { - x: int, - y: int, -}; - -type alsoHasARecord = - | Blah - | AlsoHasARecord(int, int, pointRecord); - -let result = - switch ( - AlsoHasARecord(10, 10, {x: 10, y: 20}) - ) { - | Blah => 1000 - | AlsoHasARecord(a, b, {x, y}) => - a + b + x + y - }; - -let rec commentPolymorphicCases: - 'a. - option('a) => int - = - fun - | Some(a) => 1 - /* Comment on one */ - | None => 0; - -let thisWontCompileButLetsSeeHowItFormats = - switch (something) { - | Zero - | One => 10 - }; - -let thisWontCompileButLetsSeeHowItFormats = - fun - | Zero - | One(_, _, _) => 10 - | Two => 20; - -/* Comment on two */ -/** - * GADTs. - */ -type term(_) = - | Int(int): term(int) - | Add: term((int, int) => int) - | App(term('b => 'a), term('b)): term('a); - -let rec eval: type a. term(a) => a = - fun - | Int(n) => n - /* a = int */ - | Add => ((x, y) => x + y) - /* a = int => int => int */ - | App(f, x) => eval(f, eval(x)); - -let rec eval: type a. term(a) => a = - x => - switch (x) { - | Int(n) => n - /* a = int */ - | Add => ((x, y) => x + y) - /* a = int => int => int */ - | App(f, x) => eval(f, eval(x)) - }; - -/* eval called at types (b=>a) and b for fresh b */ -let evalArg = App(App(Add, Int(1)), Int(1)); - -let two = - eval(App(App(Add, Int(1)), Int(1))); - -type someVariant = - | Purple(int) - | Yellow(int); - -let Purple(x) | Yellow(x) = - switch (Yellow(100), Purple(101)) { - | (Yellow(y), Purple(p)) => Yellow(p + y) - | (Purple(p), Yellow(y)) => Purple(y + p) - | (Purple(p), Purple(y)) => Yellow(y + p) - | (Yellow(p), Yellow(y)) => Purple(y + p) - }; - -type tuples = - | Zero - | One(int) - | Two(int, int) - | OneTuple(int, int); - -let myTuple = OneTuple(20, 30); - -let res = - switch (myTuple) { - | Two(x, y) => - try(Two(x, y)) { - | One => "hi" - | Two => "bye" - } - | One => - switch (One) { - | One => "hi" - | _ => "bye" - } - }; - -/* FIXME type somePolyVariant = [ `Purple int | `Yellow int]; */ - -let ylw = `Yellow((100, 100)); - -let prp = `Purple((101, 100)); - -let res = - switch (ylw, prp) { - | (`Yellow(y, y2), `Purple(p, p2)) => - `Yellow((p + y, 0)) - | (`Purple(p, p2), `Yellow(y, y2)) => - `Purple((y + p, 0)) - | (`Purple(p, p2), `Purple(y, y2)) => - `Yellow((y + p, 0)) - | (`Yellow(p, p2), `Yellow(y, y2)) => - `Purple((y + p, 0)) - }; - -let ylw = `Yellow(100); - -let prp = `Purple(101); - -let res = - switch (ylw, prp) { - | (`Yellow(y), `Purple(p)) => `Yellow(p + y) - | (`Purple(p), `Yellow(y)) => `Purple(y + p) - | (`Purple(p), `Purple(y)) => `Yellow(y + p) - | (`Yellow(p), `Yellow(y)) => `Purple(y + p) - }; - -/* - * Now try polymorphic variants with *actual* tuples. - * You'll notice that these become indistinguishable from multiple constructor - * args! explicit_arity doesn't work on polymorphic variants! - * - * Way to resolve this (should also work for non-polymorphic variants): - * - * If you see *one* simple expr list that is a tuple, generate: - * Pexp_tuple (Pexp_tuple ..)) - * - * If you see *one* simple expr list that is *not* a tuple, generate: - * Pexp.. - * - * If you see *multiple* simple exprs, generate: - * Pexp_tuple.. - * - * Though, I'm not sure this will even work. - */ -let ylw = `Yellow((100, 100)); - -let prp = `Purple((101, 101)); - -let res = - switch (ylw, prp) { - | (`Yellow(y, y2), `Purple(p, p2)) => - `Yellow((p + y, 0)) - | (`Purple(p, p2), `Yellow(y, y2)) => - `Purple((y + p, 0)) - | (`Purple(p, p2), `Purple(y, y2)) => - `Yellow((y + p, 0)) - | (`Yellow(p, p2), `Yellow(y, y2)) => - `Purple((y + p, 0)) - }; - -let rec atLeastOneFlushableChildAndNoWipNoPending = - (composition, atPriority) => - switch (composition) { - | [] => false - | [hd, ...tl] => - switch (hd) { - | OpaqueGraph({ - lifecycle: Reconciled(_, []), - }) => - atLeastOneFlushableChildAndNoWipNoPending( - tl, - atPriority, - ) - | OpaqueGraph({ - lifecycle: - ReconciledFlushable( - priority, - _, - _, - _, - _, - _, - ), - }) - | OpaqueGraph({ - lifecycle: - NeverReconciledFlushable( - priority, - _, - _, - _, - _, - ), - }) - when priority == AtPriority => - noWipNoPending(tl, atPriority) - | SuperLongNameThatWontBreakByItselfSoWhenWillHaveToBreak - when - priority - == AtPrasldkfjalsdfjasdlfalsdkf => - noWipNoPending(tl, atPriority) - | _ => false - } - }; - -/* - * When pretty printed, this appears to be multi-argument constructors. - */ -let prp = `Purple((101, 101)); - -let res = - switch (prp) { - | `Yellow(y, y2) => `Yellow((y2 + y, 0)) - | `Purple(p, p2) => `Purple((p2 + p, 0)) - }; - -/* - * Testing explicit arity. - */ -let rec map = f => - fun - | Node(None, m) => - Node(None, M.map(map(f), m)) - | Node(LongModule.Path.None, m) => - Node(None, M.map(map(f), m)) - | Node(LongModule.Path.Some(v), m) => - Node(Some(f(v)), M.map(map(f), m)); - -let myFunc = (x, y, None) => "asdf"; - -let rec map = f => - fun - | Node(None, m) => - Node(None, M.map(map(f), m)) - | Node(LongModule.Path.None, m) => - LongModule.Path.Node( - LongModule.Path.None, - M.map(map(f), m), - ) - | Node(LongModule.Path.Some(v), m) => - LongModule.Path.Node( - LongModule.Path.Some(f(v)), - M.map(map(f), m), - ); - -let myFunc = (x, y, LongModule.Path.None) => "asdf"; - -let listPatternMembersNeedntBeSimple = x => - switch (x) { - | [] => () - | [Blah(x, y), Foo(a, b), ...rest] => () - | [Blah(x, y), Bar(a, b), ...rest] => () - | _ => () - }; - -let listTailPatternNeedntBeSimple = x => - switch (x) { - | [] => () - /* Although this would never typecheck! */ - | [Blah(x, y), Foo(a, b), ...Something(x)] => - () - | _ => () - }; - -let listPatternMayEvenIncludeAliases = x => - switch (x) { - | [] => () - /* Although this would never typecheck! */ - | [ - Blah(x, y) as head, - Foo(a, b) as head2, - ...Something(x) as tail, - ] => - () - | _ => () - }; - -/* - * Testing extensible variants - */ -type attr = ..; - -/* `of` is optional */ -type attr += - | Str(string); - -type attr += - | Point(int, int); - -type attr += - | Float(float) - | Char(char); - -type tag('props) = ..; - -type titleProps = {title: string}; - -type tag('props) += - | Title: tag(titleProps) - | Count(int): tag(int); - -module Graph = { - type node = ..; -}; - -type Graph.node += - | Str = Graph.Str; - -type water = ..; - -type water += - pri - | Ocean; - -type water += - pri - | MineralWater - | SpringWater - | TapWater - | TableWater; - -type Graph.node += - pri - | Node = Expr.Node; - -type Graph.node += - pri - | Node = Expr.Node - | Atom = Expr.Atom; - -/* without single unit arg sugar */ -MyConstructorWithSingleUnitArg(); -/* with single unit arg sugar */ -MyConstructorWithSingleUnitArg(); -/* without single unit arg sugar */ -`polyVariantWithSingleUnitArg(); -/* with single unit arg sugar */ -`polyVariantWithSingleUnitArg(); - -/* #1510: keep ({ and }) together on the same line when breaking */ -Delete({ - uuid: - json - |> Util.member("uuid") - |> Util.to_string, -}); -Delete(( - someLongStuf, - someOtherLongStuff, - okokokok, -)); -Delete([ - someLongStuf, - someOtherLongStuff, - okokokok, -]); -Delete([| - someLongStuf, - someOtherLongStuff, - okokokok, -|]); -Delete([ - someLongStuf, - someOtherLongStuff, - okokokok, - ...veryES6, -]); -Delete({ - pub x = methodOne; - pub y = methodTwo; - pub z = methodThisBreaks -}); - -`Delete({ - uuid: - json - |> Util.member("uuid") - |> Util.to_string, -}); -`Delete(( - someLongStuf, - someOtherLongStuff, - okokokok, -)); -`Delete([ - someLongStuf, - someOtherLongStuff, - okokokok, -]); -`Delete([| - someLongStuf, - someOtherLongStuff, - okokokok, -|]); -`Delete([ - someLongStuf, - someOtherLongStuff, - okokokok, - ...veryES6, -]); -`Delete({ - pub x = methodOne; - pub y = methodTwo; - pub z = methodThisBreaks -}); - -let x: t = `Poly; - -/* Format doc attrs consistent: https://github.com/facebook/reason/issues/2187 */ -type t = - | /** This is some documentation that might be fairly long and grant a line break */ - A - | /** Shorter docs */ - B - | /** Some more longer docs over here that make sense to break lines on too */ - C; - -/* https://github.com/facebook/reason/issues/1828 */ -type widget_state = [ - | `DEFAULT /* here */ - | `HOVER - | `ACTIVE -]; diff --git a/formatTest/unit_tests/expected_output/whitespace.re b/formatTest/unit_tests/expected_output/whitespace.re deleted file mode 100644 index 4acfff66f..000000000 --- a/formatTest/unit_tests/expected_output/whitespace.re +++ /dev/null @@ -1,496 +0,0 @@ -module Test = { - open Belt; - open React; - - type a = int; - type b = string; - - let x = 12; - let y = 34; -}; - -/** recursive let bindings */ - -/* see below */ - -let foo = "abc" -and bar = "def" -and baz = "ghi"; - -/* with whitespace */ - -let foo = "abc" - -and bar = "def" - -and baz = "ghi"; - -/** with whitespace and attrs */ - -/* -> */ - -[@foo] -let foo = "abc" - -[@bar] -and bar = "def" - -[@baz] -and baz = "ghi"; - -module Comments = { - let z = 1; - /* comment *without* whitespace interleaved*/ - let ab = 2; - - let add = (a, b) => a + b; - - /* comment *with* multiple newlines above */ - let min = (a, b) => a - b; - - let a = 1; /* trailing comment ok */ - let b = 2; - - /* comment on top */ - let x = 1; /* this comment sits at the end of the line */ - /* wow another one below too */ - - let add = Test.x; - - /* this - is - a multiline - comment */ - let minus = (a, b) => a - b; - - /* look - another - multi - line - comment */ - let vermenigvuldig = (a, b) => a * b; - /* attach another comment below - it spreads - over - multiple - line - */ - - type x = { - a: int /* comment1*/, - b: string /* comment2 */, - }; -}; - -module FloatingComments = { - let a = 1; - /* a */ - - /* b */ - - /* c */ - let b = 1; - - /* d */ - - let c = 1; - - /* e */ - /* f */ - - let d = 1; - /* g */ - /* h */ - - /* i */ - /* j */ - - /* k */ - /* l */ - let e = 1; -}; - -module FloatingMultiLineComments = { - let a = 1; - /* 1 - 2 */ - - /* ok - another one */ - - /* wow - here */ - let b = 1; - - /* float - -ing */ - /* here - on the second */ - - let c = 1; - - /* one - two */ - /* three - four */ - - /* extreme - comment */ - /* here - on two lines */ - - /* another - one */ - /* chocolate - is - good */ - - let d = 2; -}; - -module type TestModuleType = { - type a = int; - type b = string; - - let x: a; - let y: b; -}; - -let main = () => { - let%lwt tc = tcGetAddr(stdin); - - let a = 1; - - let%lwt () = tcsetattr(stdin, TCSANOW, tc); - - let%lwt _i = write_string(stdout, s, 0, len); - (); -}; - -module PatternMatching = { - let x = - switch (color) { - | Black => () - - | Red => () - - | White => () - }; - - /* with comments */ - let color = - switch (color) { - /* c1 */ - - /* c2 */ - | Black => "black" - - /* c3 */ - - /* c4 */ - /* c5 */ - - /* c6 */ - | Green => "green" - - /* multi - line - comment */ - - | Blue => "blue" - }; -}; - -/** recursive modules without whitespace */ -module rec A: { - type t; - let a_fn: t => B.t; - let of_float: float => t; -} = { - type t = int; - let a_fn = x => B.of_int(x); - let of_float = x => int_of_float(x); -} -/* no whitespace */ -and B: { - type t; - let another_fn: t => A.t; - let of_int: int => t; -} = { - type t = float; - let another_fn = x => A.of_float(x); - let of_int = x => float_of_int(x); -}; - -/** recursive modules with whitespace */ - -/* -> below */ - -module rec A: { - type t; - let a_fn: t => B.t; - let of_float: float => t; -} = { - type t = int; - let a_fn = x => B.of_int(x); - let of_float = x => int_of_float(x); -} - -/** okok */ - -/* lala */ - -and B: { - type t; - let another_fn: t => A.t; - let of_int: int => t; -} = { - type t = float; - let another_fn = x => A.of_float(x); - let of_int = x => float_of_int(x); -}; - -/** recursive modules with attrs */ - -/* -> below */ - -[@foo1] -module rec A: { - type t; - let a_fn: t => B.t; - let of_float: float => t; -} = { - type t = int; - let a_fn = x => B.of_int(x); - let of_float = x => int_of_float(x); -} - -/** okok */ - -/* lala */ - -[@foo2] -and B: { - type t; - let another_fn: t => A.t; - let of_int: int => t; -} = { - type t = float; - let another_fn = x => A.of_float(x); - let of_int = x => float_of_int(x); -}; - -module EdgeCase = { - let x = 1; /* a */ - - /* b */ - - /* c */ - - let x = 1; -}; - -/** Record-like expressions */ -let r = { - a: 1, - - b: 2, - c: 3, -}; - -/* with punning */ -let r = { - a, - - b, - c, -}; - -/* with spread */ -let r = { - ...x, - - a: 1, - - b: 2, - c: 3, -}; - -/* comments */ -let r = { - ...x, - - /* a */ - a: 1, - - /* b */ - /* c */ - - /* d */ - b: 2, - /* e */ - - c: 3, - - /* f */ - d, - - e, -}; - -/* string keys */ -let x = { - "a": 1, - - "b": 2, - "c": 3, -}; - -/* string keys punning */ -let x = { - "a": a, - - "b": b, - "c": c, -}; - -/* string keys with spread */ -let x = { - ...x, - - "a": 1, - - "b": 2, - "c": 3, -}; - -/* string keys with comments */ -let x = { - ...x, - - /* a */ - "a": 1, - - /* b */ - /* c */ - - /* d */ - "b": 2, - /* e */ - - "c": 3, - - /* f */ - "d": d, - - "e": e, -}; - -let make = _children => { - ...component, - - initialState: () => { - posts: [], - activeRoute: - urlToRoute( - ReasonReact.Router.dangerouslyGetInitialUrl(), - ), - }, - - didMount: self => { - let watcherID = - ReasonReact.Router.watchUrl(url => - self.send( - ChangeRoute(urlToRoute(url)), - ) - ); - self.onUnmount(() => - ReasonReact.Router.unwatchUrl(watcherID) - ); - }, - - reducer: (action, state) => - switch (action) { - | ChangeRoute(activeRoute) => - ReasonReact.Update({ - ...state, - activeRoute, - }) - | FetchCats => ReasonReact.NoUpdate - }, - - render: ({state: {posts, activeRoute}}) => -
-

- - {ReasonReact.string("Instagram")} - -

- {switch (activeRoute) { - | Default => - | Detail(postId) => - - }} -
, -}; - -// Recursive types -// Also create another form for splicing in nodes into otherwise fixed length sets. -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -and subtree('t) = - | EmptyInstance: subtree(empty); - -// Also create another form for splicing in nodes into otherwise fixed length sets. -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree - -and subtree('t) = - | EmptyInstance: subtree(empty); - -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -// trailing comment - -// leading comment -and subtree('t) = - | EmptyInstance: subtree(empty); - -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -// trailing comment - -// in between - -// leading comment -and subtree('t) = - | EmptyInstance: subtree(empty); - -// with attrs -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -[@attr] -and subtree('t) = - | EmptyInstance: subtree(empty); - -// with attrs -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree - -[@attr] -and subtree('t) = - | EmptyInstance: subtree(empty); - -let f = (a, b) => a + b; -/* this comment sticks at the end */ - -/* another one below the structure */ -/* this one should stick */ - -/* :) */ diff --git a/formatTest/unit_tests/expected_output/whitespace.rei b/formatTest/unit_tests/expected_output/whitespace.rei deleted file mode 100644 index 8cbda032c..000000000 --- a/formatTest/unit_tests/expected_output/whitespace.rei +++ /dev/null @@ -1,274 +0,0 @@ -/** Interleave whitespace intelligently in signatures */ - -/* a */ -let a: int; - -/** Hi I'm a doc comment for some_definition */ -let some_definition: - ( - ~what_a_long_label: M.its_a_type, - ~just_need_to_make_this: long_enough_to_wrap - ) => - unit; - -/** Hi I'm a doc comment for another_definition */ -let another_definition: unit => unit; - -/* b */ -let b: int; -/* trailing */ - -/* kkk */ -/* ---> */ - -/* amazing */ -let f: int => int; - -/** stick to x */ -type x = string; - -/** one newline below */ - -type x = string; - -/** one newline below with comment */ - -/* comment */ -type x = string; - -/** doc comment attached */ -type payload = - | PStr(structure) - | PSig(signature) - | PTyp(core_type) - | PPat(pattern, option(expression)); - -/** doc comment with whitespace */ - -type payload = - | PStr(structure) - | PSig(signature) - | PTyp(core_type) - | PPat(pattern, option(expression)); - -/** doc comment with whitespace and comment below */ - -/* comment here */ -type payload = - | PStr(structure) - | PSig(signature) - | PTyp(core_type) - | PPat(pattern, option(expression)); - -/** doc attached */ -type core_type = { - ptyp_desc: core_type_desc, - ptyp_loc: Location.t, - ptyp_attributes: attributes, -}; - -/** doc attached with newline */ - -type core_type = { - ptyp_desc: core_type_desc, - ptyp_loc: Location.t, - ptyp_attributes: attributes, -}; - -/** doc attached with newline and comments */ - -/* comment1 */ - -/* comment2 */ -type core_type = { - ptyp_desc: core_type_desc, - ptyp_loc: Location.t, - ptyp_attributes: attributes, -}; - -/** doc attached */ -type water += - | H20 - | Spritzer; - -/** doc with newline */ - -type water += - | H20 - | Spritzer; - -/** doc with newline and comment */ - -/* test */ -type water += - | H20 - | Spritzer; - -/** doc attached */ -exception Key_not_found(string); - -/** doc attached with newline */ - -exception Key_not_found(string); - -/** doc attached with newline and comment */ - -/* comment */ -exception Key_not_found(string); - -/** doc on open */ -open Belt; - -/** doc on open with whitespace */ - -open Belt; - -/** doc on open with whitespace and comment */ - -/* test */ -open Belt; - -/** doc attached */ -include Shared; - -/** doc attached with whitespace */ -include Shared; - -/** doc attached with whitespace and comment */ - -/* test */ -include Shared; - -/** doc attached */ -module type X = {let x: int;}; - -/** doc attached with whitespace */ - -module type X = {let x: int;}; - -/** doc attached with whitespace and comment */ - -/* test */ -module type X = {let x: int;}; - -/** doc attached */ -module X: MX; - -/** doc attached with whitespace */ - -module X: MX; - -/** doc attached with whitespace and comment */ - -/* test */ -module X: MX; - -/** doc attached */ -module X = MX; - -/** doc attached with whitespace */ - -module X = MX; - -/** doc attached with whitespace and comment */ - -/* test */ -module X = MX; - -/** doc attr attached */ -class type x = { - pub height: int; -}; - -/** doc attr with newline */ - -class type x = { - pub height: int; -}; - -/** doc attr with newline and comment */ - -/* test */ -class type x = { - pub height: int; -}; - -/** doc attr attached */; -[@id]; - -/** doc attr with newline */; - -[@id]; - -/** doc attr with newline and comment */; - -/* test */ -[@id]; - -/** doc attr attached */ -[%%obj {a: 1}]; - -/** doc attr attached with newline */ - -[%%obj {a: 1}]; - -/** doc attr attached with newline and comment */ - -/* test */ -[%%obj {a: 1}]; - -/** doc attached */ -class reason: ocaml; - -/** doc attached with whitespace */ - -class reason: ocaml; - -/** doc attached with whitespace and comment */ - -/* test */ -class reason: ocaml; - -/** doc attached */ -module rec X1: Y1 -and X2: Y2; - -/** doc attached with whitespace */ - -module rec X1: Y1 -and X2: Y2; - -/** doc attached with whitespace and comment */ - -/* comment */ -module rec X1: Y1 -and X2: Y2; - -/** rec modules with whitespace */ - -/* -> */ - -module rec X1: Y1 - -and X2: Y2; - -/** rec modules with whitespace and attrs */ - -/* -> */ - -[@foo] -module rec X1: Y1 - -/** another one below */ - -/* random comment */ - -[@bar] -and X2: Y2; - -/* notice the whitespace after the last signature item */ - -/* this one has whitespace interleaved */ -/* stick together */ - -/* :) */ diff --git a/formatTest/unit_tests/expected_output/wrappingTest.re b/formatTest/unit_tests/expected_output/wrappingTest.re deleted file mode 100644 index 3259658c7..000000000 --- a/formatTest/unit_tests/expected_output/wrappingTest.re +++ /dev/null @@ -1,2900 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/* Run the formatting pretty printer with width 50 */ - -/* - * Testing infix wrapping - */ -let reallyLongIdent = 100; -let andYetAnotherReallyLongIdent = 30; - -let something = - reallyLongIdent - + andYetAnotherReallyLongIdent - + reallyLongIdent; - -let something = - /* Hopefully */ - reallyLongIdent - /* It will indent like this */ - + andYetAnotherReallyLongIdent - /* And no further */ - + reallyLongIdent; - -/* Comments can be written like this. - No leading star is required on each line. - Everything will line up just fine. - In this form, include the final closing on the last line. */ -let test = 10; - -/* You could begin the block bar out like this. - And it still works correctly. */ -let test = 10; - -/** Include multiple opening stars if you like. - And it will still work. */ -let test = 10; - -/** This comment will be corrected. - when printed. */ -let test = 10; - -/** Comments with text on line zero - * Still work well with comments that have stars on the left side. - */ -let test = 10; - -/* - * Even though the precedence of the operators are different, no - * "simplification" grouping is needed. - */ -let testPrintingPrecedence = - reallyLongIdent - + reallyLongIdent - * andYetAnotherReallyLongIdent - + reallyLongIdent; - -let testPrintingPrecedence = - reallyLongIdent - /* - * In this case, grouping of the right expression is needed because the - * right side of the infix operator is of *lower* precedence than STAR. - */ - + reallyLongIdent - * ( - reallyLongIdent - + andYetAnotherReallyLongIdent - ) - + reallyLongIdent - * 10; - -let testPrintingPrecedence = - reallyLongIdent - /* - * In this case, grouping of the right expression is needed because the - * right side of the infix operator is of *lower* precedence than STAR. - */ - + reallyLongIdent - * ( - reallyLongIdent - + andYetAnotherReallyLongIdent - ) - + reallyLongIdent; - -let add = (x, y) => x + y; -let testPrintingPrecedence = - reallyLongIdent - /* - * In this case, grouping of the right expression is needed because the - * right side isn't even infix at all. - */ - + reallyLongIdent - * add( - reallyLongIdent, - andYetAnotherReallyLongIdent, - ) - + reallyLongIdent; -/* - * Test wrapping every form of named arguments where various parts are - * commented. - */ -let a = 10; -let b = 20; -/*A*/ -let named = - /* a::a */ - ( - ~a, - /* b::b */ - ~b, - ) => - /* a + b */ - a + b; - -/*B*/ -let namedAlias = - /* a::aa */ - ( - ~a as aa, - /* b::bb */ - ~b as bb, - ) => - /* aa + bb */ - aa + bb; - -/*C*/ -let namedAnnot = - /* ~a a: option(int) */ - ( - ~a: option(int), - /* ~b b: option(int) */ - ~b: option(int), - ) => - /* 20 */ - 20; - -/*D*/ -let namedAliasAnnot = - /* a::(aa: option int) */ - ( - ~a as aa: option(int), - /* b::(bb: option int) */ - ~b as bb: option(int), - ) => - /* 20 */ - 20; - -/*E*/ -let optional = - /* a::a=? */ - ( - ~a=?, - /* b::b=? */ - ~b=?, - /* () */ - (), - ) => - /* 10 */ - 10; - -/*F*/ -let optionalAlias = - /* a::aa */ - ( - ~a as aa=?, - /* ?b:bb */ - ~b as bb=?, - /* () */ - (), - ) => - /* 10 */ - 10; - -/*G*/ -let optionalAnnot = - /* a::(a: option int)=? */ - ( - ~a: option(int)=?, - /* ?b:(b: option int) */ - ~b: option(int)=?, - /* () */ - (), - ) => - /* 10 */ - 10; - -/*H*/ -let optionalAliasAnnot = - /* a::(aa: option int)=? */ - ( - ~a as aa: option(int)=?, - /* b::(bb: option int)=? */ - ~b as bb: option(int)=?, - /* () = */ - (), - ) => - /* 10 */ - 10; -/*I: This one is really annoying? Where's the visual label?*/ -let defOptional = - /* a::a=10 */ - ( - ~a=10, - /* b::b=10 */ - ~b=10, - /* () = */ - (), - ) => - /* 10 */ - 10; - -/*J*/ -let defOptionalAlias = - /* a::aa=10 */ - ( - ~a as aa=10, - /* b::bb=10 */ - ~b as bb=10, - /* () = */ - (), - ) => - /* 10; */ - 10; - -/*K*/ -let defOptionalAnnot = - /* a::(a:int)=10 */ - ( - ~a: int=10, - /* b::(b:int)=10 */ - ~b: int=10, - /* () = */ - (), - ) => - /* 10; */ - 10; - -/*L*/ -let defOptionalAliasAnnot = - /* a::(aa:int)=10 */ - ( - ~a as aa: int=10, - /* b::(bb:int)=10 */ - ~b as bb: int=10, - /* () = */ - (), - ) => - /* 10; */ - 10; - -/* Invoking them */ -named( - /* a::a */ - ~a, - /* b::b; */ - ~b, -); - -named( - /* a::a */ - ~a, - /* b::b; */ - ~b, -); - -optional( - /* a::a */ - ~a, - /* b::b; */ - ~b, -); -optional( - /* a::a */ - ~a, - /* b::b; */ - ~b, -); -let explictlyPassed = - /* optional */ - optional( - /* a::? */ - /* None */ - ~a=?None, - /* b::? */ - /* None; */ - ~b=?None, - ); - -let a = None; -let explictlyPassed = - /* optional */ - optional( - /* a::? */ - ~a?, - /* b::? */ - /* None; */ - ~b=?None, - ); - -let complex_default = - (~callback=(k, d) => 4, x) => 3; - -let myList = /*CommentAfterEqualBeforeList */ [ - 1, - 2, - 3, -]; -let myList = [ - /*CommentAfterEqualBefore1 */ 1, - 2, - 3, -]; -let myList = [ - 1 /*CommentAfterOneBeforeCons */, - 2, - 3, -]; -let myList = [ - 1, - 2 /*CommentAfterTwoBeforeCons */, - 3, -]; -let myList = [ - 1, - 2, - /*CommentAfterConsBeforeThree */ 3, -]; -let myList = [ - 1, - 2, - 3 /*CommentAfterThreeBeforeCons*/, -]; - -let myList = [ - 1, - 2, - 3 /*same w space after three */, -]; -let myList = [ - 1, - 2, - 3 /*same w space before rbracket*/, -]; -let myList = [ - 1, - 2, - 3 /*same w both */, -]; - -/* End of line comments */ -let myList = [ - 1, - 2, - 3 /*no space after three */ -]; -let myList = [ - 1, - 2, - 3 /*same w space after three */ -]; -let myList = [ - 1, - 2, /*no space after two comma */ - 3, -]; -let myList = [ - 1, - 2, /*same w space after two comma */ - 3, -]; - -/* End of line comments */ -let myList = [ - 1, - 2, /*no space after two comma */ - 3, -]; -let myList = [ - 1, - 2, /*same w space after two comma */ - 3, -]; -let myRec = { - x: 1, - y: 2, /*no space after two */ - z: 3, -}; -let myRec = { - x: 1, - y: 2, /*same w space after two */ - z: 3, -}; - -/* Ensure end of line comments force breaks */ -let myList = [ - 1, - 2, - 3 /* */ -]; -let myList = [1, 2, /**/ 3]; - -let myList = [ - 1, - 2, - 3 /*CommentAfterConsBeforeAppendedTo */, - ...myList, -]; -let myList = [3, 4, 5]; - -let simpleListPattern = x => - switch (x) { - | [1, 2, 3] => 0 - | _ => 0 - }; - -type blahType = string; - -let x: blahType = "asdf"; - -type nameAge = { - age: int, - name: string, -}; - -type hasABunch = { - /* - * Field comment - */ - fieldOne: int, - fieldtwo: list(int), - fieldThree: list(string), - fieldFour: nameAge, - /* Comment at bottom of record type def */ -}; - -type functionsInARecord = { - adder: int => int, - minuser: int => int, -}; - -let myFunctionsInARecord = { - adder: x => x, - minuser: x => x, -}; - -let myFunctionsInARecordThatMustWrap = { - /* Desired wrapping */ - adder: reallyLongArgument => reallyLongArgument, - minuser: anotherReallyLongArgument => anotherReallyLongArgument, - /* Comment at bottom of record */ -}; - -type twoArgFunctionsInARecord = { - adder: (int, int) => int, - minuser: (int, int) => int, -}; - -let myFunctionsInARecordThatMustWrap = { - /* Desired wrapping */ - adder: - ( - reallyLongArgument, - anotherReallyLongArgument, - ) => reallyLongArgument, - minuser: - ( - reallyLongArgument, - anotherReallyLongArgument, - ) => - reallyLongArgument - + anotherReallyLongArgument, -}; - -type threeArgFunctionsInARecord = { - adder: (int, int, int) => int, - minuser: (int, int, int) => int, -}; - -let myFunctionsInARecordThatMustWrap = { - /* Desired wrapping */ - adder: - /* Even if you have a comment before fun */ - ( - reallyLongArgument, - /* Or before the first arg */ - anotherReallyLongArgument, - yetAnotherReallyLongArgument, - ) => reallyLongArgument, - minuser: - ( - reallyLongArgument, - anotherReallyLongArgument, - anotherReallyLongArgument, - ) => - reallyLongArgument - + anotherReallyLongArgument, -}; - -let oneArgShouldWrapToAlignWith = - theFunctionNameBinding => theFunctionNameBinding; - -let twoArgsShouldWrapToAlignWith = - (firstArgHere, secondArgThere) => secondArgThere; - -let rec oneArgShouldWrapToAlignWith = - theFunctionNameBinding => theFunctionNameBinding; - -let rec twoArgsShouldWrapToAlignWith = - (firstArgHere, secondArgThere) => secondArgThere; - -let secondArgShouldWrap = - (pointLess, (a, b, c, d, e, f, g, h)) => - pointLess + a + b + c + d + e; - -/* Now check that one and two args both indent the same when applying */ -let reallyReallyLongVarName = "hello"; -let result = - oneArgShouldWrapToAlignWith( - reallyReallyLongVarName, - ); -let result = - twoArgsShouldWrapToAlignWith( - reallyReallyLongVarName, - reallyReallyLongVarName, - ); - -let justReturn = x => x; - -/* With default formatting settings: Two arguments are special cased in - function application "justReturn hasABunch" */ -let acceptsTwoThings = - (nameAge: nameAge, hasABunch: hasABunch) => - justReturn(hasABunch); - -/* - Ideally, we'd allow "acceptsTwoThings {age, name}" on the first line, then - wrapping the final argument across multiple, but that is difficult to tell - the formatter "if the final argument cannot fit", but everything else can, - then only wrap the final argument with open faced braces. It's possible, but - not a v1 feature of wrapping. - */ -let result = - acceptsTwoThings( - {age: 20, name: "a"}, - { - fieldOne: 10, - fieldtwo: [10, 20], - fieldThree: ["one", "two"], - fieldFour: { - age: 20, - name: "joe", - }, - }, - ); - -let howDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark = - (x, y, z) => - x + y + z; -let howDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark = - (x, y) => - x + y; -let reallyHowDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark = - (x, y, z) => - x + y + z; -let reallyHowDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark = - (x, y) => - x + y; - -let reallyLongFunctionNameThatJustConcats = a => - String.concat("-", a); - -let seeHowLongValuesWrap = { - age: 30, - name: - reallyLongFunctionNameThatJustConcats([ - "one", - "two", - "two", - "two", - "two", - "two", - "two", - ]), -}; - -/* - /--Everything up to the arrow is label left--\ /-The return is label right-\ - /-append => to last-\ - /-----------------------\ /--------------------\ */ -let onlyReturnWraps = ((a, b, c, d, e, f)) => ( - a, - b, - c, - d, - e, - f, -); - -let bothArgsWrapAndIndent = - ((a, b, c, d, e, f), (h, i, j, k, l, m)) => ( - a, - b, - c, - d, - e, - f, -); - -let result = - onlyReturnWraps((10, 11, 12, 13, 14, 15)); - -let result = - bothArgsWrapAndIndent( - (10, 11, 12, 13, 14, 15), - (10, 11, 12, 13, 14, 15), - ); - -type sixteenTuple = ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -); - -/* Nothing annotated */ -let echoTuple = - ( - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ), - ) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -); - -/* Nothing annotated fun */ -let echoTuple = - ( - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ), - ) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -); - -let echoTheEchoer = - (x: sixteenTuple => sixteenTuple) - : (sixteenTuple => sixteenTuple) => x; - -/* Nothing annotated fun, passed to func */ -echoTheEchoer( - ( - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ), - ) => - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ) -); - -/* Argument annotated */ -let echoTuple = - ( - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ): sixteenTuple, - ) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -); - -/* Argument annotated fun */ -let echoTuple = - ( - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ): sixteenTuple, - ) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -); - -/* Argument annotated, return type annotated */ -let echoTuple = - ( - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ): sixteenTuple, - ) - : sixteenTuple => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -); - -/* Desired formatting if first line fits within margin */ -let makeTuple = - ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - ) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -); - -/* Desired formatting if first line fits within margin (70) */ -let ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -) = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); -/* Annotated version */ -let ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -): sixteenTuple = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); -/* Annotated inline */ -let x: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); - -let ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -) = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); -/* Annotated version */ -let ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, -): sixteenTuple = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); -/* Annotated inline */ -let x: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); - -/* Desired formatting if pattern does not fit, arguments do (margin 70) */ - -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -) = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); -/* Annotated */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): sixteenTuple = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); - -/* Annotated */ -/* Destructured */ -/* Inline */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); - -/* Not-Destructured */ -let someResult = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); -/* Annotated */ -/* Not-Destructured */ -let someResult: sixteenTuple = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); -/* Annotated */ -/* Not-Destructured */ -/* Inline */ -let someResult: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - makeTuple( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ); - -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -) = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); -/* Annotated */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): sixteenTuple = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); -/* Annotated Inline */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); -/* Not-Destructured */ -let someResult = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); -/* Annotated */ -/* Not-Destructured */ -let someResult: sixteenTuple = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); -/* Annotated Inline */ -/* Not-Destructured */ -let someResult: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - echoTuple(( - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - )); - -/* Desired formatting if neither fit on one line (margin 70) */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -) = - makeTuple( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, - ); -/* Annoted */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): sixteenTuple = - makeTuple( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, - ); -/* Annoted inline */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - makeTuple( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, - ); -/* Not-Destructured */ -let someResult = - makeTuple( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, - ); -/* Not-Destructured */ -/* Annoted */ -let someResult: sixteenTuple = - makeTuple( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, - ); -/* Not-Destructured */ -/* Annoted inline */ -let someResult: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - makeTuple( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, - ); - -/* Desired formatting if neither fit on one line (margin 70) */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -) = - echoTuple(( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - )); -/* Annoted */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): sixteenTuple = - echoTuple(( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - )); -/* Annoted Inline */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx, -): ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - echoTuple(( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - )); - -/* Desired formatting if neither fit on one line (margin 70) */ -/* Not-Destructured */ -let someResult = - echoTuple(( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - )); -/* Annoted */ -/* Not-Destructured */ -let someResult: sixteenTuple = - echoTuple(( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - )); -/* Annoted Inline */ -/* Not-Destructured */ -let someResult: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = - echoTuple(( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - )); - -/* The rhs of = shouldn't be broken onto its own newline: @see ensureSingleTokenSticksToLabel */ -let someResult: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, -) = someResult; - -type sevenStrings = ( - string, - string, - string, - string, - string, - string, - string, -); -let (only, the, type_, should, have, to_, wrap) = ( - "only", - "the", - "type", - "should", - "have", - "to", - "wrap", -); - -let (only, the, type_, should, have, to_, wrap): sevenStrings = ( - "only", - "the", - "type", - "should", - "have", - "to", - "wrap", -); - -let ifTheNameIsReallyLongTheTypeAndValueShouldBothWrap: ( - string, - string, - string, - string, - string, - string, - string, -) = ( - "only", - "the", - "type", - "should", - "have", - "to", - "wrap", -); -let ( - the, - type_, - and_, - value, - should, - both, - wrap, -): ( - string, - string, - string, - string, - string, - string, - string, -) = ( - "but", - "the", - "destructured", - "assignment", - "should", - "not", - "wrap", -); - -let myPolyFunc: 'a. 'a => 'a = o => o; -let myNonPolyFunc: 'a => 'a = o => o; - -let locallyAbstractFunc = (type a, input: a) => input; -let locallyAbstractFuncNotSugared = - (type a, input: a) => input; -let locallyAbstractFuncAnnotated: type a. a => a = - (type a, input: a) => input; - -/* - Examples of how long versions of these should be wrapped: df stands for - "desired formatting" when the function binding itself must wrap. - */ -let df_myPolyFunc: 'a. 'a => 'a = o => o; -let df_myNonPolyFunc: 'a => 'a = o => o; - -type nameBlahType = {nameBlah: int}; - -let myFunc = (~firstArg, ~another, ~fl) => { - nameBlah: 10, -}; - -type inputEchoRecord('a) = {inputIs: 'a}; -let df_locallyAbstractFunc = - (type a, type b, input: a) => { - inputIs: input, -}; /* With setting ReturnValOnSameLine */ - -let df_locallyAbstractFuncNotSugared = - (type a, type b, input: a) => { - inputIs: input, -}; - -/** - * The following is automatically expanded at the parser level into: - * - * let df_locallyAbstractFuncAnnotated: - * 'a . - * 'a => 'a => inputEchoRecord 'a - * = - * fun (type a) => ( - * fun (input: a) (input: a) => {inputIs: input}: - * a => a => inputEchoRecord a - * ); - * - */ -let df_locallyAbstractFuncAnnotated: - type a. (a, a) => inputEchoRecord(a) = - (input: a, input: a) => {inputIs: input}; - -/** - * The following is automatically expanded at the parser level into: - * - * let df_locallyAbstractFuncAnnotated: - * 'a . - * 'a => 'a => inputEchoRecord 'a - * = - * fun (type a) => ( - * df_locallyAbstractFuncAnnotated: - * a => a => inputEchoRecord a - * ); - * - */ -let df_locallyAbstractFuncAnnotatedRef: - type a. (a, a) => inputEchoRecord(a) = df_locallyAbstractFuncAnnotated; - -/** - * Doesn't do what you want: - * - * let df_locallyAbstractFuncAnnotatedExtra: type a. a => a => inputEchoRecord a = - * fun (type a) - * (input:a) - * (input:a) => { - * inputIs: input - * }; - */ - -/** - * The following is automatically expanded at the parser level into: - * - * let df_locallyAbstractFuncAnnotatedTwo: - * 'a 'b . - * 'a => 'b => (inputEchoRecord 'a, inputEchoRecord 'b) - * = - * fun (type a) (type b) => ( - * fun (input: a) (input2: b) => ({inputIs: input}, {inputIs:input2}): - * a => b => (inputEchoRecord a, inputEchoRecord b) - * ); - * - */ -let df_locallyAbstractFuncAnnotated: - type a b. - (a, b) => - (inputEchoRecord(a), inputEchoRecord(b)) = - (input: a, input2: b) => ( - {inputIs: input}, - {inputIs: input2}, - ); - -/** - * This case shows why inferring what was originally sugar type a b . blahblah - * is not so trivial. We have to take the last Pexp_constraint type, varify the - * constructors, then check if the result is equal to the first - * Ppat_constraint. In this case, they're not equal! - */ -let df_locallyAbstractFuncAnnotated: 'figureMeOut = - (type a, type b) => ( - (input: a, input2: b) => ( - {inputIs: input}, - {inputIs: input2}, - ): - (a, b) => - (inputEchoRecord(a), inputEchoRecord(b)) - ); - -let createTuple_thisFuncShouldWrapCorrectlyNow: - 'a. - ('a, 'a, 'a) => ('a, 'a, 'a) - = - (someVar, someVar2, someVar3) => ( - someVar, - someVar2, - someVar3, - ); - -let theTupleTypeAnnotationShouldWrap: ( - string, - string, - string, - string, -) = ( - "now these tuple values should wrap", - "now these tuple values should wrap", - "now these tuple values should wrap", - "now these tuple values should wrap", -); - -let rec mutuallyRecursiveOne = x => - mutuallyRecursiveTwo(x + x) -and mutuallyRecursiveTwo = y => print_int(y); - -/* The only downside to this is that now you can't redeclare a binding. */ -/* let newMutualRecursionSyntax x => newMutuallyRecursiveTwo (x + x); */ -/* let newMutuallyRecursiveTwo y => print_int y; */ -/* */ - -type x = pri int; -type y = x = ..; -type myType('a, 'b, 'c) = pri ('a, 'b, 'c); - -type privateVariant = - pri | BigSize(int) | SmallSize(int); - -type doubleEqualsDoublePrivateVariant = - privateVariant = - pri | BigSize(int) | SmallSize(int); - -type myRecordWithReallyLongName = { - xx: int, - yy: int, -}; -type doubleEqualsRecord = - myRecordWithReallyLongName = { - xx: int, - yy: int, - }; -type doubleEqualsDoublePrivateRecord = - myRecordWithReallyLongName = - pri { - xx: int, - yy: int, - }; - -type someConstructor = - | SomeConstructorHi(int, int); -type someRecord = { - firstFieldInRecord: int, - secondField: int, -}; - -/* - With settings.functionBindingStyle = AttachFirstTermToLabelIffTwoTotalTerms, - the binding name becomes part of the label when there are only two total - terms in the binding/argument pattern list (the name, followed by one - pattern). - */ -let funcOnSomeConstructorHi = - (SomeConstructorHi(x, y)) => - x + y; - -let funcOnSomeConstructorHi = - (SomeConstructorHi(x, y), secondArg) => - x + y; - -/* With two args */ -let funcOnSomeRecord = - ({firstFieldInRecord, secondField}) => - firstFieldInRecord + secondField; - -let funcOnSomeRecord = - ( - {firstFieldInRecord, secondField}, - secondArg, - ) => - firstFieldInRecord + secondField; - -/* - With settings.functionBindingStyle = DontAttachFirstTermToLabel, - the binding name becomes part of the label when there are only two total - terms in the binding/argument pattern list (the name, followed by one - pattern). - */ -let funcOnSomeConstructorHi = - (SomeConstructorHi(x, y)) => - x + y; - -let funcOnSomeRecord = - ({firstFieldInRecord, secondField}) => - firstFieldInRecord + secondField; - -/* With two args */ -let funcOnSomeConstructorHi = - (SomeConstructorHi(x, y), secondArg) => - x + y; - -let funcOnSomeRecord = - ( - {firstFieldInRecord, secondField}, - secondArg, - ) => - firstFieldInRecord + secondField; - -type simpleTupleVariant = - | SimpleActuallyATuple((int, int)); - -let returnTheSimpleTupleVariant = i => - SimpleActuallyATuple(i, i); - -let shouldWrapLike = whenLongArg => - SimpleActuallyATuple( - whenLongArg, - whenLongArg, - ); - -type recordWithLong = { - someField: int, - anotherField: string, -}; - -/* - * Commenting first of two mutualy recursive types. - */ -type recursiveType = - /* First variant of first mutually recursive */ - | Blah - /* Second variant of first mutually recursive */ - | Another(option(anotherRecursiveType)) - -/* - * Commenting second of two mutually recursive types. - */ -and anotherRecursiveType = - /* Second variant of second mutually recursive */ - | Baz - /* Second variant of second mutually recursive */ - | Recursive(option(recursiveType)); - -/** - * Commented GADT definition. - */ -type term(_) = - /* First variant leaf of GADT */ - | Int /*first var arg */(int) - : /* First GADT res */ term(int) - /* Second variant leaf of GADT */ - | Float /*second var arg */(int) - : /* Second GADT res */ term(int) - /* Third variant leaf of GADT */ - | Bool /*third var arg */(int) - : /* Third GADT res */ term(int); - -/* Commented colors */ -type commentedTypeDef = - /* - * Commenting first variant member. - */ - | First( - ( - /* First field of tuple in first variant member */ - int, - /* Second field of tuple in first variant member */ - int, - ), - ) - /* - * Commenting second variant member. - */ - | Second(int) - /* - * Commenting third variant member. - */ - | Third( - list - /* Commenting deep in type def */ - (list(int)), - ); - -type colors = - | Red(int) - | Black(int) - | Green(int); - -let blah = arg => - switch (arg) { - /* Comment before Bar */ - | /* Comment between bar/pattern */ Red(_) => 1 - /* Comment Before non-first bar */ - | /* Comment betwen bar/pattern */ Black(_) => 0 - | Green(_) => 0 - }; - -let blah = - fun - | Red(_) => 1 - | Black(_) => 0 - | Green(_) => 1; - -let blahCurriedX = x => - fun - /* Comment before first bar */ - /* Comment between first bar and OR pattern */ - | Red(x) - | Black(x) - | Green(x) => 1 - /* Comment before second bar */ - | Black(x) => 0 - | Green(x) => 0; - -type reallyLongVariantNames = - | ReallyLongVariantName(recordWithLong) - | AnotherReallyLongVariantName(int, int, int) - | AnotherReallyLongVariantName2( - int, - int, - int, - ); - -let howDoLongMultiBarPatternsWrap = x => - switch (x) { - | AnotherReallyLongVariantName(_, _, _) => 0 - | AnotherReallyLongVariantName2(_, _, _) => 0 - | ReallyLongVariantName({ - someField, - anotherField, - }) => 0 - }; - -let letsCombineTwoLongPatternsIntoOneCase = x => - switch (x) { - | AnotherReallyLongVariantName(_, _, _) - | AnotherReallyLongVariantName2(_, _, _) => 0 - | ReallyLongVariantName({ - someField, - anotherField, - }) => 0 - }; - -let letsPutAWhereClauseOnTheFirstTwo = x => - switch (x) { - | AnotherReallyLongVariantName(_, _, _) - | AnotherReallyLongVariantName2(_, _, _) - when true => 0 - | ReallyLongVariantName({ - someField, - anotherField, - }) => 0 - }; - -let letsPutAWhereClauseOnTheLast = x => - switch (x) { - | AnotherReallyLongVariantName(_, _, _) - | AnotherReallyLongVariantName2(_, _, _) => 0 - | ReallyLongVariantName({ - someField, - anotherField, - }) - when true => 0 - }; - -type wrappingGadt(_) = - | ThisIsLongSoTypeWillWrap(int) - : wrappingGadt(int) - | Add: wrappingGadt((int, int) => int) - | App( - wrappingGadt('b => 'a), - wrappingGadt('b), - ) - : wrappingGadt('a); - -type withThreeFields = { - name: string, - age: int, - occupation: string, -}; - -let testRecord = { - name: "joe", - age: 20, - occupation: "engineer", -}; -let anotherRecord = { - ...testRecord, - name: "joe++", - age: testRecord.age + 10, -}; - -type polymorphicCommentedType - /* Commenting the first type variable */ - ( - 'a, - /* Commenting the second type variable */ - 'b, - ) = - list('a, 'b); - -/** - * Commenting the entire record definition. - */ -type withThreeFieldsCommented = { - /* Commenting the first field */ - nameCommented: string, - /* Commenting the second field */ - ageCommented: int, - /* Commenting the third field */ - occupationCommented: string, -}; - -/** - * Commenting the entire record. - */ -let testRecordCommented = { - /* Commenting the first field */ - nameCommented: "joe", - /* Commenting the second field */ - ageCommented: 20, - /* Commenting the last field */ - occupationCommented: "engineer", -}; - -/* - * Test comments near the arguments. - */ -let callMeWithComments = - /* Comment before first arg "a" */ - ( - a: int, - /* Comment before second arg "b" */ - b: int, - ) - /* Comment before return type annotation "int" */ - : int => - /* Comment above return value a + b + c */ - a + b + c; - -let callMeWithComments2 = - /* Comment before the only argument */ - ( - ( - a: int, - /* Comment before second arg "b" */ - b: int, - ), - ) - /* Comment before return type annotation "int" */ - : int => - /* Comment above return value a + b + c */ - a + b + c; - -let result = - /* Comment before function to invoke */ - callMeWithComments( - /* Comment before first argument expression */ - 1 + 2 + 3 + 3, - /* Comment before second argument expression */ - 1 + 2 + 3 + 3, - ); - -module type ASig = {let a: int;}; -module type BSig = {let b: int;}; -module AMod = { - let a = 10; -}; -module BMod = { - let b = 10; -}; -module CurriedSugar = - /* Commenting before First curried functor arg */ - /* If these comments aren't formatted correctly - * see how functor args' locations aren't set - * correclty due to the fold_left. - */ - ( - A: ASig, - /* Commenting before Second curried functor arg */ - B: BSig, - ) => { - let result = A.a + B.b; - /* Comment at bottom of module expression */ -}; - -module CurriedSugarFunctorResult = - /* Commenting before functor name*/ - CurriedSugar - /* Commenting before functor arg 1 in app */ - ( - AMod, - /* Commenting before functor arg 2 in app */ - BMod, - ); - -module CurriedSugarFunctorResultInline = - /* Commenting before functor name*/ - CurriedSugar - /* Commenting before functor arg 1 in app */ - ( - { - let a = 10; - }, - { - /* Commenting before functor arg 2 in app */ - let b = 10; - }, - ); - -module type FunctorType = - (ASig, ASig, BSig) => BSig; -/* - * Commenting locations - */ -let commentingBeforeEqual /*beforeEqual*/ = { - name: "hello", - age: 20, - occupation: "programmer", -}; -let commentingAfterEqual = /*afterEqual*/ { - name: "hello", - age: 20, - occupation: "programmer", -}; -let commentingBeforeEqualBeforeType /*beforeEqualBeforeType*/: withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer", -}; -let commentingBeforeEqualAfterType: - withThreeFields /*beforeEqualAfterType*/ = { - name: "hello", - age: 20, - occupation: "programmer", -}; -let commentingAfterEqualAfterType: withThreeFields = /*afterEqual*/ { - name: "hello", - age: 20, - occupation: "programmer", -}; -let /*beforePattern*/ commentingBeforePattern: withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer", -}; -/*beforePattern*/ -let /*beforePattern2 */ commentingBeforePattern2: withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer", -}; - -/*beforePattern*/ -let /*beforePattern2 */ commentingBeforePatternSpecial: withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer", -}; - -let produceRecord /*commentBeforeArg*/ = x => { - name: "hello", - age: 20, - occupation: "programmer", -}; - -let produceRecord = x => /*commentAfterArg*/ { - name: "hello", - age: 20, - occupation: "programmer", -}; - -let myPolyFuncCommentBeforeColon /*beforeColon */: - 'a. - 'a => 'a - = - o => o; -let myPolyFuncCommentAfterColon: 'a. 'a => 'a = - /*afterColon */ - o => o; -let myPolyFuncCommentBeforeArrow: 'a. 'a => 'a = - /*beforeArrow */ - o => o; -let myPolyFuncCommentAfterArrow: - 'a. - 'a => /*afterArrow */ 'a - = - o => o; -/* THIS IS THE ONLY TEST THAT IS FAILING DUE TO BEING NON-IDEMPOTENT */ -/* let myPolyFuncCommentBeforeEqual : 'a . ('a) => 'a /*beforeEqual */ = fun(o) => o; */ -let myPolyFuncCommentAfterEqual: 'a. 'a => 'a = - /*afterEqual */ o => o; - -let myNonPolyFuncCommentBeforeColon /*BeforeColon */: - 'a => 'a = - o => o; -let myNonPolyFuncCommentAfterColon: - /*AfterColon */ 'a => 'a = - o => o; -let myNonPolyFuncCommentBeforeArrow: - 'a /*BeforeArrow */ => 'a = - o => o; -let myNonPolyFuncCommentAfterArrow: - 'a => /*AfterArrow */ 'a = - o => o; -let myNonPolyFuncCommentBeforeEqual: - 'a => 'a /*BeforeEqual */ = - o => o; -let myNonPolyFuncCommentAfterEqual: 'a => 'a = - /*AfterEqual */ o => o; - -let lATCurrySugarCommentBeforeType /*BeforeType */ = - (type a, input: a) => input; -let lATCurrySugarCommentAfterType /*AfterType */ = - (type a, input: a) => input; -let lATCurrySugarCommentBeforeArg = - (type a, /*BeforeArg */ input: a) => input; -let lATCurrySugarCommentAfterArg = - (type a, input: a) => - /*AfterArg */ - input; -let lATCurrySugarCommentAfterArrow = - (type a, input: a) => /*AfterArrow */ input; - -let lATNotSugaredCommentBeforeEqual /*BeforeEqual*/ = - (type a, input: a) => input; -let lATNotSugaredCommentAfterEqual = /*AfterEqual*/ - (type a, input: a) => input; -let lATNotSugaredCommentBeforeType = /*BeforeType*/ - (type a, input: a) => input; -let lATNotSugaredCommentAfterType = /*AfterType*/ - (type a, input: a) => input; -let lATNotSugaredCommentBeforeArg = - (type a, /*BeforeArg*/ input: a) => input; -let lATNotSugaredCommentAfterArg = - (type a, input: a) => - /*AfterArg*/ - input; -let lATNotSugaredCommentAfterArrow = - (type a, input: a) => /*AfterArrow*/ input; - -let lAtFuncAnnotatedCommentBeforeColon /*BeforeColon*/: - type a. a => a = - (type a, input: a) => input; -let lAtFuncAnnotatedCommentAfterColon /*AfterColon*/: - type a. a => a = - (type a, input: a) => input; -let lAtFuncAnnotatedCommentBeforeTypeVar /*BeforeTypeVar*/: - type a. a => a = - (type a, input: a) => input; -let lAtFuncAnnotatedCommentAfterTypeVar /*AfterTypeVar*/: - type a. a => a = - (type a, input: a) => input; -let lAtFuncAnnotatedBeforeEqual: - type a. a => a /*BeforeEqual*/ = - (type a, input: a) => input; -let lAtFuncAnnotatedAfterEqual: type a. a => a = - /*AfterEqual*/ (type a, input: a) => input; - -/* Ternary wrapping comments */ -let ternaryResult = - /* Before Test */ - something - /* Before ifTrue */ - ? callThisFunction(withThisArg) - /* Before ifFalse */ - : thatResult; - -let ternaryResult = - /* Before Test */ - something - /* Before ifTrue */ - ? callThisFunction(withThisArg) - /* Before ifFalse */ - : trailingTest - ? /* before nested ifTrue */ true - : /* before nested ifFalse */ false; - -let returningATernary = (x, y) => - x > y ? "hi" : "by"; - -/** Testing some special comment alignment features */ - -/* Comments can be written like this. - No leading star is required on each line. - Everything will line up just fine. - In this form, include the final closing on the last line. */ -let test = 10; -let test = - /* And if the entire block needs to be re-indented - such as this case, everything will still look okay. */ - 10; - -/* You could begin the block bar out like this. - And it still works correctly. */ -let test = 10; - -/** Include multiple opening stars if you like. - And it will still work. */ -let test = 10; - -/** This comment will be corrected. - when printed. */ -let test = 10; - -/** Comments with text on line zero - * Still work well with comments that have stars on the left side. - */ -let test = 10; - -let test = - /* This kind of comment doesn't exactly render well though. - Not many people write comments like this. - */ - 10; - -let x = - calWith( - reallyLongName, - reallyReallyLongName, - reallyReallyLongName, - reallyReallyLongName, - reallyReallyLongName, - reallyReallyLongName, - a, - a, - a, - alskdjfalskdjfalsdf, - ) - + reallyReallyLongName; - -let onlyDoingThisTopLevelLetToBypassTopLevelSequence = { - let x = { - print_int(1); - print_int(20); /* Missing trailing SEMI */ - }; - - let x = { - print_int(1); - print_int(20); /* Ensure missing middle SEMI reported well */ - print_int(20); - }; - - let x = { - print_int(1); - print_int(20); - 10; - }; /* Missing final SEMI */ - - let x = { - print_int(1); - print_int(20); - 10; - }; - x + x; /* Final item */ -}; - -/* With this unification, anywhere eyou see `= fun` you can just ommit it */ -let blah = a => a; /* Done */ -let blah = a => a; /* Done (almost) */ - -let blah = (a, b) => a; /* Done */ -let blah = (a, b) => a; /* Done (almost) */ - -let tryingTheSameInLocalScope = { - let blah = a => a; /* Done */ - let blah = a => a; /* Done (almost) */ - - let blah = (a, b) => a; /* Done */ - let blah = (a, b) => a; - (); /* Done (almost) */ -}; - -reallyLongFunctionNameWithArrayThatBreaks([| - "one", - "two", - "two", - "two", - "two", - "two", - "two", -|]); - -reallyLongFunctionNameWithRecordStringKeys({ - "one": 2345, - "two": 2345678, - "three": 45678, - "four": 45678, -}); - -fooSpreadES6List([ - "sldkjfklsjdflskjdflksjok", - "more tests", - ...x, -]); diff --git a/formatTest/unit_tests/expected_output/wrappingTest.rei b/formatTest/unit_tests/expected_output/wrappingTest.rei deleted file mode 100644 index b8b2a8132..000000000 --- a/formatTest/unit_tests/expected_output/wrappingTest.rei +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let named: (~a: int, ~b: int) => int; - -let namedAlias: (~a: int, ~b: int) => int; - -let namedAnnot: - (~a: option(int), ~b: option(int)) => int; - -let namedAliasAnnot: - (~a: option(int), ~b: option(int)) => int; - -let optional: (~a: 'a=?, ~b: 'b=?, unit) => int; - -let optionalAlias: - (~a: 'a=?, ~b: 'b=?, unit) => int; - -let optionalAnnot: - (~a: int=?, ~b: int=?, unit) => int; - -let optionalAliasAnnot: - (~a: int=?, ~b: int=?, unit) => int; - -let defOptional: - (~a: int=?, ~b: int=?, unit) => int; - -let defOptionalAlias: - (~a: int=?, ~b: int=?, unit) => int; - -let defOptionalAnnot: - (~a: int=?, ~b: int=?, unit) => int; - -let defOptionalAliasAnnot: - (~a: int=?, ~b: int=?, unit) => int; - -let fun_option_int: - (option(int), option(int)) => int; - -/* Comments can be written like this. - No leading star is required on each line. - Everything will line up just fine. - In this form, include the final closing on the last line. */ -let test: int; -let test: - /* And if the entire block needs to be re-indented - such as this case, everything will still look okay. */ - int; - -/* You could begin the block bar out like this. - And it still works correctly. */ -let test: int; - -/** Include multiple opening stars if you like. - And it will still work. */ -let test: int; - -/** This comment will be corrected. - when printed. */ -let test: int; - -/** Comments with text on line zero - * Still work well with comments that have stars on the left side. - */ -let test: int; - -let test: - /* This kind of comment doesn't exactly render well though. - Not many people write comments like this. - */ - int; diff --git a/formatTest/unit_tests/input/arity.txt b/formatTest/unit_tests/input/arity.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/formatTest/unit_tests/input/assert.re b/formatTest/unit_tests/input/assert.re deleted file mode 100644 index cb6d21f0a..000000000 --- a/formatTest/unit_tests/input/assert.re +++ /dev/null @@ -1,17 +0,0 @@ -switch(true) { - | true => () - | false => assert(false) - | _ => assert false -}; - -let root = { - let root = Doc.rootNode(doc); - assert (root.type_ == "expression"); - assert (Node.namedChildCount(root) == 1); - assert (Node.childCount(root) == 1); - assert (Point.toString(root.startPoint) == "(Point.t {:row 0 :column 0})"); - assert (Point.toString(root.endPoint) == "(Point.t {:row 0 :column 9})"); - root; -}; - -assert(theTruth()); diff --git a/formatTest/unit_tests/input/basicStructures.re b/formatTest/unit_tests/input/basicStructures.re deleted file mode 100644 index 3d6d29c6d..000000000 --- a/formatTest/unit_tests/input/basicStructures.re +++ /dev/null @@ -1,698 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = fun () => {TestUtils.printSection("Basic Structures");}; - -while (something) { - print_string ("You're in a while loop"); - print_newline (); -}; - -for (i in 0 to 5) { - print_int (i); - print_newline (); - for (i in 10 downto 0) { - print_string ("Counting in reverse direction"); - print_newline (); - }; -}; - -for (i in 0 to endOfRangeMustBeSimple(expr,soWrap)) { - print_int (i); - print_newline (); - for (i in theSame(isTrue,ofThe,startOfRange) downto 0) { - print_string ("Counting in reverse direction"); - print_newline (); - }; -}; - -let x = (foo^)^.bar^; - -let x = foo.bar^; - -let x = foo#bar^; - -let x = foo^.bar^; - -let x = (foo^)#bar^; - -/* Prefix operators: - * ! followed by zero or more appropriate_operator_suffix_chars (see the - * lexer). - * ? or ~ followed by at least one appropriate_operator_suffix_chars. - */ -let x = !(! !foo).bar; - -let x = !foo.bar; - -let x = !foo#bar; - -let x = !(!foo).bar; - -let x = !(!foo)#bar; - -let x = ! !foo.bar; - -let x = ?! (!foo.bar); - -let x = ! ?!foo.bar; - -let x = ~! (!foo.bar); - -let x = ! ~!foo.bar; - -let x = ~! ~!foo.bar; - -let x = !!foo.bar; - -let x = !!foo#bar; - -let x = !~foo.bar; - -let x = !~foo#bar; - -let noParensNeeded = !blah.foo.bar; - -let parensNeededAroundFirst = (!blah).foo.bar; - -let parensNeededAroundSecond = (!blah.foo).bar; - -let noParensNeeded = !blah#foo#bar; - -let parensNeededAroundFirst = (!blah)#foo#bar; - -let parensNeededAroundSecond = (!blah#foo)#bar; - - -let parensWithSpaceNeededAroundFirst = (! !blah)#foo#bar; - -let parensWithSpaceNeededAroundSecond = (! !blah#foo)#bar; - -let parensWithSpaceNeededAroundFirst = (?! ~+blah)#foo#bar; - -let parensWithSpaceNeededAroundSecond = (?! ~+blah#foo)#bar; - -let x = !(!foo.bar); - -let x = !(!foo#bar); - -let x = -10; - -let x = -5.0; - -let x = Some(-10); - -let x = Some(-5.0); - -let lazy x = 10; -let lazy (x : int) = 10; -let lazy [] = 10; -let lazy true = 10; -let lazy #x = 10; -let lazy `Variant = 10; -let lazy `variant = 10; -let lazy ('0' .. '9') = 10; -let lazy (lazy true) = 10; -let lazy [%extend] = 10; - -/* Test precedence on access sugar */ -let x = arr^[0]; - -let x = Array.get(arr^,0); - -let x = str^.[0]; - -let x = String.get(str^,0); - -let x = Array.set(arr^,0,1); - -let x = arr^[0] = 1; - -/* Comments */ -/*Below is an empty comment*/ -/**/ -/** IF - *============================================================================ - */; - -let (/++) = (+); /* // indicates the start of a comment, not an infix op */ - -let something = if (self.ext.logSuccess) { - print_string("Did tap"); - print_newline (); - }; - -let logTapSuccess = fun(self) => if (self.ext.logSuccess) { - print_string("Did tap"); - print_newline (); - } else { - (); - }; - -let logTapSuccess(self) = if (self.ext.logSuccess) { - print_string("Did tap"); - print_newline (); - }; - -(!data).field = true; -(!data).field1.field2 = true; -(!data.field1).field2 = true; -((!data).field1).field2 = true; -(!(data.field1)).field2 = true; - -let loop(appTime,frameTime) = { - if (hasSetup.contents) { - setupScene (); - renderIntoTop (); - hasSetup.contents = true; - }; - process(appTime,frameTime); -}; - -/* These parens should be kept around the entire last if/then/else */ -if (something) { - if (somethingElse) { - (); - } else { - "blah"; - }; -}; - -/* These parens should be kept around just the last if/then*/ -if (something) {if (somethingElse) {();} else {"blah";};}; - -/* Parens should be generated to wrap the entire final if then else. - * To test that it's being parsed correclty, should print "one". */ -if (true) { - if (true) { - print_string("one"); - } else { - print_string("two"); - }; -}; - -/* Should print two */ -if (true) { - if (false) { - print_string("one"); - } else { - print_string("two"); - }; -}; - -/* Should not print */ -if (false) { - if (true) { - print_string("one"); - } else { - print_string("two"); - }; -}; - - - -/* Should wrap (if a > b then a else b). - * printer( - */ -let printIfFirstArgGreater = true; -let result = - if (printIfFirstArgGreater) { - fun(a,b) => if (a > b) {print_string("a > b");} else {print_string("b >= a");}; - } else if ({ - fun(a,b) => if (a > b) {print_string("b < a");} else {print_string("a <= b");}; - }) { - print_string ("That could never possibly type check"); - print_newline (); - }; - - -let myRecord = { - nestedRecord: { - anotherNestedRecord: fun(instaComp,displayRect) => - if (Graphics.cgRectIntersectsWithSlop - (defaultCompositeTimerRectSlop,instaComp.relativeRect,displayRect)) { - IoEligible; - } else { - IoInelibleButTryComposition; - } - } -}; - - -if (printIfFirstArgGreater) { - fun(a,b) => if (a > b) {print_string("a > b");}; -} else {fun(a,b) => if (a > b) {print_string("b < a");};}; -/* Should Be Parsed As: Cleary a type error, but at least the parsing makes that clear */ -if (printIfFirstArgGreater) { - fun(a,b) => - if (a > b) { - print_string("a > b"); - } else { - fun(a,b) => if (a > b) {print_string("b < a");}; - }; -}; - -fun(a,b) => if (a > b) {print_string("a > b");}; - -/* What you probably wanted was: */ -if (printIfFirstArgGreater) { - fun(a,b) => (if (a > b) {print_string("a > b");}); -} else { - fun(a,b) => (if (a > b) {print_string("b < a");}); -}; - -/* Mutative if statement: Not used to evaluate to something. */ -if (10 < 100) { - let msg = "If there was any doubt, 10 is in fact less than 100."; - print_string (msg); -} else { - let msg = "All bets are off."; - print_string (msg); -}; - -if (10 < 100) { - print_string ("If there was any doubt, 10 is in fact less than 100."); -} else { - print_string ("All bets are off."); -}; - - -/** TYPE CONSTRAINTS - *============================================================================ - */; -let x = (10:int); -let x:int = 10; -let (x:int) = 10; -let (x:int) = (10:int); -/* let (x:int) = (10:string); */ -/* let (x:string) = ("hello":int); */ - -/** TUPLES - *============================================================================ - */; - -/* In Reason, types look like the data they model! Tuples are no exception. */ -type pairOfInts = (int, int); -let (letBindingWithTypeConstraint:int) = 10; -let ((tupleItem:int), (withTypeConstraint:int)) = (10, 20); - -/* To make sure that tuple field annotations are annotating the entire field */ -let _dummyFunc(x) = 10; -let annotatingFuncApplication = (_dummyFunc("a"):int, _dummyFunc("a"):int); - -/* Pretty printer might stick the [int] at the label. */ -let annotatingSingleFuncApplication = (_dummyFunc("a"):int); - -/* So lets try a place where it won't */ -let annotatingSingleFuncApplication = { - /* Commenting a let binding. */ - let a = 100; - /* Commenting another let binding. */ - let int = 200; - /* - * This demonstrates why named arguments cannot simply have the form (func - * arg:val) - it is indistinguishable from a type constraint. - */ - 2 + (_dummyFunc(a):int); -}; - -let (tupleItem:int, constrainedWithoutGrouping:int) = (10, 20); -let (tupleItem, withOutsideTypeConstraint):(int,int) = (10, 20); - -/* Trailing commas */ -let trailingCommaAccepted = (1, 2,); -let moreTrailing = (1, 2, 3, 4, 5, 7, ); - -/** Immutable Lists - * ============================================================================ - */; - -/* Anatomy: -Head- --------- Tail--------- nil: You can't see nil */ -let x: list(int) = [ 1, 2, 3, 4, 5, 6, 7, 8, 9]; -let hd = "appendedToHead"; -let tl = ["listTo", "append", "to"]; - -/* To push *one* and only *one* item to the front of a list - use [hd, ...tl] */ -let result: list(string) = [hd, ...tl]; - -/* Is the same as writing */ -let result: list(string) = ["appendedToHead", "listTo", "append", "to"]; - -/* To operate on lists, use pattern matching */ -let rec size = fun - | [] => 0 - | [hd, ...tl] => 1 + size(tl); - -/* Optimize for tail recursion */ -let rec size = fun(soFar,lst) => switch (lst) { - | [] => 0 - | [hd, ...tl] => size(soFar + 1,tl) -}; - -let nestedMatch(lstLst) = switch (lstLst) { - | [hd, ...tl] when false => 10 - | [hd, ...tl] => switch (tl) { - | [] => 0 + 0 - | [tlHd, ...tlTl] => 0 + 1 - } - | [] => 0 -}; - -let nestedMatchWithWhen(lstLst) = switch (lstLst) { - | [hd, ...tl] when false => 10 - | [hd, ...tl] when true => switch (tl) { - | [] when false => 0 + 0 - | [] when true => 0 + 0 - | [tlHd, ...tlTl] => 0 + 1 - } - | [] => 0 -}; - - -/** - * Aliasing with "as" during matches. - */; -type mine = MyThing(int) | YourThing(int); -/* - * Reason parses "as" aliases differently than OCaml. - */ -let ppp = switch (MyThing(20)) { - | MyThing(x) as ppp - | YourThing(x) as ppp => ppp -}; - -let MyThing(_) as ppp | YourThing(_) as ppp = ppp; - -/* - * in order to achieve the previous example in ocaml, you would have to group - * as: - */ -let ppp = switch (MyThing(20)) { - | (MyThing(x) as ppp) - | (YourThing(x) as ppp) => ppp -}; - -let (MyThing(_) as ppp) |(YourThing(_) as ppp) = ppp; -/* - * But this isn't needed in Reason because OR patterns have much lower - * precedence - they should be pretty printed in the same way. - */ - - - -/* TODO: */ -/* let rec nestedMatch lstLst => match lstLst with { */ -/* hd::tl: match tl with { */ -/* []: 0 + 0, */ -/* tlHd::tlTl: 0 + 1, */ -/* }, */ -/* []: 0 */ -/* }; */ -/* */ - - -/** ARRAYS - * ============================================================================ - * Arrays are weird looking. Usually you want lists because they support pattern - * matching - that's why they have nicer syntax - to entice you. But if you want - * random access and better control over memory layout, use arrays. - */; -let emptyArray = [||]; -let arrayWithOne = [|10|]; -let arrayWithTwo = [|10, 10|]; -let secondItem = Array.get(arrayWithTwo,1); - -/* Getting And Setting: Yeah, we should really change this */ -/* Get an array item at index 1 */ -let secondItem = arrayWithTwo[1]; -/* Set an array item at index 1 */ -arrayWithTwo[1] = 300; - - -/** - * STRINGS - * ============================================================================ - * The language supports mutating strings, but that should not be depended upon. - */; -let myString = "asdf"; -myString.[2] = '9'; /* Replacing a character: I could do without this sugar */ - - - - -/* FUNCTIONS - *============================================================================= - */ - - - -/* TYPE ANNOTATIONS - * ============================================================================= - */ - - - -let one = 900; -let two = 10000; -/* Tuple expressions can be annotated without additional paren wrapping */ -let myTuple = (one:int, two:int); -type myTupleType = (int, int); -let myTuple = (myTuple:myTupleType); - -/* Anything *outside* of a tuple, must still be annotated within parens. */ -let myTuple = ((one:int, two:int):myTupleType); - -/* Now functions that accept a single argument being a tuple look familiar */ -let addValues = fun (a:int, b:int) => { - a + b; -}; - -let addValues = fun (a:int, b:int) => { - a + b; -}; - -let myFunction = fun (a : int, b : int) : int => a + b; - -let functionReturnValueType (i:int, s:string): (int) => int = fun(x) => x + 1; - -let curriedFormOne (i:int, s:string) = s ++ string_of_int(i); - -let curriedFormTwo (i:int, x:int) :(int, int) = (i, x); -/* let nonCurriedFormTwo = fun (i:int, x:int) (:(int, int)) => (i, x); */ - -let curriedFormThree (i:int, (a:int, b:int):(int, int)) :(int, int, int) = (i, a, b); - -/* let nonCurriedFormThree = fun (i:int, (a:int, b:int):(int, int)) (:(int, int, int)) => (i, a, b); */ - - -/** TODO: But this, however doesn't work. - * let (myCurriedFunc: int => int) a => a; - * Note: This is likely because only "simple patterns" are accepted as constraints - * in let bindings - that may be easy to change. - */; - -type myFuncType = (int, int) => int; - -let myFunc: myFuncType = fun (a,b) => a + b; - -let funcWithTypeLocallyAbstractTypes (type atype, type btype, a, b, c: (atype, btype) => unit) = c(a,b); - -/* Checks that function types aren't unnecessary wrapped */ -type a = ((unit => unit)); - -type b = - | Foo((unit => unit)) - | Bar((unit => unit), (unit => unit), ((a, b) => c)) - | Baz(unit => unit, unit => unit, (a, b) => c); - -type c = - | Foo((a, b) => unit) - | Bar(((a, b) => unit)); - -type d = [> | `Foo((unit => unit))]; - - -/** - * Records: - *============================================================================= - */; - -type withThreeFields = { - name: string, - age: int, - occupation: string -}; - -let testRecord = { - name: "joe", - age: 20, - occupation: "engineer" -}; -let anotherRecord = { - ...testRecord, - name: "joe++", - age: testRecord.age + 10 -}; - -let makeRecordBase () {name: "Joe", age: 30, occupation: "Engineer"}; -let anotherRecord = { - /* These parens should be evaporated. */ - ...(makeRecordBase ()), - name: "joe++", - age: testRecord.age + 10 -}; - -let anotherRecord = { - /* Comments should be correctly placed before ... expression */ - ...makeRecordBase(), - /* Comment after record extension */ - name: "joe++", - age: testRecord.age + 10 -}; - -let anotherRecord = { - /* Currently, type annotations must be wrapped in parens - that's easy to improve */ - ...(makeRecordBase () : withThreeFields), - name: "joe++", - age: testRecord.age + 10 -}; - - -let anotherRecord = { - /* This is meaningless, sure */ - ...someArray.[0] = 20, - name: "joe++", - age: testRecord.age + 10 -}; - -let anotherRecord = { - ...SomeReally.longFunctionCall { - passingRecordField: 0, - andThisOtherRecordField: 10 - }, - name: "joe++", - age: testRecord.age + 10 -}; - -let anotherRecord = { - ...SomeReally.longFunctionCall(withArguments, thatWrap:bool), - name: "joe++", - age: testRecord.age + 10 -}; - -let anotherRecord = { - ...SomeReally.longFunctionCall - (withArg, - ["and", "final", "list", "that", "should", "break"]), - name: "joe++", - age: testRecord.age + 10 -}; - -/* Record type punning */ -type props = {title: string}; - -type state = unit; - -type component = {props}; - -type component2 = {props, state, updater: unit,}; - -type component3 = {props: M.props, state}; - -type mutableComponent = {mutable props}; - -type mutabeleComponent2 = {mutable props, mutable state, style: int,}; - -/* Don't pun parameterized types */ -type description('props) = { - element: string, - tag: tag('props) -}; - -/* Don't pun types from other modules */ -module Foo = { - type bar = {foo: Baz.foo}; -}; - -/* Don't pun field names that aren't "simple" */ -type foo = { - bar: Baz.bar, - qux: qux, - fooo: Fooo.fooo -}; - -let moreFoo = { - bar: Baz.bar, - qux: qux, - fooo: Fooo.fooo -}; - -/* record value punning */ - -let props = {title: "hi"}; -/* no punning available for a single field. Can't tell the difference with a scope + expression */ -let componentA = {props: props}; -/* pun for real */ -let componentB = {props: props, state: ()}; -/* pun fields with module prefix too */ -let foo = {Foo.foo: foo}; -let bar = {Foo.foo: foo, bar: 1}; -let bar = {bar: 1, Foo.foo: foo}; -let bar = {Foo.foo: foo, Bar.bar: bar}; - -fun ({M.x: x, y: y}) => 1; - -switch (foo) { -| {y: 1, M.x: x} => 2 -}; - -/* Requested in #566 */ -let break_after_equal = no_break_from_here(some_call(to_here)); - -/* Pexp_letexception */ -let () = { - exception E; - raise(E) -}; - -/* # 1587: don't print fun keyword when printing Pexp_fun in a record expression */ -{contents: fun () => ((): unit)}; - -/* #1556: Always break nested record/obj */ -let z = {a: {b: c, d: e}, f: g}; - -let z = {a: {"b": c, "d": e}, f: g}; - -let z = {a: {pub b = c; pub d = e}, f: g}; - -let z = {"a": {"b": c, "d": e}, "f": g}; - -let z = {"a": {b: c, d: e}, "f": g}; - -let z = {"a": {pub b = c; pub d = e}, "f": g}; - - -/** - * Unnecessary parens should be removed. - */ -let unitLambda = (()) => (); -let identifierLambda = (a) => (); -let underscoreLambda = (_) => (); -it("should remove parens", (a) => { - print_string("did it work?"); - print_string("did it work?"); -}); - -/* https://github.com/facebook/reason/issues/1554 */ -(curNode^)##childNodes; - -foo(preserveBraces => { - inCallback -}); - -foo(preserveBraces => { - inFirstPos -}, secondArg); - -foo(oneArg, preserveBraces => { - inFirstPos -}, secondArg); diff --git a/formatTest/unit_tests/input/bigarray.re b/formatTest/unit_tests/input/bigarray.re deleted file mode 100644 index 6e2edcb90..000000000 --- a/formatTest/unit_tests/input/bigarray.re +++ /dev/null @@ -1,13 +0,0 @@ -my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine}; - -my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine}; - -my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine}; - -my_big_array3.{reallyLongString, reallyLongString, reallyLongString, reallyLongString, reallyLongString}; - -my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine} = 3.0; - -my_big_array3.{reallyLongStringThatWillDefinitelyBreakLine, reallyLongStringThatWillDefinitelyBreakLine} = 3.0; - -my_big_array3.{reallyLongString, reallyLongString, reallyLongString, reallyLongString, reallyLongString} = 3.0; diff --git a/formatTest/unit_tests/input/bucklescript.re b/formatTest/unit_tests/input/bucklescript.re deleted file mode 100644 index 369bcb2a3..000000000 --- a/formatTest/unit_tests/input/bucklescript.re +++ /dev/null @@ -1,95 +0,0 @@ -bla#=10; - -bla#=Some(10); - -bla#=someFunc(Some(10)); - -test##var#=Some(-10); - -obj##.prop; - -obj##.prod := exp; - -preview##style##border#=Js.string("1px black dashed"); - -(preview##(style##border)#=args)(somenum); - -(x##y)##z#=((xxxx##yyyy)##zzzz); - -let result = js_method_run1((!react)#createElement,foo); - -add(zz##yy,xx##ww); - -/* These should print the same */ -let res = ((x##y) + (z##q)); /* AST */ -let res = x##y + z##q; /* Minimum parens */ - -/* These should print the same */ -let res = (y + (z##q)##a); /* AST */ -let res = y + z##q##a; /* Min parens */ - -/* Make sure it's actually parsed as left precedence - * and that is maintained when printed */ -let res = (z##(q##a)); /* AST */ -let res = z##(q##a); /* Min parens */ - -/* These should print the same */ -let res = (! (x##y)); /* AST */ -let res = !x##y; /* Minimum parens */ - -/* These should print the same */ -let res = (!(z##q)##a); /* AST */ -let res = !z##q##a; /* Min parens */ - -/* These should print the same */ -let res = (?!! (x##y)); /* AST */ -let res = ?!!x##y; /* Minimum parens */ - -/* These should print the same */ -let res = (?!!z##(q##a)); /* AST */ -let res = ?!!z##(q##a); /* Min parens */ - -res #= ?!!z ## q; -res #= ?!!z##(q##a); - -let result = myFunction(x(y)## z, a(b)#= c); - -(!x)##y##(b##c); - -type a = Js.t({. foo: bar}); - -let a = {"key": 10}; - -let b = {"nested": {"objs": {"are": {"nice": "<3"}}}}; - -let c = {"a": a, "b": b, "func": fun(a)=> a##c#=func(10)}; - -let d = {"a": a2, "b": b , "func": fun(a)=> {"a": (fun(arg1,arg2)=> arg1 + arg2)}}; - -let a = {"/foo": 10}; - -let isArrayPolyfill: [@bs] ((int) => bool) = [%bs.raw - "function(a) {return Object.prototype.toString.call(a) === '[object Array]'}" -]; - -this#arrayInObject[count] = 1; - -type y = {. - [@bs.set no_get] "height" : int, - [@bs.set no_get] "width" : int -}; - -type y = { - . - [@foo barbaz] "heightThatIsASuperLongStringForceBreak": int => unit, - [@foo barbaz] "widthThatIsASuperLongStringForceBreak": int => unit, -}; - -type y = { - . - [@foo barbaz] "width": (int, int, int, float, float, float) => unit, - [@foo barbaz] "height": (int, int, int, float, float, float) => unit, -}; - -/* https://github.com/facebook/reason/issues/2121 */ -Style.( { "container": 3 }); diff --git a/formatTest/unit_tests/input/class_types.re b/formatTest/unit_tests/input/class_types.re deleted file mode 100644 index 168306e5a..000000000 --- a/formatTest/unit_tests/input/class_types.re +++ /dev/null @@ -1,37 +0,0 @@ -class type _module ('provider_impl) = { - -}; -type t; -class type bzz = { - inherit _module(t) -}; - -class type t = { as 'a; - constraint 'a = #s -}; - -/* https://github.com/facebook/reason/issues/2037 */ -class type xt = { as 'a }; - -class x = { - as self -}; - -class type classWithNoArgType { - pub x : int; - pub y : int -}; - -class classWithNoArg { - pub x = 0; - pub y = 0 -}; - -class type t = { - open M; - as 'a; -}; - -class type t = { - open M; -}; diff --git a/formatTest/unit_tests/input/emptyFileComment.re b/formatTest/unit_tests/input/emptyFileComment.re deleted file mode 100644 index eb2b9c00d..000000000 --- a/formatTest/unit_tests/input/emptyFileComment.re +++ /dev/null @@ -1 +0,0 @@ -// file with just a single line comment diff --git a/formatTest/unit_tests/input/escapesInStrings.re b/formatTest/unit_tests/input/escapesInStrings.re deleted file mode 100755 index 51e486fe1..000000000 --- a/formatTest/unit_tests/input/escapesInStrings.re +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/* - let str = "@[.... some formatting ....@\n\010@."; - */ - -let str = "@[.... some formatting ....@\n\010@."; -let str = {abcd|@[.... some formatting ....@\n\010@.|abcd}; - -let utf8_string = "😁"; - -let keep_representation = "\n -\t . this should be on a new line\ - ^ this should be aligned with the . -"; diff --git a/formatTest/unit_tests/input/extensions.re b/formatTest/unit_tests/input/extensions.re deleted file mode 100644 index 8024f3c36..000000000 --- a/formatTest/unit_tests/input/extensions.re +++ /dev/null @@ -1,374 +0,0 @@ -/* Extension sugar */ - -[%extend open M]; - -[%extend module M = {}]; - -[%extend module type M = {}]; - -type a = [%extend int]; - -let%extend x = "hi"; - -let x = { - let%extend x = (); - ignore(); - [%extend ignore()]; - let%extend x = (); - [%extend return("hi")]; -}; - -let x = { - if%extend (true) {1} else {2}; - switch%extend (None) { - | Some(x) => assert(false) - | None => () - }; - try%extend(raise(Not_found)) { - | Not_found => () - | Invalid_argument(msg) => prerr_endline(msg) - }; -}; - -let x = { - if%extend (true) {1} else {2}; -}; - -let x = { - switch%extend (None) { - | Some(x) => assert(false) - | None => () - }; -}; - -let x = { - try%extend(raise(Not_found)) { - | Not_found => () - | Invalid_argument(msg) => prerr_endline(msg) - }; -}; - -/* At structure level */ - -try%extend() { -| _ => () -}; - -switch%extend () { -| _ => () -}; - -if%extend (true) {1} else {2}; - -for%extend (i in 1 to 10) { - (); -}; - -while%extend (false) { - (); -}; - -[%extend () => ()]; - -fun%extend -| None => () -| Some(1) => (); - -/* In a top-level binding */ - -let x = - try%extend() { - | _ => () - }; - -let x = - switch%extend () { - | _ => () - }; - -let x = if%extend (true) {1} else {2}; - -let x = - for%extend (i in 1 to 10) { - (); - }; - -let x = - while%extend (false) { - (); - }; - -let x = [%extend () => ()]; - -let x = - fun%extend - | None => () - | Some(1) => (); - -/* With two extensions, alone */ - -let x = { - [%extend1 - try%extend2() { - | _ => () - }]; -}; - -let x = { - [%extend1 - switch%extend2 () { - | _ => () - }]; -}; - -let x = { - [%extend1 if%extend2 (true) {1} else {2}]; -}; - -let x = { - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; -}; - -let x = { - [%extend1 - while%extend2 (false) { - (); - }]; -}; - -let x = { - [%extend1 [%extend2 () => ()]]; -}; - -let x = { - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; -}; - -/* With two extensions, first in sequence */ - -let x = { - [%extend1 - try%extend2() { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - switch%extend2 () { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 if%extend2 (true) {1} else {2}]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - while%extend2 (false) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 [%extend2 () => ()]]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; -}; - -/* With two extensions, in sequence */ - -let x = { - ignore(); - [%extend1 - try%extend2() { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - switch%extend2 () { - | _ => () - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 if%extend2 (true) {1} else {2}]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - while%extend2 (false) { - (); - }]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 [%extend2 () => ()]]; - ignore(); -}; - -let x = { - ignore(); - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; - ignore(); -}; - -/* With two extensions, second in sequence */ - -let x = { - ignore(); - [%extend1 - try%extend2() { - | _ => () - }]; -}; - -let x = { - ignore(); - [%extend1 - switch%extend2 () { - | _ => () - }]; -}; - -let x = { - ignore(); - [%extend1 if%extend2 (true) {1} else {2}]; -}; - -let x = { - ignore(); - [%extend1 - for%extend2 (i in 1 to 10) { - (); - }]; -}; - -let x = { - ignore(); - [%extend1 - while%extend2 (false) { - (); - }]; -}; - -let x = { - ignore(); - [%extend1 [%extend2 () => ()]]; -}; - -let x = { - ignore(); - [%extend1 - fun%extend2 - | None => () - | Some(1) => ()]; -}; - -let _ = - switch%ext (expr) { - | A => - /* Comment under A */ - () - | B => () - }; - -/* comments in presence of extension point syntax #1938 */ -let () = { - /* 1. comment attached to extension */ - [%defer - /* 2. comment attached to expr in extension */ - cleanup()]; - /* 3. comment attached to next expr */ - something_else(); -}; - -/* comments in presence of extension point syntax #1938 */ -let () = { - /* random let binding */ - let x = 1; - /* 1. comment attached to extension */ - [%defer - /* 2. comment attached to expr in extension */ - cleanup()]; - /* 3. comment attached to next expr */ - something_else(); -}; - -let f = [%bs.raw x => x]; - -[%bs.raw x => x]; - -let work = () => { - open Syntax; - let%bind name = x; - name; -}; - -/** header */ -[%raw "console.log(42)"]; - -/* https://github.com/facebook/reason/issues/2032 */ -let predicate = - predicate === Functions.alwaysTrue1 - ? defaultPredicate - : fun%extend - | None => false - | Some(exn) => predicate(exn); - -/* Attributes shoudn't be inlined and always break */ -[@warning "-8"] -let a = 3; diff --git a/formatTest/unit_tests/input/externals.re b/formatTest/unit_tests/input/externals.re deleted file mode 100644 index 25753dc75..000000000 --- a/formatTest/unit_tests/input/externals.re +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Tests external formatting. - */ -external foo : type_ = "%caml_something_or_other"; - -external multilineStringExtern : int => int = {| - Did you know you can put whatver you want inside - of an extern? Good luck with the linker though! -|}; - -module Nested = { - external multilineStringExtern : int => int = {| - Did you know you can put whatver you want inside - of an extern? Good luck with the linker though! - |}; - external multilineStringExternWithTag : int => int = {js| - Did you know you can put whatver you want inside - of an extern? Good luck with the linker though! - |js}; - external multilineStringExtern : int => int = " - And this has a newline in it, so will be formatted with { | | } style string"; - external containsQuote : int => int = "This has a quote in it \" so will be formatted as { | | } style string"; - external noIndentation : int => int = {| -Did you know you can put whatver you want inside -of an extern? Good luck with the linker though! -|}; -}; diff --git a/formatTest/unit_tests/input/features403.re b/formatTest/unit_tests/input/features403.re deleted file mode 100644 index 203c7851b..000000000 --- a/formatTest/unit_tests/input/features403.re +++ /dev/null @@ -1,32 +0,0 @@ -type t = A { a : int } | B; - -let f = fun - | B => 0 - | A { a } => a; - -type nonrec u('a) = Box('a); - -type expr('a) = - | Val {value: 'a} :expr('a) - | Add {left: expr(int), right: expr(int)} :expr(int) - | Is0 {test: expr(int)} :expr(bool) - | If {pred: expr(bool), true_branch: expr('a), false_branch: expr('a)} :expr('a); - -let rec eval: type a. (expr(a)) => a = - fun(e) => - switch (e) { - | Is0 {test} => eval(test) == 0 - | Val {value} => value - | Add {left, right} => eval(left) + eval(right) - | If {pred, true_branch, false_branch} => - if (eval(pred)) { - eval(true_branch) - } else { - eval(false_branch) - } - }; - -type hlist = - | [] : hlist; - -let foo (type a, type b) = 5; diff --git a/formatTest/unit_tests/input/firstClassModules.re b/formatTest/unit_tests/input/firstClassModules.re deleted file mode 100644 index c84bb2008..000000000 --- a/formatTest/unit_tests/input/firstClassModules.re +++ /dev/null @@ -1,50 +0,0 @@ -module Modifier = (val ((Db.Hashtbl.create ()): (module Db.Sig with type t = Mods.t))); -module Modifier = (val (Db.Hashtbl.create ()): (Db.Sig with type t = Mods.t)); -module Modifier = (val (Db.Hashtbl.create (): module Db.Sig with type t = Mods.t)); -module Modifier = (val Db.Hashtbl.create (): Db.Sig with type t = Mods.t); -module Modifier = (val Db.Hashtbl.create ()); -module Modifier = (val Db.Hashtbl.create (): - Db.Sig with type t = Mods.t and type s = Mods.s and - type z = Mods.z); - -module Lowercase = (val stuff: lowercase); -module Lowercase = (val stuff: Foo.Bar.lowercase); -module Lowercase = (val stuff: Foo.Bar.lowercase with type t = Mods.t); - -module T = (val (module FirstClass): myLowercaseModule); - -module Three = (val three: X_int); - -let thing: module Thing = (module MyModule); -let thing: module Foo.Bar.Thing = (module MyModule); - -let smallThing: (module lowercase) = (module Mod); -let smallThing: module lowercase = (module Mod); -let smallThing: (module Foo.Bar.lowercase) = (module Mod); -let smallThing: module Foo.Bar.lowercase = (module Mod); - -let f = ((module Add : S.Z), x) => Add.add(x); - -let join_iter = - (type ta, type tb, - ((module A): (module Sig with type t=ta)), - (module B): (module Sig with type t=tb), - module C: module Sig with type t=tb, - module D: Sig with type t=tb and type s =tc and type x = td and type z = te, - fn) => fn(A.value + B.value); - -type t = ref((module Console)); -type firstClassConsole = (module Console); - -type crossPlatform = Platform.t((module Windows), (module Mac), (module Linux)); - -type t = (module FirstClass, module SecondClass); - -type withAttr = ref([@bar] (module Console)); -type withAttrPlatform = Platform.t([@bar] (module Iphone), [@foo] (module Ipad)); -type tWithAttr = ([@foo] (module FirstClass), [@bar] (module SecondClass)); - -type t = {m: (module M)}; - -/* https://github.com/facebook/reason/issues/2150 */ -type t('a) = (module Test with type a = 'a); diff --git a/formatTest/unit_tests/input/fixme.re b/formatTest/unit_tests/input/fixme.re deleted file mode 100644 index ccd8d9d16..000000000 --- a/formatTest/unit_tests/input/fixme.re +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Problem: In thise example, the comment should have a space after it. - */ -let store_attributes(proc_attributes) { - let should_write = - /* only overwrite defined procedures */proc_attributes.ProcAttributes.is_defined || - not (DB.file_exists(attributes_file)); - should_write; -}; diff --git a/formatTest/unit_tests/input/functionInfix.re b/formatTest/unit_tests/input/functionInfix.re deleted file mode 100644 index 8400c8e65..000000000 --- a/formatTest/unit_tests/input/functionInfix.re +++ /dev/null @@ -1,65 +0,0 @@ -let entries = ref([]); - -let all = ref(0); - -/* - * >>= is left associative, and higher precedence than => - */ -let (>>=)(a,b) = b(a); - -let fff = (); - - -/** Parse tree */ -(fff >>= (xx(yy) >>= aa(bb))); - -/* Minimum parenthesis */ -fff >>= xx(yy) >>= aa(bb); - -/* Actually printed parenthesis */ -fff >>= (xx(yy) >>= aa(bb)); - - -/** Parse tree */ -fff >>= ((fun(xx)=> 0) >>= (fun(aa) => 10)); - -/* Minimum parenthesis */ -fff >>= ((fun(xx)=> 0) >>= (fun(aa) => 10)); - -/* Actually printed parenthesis */ -fff >>= ((fun(xx)=> 0) >>= (fun(aa) => 10)); - - -/** Parse tree */ -((fff >>= (fun(xx) => 0)) >>= (fun(aa) => 10)); - -/* Minimum parenthesis */ -/* It is very difficult to actually achieve this. */ -fff >>= (fun(xx) => 0) >>= fun(aa) => 10; - -/* Actually printed. */ -fff >>= (fun(xx) => 0) >>= (fun(aa) => 10); - - -/** Parse tree */ -(fff >>= (fun(xx) => (0 >>= (fun(aa,cc) => 10)))); - -/* Minimum parens - grouping the zero */ -/* Difficult to achieve. */ -fff >>= fun(xx) => 0 >>= (fun(aa,cc) => 10); - -/* Actually printed parenthesis. */ -fff >>= (fun(xx) => 0) >>= (fun(aa,cc) => 10); - -/* Another way you could also write it it */ -(fff >>= fun(xx) => 0) >>= (fun(aa,cc) => 10); - - -/** Parse tree */ -(fff >>= (fun(xx) => 0)); - -/* Minimum parens - grouping the zero */ -fff >>= fun(xx) => 0; - -/* Printed parens - see how more are printed than necessary. */ -fff >>= (fun(xx) => 0); diff --git a/formatTest/unit_tests/input/if.re b/formatTest/unit_tests/input/if.re deleted file mode 100644 index d93485344..000000000 --- a/formatTest/unit_tests/input/if.re +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let logTSuccess = fun(self) => if (self > other) { - print_string("Did T"); - print_newline (); - } else { - (); - }; -let something = if (self.ext.logSuccess) { - print_string("Did T"); - print_newline (); - }; - -let logTSuccess = fun(self) => if (self.ext.logSuccess) { - print_string("Did T"); - print_newline (); - } else { - (); - }; - -if (if (x) {true;} else {false;}) { - true; -} else { - false; -}; - -/* Parens are required around if if it's an argument - this is the same as before. */ -if (callSomeFunction (if (true) {true;} else {false;})) { - true; -} else { - false; -}; - - -/* Notice that to do something strange, your code must *look* strange. */ -/* That's generally a good thing */ -if (callSomeFunction) {if (true) { - true; -};} else { - false; -}; - -if (callSomeFunction {thisIsAnArgument; notTheControlFlow;}) { - thisIsTheControlFlow; -}; - -/* The braces around the test conditions of if statements are not required. - * The only requirement is that the test conditions be "simple". - * The "then" body only need be simple but the parser will print it as a - * sequence (this is a lossless process - nothing changes about the AST). - * - * The else body doesn't even need to be simple (hence the nesting of else if), - * but the printer will print it inside a simple sequence, unless it - * can make it prettier by nesting the else ifs. - * - */ -if (printIfFirstArgGreater) - simpleThen -else thisDoesnt(even,have2,be,simple); - -if (if (x) {true;} else {false;}) { - (); -} else { - (); -}; - -/** TERNARY - *============================================================================ - */ - -let ternaryResult = - something ? - callThisFunction(withThisArg): - thatResult; - -let annotatedTernary = - true && - (something ? true : false : bool); - -let annotatedBranch = - true && - (something ? (true:bool) : false : bool); - -/* The following should be... */ -let whatShouldThisBeParsedAs = - something ? callThisFunction(withThisArg): - trailingTest ? true : false; - -/* ... it should be parsed as */ -let whatShouldThisBeParsedAs = - something ? callThisFunction(withThisArg): - (trailingTest ? true : false); - -/* Should *not* be parsed as */ -let whatShouldThisBeParsedAs = - (something ? callThisFunction(withThisArg): - trailingTest) ? true : false; - -/* the following shoud be... */ -let ternaryFormatting = - something ? notLongEnoughToCauseTwoLineBreaks : other - -/* ideally formatted as -let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks - : other -*/ -let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks - : other - -/* but is currently formatted as the following (which is less than desirable) -let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks : other - */ -let ternaryFormatting = - something - ? notLongEnoughToCauseTwoLineBreaks : other - -let ternaryResult = - aaaaaa ? bbbbbbb : - ccccc ? ddddddd : - eeeee ? fffffff : ggggg; - -/* Should be parsed as: */ -let ternaryResult = - aaaaaa ? bbbbbbb : - (ccccc ? ddddddd : - (eeeee ? fffffff : ggggg)); - -let ternaryResult = - /* The first Parens *must* be preserved! */ - (x ? y : z) ? bbbbbbb : - ccccccc ? ddddddd : - eeeeeee ? fffffff : ggggg; - -let ternaryResult = - aaaaaaa ? bbbbbbb : - /* The second Parens *must* be preserved! */ - (x ? y : z) ? ddddddd : - eeeeeee ? fffffff : ggggg; - -let ternaryResult = - aaaaaaa ? bbbbbbb : - x ? y : z ? ddddddd : - /* The final parent don't need to be preserved */ - eeeeeee ? fffffff : (x ? y : z); - - -let addOne(x) = x + 1; - -let result = - addOne(0) + 0 > 1 ? print_string("this wont print") : print_string("this will"); -/* - * Should be parsed as: - */ -let result = - ((addOne(0) + 0) > 1) ? (print_string("this wont print")) : (print_string("this will")); - - -/* - * Try shouldn't be aliased as ternary! - */ -let res = - try (something) { - | true => "hi" - | false => "bye" - }; - -/* - * Many levels of if elseif should be formatted very nicely. - */ -let result = - if (something) { - Console.log ("First Branch"); - } else if (anotherThing) { - Console.log ("Second Branch"); - } else if (yetAnotherThing) { - Console.log ("Third Branch"); - } else { - Console.log ("Final Case"); - }; - - -/* - * Ternaries are simply switch statements on true/false. It's nice that there - * is a distinction between if and switch (even though if could have just been - * sugar on top of switch) because it allows us to use switching on true/false - * as yet another pun for if/then that should be *preserved* as being distinct - * from if/then (the ternary). - */ -let res = - switch (someExpression) { - | true => "true" - | false => "false" - }; - - -let pngSuffix = - pixRation > 1 ? - "@" ++ string_of_int(pixRation) ++ "x.png" - : ".png"; - diff --git a/formatTest/unit_tests/input/infix.re b/formatTest/unit_tests/input/infix.re deleted file mode 100644 index 402922bdf..000000000 --- a/formatTest/unit_tests/input/infix.re +++ /dev/null @@ -1,1013 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/* - A good way to test if formatting of infix operators groups precedences - correctly, is to write an expression twice. Once in a form where parenthesis - explicitly group according to the parse tree and write it another time - without any parenthesis. After formatting, the two should be equal - textually. - - Reformatting n > 0 times should be idempotent. - - Our formatting algorithm *could* decide to leave equivalently precedented - infix applications ungrouped in parenthesis (which is what the above test - verifies), but the additional parenthesis is nice. */ -/* < > = all have same precedence level/direction(left) */ -let parseTree = ((x > y > z) < a < b) == c == d; - -let minParens = ((x > y > z) < a < b) == c == d; - -let formatted = ((x > y > z) < a < b) == c == d; - -/* Case with === */ - -let parseTree = ((x > y > z) < a < b) === c === d; - -let minParens = ((x > y > z) < a < b) === c === d; - -let formatted = ((x > y > z) < a < b) === c === d; - -/* < > = all have same precedence level and direction (left) */ -let parseTree = a1 < a2 < (b1 > b2 > (y == x == z)); - -let minParens = a1 < a2 < (b1 > b2 > (y == x == z)); - -let formatted = a1 < a2 < (b1 > b2 > (y == x == z)); - -/* Case with === */ - -let parseTree = a1 < a2 < (b1 > b2 > (y === x === z)); - -let minParens = a1 < a2 < (b1 > b2 > (y === x === z)); - -let formatted = a1 < a2 < (b1 > b2 > (y === x === z)); - -/* !=...(left) same level =(left) is higher than :=(right) */ -let parseTree = a1 := a2 := b1 == b2 == (y != x != z); - -let minParens = a1 := a2 := b1 == b2 == (y != x != z); - -let formatted = a1 := a2 := b1 == b2 == (y != x != z); - -/* Case with === */ - -let parseTree = a1 := a2 := b1 === b2 === (y !== x !== z); - -let minParens = a1 := a2 := b1 === b2 === (y !== x !== z); - -let formatted = a1 := a2 := b1 === b2 === (y !== x !== z); - -/* !=...(left) same level =(left) is higher than :=(right) */ -let parseTree = a1 := a2 := b1 == ((b2 == y) != x != z); - -let minParens = a1 := a2 := b1 == ((b2 == y) != x != z); - -let formatted = a1 := a2 := b1 == ((b2 == y) != x != z); - -/* Case with === */ - -let parseTree = a1 := a2 := b1 === ((b2 === y) !== x !== z); - -let minParens = a1 := a2 := b1 === ((b2 === y) !== x !== z); - -let formatted = a1 := a2 := b1 === ((b2 === y) !== x !== z); - -/* &...(left) is higher than &(right). &(right) is equal to &&(right) */ -let parseTree = a1 && (a2 && (b1 & b2 & y &|| x &|| z)); - -let minParens = a1 && a2 && (b1 & b2 & y &|| x &|| z); - -let formatted = a1 && a2 && (b1 & b2 & y &|| x &|| z); - -/** - * Now, let's try an example that resembles the above, yet would require - * parenthesis everywhere. - */ -/* &...(left) is higher than &(right). &(right) is equal to &&(right) */ -let parseTree = ((((a1 && a2) && b1) & b2) & y) &|| (x &|| z); - -let minParens = ((((a1 && a2) && b1) & b2) & y) &|| (x &|| z); - -let formatted = ((((a1 && a2) && b1) & b2) & y) &|| (x &|| z); - -/* **...(right) is higher than *...(left) */ -let parseTree = ((b1 *| b2) *| (y *\*| (x *\*| z))); - -let minParens = b1 *| b2 *| y *\*| x *\*| z; - -let formatted = b1 *| b2 *| y *\*| x *\*| z; - - -/* **...(right) is higher than *...(left) */ -let parseTree = ((b1 *| b2) *| (y *\*| ((x *\*| z) *| a))); - -let minParens = b1 *| b2 *| y *\*| (x *\*| z *| a); - -let formatted = b1 *| b2 *| y *\*| (x *\*| z *| a); - - -/* |...(left) is higher than ||(right) */ -/* All parens should be removed when formatting n > 0 times */ -let parseTree = b1 || b2 || y |\* x |\* z; - -let minParens = b1 || b2 || y |\* x |\* z; - -let formatted = b1 || b2 || y |\* x |\* z; - -/* Associativity effects how parenthesis should be dropped */ -/* This one *shouldn't* expand into two consecutive infix + */ -first + (second + third); - -/* This one *should* */ -first + second + third; - -/* But that's just because + is left associative. Since & is right associative, - * it's the opposite. */ -/* This one *should* expand into two consecutive infix * */ -first & second & third; - -/* This one *shouldn't* */ -(first & second) & third; - -/* || is basically the same as &/&& */ -first || second || third; - -/* This one *shouldn't* */ -(first || second) || third; - -/* No parens should be added/removed from the following when formatting */ -let seeWhichCharacterHasHigherPrecedence = (first |> second |> third) ^> fourth; - -let seeWhichCharacterHasHigherPrecedence = first |> second |> third; - -let seeWhichCharacterHasHigherPrecedence = first + second + third; - -let comparison = (==); - -/* Why would the following two cases have different grouping? */ -let res = blah || DataConstructor(10) || DataConstructor(10) && 10; - -let res = blah && DataConstructor(10) && DataConstructor(10) + 10; - -/* This demonstrates how broken infix pretty printing is: - */ -let curriedComparison = (==)(10); - -let resultOfAdd = 10 + 20 + 40; - -let resultOfAddAndMult = 10 * 1 + 20 * 1 + 40 * 1; - -let greaterThanAndSubtract = 1 - 2 > 4 + 3; - -let greaterThanAndFunctionCalls = pred(1) > pred(2); - -let lessThanAndFunctionCalls = pred(1) < pred(2); - -/* This doesn't type check because it looks like pred - 1 */ -let minusAndInteger = pred - 1; - -let passingMinusOneToFunction = pred (-1); - -let leadingMinusIsCorrectlyNeg = (-1) + 20; - -let leadingMinusIsCorrectlyNeg = 3 > (-1); - -/* Custom infix without labeled args */ -let (|>)(first,second) = first + second; - -/* Should reformat to actually be placed infix */ -let res = first |> second; - -/* Curried shouldn't place infix */ -let res = (|>)(first); - -/* Custom infix with labeled args */ -let (|>)(~first as first, ~second as second) = first + second; - -/* Should NOT reformat named args to actually be placed infix */ -let res = (|>)(~first=first, ~second=second); - -/* Curried shouldn't place infix */ -let res = (|>)(~first=first); - -/* Custom infix accepting *three* without labeled args */ -let (|>)(firsfirst,second,third) = first + second + third; - -/* Should reformat to actually be placed infix if passed two args */ -let res = first |> second; - -let res = (first |> second)(third); - -/* Should NOT reformat to be placed infix if passed all three */ -let res = (|>)(first,second,third); - -/* Same: Curried shouldn't place infix */ -let res = (|>)(first); - -/* In fact, if even just one of the arguments are named, it shouldn't - * be formatted or parsed as infix! */ -(|>)(first,~second=second); - -(|>)(~first=first,second); - -(|>)(first,second,~third=third); - -(first |> second)(~third=third); - -/* Infix has lower precedence than function application */ -first |> second(~third=third); - -let leftAssocGrouping = first |> second |> third; - -let rightAssocGrouping = first ^> second ^> third; - -/* It's definitely the caret. */ -let seeWhichCharacterHasHigherPrecedence = first |> second ^> third; - -let seeWhichCharacterHasHigherPrecedence = first ^> second |> third; - -let seeWhichCharacterHasHigherPrecedence = first ^> (second |> third) |> fourth; - -let res = blah && DataConstructor(10) && DataConstructor(10) + 10; - -/* Should be parsed as */ -let res = blah && DataConstructor(10) && DataConstructor(10) + 10; - -let (++)(~label as label,~label2 as label2) = label + label2; - -let (++)(~label as label,~label2 as label2) = label + label2; - -let (++) = (++); - -let (++): int = int = (++); - -(++)(~label=20, ~label2=30) + 40; - -/* Should be parsed as: */ -(++)(~label=20, ~label2=30) + 40; - -/* Great idea! */ -let (==)(a,b) = a < 0; - -let (==)(a,b) = a < 0; - -let (==) = (==); - -let (==): int = int = (==); - -let equal = Pervasives.(==); - -let starInfix_makeSureSpacesSurround = ( * ); - -let starInfix_makeSureSpacesSurround = ( *\*\* ); - -/* The following two should be equivalently parsed/printed. */ -let includesACommentCloseInIdentifier = ( *\*\/ ); - -let includesACommentCloseInIdentifier = ( *\*\/ ); - -let shouldSimplifyAnythingExceptApplicationAndConstruction = call("hi") ++ (switch (x) { - | _ => "hi" - }) ++ "yo"; -let shouldRemoveParens = (ident + ident) + ident; -let shouldRemoveParens = ident ++ (ident ++ ident); -let shouldPreserveParens = ident + (ident + ident); -let shouldPreserveParens = (ident ++ ident) ++ ident; -/** - * Since ++ is now INFIXOP1, it should have lower priority than INFIXOP2 (which - * includes the single plus sign). That means no parens are required in the - * following scenario even though they'd be required in (ident ++ ident) ++ ident. - */ -let noParensRequired = ident + ident ++ ident; - -/* So in this case, it should format to whatever the previous example formats to. */ -let noParensRequired = (ident + ident) ++ ident; - -/** - * Everything that was said above should be true of minus sign as well. In - * terms of precedence, plus sign should be treated the same as plus sign - * followed by a dollar sign. And +++ should be treated the same as ++. - * should also be true of plus sign followed by dollar sign for example. - */ - -let shouldRemoveParens = (ident - ident) - ident; -let shouldPreserveParens = ident - (ident - ident); -let shouldPreserveParens = ident +$ (ident +$ ident); -let noParensRequired = ident - ident ++ ident; -let noParensRequired = (ident - ident) ++ ident; -let noParensRequired = (ident +$ ident) ++ ident; - -let noParensRequired = ident + ident +++ ident; -let noParensRequired = (ident + ident) +++ ident; - -/* Parens are required any time you want to make ++ or +++ parse with higher - * priority than + or - */ -let parensRequired = ident + (ident ++ ident); -let parensRequired = ident + (ident +++ ident); -let parensRequired = ident + (ident ++- ident); -let parensRequired = ident +$ (ident ++- ident); - -/* ++ and +++ have the same parsing precedence, so it's right associative. - * Parens are required if you want to group to the left, even when the tokens - * are different.*/ -let parensRequired = (ident ++ ident) +++ ident; -let parensRequired = (ident +++ ident) ++ ident; - -/* Add tests with IF/then mixed with infix/constructor application on left and right sides */ -/** - * Every star or forward slash after the character of an infix operator must be - * escaped. - */ -let ( /\* )(a,b) = a + b; - -let x = 12 /-\* 23 /-\* 12; - -let y = a /\* b; - -let ( !=\* )(q,r) = q + r; - -let res = q(( !=\* ),r); - -let ( !=\/\* )(q,r) = q + r; - -let res = q(( !=\/\* ),r); - -let ( ~\* )(a) = a + 1; - -let res = ~\*10; - -let res = f - - x; - -let res = f - (- x); - -let res = - (- x); - -let res = f (- x); - -/** - * Test using almost simple prefix as regular function. - */ -let (!!)(a,b) = a + b; - -let res = (!!)(20,40); - -/* The semicolon should be attached to someType */ -let myFunc(aaaa,bbbb,cccc,dddd,aaaa,bbbb,cccc,dddd,aaaa) = - [blah(aaaa,bbbb,cccc,dddd,aaaa,bbbb,cccc,dddd,aaaa), ...someType]; - -/** - * Testing various fixity. - */ - -/** - * For each of these test cases for imperative updates, we'll test both record - * update, object member update and array update. - */ -let containingObject = { - val mutable y = 0; - val arr = [|true, false, false|]; - val bigArr = "goodThingThisIsntTypeChecked"; - val str = "string"; - pub testCases () { - /** - * The lowest precedence token is =, followed by :=, and then ?, then :. - * - * The following text - * - * x.contents = tenaryTest ? ifTrue : ifFalse - * - * Generates the following parse tree: - * - * = - * / \ - * / \ - * record ternary - * - * Because when encountering the ? the parser will shift on the ? instead of - * reducing expr = expr - */ - - /** - * Without a + 1 - */ - x.contents = something ? hello : goodbye; - y = something ? hello : goodbye; - arr[0] = something ? hello : goodbye; - bigArr.{0} = something ? hello : goodbye; - str.[0] = something ? hello : goodbye; - - (x.contents = something) ? hello : goodbye; - (y = something) ? hello : goodbye; - (arr[0] = something) ? hello : goodbye; - (bigArr.{0} = something) ? hello : goodbye; - (str.[0] = something) ? hello : goodbye; - - x.contents = (something ? hello : goodbye); - y = (something ? hello : goodbye); - arr[0] = (something ? hello : goodbye); - bigArr.{0} = (something ? hello : goodbye); - str.[0] = (something ? hello : goodbye); - - - /** - * With a + 1 - */ - x.contents = something + 1 ? hello : goodbye; - x := something + 1 ? hello : goodbye; - y = something + 1 ? hello : goodbye; - arr[0] = something + 1 ? hello : goodbye; - bigArr.{0} = something + 1 ? hello : goodbye; - str.[0] = something + 1 ? hello : goodbye; - - (x.contents = something + 1) ? hello : goodbye; - (x := something + 1) ? hello : goodbye; - (y = something + 1) ? hello : goodbye; - (arr[0] = something + 1) ? hello : goodbye; - (bigArr.{0} = something + 1) ? hello : goodbye; - (str.[0] = something + 1) ? hello : goodbye; - - x.contents = (something + 1 ? hello : goodbye); - x := (something + 1 ? hello : goodbye); - y = (something + 1 ? hello : goodbye); - arr[0] = (something + 1 ? hello : goodbye); - bigArr.{0} = (something + 1 ? hello : goodbye); - str.[0] = (something + 1 ? hello : goodbye); - - - /** - * #NotActuallyAConflict - * Note that there's a difference with how = and := behave. - * We only *simulate* = being an infix identifier for the sake of printing, - * but for parsing it's a little more nuanced. There *isn't* technically a - * shift/reduce conflict in the following that must be resolved via - * precedence ranking: - * - * a + b.c = d - * - * No conflict between reducing a + b.c, and shifting =, like there would - * be if it was := instead of =. That's because the rule for = isn't the - * infix rule with an arbitrary expression on its left - it's something - * much more specific. - * - * (simple_expr) DOT LIDENT EQUAL expression. - * - * So with the way yacc/menhir works, when it sees an equal sign, it knows - * that there is no valid parse where a + b.c is reduced to an expression - * with an = immediately appearing after, so it shifts the equals. - * - * If you replace = with :=, you'd see different behavior. - * - * a + b.c := d - * - * Since := has lower precedence than +, it would be parsed as: - * - * (a + b.c) := d - * - * However, our printing logic will print = assignment with parenthesis: - * - * a + (b.c = d) - * - * Even though they're not needed, because it doesn't know details about - * which rules are valid, we just told it to print = as if it were a valid - * infix identifier. - * - * Another case: - * - * something >>= fun x => x + 1; - * - * Will be printed as: - * - * something >>= (fun x => x + 1); - * - * Because the arrow has lower precedence than >>=, but it wasn't needed because - * - * (something >>= fun x) => x + 1; - * - * Is not a valid parse. Parens around the `=>` weren't needed to prevent - * reducing instead of shifting. To optimize this part, we need a much - * deeper encoding of the parse rules to print parens only when needed. - * - */ - - /* The following */ - x + something.contents = y; - x + something = y; - x + something.contents := y; - x + something := y; - - /* Should be parsed as: */ - x + (something.contents = y); /* Because of the #NotActuallyAConflict above */ - x + (something = y); /* Same */ - (x + something.contents) := y; - (x + something) := y; - - /* To make the := parse differently, we must use parens */ - x + (something.contents := y); - x + (something := y); - - - /** - * Try with || - */ - x.contents || something + 1 ? hello : goodbye; - y || something + 1 ? hello : goodbye; - arr[0] || something + 1 ? hello : goodbye; - bigArr.{0} || something + 1 ? hello : goodbye; - str.[0] || something + 1 ? hello : goodbye; - - (x.contents || something + 1) ? hello : goodbye; - (y || something + 1) ? hello : goodbye; - (arr[0] || something + 1) ? hello : goodbye; - (bigArr.{0} || something + 1) ? hello : goodbye; - (str.[0] || something + 1) ? hello : goodbye; - - x.contents || (something + 1 ? hello : goodbye); - y || (something + 1 ? hello : goodbye); - arr[0] || (something + 1 ? hello : goodbye); - bigArr.{0} || (something + 1 ? hello : goodbye); - str.[0] || (something + 1 ? hello : goodbye); - - - /** - * Try with && - */ - x.contents && something + 1 ? hello : goodbye; - y && something + 1 ? hello : goodbye; - arr[0] && something + 1 ? hello : goodbye; - bigArr.{0} && something + 1 ? hello : goodbye; - str.[0] && something + 1 ? hello : goodbye; - - (x.contents && something + 1) ? hello : goodbye; - (y && something + 1) ? hello : goodbye; - (arr[0] && something + 1) ? hello : goodbye; - (bigArr.{0} && something + 1) ? hello : goodbye; - (str.[0] && something + 1) ? hello : goodbye; - - x.contents && (something + 1 ? hello : goodbye); - y && (something + 1 ? hello : goodbye); - arr[0] && (something + 1 ? hello : goodbye); - bigArr.{0} && (something + 1 ? hello : goodbye); - str.[0] && (something + 1 ? hello : goodbye); - - - - /** - * See how regular infix operators work correctly. - */ - x.contents = (2 + 4); - y = (2 + 4); - arr[0] = (2 + 4); - bigArr.{0} = (2 + 4); - str.[0] = (2 + 4); - - (x.contents = 2) + 4; - (y = 2) + 4; - (arr[0] = 2) + 4; - (bigArr.{0} = 2) + 4; - (str.[0] = 2) + 4; - - - /** - * Ensures that record update, object field update, and := are all right - * associative. - */ - x.contents = y.contents = 10; - y = x.contents = 10; - arr[0] = x.contents = 10; - bigArr.{0} = x.contents = 10; - str.[0] = x.contents = 10; - /* Should be the same as */ - x.contents = (x.contents = 10); - y = (x.contents = 10); - arr[0] = (x.contents = 10); - bigArr.{0} = (x.contents = 10); - str.[0] = (x.contents = 10); - - - /** - * Ensures that record update, object field update, and := are all right - * associative. - */ - x := x := 10; - /* Should be the same as */ - x := (x := 10); - - /* By default, without parens*/ - x ? y : z ? a : b; - - /* It is parsed as the following: */ - x ? y : (z ? a : b); - - /* Not this: */ - (x ? y : z) ? a : b; - - /** - * ^ - * When rendering the content to the left of the ? we know that we want the - * parser to reduce the thing to the left of the ? when the ? is seen. So we - * look at the expression to the left of ? and discover what precedence level - * it is (token of its rightmost terminal). We then compare it with ? to see - * who would win a shift reduce conflict. We want the term to the left of the ? - * to be reduced. So if it's rightmost terminal isn't higher precedence than ?, - * we wrap it in parens. - */ - - - /*** - * The following - */ - x.contents = something ? x.contents = somethingElse : goodbye; - y = something ? y = somethingElse : goodbye; - arr[0] = something ? arr[0] = somethingElse : goodbye; - bigArr.{0} = something ? bigArr.{0} = somethingElse : goodbye; - str.[0] = something ? str.[0] = somethingElse : goodbye; - /* - * Should be parsed as - */ - x.contents = (something ? x.contents = somethingElse : goodbye); - y = (something ? y = somethingElse : goodbye); - arr[0] = (something ? arr[0] = somethingElse : goodbye); - bigArr.{0} = (something ? bigArr.{0} = somethingElse : goodbye); - str.[0] = (something ? str.[0] = somethingElse : goodbye); - - /** And this */ - y := something ? y := somethingElse : goodbye; - arr[0] := something ? arr[0] := somethingElse : goodbye; - bigArr.{0} := something ? bigArr.{0} := somethingElse : goodbye; - str.[0] := something ? str.[0] := somethingElse : goodbye; - - /* Should be parsed as */ - y := (something ? (y := somethingElse) : goodbye); - arr[0] := (something ? (arr[0] := somethingElse) : goodbye); - bigArr.{0} := (something ? (bigArr.{0} := somethingElse) : goodbye); - str.[0] := (something ? (str.[0] := somethingElse) : goodbye); - - - /* The following */ - x := something ? x.contents = somethingElse ? goodbye : goodbye : goodbye; - x := something ? arr[0] = somethingElse ? goodbye : goodbye : goodbye; - x := something ? bigArr.{0} = somethingElse ? goodbye : goodbye : goodbye; - x := something ? str.[0] = somethingElse ? goodbye : goodbye : goodbye; - /* Is parsed as */ - x := (something ? x.contents = (somethingElse ? goodbye : goodbye) : goodbye); - x := (something ? arr[0] = (somethingElse ? goodbye : goodbye) : goodbye); - x := (something ? bigArr.{0} = (somethingElse ? goodbye : goodbye) : goodbye); - x := (something ? str.[0] = (somethingElse ? goodbye : goodbye) : goodbye); - /* is not the same as */ - x := something ? (x.contents = somethingElse) ? goodbye : goodbye : goodbye; - x := something ? (arr[0] = somethingElse) ? goodbye : goodbye : goodbye; - x := something ? (bigArr.{0} = somethingElse) ? goodbye : goodbye : goodbye; - x := something ? (str.[0] = somethingElse) ? goodbye : goodbye : goodbye; - - /** - * And - */ - - /** These should be parsed the same */ - something ? somethingElse : x.contents = somethingElse ? x : z; - something ? somethingElse : (x.contents = (somethingElse ? x : z)); - /* Not: */ - something ? somethingElse : (x.contents = somethingElse) ? x : z; - (something ? somethingElse : (x.contents = somethingElse)) ? x : z; - - /* These should be parsed the same */ - something ? somethingElse : x := somethingElse ? x : z; - something ? somethingElse : (x := (somethingElse ? x : z)); - /* Not: */ - something ? somethingElse : (x := somethingElse) ? x : z; - (something ? somethingElse : (x := somethingElse)) ? x : z; - - /** These should be parsed the same */ - something ? somethingElse : y = somethingElse ? x : z; - something ? somethingElse : (y = (somethingElse ? x : z)); - /* Not: */ - something ? somethingElse : (y = somethingElse) ? x : z; - (something ? somethingElse : (y = somethingElse)) ? x : z; - - /** These should be parsed the same */ - something ? somethingElse : arr[0] = somethingElse ? x : arr[0]; - something ? somethingElse : (arr[0] = (somethingElse ? x : arr[0])); - /* Not: */ - something ? somethingElse : (arr[0] = somethingElse) ? x : z; - (something ? somethingElse : (arr[0] = somethingElse)) ? x : z; - - /** These should be parsed the same */ - something ? somethingElse : bigArr.{0} = somethingElse ? x : bigArr.{0}; - something ? somethingElse : (bigArr.{0} = (somethingElse ? x : bigArr.{0})); - /* Not: */ - something ? somethingElse : (bigArr.{0} = somethingElse) ? x : z; - (something ? somethingElse : (bigArr.{0} = somethingElse)) ? x : z; - - /** These should be parsed the same */ - something ? somethingElse : arr.[0] = somethingElse ? x : arr.[0]; - something ? somethingElse : (arr.[0] = (somethingElse ? x : arr.[0])); - /* Not: */ - something ? somethingElse : (str.[0] = somethingElse) ? x : z; - (something ? somethingElse : (str.[0] = somethingElse)) ? x : z; - - /** - * It creates a totally different meaning when parens group the : - */ - x.contents = something ? (x.contents = somethingElse : x) : z; - y = something ? (y = somethingElse : x) : z; - arr[0] = something ? (arr[0] = somethingElse : x) : z; - bigArr.{0} = something ? (bigArr.{0} = somethingElse : x) : z; - str.[0] = something ? (str.[0] = somethingElse : x) : z; - - /** - * Various precedence groupings. - */ - true ? true ? false : false : false; - /* Is the same as */ - true ? (true ? false : false) : false; - /* - * Just some examples of how prefix will be printed. - */ - - x + something.contents = y; - - x + something = y; - - x + something.contents := y; - - x + something := y; - x + - something.contents = y; - x + - something = y; - x + - something.contents := y; - x + - something := y; - x.contents || something + 1 ? - hello : goodbye; - bigArr.{0} || - something + 1 ? hello : goodbye; - let result = - x + something.contents = y; - - /* Prefix minus is actually sugar for regular function identifier ~-*/ - let result = 2 + (~-) (add(4,0)); - /* Same as */ - let result = 2 + ~- add(4,0); - /* Same as */ - let result = 2 + - add(4,0); - - /* That same example but with ppx attributes on the add application */ - let result = 2 + (~-) ([@ppx] add(4,0)); - /* Same as */ - let result = [@ppx] 2 + ~- add(4,0); - /* Same as */ - let result = [@ppx] 2 + - add(4,0); - - - /* Multiple nested prefixes */ - let result = 2 + - - - add(4,0); - - /* And with attributes */ - let result = [@onAddApplication] 2 + - - - add(4,0); - - - /** - * TODO: Move all of these test cases to attributes.re. - */ - /* Attribute on the prefix application */ - let res = [@attr] (- something(blah,blah)); - /* Attribute on the regular function application, not prefix */ - let res = [@attr] - something(blah,blah); - let attrOnPrefix = [@ppxOnPrefixApp] (- 1); - let attrOnPrefix = 5 + - 1; - let result = [@ppxAttributeOnSugarGetter] arr.[0]; - - - /** - * Unary plus/minus has lower precedence than prefix operators: - * And unary plus has same precedence as unary minus. - */ - let res = - !record; - /* Should be parsed as: */ - let res = - (! record); - /* Although that precedence ranking doesn't likely have any effect in that - * case. */ - /** - * And this - */ - let res = - + callThisFunc (); - /* should be parsed as: */ - let res = - + callThisFunc (); - - /** - * And this - */ - let res = ! (- callThisFunc ()); - /* Should be parsed (and should remain printed as: */ - let res = ! (- callThisFunc ()); - - - let res = [@onApplication] !x; - let res = !([@onX] x); - - let res = !([@onX] x); - [@shouldBeRenderedOnEntireSetField] (something.contents = "newvalue"); - something.contents = [@shouldBeRenderedOnString] "newvalue"; - }; -}; - -let x = foo |> z; - -let x = foo |> f |> g; - -let x = foo |> somelongfunctionname("foo") |> anotherlongfunctionname("bar", 1) |> somelongfunction |> bazasdasdad; - - -let code = JSCodegen.Code.( - create - |> lines(Requires.( - create - |> import_type(~local="Set", ~source="Set") - |> import_type(~local="Map", ~source="Map") - |> import_type(~local="Immutable", ~source="immutable") - |> require(~local="invariant", ~source="invariant") - |> require(~local="Image", ~source="Image.react") - |> side_effect(~source="monkey_patches") - |> render_lines - )) - |> new_line - |> new_line - |> new_line - |> new_line - |> render -); - -let code = JSCodegen.Code.(create |> render); - -let server = { - let callback(_conn, req, body) = { - let uri = req |> Request.uri |> Uri.to_string |> Code.string_of_uri |> Server.respond |> Request.uri; - let meth = req |> Request.meth |> Code.string_of_method; - let headers = req |> Request.headers |> Header.to_string; - body |> Cohttp_lwt_body.to_string >|= ((body) => { - Printf.sprintf("okokok", uri, meth, headers, body)}) >>= ((body) => Server.respond_string(~status, ~body, ())); - }; -Server.create(~mode, Server.make(~callback, ())); -}; - -let lijst = - List.length - @@ List.map( - (s) => s ++ " example", - [ - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "ten" - ] - ); - -let example = - true != false - && "a" == "b" - && "arbitrary" === "example" - && "how long" >= "can you get" - && "seriously" <= "what is the line length"; - -if (List.length(files) - > 0 - && List.length(otherfiles) - < 2) { - () -}; - -/* Don't clash with jsx edge cases */ -let (=<) = (a, b) => a + b; -let result = x =< y; -let z = x =< -y; - -let z = x =< - - -y; - -let (> a - b; -let result = x >) = (a, b) => a + b; -let result = x = b; -let z = x = -b; - -let z = x = - -b; - -/* #1676: Exponentiation should be right-associative */ -let foo = (100. /. 2.) ** 2. +. (200. /. 2.) ** 2.; -let foo = 100. /. 2. ** 2. +. 200. /. 2. ** 2.; - -let x = y />> f; - -let (/>>) = (a, b) => a + b; - -let x = y />/> f; - -let (/>/>) = (a, b) => a + b; - -let (><) = (a, b) => a + b; - -let x = a >< b; - -let (=-) = (a, b) => a + b; - -let foo = (a, b) => a =- b; - -let (=><) = (a, b) => a + b; -let x = a =>< b; - -let foo = - fun - | None => x >>= y - | Some(x) => x >>= y; - -something ->>= ( - fun - | None => x >>= y - | Some(x) => x >>= y -); - -(fun -| None => x >>= y -| Some(x) => x >>= y) ->>= bar ; - -something >>= - fun - | None => x >>= y - | Some(x) => x >>= y; - -something ? -a >>= ( - fun - | None => x >>= y - | Some(x) => x >>= y -) : ( - fun - | None => x >>= y - | Some(x) => x >>= y -); - -something ? -a >>= ( - fun - | None => x >>= y - | Some(x) => x >>= y -) : ( - fun - | None => x >>= y - | Some(x) => x >>= y -) >>= b; - -let foo = -fun - | None => () - | Some(x) => fun | None => () | Some(_) => (); - -let foo = -fun - | Some(x) => (fun | None => () | Some(_) => ()) - | None => (); - -let predicate = - predicate === Functions.alwaysTrue1 ? - (fun - | None => false - | Some(exn) => predicate(exn)) >>= foo : - (fun - | None => false - | Some(exn) => predicate(exn)); - -let predicate = - predicate === Functions.alwaysTrue1 ? - (fun - | None => false - | Some(exn) => predicate(exn)) >>= foo : - bar >>= (fun - | None => false - | Some(exn) => predicate(exn)); - -let (>...) = (a, b) => a + b; - -a >... b; - -/* https://github.com/facebook/reason/issues/2169 */ -let not = (x) => !x; - -let other = (x) => not(x); - -let derefInsideArray = [|a^|]; - -/* https://github.com/facebook/reason/issues/126 */ -foo^^; - -let x = foo^^; - -foo^^bar; diff --git a/formatTest/unit_tests/input/jsx.re b/formatTest/unit_tests/input/jsx.re deleted file mode 100644 index 3d9de4ce5..000000000 --- a/formatTest/unit_tests/input/jsx.re +++ /dev/null @@ -1,580 +0,0 @@ -let x = - ; - -let y = - - updater((latestComponentBag,_) => { - let currentActualPath = Routes.hashOfUri(newUrl); - let pathFromState = Routes.stateToPath(latestComponentBag.state); - currentActualPath == pathFromState ? - None : dispatchEventless(State.UriNavigated(currentActualPath),latestComponentBag,()) - }, - () - ) - ) - />; - -let z = -
; - - let omega = -
; - -let someArray =
; - -let tuples = -
; - -let icon = "sound-off" - | v when v < 0.11 => "sound-min" - | v when v < 0.51 => "sound-med" - | _ => "sound-max" - } - ) - />; - -; - -/* punning */ -; - -/* punning for explicitly passed optional */ -; - -/* don't pun explicitly passed optional with module identifier */ -; - -let x =
; - -
; - -foo#=(); - -foo#=; - -let x =[|
|]; - -let x = [|; - -; - -; - -; - -; - -// shouldn't result in a stack overflow -Belt.Option.getWithDefault("")} />; - -
{ReasonReact.string("BugTest")}
; - -
- { - let left = limit->Int.toString; - {j|$left characters left|j}->React.string; - } -
; - - - { - let uri = "/images/header-background.png"; - - } -; - -
- {true - ? {let foo = "foo"; // don't remove semi - {ReasonReact.string(foo)} } - : {ReasonReact.string("bar")} } -
; - -let v = - - - ...{_ => { - let renderX = x => { - let y = x ++ x; -
; - }; - renderX("foo"); - }} - - ; - -Option.map(x => {let y = x; y ++ y}) - } -/>; - -Option.map(x => {let y = x; y ++ y}) - }} -/>; - - {let y = x; y ++ y}) - }} -/>; - - {let y = x; y ++ y}) - }} -/>; - - Option.map(x => {let y = x; y ++ y}) - }} -/>; - - {React.string("Hello")} } />; - - {React.string("Hi")} } />; - - - -; - -; - -; diff --git a/formatTest/unit_tests/input/jsx_functor.re b/formatTest/unit_tests/input/jsx_functor.re deleted file mode 100644 index fec4a8709..000000000 --- a/formatTest/unit_tests/input/jsx_functor.re +++ /dev/null @@ -1,33 +0,0 @@ -type elt = Text(string) | Group(list(elt)); - -module X = { - let createElement(~children=[], ()) { - Text("x"); - }; -}; - -module Y = { - let createElement(~children=[], ()) { - Text("y"); - }; -}; - -module M(X: (module type of X), Y: (module type of Y)) = { - let createElement(~name="M", ~id=0, ~children=[], ()) { - Group([ - Text(name), - Text(string_of_int(id)), - , - - ] @ children); - }; -}; - -let _ = Group([ - , - - Text("A") - , - - -]) diff --git a/formatTest/unit_tests/input/lineComments.re b/formatTest/unit_tests/input/lineComments.re deleted file mode 100644 index ad3527bdd..000000000 --- a/formatTest/unit_tests/input/lineComments.re +++ /dev/null @@ -1,739 +0,0 @@ -3; // - -3 //- -; -3//- -; -3/*-*/; -// **** comment -/*** comment */ -/** docstring */ -// comment -/** docstring */ -/*** comment */ -/**** comment */ -/***** comment */ -/** */ -/*** */ -/**** */ -/**/ -/***/ -/****/ -/** (** comment *) */ -/** (*** comment *) */ -// (** comment *) -// (*** comment *) -// *(*** comment *) -// comment * -// comment ** -// comment *** -// comment **** -/** - * Multiline - */ -/** Multiline - * - */ -/** - ** - */ - -module JustString = { - include Map.Make(Int32); // Comment eol include -}; - -let testingEndOfLineComments = - [ - "Item 1" /* Comment For First Item */, - "Item 2" /* Comment For Second Item */, - "Item 3" /* Comment For Third Item */, - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - // Comment after last item in list. - ] /* Comment after rbracket */; - -// But if you place them after the comma at eol, they're preserved as such -let testingEndOfLineComments = - [ - "Item 1", // Comment For First Item - "Item 2", // Comment For Second Item - "Item 3", // Comment For Third Item - "Item 4" /* Comment For Fourth Item - but before trailing comma */, - // Comment after last item in list. - ] /* Comment after rbracket */ ; - - -// The space between ; and comment shoudn't matter -let testPlacementOfTrailingComment = [ - "Item 0" // - // Comment after last item in list. -]; // Comment after semi - -// The space between ; and comment shoudn't matter -let testPlacementOfTrailingComment = [ - "Item 0" // - // Comment after last item in list. -];// Comment after semi - -// Try again but without other things in the list -let testPlacementOfTrailingComment = [ - "Item 0" // -]; // Comment after semi - -// The space between ; and comment shoudn't matter -let testPlacementOfTrailingComment = [ - "Item 0" // - // Comment after last item in list. -];// Comment after semi - -let testingEndOfLineComments = [];// Comment after entire let binding - - -// The following is not yet idempotent -// let myFunction -// withFirstArg // First arg -// andSecondArg => { // Second Arg -// withFirstArg + andSecondArg /* before semi */ ; -// }; - -let myFunction - (// First arg - withFirstArg, - // Second Arg - andSecondArg) { - withFirstArg + andSecondArg -}; // After Semi - -type point = { - x: string, // x field - y: string, // y field -}; - -type pointWithManyKindsOfComments = { - // Line before x - x: string, // x field - // Line before y - y: string, // y field - // Final row of record -}; - -type typeParamPointWithComments('a) = { - // Line before x - x: 'a, // x field - // Line before y - y: 'a // y field - // Final row of record -}; - -// Now, interleaving comments in type params -type - // Type name - typeParamPointWithComments2( - // The a type param - 'a, - // The b type apram - 'b) = { - // Line before x - x: 'a, // x field - // Line before y - y: 'a // y field - // Final row of record -}; - -/* The way the last row comment is formatted is suboptimal becuase - * record type definitions do not include enough location information */ -type anotherpoint = { - x: string, // x field - y: string, // y field - // comment as last row of record -}; - -type t = (int, int); // End of line on t -type t2 = - (int, int) // End of line on (int, int) - ; - -type t3 = - (int, int); // End of line on (int, int) - - -type variant = - | X (int, int) // End of line on X - | Y (int, int); // End of line on Y - // Comment on entire type def for variant - -// Before let -let res = - // Before switch - switch (X (2, 3)) { - // Above X line - | X(_) => "result of X" // End of arrow and X line - // Above Y line - | Y(_) => "result of Y" // End of arrow and Y line - }; // After final semi in switch - -let res = - switch (X (2, 3)) { - | X (0, 0) => // After X arrow - "result of X" // End of X body line - | X (1, 0) /* Before X's arrow */ => - "result of X" // End of X body line - | X (_) => // After X _ arrow - "result of X" // End of X body line - // Above Y line - | Y (_) => - // Comment above Y body - "result of Y" - }; - -type variant2 = - // Comment above X - | X (int, int) // End of line on X - // Comment above Y - | Y (int, int); - -type variant3 = - // Comment above X - | X (int, int) // End of line on X - // Comment above Y - | Y (int, int) // End of line on Y -; - - -type x = { // not attached *above* x - fieldOne : int, - fieldA : int -} // Attached end of line after x -and y = { // not attached *above* y - fieldTwo : int -} // Attached end of line after y -; - -type x2 = { // not attached *above* x2 - fieldOne : int, - fieldA : int -} // Attached end of line after x2 -and y2 = { // not attached *above* y2 - fieldTwo : int -}; - - -let result = - switch (None) { - | Some({fieldOne: 20, fieldA:a})=> // Where does this comment go? - let tmp = 0; - 2 + tmp - | Some {fieldOne: n, fieldA:a} => - // How about this one - let tmp = n; - n + tmp - | None => 20 - }; - -let res = - // Before switch - switch (X (2, 3)) { - // Above X line - | X(_) => "result of X" // End of arrow and X line - // Above Y line - | Y(_) => "result of Y" // End of arrow and Y line - }; - -/* - * Now these end of line comments *should* be retained. - */ -let result = switch (None) { - | Some { - fieldOne: 20, // end of line - fieldA:a // end of line - } => - let tmp = 0; - 2 + tmp - | Some { - fieldOne: n, // end of line - fieldA:a // end of line - } => - let tmp = n; - n + tmp - | None => 20 - }; - -/* - * These end of line comments *should* be retained. - * To get the simple expression eol comment to be retained, we just need to - * implement label breaking eol behavior much like we did with sequences. - * Otherwise, right now they are not idempotent. - */ -let res = - switch ( // Retain this - X (2, 3) - ) - { - // Above X line - | X ( - _, // retain this - _ // retain this - ) => "result of X" - - // Above Y line - | Y(_) => "result of Y" // End of arrow and Y line - }; - - -type optionalTuple = - | OptTup ( - option (( - int, // First int - int // Second int - )) - ); - -type optionTuple = - option (( - int, // First int - int // Second int - )); - -type intPair = ( - int, // First int - int // Second int -); - -type intPair2 = ( - // First int - int, - // Second int - int -); - -let result = { - /**/ - (+)(2,3) -}; - -// This is not yet idempotent -// { -// /**/ -// (+) 2 3 -// }; - -let a = (); -for (i in 0 to 10) { - // bla - a -}; - -if (true) { - // hello - () -}; - -type color = - | Red(int) // After red end of line - | Black(int) // After black end of line - | Green(int); // After green end of line - // On next line after color type def - -let blahCurriedX(x) = - fun - | Red(10) - | Black(20) - | Green(10) => 1 // After or pattern green - | Red(x) => 0 // After red - | Black(x) => 0 // After black - | Green(x) => 0; // After second green - // On next line after blahCurriedX def - -let name_equal(x,y) { x == y }; - -let equal(i1,i2) = - i1.contents === i2.contents && true; // most unlikely first - -let equal(i1,i2) = - compare(compare(0,0),compare(1,1)); // END OF LINE HERE - -let tuple_equal((i1, i2)) = i1 == i2; - -let tuple_equal((csu, mgd)) = - // Some really long comments, see https://github.com/facebook/reason/issues/811 - tuple_equal((csu, mgd)); - -/** Comments inside empty function bodies - * See https://github.com/facebook/reason/issues/860 - */ -let fun_def_comment_inline = () => { /* */ }; - -let fun_def_comment_newline = () => { - // -}; - -let fun_def_comment_long = () => { /* longer comment inside empty function body */}; - -let trueThing = true; - -for (i in 0 to 1) { - // comment - print_newline(); -}; - -while (trueThing) { - // comment - print_newline(); -}; - -if (trueThing) { - // comment - print_newline() -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -} else { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); - // Comment after final print -} else { - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); - // Comment before print - print_newline(); - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); - // Comment after final print -}; - - - -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -} else { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before if test -if (trueThing) { - // Comment before print - print_newline(); // eol print - // Comment before print -} else { - // Comment before print - print_newline(); // eol print - // Comment before print - print_newline(); // eol print - // Comment after print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); // eol - // Comment before print - print_newline(); // eol - // Comment after final print -}; - -// Comment before while test -while (trueThing) { - // Comment before print - print_newline(); // eol - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); // eol - // Comment before print - print_newline(); // eol - // Comment after final print -}; - -// Comment before for test -for (i in 0 to 100) { - // Comment before print - print_newline(); // eol - // Comment after final print -}; - - -let f = (a, b, c, d) => a + b + c + d; - -while(trueThing) { - f( - // a - 1, - // b - 2, - // c - 3, - // d - 4 - // does work - ); -}; -while(trueThing) { - f( - // a - 1, - // b - 2, - // c - 3, - // d - 4 // does work - ); -}; - -ignore((_really, _long, _printWidth, _exceeded, _here) => { - // First comment - let x = 0; - x + x; - // Closing comment -}); - -ignore((_xxx, _yyy) => { - // First comment - let x = 0; - x + x; - // Closing comment -}); - -type tester('a, 'b) = | TwoArgsConstructor('a, 'b) | OneTupleArgConstructor(('a, 'b)); -let callFunctionTwoArgs = (a, b) => (); -let callFunctionOneTuple = (tuple) => (); - -let y = TwoArgsConstructor( - 1, //eol1 - 2 // eol2 -); - -let y = callFunctionTwoArgs( - 1, //eol1 - 2 // eol2 -); - -let y = OneTupleArgConstructor(( - 1, //eol1 - 2 // eol2 -)); - -let y = callFunctionOneTuple(( - 1, //eol1 - 2 // eol2 -)); - - -type polyRecord('a, 'b) = {fieldOne: 'a, fieldTwo: 'b}; - -let r = { - fieldOne: 1, //eol1 - fieldTwo: 2 // eol2 -}; - -let r = { - fieldOne: 1, //eol1 - fieldTwo: 2, // eol2 with trailing comma -}; - - -let y = TwoArgsConstructor( - "1", //eol1 - "2" // eol2 -); - -let y = callFunctionTwoArgs( - "1", //eol1 - "2" // eol2 -); - -let y = OneTupleArgConstructor(( - "1", //eol1 - "2" // eol2 -)); - -let y = callFunctionOneTuple(( - "1", //eol1 - "2" // eol2 -)); - - -let r = { - fieldOne: "1", //eol1 - fieldTwo: "2" // eol2 -}; - -let r = { - fieldOne: "1", //eol1 - fieldTwo: "2", // eol2 with trailing comma -}; - -let identifier = "hello"; - -let y = TwoArgsConstructor( - identifier, //eol1 - identifier // eol2 -); - -let y = callFunctionTwoArgs( - identifier , //eol1 - identifier // eol2 -); - -let y = OneTupleArgConstructor(( - identifier , //eol1 - identifier // eol2 -)); - -let y = callFunctionOneTuple(( - identifier , //eol1 - identifier // eol2 -)); - - -let r = { - fieldOne: identifier, //eol1 - fieldTwo: identifier // eol2 -}; - -let r = { - fieldOne: identifier, //eol1 - fieldTwo: identifier, // eol2 with trailing comma -}; - - -let y = TwoArgsConstructor( - identifier : string, //eol1 - identifier : string// eol2 -); - -let y = callFunctionTwoArgs( - identifier : string , //eol1 - identifier : string // eol2 -); - -let y = OneTupleArgConstructor(( - identifier : string , //eol1 - identifier : string // eol2 -)); - -let y = callFunctionOneTuple(( - identifier : string , //eol1 - identifier : string // eol2 -)); - - -let r = { - fieldOne: (identifier : string), //eol1 - fieldTwo: (identifier : string) // eol2 -}; - -let r = { - fieldOne: (identifier : string), //eol1 - fieldTwo: (identifier : string), // eol2 with trailing comma -}; - -// whitespace interleaving - -// comment1 -// comment2 - -// whitespace above & below - -let r = { - fieldOne: (identifier : string), //eol1 - // c1 - - // c2 - - // c3 - // c4 - - // c5 - fieldTwo: (identifier : string), // eol2 with trailing comma -}; -// trailing - -// trailing whitespace above -// attach - -// last comment diff --git a/formatTest/unit_tests/input/modules.re b/formatTest/unit_tests/input/modules.re deleted file mode 100644 index 1786ababd..000000000 --- a/formatTest/unit_tests/input/modules.re +++ /dev/null @@ -1,490 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = fun () => { - TestUtils.printSection("Modules"); -}; - - - -/** - * Modules: - * ---------------------------------------------------------------------------- - * Modules accomplish the following: - * - Organization of code and data. - * - Basis for separate compilation and fast compile times. - * - Enabled higher order type abstractions that are capable of modelling very - * sophisticated typing relationships between various parts of your code. - * - * Modules are much like records, but much more powerful. Much of modules' - * powers are derived from the fact that they are primarily built up and - * organized at compilation time, instead of runtime. It is this constraint - * that allows modules to be more powerful than simple records. - * - * There are some important ways that modules differ from records: - * - * - Fields are lexically scoped: In the following record: `{x:1, y: x + x}`, - * the reference to `x` does not refer to the record field `x`. This is because - * records fields do not form lexical scopes for the evaluation of other record - * values. Modules, on the other hand do allow fields to reference other - * fields. Appropriately, each field is introduced via the keyword `let`. - */ - -module MyFirstModule = { - let x = 0; - let y = x + x; -}; - -let result = MyFirstModule.x + MyFirstModule.y; - -/** - * - A module is introduced with the `module` phrase. - * - A module *must* have a capital letter as its first character. - * - The exported fields of a module must be listed within `{}` braces and each - * exported value binding is specified via a `let` keyword. - */ - -/** - * Another way that modules are more powerful than records, is that they may - * also export types. - */ -module MySecondModule = { - type someType = int; - let x = 0; - let y = x + x; -}; - -let myInt:MySecondModule.someType = 100; - -/** Module signatures: - * ---------------------------------------------------------------------------- - * Not only may modules export types, but modules *themselves* can be described - * by types via the `module type` phrase. We call these module types - * "signatures". For example, `MySecondModule` has the following `module type` - * signature: - */ -module type MySecondModuleType = { - type someType = int; - let x: int; - let y: int; -}; - -/** - * Much like how you can ensure that a value is compatible with a specific - * type: - - let myTestVal: int = 10; - - * You can also perform the same type of annotation to ensure that you have - * written code that matches your understanding. For example, `MySecondModule` - * could have been written as: - - module MySecondModule: MySecondModuleType = { - type someType = int; - let x = 0; - let y = x + x; - }; - */ - -/** - * - Modules may be artificially "constrained" so that users of a module see - * fewer details than are actually present. - * - Modules may be combined, merged, and transformed at compile time in ways - * that - * - Because they are more powerful, they may not be passed around at runtime - * as easily as records. - * - * Some additioal benefits to using modules: - * - Modules are a very elegant way to organize large packages of code. - * - Modules are the unit of compilation. Minimal recompilation changes - * - Modules can help you achieve higher degrees of polymorphism than the core - * language. - */ - -let opensAModuleLocally = { - module MyLocalModule = { - type i = int; - let x:i = 10; - }; - /* Notice how local modules names may be used twice and are shadowed */ - module MyLocalModule: MySecondModuleType = { - type someType = int; - let x:someType = 10; - let y:someType = 20; - }; - let tmp = MyLocalModule.x + 22; - tmp + 30; -}; - -module type HasTT = { - type tt; -}; - -module SubModule: HasTT = { - type tt = int; -}; - -module type HasEmbeddedHasTT = { - module SubModuleThatHasTT = SubModule; -}; - -module type HasPolyType = {type t('a);}; - -module type HasDestructivelySubstitutedPolyType = - HasPolyType with type t('a) := list('a); - -module type HasDestructivelySubstitutedSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int); */ - module X: HasDestructivelySubstitutedPolyType; -}; -module type HasSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int); */ - module X: HasPolyType; -}; - -module EmbedsSubPolyModule: HasSubPolyModule = { - module X = { - type t('a) = list('a); - }; -}; - -module EmbedsDestructivelySubstitutedPolyModule: HasDestructivelySubstitutedSubPolyModule = { - module X = { - type t = list (int, int); - }; -}; - -module type HasMultiPolyType = { - type substituteThis('a,'b); - type substituteThat('a,'b); -}; - -module type HasDestructivelySubstitutedMultiPolyType = ( - HasMultiPolyType with -type substituteThis('a,'b) := Hashtbl.t('a,'b) and -type substituteThat('a,'b) := Hashtbl.t('a,'b) -); - - -module InliningSig: {let x: int; let y:int;} = { - /* - * Comment inside of signature. - */ - let x = 10; - /* Inline comment inside signature. */ - let y = 20; -}; - -module MyFunctor = fun (M: HasTT) => { - type reexportedTT = M.tt; - /* Inline comment inside module. */ - /** Following special comment inside module. */ - let someValue = 1000; -}; - -/* Notice how - - Functors no longer require parens around argument. - - A final semicolon is required for module structures. - - We should eliminate both those requirements. See action items 13-14 at the - bottom of this file. [Actually, forgiving the trailing SEMI might not be - such a great idea]. - */ -module MyFunctorResult = MyFunctor ({type tt = string;}); - -module LookNoParensNeeded = MyFunctor {type tt = string;}; - -module type SigResult = {let result:int;}; - -module type ASig = {let a:int;}; -module type BSig = {let b:int;}; -module AMod = {let a = 10;}; -module BMod = {let b = 10;}; - -module CurriedSugar (A:ASig, B:BSig) { - let result = A.a + B.b; -}; - - -/* Right now [CurriedSuperSugar] is parsed as being indistinguishable from - the above. - - module CurriedSuperSugar (A:ASig) (B:BSig): SigResult => ({ - let result = A.a + B.b; - }: SigResult); - - /* Not supported in OCaml OR Reason (Edit: now supported in OCaml for functions) */ - let x = fun (a:foo) :bar => baz; - module x = fun (A:Foo) :Bar => Baz; - - /* Supported in both OCaml and Reason */ - let x (a:foo) :bar => baz; - module x (A:Foo) :Bar => Baz; - - */ -module CurriedSugarWithReturnType (A:ASig, B:BSig): SigResult { - let result = A.a + B.b; -}; - -/* This is parsed as being equivalent to the above example */ -module CurriedSugarWithAnnotatedReturnVal (A:ASig, B:BSig) = ({ - let result = A.a + B.b; -}: SigResult); - -module CurriedNoSugar = fun (A:ASig) => fun (B:BSig) => { - let result = A.a + B.b; -}; - -let letsTryThatSyntaxInLocalModuleBindings () { - module CurriedSugarWithReturnType (A:ASig, B:BSig): SigResult = { - let result = A.a + B.b; - }; - module CurriedSugarWithAnnotatedReturnVal (A:ASig, B:BSig) = ({ - let result = A.a + B.b; - }: SigResult); - - module CurriedNoSugar = fun (A:ASig) => fun (B:BSig) => { - let result = A.a + B.b; - }; - - /* - * The following doesn't work in OCaml (LocalModule (struct end)).x isn't even - * parsed! - * - * let thisDoesntWorkInOCaml () = - * module LocalModule(A:sig end) = struct let x = 10 end in - * module Out = (LocalModule (struct end)) in - * let outVal = (LocalModule (struct end)).x in - * let res = Out.x in - * res;; - */ - - module TempModule = CurriedNoSugar(AMod,BMod); - module TempModule2 = CurriedSugarWithAnnotatedReturnVal(AMod,BMod); - TempModule.result + TempModule2.result; -}; - - - -module type EmptySig = {}; -module MakeAModule (X:EmptySig) {let a = 10;}; -module CurriedSugarFunctorResult = CurriedSugar(AMod,BMod); -module CurriedSugarFunctorResultInline = CurriedSugar {let a=10;} {let b=10;}; -module CurriedNoSugarFunctorResult = CurriedNoSugar(AMod,BMod); -module CurriedNoSugarFunctorResultInline = CurriedNoSugar {let a=10;} {let b=10;}; - -module ResultFromNonSimpleFunctorArg = CurriedNoSugar (MakeAModule {}, BMod); - - -/* TODO: Functor type signatures should more resemble value signatures */ -let curriedFunc: (int,int)=>int = fun(a,b) => a + b; -module type FunctorType = (ASig) => (BSig) => SigResult; -/* Which is sugar for:*/ -module type FunctorType2 = (_:ASig) => (_:BSig) => SigResult; - -/* Just for compability with existing OCaml ASTs you can put something other -* than an underscore */ -module type FunctorType3 = (Blah:ASig) => (ThisIsIgnored:BSig) => SigResult; - -/* The actual functors themselves now have curried sugar (which the pretty - * printer will enforce as well */ -/* The following: */ -module CurriedSugarWithAnnotation2: (ASig) => (BSig) => SigResult = - fun (A:ASig) => fun (B:BSig) => {let result = A.a + B.b;}; - -/* Becomes: */ -module CurriedSugarWithAnnotation: (ASig) => (BSig) => SigResult = - fun (A:ASig, B:BSig) => {let result = A.a + B.b;}; - - -/* "functors" that are not in sugar curried form cannot annotate a return type - * for now, so we settle for: */ -module CurriedSugarWithAnnotationAndReturnAnnotated: (ASig, BSig) => SigResult = - (A:ASig, B:BSig) => ({let result = A.a + B.b;}: SigResult); - -module ReturnsAFunctor (A:ASig, B:BSig): (ASig, BSig) => SigResult = - (A:ASig, B:BSig) => { - let result = 10; - }; - -module ReturnsSigResult (A:ASig, B:BSig): SigResult { - let result = 10; -}; - -module ReturnsAFunctor2 (A:ASig, B:BSig): (ASig, BSig) => SigResult = - (A:ASig, B:BSig) => {let result = 10;}; - -/* - * Recursive modules. - * TODO: Test [Psig_recmodule] - */ -module rec A : { - type t = Leaf(string) | Node(ASet.t); - let compare: (t, t) => int; -} = { - type t = Leaf(string) | Node(ASet.t); - let compare(t1,t2) = switch (t1, t2) { - | (Leaf(s1), Leaf(s2)) => Pervasives.compare(s1, s2) - | (Leaf(_), Node(_)) => 1 - | (Node(_), Leaf(_)) => -1 - | (Node(n1), Node(n2)) => ASet.compare(n1, n2) - }; -} -and ASet: Set.S with type elt = A.t = Set.Make(A); - - -/* - * How recursive modules appear in signatures. - */ -module type HasRecursiveModules = { - module rec A: { - type t = | Leaf(string) | Node(ASet.t); - let compare: (t, t) => int; - } - and ASet: Set.S with type elt = A.t; -}; - - -/* From http://stackoverflow.com/questions/1986374/higher-order-type-constructors-and-functors-in-ocaml */ -module type Type {type t;}; -module Char {type t = char;}; -module List (X:Type) {type t = list(X.t);}; -module Maybe (X:Type) {type t = option(X.t);}; -module Id (X:Type) = X; -module Compose (F:(Type)=>Type, G:(Type)=>Type, X:Type) = F(G(X)); -let l : Compose(List,Maybe,Char).t = [Some('a')]; -module Example2 (F:(Type)=>Type, X:Type) { - /** - * Note: This is the one remaining syntactic issue where - * modules/functions do not have syntax unified with values. - * It should be: - * - * let iso (a:(Compose Id F X).t): (F X).t => a; - * - */ - let iso (a:Compose(Id,F,X).t): F(X).t = a; -}; - -Printf.printf("\nModules And Functors: %n\n", CurriedNoSugarFunctorResultInline.result); - -/* We would have: */ -/* module CurriedSugarWithAnnotation: ASig => BSig => SigResult = - fun (A:ASig) (B:BSig) => {let result = A.a + B.b;; */ - -/* - module Typeahead = React.Create { - type props = {initialCount: int}; - type state = {count: int}; - let getInitialState props => {count: 10}; - let render {props, state} => -
- -
; - }; - */ - -include YourLib.CreateComponent { - type thing = blahblahblah; - type state = unit; - let getInitialState(_)= (); - let myValue = { - recordField: "hello" - }; -}; - - -module type HasInt = {let x: int;}; - -module MyModule = {let x = 10;}; - -let myFirstClass = (module MyModule : HasInt); - -let myFirstClassWillBeFormattedAs: (module HasInt) = (module MyModule); - -let acceptsAndUnpacksFirstClass ((module M : HasInt)) = M.x + M.x; - -let acceptsAndUnpacksFirstClass ((module M) : (module HasInt)) = M.x + M.x; - -module SecondClass = (val myFirstClass); - -module SecondClass2 = (val (module MyModule: HasInt)); - -let p = SecondClass.x; - -/* Opening Modules */ -module M = { - module Inner = {}; -}; - -module N = { -open M; -let z = { open M; 34; }; -let z = { open M; 34; 35; }; -let z = { open M; (34, 35) }; -let z = M.(34, 35); -let z = M.((34, 35)); -let z = { open M; {} }; -let z = M.{}; -let z = M.({}); -let z = { open M; {x:10} }; -let z = { open M; [foo, bar] }; -let z = { open M; ([foo, bar]) }; -let z = { open M; ({x: 10, y:20}) }; -let z = { open M; let open M2; value }; -let z = { open M; M2.value }; -let z = { open! M; 34; }; -let z = { open! M; 34; 35; }; -let z = { open! M; {} }; -let z = { open! M; {x:10} }; -let z = { open! M; [foo, bar] }; -let z = { open! M; ([foo, bar]) }; -let z = { open! M; ({x: 10, y:20}) }; -let z = { open! M; let open! M2; value }; -let z = { open! M; M2.value }; -let y = 44; -}; - -open M; -open M.Inner; -open M; - -let module OldModuleSyntax = { - let module InnerOldModule = { - }; -}; - -module type SigWithModuleTypeOf = { - module type ModuleType; - include (module type of String); - include (module type of Array); -}; - -module type T = t with type t = (a) => a; -module type T = t with type t = ((a) => a); -module type T = (t with type t = a) => a; - -module X = [%test extension]; -module type T = [%test extension]; - -let foo (type a, (module X): (module X_t with type t =a)) = X.a; - -let f = ((module M): (module M with type x = x and type y = y)) => M.x; - -let foo = - ( - (module X): (module X_t with type t = a and type s = a and type z = a), - (module Y): (module Y_t with type t = a), - (module Z): (module Z_t with type t = a), - ) => X.a; - -/* https://github.com/facebook/reason/issues/2028 */ -M.[]; - -module type Event = (module type of { - include ReactEventRe; -}); - -include (Version2: (module type of Version2)); - -/* https://github.com/facebook/reason/issues/2608 */ -module Functor = (()): (module type of {}) => {}; diff --git a/formatTest/unit_tests/input/modules_no_semi.re b/formatTest/unit_tests/input/modules_no_semi.re deleted file mode 100644 index aadeb0820..000000000 --- a/formatTest/unit_tests/input/modules_no_semi.re +++ /dev/null @@ -1,501 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = fun () => { - TestUtils.printSection("Modules") -}; - - - -/** - * Modules: - * ---------------------------------------------------------------------------- - * Modules accomplish the following: - * - Organization of code and data. - * - Basis for separate compilation and fast compile times. - * - Enabled higher order type abstractions that are capable of modelling very - * sophisticated typing relationships between various parts of your code. - * - * Modules are much like records, but much more powerful. Much of modules' - * powers are derived from the fact that they are primarily built up and - * organized at compilation time, instead of runtime. It is this constraint - * that allows modules to be more powerful than simple records. - * - * There are some important ways that modules differ from records: - * - * - Fields are lexically scoped: In the following record: `{x:1, y: x + x}`, - * the reference to `x` does not refer to the record field `x`. This is because - * records fields do not form lexical scopes for the evaluation of other record - * values. Modules, on the other hand do allow fields to reference other - * fields. Appropriately, each field is introduced via the keyword `let`. - */ - -module MyFirstModule = { - let x = 0 - let y = x + x -} - -let result = MyFirstModule.x + MyFirstModule.y; - -/** - * - A module is introduced with the `module` phrase. - * - A module *must* have a capital letter as its first character. - * - The exported fields of a module must be listed within `{}` braces and each - * exported value binding is specified via a `let` keyword. - */ - -/** - * Another way that modules are more powerful than records, is that they may - * also export types. - */ -module MySecondModule = { - type someType = int - let x = 0 - let y = x + x -} - -let myInt:MySecondModule.someType = 100; - -/** Module signatures: - * ---------------------------------------------------------------------------- - * Not only may modules export types, but modules *themselves* can be described - * by types via the `module type` phrase. We call these module types - * "signatures". For example, `MySecondModule` has the following `module type` - * signature: - */ -module type MySecondModuleType = { - type someType = int - let x: int - let y: int -} - -/** - * Much like how you can ensure that a value is compatible with a specific - * type: - - let myTestVal: int = 10 - - * You can also perform the same type of annotation to ensure that you have - * written code that matches your understanding. For example, `MySecondModule` - * could have been written as: - - module MySecondModule: MySecondModuleType = { - type someType = int - let x = 0 - let y = x + x - } - */ - -/** - * - Modules may be artificially "constrained" so that users of a module see - * fewer details than are actually present. - * - Modules may be combined, merged, and transformed at compile time in ways - * that - * - Because they are more powerful, they may not be passed around at runtime - * as easily as records. - * - * Some additioal benefits to using modules: - * - Modules are a very elegant way to organize large packages of code. - * - Modules are the unit of compilation. Minimal recompilation changes - * - Modules can help you achieve higher degrees of polymorphism than the core - * language. - */ - -let opensAModuleLocally = { - module MyLocalModule = { - type i = int - let x:i = 10 - } - /* Notice how local modules names may be used twice and are shadowed */ - module MyLocalModule: MySecondModuleType = { - type someType = int - let x:someType = 10 - let y:someType = 20 - } - let tmp = MyLocalModule.x + 22; - tmp + 30 -} - -module type HasTT = { - type tt -} - -module SubModule: HasTT = { - type tt = int -} - -module type HasEmbeddedHasTT = { - module SubModuleThatHasTT = SubModule -} - -module type HasPolyType = {type t('a)} - -module type HasDestructivelySubstitutedPolyType = - HasPolyType with type t('a) := list('a) - -module type HasDestructivelySubstitutedSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int) */ - module X: HasDestructivelySubstitutedPolyType -} -module type HasSubPolyModule = { - /* Cannot perform destructive substitution on submodules! */ - /* module X: HasPolyType with type t := list (int, int) */ - module X: HasPolyType -} - -module EmbedsSubPolyModule: HasSubPolyModule = { - module X = { - type t('a) = list('a) - } -} - -module EmbedsDestructivelySubstitutedPolyModule: HasDestructivelySubstitutedSubPolyModule = { - module X = { - type t = list (int, int) - } -} - -module type HasMultiPolyType = { - type substituteThis('a,'b) - type substituteThat('a,'b) -} - -module type HasDestructivelySubstitutedMultiPolyType = ( - HasMultiPolyType with -type substituteThis('a,'b) := Hashtbl.t('a,'b) and -type substituteThat('a,'b) := Hashtbl.t('a,'b) -) - - -module InliningSig: {let x: int let y:int} = { - /* - * Comment inside of signature. - */ - let x = 10 - /* Inline comment inside signature. */ - let y = 20 -} - -module MyFunctor = fun (M: HasTT) => { - type reexportedTT = M.tt; - /* Inline comment inside module. */ - /** Following special comment inside module. */ - let someValue = 1000 -} - -/* Notice how - - Functors no longer require parens around argument. - - A final semicolon is required for module structures. - - We should eliminate both those requirements. See action items 13-14 at the - bottom of this file. [Actually, forgiving the trailing SEMI might not be - such a great idea]. - */ -module MyFunctorResult = MyFunctor ({type tt = string}) - -module LookNoParensNeeded = MyFunctor {type tt = string} - -module type SigResult = {let result:int} - -module type ASig = {let a:int} -module type BSig = {let b:int} -module AMod = {let a = 10} -module BMod = {let b = 10} - -module CurriedSugar (A:ASig, B:BSig) { - let result = A.a + B.b -} - - -/* Right now [CurriedSuperSugar] is parsed as being indistinguishable from - the above. - - module CurriedSuperSugar (A:ASig) (B:BSig): SigResult => ({ - let result = A.a + B.b - }: SigResult) - - /* Not supported in OCaml OR Reason (Edit: now supported in OCaml for functions) */ - let x = fun (a:foo) :bar => baz - module x = fun (A:Foo) :Bar => Baz - - /* Supported in both OCaml and Reason */ - let x (a:foo) :bar => baz - module x (A:Foo) :Bar => Baz - - */ -module CurriedSugarWithReturnType (A:ASig, B:BSig): SigResult { - let result = A.a + B.b -} - -/* This is parsed as being equivalent to the above example */ -module CurriedSugarWithAnnotatedReturnVal (A:ASig, B:BSig) = ({ - let result = A.a + B.b -}: SigResult) - -module CurriedNoSugar = fun (A:ASig) => fun (B:BSig) => { - let result = A.a + B.b -} - -let letsTryThatSyntaxInLocalModuleBindings () { - module CurriedSugarWithReturnType (A:ASig, B:BSig): SigResult = { - let result = A.a + B.b - } - module CurriedSugarWithAnnotatedReturnVal (A:ASig, B:BSig) = ({ - let result = A.a + B.b - }: SigResult) - - module CurriedNoSugar = fun (A:ASig) => fun (B:BSig) => { - let result = A.a + B.b - } - - /* - * The following doesn't work in OCaml (LocalModule (struct end)).x isn't even - * parsed! - * - * let thisDoesntWorkInOCaml () = - * module LocalModule(A:sig end) = struct let x = 10 end in - * module Out = (LocalModule (struct end)) in - * let outVal = (LocalModule (struct end)).x in - * let res = Out.x in - * res - */ - - module TempModule = CurriedNoSugar(AMod,BMod) - module TempModule2 = CurriedSugarWithAnnotatedReturnVal(AMod,BMod); - TempModule.result + TempModule2.result -} - - - -module type EmptySig = {} -module MakeAModule (X:EmptySig) {let a = 10} -module CurriedSugarFunctorResult = CurriedSugar(AMod,BMod) -module CurriedSugarFunctorResultInline = CurriedSugar {let a=10} {let b=10} -module CurriedNoSugarFunctorResult = CurriedNoSugar(AMod,BMod) -module CurriedNoSugarFunctorResultInline = CurriedNoSugar {let a=10} {let b=10} - -module ResultFromNonSimpleFunctorArg = CurriedNoSugar (MakeAModule {}, BMod) - - -/* TODO: Functor type signatures should more resemble value signatures */ -let curriedFunc: (int,int)=>int = fun(a,b) => a + b -module type FunctorType = (ASig) => (BSig) => SigResult -/* Which is sugar for:*/ -module type FunctorType2 = (_:ASig) => (_:BSig) => SigResult - -/* Just for compability with existing OCaml ASTs you can put something other -* than an underscore */ -module type FunctorType3 = (Blah:ASig) => (ThisIsIgnored:BSig) => SigResult - -/* The actual functors themselves now have curried sugar (which the pretty - * printer will enforce as well */ -/* The following: */ -module CurriedSugarWithAnnotation2: (ASig) => (BSig) => SigResult = - fun (A:ASig) => fun (B:BSig) => {let result = A.a + B.b} - -/* Becomes: */ -module CurriedSugarWithAnnotation: (ASig) => (BSig) => SigResult = - fun (A:ASig, B:BSig) => {let result = A.a + B.b} - - -/* "functors" that are not in sugar curried form cannot annotate a return type - * for now, so we settle for: */ -module CurriedSugarWithAnnotationAndReturnAnnotated: (ASig, BSig) => SigResult = - (A:ASig, B:BSig) => ({let result = A.a + B.b}: SigResult) - -module ReturnsAFunctor (A:ASig, B:BSig): (ASig, BSig) => SigResult = - (A:ASig, B:BSig) => { - let result = 10 - } - -module ReturnsSigResult (A:ASig, B:BSig): SigResult { - let result = 10 -} - -module ReturnsAFunctor2 (A:ASig, B:BSig): (ASig, BSig) => SigResult = - (A:ASig, B:BSig) => {let result = 10} - -/* - * Recursive modules. - * TODO: Test [Psig_recmodule] - */ -module rec A : { - type t = Leaf(string) | Node(ASet.t) - let compare: (t, t) => int -} = { - type t = Leaf(string) | Node(ASet.t) - let compare(t1,t2) = switch (t1, t2) { - | (Leaf(s1), Leaf(s2)) => Pervasives.compare(s1, s2) - | (Leaf(_), Node(_)) => 1 - | (Node(_), Leaf(_)) => -1 - | (Node(n1), Node(n2)) => ASet.compare(n1, n2) - } -} -and ASet: Set.S with type elt = A.t = Set.Make(A) - - -/* - * How recursive modules appear in signatures. - */ -module type HasRecursiveModules = { - module rec A: { - type t = | Leaf(string) | Node(ASet.t) - let compare: (t, t) => int - } - and ASet: Set.S with type elt = A.t -} - - -/* From http://stackoverflow.com/questions/1986374/higher-order-type-constructors-and-functors-in-ocaml */ -module type Type {type t} -module Char {type t = char} -module List (X:Type) {type t = list(X.t)} -module Maybe (X:Type) {type t = option(X.t)} -module Id (X:Type) = X -module Compose (F:(Type)=>Type, G:(Type)=>Type, X:Type) = F(G(X)) -let l : Compose(List,Maybe,Char).t = [Some('a')] -module Example2 (F:(Type)=>Type, X:Type) { - /** - * Note: This is the one remaining syntactic issue where - * modules/functions do not have syntax unified with values. - * It should be: - * - * let iso (a:(Compose Id F X).t): (F X).t => a - * - */ - let iso (a:Compose(Id,F,X).t): F(X).t = a -}; - -Printf.printf("\nModules And Functors: %n\n", CurriedNoSugarFunctorResultInline.result); - -/* We would have: */ -/* module CurriedSugarWithAnnotation: ASig => BSig => SigResult = - fun (A:ASig) (B:BSig) => {let result = A.a + B.b} */ - -/* - module Typeahead = React.Create { - type props = {initialCount: int} - type state = {count: int} - let getInitialState props => {count: 10} - let render {props, state} => -
- -
- } - */ - -include YourLib.CreateComponent { - type thing = blahblahblah - type state = unit - let getInitialState(_)= () - let myValue = { - recordField: "hello" - } -} - - -module type HasInt = {let x: int} - -module MyModule = {let x = 10} - -let myFirstClass = (module MyModule : HasInt) - -let myFirstClassWillBeFormattedAs: (module HasInt) = (module MyModule) - -let acceptsAndUnpacksFirstClass ((module M : HasInt)) = M.x + M.x - -let acceptsAndUnpacksFirstClass ((module M) : (module HasInt)) = M.x + M.x - -module SecondClass = (val myFirstClass) - -module SecondClass2 = (val (module MyModule: HasInt)) - -let p = SecondClass.x - -/* Opening Modules */ -module M = { - module Inner = {} -} - -module N = { -open M -let z = { open M; 34 } -let z = { open M; 34; 35 } -let z = { open M; (34, 35) } -let z = M.(34, 35) -let z = M.((34, 35)) -let z = { open M; {} } -let z = M.{} -let z = M.({}) -let z = { open M; {x:10} } -let z = { open M; [foo, bar] } -let z = { open M; ([foo, bar]) } -let z = { open M; ({x: 10, y:20}) } -let z = { open M let open M2; value } -let z = { open M; M2.value } -let z = { open! M; 34 } -let z = { open! M; 34; 35 } -let z = { open! M; {} } -let z = { open! M; {x:10} } -let z = { open! M; [foo, bar] } -let z = { open! M; ([foo, bar]) } -let z = { open! M; ({x: 10, y:20}) } -let z = { open! M let open! M2; value } -let z = { open! M; M2.value } -let y = 44 -} - -open M -open M.Inner -open M - -let module OldModuleSyntax = { - let module InnerOldModule = { - } -} - -module type SigWithModuleTypeOf = { - module type ModuleType - include (module type of String) - include (module type of Array) -} - -module type T = t with type t = (a) => a -module type T = t with type t = ((a) => a) -module type T = (t with type t = a) => a - -module X = [%test extension] -module type T = [%test extension] - -let foo (type a, (module X): (module X_t with type t =a)) = X.a - -let f = ((module M): (module M with type x = x and type y = y)) => M.x - -let test = b => { - if (b) { - ignore(); - } - - while (x) { - compute() - } - - try (x()) { - | _ => log() - } - - switch (test) { - | A => () - | B => () - } - - for (x in 0 to 10) { - print_int(x) - print_string(" ") - } - - assert(true) - - lazy true - - Fun.ignore() -} diff --git a/formatTest/unit_tests/input/object.re b/formatTest/unit_tests/input/object.re deleted file mode 100644 index f8cdcc56a..000000000 --- a/formatTest/unit_tests/input/object.re +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -type t = {.}; - -type t = { - . - u: int, - v: int -}; - -type t = {.. u: int}; - -type t = {.. u: int}; - -type t = { - .. -}; - -type t = {..}; - -let (<..>)(a,b) = a + b; -let five = 2 <..> 3; - -type closedObjSugar = Js.t({. foo: bar, baz: int}); - -type openObjSugar = Js.t({.. x: int, y: int}); - -type x = Js.t({.}); - -type y = Js.t({..}); - -/* #1595: always break object rows (>= 2) for readability */ -type o = { - . - a: int, - b: int -}; - -type o2 = { - .. - a: int, - b: int -}; - -let obj = {as _; [@foo] val a = 1}; - -/* Oinherit (https://github.com/ocaml/ocaml/pull/1118) */ -type t1 = { - . - n: string, - ...t, -}; - -type t1 = { - .. - n: string, - ...t, -}; - -type g1 = { - . - n: string, - ...t, - ...y, -}; - -type g2 = { - . - n: string, - ...t, - ...y, -}; - -type m1 = { - . - ...M.t, -}; -type m2('a) = { - . - n: string, - ...M.t('a), -}; diff --git a/formatTest/unit_tests/input/ocaml_identifiers.ml b/formatTest/unit_tests/input/ocaml_identifiers.ml deleted file mode 100644 index 61182be31..000000000 --- a/formatTest/unit_tests/input/ocaml_identifiers.ml +++ /dev/null @@ -1,95 +0,0 @@ -(* Type names (supported with PR#2342) *) -module T = struct - type pub = unit -end - -(* Value names (already supported) *) -module V = struct - let method_ = () -end - -(* Record fields *) -module R = struct - type r = { mutable method_ : int } - - let foo = { method_ = 4 } - - let x = foo.method_ - - let () = foo.method_ <- 42 - - let y = match foo with {method_} -> method_ - - let z = match foo with {method_=12} -> 21 -end - -(* Class names and instance variables *) -module C = struct - class pub = object end - - class c = object - val pub = 0 - method method_ () = () - end - - class c' = object - inherit method_ - val! pub = 1 - end -end - -(* Class types *) -module Ct = struct - class type method_ = object - val method_: unit -> unit - end -end - -(* Virtual *) -module Cv = struct - class virtual method_ = object end -end - -(* Object methods *) -module O = struct - let o = object method method_ = () end -end - -(* Function parameter labels *) -module L = struct - let f ~method_ = ignore method_ -end - -(* Module types *) -module type method_ = sig -end - -(* Polymorphic variants (probably ok as-is?) *) -module P = struct - type t = [ `pub | `method_ ] - - let x = `method_ - - let () = fun `method_ -> 34 -end - -type method_ = string - -type foo = {method_: method_} -[@@some_attr: type_] -[@@other_attr: method_] - -let f ~method_ = Js.log(method_) - -let x = f ~method_:"GET" - -type marshalFields = < switch: string > Js.t - -let testMarshalFields = ([%bs.obj { switch = "switch" }] : marshalFields) - -(* Not an identifier test, but this is testing OCaml -> RE *) -let x = List.map (fun y -> - (); - y) - -let newType (type method_) () = () \ No newline at end of file diff --git a/formatTest/unit_tests/input/pexpFun.re b/formatTest/unit_tests/input/pexpFun.re deleted file mode 100644 index bcd9e6cda..000000000 --- a/formatTest/unit_tests/input/pexpFun.re +++ /dev/null @@ -1,77 +0,0 @@ -let x = - switch (x) { - | Bar => - ReasonReact.UpdateWithSideEffects( - {...state, click: click + 1}, - self => { - let _ = 1; - apply(bar); - }, - "foo", - ) - | Foo => () - }; - -let x = - switch (x) { - | Bar => - ReasonReact.UpdateWithSideEffects( - self => { - let _ = 1; - apply(bar); - }, - ) - | Foo => () - }; - -Mod.Update( - (acc, curr) => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update( - (acc, curr): string => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update( - [@foo] [@bar] - (acc, curr) => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update( - [@foo] [@bar] - (curr) => string_of_int(curr), - "", - lst, -); - -Mod.Update( - [@foo] [@bar] [@baz] [@something] [@do] curr => string_of_int(curr), - "", - lst, -); - -Mod.Update( - (acc, curr, lkdjf, lskdfj, sdfljk, slkdjf, skdjf, sdlkfj): string => { - let x = 1; - string_of_int(curr); - }, - "", - lst, -); - -Mod.Update((acc, curr) => string_of_int(curr), "", lst); diff --git a/formatTest/unit_tests/input/pipeFirst.re b/formatTest/unit_tests/input/pipeFirst.re deleted file mode 100644 index a136282b0..000000000 --- a/formatTest/unit_tests/input/pipeFirst.re +++ /dev/null @@ -1,174 +0,0 @@ -foo |. f |. g |. h; - -bar->f->g->h; - -foo(g)->f(a, b)->g(c, d); - -foo->f(); - -compilation -->Plugin.buildAssets -->Js.Json.stringify -->Node.Fs.writeFileAsUtf8Sync(_, path); - -foo -->someLongIdentifier -->otherLongIdentifierWithArgs(a, b, c) -->longIdentWithVeryLongArgs(aaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbb, ccccccccccccc); - -/* with comments */ -compilation -/* first */ -->Plugin.buildAssets /* first trail */ -/* second */ -->Js.Json.stringify /* second trail */ -/* last */ -->Node.Fs.writeFileAsUtf8Sync(_, path); /* last trail */ - -foo->bar->baz >>= monadicFunction |> bind; - -compilation -->Plugin.buildAssets -->Js.Json.stringify -|> Cohttp_lwt_body.to_string ->|= ( - body => - Printf.sprintf( - "okokok", - uri, - meth, - headers, - body, - ) -) ->>= ( - body => - Server.respond_string( - ~status, - ~body, - (), - ) -); - -x + y + foo->bar->baz; -x + y * foo->bar->baz; -x && y || foo->bar->baz; - -x < foo->bar->baz; -foo !== bar->baz; -x |> y >>= foo->bar->baz; -let m = f => foo->bar->f; - -obj##x->foo->bar; - -(event->target)[0]; - -event->target[0]; - -(event->target)##value; - -event->target##value; - -event->target##value[0]; - -event |. target##value[0]; - -event->target(foo); - -event->(target(foo)); - -(event->target)(foo); - -event |. target(foo); - -foo->bar := baz; - -foo->bar === baz; - -event->target##value(foo); - -event->target##(value(foo)); - -(foo^)->bar; - -(location##streets).foo[1]; - -(event->target^)##value; - -event->target^ #= value; - -foo->f(. a, b); -foo->f(. a, b)->g(. c, d); -foo->([@attr] f(. a, b))->([@attr2] f(. a, b)); -foo->f(.); -foo->f(.)->g(.); -foo->([@attr] f(.))->([@attr] g(.)); - -("some-string" ++ "another")->more; -(-1)->foo; --1->foo; -!foo->bar; -(!foo)->bar; - -a->(b##c); - -(a->b)##c; - -(switch (saveStatus) { - | Pristine => "" - | Saved => "Saved" - | Saving => "Saving" - | Unsaved => "Unsaved" - }) - ->str; - -
- (switch (saveStatus) { - | Pristine => "" - | Saved => "Saved" - | Saving => "Saving" - | Unsaved => "Unsaved" - }) - ->str -
; - -blocks->(blocks => {"blocks": blocks}); -
blocks->(blocks => {"blocks": blocks})
; - -(state.title == "" ? "untitled" : state.title)->str; - - ((state.title == "" ? "untitled" : state.title)->str) ; - -ReasonReact.Router.watchUrl(url => Route.urlToRoute(url)->ChangeView->(self.send)); -ReasonReact.Router.watchUrl(url => Route.urlToRoute(url)->ChangeView->self.send); - -window->Webapi.Dom.Window.open_(~url, ~name="authWindow", ~features=params); - -window->Webapi.Dom.Window.open_(~url, ~name="authWindow", () => { let x = 1; let y = 2; x + y; }); - -reactClass -->setNavigationOptions( - NavigationOptions.t(~title="Title", ~gesturesEnabled=false, ()), - ); - -Foo.Bar.reactClass -->setNavigationOptions( - NavigationOptions.t(~title="Title", ~gesturesEnabled=false, ()), - ); - -foo##bar -->setNavigationOptions( - NavigationOptions.t(~title="Title", ~gesturesEnabled=false, ()), - ); - -
{items->Belt.Array.map(ReasonReact.string)->ReasonReact.array}
; - -a->(b->c); - -
(T.t("value") |. ReasonReact.string)
; - -
{url->a(b, _)}
; -
{url->a(b, _)->a(b, _)}
; - -foo->Option.map(fn(_, arg)); - diff --git a/formatTest/unit_tests/input/polymorphism.re b/formatTest/unit_tests/input/polymorphism.re deleted file mode 100644 index bc9dfe432..000000000 --- a/formatTest/unit_tests/input/polymorphism.re +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let run = fun () => { - TestUtils.printSection("Polymorphism"); -}; - -type myType('a) = list('a); -type myTwoParamType('a,'b) = ('a, 'b); - -type myTupleType = (int, int); -type myPolymorphicTupleType('a) = ('a, 'a); - -type extensible('a) = 'a -constraint 'a = [ | `Base(int)]; - -type intListTranformer = (list(int)) => list(int); - -type x = list (int, string); - - -module HoldsAType = { - type hasPrime('a,'b,'c) = Hashtbl.t (list('a),list('b)); -}; - -type myType2 = (myTwoParamType(myType((int) => int), int)) => int; - - - /* Confusing because => looks like part - of the return type signature. */ -let myFunc (a:(int)=>int, b:(int)=>int) :myType(int) = - [a(20) + b(30)]; - -let myFunc (a:(int)=>int, b:(int)=>int) : ((myType(int)) => myType(int)) = - fun(lst) => lst; - - -let certainlyRequiresWrapping: - (option((Mod.handler(p,re), Mod.Types.handler)), - option((Mod.touch(props,(props, state),resource), (list(Mod.t), list(Mod.t)))), - list(Mod.update(props,(props, state),resource))) => - list(Mod.update(props,(props, state),resource)) = (); - - -/* Because of the confusion in the last two examples, I believe we should - switch back to the `=` based syntax. - - let add a b = a + b; - - Pexp_function printing: - - Decide on either: - - let add Some (Hearts n) = n + n - | add Some (Diamonds n) = 0 - | add Some (Spades n) = 0 - | add None = 0 - | _ = 0 - - Or: - let add = x => match x with - | Some (Hearts n) => n + n - | Some (Diamonds n) => 0 - | Some (Spades n) => 0 - | None => 0 - | _ => 0 - - let add = - | Some (Hearts n) => n + n - | Some (Diamonds n) => 0 - | Some (Spades n) => 0 - | None => 0 - | _ => 0 - - let myFunc = (a:int) (b:int) => a + b; */ - -/* Fringe features */ - -/* - /* This parses, but doesn't type check */ - module TryExtendingType = {type t = Hello of string;}; - type TryExtendingType.t += LookANewExtension of string; - */ -"end"; diff --git a/formatTest/unit_tests/input/sharpop.re b/formatTest/unit_tests/input/sharpop.re deleted file mode 100644 index 8c7e7ab53..000000000 --- a/formatTest/unit_tests/input/sharpop.re +++ /dev/null @@ -1,23 +0,0 @@ -foo#=bar[0]; - -foo##bar[0] = 3; - -foo##bar[0]##baz[1] = 3; - -foo##bar[0]##baz[1]; - -foo##bar#=bar[0]; - -foo##bar##baz #= bar##baz[0]; - -foo[bar + 1]; - -foo.[bar + 1]; - -foo.{bar + 1}; - -foo.[bar + 1] = 1; - -foo.{bar + 1} = 1; - -foo[bar + 1] = 1; diff --git a/formatTest/unit_tests/input/singleLineCommentEof.re b/formatTest/unit_tests/input/singleLineCommentEof.re deleted file mode 100644 index 18f9b9683..000000000 --- a/formatTest/unit_tests/input/singleLineCommentEof.re +++ /dev/null @@ -1 +0,0 @@ -// let x = 1 diff --git a/formatTest/unit_tests/input/syntax.re b/formatTest/unit_tests/input/syntax.re deleted file mode 100644 index a579f2f01..000000000 --- a/formatTest/unit_tests/input/syntax.re +++ /dev/null @@ -1,1278 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -[@autoFormat let wrap=80; let shift=2;]; -Modules.run (); -Polymorphism.run (); -Variants.run(); -BasicStructures.run(); - -TestUtils.printSection("General Syntax"); -/* Won't work! */ -/* let matchingFunc a = match a with */ -/* `Thingy x => (print_string "matched thingy x"); x */ -/* | `Other x => (print_string "matched other x"); x;; */ -/* */ -let matchingFunc(a) = switch (a) { - | `Thingy x => { - print_string("matched thingy x"); - let zz = 10; - zz; - } - | `Other x => { - print_string("matched other x"); - x; - } -}; - -type firstTwoShouldBeGroupedInParens = - ((int) => int, int) => int; -type allParensCanBeRemoved = - (int) => ((int) => ((int) => int)); -type firstTwoShouldBeGroupedAndFirstThree = - (((int) => int) => int) => int; -/* Same thing now but with type constructors instead of each int */ -type firstTwoShouldBeGroupedInParens = - ((list(int)) => list(int), list(int)) => list(int); -type allParensCanBeRemoved = - (list(int)) => ((list(int)) => ((list(int)) => list(int))); -type firstTwoShouldBeGroupedAndFirstThree = - (((list(int)) => list(int)) => list(int)) => list(int); - -type myRecordType = { - firstTwoShouldBeGroupedInParens: - ((int) => int, int) => int, - allParensCanBeRemoved: - (int) => ((int) => ((int) => int)), - firstTwoShouldBeGroupedAndFirstThree: - (((int) => int) => int) => int, -}; - -type firstNamedArgShouldBeGroupedInParens = - (~first: (int) => int, ~second: int) => int; -type allParensCanBeRemoved = - (~first: int) => ((~second: int) => ((~third: int) => int)); -type firstTwoShouldBeGroupedAndFirstThree = - (~first: ((int) => int) => int) => int; - -/* Same thing now, but with type constructors instead of int */ -type firstNamedArgShouldBeGroupedInParens = - (~first: (list(int)) => list(int)) => (~second: list(int)) => list(int); -type allParensCanBeRemoved = - (~first: list(int)) => (~second: list(int)) => (~third: list(int)) => list(int); -type firstTwoShouldBeGroupedAndFirstThree = - (~first: ((list(int)) => list(int)) => list(int)) => list(int); - - -type firstNamedArgShouldBeGroupedInParens = - (~first: ((int) => int)=?, ~second: list(int)=?) => int; -/* The arrow necessitates parens around the next two args. The ? isn't what - * makes the parens necessary. */ -type firstNamedArgShouldBeGroupedInParensAndSecondNamedArg = - (~first: ((int) => int)=?, ~second: ((int) => int)=?) => int; -type allParensCanBeRemoved = - (~first: int=?, ~second: int=?, ~third: int=?) => int; -type firstTwoShouldBeGroupedAndFirstThree = - (~first: (((int) => int) => int)) => int; - -type noParens = (~one: int, int, int, ~two: int) => int; -type noParensNeeded = (~one: int) => ((int) => ((int) => ((~two: int) => int))); -type firstNamedArgNeedsParens = (~one: (int, int) => int, ~two: int) => int; - -/* Now, let's try type aliasing */ -/* Unless wrapped in parens, types between arrows may not be aliased, may not - * themselves be arrows. */ - -type parensRequiredAroundFirstArg = (list(int) as 'a) => int as 'a; - -type parensRequiredAroundReturnType = (list(int) as 'a) => (int as 'a); - -type parensRequiredAroundReturnType = (list(int) as 'a) => (int as 'a) as 'b; - -type noParensNeededWhenInTuple = (list(int) as 'a, list(int) as 'b) as 'entireThing; - -type myTypeDef('a) = list('a); - -type instatiatedTypeDef = (myTypeDef(int)) => int; - -/* Test a type attribute for good measure */ -/* We should clean up all of the attribute tagging eventually, but for now, - * let's make it super ugly to get out of the way of all the formatting/parsing - * implementations (fewer conflicts during parsing, fewer edge cases during - * printing). - */ -type something = (int, ([@lookAtThisAttribute] int)); - -type longWrappingTypeDefinitionExample = - M_RK__G.Types.instance ( - TGRecognizer.tGFields(unit,unit), - TGRecognizer.tGMethods(unit,unit) - ) - ; -type semiLongWrappingTypeDefinitionExample = - M_RK__Gesture.Types.instance ( - TGRecognizerFinal.tGFields, - TGRecognizerFinal.tGMethods - ); - -type semiLongWrappingTypeWithConstraint = - M_RK__Gesture.Types.instance('a, - TGRecognizerFinal.tGFields, - TGRecognizerFinal.tGMethods - ) constraint 'a = (unit, unit) - ; - -type onelineConstrain = 'a constraint 'a = int; - -/* This must be in trunk but not in this branch of OCaml */ -/* type withNestedRecords = MyConstructor {myField: int} */ - -type colors = - | Red(int) - | Black(int) - | Green(int); - -/* Another approach is to require declared variants to wrap any record */ -/* type myRecord = MyRecord {name: int}; */ -/* let myValue = MyRecord {name: int}; */ -/* This would force importing of the module */ -/* This would also lend itself naturally to pattern matching - and avoid having -to use `.` operator at all since you normally destructure. */ -type nameBlahType = {nameBlah: int}; -let myRecord = {nameBlah: 20}; -let myRecordName = myRecord.nameBlah; - -let {nameBlah}:nameBlahType = {nameBlah: 20}; -print_int(nameBlah); -let {nameBlah: aliasedToThisVar}:nameBlahType = {nameBlah: 20}; -print_int(aliasedToThisVar); - - -let desiredFormattingForWrappedLambda: - (int, int, int) => nameBlahType = -/* - - fun is - pre- /firstarg\ - fix /-coupled--\ - |-\ /-to-prefix--\ */ - fun(curriedArg, - anotherArg, - lastArg) => { - nameBlah: 10 - }; - -type longerInt = int; -let desiredFormattingForWrappedLambdaWrappedArrow: - (longerInt, - longerInt, - longerInt) => - nameBlahType = -/* - - fun is - pre- /firstarg\ - fix /-coupled--\ - |-\ /-to-prefix--\ */ - fun(curriedArg, - anotherArg, - lastArg) => { - nameBlah: 10 - }; - -let desiredFormattingForWrappedLambdaReturnOnNewLine = -/* - - fun is - pre- /firstarg\ - fix /-coupled--\ - |-\ /-to-prefix--\ */ - fun(curriedArg, - anotherArg, - lastArg) => - { - nameBlah: 10 - }; - - -/* -let is -pre- -fix /-function binding name---\ -|-\ / is coupled to prefix \ */ -let desiredFormattingForWrappedSugar - (curriedArg, - anotherArg, - lastArg) { - nameBlah: 10 -}; - -/* -let is -pre- -fix /-function binding name---\ -|-\ / is coupled to prefix \ */ -let desiredFormattingForWrappedSugarReturnOnNewLine - (curriedArg, - anotherArg, - lastArg) -{ - nameBlah: 10 -}; - - -/* - let : type t1 t2. t1 * t2 list -> t1 = ... - let rec f : 't1 't2. 't1 * 't2 list -> 't1 = - fun (type t1) (type t2) -> (... : t1 * t2 list -> t1) -*/ - -type point = {x: int, y:int}; -type point3D = {x: int, y:int, z:int}; -let point2D = { - x: 20, - y: 30 -}; - -let point3D:point3D = { - x: 10, - y: 11, - z: 80, /* Optional Comma */ -}; - -let printPoint (p:point) { - print_int(p.x); - print_int(p.y); -}; - -let addPoints (p1:point, p2:point) { - x: p1.x + p2.x, - y: p1.y + p2.y -}; - -let res1 = printPoint(point2D); -let res2 = printPoint({x:point3D.x, y:point3D.y}); - -/* - When () were used to indicate sequences, the parser used seq_expr not only - for grouping sequences, but also to form standard precedences. - /------- sequence_expr ------\ - let res3 = printPoint (addPoints (point2D, point3D)); - - Interestingly, it knew that tuples aren't sequences. - - To move towards semi delimited, semi-terminated, braces-grouped sequences: - while allowing any non-sequence expression to be grouped on parens, we make - an explicit rule that allows one single non-semi ended expression to be - grouped in parens. - - Actually: We will allow an arbitrary number of semi-delimited expressions to - be wrapped in parens, but the braces grouped semi delimited (sequence) - expressions must *also* be terminated with a semicolon. - - This allows the parser to distinguish between - - let x = {a}; /* Record {a:a} */ - let x = {a;}; /* Single item sequence returning identifier {a} */ -*/ -let res3 = printPoint (addPoints (point2D, {x:point3D.x, y:point3D.y})); - -type person = {age: int, name: string}; -type hiredPerson = {age: string, name: string, dateHired: int}; - -let o: (person) = {name: "bob", age: 10}; - -/* Parens needed? Nope! */ -let o: person = {name: "bob", age: 10}; - -let printPerson (p: person) { - let q: person = p; - p.name ++ p.name; -}; - -/* let dontParseMeBro x y:int = x = y;*/ - -/* With this unification, anywhere eyou see `= fun` you can just ommit it */ -let blah = fun(a) => a; /* Done */ -let blah (a) = a; /* Done (almost) */ - -let blah = fun(a,b) => a; /* Done */ -let blah (a, b) = a; /* Done (almost) */ - -/* More than one consecutive pattern must have a single case */ -type blah = {blahBlah: int}; -let blah = fun (a, {blahBlah}) => a; -let blah (a, {blahBlah}) = a; - -module TryToExportTwice = { - let myVal = "hello"; -}; - -/* - Unifying top level module syntax with local module syntax is probably a bad - idea at the moment because it makes it more difficult to continue to support - `let .. in` bindings. We can distinguish local modules for `let..in` that - just happen to be defined at the top level (but not exported). - - let MyModule = {let myVal = 20;} in - MyModule.x - - Wait, where would this ever be valid, even if we continued to support - `let..in`? -*/ - -let onlyDoingThisTopLevelLetToBypassTopLevelSequence = { - let x = { - print_int(1); - print_int(20); /* Missing trailing SEMI */ - }; - - let x = { - print_int(1); - print_int(20); /* Ensure missing middle SEMI reported well */ - print_int(20); - }; - - let x = { - print_int(1); - print_int(20); - 10; - /* Comment in final position */ - }; /* Missing final SEMI */ - x + x; -}; - -type hasA = {a:int}; -let a = 10; -let returnsASequenceExpressionWithASingleIdentifier () {a}; -let thisReturnsA () {a;}; -let thisReturnsAAsWell () = a; - -let recordVal:int = thisReturnsARecord().a; -Printf.printf("\nproof that thisReturnsARecord: %n\n", recordVal); -Printf.printf("\nproof that thisReturnsA: %n\n", thisReturnsA()); - -/* Pattern matching */ -let blah = fun(arg) => switch (arg) { - /* Comment before Bar */ - | /* Comment between bar/pattern */ - Red(_) => 1 - /* Comment Before non-first bar */ - | /* Comment betwen bar/pattern */ - Black(_) => 0 - | Green(_) => 0 -}; - -/* Any function that pattern matches a multicase match is interpretted as a - * single arg that is then matched on. Instead of the above `blah` example:*/ - -let blah = fun - | Red(_) => 1 - | Black(_) => 0 - | Green(_) => 1; - -/* `fun a => a` is read as "a function that maps a to a". Then the */ -/* above example is read: "a function that 'either maps' Red to.. or maps .." */ -/* Thc00f564e first bar is read as "either maps" */ - - -/* Curried form is not supported: - let blah x | Red _ => 1 | Black _ => 0; - Theres no sugar rule for dropping => fun, only = fun -*/ - -/* let blahCurriedX x => fun /* See, nothing says we can drop the => fun */ */ -/* |(Red x | Black x | Green x) => 1 /* With some effort, we can ammend the sugar rule that would */ */ -/* | Black x => 0 /* Allow us to drop any => fun.. Just need to make pattern matching */ */ -/* | Green x => 0; /* Support that */ */ -/* */ - -let blahCurriedX(x) = - fun - | Red(x) - | Black(x) - | Green(x) => 1 /* With some effort, we can ammend the sugar rule that would */ - | Black(x) => 0 /* Allow us to drop any => fun.. Just need to make pattern matching */ - | Green(x) => 0; /* Support that */ - -let sameThingInLocal = { - let blahCurriedX(x) = - fun - | Red(x) - | Black(x) - | Green(x) => 1 /* With some effort, we can ammend the sugar rule that would */ - | Black(x) => 0 /* Allow us to drop any => fun.. Just need to make pattern matching */ - | Green(x) => 0; /* Support that */ - blahCurriedX; - -}; - -/* This should be parsed/printed exactly as the previous */ -let blahCurriedX(x) = fun - | Red(x) | Black(x) | Green(x) => 1 - | Black(x) => 0 - | Green(x) => 0; - -/* Any time there are multiple match cases we require a leading BAR */ - -let v = Red(10); -let (Black(x) | Red(x) | Green(x)) = v; /* So this NON-function still parses */ - -/* This doesn't parse, however (and it doesn't in OCaml either): - let | Black(x) | Red(x) | Green(x) = v; -*/ - -print_int(x); - - - -/* Scoping: Let sequences. Familiar syntax for lexical ML style scope and -sequences. */ - -let res = { - let a = "a starts out as"; - { - print_string(a); - let a = 20; - print_int(a); - }; - print_string(a); -}; - -let res = { - let a = "first its a string"; - let a = 20; - print_int(a); - print_int(a); - print_int(a); -}; - -let res = { - let a = "a is always a string"; - print_string(a); - let b = 30; - print_int(b); -}; - - -/* let result = LyList.map((fun | [] => true | _ => false), []); */ - - - -/* OTHERWISE: You cannot tell if a is the first match case falling through or - * a curried first arg */ -/* let blah = fun a | patt => 0 | anotherPatt => 1; */ -/* let blah a patt => 0 | anotherPatt => 1; */ - - /*simple pattern EQUALGREATER expr */ -let blah ( a, {blahBlah}) = a; - - /* match_case */ - /* pattern EQUALGREATER expr */ -let blah = fun |Red(_) => 1 |Black(_)=> 0 |Green(_)=> 0; - - -/* Won't work! */ -/* let arrowFunc = fun a b => print_string "returning aplusb from arrow"; a + b;; */ -let arrowFunc = fun(a,b)=> {print_string("returning aplusb from arrow"); a + b;}; -let add(a,b) { - let extra = {print_string("adding"); 0;}; - let anotherExtra = 0; - extra + a + b + anotherExtra; -}; - -(print_string (string_of_int (add(4,34)))); - -let dummy(_) = 10; -dummy(res1); -dummy(res2); -dummy(res3); - - -/* Some edge cases */ -let myFun (firstArg, Red(x) | Black(x) | Green(x)) = firstArg + x; -let matchesWithWhen(a) = switch (a) { - | Red(x) when 1 > 0 => 10 - | Red(_) => 10 - | Black(x) => 10 - | Green(x) => 10 -}; - -let matchesWithWhen = fun - | Red(x) when 1 > 0 => 10 - | Red(_) => 10 - | Black(x) => 10 - | Green(x) => 10; - - -let matchesOne (`Red x) = 10; - - -/* -Typical OCaml would make you *wrap the functions in parens*! This is because it -can't tell if a semicolon is a sequence operator. Even if we had records use -commas to separate fields, -*/ -type adders = { - addTwoNumbers: (int, int) => int, - addThreeNumbers: (int, int, int) => int, - addThreeNumbersTupled: ((int, int, int)) => int -}; -let myRecordWithFunctions = { - addTwoNumbers: (a,b) => a + b, - addThreeNumbers: (a,b,c) => a + b + c, - addThreeNumbersTupled: ((a, b, c)) => a + b + c -}; - -let result = myRecordWithFunctions.addThreeNumbers(10, 20, 30); -let result = myRecordWithFunctions.addThreeNumbersTupled((10, 20, 30)); - -let lookTuplesRequireParens = (1, 2); -/* let thisDoesntParse = 1, 2; */ -let tupleInsideAParenSequence = { - print_string("look, a tuple inside a sequence"); - let x = 10; - (x, x); -}; - -let tupleInsideALetSequence = { - print_string("look, a tuple inside a sequence"); - let x = 10; - (x, x); -}; - -/* We *require* that function return types be wrapped in - parenthesis. In this example, there's no ambiguity */ -let makeIncrementer (delta:int) : (int)=>int = (a) => a + delta; - -/* We could even force that consistency with let bindings - it's allowed - currently but not forced. -*/ -let (myAnnotatedValBinding:int) = 10; - -/* Class functions (constructors) and methods are unified in the same way */ - -class classWithNoArg { - pub x = 0; - pub y = 0; -}; - -/* This parses but doesn't type check - class myClass init => object - pub x => init - pub y => init - end; -*/ - -let myFunc (a:int, b:int) : (int, int) = (a, b); -let myFunc (a:int, b:int) : list(int) = [1]; -let myFunc (a:int, b:int) : point { - x: a, - y: b -}; -let myFunc (a:int, b:int) : point { - x: a, - y: b -}; - -type myThing = (int, int); -type stillARecord = {name: string, age: int}; - -/* Rebase latest OCaml to get the following: And fixup - `generalized_constructor_arguments` according to master. */ -/* type ('a, 'b) myOtherThing = Leaf {first:'a, second: 'b} | Null; */ -type branch('a,'b) = {first: 'a, second: 'b}; -type myOtherThing('a,'b) = Leaf (branch('a,'b)) | Null; - -type yourThing = myOtherThing(int,int); - -/* Conveniently - this parses exactly how you would intend! No *need* to wrap -in an extra [], but it doesn't hurt */ -/* FIXME type lookAtThesePolyVariants = list [`Red] ; */ - -/* FIXME type bracketsGroupMultipleParamsAndPrecedence = list (list (list [`Red])); */ - -/* FIXME type youCanWrapExtraIfYouWant = (list [`Red]); */ - -/* FIXME type hereAreMultiplePolyVariants = list [`Red | `Black]; */ -/* FIXME type hereAreMultiplePolyVariantsWithOptionalWrapping = list ([`Red | `Black]); */ - - - -/* - /* Proposal: ES6 style lambdas: */ - - /* Currying */ - let lookES6Style = (`Red x) (`Black y) => { }; - let lookES6Style (`Red x) (`Black y) => { }; - - /* Matching the single argument */ - let lookES6Style = oneArg => match oneArg with - | `Red x => x - | `Black x => x; - - /* The "trick" to currying that we already have is basically the same - we just - * have to reword it a bit: - * From: - * "Any time you see [let x = fun ...] just replace it with [let x ...]" - * To: - * "Any time you see [let x = ... => ] just replace it with [let x ... => ]" - */ - let lookES6Style oneArg => match oneArg with - | `Red x => x - | `Black x => x; - -*/ - - -/** Current OCaml Named Arguments. Any aliasing is more than just aliasing! -OCaml allows full on pattern matching of named args. */ -/* -A: let named ~a ~b = aa + bb in -B: let namedAlias ~a:aa ~b:bb = aa + bb in -C: let namedAnnot ~(a:int) ~(b:int) = a + b in -D: let namedAliasAnnot ~a:(aa:int) ~b:(bb:int) = aa + bb in -E: let optional ?a ?b = 10 in -F: let optionalAlias ?a:aa ?b:bb = 10 in -G: let optionalAnnot ?(a:int option) ?(b:int option) = 10 in -H: let optionalAliasAnnot ?a:(aa:int option) ?b:(bb:int option) = 10 in -/* -Look! When a default is provided, annotation causes inferred type of argument -to not be "option" since it's automatically destructured (because we know it -will always be available one way or another.) -*/ -I: let defOptional ?(a=10) ?(b=10) = 10 in -J: let defOptionalAlias ?a:(aa=10) ?b:(bb=10) = 10 in -K: let defOptionalAnnot ?(a:int=10) ?(b:int=10) = 10 in - \ \ - \label_let_pattern opt_default: no longer needed in SugarML - -L: let defOptionalAliasAnnot ?a:(aa:int=10) ?b:(bb:int=10) = 10 in - \ \ - \let_pattern: still a useful syntactic building block in SugarML -*/ - -/** - * In Reason, the syntax for named args uses double semicolon, since - * the syntax for lists uses ES6 style [], freeing up the ::. - */ - -let a = 10; -let b = 20; - -/*A*/ -let named (~a as a, ~b as b) = a + b; -type named = (~a: int, ~b: int) => int; -/*B*/ -let namedAlias (~a as aa, ~b as bb) = aa + bb; -let namedAlias (~a as aa, ~b as bb) = aa + bb; -type namedAlias = (~a: int, ~b: int) => int; -/*C*/ -let namedAnnot (~a :int, ~b :int) = 20; -/*D*/ -let namedAliasAnnot (~a as aa:int,~b as bb:int) = 20; -/*E*/ -let myOptional (~a=?, ~b=?, ()) = 10; -type named = (~a: int=?, ~b: int=?, unit) => int; -/*F*/ -let optionalAlias (~a as aa=?, ~b as bb=?, ()) = 10; -/*G*/ -let optionalAnnot (~a as a:int =?, ~b as b:int=?, ()) = 10; -/*H*/ -let optionalAliasAnnot (~a as aa:int =?, ~b as bb:int=?, ()) = 10; -/*I: */ -let defOptional (~a as a=10, ~b as b=10, ()) = 10; -type named = (~a: int=?, ~b: int=?, unit) => int; -/*J*/ -let defOptionalAlias (~a as aa=10, ~b as bb=10, ()) = 10; -/*K*/ -let defOptionalAnnot (~a as a:int=10, ~b as b:int=10, ()) = 10; -/*L*/ -let defOptionalAliasAnnot(~a as aa:int=10, ~b as bb:int=10, ()) = 10; - -/*M: Invoking them - Punned */ -let resNotAnnotated = named(~a=a,~b=b); -/*N:*/ -let resAnnotated = (named(~a=a,~b=b):int); -/*O: Invoking them */ -let resNotAnnotated = named(~a=a,~b=b); -/*P: Invoking them */ -let resAnnotated = (named(~a=a,~b=b):int); - -/*Q: Here's why "punning" doesn't work! */ -/* Is b:: punned with a final non-named arg, or is b:: supplied b as one named arg? */ -let b = 20; -let resAnnotated = (named(~a=a,~b=b)); - -/*R: Proof that there are no ambiguities with return values being annotated */ -let resAnnotated = (named(~a=a,b):ty); - - -/*S: Explicitly passed optionals are a nice way to say "use the default value"*/ -let explictlyPassed = myOptional(~a=?None,~b=?None); -/*T: Annotating the return value of the entire function call */ -let explictlyPassedAnnotated = (myOptional(~a=?None,~b=?None):int); -/*U: Explicitly passing optional with identifier expression */ -let a = None; -let explictlyPassed = myOptional(~a=?a,~b=?None); -let explictlyPassedAnnotated = (myOptional(~a=?a,~b=?None):int); - -let nestedLet = { - let _ = 1 -}; - -let nestedLet = { - let _ = 1; -}; - -let nestedLet = { - let _ = 1; - () -}; - -let nestedLet = { - let _ = 1; - 2 -}; - -/* - * Showing many combinations of type annotations and named arguments. - */ - -type typeWithNestedNamedArgs = - (~outerOne: (~innerOne: int, ~innerTwo: int) => int, ~outerTwo: int) => int; - -type typeWithNestedOptionalNamedArgs = - (~outerOne: (~innerOne: int, ~innerTwo: int) => int=?, ~outerTwo: int=?) => int; - -type typeWithNestedOptionalNamedArgs = - (~outerOne: list(string)=?, ~outerTwo: int=?) => int; - -let f(~tuple="long string to trigger line break") = (); - -let x = - callSomeFunction - (~withArg=10, - ~andOtherArg=wrappedArg); - - -let res = { - (constraintedSequenceItem:string); - (dontKnowWheYoudWantToActuallyDoThis:string); -}; - -let res = { - (butTheyWillBePrintedWithAppropriateSpacing : string); - (soAsToInstillBestDevelopmentPractices : string); -}; - -let x = [ - eachItemInListCanBeAnnotated:int, - typeConstraints:float, - (tupleConstraints:int, andNotFunctionInvocations:int) -]; - -let x = [ - butWeWillPrint : int, - themAsSpaceSeparated : float, - (toInfluenceYour : int, developmentHabbits : int) -]; - -let newRecord = { - ...annotatedSpreadRecord:someRec, - x: y -}; - -let newRecord = { - ...annotatedSpreadRecord : someRec, - blah: 0, - foo: 1 -}; - -let newRecord = { - ...youCanEvenCallMethodsHereAndAnnotate(them): someRec, - blah: 0, - foo: 1 -}; - -let newRecord = { - ...youCanEvenCallMethodsHereAndAnnotate(them,~named=10):someRec, - blah: 0, - foo: 1 -}; - - -let something = (aTypeAnnotation : thing(blah)); -let something = (thisIsANamedArg: thing(blah)); - - -let something = (aTypeAnnotation: thing(blah)); - - - -let something = (thisIsANamedArg(thing):blah); -let something = (typeAnnotation(thing): blah); - -let newRecord = { - ...(heresAFunctionWithNamedArgs(~argOne=i) :annotatedResult), - soAsToInstill: 0, - developmentHabbits: 1 -}; - - -[@thisIsAThing]; -let x = 10; - -/* Ensure that the parenthesis are preserved here because they are - * important: - */ -let something = - fun | None => (fun | [] => "emptyList" | [_, ..._] => "nonEmptyList") - | Some(_)=> (fun | [] => "emptyList" | [_, ..._] => "nonEmptyList"); - -/* A | B = X; */ -let A | B = X; - -/* A | (B | C) = X; */ -let A | (B | C) = X; - -/* (A | B) | (C | D) = X; */ -let (A | B) | (C | D) = X; - -/* A | B | (C | D) = X; */ -let A | B | (C | D) = X; - -/* (A | B) | C = X; */ -let (A | B) | C = X; - -/* A | B | C = X; */ -let A | B | C = X; - - -/** External function declaration - * - */ -external f : (int) => int = "foo"; - -let x = {contents: 0}; - -let unitVal = x.contents = 210; - -let match = "match"; - -let method = "method"; - -let foo(x,~x as bar,~z,~foo as bar,~foo as z) { - bar + 2 -}; - -let zzz = myFunc(1, 2, [||]); - -/* 1492 */ -let registerEventHandlers = - ( - ~window: Window.t, - ~mouseDown: - option(((~button: Events.buttonStateT, ~state: Events.stateT, ~x: int, ~y: int) => unit))=?, - () - ) => 1; - -/* #1320: record destrucuring + renaming */ -let x = ({state: state as prevState}) => 1; -let x = ({ReasonReact.state: state as prevState}) => 1; - -/* 1567: optional parens around expr constraint in constructor expression */ -Some(x : int); -Some((x : int)); -Some(x, y: int, b); -Some(x, (y: int), b); - -foo(~x=-. bar); - -Some((-1), (-1), (-1)); -Some(-1, -1, -1); -Some(-1g, -1G, -1z); -Some((-1g), (-1G), (-1z)); -Some(-0.1, -0.1, -0.1); -Some((-0.1), (-0.1), (-0.1)); -Some(-0.1G, -0.1x, -0.1H); -Some((-0.1G), (-0.1x), (-0.1H)); -Some([@foo] (-1), [@foo] (-1), [@foo] (-1)); -Some([@foo] (-1z), [@foo] (-1z), [@foo] (-1z)); -Some([@foo] (-0.1), [@foo] (-0.1), [@foo] (-0.1)); -Some([@foo] (-0.1m), [@foo] (-0.1n), [@foo] (-0.1p)); - -foo(~x=-1, ~y=-2); -foo(~x=(-1), ~y=(-2)); -foo(~x=-.1, ~y=-.2); -foo(~x=(-.1), ~y=(-.2)); -foo(~x=-1g, ~y=-1G, ~z=-1z); -foo(~x=(-1g), ~y=(-1G), ~z=(-1z)); -foo(~x=-0.1G, ~y=-0.1x, ~z=-0.1H); -foo(~x=(-0.1G), ~y=(-0.1x), ~z=(-0.1H)); -foo(~x=[@foo] (-1), ~y=[@foo] (-1), ~z=[@foo] (-1)); -foo(~x=[@foo] (-1z), ~y=[@foo] (-1z), ~z=[@foo] (-1z)); -foo(~x=[@foo] (-0.1), ~y=[@foo] (-0.1), ~z=[@foo] (-0.1)); -foo(~x=[@foo] (-0.1m), ~y=[@foo] (-0.1n), ~z=[@foo] (-0.1p)); - -/* Smooth formatting of functions with callbacks as arguments */ -funWithCb("text", () => doStuff()); - -funWithCb([@attr] "text", [@myAttr] () => doStuff()); - -funWithCb(~text="text", ~f=() => doStuff()); - -funWithCb(~text=[@attr] "text", ~f=[@myAttr] () => doStuff()); - -funWithCb(~text="text", ~f=?() => doStuff()); - -funWithCb(~text=[@attr] "text", ~f=?[@myAttr] () => doStuff()); - -test("my test", () => { - let x = a + b; - let y = z + c; - x + y -}); - -test([@attr] "my test", [@attr] () => { - let x = a + b; - let y = z + c; - x + y -}); - -test(~desc="my test", ~f=() => { - let x = a + b; - let y = z + c; - x + y -}); - -test(~desc=[@attr] "my test", ~f=[@myAttr] () => { - let x = a + b; - let y = z + c; - x + y -}); - -test(~desc=?"my test", ~f=?() => { - let x = a + b; - let y = z + c; - x + y -}); - -test(~desc=?[@attr] "my test", ~f=?[@attr] () => { - let x = a + b; - let y = z + c; - x + y -}); - -describe("App", () => { - test("math", () => { - Expect.expect(1+2) |> toBe(3) - }); -}); - -describe([@attr] "App", [@attr] () => { - test([@attr] "math", [@attr] () => { - Expect.expect(1+2) |> toBe(3) - }); -}); - -describe(~text="App", ~f=() => - test(~text="math", ~f=() => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -describe(~text=[@attr] "App", ~f=[@attr] () => - test(~text=[@attr] "math", ~f=[@attr] () => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -describe(~text=?"App", ~f=?() => - test(~text=?"math", ~f=?() => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -describe(~text=?[@attr] "App", ~f=?[@attr] () => - test(~text=?[@attr] "math", ~f=?[@attr] () => - Expect.expect(1 + 2) |> toBe(3) - ) -); - -Thing.map(foo, bar, baz, (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map([@attr] foo, bar, baz, [@attr] (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map(~a=[@attr] foo, ~b=bar, ~c=?baz, ~f=(abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map(~a=foo, ~b=bar, ~c=?[@attr] baz, ~f=[@attr] (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map(~a=foo, ~b=bar, ~c=?baz, ~f=?(abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map(~a=foo, ~b=bar, ~c=?[@attr] baz, ~f=?[@attr] (abc, z) => - MyModuleBlah.toList(argument) -); - -Thing.map( - foo, - bar, - baz, - foo2, - bakjlksjdf, - okokokok, - (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -Thing.map( - foo, - bar, - baz, - foo2, - [@attr] bakjlksjdf, - okokokok, - [@attr] (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -Thing.map( - ~a=foo, - ~b=bar, - ~c=baz, - ~d=foo2, - ~e=bakjlksjdf, - ~f=okokokok, - ~cb=(abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -Thing.map( - ~a=foo, - ~b=bar, - ~c=[@attr] baz, - ~d=foo2, - ~e=bakjlksjdf, - ~f=okokokok, - ~cb=[@attr] (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?bakjlksjdf, - ~f=?okokokok, - ~cb=?(abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?[@attr] bakjlksjdf, - ~f=?okokokok, - ~cb=?[@attr] (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -Thing.map( - foo, - bar, - baz, - (abc, z) => MyModuleBlah.toList(argument), - (abc, z) => MyModuleBlah.toList(argument) -); - -Thing.map( - foo, - bar, - baz, - [@attr] (abc, z) => MyModuleBlah.toList(argument), - [@attr] (abc, z) => MyModuleBlah.toList(argument) -); - -Js.Option.andThen([@bs] w => w#getThing()); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?[@attr] bakjlksjdf, - ~f=?okokokok, - ~cb=?[@attr] [@attr2] [@aslkdfjlsdjf][@sldkfjlksdjflksjdlkjf] [@sldkflskjdf] (abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -let result = - F.call(x => { - let x = 123; - let y = 2345; - doStuff(); - }); - -let result = F.call(x => doStuff(x)); - -let () = x |> Bigarray.Genarray.get(_, [|1, 2, 3, 4|]); - -let () = x |> Bigarray.Array1.get(_, 1); - -let () = x |> Bigarray.Array2.get(_, 1, 2); - -let () = x |> Bigarray.Array3.get(_, 1, 2, 3); - -let x=-.1; - -let x=-1; - -let x=+1; - -let x=+.1; - -let x = (~a: int=- 1) => a; - -let x = (~a=-1) => a; - -let x: float=-.1; - -let x: int =-1; - -let x: int=+1; - -let x: float =+. 1; - -foo(~a=?-1); - -/* - https://github.com/facebook/reason/issues/1992 - Pexp_override -*/ -let z = {}; -let z = {<>}; - -/* https://github.com/facebook/reason/issues/2056 */ -type foo = ~a:bool=? => int; - -/* https://github.com/facebook/reason/issues/2070 */ -f(~commit=!build); - -/* https://github.com/facebook/reason/issues/2032 */ -let predicate = - predicate === Functions.alwaysTrue1 ? - defaultPredicate : - (fun - | None => false - | Some(exn) => predicate(exn)); - -let predicate = - predicate === Functions.alwaysTrue1 ? - (fun - | None => false - | Some(exn) => predicate(exn)) : - (fun - | None => false - | Some(exn) => predicate(exn)); - -/* https://github.com/facebook/reason/issues/2125 */ -foo(~a); - -foo(~a: int); - -foo(~(a: int)); - -foo(~(a :> int)); - -foo(~a :> int); - -foo(~Foo.a?); - -foo(~Foo.a); - -/* https://github.com/facebook/reason/issues/2155#issuecomment-422077648 */ -true ? (Update({...a, b: 1}), None) : x; -true ? ({...a, b: 1}) : a; -true ? (a, {...a, b: 1}) : a; - -true ? ([x, ...xs]) => f(x, xs) : a; - -/* https://github.com/facebook/reason/issues/2200 */ -foo(~x=-1 + 2); - -foo(~x=-1 + 2: int); - -foo(~not); - -let foo = (~not) => (); - -let foo = (~not: string) => (); - -foo(~not: string); - -/* https://github.com/facebook/reason/issues/2141 */ -let testCallNamedArgs = (foo: ((~a: int, ~b: int) => int), a, b) => - foo(~a, ~b); - -let testCallNamedArgs = (foo: ((~a: int, ~b: int=?) => int), a, b) => - foo(~a, ~b); - -let Foo.{name} = bar; -let Foo.Bar.{name} = bar; - -let Foo.[ name ] = bar; -let Foo.Bar.[ name ] = bar; - -let Foo.Bar.[] = bar; -let Foo.Bar.[||] = bar; -let Foo.() = foo; - -/* let Foo.(bar, baz) = foo; */ - -let Foo.(exception bar) = baz; - -try({ - let this = try_exp; - let has = hugged; - parens; -}) { - | _ => () -}; - -/* Pcl_open (4.06+) */ -class x = { - open EM; - as self; -}; - -class y = { - open EM; - open OM; - as self; -}; diff --git a/formatTest/unit_tests/input/syntax.rei b/formatTest/unit_tests/input/syntax.rei deleted file mode 100644 index 766c53ec9..000000000 --- a/formatTest/unit_tests/input/syntax.rei +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -/** - * Typically the "interface file" is where you would write a ton of - * comments/documentation. - */ -type adders = { - /* - * Adds two numbers together. - */ - addTwoNumbers: (int, int) => int, - /* - * Amazingly, adds *three* numbers together. - */ - addThreeNumbers: (int, int, int) => int, - /* - * Tuple version of previous function. - */ - addThreeNumbersTupled: ((int, int, int)) => int, -}; - -/** - * Public function. - */ -let myRecordWithFunctions: adders; -/** - * Public result. - */ -let result: int; - -/* https://github.com/facebook/reason/issues/1614 */ -module Event: (module type of { include ReactEventRe; }); - -module type Event = (module type of { include ReactEventRe; }); - -/* https://github.com/facebook/reason/issues/2169 */ -let not : string => string; - -let other : string => not; - -include (module type of Bos.Cmd) with type t = Bos.Cmd.t; diff --git a/formatTest/unit_tests/input/testUtils.re b/formatTest/unit_tests/input/testUtils.re deleted file mode 100644 index 526778751..000000000 --- a/formatTest/unit_tests/input/testUtils.re +++ /dev/null @@ -1,9 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let printSection(s) { - print_string("\n"); - print_string(s); - print_string("\n---------------------\n"); -}; - -let printLn(s) = print_string(s ++ "\n"); diff --git a/formatTest/unit_tests/input/trailing.re b/formatTest/unit_tests/input/trailing.re deleted file mode 100644 index 654681620..000000000 --- a/formatTest/unit_tests/input/trailing.re +++ /dev/null @@ -1,73 +0,0 @@ - -let x = { - "obj": obj, -}; - -let x = { - "key", - "keyTwo", -}; - -let x = { - ...x, - "key", -}; - -let x = { - ...x, - "key", - "keyTwo", -}; - -type t = {. - "x": int, -}; - -type t('a) = {.. - "x": int, -} as 'a; - -type t = {. - "x": (int, int), -}; - -type t('a) = {.. - "x": (int, int), -} as 'a; - - -let x = { - "obj": 0, -}; - -let x = { - "key": 0, - "keyTwo": 1, -}; - -let x = { - ...x, - "key": 0, -}; - -let x = { - ...x, - "key": 0, - "keyTwo": 1, -}; - -type t = {. - "x": int, -}; - -type t('a) = {.. - "x": int, -} as 'a; - -type t = {. - "x": (int, int), -}; - -type t('a) = {.. - "x": (int, int), -} as 'a; diff --git a/formatTest/unit_tests/input/trailingSpaces.re b/formatTest/unit_tests/input/trailingSpaces.re deleted file mode 100755 index d4d914c05..000000000 --- a/formatTest/unit_tests/input/trailingSpaces.re +++ /dev/null @@ -1,6 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -module M = Something.Create { - type resource1 = MyModule.MySubmodule.t; - type resource2 = MyModule.MySubmodule.t; -}; diff --git a/formatTest/unit_tests/input/typeDeclarations.re b/formatTest/unit_tests/input/typeDeclarations.re deleted file mode 100644 index 2fb536d60..000000000 --- a/formatTest/unit_tests/input/typeDeclarations.re +++ /dev/null @@ -1,62 +0,0 @@ -/* === test wrapping for arrows === */ -type foo = option((int => int)); -type foo = option((int => (int => int))); -type foo = option(((int => int) => int)); -type foo = option(((int, int) => int)); - -/* tuple */ -type foo = option(((int => int), (int => int))); -type foo = option(((int => int), string)); -type foo = option((string, (int => int), string)); -type foo = option((string, (int => int))); - -/* other preceeding/trailing */ -type foo = option((int => int), (int => int)); -type foo = option((int => int), string); -type foo = option(string, (int => int), string); -type foo = option(string, (int => int)); - -/* preceeding/trailing, more args */ -type foo = option((int => string => int), (int => string => int)); -type foo = option((int => string => int), string); -type foo = option(string, (int => string => int), string); -type foo = option(string, (int => string => int)); - -/* others */ -type foo = option(string, option(int => int), string); -type foo = option(string, option(option(option(int) => int)), string); -type foo = option(string, option([@foo]option(option(int) => int)), string); - -/* with attributes */ -type foo = option([@foo]([@bar] int => [@baz] int)); -type foo = option([@foo]((([@bar] int) => [@baz] int))); -type foo = option((int => [@foo](int => int))); -type foo = option(([@foo](int => int) => int)); -type foo = option(([@foo](int, int) => int)); - -/* tuple */ -type foo = option([@foo]([@bar](int => int), [@baz](int => int))); -type foo = option([@foo]([@bar](int => int), [@baz] string)); -type foo = option([@foo]([@bar]string, [@baz](int => int), [@qux]string)); -type foo = option((string, [@foo](int => int))); - -/* other preceeding/trailing */ -type foo = option([@foo](int => int), [@bar](int => int)); -type foo = option([@foo](int => int), [@bar]string); -type foo = option([@foo]string, [@bar](int => int), [@baz]string); -type foo = option([@foo]string, [@bar](int => int)); - -/* preceeding/trailing, more args */ -type foo = option([@foo](int => string => int), [@bar](int => string => int)); -type foo = option([@foo](int => string => int), [@bar]string); -type foo = option([@foo]string, [@bar](int => string => int), [@baz]string); -type foo = option([@foo]string, [@bar](int => string => int)); - -/* === end test wrapping for arrows === */ - -/* https://github.com/facebook/reason/issues/2073 */ -type a = array({. "someStringKeyThatCausesLineToBreak": string }); - -type b = { - punned: [@with_attribute] punned -}; diff --git a/formatTest/unit_tests/input/uncurried.re b/formatTest/unit_tests/input/uncurried.re deleted file mode 100644 index a8e8ce3ae..000000000 --- a/formatTest/unit_tests/input/uncurried.re +++ /dev/null @@ -1,178 +0,0 @@ -f(.); - -[@attr] f(.); - -[@bs] f(); - -f(. a, b, c); - -[@attr] f(. a, b, c); - -f(. a); - -f(. (1, 2)); - -f([@bs] (1, 2)); - -f(. [@bs] (1, 2)); - -f(. (1, 2), (3, 4)); - -f(. [@bs] (1, 2), [@bs] (3, 4)); - -f(. [@bs] (1, 2), . [@bs] (3, 4)); - -f(. "string"); - -f(. "string", "2string"); - -f(. "string", . "2string"); - -f(. [@bs] "string", . [@bs] "2string"); - -f(. 1); - -f(. [@bs] 1); - -f(. {a: "supersupersupersupersupersuperlong", b: "supersupersupersupersupersuperlong"}); - -let f = (. a, b) => a + b; - -let f = [@attr] (. a, b) => a + b; - -let f = [@bs] (. a, b) => a + b; - -let f = ("hello", (. b, c) => b + c); - -let f = ("hello", [@attr] (. b, c) => b + c); - -let f = ("hello", [@bs] (. b, c) => b + c); - -let obj: tesla = { - pub drive = (. speed, safe) => (speed, safe); - pub drive2 = [@attr] (. speed, safe) => (speed, safe); - pub park = (.) => (); - pub park2 = [@attr] (.) => (); -}; - -type f = (. int, int) => int; - -type f = [@attr] (. int, int) => int; - -type f = [@bs] ((int, int) => int); - -type z = [@bs] unit => unit; - -type z = [@attr] [@bs] unit => unit; - -type z = (. unit) => unit; - -type tesla = {. - drive: (. int, int) => int -}; - -class type _rect = - [@bs] - { - [@bs.set] pub height: int; - [@bs.set] pub width: int; - pub draw: unit => unit - }; - -class type _rect = {. - [@bs.set] - pub height: int; - [@bs.set] - pub width: int; - pub draw: unit => unit -}; - -funWithCb("text", (.) => doStuff()); - -funWithCb("text", (. test) => doStuff()); - -funWithCb("text", [@attr] (. arg) => doStuff()); - -test(~desc="my test", (.) => { - let x = a + b; - let y = z + c; - x + y; -}); - -test(~desc="my test", [@attr] (. a, b, c) => { - let x = a + b; - let y = z + c; - x + y; -}); - -Thing.map( - ~a=?foo, - ~b=?bar, - ~c=?baz, - ~d=?foo2, - ~e=?bakjlksjdf, - ~f=?okokokok, - ~cb=[@attr] (. abc, z) => { - let x = 1; - MyModuleBlah.toList(x, argument); - } -); - -type f = int => (. int) => unit; - -type f = (int, . int) => unit; - -add(. 2); - -add(. 2, . 3); - -([@bs] add(2, [@bs] 3)); - -add(. 2, 3, 4, . 5, 6, 7, . 8, 9, 10); - -type timerId; - -[@bs.val] external setTimeout : ([@bs] (unit => unit), int) => timerId = "setTimeout"; - -let id = setTimeout([@bs] (() => Js.log("hello")), 1000); - -let id = setTimeout(1000, [@bs] (() => Js.log("hello"))); - -foo([@bs] {val a = 1}); - -[@bs] foo([@bs] {val a = 1}); - -foo(. [@bs] {val a = 1}); - -foo([@attr1][@bs][@attr2] {val a = 1}); - -add([@attr][@bs][@attr] 1); - -[@bs] add([@attr][@bs][@attr] 1); - -add(. [@attr][@bs][@attr] 1); - -let a = [@bs] foo ([@bs] foo(3)); - -let a = foo(. foo(. 3)); - -add(1, 2, . 3, 4); - -add(1, . 2, 3, 4); - -add(1, 2, 3, . 4); - -let run = (~dry as [@attr] dry: bool=false, ~mMap as mMap: string=?, logger) => { - -}; - -f(. _ => 1); - -f(.a, _ => 1); - -f(.a, (._) => 1); - -let u = (. ~f : t , a , b) => { - f(.~x=a,~y=b) -> Js.log; - f(.~y=b,~x=a) -> Js.log; -}; diff --git a/formatTest/unit_tests/input/variants.re b/formatTest/unit_tests/input/variants.re deleted file mode 100644 index b3dccec37..000000000 --- a/formatTest/unit_tests/input/variants.re +++ /dev/null @@ -1,429 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -module LocalModule = { - type accessedThroughModule = | AccessedThroughModule; - type accessedThroughModuleWithArg = - | AccessedThroughModuleWith(int)| AccessedThroughModuleWithTwo(int,int); -}; - -type notTupleVariant = | NotActuallyATuple(int,int); -type attr = | A(int); -type attr += | Point(int, int); -type attr += | PointA{a : int, b : int}; - -type notTupleVariantExtraParens = | NotActuallyATuple2(int,int); - -type simpleTupleVariant = | SimpleActuallyATuple((int, int)); - -type tupleVariant = | ActuallyATuple((int, int)); - -let intTuple = (20, 20); - -let notTupled: notTupleVariant = NotActuallyATuple(10,10); - -/* Doesn't work because we've correctly annotated parse tree nodes with explicit_arity! */ -/* let notTupled: notTupleVariant = NotActuallyATuple (10, 10); */ -let funcOnNotActuallyATuple (NotActuallyATuple(x,y)) = x + y; - -/* let funcOnNotActuallyATuple (NotActuallyATuple (x, y)) = x + y; */ -/* let notTupled: notTupleVariant = NotActuallyATuple intTuple; /*Doesn't work! */ */ -/* At least the above acts as proof that there *is* a distinction that is -honored. */ -let simpleTupled: simpleTupleVariant = SimpleActuallyATuple (10, 10); - -let simpleTupled: simpleTupleVariant = SimpleActuallyATuple (intTuple); - -/*Works! */ -let NotActuallyATuple(x,y) = NotActuallyATuple (10, 20); - -/* Doesn't work because we've correctly annotated parse tree nodes with explicit_arity! */ -/* let unfortunatelyThisStillWorks: simpleTupleVariant = SimpleActuallyATuple 10 10; */ -let yesTupled: tupleVariant = ActuallyATuple (10, 10); - -let yesTupled: tupleVariant = ActuallyATuple (10, 10); - -let yesTupled: tupleVariant = ActuallyATuple (intTuple); - -type threeForms = | FormOne(int) | FormTwo(int) | FormThree; - -let doesntCareWhichForm(x) = switch (x) { - | FormOne(q) - | FormTwo(q) => 10 - | FormThree => 20 -}; - -let doesntCareWhichFormAs(x) = switch (x) { - | FormOne(q) as ppp - | FormTwo(q) as ppp => 10 - | FormThree => 20 -}; - -type colorList1 = [ - otherThingInheritedFrom - | `Red - | `Black -]; - -type colorList2 = [ | `Red | `Black | otherThingInheritedFrom ]; - -type colorList3 = [ bar | foo | `Red | `Black | foo ]; - -type colorList = [< - | `Red (int, int) &(int) - | `Black &(int, int) &(int) - | `Blue - > `Red `Black -]; - -1 + doesntCareWhichForm(FormOne(10)); - -1 + doesntCareWhichForm(FormTwo(10)); - -1 + doesntCareWhichForm(FormThree); - -/* Destructured matching at function definition */ -let accessDeeply(LocalModule.AccessedThroughModule) = 10; - -let accessDeeplyWithArg - (LocalModule.AccessedThroughModuleWith(x) | LocalModule.AccessedThroughModuleWithTwo(_,x)) = x; - -/* Destructured matching *not* at function definition */ -let accessDeeply(x) = switch (x) { - | LocalModule.AccessedThroughModule => 10 - | _ => 0 -}; - -let accessDeeplyWithArg(x) = switch (x) { - | LocalModule.AccessedThroughModuleWith(x) => 10 - | _ => 0 -}; - -/* In OCaml's syntax, to capture the wrapped data, you do: - * - * let myFunc x = function | `Blah (p as retVal) -> retVal` - * - * In OCaml's syntax, to capture the entire pattern you do: - * - * let myFunc x = function | `Blah p as retVal -> retVal` - */ -let accessDeeply(x) = switch (x) { - | LocalModule.AccessedThroughModule as ppp => 1 -}; - -let accessDeeplyWithArg(x) = switch (x) { - | LocalModule.AccessedThroughModuleWith (x as retVal) => retVal + 1 - | LocalModule.AccessedThroughModuleWithTwo((x as retVal1),(y as retVal2)) => retVal1 + retVal2 + 1 -}; - -/* Just to show that by default `as` captures much less aggresively */ -let rec accessDeeplyWithArgRecursive(x,count) = switch (x) { - | LocalModule.AccessedThroughModuleWith(x) as entirePattern => - /* It captures the whole pattern */ - if (count > 0) {0;} else {accessDeeplyWithArgRecursive(entirePattern, count - 1);} - | LocalModule.AccessedThroughModuleWithTwo(x,y) as entirePattern => - /* It captures the whole pattern */ - if (count > 0) {0;} else {accessDeeplyWithArgRecursive(entirePattern, count - 1);} -}; - -accessDeeplyWithArgRecursive (LocalModule.AccessedThroughModuleWith(10), 10); - -let run () { - TestUtils.printSection("Variants"); - Printf.printf("%d %d \n",x,y); -}; - -type combination('a) = | HeresTwoConstructorArguments(int,int); - -/** But then how do we parse matches in function arguments? */ -/* We must require parenthesis around construction matching in function args only*/ -let howWouldWeMatchFunctionArgs (HeresTwoConstructorArguments(x,y)) = x + y; - -/* How would we annotate said arg? */ -let howWouldWeMatchFunctionArgs (HeresTwoConstructorArguments(x,y): combination('wat)) = x + y; - -let matchingTwoCurriedConstructorsInTuple(x) = switch (x) { - | (HeresTwoConstructorArguments(x,y), HeresTwoConstructorArguments(a,b)) => x + y + a + b -}; - -type twoCurriedConstructors = | TwoCombos (combination(int), combination(int)); - -let matchingTwoCurriedConstructorInConstructor(x) = switch (x) { - | TwoCombos (HeresTwoConstructorArguments(x,y), HeresTwoConstructorArguments(a,b)) => a + b + x + y -}; - -type twoCurriedConstructorsPolyMorphic('a) = | TwoCombos (combination('a), combination('a)); - -/* Matching records */ -type pointRecord = {x: int, y: int}; - -type alsoHasARecord = | Blah | AlsoHasARecord(int,int,pointRecord); - -let result = switch (AlsoHasARecord(10,10,{x: 10, y: 20})) { - | Blah => 1000 - | AlsoHasARecord(a,b,{x, y}) => a + b + x + y -}; - -let rec commentPolymorphicCases: 'a . (option('a)) => int = fun | Some(a) => 1 - /* Comment on one */ - | None => 0; - -let thisWontCompileButLetsSeeHowItFormats = switch (something) { - | Zero - | One => 10 -}; - -let thisWontCompileButLetsSeeHowItFormats = fun | Zero - | One(_,_,_) => 10 - | Two => 20; - -/* Comment on two */ -/** - * GADTs. - */ -type term(_) = - | Int(int) : term(int) | Add : term ((int, int) => int) | App (term (('b) => 'a), term ('b)) : term('a); - -let rec eval: type a. (term(a)) => a = - fun | Int(n) => n - /* a = int */ - | Add => (fun(x,y) => x + y) - /* a = int => int => int */ - | App(f,x) => eval(f, eval(x)); - -let rec eval: type a. (term(a)) => a = - (x) => switch (x) { - | Int(n) => n - /* a = int */ - | Add => (fun(x,y) => x + y) - /* a = int => int => int */ - | App(f,x) => eval(f, eval(x)) - }; - -/* eval called at types (b=>a) and b for fresh b */ -let evalArg = App (App (Add, Int(1)), Int(1)); - -let two = eval (App (App(Add, Int(1)), Int(1))); - -type someVariant = | Purple(int) | Yellow(int); - -let Purple(x) | Yellow(x) = switch (Yellow(100), Purple(101)) { - | (Yellow(y), Purple(p)) => Yellow (p + y) - | (Purple(p), Yellow(y)) => Purple (y + p) - | (Purple(p), Purple(y)) => Yellow (y + p) - | (Yellow(p), Yellow(y)) => Purple (y + p) -}; - -type tuples = | Zero | One(int) | Two(int,int) | OneTuple (int, int); - -let myTuple = OneTuple (20, 30); - -let res = switch (myTuple) { - | Two(x,y) => try (Two(x,y)) { - | One => "hi" - | Two => "bye" - } - | One => switch (One) { - | One => "hi" - | _ => "bye" - } -}; - -/* FIXME type somePolyVariant = [ `Purple int | `Yellow int]; */ - -let ylw = `Yellow (100, 100); - -let prp = `Purple (101, 100); - -let res = switch (ylw, prp) { - | (`Yellow (y, y2), `Purple (p, p2)) => `Yellow (p + y, 0) - | (`Purple (p, p2), `Yellow (y, y2)) => `Purple (y + p, 0) - | (`Purple (p, p2), `Purple (y, y2)) => `Yellow (y + p, 0) - | (`Yellow (p, p2), `Yellow (y, y2)) => `Purple (y + p, 0) -}; - -let ylw = `Yellow(100); - -let prp = `Purple(101); - -let res = switch (ylw, prp) { - | (`Yellow y, `Purple p) => `Yellow (p + y) - | (`Purple p, `Yellow y) => `Purple (y + p) - | (`Purple p, `Purple y) => `Yellow (y + p) - | (`Yellow p, `Yellow y) => `Purple (y + p) -}; - -/* - * Now try polymorphic variants with *actual* tuples. - * You'll notice that these become indistinguishable from multiple constructor - * args! explicit_arity doesn't work on polymorphic variants! - * - * Way to resolve this (should also work for non-polymorphic variants): - * - * If you see *one* simple expr list that is a tuple, generate: - * Pexp_tuple (Pexp_tuple ..)) - * - * If you see *one* simple expr list that is *not* a tuple, generate: - * Pexp.. - * - * If you see *multiple* simple exprs, generate: - * Pexp_tuple.. - * - * Though, I'm not sure this will even work. - */ -let ylw = `Yellow (100, 100); - -let prp = `Purple (101, 101); - -let res = switch (ylw, prp) { - | (`Yellow (y, y2), `Purple (p, p2)) => `Yellow (p + y, 0) - | (`Purple (p, p2), `Yellow (y, y2)) => `Purple (y + p, 0) - | (`Purple (p, p2), `Purple (y, y2)) => `Yellow (y + p, 0) - | (`Yellow (p, p2), `Yellow (y, y2)) => `Purple (y + p, 0) -}; - -let rec atLeastOneFlushableChildAndNoWipNoPending(composition,atPriority) = switch (composition) { - | [] => false - | [hd, ...tl] => - switch (hd) { - | OpaqueGraph {lifecycle: Reconciled (_, [])} => - atLeastOneFlushableChildAndNoWipNoPending(tl,atPriority) - | OpaqueGraph {lifecycle: ReconciledFlushable (priority, _, _, _, _, _)} - | OpaqueGraph {lifecycle: NeverReconciledFlushable (priority, _, _, _, _)} - when priority == AtPriority => - noWipNoPending(tl,atPriority) - | SuperLongNameThatWontBreakByItselfSoWhenWillHaveToBreak - when priority == AtPrasldkfjalsdfjasdlfalsdkf => - noWipNoPending(tl,atPriority) - | _ => false - } -}; - -/* - * When pretty printed, this appears to be multi-argument constructors. - */ -let prp = `Purple (101, 101); - -let res = switch (prp) { - | `Yellow (y, y2) => `Yellow (y2 + y, 0) - | `Purple (p, p2) => `Purple (p2 + p, 0) -}; - -/* - * Testing explicit arity. - */ -let rec map(f) = - fun | Node(None,m) => Node(None, M.map(map(f),m)) - | Node(LongModule.Path.None,m) => Node(None, M.map(map(f),m)) - | Node(LongModule.Path.Some(v),m) => Node(Some(f(v)), M.map(map(f),m)); - -let myFunc(x,y,None) = "asdf"; - -let rec map(f) = - fun | Node(None,m) => Node(None, M.map(map(f),m)) - | Node(LongModule.Path.None,m) => LongModule.Path.Node(LongModule.Path.None, M.map(map(f),m)) - | Node(LongModule.Path.Some(v),m) => - LongModule.Path.Node(LongModule.Path.Some(f(v)), M.map(map(f),m)); - -let myFunc(x,y,LongModule.Path.None) = "asdf"; - -let listPatternMembersNeedntBeSimple(x) = switch (x) { - | [] => () - | [Blah(x,y), Foo(a,b), ...rest] => () - | [Blah(x,y), Bar(a,b), ...rest] => () - | _ => () -}; - -let listTailPatternNeedntBeSimple(x) = switch (x) { - | [] => () - /* Although this would never typecheck! */ - | [Blah(x,y), Foo(a,b), ...Something(x)] => () - | _ => () -}; - -let listPatternMayEvenIncludeAliases(x) = switch (x) { - | [] => () - /* Although this would never typecheck! */ - | [Blah(x,y) as head, Foo(a,b) as head2, ...Something(x) as tail] => () - | _ => () -}; - -/* - * Testing extensible variants - */ -type attr = ..; - -/* `of` is optional */ -type attr += Str(string); - -type attr += | Point(int,int); - -type attr += - | Float(float) - | Char(char); - -type tag('props) = ..; - -type titleProps = { title: string }; - -type tag('props) += - | Title: tag(titleProps) - | Count(int):tag(int); - -module Graph = { - type node = ..; -}; - -type Graph.node += - | Str = Graph.Str; - -type water = ..; - -type water += pri Ocean; - -type water += pri MineralWater | SpringWater | TapWater | TableWater; - -type Graph.node += pri Node = Expr.Node; - -type Graph.node += pri | Node = Expr.Node | Atom = Expr.Atom; - -/* without single unit arg sugar */ -MyConstructorWithSingleUnitArg(()); -/* with single unit arg sugar */ -MyConstructorWithSingleUnitArg(); -/* without single unit arg sugar */ -`polyVariantWithSingleUnitArg(()); -/* with single unit arg sugar */ -`polyVariantWithSingleUnitArg(); - -/* #1510: keep ({ and }) together on the same line when breaking */ -Delete({ uuid: json |> Util.member("uuid") |> Util.to_string }); -Delete((someLongStuf, someOtherLongStuff, okokokok)); -Delete([someLongStuf, someOtherLongStuff, okokokok]); -Delete([|someLongStuf, someOtherLongStuff, okokokok|]); -Delete([someLongStuf, someOtherLongStuff, okokokok, ...veryES6]); -Delete({pub x = methodOne; pub y = methodTwo; pub z = methodThisBreaks}); - -`Delete({ uuid: json |> Util.member("uuid") |> Util.to_string }); -`Delete((someLongStuf, someOtherLongStuff, okokokok)); -`Delete([someLongStuf, someOtherLongStuff, okokokok]); -`Delete([|someLongStuf, someOtherLongStuff, okokokok|]); -`Delete([someLongStuf, someOtherLongStuff, okokokok, ...veryES6]); -`Delete({pub x = methodOne; pub y = methodTwo; pub z = methodThisBreaks}); - -let x: t = `Poly; - -/* Format doc attrs consistent: https://github.com/facebook/reason/issues/2187 */ -type t = - | /** This is some documentation that might be fairly long and grant a line break */ - A - | /** Shorter docs */ - B - | /** Some more longer docs over here that make sense to break lines on too */ - C; - -/* https://github.com/facebook/reason/issues/1828 */ -type widget_state = [ - | `DEFAULT /* here */ - | `HOVER - | `ACTIVE - ]; diff --git a/formatTest/unit_tests/input/whitespace.re b/formatTest/unit_tests/input/whitespace.re deleted file mode 100644 index 11c074c1e..000000000 --- a/formatTest/unit_tests/input/whitespace.re +++ /dev/null @@ -1,464 +0,0 @@ -module Test = { - open Belt; - open React; - - type a = int; - type b = string; - - let x = 12; - let y = 34; - -}; - -/** recursive let bindings */ - -/* see below */ - -let foo = "abc" -and bar = "def" -and baz = "ghi"; - -/* with whitespace */ - -let foo = "abc" - -and bar = "def" - -and baz = "ghi"; - -/** with whitespace and attrs */ - -/* -> */ - -[@foo] -let foo = "abc" - -[@bar] -and bar = "def" - -[@baz] -and baz = "ghi"; - -module Comments = { - - let z = 1; - /* comment *without* whitespace interleaved*/ - let ab = 2; - - let add = (a, b) => a + b; - - - /* comment *with* multiple newlines above */ - let min = (a, b) => a - b; - - - let a = 1; /* trailing comment ok */ - let b = 2; - - /* comment on top */ - let x = 1; /* this comment sits at the end of the line */ - /* wow another one below too */ - - let add = Test.x; - - - /* this - is - a multiline - comment */ - let minus = (a, b) => a - b; - - /* look - another - multi - line - comment */ - let vermenigvuldig = (a, b) => a * b; - /* attach another comment below - it spreads - over - multiple - line - */ - - type x = {a: int /* comment1*/, b: string /* comment2 */}; -}; - -module FloatingComments = { - let a = 1; - /* a */ - - /* b */ - - /* c */ - let b = 1; - - /* d */ - - let c = 1; - - /* e */ - /* f */ - - let d = 1; - /* g */ - /* h */ - - /* i */ - /* j */ - - /* k */ - /* l */ - let e = 1; -}; - -module FloatingMultiLineComments = { - let a = 1; - /* 1 - 2 */ - - /* ok - another one */ - - /* wow - here */ - let b = 1; - - /* float - -ing */ - /* here - on the second */ - - let c = 1; - - /* one - two */ - /* three - four */ - - /* extreme - comment */ - /* here - on two lines */ - - /* another - one */ - /* chocolate - is - good */ - - - let d = 2; -}; - -module type TestModuleType = { - type a = int; - type b = string; - - - - let x: a; - let y: b; - -}; - -let main = () => { - let%lwt tc = tcGetAddr(stdin); - - let a = 1; - - let%lwt () = tcsetattr(stdin, TCSANOW, tc); - - let%lwt _i = write_string(stdout, s, 0, len); - (); -}; - -module PatternMatching = { - let x = switch(color) { - | Black => () - - | Red => () - - | White => () - }; - - /* with comments */ - let color = switch (color) { - /* c1 */ - - /* c2 */ - | Black => - "black" - - /* c3 */ - - /* c4 */ - /* c5 */ - - /* c6 */ - | Green => "green" - - /* multi - line - comment */ - - | Blue => "blue" - }; -}; - -/** recursive modules without whitespace */ -module rec A: {type t; let a_fn: t => B.t; let of_float: float => t;} = { - type t = int; - let a_fn = x => B.of_int(x); - let of_float = x => int_of_float(x); -} -/* no whitespace */ -and B: {type t; let another_fn: t => A.t; let of_int: int => t;} = { - type t = float; - let another_fn = x => A.of_float(x); - let of_int = x => float_of_int(x); -}; - -/** recursive modules with whitespace */ - -/* -> below */ - -module rec A: {type t; let a_fn: t => B.t; let of_float: float => t;} = { - type t = int; - let a_fn = x => B.of_int(x); - let of_float = x => int_of_float(x); -} - -/** okok */ - -/* lala */ - -and B: {type t; let another_fn: t => A.t; let of_int: int => t;} = { - type t = float; - let another_fn = x => A.of_float(x); - let of_int = x => float_of_int(x); -}; - -/** recursive modules with attrs */ - -/* -> below */ - -[@foo1] -module rec A: {type t; let a_fn: t => B.t; let of_float: float => t;} = { - type t = int; - let a_fn = x => B.of_int(x); - let of_float = x => int_of_float(x); -} - -/** okok */ - -/* lala */ - -[@foo2] -and B: {type t; let another_fn: t => A.t; let of_int: int => t;} = { - type t = float; - let another_fn = x => A.of_float(x); - let of_int = x => float_of_int(x); -}; - -module EdgeCase = { - let x = 1; /* a */ - - /* b */ - - /* c */ - - let x = 1; -}; - -/** Record-like expressions */ -let r = { - a: 1, - - b: 2, - c: 3, -}; - -/* with punning */ -let r = { - a, - - b, - c, -}; - -/* with spread */ -let r = { - ...x, - - a: 1, - - b: 2, - c: 3, -}; - -/* comments */ -let r = { - ...x, - - /* a */ - a: 1, - - /* b */ - /* c */ - - /* d */ - b: 2, - /* e */ - - c: 3, - - /* f */ - d, - - e, -}; - -/* string keys */ -let x = { - "a": 1, - - "b": 2, - "c": 3, -}; - -/* string keys punning */ -let x = { - "a", - - "b", - "c" -}; - -/* string keys with spread */ -let x = { - ...x, - - "a": 1, - - "b": 2, - "c": 3, -}; - -/* string keys with comments */ -let x = { - ...x, - - /* a */ - "a": 1, - - /* b */ - /* c */ - - /* d */ - "b": 2, - /* e */ - - "c": 3, - - /* f */ - "d", - - "e", -}; - -let make = _children => { - ...component, - - initialState: () => { - posts: [], - activeRoute: urlToRoute(ReasonReact.Router.dangerouslyGetInitialUrl()), - }, - - didMount: self => { - let watcherID = - ReasonReact.Router.watchUrl(url => - self.send(ChangeRoute(urlToRoute(url))) - ); - self.onUnmount(() => ReasonReact.Router.unwatchUrl(watcherID)); - }, - - reducer: (action, state) => - switch (action) { - | ChangeRoute(activeRoute) => - ReasonReact.Update({...state, activeRoute}) - | FetchCats => ReasonReact.NoUpdate - }, - - render: ({state: {posts, activeRoute}}) => -
-

{ReasonReact.string("Instagram")}

- { - switch (activeRoute) { - | Default => - | Detail(postId) => - } - } -
, -}; - -// Recursive types -// Also create another form for splicing in nodes into otherwise fixed length sets. -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -and subtree('t) = - | EmptyInstance: subtree(empty); - -// Also create another form for splicing in nodes into otherwise fixed length sets. -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree - -and subtree('t) = - | EmptyInstance: subtree(empty); - -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -// trailing comment - -// leading comment -and subtree('t) = - | EmptyInstance: subtree(empty); - -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -// trailing comment - -// in between - -// leading comment -and subtree('t) = - | EmptyInstance: subtree(empty); - -// with attrs -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree -[@attr] -and subtree('t) = - | EmptyInstance: subtree(empty); - -// with attrs -type elem('t) = - | Empty: elem(empty) -constraint 't = ('st, 'a) => 'subtree - -[@attr] -and subtree('t) = - | EmptyInstance: subtree(empty); - -let f = (a, b) => a + b; -/* this comment sticks at the end */ - -/* another one below the structure */ -/* this one should stick */ - -/* :) */ diff --git a/formatTest/unit_tests/input/whitespace.rei b/formatTest/unit_tests/input/whitespace.rei deleted file mode 100644 index 88649bcde..000000000 --- a/formatTest/unit_tests/input/whitespace.rei +++ /dev/null @@ -1,276 +0,0 @@ -/** Interleave whitespace intelligently in signatures */ - -/* a */ -let a: int; - -/** Hi I'm a doc comment for some_definition */ -let some_definition: - ( - ~what_a_long_label: M.its_a_type, - ~just_need_to_make_this: long_enough_to_wrap - ) => - unit; - -/** Hi I'm a doc comment for another_definition */ -let another_definition: unit => unit; - -/* b */ -let b: int; -/* trailing */ - -/* kkk */ -/* ---> */ - -/* amazing */ -let f: int => int; - -/** stick to x */ -type x = string; - -/** one newline below */ - -type x = string; - - -/** one newline below with comment */ - -/* comment */ -type x = string; - -/** doc comment attached */ -type payload = -| PStr(structure) -| PSig(signature) -| PTyp(core_type) -| PPat(pattern, option(expression)); - -/** doc comment with whitespace */ - -type payload = -| PStr(structure) -| PSig(signature) -| PTyp(core_type) -| PPat(pattern, option(expression)); - -/** doc comment with whitespace and comment below */ - -/* comment here */ -type payload = -| PStr(structure) -| PSig(signature) -| PTyp(core_type) -| PPat(pattern, option(expression)); - -/** doc attached */ -type core_type = { - ptyp_desc: core_type_desc, - ptyp_loc: Location.t, - ptyp_attributes: attributes, -}; - -/** doc attached with newline */ - -type core_type = { - ptyp_desc: core_type_desc, - ptyp_loc: Location.t, - ptyp_attributes: attributes, -}; - -/** doc attached with newline and comments */ - -/* comment1 */ - -/* comment2 */ -type core_type = { - ptyp_desc: core_type_desc, - ptyp_loc: Location.t, - ptyp_attributes: attributes, -}; - -/** doc attached */ -type water += - | H20 - | Spritzer; - -/** doc with newline */ - -type water += - | H20 - | Spritzer; - -/** doc with newline and comment */ - -/* test */ -type water += - | H20 - | Spritzer; - -/** doc attached */ -exception Key_not_found(string); - -/** doc attached with newline */ - -exception Key_not_found(string); - -/** doc attached with newline and comment */ - -/* comment */ -exception Key_not_found(string); - -/** doc on open */ -open Belt; - -/** doc on open with whitespace */ - -open Belt; - -/** doc on open with whitespace and comment */ - -/* test */ -open Belt; - -/** doc attached */ -include Shared; - -/** doc attached with whitespace */ -include Shared; - -/** doc attached with whitespace and comment */ - -/* test */ -include Shared; - -/** doc attached */ -module type X = {let x: int}; - -/** doc attached with whitespace */ - -module type X = {let x: int}; - -/** doc attached with whitespace and comment */ - -/* test */ -module type X = {let x: int}; - -/** doc attached */ -module X : MX; - -/** doc attached with whitespace */ - -module X : MX; - -/** doc attached with whitespace and comment */ - -/* test */ -module X : MX; - -/** doc attached */ -module X = MX; - -/** doc attached with whitespace */ - -module X = MX; - -/** doc attached with whitespace and comment */ - -/* test */ -module X = MX; - -/** doc attr attached */ -class type x = { - pub height: int -}; - -/** doc attr with newline */ - -class type x = { - pub height: int -}; - -/** doc attr with newline and comment */ - -/* test */ -class type x = { - pub height: int -}; - -/** doc attr attached */ -[@id]; - -/** doc attr with newline */ - -[@id]; - -/** doc attr with newline and comment */ - -/* test */ -[@id]; - -/** doc attr attached */ -[%%obj {a: 1}]; - -/** doc attr attached with newline */ - -[%%obj {a: 1}]; - -/** doc attr attached with newline and comment */ - -/* test */ -[%%obj {a: 1}]; - -/** doc attached */ -class reason : ocaml; - -/** doc attached with whitespace */ - -class reason : ocaml; - -/** doc attached with whitespace and comment */ - -/* test */ -class reason : ocaml; - -/** doc attached */ -module rec X1: Y1 -and X2: Y2; - -/** doc attached with whitespace */ - -module rec X1: Y1 -and X2: Y2; - -/** doc attached with whitespace and comment */ - -/* comment */ -module rec X1: Y1 -and X2: Y2; - - -/** rec modules with whitespace */ - -/* -> */ - -module rec X1: Y1 - -and X2: Y2; - -/** rec modules with whitespace and attrs */ - -/* -> */ - -[@foo] -module rec X1: Y1 - -/** another one below */ - -/* random comment */ - -[@bar] -and X2: Y2; - -/* notice the whitespace after the last signature item */ - -/* this one has whitespace interleaved */ -/* stick together */ - -/* :) */ diff --git a/formatTest/unit_tests/input/wrappingTest.re b/formatTest/unit_tests/input/wrappingTest.re deleted file mode 100644 index 01fe0339f..000000000 --- a/formatTest/unit_tests/input/wrappingTest.re +++ /dev/null @@ -1,1984 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - - -/* Run the formatting pretty printer with width 50 */ - - - -/* - * Testing infix wrapping - */ -let reallyLongIdent = 100; -let andYetAnotherReallyLongIdent = 30; - -let something = - reallyLongIdent + - andYetAnotherReallyLongIdent + - reallyLongIdent; - -let something = - /* Hopefully */ - reallyLongIdent + - /* It will indent like this */ - andYetAnotherReallyLongIdent + - /* And no further */ - reallyLongIdent; - -/* Comments can be written like this. - No leading star is required on each line. - Everything will line up just fine. - In this form, include the final closing on the last line. */ -let test = 10; - -/* You could begin the block bar out like this. - And it still works correctly. */ -let test = 10; - -/** Include multiple opening stars if you like. - And it will still work. */ -let test = 10; - - /** This comment will be corrected. - when printed. */ -let test = 10; - -/** Comments with text on line zero - * Still work well with comments that have stars on the left side. - */ -let test = 10; - - -/* - * Even though the precedence of the operators are different, no - * "simplification" grouping is needed. - */ -let testPrintingPrecedence = - reallyLongIdent + - reallyLongIdent * andYetAnotherReallyLongIdent + - reallyLongIdent; - -let testPrintingPrecedence = - reallyLongIdent + - /* - * In this case, grouping of the right expression is needed because the - * right side of the infix operator is of *lower* precedence than STAR. - */ - reallyLongIdent * (reallyLongIdent + andYetAnotherReallyLongIdent) + - (reallyLongIdent * 10); - -let testPrintingPrecedence = - reallyLongIdent + - /* - * In this case, grouping of the right expression is needed because the - * right side of the infix operator is of *lower* precedence than STAR. - */ - reallyLongIdent * (reallyLongIdent + andYetAnotherReallyLongIdent) + - reallyLongIdent; - -let add(x,y) = x + y; -let testPrintingPrecedence = - reallyLongIdent + - /* - * In this case, grouping of the right expression is needed because the - * right side isn't even infix at all. - */ - reallyLongIdent * add(reallyLongIdent,andYetAnotherReallyLongIdent) + - reallyLongIdent; -/* - * Test wrapping every form of named arguments where various parts are - * commented. - */ -let a = 10; -let b = 20; -/*A*/ -let named - /* a::a */ - (~a as a, - /* b::b */ - ~b as b) = - /* a + b */ - a + b; - -/*B*/ -let namedAlias - /* a::aa */ - (~a as aa, - /* b::bb */ - ~b as bb) = - /* aa + bb */ - aa + bb; - -/*C*/ -let namedAnnot - /* ~a a: option(int) */ - (~a as a: option(int), - /* ~b b: option(int) */ - ~b as b: option(int)) = - /* 20 */ - 20; - -/*D*/ -let namedAliasAnnot - /* a::(aa: option int) */ - (~a as aa: option(int), - /* b::(bb: option int) */ - ~b as bb: option(int)) = - /* 20 */ - 20; - -/*E*/ -let optional - /* a::a=? */ - (~a as a=?, - /* b::b=? */ - ~b as b=?, - /* () */ - ()) = - /* 10 */ - 10; - -/*F*/ -let optionalAlias - /* a::aa */ - (~a as aa=?, - /* ?b:bb */ - ~b as bb=?, - /* () */ - ()) = - /* 10 */ - 10; - -/*G*/ -let optionalAnnot - /* a::(a: option int)=? */ - (~a: option(int)=?, - /* ?b:(b: option int) */ - ~b: option(int)=?, - /* () */ - ()) = - /* 10 */ - 10; - -/*H*/ -let optionalAliasAnnot - /* a::(aa: option int)=? */ - (~a as aa: option(int)=?, - /* b::(bb: option int)=? */ - ~b as bb: option(int)=?, - /* () = */ - ()) = - /* 10 */ - 10; -/*I: This one is really annoying? Where's the visual label?*/ -let defOptional - /* a::a=10 */ - (~a as a=10, - /* b::b=10 */ - ~b as b=10, - /* () = */ - ()) = - /* 10 */ - 10; - -/*J*/ -let defOptionalAlias - /* a::aa=10 */ - (~a as aa=10, - /* b::bb=10 */ - ~b as bb=10, - /* () = */ - ()) = - /* 10; */ - 10; - -/*K*/ -let defOptionalAnnot - /* a::(a:int)=10 */ - (~a :int=10, - /* b::(b:int)=10 */ - ~b :int=10, - /* () = */ - ()) = - /* 10; */ - 10; - -/*L*/ -let defOptionalAliasAnnot - /* a::(aa:int)=10 */ - (~a as aa :int=10, - /* b::(bb:int)=10 */ - ~b as bb :int=10, - /* () = */ - ()) = - /* 10; */ - 10; - -/* Invoking them */ -named( - /* a::a */ - ~a=a, - /* b::b; */ - ~b=b -); - -named( - /* a::a */ - ~a=a, - /* b::b; */ - ~b=b -); - -optional( - /* a::a */ - ~a=a, - /* b::b; */ - ~b=b -); -optional( - /* a::a */ - ~a=a, - /* b::b; */ - ~b=b -); -let explictlyPassed = - /* optional */ - optional( - /* a::? */ - ~a=? - /* None */ - None, - /* b::? */ - ~b=? - /* None; */ - None -); - -let a = None; -let explictlyPassed = - /* optional */ - optional( - /* a::? */ - ~a=?a, - /* b::? */ - ~b=? - /* None; */ - None); - - -let complex_default(~callback as callback=(fun(k,d) => 4),x) = 3; - - -let myList = /*CommentAfterEqualBeforeList */[1, 2, 3]; -let myList = [/*CommentAfterEqualBefore1 */1, 2, 3]; -let myList = [1 /*CommentAfterOneBeforeCons */, 2, 3]; -let myList = [1, 2 /*CommentAfterTwoBeforeCons */, 3, ]; -let myList = [1, 2, /*CommentAfterConsBeforeThree */3 ]; -let myList = [1, 2, 3/*CommentAfterThreeBeforeCons*/]; - -let myList = [1, 2, 3 /*same w space after three */]; -let myList = [1, 2, 3/*same w space before rbracket*/ ]; -let myList = [1, 2, 3 /*same w both */ ]; - -/* End of line comments */ -let myList = [ - 1, - 2, - 3/*no space after three */ -]; -let myList = [ - 1, - 2, - 3 /*same w space after three */ -]; -let myList = [ - 1, - 2,/*no space after two comma */ - 3 -]; -let myList = [ - 1, - 2, /*same w space after two comma */ - 3 -]; - - -/* End of line comments */ -let myList = [ - 1, - 2,/*no space after two comma */ - 3 -]; -let myList = [ - 1, - 2, /*same w space after two comma */ - 3 -]; -let myRec = { - x:1, - y:2,/*no space after two */ - z:3 -}; -let myRec = { - x:1, - y:2, /*same w space after two */ - z:3 -}; - -/* Ensure end of line comments force breaks */ -let myList = [ - 1, - 2, - 3/* */ -]; -let myList = [ - 1, - 2,/**/ - 3 -]; - -let myList = [1, 2, 3, /*CommentAfterConsBeforeAppendedTo */...myList]; -let myList = [3, 4, 5]; - -let simpleListPattern(x) = switch (x) { -| [1, 2, 3] => 0 -| _ => 0 -}; - - -type blahType = string; - -let x: blahType = "asdf"; - -type nameAge = { - age: int, - name: string -}; - -type hasABunch = { - /* - * Field comment - */ - fieldOne: int, - fieldtwo: list(int), - fieldThree: list(string), - fieldFour: nameAge - /* Comment at bottom of record type def */ -}; - -type functionsInARecord = { - adder: (int) => int, - minuser: (int) => int -}; - -let myFunctionsInARecord = { - adder: fun(x) => x, - minuser: fun(x) => x -}; - -let myFunctionsInARecordThatMustWrap = { - /* Desired wrapping */ - adder: - fun(reallyLongArgument) => reallyLongArgument, - minuser: - fun(anotherReallyLongArgument) => anotherReallyLongArgument - /* Comment at bottom of record */ -}; - -type twoArgFunctionsInARecord = { - adder: (int, int) => int, - minuser: (int, int) => int -}; - -let myFunctionsInARecordThatMustWrap = { - /* Desired wrapping */ - adder: - fun(reallyLongArgument, - anotherReallyLongArgument) => - reallyLongArgument, - minuser: - fun(reallyLongArgument, - anotherReallyLongArgument) => - reallyLongArgument + anotherReallyLongArgument, -}; - - -type threeArgFunctionsInARecord = { - adder: (int, int, int) => int, - minuser: (int, int, int) => int -}; - -let myFunctionsInARecordThatMustWrap = { - /* Desired wrapping */ - adder: - /* Even if you have a comment before fun */ - fun(reallyLongArgument, - /* Or before the first arg */ - anotherReallyLongArgument, - yetAnotherReallyLongArgument) => - reallyLongArgument, - minuser: - fun(reallyLongArgument, - anotherReallyLongArgument, - anotherReallyLongArgument) => - reallyLongArgument + anotherReallyLongArgument, -}; - -let oneArgShouldWrapToAlignWith - (theFunctionNameBinding) = theFunctionNameBinding; - -let twoArgsShouldWrapToAlignWith - (firstArgHere, - secondArgThere) = secondArgThere; - -let rec oneArgShouldWrapToAlignWith - (theFunctionNameBinding) = theFunctionNameBinding; - -let rec twoArgsShouldWrapToAlignWith - (firstArgHere, - secondArgThere) = secondArgThere; - -let secondArgShouldWrap (pointLess, ( - a, - b, - c, - d, - e, - f, - g, - h -)) = ( - pointLess + a + b + c + d + e -); - - -/* Now check that one and two args both indent the same when applying */ -let reallyReallyLongVarName = "hello"; -let result = - oneArgShouldWrapToAlignWith - (reallyReallyLongVarName); -let result = - twoArgsShouldWrapToAlignWith - (reallyReallyLongVarName, - reallyReallyLongVarName); - - -let justReturn(x) = x; - -/* With default formatting settings: Two arguments are special cased in - function application "justReturn hasABunch" */ -let acceptsTwoThings - (nameAge:nameAge, - hasABunch:hasABunch) = justReturn(hasABunch); - -/* - Ideally, we'd allow "acceptsTwoThings {age, name}" on the first line, then - wrapping the final argument across multiple, but that is difficult to tell - the formatter "if the final argument cannot fit", but everything else can, - then only wrap the final argument with open faced braces. It's possible, but - not a v1 feature of wrapping. - */ -let result = - acceptsTwoThings - {age:20, name:"a"} - { - fieldOne: 10, - fieldtwo: [10, 20], - fieldThree: ["one", "two"], - fieldFour: {age: 20, name: "joe"} - }; - -let howDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark(x,y,z) = x + y + z; -let howDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark(x,y) = x + y; -let reallyHowDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark(x,y,z) = x + y + z; -let reallyHowDoesInfixOperatorsWrapWhenYouMustWrapQuestionMark(x,y) = x + y; - -let reallyLongFunctionNameThatJustConcats(a) = String.concat("-",a); - -let seeHowLongValuesWrap = { - age: 30, - name: reallyLongFunctionNameThatJustConcats([ - "one", - "two", - "two", - "two", - "two", - "two", - "two" - ]) -}; - -/* -/--Everything up to the arrow is label left--\ /-The return is label right-\ - /-append => to last-\ -/-----------------------\ /--------------------\ */ -let onlyReturnWraps ((a, b, c, d, e, f)) = ( - a, - b, - c, - d, - e, - f -); - -let bothArgsWrapAndIndent - ((a, b, c, d, e, f), - (h, i, j, k, l, m)) = ( - a, - b, - c, - d, - e, - f -); - -let result = onlyReturnWraps (( - 10, - 11, - 12, - 13, - 14, - 15 -)); - -let result = - bothArgsWrapAndIndent - ((10, 11, 12, 13, 14, 15), - (10, 11, 12, 13, 14, 15)); - -type sixteenTuple = (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); - -/* Nothing annotated */ -let echoTuple (( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -)) = ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -); - -/* Nothing annotated fun */ -let echoTuple = fun((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -); - -let echoTheEchoer (x: (sixteenTuple) => sixteenTuple) : (sixteenTuple) => sixteenTuple = x; - -/* Nothing annotated fun, passed to func */ -echoTheEchoer (fun((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -)); - - -/* Argument annotated */ -let echoTuple ((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p):sixteenTuple) = ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -); - -/* Argument annotated fun */ -let echoTuple = fun ((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p):sixteenTuple) => ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -); - -/* Argument annotated, return type annotated */ -let echoTuple ((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p):sixteenTuple) :sixteenTuple = ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -); - -/* Desired formatting if first line fits within margin */ -let makeTuple(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) = ( - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p -); - -/* Desired formatting if first line fits within margin (70) */ -let (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = - makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -/* Annotated version */ -let (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p): sixteenTuple = - makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -/* Annotated inline */ -let x: (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = - makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); - -let (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = - echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); -/* Annotated version */ -let (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p): sixteenTuple = - echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); -/* Annotated inline */ -let x: (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = - echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - -/* Desired formatting if pattern does not fit, arguments do (margin 70) */ - -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -) = makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -/* Annotated */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): sixteenTuple = makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); - -/* Annotated */ -/* Destructured */ -/* Inline */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); - -/* Not-Destructured */ -let someResult = makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -/* Annotated */ -/* Not-Destructured */ -let someResult: sixteenTuple = makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -/* Annotated */ -/* Not-Destructured */ -/* Inline */ -let someResult: (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = makeTuple(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); - - -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -) = echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); -/* Annotated */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): sixteenTuple = echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); -/* Annotated Inline */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); -/* Not-Destructured */ -let someResult = echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); -/* Annotated */ -/* Not-Destructured */ -let someResult: sixteenTuple = echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); -/* Annotated Inline */ -/* Not-Destructured */ -let someResult: (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = echoTuple((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); - -/* Desired formatting if neither fit on one line (margin 70) */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -) = - makeTuple - (axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx); -/* Annoted */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): sixteenTuple = - makeTuple - (axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx); -/* Annoted inline */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = - makeTuple - (axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx); -/* Not-Destructured */ -let someResult = - makeTuple - (axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx); -/* Not-Destructured */ -/* Annoted */ -let someResult: sixteenTuple = - makeTuple - (axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx); -/* Not-Destructured */ -/* Annoted inline */ -let someResult: (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = - makeTuple - (axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx); - - -/* Desired formatting if neither fit on one line (margin 70) */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -) = echoTuple (( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10 -)); -/* Annoted */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): sixteenTuple = echoTuple (( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10 -)); -/* Annoted Inline */ -/* Destructured */ -let ( - axx, - bxx, - cxx, - dxx, - exx, - fxx, - gxx, - hxx, - ixx, - jxx, - kxx, - lxx, - mxx, - nxx, - oxx, - pxx -): (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = echoTuple (( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10 -)); - -/* Desired formatting if neither fit on one line (margin 70) */ -/* Not-Destructured */ -let someResult = echoTuple (( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10 -)); -/* Annoted */ -/* Not-Destructured */ -let someResult: sixteenTuple = echoTuple (( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10 -)); -/* Annoted Inline */ -/* Not-Destructured */ -let someResult: (int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int) = echoTuple (( - 1000, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10 -)); - -/* The rhs of = shouldn't be broken onto its own newline: @see ensureSingleTokenSticksToLabel */ -let someResult: ( - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int, - int -) = someResult; - -type sevenStrings = (string, string, string, string, string, string, string); -let (only, the, type_, should, have, to_, wrap) = ( - "only", - "the", - "type", - "should", - "have", - "to", - "wrap" -); - -let (only, the, type_, should, have, to_, wrap):sevenStrings = ( - "only", - "the", - "type", - "should", - "have", - "to", - "wrap" -); - -let ifTheNameIsReallyLongTheTypeAndValueShouldBothWrap: (string, string, string, string, string, string, string) = ( - "only", - "the", - "type", - "should", - "have", - "to", - "wrap" -); -let (the, type_, and_, value, should, both, wrap): (string, string, string, string, string, string, string) = ( - "but", - "the", - "destructured", - "assignment", - "should", - "not", - "wrap" -); - - - -let myPolyFunc: 'a . ('a) => 'a = fun(o) => o; -let myNonPolyFunc: ('a) => 'a = fun(o) => o; - -let locallyAbstractFunc (type a, input:a) = input; -let locallyAbstractFuncNotSugared = fun (type a, input:a) => input; -let locallyAbstractFuncAnnotated: type a. (a) => a = fun (type a, input:a) => input; - -/* - Examples of how long versions of these should be wrapped: df stands for - "desired formatting" when the function binding itself must wrap. - */ -let df_myPolyFunc: 'a . ('a) => 'a = fun(o) => o; -let df_myNonPolyFunc: ('a) => 'a = fun(o) => o; - -type nameBlahType = {nameBlah: int}; - -let myFunc = - fun(~firstArg as firstArg, - ~another as another, - ~fl as fl) => { - nameBlah: 10 - }; - -type inputEchoRecord('a) = { - inputIs: 'a -}; -let df_locallyAbstractFunc - (type a, - type b, - input:a) { - inputIs: input -}; /* With setting ReturnValOnSameLine */ - -let df_locallyAbstractFuncNotSugared = - fun (type a, - type b, - input:a) { - inputIs: input -}; - -/** - * The following is automatically expanded at the parser level into: - * - * let df_locallyAbstractFuncAnnotated: - * 'a . - * 'a => 'a => inputEchoRecord 'a - * = - * fun (type a) => ( - * fun (input: a) (input: a) => {inputIs: input}: - * a => a => inputEchoRecord a - * ); - * - */ -let df_locallyAbstractFuncAnnotated: type a. (a, a) => inputEchoRecord(a) = - fun (input:a, input:a) { - inputIs: input - }; - -/** - * The following is automatically expanded at the parser level into: - * - * let df_locallyAbstractFuncAnnotated: - * 'a . - * 'a => 'a => inputEchoRecord 'a - * = - * fun (type a) => ( - * df_locallyAbstractFuncAnnotated: - * a => a => inputEchoRecord a - * ); - * - */ -let df_locallyAbstractFuncAnnotatedRef: type a. (a, a) => inputEchoRecord(a) = - df_locallyAbstractFuncAnnotated; - -/** - * Doesn't do what you want: - * - * let df_locallyAbstractFuncAnnotatedExtra: type a. a => a => inputEchoRecord a = - * fun (type a) - * (input:a) - * (input:a) => { - * inputIs: input - * }; - */ - -/** - * The following is automatically expanded at the parser level into: - * - * let df_locallyAbstractFuncAnnotatedTwo: - * 'a 'b . - * 'a => 'b => (inputEchoRecord 'a, inputEchoRecord 'b) - * = - * fun (type a) (type b) => ( - * fun (input: a) (input2: b) => ({inputIs: input}, {inputIs:input2}): - * a => b => (inputEchoRecord a, inputEchoRecord b) - * ); - * - */ -let df_locallyAbstractFuncAnnotated: type a b. (a, b) => (inputEchoRecord(a), inputEchoRecord(b)) = - fun (input:a, input2:b) => ( - {inputIs: input}, - {inputIs: input2} - ); - - -/** - * This case shows why inferring what was originally sugar type a b . blahblah - * is not so trivial. We have to take the last Pexp_constraint type, varify the - * constructors, then check if the result is equal to the first - * Ppat_constraint. In this case, they're not equal! - */ -let df_locallyAbstractFuncAnnotated: - 'figureMeOut - = - fun (type a, type b) => ( - fun (input: a, input2: b) => ( - {inputIs: input}, - {inputIs: input2} - ): - (a, b) => (inputEchoRecord(a), inputEchoRecord(b)) - ); - - - -let createTuple_thisFuncShouldWrapCorrectlyNow -:'a. ('a, 'a, 'a) => ('a, 'a, 'a) = -(someVar,someVar2,someVar3) => (someVar, someVar2, someVar3); - -let (theTupleTypeAnnotationShouldWrap: ( - string, - string, - string, - string -)) = ( - "now these tuple values should wrap", - "now these tuple values should wrap", - "now these tuple values should wrap", - "now these tuple values should wrap" -); - - -let rec mutuallyRecursiveOne(x) = mutuallyRecursiveTwo (x + x) -and mutuallyRecursiveTwo(y) = print_int(y); - -/* The only downside to this is that now you can't redeclare a binding. */ -/* let newMutualRecursionSyntax x => newMutuallyRecursiveTwo (x + x); */ -/* let newMutuallyRecursiveTwo y => print_int y; */ -/* */ - - - -type x = pri int; -type y = x = ..; -type myType('a,'b,'c) = pri ('a, 'b, 'c); - -type privateVariant = pri - | BigSize(int) - | SmallSize(int); - -type doubleEqualsDoublePrivateVariant = - privateVariant = - pri - | BigSize(int) - | SmallSize(int); - -type myRecordWithReallyLongName = {xx:int, yy:int}; -type doubleEqualsRecord = myRecordWithReallyLongName = {xx:int, yy:int}; -type doubleEqualsDoublePrivateRecord = myRecordWithReallyLongName = pri {xx:int, yy:int}; - - - -type someConstructor = SomeConstructorHi(int,int); -type someRecord = {firstFieldInRecord: int, secondField: int}; - -/* - With settings.functionBindingStyle = AttachFirstTermToLabelIffTwoTotalTerms, - the binding name becomes part of the label when there are only two total - terms in the binding/argument pattern list (the name, followed by one - pattern). -*/ -let funcOnSomeConstructorHi ( - SomeConstructorHi(x,y) -) = x + y; - -let funcOnSomeConstructorHi - (SomeConstructorHi(x,y), - secondArg) = x + y; - -/* With two args */ -let funcOnSomeRecord ({ - firstFieldInRecord, - secondField -}) = firstFieldInRecord + secondField; - -let funcOnSomeRecord - ({firstFieldInRecord, secondField}, secondArg) = - firstFieldInRecord + secondField; - - -/* - With settings.functionBindingStyle = DontAttachFirstTermToLabel, - the binding name becomes part of the label when there are only two total - terms in the binding/argument pattern list (the name, followed by one - pattern). -*/ -let funcOnSomeConstructorHi - (SomeConstructorHi(x,y)) = x + y; - -let funcOnSomeRecord - ({firstFieldInRecord, secondField}) = - firstFieldInRecord + secondField; - -/* With two args */ -let funcOnSomeConstructorHi - (SomeConstructorHi(x,y), secondArg) = - x + y; - -let funcOnSomeRecord - ({firstFieldInRecord, secondField}, secondArg) = - firstFieldInRecord + secondField; - - -type simpleTupleVariant = - SimpleActuallyATuple((int, int)); - -let returnTheSimpleTupleVariant(i) = - SimpleActuallyATuple (i, i); - -let shouldWrapLike(whenLongArg) = SimpleActuallyATuple ( - whenLongArg, - whenLongArg -); - -type recordWithLong = { - someField: int, - anotherField: string -}; - -/* - * Commenting first of two mutualy recursive types. - */ -type recursiveType = - /* First variant of first mutually recursive */ - | Blah - /* Second variant of first mutually recursive */ - | Another (option(anotherRecursiveType)) - -/* - * Commenting second of two mutually recursive types. - */ -and anotherRecursiveType = - /* Second variant of second mutually recursive */ - | Baz - /* Second variant of second mutually recursive */ - | Recursive (option(recursiveType)); - -/** - * Commented GADT definition. - */ -type term(_) = - /* First variant leaf of GADT */ - | Int /*first var arg */ (int) : /* First GADT res */ term(int) - /* Second variant leaf of GADT */ - | Float /*second var arg */ (int) : /* Second GADT res */ term(int) - /* Third variant leaf of GADT */ - | Bool /*third var arg */ (int) : /* Third GADT res */ term(int); - - -/* Commented colors */ -type commentedTypeDef = - /* - * Commenting first variant member. - */ - | First (( - /* First field of tuple in first variant member */ - int, - /* Second field of tuple in first variant member */ - int - )) - /* - * Commenting second variant member. - */ - | Second(int) - /* - * Commenting third variant member. - */ - | Third ( - list - /* Commenting deep in type def */ - (list(int)) - ); - -type colors = - | Red(int) - | Black(int) - | Green(int); - -let blah = fun(arg) => switch (arg) { - /* Comment before Bar */ - | /* Comment between bar/pattern */ - Red(_) => 1 - /* Comment Before non-first bar */ - | /* Comment betwen bar/pattern */ - Black(_) => 0 - | Green(_) => 0 -}; - -let blah = fun - | Red(_) => 1 - | Black(_) => 0 - | Green(_) => 1; - -let blahCurriedX(x) = fun - /* Comment before first bar */ - | /* Comment between first bar and OR pattern */ - (Red(x) | Black(x) | Green(x)) => 1 - /* Comment before second bar */ - | Black(x) => 0 - | Green(x) => 0; - - -type reallyLongVariantNames = - | ReallyLongVariantName(recordWithLong) - | AnotherReallyLongVariantName(int,int,int) - | AnotherReallyLongVariantName2(int,int,int); - -let howDoLongMultiBarPatternsWrap = fun(x) => switch (x) { - | AnotherReallyLongVariantName(_,_,_) => 0 - | AnotherReallyLongVariantName2(_,_,_) => 0 - | ReallyLongVariantName {someField, anotherField} => 0 -}; - -let letsCombineTwoLongPatternsIntoOneCase(x) = - switch (x) { - | AnotherReallyLongVariantName(_,_,_) - | AnotherReallyLongVariantName2(_,_,_) => 0 - | ReallyLongVariantName {someField, anotherField} => 0 - }; - -let letsPutAWhereClauseOnTheFirstTwo(x) = - switch (x) { - | AnotherReallyLongVariantName(_,_,_) - | AnotherReallyLongVariantName2(_,_,_) when true => 0 - | ReallyLongVariantName {someField, anotherField} => 0 - }; - -let letsPutAWhereClauseOnTheLast(x) = - switch (x) { - | AnotherReallyLongVariantName(_,_,_) - | AnotherReallyLongVariantName2(_,_,_) => 0 - | ReallyLongVariantName {someField, anotherField} when true => 0 - }; - - - -type wrappingGadt(_) = - | ThisIsLongSoTypeWillWrap(int) - :wrappingGadt(int) - | Add :wrappingGadt ((int, int) => int) - | App - (wrappingGadt(('b) => 'a), wrappingGadt('b)) - :wrappingGadt('a); - - -type withThreeFields = { - name: string, - age: int, - occupation: string -}; - -let testRecord = { - name: "joe", - age: 20, - occupation: "engineer" -}; -let anotherRecord = { - ...testRecord, - name: "joe++", - age: testRecord.age + 10 -}; - -type polymorphicCommentedType - /* Commenting the first type variable */ - ('a, - /* Commenting the second type variable */ - 'b) = list ('a, 'b); - -/** - * Commenting the entire record definition. - */ -type withThreeFieldsCommented = { - /* Commenting the first field */ - nameCommented: string, - /* Commenting the second field */ - ageCommented: int, - /* Commenting the third field */ - occupationCommented: string -}; - -/** - * Commenting the entire record. - */ -let testRecordCommented = { - /* Commenting the first field */ - nameCommented: "joe", - /* Commenting the second field */ - ageCommented: 20, - /* Commenting the last field */ - occupationCommented: "engineer" -}; - - -/* - * Test comments near the arguments. - */ -let callMeWithComments - /* Comment before first arg "a" */ - (a:int, - /* Comment before second arg "b" */ - b:int) - /* Comment before return type annotation "int" */ - :int = - /* Comment above return value a + b + c */ - a + b + c; - -let callMeWithComments2 = - /* Comment before the only argument */ - ((a:int, - /* Comment before second arg "b" */ - b:int)) - /* Comment before return type annotation "int" */ - :int => - /* Comment above return value a + b + c */ - a + b + c; - -let result = - /* Comment before function to invoke */ - callMeWithComments - /* Comment before first argument expression */ - (1 + 2 + 3 + 3, - /* Comment before second argument expression */ - 1 + 2 + 3 + 3); - -module type ASig = {let a:int;}; -module type BSig = {let b:int;}; -module AMod = {let a = 10;}; -module BMod = {let b = 10;}; -module CurriedSugar - /* Commenting before First curried functor arg */ - /* If these comments aren't formatted correctly - * see how functor args' locations aren't set - * correclty due to the fold_left. - */ - (A:ASig, - /* Commenting before Second curried functor arg */ - B:BSig) { - let result = A.a + B.b; - /* Comment at bottom of module expression */ -}; - -module CurriedSugarFunctorResult = - /* Commenting before functor name*/ - CurriedSugar - /* Commenting before functor arg 1 in app */ - (AMod, - /* Commenting before functor arg 2 in app */ - BMod); - -module CurriedSugarFunctorResultInline = - /* Commenting before functor name*/ - CurriedSugar - /* Commenting before functor arg 1 in app */ - {let a=10;} - /* Commenting before functor arg 2 in app */ - {let b=10;}; - - -module type FunctorType = (ASig, ASig, BSig,) => BSig; -/* - * Commenting locations - */ -let commentingBeforeEqual /*beforeEqual*/ = { - name: "hello", - age: 20, - occupation: "programmer" -}; -let commentingAfterEqual = /*afterEqual*/ { - name: "hello", - age: 20, - occupation: "programmer" -}; -let commentingBeforeEqualBeforeType /*beforeEqualBeforeType*/ : withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer" -}; -let commentingBeforeEqualAfterType : withThreeFields /*beforeEqualAfterType*/ = { - name: "hello", - age: 20, - occupation: "programmer" -}; -let commentingAfterEqualAfterType : withThreeFields = /*afterEqual*/ { - name: "hello", - age: 20, - occupation: "programmer" -}; -let /*beforePattern*/ commentingBeforePattern : withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer" -}; -let /*beforePattern*/ /*beforePattern2 */ commentingBeforePattern2 : withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer" -}; - -let /*beforePattern*/ /*beforePattern2 */ commentingBeforePatternSpecial : withThreeFields = { - name: "hello", - age: 20, - occupation: "programmer" -}; - -let produceRecord /*commentBeforeArg*/(x) { - name: "hello", - age: 20, - occupation: "programmer" -}; - -let produceRecord(x) /*commentAfterArg*/ { - name: "hello", - age: 20, - occupation: "programmer" -}; - - - -let myPolyFuncCommentBeforeColon /*beforeColon */: 'a . ('a) => 'a = fun(o) => o; -let myPolyFuncCommentAfterColon : /*afterColon */ 'a . ('a) => 'a = fun(o) => o; -let myPolyFuncCommentBeforeArrow : 'a . ('a) /*beforeArrow */ => 'a = fun(o) => o; -let myPolyFuncCommentAfterArrow : 'a . ('a) => /*afterArrow */ 'a = fun(o) => o; -/* THIS IS THE ONLY TEST THAT IS FAILING DUE TO BEING NON-IDEMPOTENT */ -/* let myPolyFuncCommentBeforeEqual : 'a . ('a) => 'a /*beforeEqual */ = fun(o) => o; */ -let myPolyFuncCommentAfterEqual : 'a . ('a) => 'a = /*afterEqual */ fun(o) => o; - -let myNonPolyFuncCommentBeforeColon /*BeforeColon */: ('a) => 'a = fun(o) => o; -let myNonPolyFuncCommentAfterColon : /*AfterColon */('a) => 'a = fun(o) => o; -let myNonPolyFuncCommentBeforeArrow: ('a) /*BeforeArrow */=> 'a = fun(o) => o; -let myNonPolyFuncCommentAfterArrow: ('a) => /*AfterArrow */'a = fun(o) => o; -let myNonPolyFuncCommentBeforeEqual: ('a) => 'a /*BeforeEqual */= fun(o) => o; -let myNonPolyFuncCommentAfterEqual: ('a) => 'a = /*AfterEqual */ fun(o) => o; - -let lATCurrySugarCommentBeforeType /*BeforeType */ (type a, input:a) = input; -let lATCurrySugarCommentAfterType /*AfterType */ (type a, input:a) = input; -let lATCurrySugarCommentBeforeArg (type a, /*BeforeArg */ input:a) = input; -let lATCurrySugarCommentAfterArg (type a, input:a) /*AfterArg */ = input; -let lATCurrySugarCommentAfterArrow (type a, input:a) = /*AfterArrow */ input; - -let lATNotSugaredCommentBeforeEqual /*BeforeEqual*/ = fun (type a, input:a) => input; -let lATNotSugaredCommentAfterEqual = /*AfterEqual*/fun (type a, input:a) => input; -let lATNotSugaredCommentBeforeType = fun /*BeforeType*/(type a, input:a) => input; -let lATNotSugaredCommentAfterType = fun (type a /*AfterType*/, input:a) => input; -let lATNotSugaredCommentBeforeArg = fun (type a, /*BeforeArg*/ input:a) => input; -let lATNotSugaredCommentAfterArg = fun (type a, input:a) /*AfterArg*/ => input; -let lATNotSugaredCommentAfterArrow = fun (type a, input:a) => /*AfterArrow*/ input; - -let lAtFuncAnnotatedCommentBeforeColon /*BeforeColon*/: type a. (a) => a = fun (type a, input:a) => input; -let lAtFuncAnnotatedCommentAfterColon: /*AfterColon*/ type a. (a) => a = fun (type a, input:a) => input; -let lAtFuncAnnotatedCommentBeforeTypeVar: type /*BeforeTypeVar*/ a. (a) => a = fun (type a, input:a) => input; -let lAtFuncAnnotatedCommentAfterTypeVar: type a /*AfterTypeVar*/. (a) => a = fun (type a, input:a) => input; -let lAtFuncAnnotatedBeforeEqual: type a. (a) => a /*BeforeEqual*/ = fun (type a, input:a) => input; -let lAtFuncAnnotatedAfterEqual: type a. (a) => a = /*AfterEqual*/ fun (type a, input:a) => input; - - -/* Ternary wrapping comments */ -let ternaryResult = - /* Before Test */ - something ? - /* Before ifTrue */ - callThisFunction(withThisArg): - /* Before ifFalse */ - thatResult; - -let ternaryResult = - /* Before Test */ - something ? - /* Before ifTrue */ - callThisFunction(withThisArg): - /* Before ifFalse */ - trailingTest ? /* before nested ifTrue */ true : /* before nested ifFalse */ false; - - -let returningATernary(x,y) = x > y ? "hi" : "by"; - - -/** Testing some special comment alignment features */ - -/* Comments can be written like this. - No leading star is required on each line. - Everything will line up just fine. - In this form, include the final closing on the last line. */ -let test = 10; -let test = - /* And if the entire block needs to be re-indented - such as this case, everything will still look okay. */ - 10; - -/* You could begin the block bar out like this. - And it still works correctly. */ -let test = 10; - -/** Include multiple opening stars if you like. - And it will still work. */ -let test = 10; - - /** This comment will be corrected. - when printed. */ -let test = 10; - -/** Comments with text on line zero - * Still work well with comments that have stars on the left side. - */ -let test = 10; - -let test = - /* This kind of comment doesn't exactly render well though. - Not many people write comments like this. - */ - 10; - - -let x = calWith( - reallyLongName, - reallyReallyLongName, - reallyReallyLongName, - reallyReallyLongName, - reallyReallyLongName, - reallyReallyLongName, - a, - a, - a, - alskdjfalskdjfalsdf) + reallyReallyLongName; - - - - -let onlyDoingThisTopLevelLetToBypassTopLevelSequence = { - let x = { - print_int(1); - print_int(20); /* Missing trailing SEMI */ - }; - - let x = { - print_int(1); - print_int(20); /* Ensure missing middle SEMI reported well */ - print_int(20); - }; - - let x = { - print_int(1); - print_int(20); - 10; - }; /* Missing final SEMI */ - - let x = { - print_int(1); - print_int(20); - 10; - }; - x + x; /* Final item */ -}; - - -/* With this unification, anywhere eyou see `= fun` you can just ommit it */ -let blah = fun(a)=> a; /* Done */ -let blah(a) = a; /* Done (almost) */ - -let blah = fun(a,b) => a; /* Done */ -let blah(a,b) = a; /* Done (almost) */ - -let tryingTheSameInLocalScope = { - let blah = fun(a) => a; /* Done */ - let blah(a) = a; /* Done (almost) */ - - let blah = fun(a,b) => a; /* Done */ - let blah(a,b) = a; /* Done (almost) */ -}; - -reallyLongFunctionNameWithArrayThatBreaks([| - "one", - "two", - "two", - "two", - "two", - "two", - "two" -|]); - -reallyLongFunctionNameWithRecordStringKeys({ - "one": 2345, - "two": 2345678, - "three": 45678, - "four": 45678 -}); - -fooSpreadES6List([ - "sldkjfklsjdflskjdflksjok", - "more tests", - ...x -]); diff --git a/formatTest/unit_tests/input/wrappingTest.rei b/formatTest/unit_tests/input/wrappingTest.rei deleted file mode 100644 index 688ad7d6e..000000000 --- a/formatTest/unit_tests/input/wrappingTest.rei +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */ - -let named : (~a: int, ~b: int) => int; - -let namedAlias : (~a: int, ~b: int) => int; - -let namedAnnot : (~a: option(int), ~b: option(int)) => int; - -let namedAliasAnnot : (~a: option(int), ~b: option(int)) => int; - -let optional : (~a: 'a=?, ~b: 'b=?, unit) => int; - -let optionalAlias : (~a: 'a=?, ~b: 'b=?, unit) => int; - -let optionalAnnot : (~a: int=?, ~b: int=?, unit) => int; - -let optionalAliasAnnot : (~a: int=?, ~b: int=?, unit) => int; - -let defOptional : (~a: int=?, ~b: int=?, unit) => int; - -let defOptionalAlias : (~a: int=?, ~b: int=?, unit) => int; - -let defOptionalAnnot : (~a: int=?, ~b: int=?, unit) => int; - -let defOptionalAliasAnnot : (~a: int=?, ~b: int=?, unit) => int; - -let fun_option_int : (option(int), option(int)) => int; - -/* Comments can be written like this. - No leading star is required on each line. - Everything will line up just fine. - In this form, include the final closing on the last line. */ -let test: int; -let test: - /* And if the entire block needs to be re-indented - such as this case, everything will still look okay. */ - int; - -/* You could begin the block bar out like this. - And it still works correctly. */ -let test:int; - -/** Include multiple opening stars if you like. - And it will still work. */ -let test: int; - - /** This comment will be corrected. - when printed. */ -let test:int; - -/** Comments with text on line zero - * Still work well with comments that have stars on the left side. - */ -let test:int; - -let test - /* This kind of comment doesn't exactly render well though. - Not many people write comments like this. - */ - :int; diff --git a/miscTests/backportSyntaxTests.sh b/miscTests/backportSyntaxTests.sh deleted file mode 100755 index 57dd2d07c..000000000 --- a/miscTests/backportSyntaxTests.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo "Testing the backport of 'letop'" -testPath="./miscTests/backport_syntax_tests" -input=$testPath/basic.re -output=$testPath/basic.bin -binary=$testPath/bin - -refmt $input --print binary > $output -ocamlc -impl $output -o $binary -$binary -rm $output $binary $testPath/basic.cm* diff --git a/miscTests/backport_syntax_tests/basic.re b/miscTests/backport_syntax_tests/basic.re deleted file mode 100644 index f5aa53d54..000000000 --- a/miscTests/backport_syntax_tests/basic.re +++ /dev/null @@ -1,21 +0,0 @@ - -let (let.opt) = (x, f) => switch x { | None => None | Some(x) => f(x) }; -let (let.&opt) = (x, f) => switch x { | None => None | Some(x) => Some(f(x)) }; -let (and.opt) = (a, b) => switch (a, b) { | (Some(a), Some(b)) => Some((a, b)) | _ => None }; - -let x = { - let.opt a = Some(1); - let.opt b = Some(2) - and.opt c = Some(3) - and.opt d = Some(4); - Some((a, b, c, d)) -} -let y = { - let.opt a = Some(1) - and.opt b = None - and.opt c = Some(4); - Some((a, b, c)) -} -assert(x == Some((1,2,3,4))); -assert(y == None); -print_endline("Success") \ No newline at end of file diff --git a/miscTests/reactjs_jsx_ppx_tests/expected_v2_1.re b/miscTests/reactjs_jsx_ppx_tests/expected_v2_1.re deleted file mode 100644 index 50b8b0bec..000000000 --- a/miscTests/reactjs_jsx_ppx_tests/expected_v2_1.re +++ /dev/null @@ -1,228 +0,0 @@ -module ReactDOMRe = { - let createElement = (tag, ~props=?, children: array('a)) => 1; - let createElementVariadic = (tag, ~props=?, children: array('a)) => 1; - let props = (~className=?, ~width=?, ~comp=?, ~compCallback=?, ()) => 1; -}; -module Foo = { - let make = (~className=?, ~width=?, ~comp=?, ~bar=?, children) => 1; - let createElement = - (~className=?, ~ref=?, ~key=?, ~width=?, ~comp=?, ~bar=?, ~children, ()) => 1; - module Bar = { - let make = (~className=?, children) => 1; - let createElement = (~className=?, ~ref=?, ~key=?, ~children, ()) => 1; - }; -}; -module Bar = { - let make = (~bar=?, children) => 1; - let createElement = (~bar=?, ~children, ()) => 1; -}; -module ReasonReact = { - let element = (~key=?, ~ref=?, component) => 1; - let fragment = (children: array('a)) => 1; -}; -let divRef = ReactDOMRe.createElement("div", [||]); -let divRefs = [|ReactDOMRe.createElement("div", [||])|]; -"=== DOM component ==="; -ReactDOMRe.createElement("div", [||]); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~className="hello", ()), - [||], -); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~className="hello", ~width="10", ()), - [||], -); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~className="hello", ~width="10", ()), - [| - ReactDOMRe.createElement("li", [|ReactDOMRe.createElement("p", [||])|]), - ReasonReact.element(Foo.make([|ReasonReact.element(Bar.make([||]))|])), - |], -); -ReactDOMRe.createElement( - "div", - ~props= - ReactDOMRe.props( - ~className="hello", - ~comp=ReasonReact.element(Foo.make(~bar=1, [||])), - (), - ), - [| - ReactDOMRe.createElement("li", [||]), - ReasonReact.element(Foo.make(~bar=2, [||])), - |], -); -ReactDOMRe.createElement( - "div", - ~props= - ReactDOMRe.props( - ~className="hello", - ~compCallback=() => ReasonReact.element(Foo.make(~bar=1, [||])), - (), - ), - [| - ReactDOMRe.createElement("li", [||]), - (() => ReasonReact.element(Foo.make(~bar=2, [||])))(), - |], -); -"=== Custom component ==="; -ReasonReact.element(Foo.make([||])); -ReasonReact.element(Foo.make([|ReactDOMRe.createElement("div", [||])|])); -ReasonReact.element(Foo.make([|ReasonReact.element(Bar.make([||]))|])); -ReasonReact.element( - Foo.make([| - ReactDOMRe.createElement("div", [||]), - ReasonReact.element(Bar.make([||])), - |]), -); -ReasonReact.element(Foo.make([|divRef, divRef|])); -ReasonReact.element(Foo.make(~className="hello", [||])); -ReasonReact.element( - Foo.make(~className="hello", [|ReactDOMRe.createElement("div", [||])|]), -); -ReasonReact.element( - Foo.make(~className="hello", [|ReasonReact.element(Bar.make([||]))|]), -); -ReasonReact.element( - Foo.make( - ~className="hello", - [| - ReactDOMRe.createElement("div", [||]), - ReasonReact.element(Bar.make([||])), - |], - ), -); -ReasonReact.element(Foo.make(~className="hello", [|divRef, divRef|])); -ReasonReact.element(Foo.make(~className="hello", ~width="10", [||])); -ReasonReact.element( - Foo.make( - ~className="hello", - ~width="10", - [| - ReactDOMRe.createElement( - "li", - [|ReactDOMRe.createElement("p", [||])|], - ), - ReasonReact.element( - Foo.make([|ReasonReact.element(Bar.make([||]))|]), - ), - |], - ), -); -ReasonReact.element( - Foo.make( - ~className="hello", - ~comp=ReasonReact.element(Bar.make(~bar=1, [||])), - [| - ReactDOMRe.createElement("li", [||]), - ReasonReact.element(Bar.make(~bar=2, [||])), - |], - ), -); -ReasonReact.element( - Foo.make( - ~comp=ReasonReact.element(Bar.make([|divRef, divRef|])), - [|ReactDOMRe.createElement("li", [||])|], - ), -); -ReasonReact.element( - Foo.make( - ~comp= - ReasonReact.element( - Bar.make([|ReactDOMRe.createElement("div", [||])|]), - ), - [|ReactDOMRe.createElement("li", [||])|], - ), -); -"=== No wrapping for single child ==="; -ReasonReact.element(Foo.make(() => 1)); -ReasonReact.element(Foo.make(() => ReasonReact.element(Bar.make([||])))); -ReasonReact.element(Foo.make((1, 2))); -ReasonReact.element(Foo.make([|1|])); -ReasonReact.element(Foo.make([||])); -ReasonReact.element(Foo.make([||])); -ReasonReact.element(Foo.make(divRef)); -ReasonReact.element(Foo.make(ReactDOMRe.createElement("div", [||]))); -ReasonReact.element(Foo.make(ReasonReact.element(Bar.make([||])))); -ReasonReact.element(Foo.make(~className="hello", () => 1)); -ReasonReact.element(Foo.make(~className="hello", (1, 2))); -ReasonReact.element(Foo.make(~className="hello", [|1, 2|])); -ReasonReact.element(Foo.make(~className="hello", divRef)); -ReasonReact.element( - Foo.make( - ~comp=ReasonReact.element(Bar.make(divRef)), - ReactDOMRe.createElement("li", [||]), - ), -); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~comp=ReasonReact.element(Bar.make(divRef)), ()), - [||], -); -"=== Special transform for DOM component with a single child spread ==="; -ReactDOMRe.createElementVariadic("div", divRefs); -ReactDOMRe.createElementVariadic("div", (() => divRefs)()); -ReactDOMRe.createElementVariadic( - "div", - ~props=ReactDOMRe.props(~className="hi", ()), - divRefs, -); -ReactDOMRe.createElementVariadic( - "div", - ~props=ReactDOMRe.props(~className="hi", ()), - (() => divRefs)(), -); -ReactDOMRe.createElement("div", [||]); -ReactDOMRe.createElement("div", [|ReactDOMRe.createElement("div", [||])|]); -"=== With ref/key ==="; -ReasonReact.element(~key="someKey", Foo.make(~className="hello", [||])); -ReasonReact.element( - ~key=Some("someKey"), - ~ref=Some(ref), - Foo.make(~className="hello", [||]), -); -ReasonReact.element( - ~key=?Some("someKey"), - ~ref=?Some(ref), - Foo.make(~className="hello", [||]), -); -ReasonReact.element( - ~key="someKey", - ~ref=Some(ref), - Foo.Bar.make(~className="hello", [|ReasonReact.element(Bar.make([||]))|]), -); -ReasonReact.element(Foo.make([||])); -"=== Fragment ==="; -ReactDOMRe.createElement(ReasonReact.fragment, [||]); -ReactDOMRe.createElement(ReasonReact.fragment, [|1|]); -ReactDOMRe.createElement( - ReasonReact.fragment, - [| - ReactDOMRe.createElement( - ReasonReact.fragment, - [|ReactDOMRe.createElement("div", [||])|], - ), - |], -); -ReactDOMRe.createElement( - ReasonReact.fragment, - [|ReactDOMRe.createElement(ReasonReact.fragment, [||]), 2|], -); -ReactDOMRe.createElement( - ReasonReact.fragment, - [|ReasonReact.element(Foo.make([|1|]))|], -); -ReactDOMRe.createElement( - ReasonReact.fragment, - [| - ReactDOMRe.createElement( - "div", - ~props= - ReactDOMRe.props(~comp=ReasonReact.element(Bar.make(divRef)), ()), - [||], - ), - |], -); diff --git a/miscTests/reactjs_jsx_ppx_tests/expected_v2_2.re b/miscTests/reactjs_jsx_ppx_tests/expected_v2_2.re deleted file mode 100644 index ae251956f..000000000 --- a/miscTests/reactjs_jsx_ppx_tests/expected_v2_2.re +++ /dev/null @@ -1,229 +0,0 @@ -[@bs.config {foo: foo}]; -module ReactDOMRe = { - let createElement = (tag, ~props=?, children: array('a)) => 1; - let createElementVariadic = (tag, ~props=?, children: array('a)) => 1; - let props = (~className=?, ~width=?, ~comp=?, ~compCallback=?, ()) => 1; -}; -module Foo = { - let make = (~className=?, ~width=?, ~comp=?, ~bar=?, children) => 1; - let createElement = - (~className=?, ~ref=?, ~key=?, ~width=?, ~comp=?, ~bar=?, ~children, ()) => 1; - module Bar = { - let make = (~className=?, children) => 1; - let createElement = (~className=?, ~ref=?, ~key=?, ~children, ()) => 1; - }; -}; -module Bar = { - let make = (~bar=?, children) => 1; - let createElement = (~bar=?, ~children, ()) => 1; -}; -module ReasonReact = { - let element = (~key=?, ~ref=?, component) => 1; - let fragment = (children: array('a)) => 1; -}; -let divRef = ReactDOMRe.createElement("div", [||]); -let divRefs = [|ReactDOMRe.createElement("div", [||])|]; -"=== DOM component ==="; -ReactDOMRe.createElement("div", [||]); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~className="hello", ()), - [||], -); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~className="hello", ~width="10", ()), - [||], -); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~className="hello", ~width="10", ()), - [| - ReactDOMRe.createElement("li", [|ReactDOMRe.createElement("p", [||])|]), - ReasonReact.element(Foo.make([|ReasonReact.element(Bar.make([||]))|])), - |], -); -ReactDOMRe.createElement( - "div", - ~props= - ReactDOMRe.props( - ~className="hello", - ~comp=ReasonReact.element(Foo.make(~bar=1, [||])), - (), - ), - [| - ReactDOMRe.createElement("li", [||]), - ReasonReact.element(Foo.make(~bar=2, [||])), - |], -); -ReactDOMRe.createElement( - "div", - ~props= - ReactDOMRe.props( - ~className="hello", - ~compCallback=() => ReasonReact.element(Foo.make(~bar=1, [||])), - (), - ), - [| - ReactDOMRe.createElement("li", [||]), - (() => ReasonReact.element(Foo.make(~bar=2, [||])))(), - |], -); -"=== Custom component ==="; -ReasonReact.element(Foo.make([||])); -ReasonReact.element(Foo.make([|ReactDOMRe.createElement("div", [||])|])); -ReasonReact.element(Foo.make([|ReasonReact.element(Bar.make([||]))|])); -ReasonReact.element( - Foo.make([| - ReactDOMRe.createElement("div", [||]), - ReasonReact.element(Bar.make([||])), - |]), -); -ReasonReact.element(Foo.make([|divRef, divRef|])); -ReasonReact.element(Foo.make(~className="hello", [||])); -ReasonReact.element( - Foo.make(~className="hello", [|ReactDOMRe.createElement("div", [||])|]), -); -ReasonReact.element( - Foo.make(~className="hello", [|ReasonReact.element(Bar.make([||]))|]), -); -ReasonReact.element( - Foo.make( - ~className="hello", - [| - ReactDOMRe.createElement("div", [||]), - ReasonReact.element(Bar.make([||])), - |], - ), -); -ReasonReact.element(Foo.make(~className="hello", [|divRef, divRef|])); -ReasonReact.element(Foo.make(~className="hello", ~width="10", [||])); -ReasonReact.element( - Foo.make( - ~className="hello", - ~width="10", - [| - ReactDOMRe.createElement( - "li", - [|ReactDOMRe.createElement("p", [||])|], - ), - ReasonReact.element( - Foo.make([|ReasonReact.element(Bar.make([||]))|]), - ), - |], - ), -); -ReasonReact.element( - Foo.make( - ~className="hello", - ~comp=ReasonReact.element(Bar.make(~bar=1, [||])), - [| - ReactDOMRe.createElement("li", [||]), - ReasonReact.element(Bar.make(~bar=2, [||])), - |], - ), -); -ReasonReact.element( - Foo.make( - ~comp=ReasonReact.element(Bar.make([|divRef, divRef|])), - [|ReactDOMRe.createElement("li", [||])|], - ), -); -ReasonReact.element( - Foo.make( - ~comp= - ReasonReact.element( - Bar.make([|ReactDOMRe.createElement("div", [||])|]), - ), - [|ReactDOMRe.createElement("li", [||])|], - ), -); -"=== No wrapping for single child ==="; -ReasonReact.element(Foo.make(() => 1)); -ReasonReact.element(Foo.make(() => ReasonReact.element(Bar.make([||])))); -ReasonReact.element(Foo.make((1, 2))); -ReasonReact.element(Foo.make([|1|])); -ReasonReact.element(Foo.make([||])); -ReasonReact.element(Foo.make([||])); -ReasonReact.element(Foo.make(divRef)); -ReasonReact.element(Foo.make(ReactDOMRe.createElement("div", [||]))); -ReasonReact.element(Foo.make(ReasonReact.element(Bar.make([||])))); -ReasonReact.element(Foo.make(~className="hello", () => 1)); -ReasonReact.element(Foo.make(~className="hello", (1, 2))); -ReasonReact.element(Foo.make(~className="hello", [|1, 2|])); -ReasonReact.element(Foo.make(~className="hello", divRef)); -ReasonReact.element( - Foo.make( - ~comp=ReasonReact.element(Bar.make(divRef)), - ReactDOMRe.createElement("li", [||]), - ), -); -ReactDOMRe.createElement( - "div", - ~props=ReactDOMRe.props(~comp=ReasonReact.element(Bar.make(divRef)), ()), - [||], -); -"=== Special transform for DOM component with a single child spread ==="; -ReactDOMRe.createElementVariadic("div", divRefs); -ReactDOMRe.createElementVariadic("div", (() => divRefs)()); -ReactDOMRe.createElementVariadic( - "div", - ~props=ReactDOMRe.props(~className="hi", ()), - divRefs, -); -ReactDOMRe.createElementVariadic( - "div", - ~props=ReactDOMRe.props(~className="hi", ()), - (() => divRefs)(), -); -ReactDOMRe.createElement("div", [||]); -ReactDOMRe.createElement("div", [|ReactDOMRe.createElement("div", [||])|]); -"=== With ref/key ==="; -ReasonReact.element(~key="someKey", Foo.make(~className="hello", [||])); -ReasonReact.element( - ~key=Some("someKey"), - ~ref=Some(ref), - Foo.make(~className="hello", [||]), -); -ReasonReact.element( - ~key=?Some("someKey"), - ~ref=?Some(ref), - Foo.make(~className="hello", [||]), -); -ReasonReact.element( - ~key="someKey", - ~ref=Some(ref), - Foo.Bar.make(~className="hello", [|ReasonReact.element(Bar.make([||]))|]), -); -ReasonReact.element(Foo.make([||])); -"=== Fragment ==="; -ReactDOMRe.createElement(ReasonReact.fragment, [||]); -ReactDOMRe.createElement(ReasonReact.fragment, [|1|]); -ReactDOMRe.createElement( - ReasonReact.fragment, - [| - ReactDOMRe.createElement( - ReasonReact.fragment, - [|ReactDOMRe.createElement("div", [||])|], - ), - |], -); -ReactDOMRe.createElement( - ReasonReact.fragment, - [|ReactDOMRe.createElement(ReasonReact.fragment, [||]), 2|], -); -ReactDOMRe.createElement( - ReasonReact.fragment, - [|ReasonReact.element(Foo.make([|1|]))|], -); -ReactDOMRe.createElement( - ReasonReact.fragment, - [| - ReactDOMRe.createElement( - "div", - ~props= - ReactDOMRe.props(~comp=ReasonReact.element(Bar.make(divRef)), ()), - [||], - ), - |], -); diff --git a/miscTests/reactjs_jsx_ppx_tests/test1.re b/miscTests/reactjs_jsx_ppx_tests/test1.re deleted file mode 100644 index 7303ebaea..000000000 --- a/miscTests/reactjs_jsx_ppx_tests/test1.re +++ /dev/null @@ -1,153 +0,0 @@ - - -/* test setup dummy modules. These are here to make the transform pass the type checker. Also helps validating our transforms thanks to types */ - -module ReactDOMRe = { - let createElement = (tag, ~props=?, children: array('a)) => 1; - let createElementVariadic = (tag, ~props=?, children: array('a)) => 1; - let props = (~className=?, ~width=?, ~comp=?, ~compCallback=?, ()) => 1; -}; - -module Foo = { - let make = (~className=?, ~width=?, ~comp=?, ~bar=?, children) => 1; - let createElement = (~className=?, ~ref=?, ~key=?, ~width=?, ~comp=?, ~bar=?, ~children, ()) => 1; - module Bar = { - let make = (~className=?, children) => 1; - let createElement = (~className=?, ~ref=?, ~key=?, ~children, ()) => 1; - }; -}; - -module Bar = { - let make = (~bar=?, children) => 1; - let createElement = (~bar=?, ~children, ()) => 1; -}; - -module ReasonReact = { - let element = (~key=?, ~ref=?, component) => 1; - let fragment = (children: array('a)) => 1; -}; - -let divRef =
; -let divRefs = [|
|]; - -"=== DOM component ==="; - -
; - -
; - -
; - -
(
  • ) ( )
    ; - -
    )>
  • ; - -
    )>
  • ((fun () => ) ())
  • ; - -"=== Custom component ==="; - -; - -
    ; - - ; - -
    ; - - divRef divRef ; - -; - -
    ; - - ; - -
    ; - - divRef divRef ; - -; - - (
  • ) ( )
    ; - -)>
  • ; - - divRef divRef )>
  • ; - -
    )>
  • ; - -"=== No wrapping for single child ==="; - - ...(() => 1) ; - - ...(() => ()) ; - - ...(1, 2) ; - - ...[|1|] ; - - ...[||] ; - - ...[] ; - - ...divRef ; - - ...
    ; - - ... ; - - ...(() => 1) ; - - ...(1, 2) ; - - ...[|1, 2|] ; - - ...divRef ; - - ...divRef )> ...
  • ; - -
    ...divRef )>
    ; - -"=== Special transform for DOM component with a single child spread ==="; - -
    ...divRefs
    ; - -
    ...((() => divRefs)())
    ; - -
    ...divRefs
    ; - -
    ...((() => divRefs)())
    ; - -
    ...[]
    ; - -
    ...[
    ]
    ; - -"=== With ref/key ==="; - -; - -; - -; - - ; - -/* Upcoming JSX syntax (pre-ppx) will desugar to Foo.make instad of - Foo.createElement. Future-proof it in the ppx by transforming both to the - correct ReasonReact-specific call */ - -([@JSX] Foo.make(~children=[], ())); - -"=== Fragment ==="; - -<> ; - -<> 1 ; - -<> <>
    ; - -<> <> 2 ; - -<> 1 ; - -<>
    ...divRef )>
    ; diff --git a/miscTests/reactjs_jsx_ppx_tests/test2.re b/miscTests/reactjs_jsx_ppx_tests/test2.re deleted file mode 100644 index 53a4bce35..000000000 --- a/miscTests/reactjs_jsx_ppx_tests/test2.re +++ /dev/null @@ -1,153 +0,0 @@ -[@bs.config {foo, jsx: 2}]; - -/* test setup dummy modules. These are here to make the transform pass the type checker. Also helps validating our transforms thanks to types */ - -module ReactDOMRe = { - let createElement = (tag, ~props=?, children: array('a)) => 1; - let createElementVariadic = (tag, ~props=?, children: array('a)) => 1; - let props = (~className=?, ~width=?, ~comp=?, ~compCallback=?, ()) => 1; -}; - -module Foo = { - let make = (~className=?, ~width=?, ~comp=?, ~bar=?, children) => 1; - let createElement = (~className=?, ~ref=?, ~key=?, ~width=?, ~comp=?, ~bar=?, ~children, ()) => 1; - module Bar = { - let make = (~className=?, children) => 1; - let createElement = (~className=?, ~ref=?, ~key=?, ~children, ()) => 1; - }; -}; - -module Bar = { - let make = (~bar=?, children) => 1; - let createElement = (~bar=?, ~children, ()) => 1; -}; - -module ReasonReact = { - let element = (~key=?, ~ref=?, component) => 1; - let fragment = (children: array('a)) => 1; -}; - -let divRef =
    ; -let divRefs = [|
    |]; - -"=== DOM component ==="; - -
    ; - -
    ; - -
    ; - -
    (
  • ) ( )
    ; - -
    )>
  • ; - -
    )>
  • ((fun () => ) ())
  • ; - -"=== Custom component ==="; - -; - -
    ; - - ; - -
    ; - - divRef divRef ; - -; - -
    ; - - ; - -
    ; - - divRef divRef ; - -; - - (
  • ) ( )
    ; - -)>
  • ; - - divRef divRef )>
  • ; - -
    )>
  • ; - -"=== No wrapping for single child ==="; - - ...(() => 1) ; - - ...(() => ()) ; - - ...(1, 2) ; - - ...[|1|] ; - - ...[||] ; - - ...[] ; - - ...divRef ; - - ...
    ; - - ... ; - - ...(() => 1) ; - - ...(1, 2) ; - - ...[|1, 2|] ; - - ...divRef ; - - ...divRef )> ...
  • ; - -
    ...divRef )>
    ; - -"=== Special transform for DOM component with a single child spread ==="; - -
    ...divRefs
    ; - -
    ...((() => divRefs)())
    ; - -
    ...divRefs
    ; - -
    ...((() => divRefs)())
    ; - -
    ...[]
    ; - -
    ...[
    ]
    ; - -"=== With ref/key ==="; - -; - -; - -; - - ; - -/* Upcoming JSX syntax (pre-ppx) will desugar to Foo.make instad of - Foo.createElement. Future-proof it in the ppx by transforming both to the - correct ReasonReact-specific call */ - -([@JSX] Foo.make(~children=[], ())); - -"=== Fragment ==="; - -<> ; - -<> 1 ; - -<> <>
    ; - -<> <> 2 ; - -<> 1 ; - -<>
    ...divRef )>
    ; diff --git a/miscTests/rtopIntegrationTest.sh b/miscTests/rtopIntegrationTest.sh deleted file mode 100755 index 0a8c11918..000000000 --- a/miscTests/rtopIntegrationTest.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# Context: https://github.com/reasonml/reason/pull/674 - -# We can't directly call `rtop -stdin` because it circumvents what we're trying to -# test. See rtop.sh for the reason. We want to make sure utop's reason -# integration is legit, - -# `utop -stdin` wouldn't work because it somehow processes the code before -# invoking the reason plugin, so `echo someReasonCode | utop -stdin` would -# always error. - -export TERM= -# If it recognizes the terminal, OCaml uses escape codes to color the output. -# This breaks the validation of output. - -# Given the above, we're gonna test that utop integration works by piping code -# into it and asserting the existence of some output. -echo "Testing rtop..." -echo "let f = a => a;" \ -| rtop -I $HOME \ -| grep "let f: 'a => 'a = " > /dev/null -if [ $? -ne 0 ]; then - echo "rtop is failing! Failed to evaluate \`let f = a => a;\`" - exit 1 -fi - -echo "let f = (a) => 1 + \"hi\";" \ -| rtop -I $HOME \ -| grep "Error: This expression has type" > /dev/null -if [ $? -ne 0 ]; then - echo "rtop is failing! Failed to (correctly) error on \`let f = (a) => 1 + \"hi\";\`" - exit 1 -fi - -echo "Rtop successfully parsed stdinput and correctly errored on bad input" From 0c763cd00440dada442c025c05cdd0e407827a8c Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Fri, 24 Mar 2023 17:32:03 -0700 Subject: [PATCH 14/20] Drop the result dependency (#2703) * Drop the result dependency * remove more Result references * [ci skip] add changelog entry --- HISTORY.md | 2 + esy.json | 9 +- esy.lock/index.json | 175 +++-- flake.lock | 26 +- nix/default.nix | 3 - reason.esy.lock/index.json | 319 ++++----- reason.esy.lock/opam/biniou.1.2.1/opam | 45 -- .../opam/cppo.1.6.9}/opam | 40 +- .../opam/dot-merlin-reader.4.1/opam | 30 - .../opam/dot-merlin-reader.4.6/opam | 30 + reason.esy.lock/opam/dune.2.9.3/opam | 4 +- reason.esy.lock/opam/easy-format.1.3.2/opam | 46 -- reason.esy.lock/opam/menhir.20220210/opam | 2 +- reason.esy.lock/opam/menhirLib.20220210/opam | 2 +- reason.esy.lock/opam/menhirSdk.20220210/opam | 2 +- .../opam | 8 +- reason.esy.lock/opam/merlin-lib.4.8-414/opam | 34 + .../opam/merlin.4.8-414}/opam | 27 +- .../files/0001-Harden-test-for-OCaml-5.patch | 12 + .../{ocamlfind.1.9.3 => ocamlfind.1.9.6}/opam | 12 +- reason.esy.lock/opam/result.1.5/opam | 22 - reason.esy.lock/opam/seq.base/files/META.seq | 4 + .../opam/seq.base/files/seq.install | 3 + reason.esy.lock/opam/seq.base/opam | 15 + .../opam/{yojson.1.7.0 => yojson.2.0.2}/opam | 28 +- .../files/findlib.patch | 0 .../package.json | 0 reason.json | 12 +- rtop.esy.lock/index.json | 647 ++++++++---------- rtop.esy.lock/opam/bigarray-compat.1.1.0/opam | 26 - rtop.esy.lock/opam/biniou.1.2.1/opam | 45 -- rtop.esy.lock/opam/camomile.1.0.2/opam | 2 +- rtop.esy.lock/opam/charInfo_width.1.1.0/opam | 2 +- .../opam/cppo.1.6.9}/opam | 40 +- rtop.esy.lock/opam/dot-merlin-reader.4.1/opam | 30 - rtop.esy.lock/opam/dot-merlin-reader.4.6/opam | 30 + rtop.esy.lock/opam/dune.2.9.3/opam | 4 +- rtop.esy.lock/opam/easy-format.1.3.2/opam | 46 -- rtop.esy.lock/opam/lambda-term.3.2.0/opam | 4 +- .../opam/{lwt.5.5.0 => lwt.5.6.1}/opam | 16 +- .../{lwt_log.1.1.1 => lwt_log.1.1.2}/opam | 14 +- .../{lwt_react.1.1.5 => lwt_react.1.2.0}/opam | 9 +- rtop.esy.lock/opam/menhir.20220210/opam | 2 +- rtop.esy.lock/opam/menhirLib.20220210/opam | 2 +- rtop.esy.lock/opam/menhirSdk.20220210/opam | 2 +- .../opam | 8 +- rtop.esy.lock/opam/merlin-lib.4.8-414/opam | 34 + .../opam/merlin.4.8-414}/opam | 27 +- rtop.esy.lock/opam/mmap.1.2.0/opam | 29 - .../opam | 6 +- .../files/0001-Harden-test-for-OCaml-5.patch | 12 + .../{ocamlfind.1.9.3 => ocamlfind.1.9.6}/opam | 12 +- .../opam/{reason.3.8.0 => reason.3.8.2}/opam | 15 +- .../opam/{topkg.1.0.5 => topkg.1.0.7}/opam | 41 +- .../opam/{utop.2.9.0 => utop.2.9.2}/opam | 26 +- .../opam/{yojson.1.7.0 => yojson.2.0.2}/opam | 28 +- .../files/winpatch.patch | 0 .../package.json | 0 .../files/findlib.patch | 0 .../package.json | 0 rtop.json | 14 +- src/reason-parser/reason_errors.ml | 4 +- src/reason-parser/reason_errors.mli | 2 +- src/refmt/printer_maker.ml | 6 +- src/vendored-omp/src/dune | 2 +- .../src/migrate_parsetree_ast_io.ml | 1 - .../src/migrate_parsetree_ast_io.mli | 1 - 67 files changed, 910 insertions(+), 1191 deletions(-) delete mode 100644 reason.esy.lock/opam/biniou.1.2.1/opam rename {rtop.esy.lock/opam/cppo.1.6.8 => reason.esy.lock/opam/cppo.1.6.9}/opam (58%) delete mode 100644 reason.esy.lock/opam/dot-merlin-reader.4.1/opam create mode 100644 reason.esy.lock/opam/dot-merlin-reader.4.6/opam delete mode 100644 reason.esy.lock/opam/easy-format.1.3.2/opam rename reason.esy.lock/opam/{merlin-extend.0.6 => merlin-extend.0.6.1}/opam (73%) create mode 100644 reason.esy.lock/opam/merlin-lib.4.8-414/opam rename {rtop.esy.lock/opam/merlin.4.4-412 => reason.esy.lock/opam/merlin.4.8-414}/opam (76%) create mode 100644 reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch rename reason.esy.lock/opam/{ocamlfind.1.9.3 => ocamlfind.1.9.6}/opam (70%) delete mode 100644 reason.esy.lock/opam/result.1.5/opam create mode 100644 reason.esy.lock/opam/seq.base/files/META.seq create mode 100644 reason.esy.lock/opam/seq.base/files/seq.install create mode 100644 reason.esy.lock/opam/seq.base/opam rename reason.esy.lock/opam/{yojson.1.7.0 => yojson.2.0.2}/opam (56%) rename reason.esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.3_opam_override => opam__s__ocamlfind_opam__c__1.9.6_opam_override}/files/findlib.patch (100%) rename reason.esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.3_opam_override => opam__s__ocamlfind_opam__c__1.9.6_opam_override}/package.json (100%) delete mode 100644 rtop.esy.lock/opam/bigarray-compat.1.1.0/opam delete mode 100644 rtop.esy.lock/opam/biniou.1.2.1/opam rename {reason.esy.lock/opam/cppo.1.6.8 => rtop.esy.lock/opam/cppo.1.6.9}/opam (58%) delete mode 100644 rtop.esy.lock/opam/dot-merlin-reader.4.1/opam create mode 100644 rtop.esy.lock/opam/dot-merlin-reader.4.6/opam delete mode 100644 rtop.esy.lock/opam/easy-format.1.3.2/opam rename rtop.esy.lock/opam/{lwt.5.5.0 => lwt.5.6.1}/opam (67%) rename rtop.esy.lock/opam/{lwt_log.1.1.1 => lwt_log.1.1.2}/opam (53%) rename rtop.esy.lock/opam/{lwt_react.1.1.5 => lwt_react.1.2.0}/opam (63%) rename rtop.esy.lock/opam/{merlin-extend.0.6 => merlin-extend.0.6.1}/opam (73%) create mode 100644 rtop.esy.lock/opam/merlin-lib.4.8-414/opam rename {reason.esy.lock/opam/merlin.4.4-412 => rtop.esy.lock/opam/merlin.4.8-414}/opam (76%) delete mode 100644 rtop.esy.lock/opam/mmap.1.2.0/opam rename rtop.esy.lock/opam/{ocamlbuild.0.14.1 => ocamlbuild.0.14.2}/opam (83%) create mode 100644 rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch rename rtop.esy.lock/opam/{ocamlfind.1.9.3 => ocamlfind.1.9.6}/opam (70%) rename rtop.esy.lock/opam/{reason.3.8.0 => reason.3.8.2}/opam (59%) rename rtop.esy.lock/opam/{topkg.1.0.5 => topkg.1.0.7}/opam (66%) rename rtop.esy.lock/opam/{utop.2.9.0 => utop.2.9.2}/opam (69%) rename rtop.esy.lock/opam/{yojson.1.7.0 => yojson.2.0.2}/opam (56%) rename rtop.esy.lock/overrides/{opam__s__ocamlbuild_opam__c__0.14.1_opam_override => opam__s__ocamlbuild_opam__c__0.14.2_opam_override}/files/winpatch.patch (100%) rename rtop.esy.lock/overrides/{opam__s__ocamlbuild_opam__c__0.14.1_opam_override => opam__s__ocamlbuild_opam__c__0.14.2_opam_override}/package.json (100%) rename rtop.esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.3_opam_override => opam__s__ocamlfind_opam__c__1.9.6_opam_override}/files/findlib.patch (100%) rename rtop.esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.3_opam_override => opam__s__ocamlfind_opam__c__1.9.6_opam_override}/package.json (100%) diff --git a/HISTORY.md b/HISTORY.md index fd45cb33e..b2ce46405 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,8 @@ - Fix missing patterns around contraint pattern (a pattern with a type annotation). - Fix top level extension printing +- Remove the dependency on the `result` package, which isn't needed for OCaml + 4.03 and above (@anmonteiro) [2703](https://github.com/reasonml/reason/pull/2703) ## 3.8.2 diff --git a/esy.json b/esy.json index 8070fbee2..880ecd635 100644 --- a/esy.json +++ b/esy.json @@ -11,11 +11,10 @@ "@opam/merlin-extend": " >= 0.6", "@opam/ocamlfind": "1.9.5", "@opam/ppx_derivers": "< 2.0.0", - "@opam/result": "*", "@opam/utop": " >= 1.17.0", - "ocaml": " >= 4.2.0 < 4.15.0" + "ocaml": " >= 4.3.0 < 4.15.0" }, - "devDependencies": { "@opam/odoc": "*", "ocaml": "~4.12.0" }, + "devDependencies": { "@opam/odoc": "*", "ocaml": "~4.14.0" }, "notes-ctd": [ "This is how you make an esy monorepo for development, but then release the monorepo as many individual packages:", "1. Create a packageName-dev esy.json at the root and list the sum of all dependencies", @@ -25,7 +24,7 @@ "5. Copy ./scripts/esy-prepublish.js in to your repo and change packages= to your set of packages." ], "esy": { - "build": [ [ "dune", "build", "-p", "reason,rtop" ] ], + "build": [ [ "dune", "build", "-p", "reason,rtop", "--disable-promotion" ] ], "install": [ [ "esy-installer", "reason.install" ], [ "esy-installer", "rtop.install" ] @@ -43,7 +42,7 @@ "@opam/camomile", "@opam/lambda-term", "@opam/lwt", "@opam/lwt_log", "@opam/lwt_react", "@opam/menhir", "@opam/mmap", "@opam/ocplib-endian", "@opam/ocamlfind", "@opam/ppx_derivers", - "@opam/react", "@opam/result", "@opam/seq", "@opam/charInfo_width", + "@opam/react", "@opam/seq", "@opam/charInfo_width", "@opam/utop", "@opam/zed", "ocaml" ], "rewritePrefix": true diff --git a/esy.lock/index.json b/esy.lock/index.json index 8ce1a3c43..2701b6ee7 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "8e1a343c58ed6dd5c0179b308da5df90", + "checksum": "c48ffab0edbecaf472e23a393cb94f51", "root": "reason-cli@link-dev:./esy.json", "node": { "reason-cli@link-dev:./esy.json": { @@ -9,8 +9,7 @@ "source": { "type": "link-dev", "path": ".", "manifest": "esy.json" }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/utop@opam:2.11.0@bd245e47", - "@opam/result@opam:1.5@1c6a6533", + "ocaml@4.14.0@d41d8cd9", "@opam/utop@opam:2.11.0@bd245e47", "@opam/ppx_derivers@opam:1.2.1@e2cbad12", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/merlin-extend@opam:0.6.1@7d979feb", @@ -18,17 +17,17 @@ "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:3.6.2@e55a9c34" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/odoc@opam:2.2.0@020767ad" + "ocaml@4.14.0@d41d8cd9", "@opam/odoc@opam:2.2.0@020767ad" ] }, - "ocaml@4.12.1001@d41d8cd9": { - "id": "ocaml@4.12.1001@d41d8cd9", + "ocaml@4.14.0@d41d8cd9": { + "id": "ocaml@4.14.0@d41d8cd9", "name": "ocaml", - "version": "4.12.1001", + "version": "4.14.0", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.12.1001.tgz#sha1:6fb89973e5f2e5c3131e4b95b76dfbccceb2c050" + "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.14.0.tgz#sha1:619afaeabcc8732cc1f4014a7251403927f44021" ] }, "overrides": [], @@ -53,14 +52,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/uuseg@opam:15.0.0@14085231", "@opam/uucp@opam:15.0.0@55460339", "@opam/uchar@opam:0.0.2@aedf91f9", "@opam/result@opam:1.5@1c6a6533", "@opam/react@opam:1.2.2@e0f4480e", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/uuseg@opam:15.0.0@14085231", "@opam/uucp@opam:15.0.0@55460339", "@opam/uchar@opam:0.0.2@aedf91f9", "@opam/result@opam:1.5@1c6a6533", "@opam/react@opam:1.2.2@e0f4480e", @@ -85,13 +84,13 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/cmdliner@opam:1.1.1@03763729", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/uuseg@opam:15.0.0@14085231": { "id": "@opam/uuseg@opam:15.0.0@14085231", @@ -111,7 +110,7 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/uucp@opam:15.0.0@55460339", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", @@ -119,7 +118,7 @@ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/uucp@opam:15.0.0@55460339" + "ocaml@4.14.0@d41d8cd9", "@opam/uucp@opam:15.0.0@55460339" ] }, "@opam/uucp@opam:15.0.0@55460339": { @@ -140,14 +139,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/cmdliner@opam:1.1.1@03763729", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/utop@opam:2.11.0@bd245e47": { "id": "@opam/utop@opam:2.11.0@bd245e47", @@ -167,7 +166,7 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", + "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", "@opam/react@opam:1.2.2@e0f4480e", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/lwt_react@opam:1.2.0@4253a145", @@ -179,7 +178,7 @@ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", + "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", "@opam/react@opam:1.2.2@e0f4480e", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/lwt_react@opam:1.2.0@4253a145", @@ -213,10 +212,10 @@ } ], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28", + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/tyxml@opam:4.5.0@0a609297": { "id": "@opam/tyxml@opam:4.5.0@0a609297", @@ -236,12 +235,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/seq@opam:base@d8d7de1d", "@opam/re@opam:1.10.4@c4910ba6", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", + "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/seq@opam:base@d8d7de1d", "@opam/re@opam:1.10.4@c4910ba6", "@opam/dune@opam:3.6.2@e55a9c34" ] @@ -264,11 +263,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/topkg@opam:1.0.7@7ee47d76": { @@ -289,12 +288,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74", + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28" ] }, "@opam/seq@opam:base@d8d7de1d": { @@ -312,9 +311,9 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/result@opam:1.5@1c6a6533": { "id": "@opam/result@opam:1.5@1c6a6533", @@ -334,11 +333,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/react@opam:1.2.2@e0f4480e": { @@ -359,12 +358,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/re@opam:1.10.4@c4910ba6": { "id": "@opam/re@opam:1.10.4@c4910ba6", @@ -384,11 +383,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", "@opam/dune@opam:3.6.2@e55a9c34" ] }, @@ -410,11 +409,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/odoc-parser@opam:2.0.0@a08011a0": { @@ -435,14 +434,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/camlp-streams@opam:5.0.1@daaa0f94", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/camlp-streams@opam:5.0.1@daaa0f94", "@opam/astring@opam:0.8.5@1300cee8" @@ -466,7 +465,7 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/tyxml@opam:4.5.0@0a609297", + "ocaml@4.14.0@d41d8cd9", "@opam/tyxml@opam:4.5.0@0a609297", "@opam/result@opam:1.5@1c6a6533", "@opam/odoc-parser@opam:2.0.0@a08011a0", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.9.0@87213963", @@ -476,7 +475,7 @@ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/tyxml@opam:4.5.0@0a609297", + "ocaml@4.14.0@d41d8cd9", "@opam/tyxml@opam:4.5.0@0a609297", "@opam/result@opam:1.5@1c6a6533", "@opam/odoc-parser@opam:2.0.0@a08011a0", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.9.0@87213963", @@ -503,13 +502,13 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-bytes@opam:base@19d0c2ff", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/base-bytes@opam:base@19d0c2ff" ] }, @@ -536,9 +535,9 @@ } ], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/ocamlbuild@opam:0.14.2@c6163b28": { "id": "@opam/ocamlbuild@opam:0.14.2@c6163b28", @@ -563,9 +562,9 @@ } ], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/mew_vi@opam:0.5.0@cf66c299": { "id": "@opam/mew_vi@opam:0.5.0@cf66c299", @@ -585,12 +584,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.6.2@e55a9c34" ] }, @@ -612,12 +611,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", + "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", + "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34" ] }, @@ -639,11 +638,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/menhirSdk@opam:20220210@fe146ed3": { @@ -664,11 +663,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/menhirLib@opam:20220210@9afeb270": { @@ -689,11 +688,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/menhir@opam:20220210@ff5ea9a7": { @@ -714,12 +713,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", "@opam/menhirLib@opam:20220210@9afeb270", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", "@opam/menhirLib@opam:20220210@9afeb270", "@opam/dune@opam:3.6.2@e55a9c34" ] @@ -742,12 +741,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.6.2@e55a9c34" ] }, @@ -769,7 +768,7 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", + "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", "@opam/dune-configurator@opam:3.7.0@4fa6f76e", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-unix@opam:base@87d0b2eb", @@ -777,7 +776,7 @@ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", + "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", "@opam/dune-configurator@opam:3.7.0@4fa6f76e", "@opam/dune@opam:3.6.2@e55a9c34" ] @@ -800,7 +799,7 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/fmt@opam:0.9.0@87213963", @@ -808,7 +807,7 @@ "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/lambda-term@opam:3.3.1@ee145aff": { "id": "@opam/lambda-term@opam:3.3.1@ee145aff", @@ -828,7 +827,7 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", + "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew_vi@opam:0.5.0@cf66c299", "@opam/lwt_react@opam:1.2.0@4253a145", @@ -836,7 +835,7 @@ "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", + "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew_vi@opam:0.5.0@cf66c299", "@opam/lwt_react@opam:1.2.0@4253a145", @@ -862,14 +861,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/astring@opam:0.8.5@1300cee8" + "ocaml@4.14.0@d41d8cd9", "@opam/astring@opam:0.8.5@1300cee8" ] }, "@opam/fmt@opam:0.9.0@87213963": { @@ -890,14 +889,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@opam/cmdliner@opam:1.1.1@03763729", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/fix@opam:20220121@17b9a1a4": { "id": "@opam/fix@opam:20220121@17b9a1a4", @@ -917,11 +916,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/dune-configurator@opam:3.7.0@4fa6f76e": { @@ -942,13 +941,13 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/csexp@opam:1.5.1@8a8fb3a7", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/csexp@opam:1.5.1@8a8fb3a7", "@opam/base-unix@opam:base@87d0b2eb" ] @@ -971,12 +970,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084" ] }, @@ -998,11 +997,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/cppo@opam:1.6.9@db929a12": { @@ -1023,12 +1022,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@opam/base-unix@opam:base@87d0b2eb" ] }, @@ -1050,9 +1049,9 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/camlp-streams@opam:5.0.1@daaa0f94": { "id": "@opam/camlp-streams@opam:5.0.1@daaa0f94", @@ -1072,11 +1071,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" ] }, "@opam/base-unix@opam:base@87d0b2eb": { @@ -1128,11 +1127,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74", + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74" ] }, "@opam/astring@opam:0.8.5@1300cee8": { @@ -1153,12 +1152,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.1001@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.1001@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@esy-ocaml/substs@0.0.1@d41d8cd9": { "id": "@esy-ocaml/substs@0.0.1@d41d8cd9", diff --git a/flake.lock b/flake.lock index 129e3f017..80d7f1920 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1676283394, - "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "owner": "numtide", "repo": "flake-utils", - "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "type": "github" }, "original": { @@ -17,11 +17,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1676294984, - "narHash": "sha256-hdLUa/3RH1VJ+gMUysQE0JGM4F2Q/tIIFbtoxAOurJQ=", + "lastModified": 1678109515, + "narHash": "sha256-C2X+qC80K2C1TOYZT8nabgo05Dw2HST/pSn6s+n6BO8=", "owner": "numtide", "repo": "nix-filter", - "rev": "fc282c5478e4141842f9644c239a41cfe9586732", + "rev": "aa9ff6ce4a7f19af6415fb3721eaa513ea6c763c", "type": "github" }, "original": { @@ -38,11 +38,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1677883479, - "narHash": "sha256-ehAvAzzRzyvSfoPv2jQI5pSaasUVJa5V8oe885YcyYA=", + "lastModified": 1679617087, + "narHash": "sha256-rDcPKOEAsj9o8UeT5UMMKOURhJcM7eGC3Buzd+T69mw=", "owner": "nix-ocaml", "repo": "nix-overlays", - "rev": "f332166f76369fec30ae6ae905b7226dbf1555fe", + "rev": "2b78ff251eec962ba83b0af72c7b9e02f6627717", "type": "github" }, "original": { @@ -53,17 +53,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1677845674, - "narHash": "sha256-9wy/QFibdJUp7WQUe50U5bZKocg3OOHBpJhpl5ddfbE=", + "lastModified": 1679542234, + "narHash": "sha256-NrUIxT2MtOcRDLq+bAFqAUno4w9Ds7UDaKQj+3yJPQk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dcc47fef8bd1e91baeab8fb34a35337ab8f3a3fd", + "rev": "99265ac4a8c83e4109f9cfc7c911707b86437b67", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "dcc47fef8bd1e91baeab8fb34a35337ab8f3a3fd", + "rev": "99265ac4a8c83e4109f9cfc7c911707b86437b67", "type": "github" } }, diff --git a/nix/default.nix b/nix/default.nix index 257c99aec..a237890e2 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -23,10 +23,7 @@ ocamlPackages.buildDunePackage { menhirLib cppo fix - result ppx_derivers - ppxlib - # ocaml-migrate-parsetree ]; } diff --git a/reason.esy.lock/index.json b/reason.esy.lock/index.json index c5dc1030e..3a04494e3 100644 --- a/reason.esy.lock/index.json +++ b/reason.esy.lock/index.json @@ -1,73 +1,66 @@ { - "checksum": "7ce4dc8317ce425e522769b0d398412d", + "checksum": "60b94a2449764224ad9320278e98a208", "root": "@esy-ocaml/reason@link-dev:./reason.json", "node": { - "ocaml@4.12.0@d41d8cd9": { - "id": "ocaml@4.12.0@d41d8cd9", + "ocaml@4.14.0@d41d8cd9": { + "id": "ocaml@4.14.0@d41d8cd9", "name": "ocaml", - "version": "4.12.0", + "version": "4.14.0", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.12.0.tgz#sha1:2a979f37535faaded8aa3fdf82b6f16f2c71e284" + "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.14.0.tgz#sha1:619afaeabcc8732cc1f4014a7251403927f44021" ] }, "overrides": [], "dependencies": [], "devDependencies": [] }, - "@opam/yojson@opam:1.7.0@69d87312": { - "id": "@opam/yojson@opam:1.7.0@69d87312", + "@opam/yojson@opam:2.0.2@eb65f292": { + "id": "@opam/yojson@opam:2.0.2@eb65f292", "name": "@opam/yojson", - "version": "opam:1.7.0", + "version": "opam:2.0.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/b8/b89d39ca3f8c532abe5f547ad3b8f84d#md5:b89d39ca3f8c532abe5f547ad3b8f84d", - "archive:https://github.com/ocaml-community/yojson/releases/download/1.7.0/yojson-1.7.0.tbz#md5:b89d39ca3f8c532abe5f547ad3b8f84d" + "archive:https://opam.ocaml.org/cache/sha256/87/876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b", + "archive:https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" ], "opam": { "name": "yojson", - "version": "1.7.0", - "path": "reason.esy.lock/opam/yojson.1.7.0" + "version": "2.0.2", + "path": "reason.esy.lock/opam/yojson.2.0.2" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/cppo@opam:1.6.8@7e48217d", - "@opam/biniou@opam:1.2.1@420bda02", + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/biniou@opam:1.2.1@420bda02" + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/result@opam:1.5@1c6a6533": { - "id": "@opam/result@opam:1.5@1c6a6533", - "name": "@opam/result", - "version": "opam:1.5", + "@opam/seq@opam:base@d8d7de1d": { + "id": "@opam/seq@opam:base@d8d7de1d", + "name": "@opam/seq", + "version": "opam:base", "source": { "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/1b/1b82dec78849680b49ae9a8a365b831b#md5:1b82dec78849680b49ae9a8a365b831b", - "archive:https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz#md5:1b82dec78849680b49ae9a8a365b831b" - ], + "source": [ "no-source:" ], "opam": { - "name": "result", - "version": "1.5", - "path": "reason.esy.lock/opam/result.1.5" + "name": "seq", + "version": "base", + "path": "reason.esy.lock/opam/seq.base" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" - ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/ppx_derivers@opam:1.2.1@e2cbad12": { "id": "@opam/ppx_derivers@opam:1.2.1@e2cbad12", @@ -87,97 +80,124 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/ocamlfind@opam:1.9.3@781b30f3": { - "id": "@opam/ocamlfind@opam:1.9.3@781b30f3", + "@opam/ocamlfind@opam:1.9.6@d090a512": { + "id": "@opam/ocamlfind@opam:1.9.6@d090a512", "name": "@opam/ocamlfind", - "version": "opam:1.9.3", + "version": "opam:1.9.6", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/24/24047dd8a0da5322253de9b7aa254e42#md5:24047dd8a0da5322253de9b7aa254e42", - "archive:http://download.camlcity.org/download/findlib-1.9.3.tar.gz#md5:24047dd8a0da5322253de9b7aa254e42" + "archive:https://opam.ocaml.org/cache/md5/96/96c6ee50a32cca9ca277321262dbec57#md5:96c6ee50a32cca9ca277321262dbec57", + "archive:http://download.camlcity.org/download/findlib-1.9.6.tar.gz#md5:96c6ee50a32cca9ca277321262dbec57" ], "opam": { "name": "ocamlfind", - "version": "1.9.3", - "path": "reason.esy.lock/opam/ocamlfind.1.9.3" + "version": "1.9.6", + "path": "reason.esy.lock/opam/ocamlfind.1.9.6" } }, "overrides": [ { "opamoverride": - "reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override" + "reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override" } ], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] + }, + "@opam/merlin-lib@opam:4.8-414@ece13977": { + "id": "@opam/merlin-lib@opam:4.8-414@ece13977", + "name": "@opam/merlin-lib", + "version": "opam:4.8-414", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", + "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" + ], + "opam": { + "name": "merlin-lib", + "version": "4.8-414", + "path": "reason.esy.lock/opam/merlin-lib.4.8-414" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.0@d41d8cd9" ] + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/csexp@opam:1.5.1@8a8fb3a7" + ] }, - "@opam/merlin-extend@opam:0.6@88755c91": { - "id": "@opam/merlin-extend@opam:0.6@88755c91", + "@opam/merlin-extend@opam:0.6.1@7d979feb": { + "id": "@opam/merlin-extend@opam:0.6.1@7d979feb", "name": "@opam/merlin-extend", - "version": "opam:0.6", + "version": "opam:0.6.1", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/c2/c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43#sha256:c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43", - "archive:https://github.com/let-def/merlin-extend/releases/download/v0.6/merlin-extend-v0.6.tbz#sha256:c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43" + "archive:https://opam.ocaml.org/cache/sha256/5e/5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7", + "archive:https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" ], "opam": { "name": "merlin-extend", - "version": "0.6", - "path": "reason.esy.lock/opam/merlin-extend.0.6" + "version": "0.6.1", + "path": "reason.esy.lock/opam/merlin-extend.0.6.1" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/cppo@opam:1.6.8@7e48217d", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/merlin@opam:4.4-412@c7695ce2": { - "id": "@opam/merlin@opam:4.4-412@c7695ce2", + "@opam/merlin@opam:4.8-414@bb3fbab2": { + "id": "@opam/merlin@opam:4.8-414@bb3fbab2", "name": "@opam/merlin", - "version": "opam:4.4-412", + "version": "opam:4.8-414", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/16/16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3#sha256:16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3", - "archive:https://github.com/ocaml/merlin/releases/download/v4.4-412/merlin-4.4-412.tbz#sha256:16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3" + "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", + "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" ], "opam": { "name": "merlin", - "version": "4.4-412", - "path": "reason.esy.lock/opam/merlin.4.4-412" + "version": "4.8-414", + "path": "reason.esy.lock/opam/merlin.4.8-414" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/dot-merlin-reader@opam:4.1@84436e1c", - "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dot-merlin-reader@opam:4.6@85c88957", + "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/dot-merlin-reader@opam:4.1@84436e1c", - "@opam/csexp@opam:1.5.1@8a8fb3a7" + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dot-merlin-reader@opam:4.6@85c88957" ] }, - "@opam/menhirSdk@opam:20220210@b8921e41": { - "id": "@opam/menhirSdk@opam:20220210@b8921e41", + "@opam/menhirSdk@opam:20220210@fe146ed3": { + "id": "@opam/menhirSdk@opam:20220210@fe146ed3", "name": "@opam/menhirSdk", "version": "opam:20220210", "source": { @@ -194,15 +214,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/menhirLib@opam:20220210@e6562f4f": { - "id": "@opam/menhirLib@opam:20220210@e6562f4f", + "@opam/menhirLib@opam:20220210@9afeb270": { + "id": "@opam/menhirLib@opam:20220210@9afeb270", "name": "@opam/menhirLib", "version": "opam:20220210", "source": { @@ -219,15 +239,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/menhir@opam:20220210@ff87a93b": { - "id": "@opam/menhir@opam:20220210@ff87a93b", + "@opam/menhir@opam:20220210@ff5ea9a7": { + "id": "@opam/menhir@opam:20220210@ff5ea9a7", "name": "@opam/menhir", "version": "opam:20220210", "source": { @@ -244,14 +264,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@b8921e41", - "@opam/menhirLib@opam:20220210@e6562f4f", - "@opam/dune@opam:2.9.3@f57a6d69", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "@opam/menhirLib@opam:20220210@9afeb270", + "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@b8921e41", - "@opam/menhirLib@opam:20220210@e6562f4f", - "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "@opam/menhirLib@opam:20220210@9afeb270", + "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/fix@opam:20220121@17b9a1a4": { @@ -272,40 +292,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" - ] - }, - "@opam/easy-format@opam:1.3.2@1ea9f987": { - "id": "@opam/easy-format@opam:1.3.2@1ea9f987", - "name": "@opam/easy-format", - "version": "opam:1.3.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/34/3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926#sha256:3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926", - "archive:https://github.com/mjambon/easy-format/releases/download/1.3.2/easy-format-1.3.2.tbz#sha256:3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926" - ], - "opam": { - "name": "easy-format", - "version": "1.3.2", - "path": "reason.esy.lock/opam/easy-format.1.3.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/dune@opam:2.9.3@f57a6d69": { - "id": "@opam/dune@opam:2.9.3@f57a6d69", + "@opam/dune@opam:2.9.3@4d52c673": { + "id": "@opam/dune@opam:2.9.3@4d52c673", "name": "@opam/dune", "version": "opam:2.9.3", "source": { @@ -322,44 +317,41 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084" ] }, - "@opam/dot-merlin-reader@opam:4.1@84436e1c": { - "id": "@opam/dot-merlin-reader@opam:4.1@84436e1c", + "@opam/dot-merlin-reader@opam:4.6@85c88957": { + "id": "@opam/dot-merlin-reader@opam:4.6@85c88957", "name": "@opam/dot-merlin-reader", - "version": "opam:4.1", + "version": "opam:4.6", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/14/14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd#sha256:14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd", - "archive:https://github.com/ocaml/merlin/releases/download/v4.1/dot-merlin-reader-v4.1.tbz#sha256:14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd" + "archive:https://opam.ocaml.org/cache/sha256/02/02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce", + "archive:https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" ], "opam": { "name": "dot-merlin-reader", - "version": "4.1", - "path": "reason.esy.lock/opam/dot-merlin-reader.4.1" + "version": "4.6", + "path": "reason.esy.lock/opam/dot-merlin-reader.4.6" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/csexp@opam:1.5.1@8a8fb3a7", - "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/csexp@opam:1.5.1@8a8fb3a7" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/csexp@opam:1.5.1@8a8fb3a7": { @@ -380,66 +372,40 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/cppo@opam:1.6.8@7e48217d": { - "id": "@opam/cppo@opam:1.6.8@7e48217d", + "@opam/cppo@opam:1.6.9@db929a12": { + "id": "@opam/cppo@opam:1.6.9@db929a12", "name": "@opam/cppo", - "version": "opam:1.6.8", + "version": "opam:1.6.9", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/fe/fed401197d86f9089e89f6cbdf1d660d#md5:fed401197d86f9089e89f6cbdf1d660d", - "archive:https://github.com/ocaml-community/cppo/archive/v1.6.8.tar.gz#md5:fed401197d86f9089e89f6cbdf1d660d" + "archive:https://opam.ocaml.org/cache/md5/d2/d23ffe85ac7dc8f0afd1ddf622770d09#md5:d23ffe85ac7dc8f0afd1ddf622770d09", + "archive:https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz#md5:d23ffe85ac7dc8f0afd1ddf622770d09" ], "opam": { "name": "cppo", - "version": "1.6.8", - "path": "reason.esy.lock/opam/cppo.1.6.8" + "version": "1.6.9", + "path": "reason.esy.lock/opam/cppo.1.6.9" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@opam/base-unix@opam:base@87d0b2eb" ] }, - "@opam/biniou@opam:1.2.1@420bda02": { - "id": "@opam/biniou@opam:1.2.1@420bda02", - "name": "@opam/biniou", - "version": "opam:1.2.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/35/35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335#sha256:35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335", - "archive:https://github.com/mjambon/biniou/releases/download/1.2.1/biniou-1.2.1.tbz#sha256:35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335" - ], - "opam": { - "name": "biniou", - "version": "1.2.1", - "path": "reason.esy.lock/opam/biniou.1.2.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69" - ] - }, "@opam/base-unix@opam:base@87d0b2eb": { "id": "@opam/base-unix@opam:base@87d0b2eb", "name": "@opam/base-unix", @@ -499,15 +465,14 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/merlin-extend@opam:0.6@88755c91", - "@opam/menhir@opam:20220210@ff87a93b", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/ppx_derivers@opam:1.2.1@e2cbad12", + "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/merlin-extend@opam:0.6.1@7d979feb", + "@opam/menhir@opam:20220210@ff5ea9a7", + "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@4d52c673" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/merlin@opam:4.4-412@c7695ce2" + "ocaml@4.14.0@d41d8cd9", "@opam/merlin@opam:4.8-414@bb3fbab2" ] } } diff --git a/reason.esy.lock/opam/biniou.1.2.1/opam b/reason.esy.lock/opam/biniou.1.2.1/opam deleted file mode 100644 index ec7028f25..000000000 --- a/reason.esy.lock/opam/biniou.1.2.1/opam +++ /dev/null @@ -1,45 +0,0 @@ -opam-version: "2.0" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} - ["dune" "build" "-p" name "@doc"] {with-doc} -] -maintainer: ["martin@mjambon.com"] -authors: ["Martin Jambon"] -bug-reports: "https://github.com/mjambon/biniou/issues" -homepage: "https://github.com/mjambon/biniou" -doc: "https://mjambon.github.io/biniou/" -license: "BSD-3-Clause" -dev-repo: "git+https://github.com/mjambon/biniou.git" -synopsis: - "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve" -description: """ - -Biniou (pronounced "be new") is a binary data format designed for speed, safety, -ease of use and backward compatibility as protocols evolve. Biniou is vastly -equivalent to JSON in terms of functionality but allows implementations several -times faster (4 times faster than yojson), with 25-35% space savings. - -Biniou data can be decoded into human-readable form without knowledge of type -definitions except for field and variant names which are represented by 31-bit -hashes. A program named bdump is provided for routine visualization of biniou -data files. - -The program atdgen is used to derive OCaml-Biniou serializers and deserializers -from type definitions. - -Biniou format specification: mjambon.github.io/atdgen-doc/biniou-format.txt""" -depends: [ - "easy-format" - "dune" {>= "1.10"} - "ocaml" {>= "4.02.3"} -] -url { - src: - "https://github.com/mjambon/biniou/releases/download/1.2.1/biniou-1.2.1.tbz" - checksum: [ - "sha256=35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335" - "sha512=82670cc77bf3e869ee26e5fbe5a5affa45a22bc8b6c4bd7e85473912780e0111baca59b34a2c14feae3543ce6e239d7fddaeab24b686a65bfe642cdb91d27ebf" - ] -} diff --git a/rtop.esy.lock/opam/cppo.1.6.8/opam b/reason.esy.lock/opam/cppo.1.6.9/opam similarity index 58% rename from rtop.esy.lock/opam/cppo.1.6.8/opam rename to reason.esy.lock/opam/cppo.1.6.9/opam index c9d7f68f7..9c51ec6d8 100644 --- a/rtop.esy.lock/opam/cppo.1.6.8/opam +++ b/reason.esy.lock/opam/cppo.1.6.9/opam @@ -1,37 +1,39 @@ opam-version: "2.0" -maintainer: "martin@mjambon.com" +synopsis: "Code preprocessor like cpp for OCaml" +description: """\ +Cppo is an equivalent of the C preprocessor for OCaml programs. +It allows the definition of simple macros and file inclusion. + +Cppo is: + +* more OCaml-friendly than cpp +* easy to learn without consulting a manual +* reasonably fast +* simple to install and to maintain""" +maintainer: [ + "Martin Jambon " "Yishuai Li " +] authors: "Martin Jambon" license: "BSD-3-Clause" homepage: "https://github.com/ocaml-community/cppo" -doc: "https://ocaml-community.github.io/cppo/" +doc: "https://ocaml-community.github.io/cppo" bug-reports: "https://github.com/ocaml-community/cppo/issues" depends: [ "ocaml" {>= "4.02.3"} - "dune" {>= "1.0"} + "dune" {>= "1.10"} "base-unix" ] build: [ ["dune" "subst"] {dev} ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "-p" name "@doc"] {with-doc} ] dev-repo: "git+https://github.com/ocaml-community/cppo.git" -synopsis: "Code preprocessor like cpp for OCaml" -description: """ -Cppo is an equivalent of the C preprocessor for OCaml programs. -It allows the definition of simple macros and file inclusion. - -Cppo is: - -* more OCaml-friendly than cpp -* easy to learn without consulting a manual -* reasonably fast -* simple to install and to maintain -""" url { - src: "https://github.com/ocaml-community/cppo/archive/v1.6.8.tar.gz" + src: "https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz" checksum: [ - "md5=fed401197d86f9089e89f6cbdf1d660d" - "sha512=069bbe0ef09c03b0dc4b5795f909c3ef872fe99c6f1e6704a0fa97594b1570b3579226ec67fe11d696ccc349a4585055bbaf07c65eff423aa45af28abf38c858" + "md5=d23ffe85ac7dc8f0afd1ddf622770d09" + "sha512=26ff5a7b7f38c460661974b23ca190f0feae3a99f1974e0fd12ccf08745bd7d91b7bc168c70a5385b837bfff9530e0e4e41cf269f23dd8cf16ca658008244b44" ] -} +} \ No newline at end of file diff --git a/reason.esy.lock/opam/dot-merlin-reader.4.1/opam b/reason.esy.lock/opam/dot-merlin-reader.4.1/opam deleted file mode 100644 index f860cab46..000000000 --- a/reason.esy.lock/opam/dot-merlin-reader.4.1/opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -synopsis: "Reads config files for merlin" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.06.1" } - "dune" {>= "2.7.0"} - "yojson" {>= "1.6.0"} - "ocamlfind" {>= "1.6.0"} - "csexp" {>= "1.2.3"} - "result" {>= "1.5"} -] -description: - "Helper process: reads .merlin files and gives the normalized content to merlin" -x-commit-hash: "ab02f60994c81166820791b5f465f467d752b8dc" -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.1/dot-merlin-reader-v4.1.tbz" - checksum: [ - "sha256=14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd" - "sha512=65fd4ab08904c05651a7ef8971802ffaa428daa920765dbcf162e3c56e8047e4c9e4356daa45efccce7c73a586635c8f6cf8118fd3059789de9aff68579bd436" - ] -} diff --git a/reason.esy.lock/opam/dot-merlin-reader.4.6/opam b/reason.esy.lock/opam/dot-merlin-reader.4.6/opam new file mode 100644 index 000000000..3943521de --- /dev/null +++ b/reason.esy.lock/opam/dot-merlin-reader.4.6/opam @@ -0,0 +1,30 @@ +opam-version: "2.0" +maintainer: "defree@gmail.com" +authors: "The Merlin team" +synopsis: "Reads config files for merlin" +homepage: "https://github.com/ocaml/merlin" +bug-reports: "https://github.com/ocaml/merlin/issues" +dev-repo: "git+https://github.com/ocaml/merlin.git" +license: "MIT" +build: [ + ["dune" "subst"] {dev} + ["dune" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.08"} + "dune" {>= "2.9.0"} + "merlin-lib" {>= "4.6"} + "ocamlfind" {>= "1.6.0"} +] +description: + "Helper process: reads .merlin files and outputs the normalized content to + stdout." +url { + src: + "https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz" + checksum: [ + "sha256=02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" + "sha512=7373fadf05c692c9f054c7fe6a7d4bdfeefe237b9df432024ef9923782ee72e09021c0c3fba869da8347728105cb2d3ff0aa94b0c5eb09811bb25aa8da9fb520" + ] +} +x-commit-hash: "be753d9412387aedcf32aba88a1be9bcd33d97ba" diff --git a/reason.esy.lock/opam/dune.2.9.3/opam b/reason.esy.lock/opam/dune.2.9.3/opam index dc3b456ba..056c52674 100644 --- a/reason.esy.lock/opam/dune.2.9.3/opam +++ b/reason.esy.lock/opam/dune.2.9.3/opam @@ -36,15 +36,13 @@ conflicts: [ ] dev-repo: "git+https://github.com/ocaml/dune.git" build: [ - # opam 2 sets OPAM_SWITCH_PREFIX, so we don't need a hardcoded path - ["ocaml" "configure.ml" "--libdir" lib] {opam-version < "2"} ["ocaml" "bootstrap.ml" "-j" jobs] ["./dune.exe" "build" "-p" name "--profile" "dune-bootstrap" "-j" jobs] ] depends: [ # Please keep the lower bound in sync with .github/workflows/workflow.yml, # dune-project and min_ocaml_version in bootstrap.ml - ("ocaml" {>= "4.08"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) + ("ocaml" {>= "4.08" & < "5.0"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) "base-unix" "base-threads" ] diff --git a/reason.esy.lock/opam/easy-format.1.3.2/opam b/reason.esy.lock/opam/easy-format.1.3.2/opam deleted file mode 100644 index f55c2c8d1..000000000 --- a/reason.esy.lock/opam/easy-format.1.3.2/opam +++ /dev/null @@ -1,46 +0,0 @@ -opam-version: "2.0" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} - ["dune" "build" "-p" name "@doc"] {with-doc} -] -maintainer: ["martin@mjambon.com" "rudi.grinberg@gmail.com"] -authors: ["Martin Jambon"] -bug-reports: "https://github.com/mjambon/easy-format/issues" -homepage: "https://github.com/mjambon/easy-format" -doc: "https://mjambon.github.io/easy-format/" -license: "BSD-3-Clause" -dev-repo: "git+https://github.com/mjambon/easy-format.git" -synopsis: - "High-level and functional interface to the Format module of the OCaml standard library" -description: """ - -This module offers a high-level and functional interface to the Format module of -the OCaml standard library. It is a pretty-printing facility, i.e. it takes as -input some code represented as a tree and formats this code into the most -visually satisfying result, breaking and indenting lines of code where -appropriate. - -Input data must be first modelled and converted into a tree using 3 kinds of -nodes: - -* atoms -* lists -* labelled nodes - -Atoms represent any text that is guaranteed to be printed as-is. Lists can model -any sequence of items such as arrays of data or lists of definitions that are -labelled with something like "int main", "let x =" or "x:".""" -depends: [ - "dune" {>= "1.10"} - "ocaml" {>= "4.02.3"} -] -url { - src: - "https://github.com/mjambon/easy-format/releases/download/1.3.2/easy-format-1.3.2.tbz" - checksum: [ - "sha256=3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926" - "sha512=e39377a2ff020ceb9ac29e8515a89d9bdbc91dfcfa871c4e3baafa56753fac2896768e5d9822a050dc1e2ade43c8967afb69391a386c0a8ecd4e1f774e236135" - ] -} diff --git a/reason.esy.lock/opam/menhir.20220210/opam b/reason.esy.lock/opam/menhir.20220210/opam index 3cd79886c..498658b42 100644 --- a/reason.esy.lock/opam/menhir.20220210/opam +++ b/reason.esy.lock/opam/menhir.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/reason.esy.lock/opam/menhirLib.20220210/opam b/reason.esy.lock/opam/menhirLib.20220210/opam index 895b54277..d2097ae4f 100644 --- a/reason.esy.lock/opam/menhirLib.20220210/opam +++ b/reason.esy.lock/opam/menhirLib.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/reason.esy.lock/opam/menhirSdk.20220210/opam b/reason.esy.lock/opam/menhirSdk.20220210/opam index d95c170de..585d2ca33 100644 --- a/reason.esy.lock/opam/menhirSdk.20220210/opam +++ b/reason.esy.lock/opam/menhirSdk.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/reason.esy.lock/opam/merlin-extend.0.6/opam b/reason.esy.lock/opam/merlin-extend.0.6.1/opam similarity index 73% rename from reason.esy.lock/opam/merlin-extend.0.6/opam rename to reason.esy.lock/opam/merlin-extend.0.6.1/opam index 8394e1ac5..9f9936505 100644 --- a/reason.esy.lock/opam/merlin-extend.0.6/opam +++ b/reason.esy.lock/opam/merlin-extend.0.6.1/opam @@ -19,12 +19,12 @@ description: """ This protocol allows to replace the OCaml frontend of Merlin. It extends what used to be done with the `-pp' flag to handle a few more cases.""" doc: "https://let-def.github.io/merlin-extend" -x-commit-hash: "640620568a5f5c7798239ecf7c707c813e3df3cf" url { src: - "https://github.com/let-def/merlin-extend/releases/download/v0.6/merlin-extend-v0.6.tbz" + "https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz" checksum: [ - "sha256=c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43" - "sha512=4c64a490e2ece04fc89aef679c1d9202175df4fe045b5fdc7a37cd7cebe861226fddd9648c1bf4f06175ecfcd2ed7686c96bd6a8cae003a5096f6134c240f857" + "sha256=5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" + "sha512=631fc96aab2f35e12a078c9b4907ca7b0db9f1e3a4026040e6c23b82e0171c256a89fb5d4c887f1d156eb9e3152783cdf7a546b2496051007a1bcf5777417396" ] } +x-commit-hash: "cf2707bbe8e034c6ecf5d0fecd3fd889f6ab14bf" diff --git a/reason.esy.lock/opam/merlin-lib.4.8-414/opam b/reason.esy.lock/opam/merlin-lib.4.8-414/opam new file mode 100644 index 000000000..07698b02d --- /dev/null +++ b/reason.esy.lock/opam/merlin-lib.4.8-414/opam @@ -0,0 +1,34 @@ +opam-version: "2.0" +maintainer: "defree@gmail.com" +authors: "The Merlin team" +homepage: "https://github.com/ocaml/merlin" +bug-reports: "https://github.com/ocaml/merlin/issues" +dev-repo: "git+https://github.com/ocaml/merlin.git" +license: "MIT" +build: [ + ["dune" "subst"] {dev} + ["dune" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.14" & < "4.15"} + "dune" {>= "2.9.0"} + "csexp" {>= "1.5.1"} + "menhir" {dev & >= "20201216"} + "menhirLib" {dev & >= "20201216"} + "menhirSdk" {dev & >= "20201216"} +] +synopsis: + "Merlin's libraries" +description: + "These libraries provides access to low-level compiler interfaces and the + standard higher-level merlin protocol. The library is provided as-is, is not + thoroughly documented, and its public API might break with any new release." +url { + src: + "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" + checksum: [ + "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" + "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" + ] +} +x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/rtop.esy.lock/opam/merlin.4.4-412/opam b/reason.esy.lock/opam/merlin.4.8-414/opam similarity index 76% rename from rtop.esy.lock/opam/merlin.4.4-412/opam rename to reason.esy.lock/opam/merlin.4.8-414/opam index e8d65e15b..b080c70cc 100644 --- a/rtop.esy.lock/opam/merlin.4.4-412/opam +++ b/reason.esy.lock/opam/merlin.4.8-414/opam @@ -8,19 +8,20 @@ license: "MIT" build: [ ["dune" "subst"] {dev} ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" "merlin,dot-merlin-reader" "-j" "1"] {with-test} + ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ - "ocaml" {>= "4.12" & < "4.13"} + "ocaml" {>= "4.14" & < "4.15"} "dune" {>= "2.9.0"} - "dot-merlin-reader" {>= "4.0"} - "yojson" {>= "1.6.0"} + "merlin-lib" {= version} + "dot-merlin-reader" {>= "4.6"} + "yojson" {>= "2.0.0"} "conf-jq" {with-test} - "csexp" {>= "1.2.3"} - "result" {>= "1.5"} - "menhir" {dev} - "menhirLib" {dev} - "menhirSdk" {dev} + "ppxlib" {with-test} +] +conflicts: [ + "seq" {!= "base"} + "base-effects" ] synopsis: "Editor helper, provides completion, typing and source browsing in Vim and Emacs" @@ -68,10 +69,10 @@ See https://github.com/OCamlPro/opam-user-setup ] url { src: - "https://github.com/ocaml/merlin/releases/download/v4.4-412/merlin-4.4-412.tbz" + "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" checksum: [ - "sha256=16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3" - "sha512=f51b2875b75215d0be378de86b9dca0957b5e62241ce625a46c6341c219582510d37af94dedf67e1d3db61ebacfef8fa764e4719fac16c0b4b99bb85d0b991d4" + "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" + "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" ] } -x-commit-hash: "5497c563b06f868d72d4f74bd8026c1c1aeb6595" +x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch b/reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch new file mode 100644 index 000000000..8011238cd --- /dev/null +++ b/reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch @@ -0,0 +1,12 @@ +diff a/configure b/configure +--- a/configure ++++ b/configure +@@ -294,7 +294,7 @@ + # If findlib has been configured -sitelib $(ocamlc -where) then there's + # nothing to do, but otherwise we need to put OCaml's Standard Library + # into the path setting. +- if [ ! -e "${ocaml_sitelib}/stdlib/META" ]; then ++ if [ ! -e "${ocaml_sitelib}/stdlib.cmi" ]; then + ocamlpath="${ocaml_core_stdlib}${path_sep}${ocamlpath}" + fi + fi diff --git a/reason.esy.lock/opam/ocamlfind.1.9.3/opam b/reason.esy.lock/opam/ocamlfind.1.9.6/opam similarity index 70% rename from reason.esy.lock/opam/ocamlfind.1.9.3/opam rename to reason.esy.lock/opam/ocamlfind.1.9.6/opam index 971a203f1..a81f0c50e 100644 --- a/reason.esy.lock/opam/ocamlfind.1.9.3/opam +++ b/reason.esy.lock/opam/ocamlfind.1.9.6/opam @@ -13,7 +13,7 @@ authors: "Gerd Stolpmann " homepage: "http://projects.camlcity.org/projects/findlib.html" bug-reports: "https://github.com/ocaml/ocamlfind/issues" depends: [ - "ocaml" {>= "4.00.0"} + "ocaml" {>= "3.08.0"} ] depopts: ["graphics"] build: [ @@ -34,11 +34,15 @@ install: [ [make "install"] ["install" "-m" "0755" "ocaml-stub" "%{bin}%/ocaml"] {ocaml:preinstalled} ] +extra-files: ["0001-Harden-test-for-OCaml-5.patch" "md5=3cddbf72164c29d4e50e077a92a37c6c"] +# See https://github.com/ocaml/ocamlfind/pull/61 +patches: ["0001-Harden-test-for-OCaml-5.patch"] dev-repo: "git+https://github.com/ocaml/ocamlfind.git" url { - src: "http://download.camlcity.org/download/findlib-1.9.3.tar.gz" + src: "http://download.camlcity.org/download/findlib-1.9.6.tar.gz" checksum: [ - "md5=24047dd8a0da5322253de9b7aa254e42" - "sha512=27cc4ce141576bf477fb9d61a82ad65f55478740eed59fb43f43edb794140829fd2ff89ad27d8a890cfc336b54c073a06de05b31100fc7c01cacbd7d88e928ea" + "md5=96c6ee50a32cca9ca277321262dbec57" + "sha512=cfaf1872d6ccda548f07d32cc6b90c3aafe136d2aa6539e03143702171ee0199add55269bba894c77115535dc46a5835901a5d7c75768999e72db503bfd83027" ] } +available: os != "win32" diff --git a/reason.esy.lock/opam/result.1.5/opam b/reason.esy.lock/opam/result.1.5/opam deleted file mode 100644 index 6b7b68d72..000000000 --- a/reason.esy.lock/opam/result.1.5/opam +++ /dev/null @@ -1,22 +0,0 @@ -opam-version: "2.0" -maintainer: "Jane Street developers" -authors: ["Jane Street Group, LLC"] -homepage: "https://github.com/janestreet/result" -dev-repo: "git+https://github.com/janestreet/result.git" -bug-reports: "https://github.com/janestreet/result/issues" -license: "BSD-3-Clause" -build: [["dune" "build" "-p" name "-j" jobs]] -depends: [ - "ocaml" - "dune" {>= "1.0"} -] -synopsis: "Compatibility Result module" -description: """ -Projects that want to use the new result type defined in OCaml >= 4.03 -while staying compatible with older version of OCaml should use the -Result module defined in this library.""" -url { - src: - "https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz" - checksum: "md5=1b82dec78849680b49ae9a8a365b831b" -} diff --git a/reason.esy.lock/opam/seq.base/files/META.seq b/reason.esy.lock/opam/seq.base/files/META.seq new file mode 100644 index 000000000..06b95eff3 --- /dev/null +++ b/reason.esy.lock/opam/seq.base/files/META.seq @@ -0,0 +1,4 @@ +name="seq" +version="[distributed with OCaml 4.07 or above]" +description="dummy backward-compatibility package for iterators" +requires="" diff --git a/reason.esy.lock/opam/seq.base/files/seq.install b/reason.esy.lock/opam/seq.base/files/seq.install new file mode 100644 index 000000000..c4d70206e --- /dev/null +++ b/reason.esy.lock/opam/seq.base/files/seq.install @@ -0,0 +1,3 @@ +lib:[ + "META.seq" {"META"} +] diff --git a/reason.esy.lock/opam/seq.base/opam b/reason.esy.lock/opam/seq.base/opam new file mode 100644 index 000000000..b33d8c7da --- /dev/null +++ b/reason.esy.lock/opam/seq.base/opam @@ -0,0 +1,15 @@ +opam-version: "2.0" +maintainer: " " +authors: " " +homepage: " " +depends: [ + "ocaml" {>= "4.07.0"} +] +dev-repo: "git+https://github.com/ocaml/ocaml.git" +bug-reports: "https://caml.inria.fr/mantis/main_page.php" +synopsis: + "Compatibility package for OCaml's standard iterator type starting from 4.07." +extra-files: [ + ["seq.install" "md5=026b31e1df290373198373d5aaa26e42"] + ["META.seq" "md5=b33c8a1a6c7ed797816ce27df4855107"] +] diff --git a/reason.esy.lock/opam/yojson.1.7.0/opam b/reason.esy.lock/opam/yojson.2.0.2/opam similarity index 56% rename from reason.esy.lock/opam/yojson.1.7.0/opam rename to reason.esy.lock/opam/yojson.2.0.2/opam index f5438059e..3b22e3899 100644 --- a/reason.esy.lock/opam/yojson.1.7.0/opam +++ b/reason.esy.lock/opam/yojson.2.0.2/opam @@ -1,38 +1,38 @@ opam-version: "2.0" -maintainer: "martin@mjambon.com" +maintainer: ["nathan@cryptosense.com" "marek@xivilization.net"] authors: ["Martin Jambon"] homepage: "https://github.com/ocaml-community/yojson" bug-reports: "https://github.com/ocaml-community/yojson/issues" dev-repo: "git+https://github.com/ocaml-community/yojson.git" doc: "https://ocaml-community.github.io/yojson/" +license: "BSD-3-Clause" build: [ ["dune" "subst"] {dev} ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@doc" "-p" name "-j" jobs] {with-doc} ] -run-test: [["dune" "runtest" "-p" name "-j" jobs]] depends: [ "ocaml" {>= "4.02.3"} - "dune" + "dune" {>= "2.0"} "cppo" {build} - "easy-format" - "biniou" {>= "1.2.0"} "alcotest" {with-test & >= "0.8.5"} + "odoc" {with-doc} + "seq" {>= "0.2.2"} ] synopsis: "Yojson is an optimized parsing and printing library for the JSON format" description: """ Yojson is an optimized parsing and printing library for the JSON format. -It addresses a few shortcomings of json-wheel including 2x speedup, -polymorphic variants and optional syntax for tuples and variants. - ydump is a pretty-printing command-line program provided with the -yojson package. - -The program atdgen can be used to derive OCaml-JSON serializers and -deserializers from type definitions.""" +yojson package.""" url { src: - "https://github.com/ocaml-community/yojson/releases/download/1.7.0/yojson-1.7.0.tbz" - checksum: "md5=b89d39ca3f8c532abe5f547ad3b8f84d" + "https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz" + checksum: [ + "sha256=876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" + "sha512=9e150689a814a64e53e361e336fe826df5a3e3851d1367fda4a001392175c29348de55db0b7d7ba18539dec2cf78198efcb7f41b77a9861763f5aa97c05509ad" + ] } +x-commit-hash: "17ca03c5877a4346f0691443f35ed9678f99962f" diff --git a/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/files/findlib.patch b/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch similarity index 100% rename from reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/files/findlib.patch rename to reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch diff --git a/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/package.json b/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json similarity index 100% rename from reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/package.json rename to reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json diff --git a/reason.json b/reason.json index 9931c95a9..2681801a7 100644 --- a/reason.json +++ b/reason.json @@ -13,22 +13,14 @@ "@opam/ocamlfind": "*", "@opam/menhir": " >= 20180523.0.0", "@opam/merlin-extend": " >= 0.6", - "@opam/result": "*", "@opam/ppx_derivers": "< 2.0.0", "@opam/dune": "2.9.3" }, "devDependencies": { "@opam/merlin": "*", - "ocaml": "~4.12.0" + "ocaml": "~4.14.0" }, "esy": { - "build": [ - [ - "dune", - "build", - "-p", - "reason" - ] - ] + "build": [ [ "dune", "build", "-p", "reason", "--disable-promotion" ] ] } } diff --git a/rtop.esy.lock/index.json b/rtop.esy.lock/index.json index 26c79c4f9..308750a02 100644 --- a/rtop.esy.lock/index.json +++ b/rtop.esy.lock/index.json @@ -1,15 +1,15 @@ { - "checksum": "481f95195bc2a93105aeafed57d01523", + "checksum": "22d6e47f86c696df9abb797ecdf9ba66", "root": "@esy-ocaml/rtop@link-dev:./rtop.json", "node": { - "ocaml@4.12.0@d41d8cd9": { - "id": "ocaml@4.12.0@d41d8cd9", + "ocaml@4.14.0@d41d8cd9": { + "id": "ocaml@4.14.0@d41d8cd9", "name": "ocaml", - "version": "4.12.0", + "version": "4.14.0", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.12.0.tgz#sha1:2a979f37535faaded8aa3fdf82b6f16f2c71e284" + "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.14.0.tgz#sha1:619afaeabcc8732cc1f4014a7251403927f44021" ] }, "overrides": [], @@ -34,86 +34,85 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/charInfo_width@opam:1.1.0@1a0889ea", - "@opam/camomile@opam:1.0.2@42017332", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/charInfo_width@opam:1.1.0@2e6806d6", + "@opam/camomile@opam:1.0.2@27671317", "@opam/base-bytes@opam:base@19d0c2ff", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/charInfo_width@opam:1.1.0@1a0889ea", - "@opam/camomile@opam:1.0.2@42017332", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/charInfo_width@opam:1.1.0@2e6806d6", + "@opam/camomile@opam:1.0.2@27671317", "@opam/base-bytes@opam:base@19d0c2ff" ] }, - "@opam/yojson@opam:1.7.0@69d87312": { - "id": "@opam/yojson@opam:1.7.0@69d87312", + "@opam/yojson@opam:2.0.2@eb65f292": { + "id": "@opam/yojson@opam:2.0.2@eb65f292", "name": "@opam/yojson", - "version": "opam:1.7.0", + "version": "opam:2.0.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/b8/b89d39ca3f8c532abe5f547ad3b8f84d#md5:b89d39ca3f8c532abe5f547ad3b8f84d", - "archive:https://github.com/ocaml-community/yojson/releases/download/1.7.0/yojson-1.7.0.tbz#md5:b89d39ca3f8c532abe5f547ad3b8f84d" + "archive:https://opam.ocaml.org/cache/sha256/87/876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b", + "archive:https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" ], "opam": { "name": "yojson", - "version": "1.7.0", - "path": "rtop.esy.lock/opam/yojson.1.7.0" + "version": "2.0.2", + "path": "rtop.esy.lock/opam/yojson.2.0.2" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/cppo@opam:1.6.8@7e48217d", - "@opam/biniou@opam:1.2.1@420bda02", + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/biniou@opam:1.2.1@420bda02" + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/utop@opam:2.9.0@10af4ff3": { - "id": "@opam/utop@opam:2.9.0@10af4ff3", + "@opam/utop@opam:2.9.2@a8a2b147": { + "id": "@opam/utop@opam:2.9.2@a8a2b147", "name": "@opam/utop", - "version": "opam:2.9.0", + "version": "opam:2.9.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/cd/cd7bba0576f9f1a303d645dce07ea6577aedc1c13d315b312f6a5fc356304d9e#sha256:cd7bba0576f9f1a303d645dce07ea6577aedc1c13d315b312f6a5fc356304d9e", - "archive:https://github.com/ocaml-community/utop/releases/download/2.9.0/utop-2.9.0.tbz#sha256:cd7bba0576f9f1a303d645dce07ea6577aedc1c13d315b312f6a5fc356304d9e" + "archive:https://opam.ocaml.org/cache/md5/ab/abd1c592464ce5f31b17009954040d7c#md5:abd1c592464ce5f31b17009954040d7c", + "archive:https://github.com/ocaml-community/utop/releases/download/2.9.2/utop-2.9.2.tbz#md5:abd1c592464ce5f31b17009954040d7c" ], "opam": { "name": "utop", - "version": "2.9.0", - "path": "rtop.esy.lock/opam/utop.2.9.0" + "version": "2.9.2", + "path": "rtop.esy.lock/opam/utop.2.9.2" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/lwt_react@opam:1.1.5@9b9c268e", - "@opam/lwt@opam:5.5.0@30354e4c", - "@opam/lambda-term@opam:3.2.0@43a9b88a", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/cppo@opam:1.6.8@7e48217d", - "@opam/camomile@opam:1.0.2@42017332", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/lwt_react@opam:1.2.0@4253a145", + "@opam/lwt@opam:5.6.1@2a9902ab", + "@opam/lambda-term@opam:3.2.0@781c5f03", + "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", + "@opam/camomile@opam:1.0.2@27671317", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/lwt_react@opam:1.1.5@9b9c268e", - "@opam/lwt@opam:5.5.0@30354e4c", - "@opam/lambda-term@opam:3.2.0@43a9b88a", - "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/camomile@opam:1.0.2@42017332", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/lwt_react@opam:1.2.0@4253a145", + "@opam/lwt@opam:5.6.1@2a9902ab", + "@opam/lambda-term@opam:3.2.0@781c5f03", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/camomile@opam:1.0.2@27671317", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084" ] @@ -136,37 +135,37 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/topkg@opam:1.0.5@0aa59f51": { - "id": "@opam/topkg@opam:1.0.5@0aa59f51", + "@opam/topkg@opam:1.0.7@7ee47d76": { + "id": "@opam/topkg@opam:1.0.7@7ee47d76", "name": "@opam/topkg", - "version": "opam:1.0.5", + "version": "opam:1.0.7", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha512/94/9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab#sha512:9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab", - "archive:https://erratique.ch/software/topkg/releases/topkg-1.0.5.tbz#sha512:9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab" + "archive:https://opam.ocaml.org/cache/sha512/09/09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535#sha512:09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535", + "archive:https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz#sha512:09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535" ], "opam": { "name": "topkg", - "version": "1.0.5", - "path": "rtop.esy.lock/opam/topkg.1.0.5" + "version": "1.0.7", + "path": "rtop.esy.lock/opam/topkg.1.0.7" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/ocamlbuild@opam:0.14.1@ead10f40" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28" ] }, "@opam/seq@opam:base@d8d7de1d": { @@ -184,9 +183,9 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.0@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/result@opam:1.5@1c6a6533": { "id": "@opam/result@opam:1.5@1c6a6533", @@ -206,45 +205,45 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/reason@opam:3.8.0@0af856e0": { - "id": "@opam/reason@opam:3.8.0@0af856e0", + "@opam/reason@opam:3.8.2@19b5db6d": { + "id": "@opam/reason@opam:3.8.2@19b5db6d", "name": "@opam/reason", - "version": "opam:3.8.0", + "version": "opam:3.8.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/94/9478724b01767320064ba950ddea24c5df0eefdcdd8ff1324ba9ccd646258979#sha256:9478724b01767320064ba950ddea24c5df0eefdcdd8ff1324ba9ccd646258979", - "archive:https://github.com/reasonml/reason/releases/download/3.8.0/reason-3.8.0.tbz#sha256:9478724b01767320064ba950ddea24c5df0eefdcdd8ff1324ba9ccd646258979" + "archive:https://opam.ocaml.org/cache/sha256/7a/7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2#sha256:7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2", + "archive:https://github.com/reasonml/reason/releases/download/3.8.2/reason-3.8.2.tbz#sha256:7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2" ], "opam": { "name": "reason", - "version": "3.8.0", - "path": "rtop.esy.lock/opam/reason.3.8.0" + "version": "3.8.2", + "path": "rtop.esy.lock/opam/reason.3.8.2" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/merlin-extend@opam:0.6@88755c91", - "@opam/menhir@opam:20220210@ff87a93b", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@f57a6d69", + "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/merlin-extend@opam:0.6.1@7d979feb", + "@opam/menhir@opam:20220210@ff5ea9a7", + "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "@opam/merlin-extend@opam:0.6@88755c91", - "@opam/menhir@opam:20220210@ff87a93b", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@f57a6d69" + "@opam/merlin-extend@opam:0.6.1@7d979feb", + "@opam/menhir@opam:20220210@ff5ea9a7", + "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/react@opam:1.2.2@e0f4480e": { @@ -265,12 +264,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/topkg@opam:1.0.5@0aa59f51", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", + "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/ocamlbuild@opam:0.14.2@c6163b28", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.0@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/ppx_derivers@opam:1.2.1@e2cbad12": { "id": "@opam/ppx_derivers@opam:1.2.1@e2cbad12", @@ -290,11 +289,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/ocplib-endian@opam:1.2@008dc942": { @@ -315,96 +314,69 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/cppo@opam:1.6.8@7e48217d", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-bytes@opam:base@19d0c2ff", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@opam/base-bytes@opam:base@19d0c2ff" ] }, - "@opam/ocamlfind@opam:1.9.3@781b30f3": { - "id": "@opam/ocamlfind@opam:1.9.3@781b30f3", + "@opam/ocamlfind@opam:1.9.6@d090a512": { + "id": "@opam/ocamlfind@opam:1.9.6@d090a512", "name": "@opam/ocamlfind", - "version": "opam:1.9.3", + "version": "opam:1.9.6", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/24/24047dd8a0da5322253de9b7aa254e42#md5:24047dd8a0da5322253de9b7aa254e42", - "archive:http://download.camlcity.org/download/findlib-1.9.3.tar.gz#md5:24047dd8a0da5322253de9b7aa254e42" + "archive:https://opam.ocaml.org/cache/md5/96/96c6ee50a32cca9ca277321262dbec57#md5:96c6ee50a32cca9ca277321262dbec57", + "archive:http://download.camlcity.org/download/findlib-1.9.6.tar.gz#md5:96c6ee50a32cca9ca277321262dbec57" ], "opam": { "name": "ocamlfind", - "version": "1.9.3", - "path": "rtop.esy.lock/opam/ocamlfind.1.9.3" + "version": "1.9.6", + "path": "rtop.esy.lock/opam/ocamlfind.1.9.6" } }, "overrides": [ { "opamoverride": - "rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override" + "rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override" } ], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.0@d41d8cd9" ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, - "@opam/ocamlbuild@opam:0.14.1@ead10f40": { - "id": "@opam/ocamlbuild@opam:0.14.1@ead10f40", + "@opam/ocamlbuild@opam:0.14.2@c6163b28": { + "id": "@opam/ocamlbuild@opam:0.14.2@c6163b28", "name": "@opam/ocamlbuild", - "version": "opam:0.14.1", + "version": "opam:0.14.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/70/7027e507ed85f290923ad198f3d2cd1c#md5:7027e507ed85f290923ad198f3d2cd1c", - "archive:https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.1.tar.gz#md5:7027e507ed85f290923ad198f3d2cd1c" + "archive:https://opam.ocaml.org/cache/md5/2f/2f407fadd57b073155a6aead887d9676#md5:2f407fadd57b073155a6aead887d9676", + "archive:https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz#md5:2f407fadd57b073155a6aead887d9676" ], "opam": { "name": "ocamlbuild", - "version": "0.14.1", - "path": "rtop.esy.lock/opam/ocamlbuild.0.14.1" + "version": "0.14.2", + "path": "rtop.esy.lock/opam/ocamlbuild.0.14.2" } }, "overrides": [ { "opamoverride": - "rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override" + "rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override" } ], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [ "ocaml@4.12.0@d41d8cd9" ] - }, - "@opam/mmap@opam:1.2.0@b0f60a84": { - "id": "@opam/mmap@opam:1.2.0@b0f60a84", - "name": "@opam/mmap", - "version": "opam:1.2.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/16/1602a8abc8e232fa94771a52e540e5780b40c2f2762eee6afbd9286502116ddb#sha256:1602a8abc8e232fa94771a52e540e5780b40c2f2762eee6afbd9286502116ddb", - "archive:https://github.com/mirage/mmap/releases/download/v1.2.0/mmap-1.2.0.tbz#sha256:1602a8abc8e232fa94771a52e540e5780b40c2f2762eee6afbd9286502116ddb" - ], - "opam": { - "name": "mmap", - "version": "1.2.0", - "path": "rtop.esy.lock/opam/mmap.1.2.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/bigarray-compat@opam:1.1.0@84cda9d0", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/bigarray-compat@opam:1.1.0@84cda9d0" - ] + "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, "@opam/mew_vi@opam:0.5.0@cf66c299": { "id": "@opam/mew_vi@opam:0.5.0@cf66c299", @@ -424,13 +396,13 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/mew@opam:0.1.0@65011d4b": { @@ -451,72 +423,99 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", + "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", + "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@4d52c673" + ] + }, + "@opam/merlin-lib@opam:4.8-414@ece13977": { + "id": "@opam/merlin-lib@opam:4.8-414@ece13977", + "name": "@opam/merlin-lib", + "version": "opam:4.8-414", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", + "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" + ], + "opam": { + "name": "merlin-lib", + "version": "4.8-414", + "path": "rtop.esy.lock/opam/merlin-lib.4.8-414" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/csexp@opam:1.5.1@8a8fb3a7" ] }, - "@opam/merlin-extend@opam:0.6@88755c91": { - "id": "@opam/merlin-extend@opam:0.6@88755c91", + "@opam/merlin-extend@opam:0.6.1@7d979feb": { + "id": "@opam/merlin-extend@opam:0.6.1@7d979feb", "name": "@opam/merlin-extend", - "version": "opam:0.6", + "version": "opam:0.6.1", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/c2/c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43#sha256:c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43", - "archive:https://github.com/let-def/merlin-extend/releases/download/v0.6/merlin-extend-v0.6.tbz#sha256:c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43" + "archive:https://opam.ocaml.org/cache/sha256/5e/5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7", + "archive:https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" ], "opam": { "name": "merlin-extend", - "version": "0.6", - "path": "rtop.esy.lock/opam/merlin-extend.0.6" + "version": "0.6.1", + "path": "rtop.esy.lock/opam/merlin-extend.0.6.1" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/cppo@opam:1.6.8@7e48217d", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/merlin@opam:4.4-412@c7695ce2": { - "id": "@opam/merlin@opam:4.4-412@c7695ce2", + "@opam/merlin@opam:4.8-414@bb3fbab2": { + "id": "@opam/merlin@opam:4.8-414@bb3fbab2", "name": "@opam/merlin", - "version": "opam:4.4-412", + "version": "opam:4.8-414", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/16/16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3#sha256:16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3", - "archive:https://github.com/ocaml/merlin/releases/download/v4.4-412/merlin-4.4-412.tbz#sha256:16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3" + "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", + "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" ], "opam": { "name": "merlin", - "version": "4.4-412", - "path": "rtop.esy.lock/opam/merlin.4.4-412" + "version": "4.8-414", + "path": "rtop.esy.lock/opam/merlin.4.8-414" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/dot-merlin-reader@opam:4.1@84436e1c", - "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dot-merlin-reader@opam:4.6@85c88957", + "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/dot-merlin-reader@opam:4.1@84436e1c", - "@opam/csexp@opam:1.5.1@8a8fb3a7" + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/dot-merlin-reader@opam:4.6@85c88957" ] }, - "@opam/menhirSdk@opam:20220210@b8921e41": { - "id": "@opam/menhirSdk@opam:20220210@b8921e41", + "@opam/menhirSdk@opam:20220210@fe146ed3": { + "id": "@opam/menhirSdk@opam:20220210@fe146ed3", "name": "@opam/menhirSdk", "version": "opam:20220210", "source": { @@ -533,15 +532,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/menhirLib@opam:20220210@e6562f4f": { - "id": "@opam/menhirLib@opam:20220210@e6562f4f", + "@opam/menhirLib@opam:20220210@9afeb270": { + "id": "@opam/menhirLib@opam:20220210@9afeb270", "name": "@opam/menhirLib", "version": "opam:20220210", "source": { @@ -558,15 +557,15 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/menhir@opam:20220210@ff87a93b": { - "id": "@opam/menhir@opam:20220210@ff87a93b", + "@opam/menhir@opam:20220210@ff5ea9a7": { + "id": "@opam/menhir@opam:20220210@ff5ea9a7", "name": "@opam/menhir", "version": "opam:20220210", "source": { @@ -583,107 +582,102 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@b8921e41", - "@opam/menhirLib@opam:20220210@e6562f4f", - "@opam/dune@opam:2.9.3@f57a6d69", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "@opam/menhirLib@opam:20220210@9afeb270", + "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@b8921e41", - "@opam/menhirLib@opam:20220210@e6562f4f", - "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", + "@opam/menhirLib@opam:20220210@9afeb270", + "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/lwt_react@opam:1.1.5@9b9c268e": { - "id": "@opam/lwt_react@opam:1.1.5@9b9c268e", + "@opam/lwt_react@opam:1.2.0@4253a145": { + "id": "@opam/lwt_react@opam:1.2.0@4253a145", "name": "@opam/lwt_react", - "version": "opam:1.1.5", + "version": "opam:1.2.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/94/94272fac89c5bf21a89c102b8a8f35a5#md5:94272fac89c5bf21a89c102b8a8f35a5", - "archive:https://github.com/ocsigen/lwt/archive/refs/tags/5.5.0.tar.gz#md5:94272fac89c5bf21a89c102b8a8f35a5" + "archive:https://opam.ocaml.org/cache/md5/e6/e63979ee40a80d5b9e9e5545f33323b4#md5:e63979ee40a80d5b9e9e5545f33323b4", + "archive:https://github.com/ocsigen/lwt/archive/5.6.0.tar.gz#md5:e63979ee40a80d5b9e9e5545f33323b4" ], "opam": { "name": "lwt_react", - "version": "1.1.5", - "path": "rtop.esy.lock/opam/lwt_react.1.1.5" + "version": "1.2.0", + "path": "rtop.esy.lock/opam/lwt_react.1.2.0" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.5.0@30354e4c", "@opam/dune@opam:2.9.3@f57a6d69", - "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:2.9.3@4d52c673", + "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.5.0@30354e4c", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/lwt_log@opam:1.1.1@fc97477f": { - "id": "@opam/lwt_log@opam:1.1.1@fc97477f", + "@opam/lwt_log@opam:1.1.2@35f097e3": { + "id": "@opam/lwt_log@opam:1.1.2@35f097e3", "name": "@opam/lwt_log", - "version": "opam:1.1.1", + "version": "opam:1.1.2", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/02/02e93be62288037870ae5b1ce099fe59#md5:02e93be62288037870ae5b1ce099fe59", - "archive:https://github.com/aantron/lwt_log/archive/1.1.1.tar.gz#md5:02e93be62288037870ae5b1ce099fe59" + "archive:https://opam.ocaml.org/cache/md5/f0/f060baea008b2563265dbcf0250f8912#md5:f060baea008b2563265dbcf0250f8912", + "archive:https://github.com/ocsigen/lwt_log/archive/1.1.2.tar.gz#md5:f060baea008b2563265dbcf0250f8912" ], "opam": { "name": "lwt_log", - "version": "1.1.1", - "path": "rtop.esy.lock/opam/lwt_log.1.1.1" + "version": "1.1.2", + "path": "rtop.esy.lock/opam/lwt_log.1.1.2" } }, "overrides": [], "dependencies": [ - "@opam/lwt@opam:5.5.0@30354e4c", "@opam/dune@opam:2.9.3@f57a6d69", - "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/lwt@opam:5.6.1@2a9902ab", + "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "@opam/lwt@opam:5.5.0@30354e4c", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/lwt@opam:5.6.1@2a9902ab", + "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/lwt@opam:5.5.0@30354e4c": { - "id": "@opam/lwt@opam:5.5.0@30354e4c", + "@opam/lwt@opam:5.6.1@2a9902ab": { + "id": "@opam/lwt@opam:5.6.1@2a9902ab", "name": "@opam/lwt", - "version": "opam:5.5.0", + "version": "opam:5.6.1", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/94/94272fac89c5bf21a89c102b8a8f35a5#md5:94272fac89c5bf21a89c102b8a8f35a5", - "archive:https://github.com/ocsigen/lwt/archive/refs/tags/5.5.0.tar.gz#md5:94272fac89c5bf21a89c102b8a8f35a5" + "archive:https://opam.ocaml.org/cache/md5/27/279024789a0ec84a9d97d98bad847f97#md5:279024789a0ec84a9d97d98bad847f97", + "archive:https://github.com/ocsigen/lwt/archive/5.6.1.tar.gz#md5:279024789a0ec84a9d97d98bad847f97" ], "opam": { "name": "lwt", - "version": "5.5.0", - "path": "rtop.esy.lock/opam/lwt.5.5.0" + "version": "5.6.1", + "path": "rtop.esy.lock/opam/lwt.5.6.1" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/result@opam:1.5@1c6a6533", - "@opam/ocplib-endian@opam:1.2@008dc942", - "@opam/mmap@opam:1.2.0@b0f60a84", + "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", "@opam/dune-configurator@opam:2.9.3@174e411b", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/cppo@opam:1.6.8@7e48217d", + "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/result@opam:1.5@1c6a6533", - "@opam/ocplib-endian@opam:1.2@008dc942", - "@opam/mmap@opam:1.2.0@b0f60a84", + "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", "@opam/dune-configurator@opam:2.9.3@174e411b", - "@opam/dune@opam:2.9.3@f57a6d69" + "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/lambda-term@opam:3.2.0@43a9b88a": { - "id": "@opam/lambda-term@opam:3.2.0@43a9b88a", + "@opam/lambda-term@opam:3.2.0@781c5f03": { + "id": "@opam/lambda-term@opam:3.2.0@781c5f03", "name": "@opam/lambda-term", "version": "opam:3.2.0", "source": { @@ -700,23 +694,23 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", + "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew_vi@opam:0.5.0@cf66c299", - "@opam/lwt_react@opam:1.1.5@9b9c268e", - "@opam/lwt_log@opam:1.1.1@fc97477f", "@opam/lwt@opam:5.5.0@30354e4c", - "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/camomile@opam:1.0.2@42017332", + "@opam/lwt_react@opam:1.2.0@4253a145", + "@opam/lwt_log@opam:1.1.2@35f097e3", "@opam/lwt@opam:5.6.1@2a9902ab", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/camomile@opam:1.0.2@27671317", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", + "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", "@opam/react@opam:1.2.2@e0f4480e", "@opam/mew_vi@opam:0.5.0@cf66c299", - "@opam/lwt_react@opam:1.1.5@9b9c268e", - "@opam/lwt_log@opam:1.1.1@fc97477f", "@opam/lwt@opam:5.5.0@30354e4c", - "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/camomile@opam:1.0.2@42017332" + "@opam/lwt_react@opam:1.2.0@4253a145", + "@opam/lwt_log@opam:1.1.2@35f097e3", "@opam/lwt@opam:5.6.1@2a9902ab", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/camomile@opam:1.0.2@27671317" ] }, "@opam/fix@opam:20220121@17b9a1a4": { @@ -737,36 +731,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" - ] - }, - "@opam/easy-format@opam:1.3.2@1ea9f987": { - "id": "@opam/easy-format@opam:1.3.2@1ea9f987", - "name": "@opam/easy-format", - "version": "opam:1.3.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/34/3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926#sha256:3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926", - "archive:https://github.com/mjambon/easy-format/releases/download/1.3.2/easy-format-1.3.2.tbz#sha256:3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926" - ], - "opam": { - "name": "easy-format", - "version": "1.3.2", - "path": "rtop.esy.lock/opam/easy-format.1.3.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/dune-configurator@opam:2.9.3@174e411b": { @@ -787,17 +756,17 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/csexp@opam:1.5.1@8a8fb3a7", + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "@opam/dune@opam:2.9.3@4d52c673", "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/csexp@opam:1.5.1@8a8fb3a7" + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "@opam/dune@opam:2.9.3@4d52c673", "@opam/csexp@opam:1.5.1@8a8fb3a7" ] }, - "@opam/dune@opam:2.9.3@f57a6d69": { - "id": "@opam/dune@opam:2.9.3@f57a6d69", + "@opam/dune@opam:2.9.3@4d52c673": { + "id": "@opam/dune@opam:2.9.3@4d52c673", "name": "@opam/dune", "version": "opam:2.9.3", "source": { @@ -814,44 +783,41 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", + "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084" ] }, - "@opam/dot-merlin-reader@opam:4.1@84436e1c": { - "id": "@opam/dot-merlin-reader@opam:4.1@84436e1c", + "@opam/dot-merlin-reader@opam:4.6@85c88957": { + "id": "@opam/dot-merlin-reader@opam:4.6@85c88957", "name": "@opam/dot-merlin-reader", - "version": "opam:4.1", + "version": "opam:4.6", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/14/14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd#sha256:14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd", - "archive:https://github.com/ocaml/merlin/releases/download/v4.1/dot-merlin-reader-v4.1.tbz#sha256:14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd" + "archive:https://opam.ocaml.org/cache/sha256/02/02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce", + "archive:https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" ], "opam": { "name": "dot-merlin-reader", - "version": "4.1", - "path": "rtop.esy.lock/opam/dot-merlin-reader.4.1" + "version": "4.6", + "path": "rtop.esy.lock/opam/dot-merlin-reader.4.6" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/csexp@opam:1.5.1@8a8fb3a7", - "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/yojson@opam:1.7.0@69d87312", - "@opam/result@opam:1.5@1c6a6533", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/dune@opam:2.9.3@f57a6d69", "@opam/csexp@opam:1.5.1@8a8fb3a7" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/merlin-lib@opam:4.8-414@ece13977", + "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/csexp@opam:1.5.1@8a8fb3a7": { @@ -872,42 +838,42 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, - "@opam/cppo@opam:1.6.8@7e48217d": { - "id": "@opam/cppo@opam:1.6.8@7e48217d", + "@opam/cppo@opam:1.6.9@db929a12": { + "id": "@opam/cppo@opam:1.6.9@db929a12", "name": "@opam/cppo", - "version": "opam:1.6.8", + "version": "opam:1.6.9", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/md5/fe/fed401197d86f9089e89f6cbdf1d660d#md5:fed401197d86f9089e89f6cbdf1d660d", - "archive:https://github.com/ocaml-community/cppo/archive/v1.6.8.tar.gz#md5:fed401197d86f9089e89f6cbdf1d660d" + "archive:https://opam.ocaml.org/cache/md5/d2/d23ffe85ac7dc8f0afd1ddf622770d09#md5:d23ffe85ac7dc8f0afd1ddf622770d09", + "archive:https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz#md5:d23ffe85ac7dc8f0afd1ddf622770d09" ], "opam": { "name": "cppo", - "version": "1.6.8", - "path": "rtop.esy.lock/opam/cppo.1.6.8" + "version": "1.6.9", + "path": "rtop.esy.lock/opam/cppo.1.6.9" } }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@opam/base-unix@opam:base@87d0b2eb" ] }, - "@opam/charInfo_width@opam:1.1.0@1a0889ea": { - "id": "@opam/charInfo_width@opam:1.1.0@1a0889ea", + "@opam/charInfo_width@opam:1.1.0@2e6806d6": { + "id": "@opam/charInfo_width@opam:1.1.0@2e6806d6", "name": "@opam/charInfo_width", "version": "opam:1.1.0", "source": { @@ -924,19 +890,19 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/camomile@opam:1.0.2@42017332", + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/camomile@opam:1.0.2@27671317", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@f57a6d69", - "@opam/camomile@opam:1.0.2@42017332" + "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", + "@opam/dune@opam:2.9.3@4d52c673", + "@opam/camomile@opam:1.0.2@27671317" ] }, - "@opam/camomile@opam:1.0.2@42017332": { - "id": "@opam/camomile@opam:1.0.2@42017332", + "@opam/camomile@opam:1.0.2@27671317": { + "id": "@opam/camomile@opam:1.0.2@27671317", "name": "@opam/camomile", "version": "opam:1.0.2", "source": { @@ -953,62 +919,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" - ] - }, - "@opam/biniou@opam:1.2.1@420bda02": { - "id": "@opam/biniou@opam:1.2.1@420bda02", - "name": "@opam/biniou", - "version": "opam:1.2.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/35/35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335#sha256:35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335", - "archive:https://github.com/mjambon/biniou/releases/download/1.2.1/biniou-1.2.1.tbz#sha256:35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335" - ], - "opam": { - "name": "biniou", - "version": "1.2.1", - "path": "rtop.esy.lock/opam/biniou.1.2.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/easy-format@opam:1.3.2@1ea9f987", - "@opam/dune@opam:2.9.3@f57a6d69" - ] - }, - "@opam/bigarray-compat@opam:1.1.0@84cda9d0": { - "id": "@opam/bigarray-compat@opam:1.1.0@84cda9d0", - "name": "@opam/bigarray-compat", - "version": "opam:1.1.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/43/434469a48d5c84e80d621b13d95eb067f8138c1650a1fd5ae6009a19b93718d5#sha256:434469a48d5c84e80d621b13d95eb067f8138c1650a1fd5ae6009a19b93718d5", - "archive:https://github.com/mirage/bigarray-compat/releases/download/v1.1.0/bigarray-compat-1.1.0.tbz#sha256:434469a48d5c84e80d621b13d95eb067f8138c1650a1fd5ae6009a19b93718d5" - ], - "opam": { - "name": "bigarray-compat", - "version": "1.1.0", - "path": "rtop.esy.lock/opam/bigarray-compat.1.1.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/dune@opam:2.9.3@f57a6d69" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" ] }, "@opam/base-unix@opam:base@87d0b2eb": { @@ -1060,11 +975,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.3@781b30f3", + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.3@781b30f3" + "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512" ] }, "@esy-ocaml/substs@0.0.1@d41d8cd9": { @@ -1088,13 +1003,13 @@ "source": { "type": "link-dev", "path": ".", "manifest": "rtop.json" }, "overrides": [], "dependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/utop@opam:2.9.0@10af4ff3", - "@opam/result@opam:1.5@1c6a6533", "@opam/reason@opam:3.8.0@0af856e0", - "@opam/ocamlfind@opam:1.9.3@781b30f3", - "@opam/dune@opam:2.9.3@f57a6d69", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "ocaml@4.14.0@d41d8cd9", "@opam/utop@opam:2.9.2@a8a2b147", + "@opam/reason@opam:3.8.2@19b5db6d", + "@opam/ocamlfind@opam:1.9.6@d090a512", + "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.12.0@d41d8cd9", "@opam/merlin@opam:4.4-412@c7695ce2" + "ocaml@4.14.0@d41d8cd9", "@opam/merlin@opam:4.8-414@bb3fbab2" ] } } diff --git a/rtop.esy.lock/opam/bigarray-compat.1.1.0/opam b/rtop.esy.lock/opam/bigarray-compat.1.1.0/opam deleted file mode 100644 index 1754fc361..000000000 --- a/rtop.esy.lock/opam/bigarray-compat.1.1.0/opam +++ /dev/null @@ -1,26 +0,0 @@ -opam-version: "2.0" -maintainer: "Lucas Pluvinage " -authors: [ "Lucas Pluvinage " ] -license: "ISC" -homepage: "https://github.com/mirage/bigarray-compat" -bug-reports: "https://github.com/mirage/bigarray-compat/issues" -dev-repo: "git+https://github.com/mirage/bigarray-compat.git" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.02.3"} - "dune" {>= "1.0"} -] -synopsis: - "Compatibility library to use Stdlib.Bigarray when possible" -url { - src: - "https://github.com/mirage/bigarray-compat/releases/download/v1.1.0/bigarray-compat-1.1.0.tbz" - checksum: [ - "sha256=434469a48d5c84e80d621b13d95eb067f8138c1650a1fd5ae6009a19b93718d5" - "sha512=7be283fd957ee168ce1e62835d22114da405e4b7da9619b4f2030a832d45ca210a0c8f1d1c57c92e224f3512308a8a0f0923b94f44b6f582acbe0e7728d179d4" - ] -} -x-commit-hash: "2ea842ba4ab2cfee7b711f7ad927917f3179a6f9" diff --git a/rtop.esy.lock/opam/biniou.1.2.1/opam b/rtop.esy.lock/opam/biniou.1.2.1/opam deleted file mode 100644 index ec7028f25..000000000 --- a/rtop.esy.lock/opam/biniou.1.2.1/opam +++ /dev/null @@ -1,45 +0,0 @@ -opam-version: "2.0" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} - ["dune" "build" "-p" name "@doc"] {with-doc} -] -maintainer: ["martin@mjambon.com"] -authors: ["Martin Jambon"] -bug-reports: "https://github.com/mjambon/biniou/issues" -homepage: "https://github.com/mjambon/biniou" -doc: "https://mjambon.github.io/biniou/" -license: "BSD-3-Clause" -dev-repo: "git+https://github.com/mjambon/biniou.git" -synopsis: - "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve" -description: """ - -Biniou (pronounced "be new") is a binary data format designed for speed, safety, -ease of use and backward compatibility as protocols evolve. Biniou is vastly -equivalent to JSON in terms of functionality but allows implementations several -times faster (4 times faster than yojson), with 25-35% space savings. - -Biniou data can be decoded into human-readable form without knowledge of type -definitions except for field and variant names which are represented by 31-bit -hashes. A program named bdump is provided for routine visualization of biniou -data files. - -The program atdgen is used to derive OCaml-Biniou serializers and deserializers -from type definitions. - -Biniou format specification: mjambon.github.io/atdgen-doc/biniou-format.txt""" -depends: [ - "easy-format" - "dune" {>= "1.10"} - "ocaml" {>= "4.02.3"} -] -url { - src: - "https://github.com/mjambon/biniou/releases/download/1.2.1/biniou-1.2.1.tbz" - checksum: [ - "sha256=35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335" - "sha512=82670cc77bf3e869ee26e5fbe5a5affa45a22bc8b6c4bd7e85473912780e0111baca59b34a2c14feae3543ce6e239d7fddaeab24b686a65bfe642cdb91d27ebf" - ] -} diff --git a/rtop.esy.lock/opam/camomile.1.0.2/opam b/rtop.esy.lock/opam/camomile.1.0.2/opam index fc965c5ba..f8572c012 100644 --- a/rtop.esy.lock/opam/camomile.1.0.2/opam +++ b/rtop.esy.lock/opam/camomile.1.0.2/opam @@ -13,7 +13,7 @@ doc: "https://yoriyuki.github.io/Camomile/" bug-reports: "https://github.com/yoriyuki/Camomile/issues" depends: [ "dune" {>= "1.11"} - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.02.3" & < "5.0"} ] dev-repo: "git+https://github.com/yoriyuki/Camomile.git" build: [ diff --git a/rtop.esy.lock/opam/charInfo_width.1.1.0/opam b/rtop.esy.lock/opam/charInfo_width.1.1.0/opam index 9a930ea66..e87929b0e 100644 --- a/rtop.esy.lock/opam/charInfo_width.1.1.0/opam +++ b/rtop.esy.lock/opam/charInfo_width.1.1.0/opam @@ -14,7 +14,7 @@ depends: [ "result" "camomile" {>= "1.0.0" & < "2.0~"} "dune" - "ppx_expect" {with-test & < "v0.15"} + "ppx_expect" {with-test} ] synopsis: "Determine column width for a character" diff --git a/reason.esy.lock/opam/cppo.1.6.8/opam b/rtop.esy.lock/opam/cppo.1.6.9/opam similarity index 58% rename from reason.esy.lock/opam/cppo.1.6.8/opam rename to rtop.esy.lock/opam/cppo.1.6.9/opam index c9d7f68f7..9c51ec6d8 100644 --- a/reason.esy.lock/opam/cppo.1.6.8/opam +++ b/rtop.esy.lock/opam/cppo.1.6.9/opam @@ -1,37 +1,39 @@ opam-version: "2.0" -maintainer: "martin@mjambon.com" +synopsis: "Code preprocessor like cpp for OCaml" +description: """\ +Cppo is an equivalent of the C preprocessor for OCaml programs. +It allows the definition of simple macros and file inclusion. + +Cppo is: + +* more OCaml-friendly than cpp +* easy to learn without consulting a manual +* reasonably fast +* simple to install and to maintain""" +maintainer: [ + "Martin Jambon " "Yishuai Li " +] authors: "Martin Jambon" license: "BSD-3-Clause" homepage: "https://github.com/ocaml-community/cppo" -doc: "https://ocaml-community.github.io/cppo/" +doc: "https://ocaml-community.github.io/cppo" bug-reports: "https://github.com/ocaml-community/cppo/issues" depends: [ "ocaml" {>= "4.02.3"} - "dune" {>= "1.0"} + "dune" {>= "1.10"} "base-unix" ] build: [ ["dune" "subst"] {dev} ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "-p" name "@doc"] {with-doc} ] dev-repo: "git+https://github.com/ocaml-community/cppo.git" -synopsis: "Code preprocessor like cpp for OCaml" -description: """ -Cppo is an equivalent of the C preprocessor for OCaml programs. -It allows the definition of simple macros and file inclusion. - -Cppo is: - -* more OCaml-friendly than cpp -* easy to learn without consulting a manual -* reasonably fast -* simple to install and to maintain -""" url { - src: "https://github.com/ocaml-community/cppo/archive/v1.6.8.tar.gz" + src: "https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz" checksum: [ - "md5=fed401197d86f9089e89f6cbdf1d660d" - "sha512=069bbe0ef09c03b0dc4b5795f909c3ef872fe99c6f1e6704a0fa97594b1570b3579226ec67fe11d696ccc349a4585055bbaf07c65eff423aa45af28abf38c858" + "md5=d23ffe85ac7dc8f0afd1ddf622770d09" + "sha512=26ff5a7b7f38c460661974b23ca190f0feae3a99f1974e0fd12ccf08745bd7d91b7bc168c70a5385b837bfff9530e0e4e41cf269f23dd8cf16ca658008244b44" ] -} +} \ No newline at end of file diff --git a/rtop.esy.lock/opam/dot-merlin-reader.4.1/opam b/rtop.esy.lock/opam/dot-merlin-reader.4.1/opam deleted file mode 100644 index f860cab46..000000000 --- a/rtop.esy.lock/opam/dot-merlin-reader.4.1/opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -synopsis: "Reads config files for merlin" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.06.1" } - "dune" {>= "2.7.0"} - "yojson" {>= "1.6.0"} - "ocamlfind" {>= "1.6.0"} - "csexp" {>= "1.2.3"} - "result" {>= "1.5"} -] -description: - "Helper process: reads .merlin files and gives the normalized content to merlin" -x-commit-hash: "ab02f60994c81166820791b5f465f467d752b8dc" -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.1/dot-merlin-reader-v4.1.tbz" - checksum: [ - "sha256=14a36d6fb8646a5df4530420a7861722f1a4ee04753717947305e3676031e7cd" - "sha512=65fd4ab08904c05651a7ef8971802ffaa428daa920765dbcf162e3c56e8047e4c9e4356daa45efccce7c73a586635c8f6cf8118fd3059789de9aff68579bd436" - ] -} diff --git a/rtop.esy.lock/opam/dot-merlin-reader.4.6/opam b/rtop.esy.lock/opam/dot-merlin-reader.4.6/opam new file mode 100644 index 000000000..3943521de --- /dev/null +++ b/rtop.esy.lock/opam/dot-merlin-reader.4.6/opam @@ -0,0 +1,30 @@ +opam-version: "2.0" +maintainer: "defree@gmail.com" +authors: "The Merlin team" +synopsis: "Reads config files for merlin" +homepage: "https://github.com/ocaml/merlin" +bug-reports: "https://github.com/ocaml/merlin/issues" +dev-repo: "git+https://github.com/ocaml/merlin.git" +license: "MIT" +build: [ + ["dune" "subst"] {dev} + ["dune" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.08"} + "dune" {>= "2.9.0"} + "merlin-lib" {>= "4.6"} + "ocamlfind" {>= "1.6.0"} +] +description: + "Helper process: reads .merlin files and outputs the normalized content to + stdout." +url { + src: + "https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz" + checksum: [ + "sha256=02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" + "sha512=7373fadf05c692c9f054c7fe6a7d4bdfeefe237b9df432024ef9923782ee72e09021c0c3fba869da8347728105cb2d3ff0aa94b0c5eb09811bb25aa8da9fb520" + ] +} +x-commit-hash: "be753d9412387aedcf32aba88a1be9bcd33d97ba" diff --git a/rtop.esy.lock/opam/dune.2.9.3/opam b/rtop.esy.lock/opam/dune.2.9.3/opam index dc3b456ba..056c52674 100644 --- a/rtop.esy.lock/opam/dune.2.9.3/opam +++ b/rtop.esy.lock/opam/dune.2.9.3/opam @@ -36,15 +36,13 @@ conflicts: [ ] dev-repo: "git+https://github.com/ocaml/dune.git" build: [ - # opam 2 sets OPAM_SWITCH_PREFIX, so we don't need a hardcoded path - ["ocaml" "configure.ml" "--libdir" lib] {opam-version < "2"} ["ocaml" "bootstrap.ml" "-j" jobs] ["./dune.exe" "build" "-p" name "--profile" "dune-bootstrap" "-j" jobs] ] depends: [ # Please keep the lower bound in sync with .github/workflows/workflow.yml, # dune-project and min_ocaml_version in bootstrap.ml - ("ocaml" {>= "4.08"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) + ("ocaml" {>= "4.08" & < "5.0"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) "base-unix" "base-threads" ] diff --git a/rtop.esy.lock/opam/easy-format.1.3.2/opam b/rtop.esy.lock/opam/easy-format.1.3.2/opam deleted file mode 100644 index f55c2c8d1..000000000 --- a/rtop.esy.lock/opam/easy-format.1.3.2/opam +++ /dev/null @@ -1,46 +0,0 @@ -opam-version: "2.0" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} - ["dune" "build" "-p" name "@doc"] {with-doc} -] -maintainer: ["martin@mjambon.com" "rudi.grinberg@gmail.com"] -authors: ["Martin Jambon"] -bug-reports: "https://github.com/mjambon/easy-format/issues" -homepage: "https://github.com/mjambon/easy-format" -doc: "https://mjambon.github.io/easy-format/" -license: "BSD-3-Clause" -dev-repo: "git+https://github.com/mjambon/easy-format.git" -synopsis: - "High-level and functional interface to the Format module of the OCaml standard library" -description: """ - -This module offers a high-level and functional interface to the Format module of -the OCaml standard library. It is a pretty-printing facility, i.e. it takes as -input some code represented as a tree and formats this code into the most -visually satisfying result, breaking and indenting lines of code where -appropriate. - -Input data must be first modelled and converted into a tree using 3 kinds of -nodes: - -* atoms -* lists -* labelled nodes - -Atoms represent any text that is guaranteed to be printed as-is. Lists can model -any sequence of items such as arrays of data or lists of definitions that are -labelled with something like "int main", "let x =" or "x:".""" -depends: [ - "dune" {>= "1.10"} - "ocaml" {>= "4.02.3"} -] -url { - src: - "https://github.com/mjambon/easy-format/releases/download/1.3.2/easy-format-1.3.2.tbz" - checksum: [ - "sha256=3440c2b882d537ae5e9011eb06abb53f5667e651ea4bb3b460ea8230fa8c1926" - "sha512=e39377a2ff020ceb9ac29e8515a89d9bdbc91dfcfa871c4e3baafa56753fac2896768e5d9822a050dc1e2ade43c8967afb69391a386c0a8ecd4e1f774e236135" - ] -} diff --git a/rtop.esy.lock/opam/lambda-term.3.2.0/opam b/rtop.esy.lock/opam/lambda-term.3.2.0/opam index a9d3f9669..b109ee019 100644 --- a/rtop.esy.lock/opam/lambda-term.3.2.0/opam +++ b/rtop.esy.lock/opam/lambda-term.3.2.0/opam @@ -18,8 +18,8 @@ depends: [ "lwt" {>= "4.0.0"} "lwt_log" "react" - "zed" {>= "3.1.0" & < "4.0"} - "camomile" {>= "1.0.1"} + "zed" {>= "3.1.0" & < "3.2.0"} + "camomile" {>= "1.0.1" & < "2.0.0"} "lwt_react" "mew_vi" {>= "0.5.0" & < "0.6.0"} "dune" {>= "1.1.0"} diff --git a/rtop.esy.lock/opam/lwt.5.5.0/opam b/rtop.esy.lock/opam/lwt.5.6.1/opam similarity index 67% rename from rtop.esy.lock/opam/lwt.5.5.0/opam rename to rtop.esy.lock/opam/lwt.5.6.1/opam index ae278f864..fa437b76b 100644 --- a/rtop.esy.lock/opam/lwt.5.5.0/opam +++ b/rtop.esy.lock/opam/lwt.5.6.1/opam @@ -20,12 +20,8 @@ depends: [ "cppo" {build & >= "1.1.0"} "dune" {>= "1.8.0"} "dune-configurator" - "mmap" {>= "1.1.0" & "os" != "win32"} # mmap is needed as long as Lwt supports OCaml < 4.06.0. - "ocaml" {>= "4.02.0" & "os" != "win32 " | >= "4.06.0"} - ("ocaml" {>= "4.08.0"} | "ocaml-syntax-shims") + "ocaml" {>= "4.08"} "ocplib-endian" - "result" # result is needed as long as Lwt supports OCaml 4.02. - "seq" # seq is needed as long as Lwt supports OCaml < 4.07.0. # Until https://github.com/aantron/bisect_ppx/pull/327. # "bisect_ppx" {dev & >= "2.0.0"} @@ -38,10 +34,6 @@ depopts: [ "conf-libev" ] -conflicts: [ - "ocaml-variants" {= "4.02.1+BER"} -] - build: [ ["dune" "exec" "-p" name "src/unix/config/discover.exe" "--" "--save" "--use-libev" "%{conf-libev:installed}%"] @@ -57,9 +49,9 @@ Meanwhile, OCaml code, including code creating and waiting on promises, runs in a single thread by default. This reduces the need for locks or other synchronization primitives. Code can be run in parallel on an opt-in basis." url { - src: "https://github.com/ocsigen/lwt/archive/refs/tags/5.5.0.tar.gz" + src: "https://github.com/ocsigen/lwt/archive/5.6.1.tar.gz" checksum: [ - "md5=94272fac89c5bf21a89c102b8a8f35a5" - "sha512=8951b94555e930634375816d71815b9d85daad6ffb7dab24864661504d11be26575ab0b237196c54693efa372a9b69cdc1d5068a20a250dc0bbb4a3c03c5fda1" + "md5=279024789a0ec84a9d97d98bad847f97" + "sha512=698875bd3bfcd5baa47eb48e412f442d289f9972421321541860ebe110b9af1949c3fbc253768495726ec547fe4ba25483cd97ff39bc668496fba95b2ed9edd8" ] } diff --git a/rtop.esy.lock/opam/lwt_log.1.1.1/opam b/rtop.esy.lock/opam/lwt_log.1.1.2/opam similarity index 53% rename from rtop.esy.lock/opam/lwt_log.1.1.1/opam rename to rtop.esy.lock/opam/lwt_log.1.1.2/opam index 631c0c720..f73df584b 100644 --- a/rtop.esy.lock/opam/lwt_log.1.1.1/opam +++ b/rtop.esy.lock/opam/lwt_log.1.1.2/opam @@ -1,8 +1,7 @@ opam-version: "2.0" synopsis: "Lwt logging library (deprecated)" - -license: "LGPL-2.0-or-later" +license: ["LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" "BSD-3-Clause"] homepage: "https://github.com/ocsigen/lwt_log" doc: "https://github.com/ocsigen/lwt_log/blob/master/src/core/lwt_log_core.mli" bug-reports: "https://github.com/ocsigen/lwt_log/issues" @@ -11,19 +10,22 @@ authors: [ "Shawn Wagner" "Jérémie Dimino" ] -maintainer: "Anton Bachin " +maintainer: "Raphaël Proust " dev-repo: "git+https://github.com/ocsigen/lwt_log.git" depends: [ "dune" {>= "1.0"} "lwt" {>= "4.0.0"} + "ocaml" {>= "4.03"} ] build: [ ["dune" "build" "-p" name "-j" jobs] ] - url { - src: "https://github.com/aantron/lwt_log/archive/1.1.1.tar.gz" - checksum: "md5=02e93be62288037870ae5b1ce099fe59" + src: "https://github.com/ocsigen/lwt_log/archive/1.1.2.tar.gz" + checksum: [ + "md5=f060baea008b2563265dbcf0250f8912" + "sha512=fb976d89c0f868b57434a9e0907ffae0842fe48fc747ddb860954d20f36722faea315ebb0b4dac202f9bf7203b0a09681614e9619f3bbd0dd59f8dd7bbd50575" + ] } diff --git a/rtop.esy.lock/opam/lwt_react.1.1.5/opam b/rtop.esy.lock/opam/lwt_react.1.2.0/opam similarity index 63% rename from rtop.esy.lock/opam/lwt_react.1.1.5/opam rename to rtop.esy.lock/opam/lwt_react.1.2.0/opam index ca290f1c1..b3435cb1b 100644 --- a/rtop.esy.lock/opam/lwt_react.1.1.5/opam +++ b/rtop.esy.lock/opam/lwt_react.1.2.0/opam @@ -17,17 +17,18 @@ dev-repo: "git+https://github.com/ocsigen/lwt.git" depends: [ "dune" {>= "1.8.0"} "lwt" {>= "3.0.0"} - "ocaml" + "ocaml" {>= "4.08"} "react" {>= "1.0.0"} + "cppo" {build & >= "1.1.0"} ] build: [ ["dune" "build" "-p" name "-j" jobs] ] url { - src: "https://github.com/ocsigen/lwt/archive/refs/tags/5.5.0.tar.gz" + src: "https://github.com/ocsigen/lwt/archive/5.6.0.tar.gz" checksum: [ - "md5=94272fac89c5bf21a89c102b8a8f35a5" - "sha512=8951b94555e930634375816d71815b9d85daad6ffb7dab24864661504d11be26575ab0b237196c54693efa372a9b69cdc1d5068a20a250dc0bbb4a3c03c5fda1" + "md5=e63979ee40a80d5b9e9e5545f33323b4" + "sha512=d616389bc9e0da11f25843ab7541ac2d40c9543700a89455f14115b339bbe58cef2b8acf0ae97fd54e15a4cb93149cfe1ebfda301aa93933045f76b7d9344160" ] } diff --git a/rtop.esy.lock/opam/menhir.20220210/opam b/rtop.esy.lock/opam/menhir.20220210/opam index 3cd79886c..498658b42 100644 --- a/rtop.esy.lock/opam/menhir.20220210/opam +++ b/rtop.esy.lock/opam/menhir.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/rtop.esy.lock/opam/menhirLib.20220210/opam b/rtop.esy.lock/opam/menhirLib.20220210/opam index 895b54277..d2097ae4f 100644 --- a/rtop.esy.lock/opam/menhirLib.20220210/opam +++ b/rtop.esy.lock/opam/menhirLib.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/rtop.esy.lock/opam/menhirSdk.20220210/opam b/rtop.esy.lock/opam/menhirSdk.20220210/opam index d95c170de..585d2ca33 100644 --- a/rtop.esy.lock/opam/menhirSdk.20220210/opam +++ b/rtop.esy.lock/opam/menhirSdk.20220210/opam @@ -8,7 +8,7 @@ authors: [ homepage: "http://gitlab.inria.fr/fpottier/menhir" dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only with OCaml-LGPL-linking-exception" +license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" build: [ ["dune" "build" "-p" name "-j" jobs] ] diff --git a/rtop.esy.lock/opam/merlin-extend.0.6/opam b/rtop.esy.lock/opam/merlin-extend.0.6.1/opam similarity index 73% rename from rtop.esy.lock/opam/merlin-extend.0.6/opam rename to rtop.esy.lock/opam/merlin-extend.0.6.1/opam index 8394e1ac5..9f9936505 100644 --- a/rtop.esy.lock/opam/merlin-extend.0.6/opam +++ b/rtop.esy.lock/opam/merlin-extend.0.6.1/opam @@ -19,12 +19,12 @@ description: """ This protocol allows to replace the OCaml frontend of Merlin. It extends what used to be done with the `-pp' flag to handle a few more cases.""" doc: "https://let-def.github.io/merlin-extend" -x-commit-hash: "640620568a5f5c7798239ecf7c707c813e3df3cf" url { src: - "https://github.com/let-def/merlin-extend/releases/download/v0.6/merlin-extend-v0.6.tbz" + "https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz" checksum: [ - "sha256=c2f236ae97feb6ba0bc90f33beb7b7343e42f9871b66de9ba07974917e256c43" - "sha512=4c64a490e2ece04fc89aef679c1d9202175df4fe045b5fdc7a37cd7cebe861226fddd9648c1bf4f06175ecfcd2ed7686c96bd6a8cae003a5096f6134c240f857" + "sha256=5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" + "sha512=631fc96aab2f35e12a078c9b4907ca7b0db9f1e3a4026040e6c23b82e0171c256a89fb5d4c887f1d156eb9e3152783cdf7a546b2496051007a1bcf5777417396" ] } +x-commit-hash: "cf2707bbe8e034c6ecf5d0fecd3fd889f6ab14bf" diff --git a/rtop.esy.lock/opam/merlin-lib.4.8-414/opam b/rtop.esy.lock/opam/merlin-lib.4.8-414/opam new file mode 100644 index 000000000..07698b02d --- /dev/null +++ b/rtop.esy.lock/opam/merlin-lib.4.8-414/opam @@ -0,0 +1,34 @@ +opam-version: "2.0" +maintainer: "defree@gmail.com" +authors: "The Merlin team" +homepage: "https://github.com/ocaml/merlin" +bug-reports: "https://github.com/ocaml/merlin/issues" +dev-repo: "git+https://github.com/ocaml/merlin.git" +license: "MIT" +build: [ + ["dune" "subst"] {dev} + ["dune" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.14" & < "4.15"} + "dune" {>= "2.9.0"} + "csexp" {>= "1.5.1"} + "menhir" {dev & >= "20201216"} + "menhirLib" {dev & >= "20201216"} + "menhirSdk" {dev & >= "20201216"} +] +synopsis: + "Merlin's libraries" +description: + "These libraries provides access to low-level compiler interfaces and the + standard higher-level merlin protocol. The library is provided as-is, is not + thoroughly documented, and its public API might break with any new release." +url { + src: + "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" + checksum: [ + "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" + "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" + ] +} +x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/reason.esy.lock/opam/merlin.4.4-412/opam b/rtop.esy.lock/opam/merlin.4.8-414/opam similarity index 76% rename from reason.esy.lock/opam/merlin.4.4-412/opam rename to rtop.esy.lock/opam/merlin.4.8-414/opam index e8d65e15b..b080c70cc 100644 --- a/reason.esy.lock/opam/merlin.4.4-412/opam +++ b/rtop.esy.lock/opam/merlin.4.8-414/opam @@ -8,19 +8,20 @@ license: "MIT" build: [ ["dune" "subst"] {dev} ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" "merlin,dot-merlin-reader" "-j" "1"] {with-test} + ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] depends: [ - "ocaml" {>= "4.12" & < "4.13"} + "ocaml" {>= "4.14" & < "4.15"} "dune" {>= "2.9.0"} - "dot-merlin-reader" {>= "4.0"} - "yojson" {>= "1.6.0"} + "merlin-lib" {= version} + "dot-merlin-reader" {>= "4.6"} + "yojson" {>= "2.0.0"} "conf-jq" {with-test} - "csexp" {>= "1.2.3"} - "result" {>= "1.5"} - "menhir" {dev} - "menhirLib" {dev} - "menhirSdk" {dev} + "ppxlib" {with-test} +] +conflicts: [ + "seq" {!= "base"} + "base-effects" ] synopsis: "Editor helper, provides completion, typing and source browsing in Vim and Emacs" @@ -68,10 +69,10 @@ See https://github.com/OCamlPro/opam-user-setup ] url { src: - "https://github.com/ocaml/merlin/releases/download/v4.4-412/merlin-4.4-412.tbz" + "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" checksum: [ - "sha256=16d879496882d44ee0a5392e20b3824240e70f1585b9ae6d936ff5f3a3beb2a3" - "sha512=f51b2875b75215d0be378de86b9dca0957b5e62241ce625a46c6341c219582510d37af94dedf67e1d3db61ebacfef8fa764e4719fac16c0b4b99bb85d0b991d4" + "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" + "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" ] } -x-commit-hash: "5497c563b06f868d72d4f74bd8026c1c1aeb6595" +x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/rtop.esy.lock/opam/mmap.1.2.0/opam b/rtop.esy.lock/opam/mmap.1.2.0/opam deleted file mode 100644 index c4a86edbb..000000000 --- a/rtop.esy.lock/opam/mmap.1.2.0/opam +++ /dev/null @@ -1,29 +0,0 @@ -opam-version: "2.0" -maintainer: "jeremie@dimino.org" -authors: ["Jérémie Dimino " "Anton Bachin" ] -homepage: "https://github.com/mirage/mmap" -bug-reports: "https://github.com/mirage/mmap/issues" -doc: "https://mirage.github.io/mmap/" -dev-repo: "git+https://github.com/mirage/mmap.git" -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.02.3"} - "dune" {>= "1.6"} - "bigarray-compat" -] -synopsis: "File mapping functionality" -description: """ -This project provides a Mmap.map_file functions for mapping files in memory. -""" -url { - src: - "https://github.com/mirage/mmap/releases/download/v1.2.0/mmap-1.2.0.tbz" - checksum: [ - "sha256=1602a8abc8e232fa94771a52e540e5780b40c2f2762eee6afbd9286502116ddb" - "sha512=474a70b0de57bb31f56fe3a9e410dcc482d3c0abd791809cf103273a7ce347d6d23912920f66d60e95d1113c3ec023f2903bc0f71150a1a9eb49c24928bf7bb2" - ] -} -x-commit-hash: "b5efb79871d290072a17f755566c8288cf069e4f" diff --git a/rtop.esy.lock/opam/ocamlbuild.0.14.1/opam b/rtop.esy.lock/opam/ocamlbuild.0.14.2/opam similarity index 83% rename from rtop.esy.lock/opam/ocamlbuild.0.14.1/opam rename to rtop.esy.lock/opam/ocamlbuild.0.14.2/opam index d7413780d..74bfbb272 100644 --- a/rtop.esy.lock/opam/ocamlbuild.0.14.1/opam +++ b/rtop.esy.lock/opam/ocamlbuild.0.14.2/opam @@ -31,9 +31,9 @@ build: [ ] dev-repo: "git+https://github.com/ocaml/ocamlbuild.git" url { - src: "https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.1.tar.gz" + src: "https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz" checksum: [ - "md5=7027e507ed85f290923ad198f3d2cd1c" - "sha512=1f5b43215b1d3dc427b9c64e005add9d423ed4bca9686d52c55912df8955647cb2d7d86622d44b41b14c4f0d657b770c27967c541c868eeb7c78e3bd35b827ad" + "md5=2f407fadd57b073155a6aead887d9676" + "sha512=f568bf10431a1f701e8bd7554dc662400a0d978411038bbad93d44dceab02874490a8a5886a9b44e017347e7949997f13f5c3752f74e1eb5e273d2beb19a75fd" ] } \ No newline at end of file diff --git a/rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch b/rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch new file mode 100644 index 000000000..8011238cd --- /dev/null +++ b/rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch @@ -0,0 +1,12 @@ +diff a/configure b/configure +--- a/configure ++++ b/configure +@@ -294,7 +294,7 @@ + # If findlib has been configured -sitelib $(ocamlc -where) then there's + # nothing to do, but otherwise we need to put OCaml's Standard Library + # into the path setting. +- if [ ! -e "${ocaml_sitelib}/stdlib/META" ]; then ++ if [ ! -e "${ocaml_sitelib}/stdlib.cmi" ]; then + ocamlpath="${ocaml_core_stdlib}${path_sep}${ocamlpath}" + fi + fi diff --git a/rtop.esy.lock/opam/ocamlfind.1.9.3/opam b/rtop.esy.lock/opam/ocamlfind.1.9.6/opam similarity index 70% rename from rtop.esy.lock/opam/ocamlfind.1.9.3/opam rename to rtop.esy.lock/opam/ocamlfind.1.9.6/opam index 971a203f1..a81f0c50e 100644 --- a/rtop.esy.lock/opam/ocamlfind.1.9.3/opam +++ b/rtop.esy.lock/opam/ocamlfind.1.9.6/opam @@ -13,7 +13,7 @@ authors: "Gerd Stolpmann " homepage: "http://projects.camlcity.org/projects/findlib.html" bug-reports: "https://github.com/ocaml/ocamlfind/issues" depends: [ - "ocaml" {>= "4.00.0"} + "ocaml" {>= "3.08.0"} ] depopts: ["graphics"] build: [ @@ -34,11 +34,15 @@ install: [ [make "install"] ["install" "-m" "0755" "ocaml-stub" "%{bin}%/ocaml"] {ocaml:preinstalled} ] +extra-files: ["0001-Harden-test-for-OCaml-5.patch" "md5=3cddbf72164c29d4e50e077a92a37c6c"] +# See https://github.com/ocaml/ocamlfind/pull/61 +patches: ["0001-Harden-test-for-OCaml-5.patch"] dev-repo: "git+https://github.com/ocaml/ocamlfind.git" url { - src: "http://download.camlcity.org/download/findlib-1.9.3.tar.gz" + src: "http://download.camlcity.org/download/findlib-1.9.6.tar.gz" checksum: [ - "md5=24047dd8a0da5322253de9b7aa254e42" - "sha512=27cc4ce141576bf477fb9d61a82ad65f55478740eed59fb43f43edb794140829fd2ff89ad27d8a890cfc336b54c073a06de05b31100fc7c01cacbd7d88e928ea" + "md5=96c6ee50a32cca9ca277321262dbec57" + "sha512=cfaf1872d6ccda548f07d32cc6b90c3aafe136d2aa6539e03143702171ee0199add55269bba894c77115535dc46a5835901a5d7c75768999e72db503bfd83027" ] } +available: os != "win32" diff --git a/rtop.esy.lock/opam/reason.3.8.0/opam b/rtop.esy.lock/opam/reason.3.8.2/opam similarity index 59% rename from rtop.esy.lock/opam/reason.3.8.0/opam rename to rtop.esy.lock/opam/reason.3.8.2/opam index 8baba1f48..83b706feb 100644 --- a/rtop.esy.lock/opam/reason.3.8.0/opam +++ b/rtop.esy.lock/opam/reason.3.8.2/opam @@ -5,14 +5,14 @@ license: "MIT" homepage: "https://github.com/reasonml/reason" doc: "https://reasonml.github.io/" bug-reports: "https://github.com/reasonml/reason/issues" -dev-repo: "git://github.com/reasonml/reason.git" +dev-repo: "git+https://github.com/reasonml/reason.git" tags: [ "syntax" ] build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03" & < "4.15"} - "dune" {>= "1.4"} + "ocaml" {>= "4.03" & < "5.1"} + "dune" {>= "2.3"} "ocamlfind" {build} "menhir" {>= "20180523"} "merlin-extend" {>= "0.6"} @@ -20,7 +20,6 @@ depends: [ "result" "ppx_derivers" ] -conflicts: [ "base-effects" ] synopsis: "Reason: Syntax & Toolchain for OCaml" description: """ Reason gives OCaml a new syntax that is remniscient of languages like @@ -28,10 +27,10 @@ JavaScript. It's also the umbrella project for a set of tools for the OCaml & JavaScript ecosystem.""" url { src: - "https://github.com/reasonml/reason/releases/download/3.8.0/reason-3.8.0.tbz" + "https://github.com/reasonml/reason/releases/download/3.8.2/reason-3.8.2.tbz" checksum: [ - "sha256=9478724b01767320064ba950ddea24c5df0eefdcdd8ff1324ba9ccd646258979" - "sha512=c5dcec810a1981b78b19271a8a255f4087628514725d6818419b141be6346a62b28fe8d0f10855efe420ede2839bfe562aa5abf21f29d66250e5c0d02323d6d8" + "sha256=7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2" + "sha512=45822ecf4b19b892e1d150fd7f7a80af18df576b204647d4bbb9a18ac591a690f9b5338789ecccacb2d6b6354dbc32ff4a3574cc8b82b777e21cb8729f502f95" ] } -x-commit-hash: "52fcae90ef3b304f55dce0a57125a2483e792a03" +x-commit-hash: "6e6c3a7c2714aeaee93b421b3ffc040874bd3b3a" diff --git a/rtop.esy.lock/opam/topkg.1.0.5/opam b/rtop.esy.lock/opam/topkg.1.0.7/opam similarity index 66% rename from rtop.esy.lock/opam/topkg.1.0.5/opam rename to rtop.esy.lock/opam/topkg.1.0.7/opam index 3b2f63a01..83fc06f49 100644 --- a/rtop.esy.lock/opam/topkg.1.0.5/opam +++ b/rtop.esy.lock/opam/topkg.1.0.7/opam @@ -1,22 +1,6 @@ opam-version: "2.0" -synopsis: """The transitory OCaml software packager""" -maintainer: ["Daniel Bünzli "] -authors: ["The topkg programmers"] -homepage: "https://erratique.ch/software/topkg" -doc: "https://erratique.ch/software/topkg/doc" -dev-repo: "git+https://erratique.ch/repos/topkg.git" -bug-reports: "https://github.com/dbuenzli/topkg/issues" -license: ["ISC"] -tags: ["packaging" "ocamlbuild" "org:erratique"] -depends: ["ocaml" {>= "4.05.0"} - "ocamlfind" {build & >= "1.6.1"} - "ocamlbuild"] -build: [["ocaml" "pkg/pkg.ml" "build" "--pkg-name" name - "--dev-pkg" "%{dev}%"]] -url { - src: "https://erratique.ch/software/topkg/releases/topkg-1.0.5.tbz" - checksum: "sha512=9450e9139209aacd8ddb4ba18e4225770837e526a52a56d94fd5c9c4c9941e83e0e7102e2292b440104f4c338fabab47cdd6bb51d69b41cc92cc7a551e6fefab"} -description: """ +synopsis: "The transitory OCaml software packager" +description: """\ Topkg is a packager for distributing OCaml software. It provides an API to describe the files a package installs in a given build configuration and to specify information about the package's @@ -41,4 +25,23 @@ Topkg-care is distributed under the ISC license it depends on [cmdliner]: http://erratique.ch/software/cmdliner [webbrowser]: http://erratique.ch/software/webbrowser -Home page: http://erratique.ch/software/topkg""" \ No newline at end of file +Home page: http://erratique.ch/software/topkg""" +maintainer: "Daniel Bünzli " +authors: "The topkg programmers" +license: "ISC" +tags: ["packaging" "ocamlbuild" "org:erratique"] +homepage: "https://erratique.ch/software/topkg" +doc: "https://erratique.ch/software/topkg/doc" +bug-reports: "https://github.com/dbuenzli/topkg/issues" +depends: [ + "ocaml" {>= "4.05.0"} + "ocamlfind" {build & >= "1.6.1"} + "ocamlbuild" +] +build: ["ocaml" "pkg/pkg.ml" "build" "--pkg-name" name "--dev-pkg" "%{dev}%"] +dev-repo: "git+https://erratique.ch/repos/topkg.git" +url { + src: "https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz" + checksum: + "sha512=09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535" +} \ No newline at end of file diff --git a/rtop.esy.lock/opam/utop.2.9.0/opam b/rtop.esy.lock/opam/utop.2.9.2/opam similarity index 69% rename from rtop.esy.lock/opam/utop.2.9.0/opam rename to rtop.esy.lock/opam/utop.2.9.2/opam index 4f623ef90..e1f9248a7 100644 --- a/rtop.esy.lock/opam/utop.2.9.0/opam +++ b/rtop.esy.lock/opam/utop.2.9.2/opam @@ -1,19 +1,25 @@ opam-version: "2.0" +synopsis: "Universal toplevel for OCaml" +description: """\ +utop is an improved toplevel (i.e., Read-Eval-Print Loop or REPL) for +OCaml. It can run in a terminal or in Emacs. It supports line +edition, history, real-time and context sensitive completion, colors, +and more. It integrates with the Tuareg mode in Emacs.""" maintainer: "jeremie@dimino.org" authors: "Jérémie Dimino" license: "BSD-3-Clause" homepage: "https://github.com/ocaml-community/utop" -bug-reports: "https://github.com/ocaml-community/utop/issues" doc: "https://ocaml-community.github.io/utop/" +bug-reports: "https://github.com/ocaml-community/utop/issues" depends: [ "ocaml" {>= "4.03.0"} "base-unix" "base-threads" "ocamlfind" {>= "1.7.2"} - "lambda-term" {>= "3.1.0" & < "4.0"} + "lambda-term" {>= "3.1.0" & < "3.3.0"} "lwt" "lwt_react" - "camomile" + "camomile" {< "2.0.0"} "react" {>= "1.0.0"} "cppo" {build & >= "1.1.2"} "dune" {>= "1.0"} @@ -24,19 +30,11 @@ build: [ ["dune" "runtest" "-p" name "-j" jobs] {with-test} ] dev-repo: "git+https://github.com/ocaml-community/utop.git" -synopsis: "Universal toplevel for OCaml" -description: """ -utop is an improved toplevel (i.e., Read-Eval-Print Loop or REPL) for -OCaml. It can run in a terminal or in Emacs. It supports line -edition, history, real-time and context sensitive completion, colors, -and more. It integrates with the Tuareg mode in Emacs. -""" url { src: - "https://github.com/ocaml-community/utop/releases/download/2.9.0/utop-2.9.0.tbz" + "https://github.com/ocaml-community/utop/releases/download/2.9.2/utop-2.9.2.tbz" checksum: [ - "sha256=cd7bba0576f9f1a303d645dce07ea6577aedc1c13d315b312f6a5fc356304d9e" - "sha512=81ca5814681f40c44adb4db5e840f00afc512562dc577e87ad7bcf95e65442bf24a6485db85b95a7838b47c8c9ce1b5cd3c3775bfe7dfa8c5658066fe2ab55a8" + "md5=abd1c592464ce5f31b17009954040d7c" + "sha512=db97275aa4bd7725a9eeec6d9155c239f3e48adf8d34b73f55caa2de32fde98862480db5e05dffc89e98efd12eb60e08d89ad34b9a92a8de0d37ccb32af07ddf" ] } -x-commit-hash: "676e2cd6545fd327e02330d1ccb20c02d6b26eab" diff --git a/rtop.esy.lock/opam/yojson.1.7.0/opam b/rtop.esy.lock/opam/yojson.2.0.2/opam similarity index 56% rename from rtop.esy.lock/opam/yojson.1.7.0/opam rename to rtop.esy.lock/opam/yojson.2.0.2/opam index f5438059e..3b22e3899 100644 --- a/rtop.esy.lock/opam/yojson.1.7.0/opam +++ b/rtop.esy.lock/opam/yojson.2.0.2/opam @@ -1,38 +1,38 @@ opam-version: "2.0" -maintainer: "martin@mjambon.com" +maintainer: ["nathan@cryptosense.com" "marek@xivilization.net"] authors: ["Martin Jambon"] homepage: "https://github.com/ocaml-community/yojson" bug-reports: "https://github.com/ocaml-community/yojson/issues" dev-repo: "git+https://github.com/ocaml-community/yojson.git" doc: "https://ocaml-community.github.io/yojson/" +license: "BSD-3-Clause" build: [ ["dune" "subst"] {dev} ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@doc" "-p" name "-j" jobs] {with-doc} ] -run-test: [["dune" "runtest" "-p" name "-j" jobs]] depends: [ "ocaml" {>= "4.02.3"} - "dune" + "dune" {>= "2.0"} "cppo" {build} - "easy-format" - "biniou" {>= "1.2.0"} "alcotest" {with-test & >= "0.8.5"} + "odoc" {with-doc} + "seq" {>= "0.2.2"} ] synopsis: "Yojson is an optimized parsing and printing library for the JSON format" description: """ Yojson is an optimized parsing and printing library for the JSON format. -It addresses a few shortcomings of json-wheel including 2x speedup, -polymorphic variants and optional syntax for tuples and variants. - ydump is a pretty-printing command-line program provided with the -yojson package. - -The program atdgen can be used to derive OCaml-JSON serializers and -deserializers from type definitions.""" +yojson package.""" url { src: - "https://github.com/ocaml-community/yojson/releases/download/1.7.0/yojson-1.7.0.tbz" - checksum: "md5=b89d39ca3f8c532abe5f547ad3b8f84d" + "https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz" + checksum: [ + "sha256=876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" + "sha512=9e150689a814a64e53e361e336fe826df5a3e3851d1367fda4a001392175c29348de55db0b7d7ba18539dec2cf78198efcb7f41b77a9861763f5aa97c05509ad" + ] } +x-commit-hash: "17ca03c5877a4346f0691443f35ed9678f99962f" diff --git a/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/files/winpatch.patch b/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch similarity index 100% rename from rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/files/winpatch.patch rename to rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch diff --git a/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/package.json b/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json similarity index 100% rename from rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.1_opam_override/package.json rename to rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json diff --git a/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/files/findlib.patch b/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch similarity index 100% rename from rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/files/findlib.patch rename to rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch diff --git a/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/package.json b/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json similarity index 100% rename from rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.3_opam_override/package.json rename to rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json diff --git a/rtop.json b/rtop.json index 388f2cbd1..ba93cfb59 100644 --- a/rtop.json +++ b/rtop.json @@ -9,24 +9,16 @@ "dependencies": { "@esy-ocaml/substs": "^0.0.1", "@opam/ocamlfind": "*", - "@opam/result": "*", "@opam/dune": "2.9.3", "@opam/reason": "^3.8.0", "@opam/utop": " >= 1.17.0", - "ocaml": ">= 4.2.0 < 5.1.0" + "ocaml": ">= 4.3.0 < 5.1.0" }, "devDependencies": { "@opam/merlin": "*", - "ocaml": "~4.12.0" + "ocaml": "~4.14.0" }, "esy": { - "build": [ - [ - "dune", - "build", - "-p", - "rtop" - ] - ] + "build": [ [ "dune", "build", "-p", "reason", "--disable-promotion" ] ] } } diff --git a/src/reason-parser/reason_errors.ml b/src/reason-parser/reason_errors.ml index b23970c07..c7dc30487 100644 --- a/src/reason-parser/reason_errors.ml +++ b/src/reason-parser/reason_errors.ml @@ -55,8 +55,8 @@ let recover_non_fatal_errors f = catch_errors := Some errors; let result = match f () with - | x -> Result.Ok x - | exception exn -> Result.Error exn + | x -> Ok x + | exception exn -> Error exn in catch_errors := catch_errors0; (result, List.rev !errors) diff --git a/src/reason-parser/reason_errors.mli b/src/reason-parser/reason_errors.mli index a3a745ed1..05e547d61 100644 --- a/src/reason-parser/reason_errors.mli +++ b/src/reason-parser/reason_errors.mli @@ -39,7 +39,7 @@ val raise_error : reason_error -> Location.t -> unit val raise_fatal_error : reason_error -> Location.t -> 'a val recover_non_fatal_errors : (unit -> 'a) -> - ('a, exn) Result.result * (reason_error * Location.t) list + ('a, exn) result * (reason_error * Location.t) list val recover_parser_error : (Location.t -> string -> 'a) -> Location.t -> string -> 'a diff --git a/src/refmt/printer_maker.ml b/src/refmt/printer_maker.ml index 76f0a05ae..aba0b359c 100644 --- a/src/refmt/printer_maker.ml +++ b/src/refmt/printer_maker.ml @@ -45,11 +45,11 @@ let ocamlBinaryParser use_stdin filename = file_chan in match Ast_io.from_channel chan with - | Result.Error _ -> assert false - | Result.Ok (_, Ast_io.Impl ((module Version), ast)) -> + | Error _ -> assert false + | Ok (_, Ast_io.Impl ((module Version), ast)) -> let module Convert = Convert(Version)(OCaml_408) in ((Obj.magic (Convert.copy_structure ast), []), true, false) - | Result.Ok (_, Ast_io.Intf ((module Version), ast)) -> + | Ok (_, Ast_io.Intf ((module Version), ast)) -> let module Convert = Convert(Version)(OCaml_408) in ((Obj.magic (Convert.copy_signature ast), []), true, true) diff --git a/src/vendored-omp/src/dune b/src/vendored-omp/src/dune index 14494c5b6..489d709e8 100644 --- a/src/vendored-omp/src/dune +++ b/src/vendored-omp/src/dune @@ -6,7 +6,7 @@ (wrapped true) ; (wrapped ; (transition "Access modules via the Migrate_parsetree toplevel module")) - (libraries compiler-libs.common result ppx_derivers) + (libraries compiler-libs.common ppx_derivers) (modules :standard \ migrate_parsetree_driver_main) (preprocess (action diff --git a/src/vendored-omp/src/migrate_parsetree_ast_io.ml b/src/vendored-omp/src/migrate_parsetree_ast_io.ml index 2c5f47aa2..6d6d529d0 100644 --- a/src/vendored-omp/src/migrate_parsetree_ast_io.ml +++ b/src/vendored-omp/src/migrate_parsetree_ast_io.ml @@ -12,7 +12,6 @@ (* special exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) -open Result type ast = | Impl : (module Migrate_parsetree_versions.OCaml_version with diff --git a/src/vendored-omp/src/migrate_parsetree_ast_io.mli b/src/vendored-omp/src/migrate_parsetree_ast_io.mli index d16960f1c..41ab59ef8 100644 --- a/src/vendored-omp/src/migrate_parsetree_ast_io.mli +++ b/src/vendored-omp/src/migrate_parsetree_ast_io.mli @@ -12,7 +12,6 @@ (* special exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) -open Result[@@ocaml.warning "-33"] (** A marshalled ast packs the ast with the corresponding version of the frontend *) From 4373783577d807646f1b1ee725b56ffb3e0bbc48 Mon Sep 17 00:00:00 2001 From: David Sancho Date: Sun, 26 Mar 2023 16:30:54 +0200 Subject: [PATCH 15/20] Fix version on refmt (#2701) --- Makefile | 18 +- dune-project | 2 + esy.json | 13 +- esy.lock/index.json | 616 +++++++++- .../opam/base-bigarray.base}/opam | 2 +- esy.lock/opam/chrome-trace.3.7.0/opam | 39 + esy.lock/opam/dune-build-info.3.7.0/opam | 45 + esy.lock/opam/dune-rpc.3.6.2/opam | 43 + esy.lock/opam/{dune.3.6.2 => dune.3.7.0}/opam | 8 +- esy.lock/opam/dyn.3.6.2/opam | 40 + esy.lock/opam/fiber.3.6.2/opam | 41 + .../opam/ocaml-lsp-server.1.15.1-4.14/opam | 66 ++ esy.lock/opam/ocamlc-loc.3.6.2/opam | 40 + esy.lock/opam/ocamlformat-rpc-lib.0.25.1/opam | 39 + esy.lock/opam/octavius.1.2.2/opam | 33 + esy.lock/opam/omd.1.3.2/opam | 50 + esy.lock/opam/ordering.3.6.2/opam | 38 + esy.lock/opam/pp.1.1.2/opam | 58 + .../opam/ppx_yojson_conv_lib.v0.15.0/opam | 24 + esy.lock/opam/spawn.v0.15.1/opam | 56 + esy.lock/opam/stdune.3.6.2/opam | 44 + esy.lock/opam/xdg.3.7.0/opam | 39 + .../opam/yojson.2.0.2/opam | 0 reason.esy.lock/.gitattributes | 3 - reason.esy.lock/.gitignore | 3 - reason.esy.lock/index.json | 479 -------- reason.esy.lock/opam/base-threads.base/opam | 6 - reason.esy.lock/opam/base-unix.base/opam | 6 - reason.esy.lock/opam/cppo.1.6.9/opam | 39 - reason.esy.lock/opam/csexp.1.5.1/opam | 60 - .../opam/dot-merlin-reader.4.6/opam | 30 - reason.esy.lock/opam/dune.2.9.3/opam | 57 - reason.esy.lock/opam/fix.20220121/opam | 26 - reason.esy.lock/opam/menhir.20220210/opam | 29 - reason.esy.lock/opam/menhirLib.20220210/opam | 30 - reason.esy.lock/opam/menhirSdk.20220210/opam | 30 - reason.esy.lock/opam/merlin-extend.0.6.1/opam | 30 - reason.esy.lock/opam/merlin-lib.4.8-414/opam | 34 - reason.esy.lock/opam/merlin.4.8-414/opam | 78 -- .../files/0001-Harden-test-for-OCaml-5.patch | 12 - reason.esy.lock/opam/ocamlfind.1.9.6/opam | 48 - reason.esy.lock/opam/ppx_derivers.1.2.1/opam | 23 - reason.esy.lock/opam/seq.base/files/META.seq | 4 - .../opam/seq.base/files/seq.install | 3 - reason.esy.lock/opam/seq.base/opam | 15 - .../files/findlib.patch | 485 -------- .../package.json | 61 - reason.json | 3 +- reason.opam | 9 +- rtop.esy.lock/.gitattributes | 3 - rtop.esy.lock/.gitignore | 3 - rtop.esy.lock/index.json | 1016 ----------------- rtop.esy.lock/opam/base-bytes.base/opam | 9 - rtop.esy.lock/opam/base-threads.base/opam | 6 - rtop.esy.lock/opam/camomile.1.0.2/opam | 35 - rtop.esy.lock/opam/charInfo_width.1.1.0/opam | 27 - rtop.esy.lock/opam/cppo.1.6.9/opam | 39 - rtop.esy.lock/opam/csexp.1.5.1/opam | 60 - rtop.esy.lock/opam/dot-merlin-reader.4.6/opam | 30 - .../opam/dune-configurator.2.9.3/opam | 48 - rtop.esy.lock/opam/dune.2.9.3/opam | 57 - rtop.esy.lock/opam/fix.20220121/opam | 26 - rtop.esy.lock/opam/lambda-term.3.2.0/opam | 37 - rtop.esy.lock/opam/lwt.5.6.1/opam | 57 - rtop.esy.lock/opam/lwt_log.1.1.2/opam | 31 - rtop.esy.lock/opam/lwt_react.1.2.0/opam | 34 - rtop.esy.lock/opam/menhir.20220210/opam | 29 - rtop.esy.lock/opam/menhirLib.20220210/opam | 30 - rtop.esy.lock/opam/menhirSdk.20220210/opam | 30 - rtop.esy.lock/opam/merlin-extend.0.6.1/opam | 30 - rtop.esy.lock/opam/merlin-lib.4.8-414/opam | 34 - rtop.esy.lock/opam/merlin.4.8-414/opam | 78 -- rtop.esy.lock/opam/mew.0.1.0/opam | 25 - rtop.esy.lock/opam/mew_vi.0.5.0/opam | 25 - rtop.esy.lock/opam/ocamlbuild.0.14.2/opam | 39 - .../files/0001-Harden-test-for-OCaml-5.patch | 12 - rtop.esy.lock/opam/ocamlfind.1.9.6/opam | 48 - rtop.esy.lock/opam/ocplib-endian.1.2/opam | 40 - rtop.esy.lock/opam/ppx_derivers.1.2.1/opam | 23 - rtop.esy.lock/opam/react.1.2.2/opam | 34 - rtop.esy.lock/opam/reason.3.8.2/opam | 36 - rtop.esy.lock/opam/result.1.5/opam | 22 - rtop.esy.lock/opam/seq.base/files/META.seq | 4 - rtop.esy.lock/opam/seq.base/files/seq.install | 3 - rtop.esy.lock/opam/seq.base/opam | 15 - rtop.esy.lock/opam/topkg.1.0.7/opam | 47 - rtop.esy.lock/opam/trie.1.0.0/opam | 19 - rtop.esy.lock/opam/utop.2.9.2/opam | 40 - rtop.esy.lock/opam/yojson.2.0.2/opam | 38 - rtop.esy.lock/opam/zed.3.1.0/opam | 32 - .../files/winpatch.patch | 11 - .../package.json | 29 - .../files/findlib.patch | 485 -------- .../package.json | 61 - rtop.json | 10 +- rtop.opam | 6 +- src/refmt/.gitignore | 1 + src/refmt/dune | 11 +- src/refmt/git_commit.mli | 5 + src/refmt/package.ml | 9 +- src/refmt/package.ml.in | 3 - test/version.t | 6 +- 102 files changed, 1315 insertions(+), 4530 deletions(-) rename {rtop.esy.lock/opam/base-unix.base => esy.lock/opam/base-bigarray.base}/opam (66%) create mode 100644 esy.lock/opam/chrome-trace.3.7.0/opam create mode 100644 esy.lock/opam/dune-build-info.3.7.0/opam create mode 100644 esy.lock/opam/dune-rpc.3.6.2/opam rename esy.lock/opam/{dune.3.6.2 => dune.3.7.0}/opam (83%) create mode 100644 esy.lock/opam/dyn.3.6.2/opam create mode 100644 esy.lock/opam/fiber.3.6.2/opam create mode 100644 esy.lock/opam/ocaml-lsp-server.1.15.1-4.14/opam create mode 100644 esy.lock/opam/ocamlc-loc.3.6.2/opam create mode 100644 esy.lock/opam/ocamlformat-rpc-lib.0.25.1/opam create mode 100644 esy.lock/opam/octavius.1.2.2/opam create mode 100644 esy.lock/opam/omd.1.3.2/opam create mode 100644 esy.lock/opam/ordering.3.6.2/opam create mode 100644 esy.lock/opam/pp.1.1.2/opam create mode 100644 esy.lock/opam/ppx_yojson_conv_lib.v0.15.0/opam create mode 100644 esy.lock/opam/spawn.v0.15.1/opam create mode 100644 esy.lock/opam/stdune.3.6.2/opam create mode 100644 esy.lock/opam/xdg.3.7.0/opam rename {reason.esy.lock => esy.lock}/opam/yojson.2.0.2/opam (100%) delete mode 100644 reason.esy.lock/.gitattributes delete mode 100644 reason.esy.lock/.gitignore delete mode 100644 reason.esy.lock/index.json delete mode 100644 reason.esy.lock/opam/base-threads.base/opam delete mode 100644 reason.esy.lock/opam/base-unix.base/opam delete mode 100644 reason.esy.lock/opam/cppo.1.6.9/opam delete mode 100644 reason.esy.lock/opam/csexp.1.5.1/opam delete mode 100644 reason.esy.lock/opam/dot-merlin-reader.4.6/opam delete mode 100644 reason.esy.lock/opam/dune.2.9.3/opam delete mode 100644 reason.esy.lock/opam/fix.20220121/opam delete mode 100644 reason.esy.lock/opam/menhir.20220210/opam delete mode 100644 reason.esy.lock/opam/menhirLib.20220210/opam delete mode 100644 reason.esy.lock/opam/menhirSdk.20220210/opam delete mode 100644 reason.esy.lock/opam/merlin-extend.0.6.1/opam delete mode 100644 reason.esy.lock/opam/merlin-lib.4.8-414/opam delete mode 100644 reason.esy.lock/opam/merlin.4.8-414/opam delete mode 100644 reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch delete mode 100644 reason.esy.lock/opam/ocamlfind.1.9.6/opam delete mode 100644 reason.esy.lock/opam/ppx_derivers.1.2.1/opam delete mode 100644 reason.esy.lock/opam/seq.base/files/META.seq delete mode 100644 reason.esy.lock/opam/seq.base/files/seq.install delete mode 100644 reason.esy.lock/opam/seq.base/opam delete mode 100644 reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch delete mode 100644 reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json delete mode 100644 rtop.esy.lock/.gitattributes delete mode 100644 rtop.esy.lock/.gitignore delete mode 100644 rtop.esy.lock/index.json delete mode 100644 rtop.esy.lock/opam/base-bytes.base/opam delete mode 100644 rtop.esy.lock/opam/base-threads.base/opam delete mode 100644 rtop.esy.lock/opam/camomile.1.0.2/opam delete mode 100644 rtop.esy.lock/opam/charInfo_width.1.1.0/opam delete mode 100644 rtop.esy.lock/opam/cppo.1.6.9/opam delete mode 100644 rtop.esy.lock/opam/csexp.1.5.1/opam delete mode 100644 rtop.esy.lock/opam/dot-merlin-reader.4.6/opam delete mode 100644 rtop.esy.lock/opam/dune-configurator.2.9.3/opam delete mode 100644 rtop.esy.lock/opam/dune.2.9.3/opam delete mode 100644 rtop.esy.lock/opam/fix.20220121/opam delete mode 100644 rtop.esy.lock/opam/lambda-term.3.2.0/opam delete mode 100644 rtop.esy.lock/opam/lwt.5.6.1/opam delete mode 100644 rtop.esy.lock/opam/lwt_log.1.1.2/opam delete mode 100644 rtop.esy.lock/opam/lwt_react.1.2.0/opam delete mode 100644 rtop.esy.lock/opam/menhir.20220210/opam delete mode 100644 rtop.esy.lock/opam/menhirLib.20220210/opam delete mode 100644 rtop.esy.lock/opam/menhirSdk.20220210/opam delete mode 100644 rtop.esy.lock/opam/merlin-extend.0.6.1/opam delete mode 100644 rtop.esy.lock/opam/merlin-lib.4.8-414/opam delete mode 100644 rtop.esy.lock/opam/merlin.4.8-414/opam delete mode 100644 rtop.esy.lock/opam/mew.0.1.0/opam delete mode 100644 rtop.esy.lock/opam/mew_vi.0.5.0/opam delete mode 100644 rtop.esy.lock/opam/ocamlbuild.0.14.2/opam delete mode 100644 rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch delete mode 100644 rtop.esy.lock/opam/ocamlfind.1.9.6/opam delete mode 100644 rtop.esy.lock/opam/ocplib-endian.1.2/opam delete mode 100644 rtop.esy.lock/opam/ppx_derivers.1.2.1/opam delete mode 100644 rtop.esy.lock/opam/react.1.2.2/opam delete mode 100644 rtop.esy.lock/opam/reason.3.8.2/opam delete mode 100644 rtop.esy.lock/opam/result.1.5/opam delete mode 100644 rtop.esy.lock/opam/seq.base/files/META.seq delete mode 100644 rtop.esy.lock/opam/seq.base/files/seq.install delete mode 100644 rtop.esy.lock/opam/seq.base/opam delete mode 100644 rtop.esy.lock/opam/topkg.1.0.7/opam delete mode 100644 rtop.esy.lock/opam/trie.1.0.0/opam delete mode 100644 rtop.esy.lock/opam/utop.2.9.2/opam delete mode 100644 rtop.esy.lock/opam/yojson.2.0.2/opam delete mode 100644 rtop.esy.lock/opam/zed.3.1.0/opam delete mode 100644 rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch delete mode 100644 rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json delete mode 100644 rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch delete mode 100644 rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json create mode 100644 src/refmt/.gitignore create mode 100644 src/refmt/git_commit.mli delete mode 100644 src/refmt/package.ml.in diff --git a/Makefile b/Makefile index 86d88ef2b..b365ebab9 100644 --- a/Makefile +++ b/Makefile @@ -50,30 +50,16 @@ clean-for-ci: clean-tests .PHONY: build clean -ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) -SUBSTS:=$(ROOT_DIR)/pkg/substs - # For publishing esy releases to npm -esy-prepublish: build clean-tests pre_release +esy-prepublish: build clean-tests node ./scripts/esy-prepublish.js -# For OPAM -pre_release: -ifndef version - $(error environment variable 'version' is undefined) -endif - export git_version="$(shell git rev-parse --verify HEAD)"; \ - export git_short_version="$(shell git rev-parse --short HEAD)"; \ - $(SUBSTS) $(ROOT_DIR)/src/refmt/package.ml.in - -.PHONY: pre_release - # For OPAM release_check: ./scripts/release-check.sh # For OPAM -release: release_check pre_release +release: release_check git add package.json src/refmt/package.ml reason.opam git commit -m "Version $(version)" git tag -a $(version) -m "Version $(version)." diff --git a/dune-project b/dune-project index 2e813144b..abcdda62c 100644 --- a/dune-project +++ b/dune-project @@ -3,3 +3,5 @@ (using menhir 2.0) (cram enable) + +(version 3.8.2) diff --git a/esy.json b/esy.json index 880ecd635..c3cf11de6 100644 --- a/esy.json +++ b/esy.json @@ -3,9 +3,10 @@ "notes": "This is just the dev package config (also built as globally installable reason-cli). See ./refmt.json ./rtop.json for individual release package configs.", "license": "MIT", - "version": "3.8.1", + "version": "3.8.2", "dependencies": { - "@opam/dune": "3.6.2", + "@opam/dune": "> 3.0.0", + "@opam/dune-build-info": "> 3.0.0", "@opam/fix": "*", "@opam/menhir": " >= 20180523.0.0", "@opam/merlin-extend": " >= 0.6", @@ -14,7 +15,11 @@ "@opam/utop": " >= 1.17.0", "ocaml": " >= 4.3.0 < 4.15.0" }, - "devDependencies": { "@opam/odoc": "*", "ocaml": "~4.14.0" }, + "devDependencies": { + "@opam/ocaml-lsp-server": "1.15.1-4.14", + "@opam/odoc": "*", + "ocaml": "~4.14.0" + }, "notes-ctd": [ "This is how you make an esy monorepo for development, but then release the monorepo as many individual packages:", "1. Create a packageName-dev esy.json at the root and list the sum of all dependencies", @@ -36,7 +41,7 @@ "SYSTEM_PULLREQUEST_MERGEDAT": { "scope": "global", "val": "d" } }, "release": { - "bin": ["rtop", "refmt"], + "bin": [ "rtop", "refmt" ], "includePackages": [ "root", "@opam/base-bytes", "@opam/base-threads", "@opam/base-unix", "@opam/camomile", "@opam/lambda-term", "@opam/lwt", "@opam/lwt_log", diff --git a/esy.lock/index.json b/esy.lock/index.json index 2701b6ee7..b811aa7b4 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "c48ffab0edbecaf472e23a393cb94f51", + "checksum": "541ef021a71d9d8bce474b1d40a99f0b", "root": "reason-cli@link-dev:./esy.json", "node": { "reason-cli@link-dev:./esy.json": { @@ -14,10 +14,13 @@ "@opam/ocamlfind@opam:1.9.5@e83abf74", "@opam/merlin-extend@opam:0.6.1@7d979feb", "@opam/menhir@opam:20220210@ff5ea9a7", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/fix@opam:20220121@17b9a1a4", + "@opam/dune-build-info@opam:3.7.0@ce68449d", + "@opam/dune@opam:3.7.0@95218dc4" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/odoc@opam:2.2.0@020767ad" + "ocaml@4.14.0@d41d8cd9", "@opam/odoc@opam:2.2.0@020767ad", + "@opam/ocaml-lsp-server@opam:1.15.1-4.14@76510e53" ] }, "ocaml@4.14.0@d41d8cd9": { @@ -56,14 +59,66 @@ "@opam/uuseg@opam:15.0.0@14085231", "@opam/uucp@opam:15.0.0@55460339", "@opam/uchar@opam:0.0.2@aedf91f9", "@opam/result@opam:1.5@1c6a6533", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/uuseg@opam:15.0.0@14085231", "@opam/uucp@opam:15.0.0@55460339", "@opam/uchar@opam:0.0.2@aedf91f9", "@opam/result@opam:1.5@1c6a6533", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/yojson@opam:2.0.2@eb65f292": { + "id": "@opam/yojson@opam:2.0.2@eb65f292", + "name": "@opam/yojson", + "version": "opam:2.0.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/87/876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b", + "archive:https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" + ], + "opam": { + "name": "yojson", + "version": "2.0.2", + "path": "esy.lock/opam/yojson.2.0.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/cppo@opam:1.6.9@db929a12", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", + "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/xdg@opam:3.7.0@449d6490": { + "id": "@opam/xdg@opam:3.7.0@449d6490", + "name": "@opam/xdg", + "version": "opam:3.7.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/e2/e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8", + "archive:https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + ], + "opam": { + "name": "xdg", + "version": "3.7.0", + "path": "esy.lock/opam/xdg.3.7.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/uutf@opam:1.0.3@47c95a18": { @@ -172,7 +227,7 @@ "@opam/lwt_react@opam:1.2.0@4253a145", "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", "@opam/lambda-term@opam:3.3.1@ee145aff", - "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" @@ -184,7 +239,7 @@ "@opam/lwt_react@opam:1.2.0@4253a145", "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", "@opam/lambda-term@opam:3.3.1@ee145aff", - "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084" ] @@ -237,12 +292,12 @@ "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/seq@opam:base@d8d7de1d", "@opam/re@opam:1.10.4@c4910ba6", - "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/uutf@opam:1.0.3@47c95a18", "@opam/seq@opam:base@d8d7de1d", "@opam/re@opam:1.10.4@c4910ba6", - "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/trie@opam:1.0.0@f4e510e2": { @@ -263,11 +318,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/topkg@opam:1.0.7@7ee47d76": { @@ -296,6 +351,64 @@ "ocaml@4.14.0@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28" ] }, + "@opam/stdune@opam:3.6.2@47d75c4b": { + "id": "@opam/stdune@opam:3.6.2@47d75c4b", + "name": "@opam/stdune", + "version": "opam:3.6.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", + "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + ], + "opam": { + "name": "stdune", + "version": "3.6.2", + "path": "esy.lock/opam/stdune.3.6.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/pp@opam:1.1.2@89ad03b5", + "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/dyn@opam:3.6.2@38120dfc", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/csexp@opam:1.5.1@8a8fb3a7", + "@opam/base-unix@opam:base@87d0b2eb", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/pp@opam:1.1.2@89ad03b5", + "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/dyn@opam:3.6.2@38120dfc", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/csexp@opam:1.5.1@8a8fb3a7", + "@opam/base-unix@opam:base@87d0b2eb" + ] + }, + "@opam/spawn@opam:v0.15.1@85e9d6f1": { + "id": "@opam/spawn@opam:v0.15.1@85e9d6f1", + "name": "@opam/spawn", + "version": "opam:v0.15.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/9a/9afdee314fab6c3fcd689ab6eb5608d6b78078e6dede3953a47debde06c19d50#sha256:9afdee314fab6c3fcd689ab6eb5608d6b78078e6dede3953a47debde06c19d50", + "archive:https://github.com/janestreet/spawn/archive/v0.15.1.tar.gz#sha256:9afdee314fab6c3fcd689ab6eb5608d6b78078e6dede3953a47debde06c19d50" + ], + "opam": { + "name": "spawn", + "version": "v0.15.1", + "path": "esy.lock/opam/spawn.v0.15.1" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, "@opam/seq@opam:base@d8d7de1d": { "id": "@opam/seq@opam:base@d8d7de1d", "name": "@opam/seq", @@ -333,11 +446,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/react@opam:1.2.2@e0f4480e": { @@ -384,11 +497,37 @@ "overrides": [], "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/ppx_yojson_conv_lib@opam:v0.15.0@773058a7": { + "id": "@opam/ppx_yojson_conv_lib@opam:v0.15.0@773058a7", + "name": "@opam/ppx_yojson_conv_lib", + "version": "opam:v0.15.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/f9/f9d2c5eff4566ec1f1f379b186ed22c8ddd6be0909a160bc5a9ac7abc6a6b684#sha256:f9d2c5eff4566ec1f1f379b186ed22c8ddd6be0909a160bc5a9ac7abc6a6b684", + "archive:https://ocaml.janestreet.com/ocaml-core/v0.15/files/ppx_yojson_conv_lib-v0.15.0.tar.gz#sha256:f9d2c5eff4566ec1f1f379b186ed22c8ddd6be0909a160bc5a9ac7abc6a6b684" + ], + "opam": { + "name": "ppx_yojson_conv_lib", + "version": "v0.15.0", + "path": "esy.lock/opam/ppx_yojson_conv_lib.v0.15.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/ppx_derivers@opam:1.2.1@e2cbad12": { @@ -409,11 +548,90 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/pp@opam:1.1.2@89ad03b5": { + "id": "@opam/pp@opam:1.1.2@89ad03b5", + "name": "@opam/pp", + "version": "opam:1.1.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/e4/e4a4e98d96b1bb76950fcd6da4e938c86d989df4d7e48f02f7a44595f5af1d56#sha256:e4a4e98d96b1bb76950fcd6da4e938c86d989df4d7e48f02f7a44595f5af1d56", + "archive:https://github.com/ocaml-dune/pp/releases/download/1.1.2/pp-1.1.2.tbz#sha256:e4a4e98d96b1bb76950fcd6da4e938c86d989df4d7e48f02f7a44595f5af1d56" + ], + "opam": { + "name": "pp", + "version": "1.1.2", + "path": "esy.lock/opam/pp.1.1.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/ordering@opam:3.6.2@37bc3093": { + "id": "@opam/ordering@opam:3.6.2@37bc3093", + "name": "@opam/ordering", + "version": "opam:3.6.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", + "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + ], + "opam": { + "name": "ordering", + "version": "3.6.2", + "path": "esy.lock/opam/ordering.3.6.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/omd@opam:1.3.2@511d53d2": { + "id": "@opam/omd@opam:1.3.2@511d53d2", + "name": "@opam/omd", + "version": "opam:1.3.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/60/6023e1642631f08f678eb5725820879ed7bb5a3ffee777cdedebc28c1f85fadb#sha256:6023e1642631f08f678eb5725820879ed7bb5a3ffee777cdedebc28c1f85fadb", + "archive:https://github.com/ocaml/omd/releases/download/1.3.2/omd-1.3.2.tbz#sha256:6023e1642631f08f678eb5725820879ed7bb5a3ffee777cdedebc28c1f85fadb" + ], + "opam": { + "name": "omd", + "version": "1.3.2", + "path": "esy.lock/opam/omd.1.3.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/base-bytes@opam:base@19d0c2ff", + "@opam/base-bigarray@opam:base@b03491b0", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/base-bytes@opam:base@19d0c2ff", + "@opam/base-bigarray@opam:base@b03491b0" ] }, "@opam/odoc-parser@opam:2.0.0@a08011a0": { @@ -435,14 +653,14 @@ "overrides": [], "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/camlp-streams@opam:5.0.1@daaa0f94", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/camlp-streams@opam:5.0.1@daaa0f94", "@opam/astring@opam:0.8.5@1300cee8" ] @@ -469,7 +687,7 @@ "@opam/result@opam:1.5@1c6a6533", "@opam/odoc-parser@opam:2.0.0@a08011a0", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.9.0@87213963", - "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/cppo@opam:1.6.9@db929a12", "@opam/cmdliner@opam:1.1.1@03763729", "@opam/astring@opam:0.8.5@1300cee8", "@esy-ocaml/substs@0.0.1@d41d8cd9" @@ -479,11 +697,36 @@ "@opam/result@opam:1.5@1c6a6533", "@opam/odoc-parser@opam:2.0.0@a08011a0", "@opam/fpath@opam:0.7.3@674d8125", "@opam/fmt@opam:0.9.0@87213963", - "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/cmdliner@opam:1.1.1@03763729", "@opam/astring@opam:0.8.5@1300cee8" ] }, + "@opam/octavius@opam:1.2.2@2205cc65": { + "id": "@opam/octavius@opam:1.2.2@2205cc65", + "name": "@opam/octavius", + "version": "opam:1.2.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/md5/72/72f9e1d996e6c5089fc513cc9218607b#md5:72f9e1d996e6c5089fc513cc9218607b", + "archive:https://github.com/ocaml-doc/octavius/archive/v1.2.2.tar.gz#md5:72f9e1d996e6c5089fc513cc9218607b" + ], + "opam": { + "name": "octavius", + "version": "1.2.2", + "path": "esy.lock/opam/octavius.1.2.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, "@opam/ocplib-endian@opam:1.2@008dc942": { "id": "@opam/ocplib-endian@opam:1.2@008dc942", "name": "@opam/ocplib-endian", @@ -502,16 +745,42 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-bytes@opam:base@19d0c2ff", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@opam/base-bytes@opam:base@19d0c2ff" ] }, + "@opam/ocamlformat-rpc-lib@opam:0.25.1@fb9fa86e": { + "id": "@opam/ocamlformat-rpc-lib@opam:0.25.1@fb9fa86e", + "name": "@opam/ocamlformat-rpc-lib", + "version": "opam:0.25.1", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/dc/dc8f2a330ca3930b36cacb2623bb360ed8bdf6e4a8acd293dbd9e2241a6fd33d#sha256:dc8f2a330ca3930b36cacb2623bb360ed8bdf6e4a8acd293dbd9e2241a6fd33d", + "archive:https://github.com/ocaml-ppx/ocamlformat/releases/download/0.25.1/ocamlformat-0.25.1.tbz#sha256:dc8f2a330ca3930b36cacb2623bb360ed8bdf6e4a8acd293dbd9e2241a6fd33d" + ], + "opam": { + "name": "ocamlformat-rpc-lib", + "version": "0.25.1", + "path": "esy.lock/opam/ocamlformat-rpc-lib.0.25.1" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/csexp@opam:1.5.1@8a8fb3a7" + ] + }, "@opam/ocamlfind@opam:1.9.5@e83abf74": { "id": "@opam/ocamlfind@opam:1.9.5@e83abf74", "name": "@opam/ocamlfind", @@ -539,6 +808,32 @@ ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, + "@opam/ocamlc-loc@opam:3.6.2@edc950a7": { + "id": "@opam/ocamlc-loc@opam:3.6.2@edc950a7", + "name": "@opam/ocamlc-loc", + "version": "opam:3.6.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", + "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + ], + "opam": { + "name": "ocamlc-loc", + "version": "3.6.2", + "path": "esy.lock/opam/ocamlc-loc.3.6.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dyn@opam:3.6.2@38120dfc", + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dyn@opam:3.6.2@38120dfc", + "@opam/dune@opam:3.7.0@95218dc4" + ] + }, "@opam/ocamlbuild@opam:0.14.2@c6163b28": { "id": "@opam/ocamlbuild@opam:0.14.2@c6163b28", "name": "@opam/ocamlbuild", @@ -566,6 +861,59 @@ ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, + "@opam/ocaml-lsp-server@opam:1.15.1-4.14@76510e53": { + "id": "@opam/ocaml-lsp-server@opam:1.15.1-4.14@76510e53", + "name": "@opam/ocaml-lsp-server", + "version": "opam:1.15.1-4.14", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/9e/9e8e1edb067b0b6edc9b8081f1c046427afc6d5d422fe88a9bf2f8076ab9826d#sha256:9e8e1edb067b0b6edc9b8081f1c046427afc6d5d422fe88a9bf2f8076ab9826d", + "archive:https://github.com/ocaml/ocaml-lsp/releases/download/1.15.1-4.14/lsp-1.15.1-4.14.tbz#sha256:9e8e1edb067b0b6edc9b8081f1c046427afc6d5d422fe88a9bf2f8076ab9826d" + ], + "opam": { + "name": "ocaml-lsp-server", + "version": "1.15.1-4.14", + "path": "esy.lock/opam/ocaml-lsp-server.1.15.1-4.14" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/xdg@opam:3.7.0@449d6490", "@opam/uutf@opam:1.0.3@47c95a18", + "@opam/stdune@opam:3.6.2@47d75c4b", + "@opam/spawn@opam:v0.15.1@85e9d6f1", "@opam/re@opam:1.10.4@c4910ba6", + "@opam/ppx_yojson_conv_lib@opam:v0.15.0@773058a7", + "@opam/pp@opam:1.1.2@89ad03b5", "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/omd@opam:1.3.2@511d53d2", + "@opam/octavius@opam:1.2.2@2205cc65", + "@opam/ocamlformat-rpc-lib@opam:0.25.1@fb9fa86e", + "@opam/ocamlc-loc@opam:3.6.2@edc950a7", + "@opam/fiber@opam:3.6.2@349136be", "@opam/dyn@opam:3.6.2@38120dfc", + "@opam/dune-rpc@opam:3.6.2@d874b9d2", + "@opam/dune-build-info@opam:3.7.0@ce68449d", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/csexp@opam:1.5.1@8a8fb3a7", + "@opam/chrome-trace@opam:3.7.0@6448e71e", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", + "@opam/xdg@opam:3.7.0@449d6490", "@opam/uutf@opam:1.0.3@47c95a18", + "@opam/stdune@opam:3.6.2@47d75c4b", + "@opam/spawn@opam:v0.15.1@85e9d6f1", "@opam/re@opam:1.10.4@c4910ba6", + "@opam/ppx_yojson_conv_lib@opam:v0.15.0@773058a7", + "@opam/pp@opam:1.1.2@89ad03b5", "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/omd@opam:1.3.2@511d53d2", + "@opam/octavius@opam:1.2.2@2205cc65", + "@opam/ocamlformat-rpc-lib@opam:0.25.1@fb9fa86e", + "@opam/ocamlc-loc@opam:3.6.2@edc950a7", + "@opam/fiber@opam:3.6.2@349136be", "@opam/dyn@opam:3.6.2@38120dfc", + "@opam/dune-rpc@opam:3.6.2@d874b9d2", + "@opam/dune-build-info@opam:3.7.0@ce68449d", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/csexp@opam:1.5.1@8a8fb3a7", + "@opam/chrome-trace@opam:3.7.0@6448e71e" + ] + }, "@opam/mew_vi@opam:0.5.0@cf66c299": { "id": "@opam/mew_vi@opam:0.5.0@cf66c299", "name": "@opam/mew_vi", @@ -585,12 +933,12 @@ "overrides": [], "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/mew@opam:0.1.0@65011d4b": { @@ -612,12 +960,12 @@ "overrides": [], "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/merlin-extend@opam:0.6.1@7d979feb": { @@ -638,11 +986,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/menhirSdk@opam:20220210@fe146ed3": { @@ -663,11 +1011,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/menhirLib@opam:20220210@9afeb270": { @@ -688,11 +1036,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/menhir@opam:20220210@ff5ea9a7": { @@ -715,12 +1063,12 @@ "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", "@opam/menhirLib@opam:20220210@9afeb270", - "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", "@opam/menhirLib@opam:20220210@9afeb270", - "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/lwt_react@opam:1.2.0@4253a145": { @@ -742,12 +1090,12 @@ "overrides": [], "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.7.0@95218dc4", "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/lwt@opam:5.6.1@2a9902ab": { @@ -770,7 +1118,7 @@ "dependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", "@opam/dune-configurator@opam:3.7.0@4fa6f76e", - "@opam/dune@opam:3.6.2@e55a9c34", "@opam/cppo@opam:1.6.9@db929a12", + "@opam/dune@opam:3.7.0@95218dc4", "@opam/cppo@opam:1.6.9@db929a12", "@opam/base-unix@opam:base@87d0b2eb", "@opam/base-threads@opam:base@36803084", "@esy-ocaml/substs@0.0.1@d41d8cd9" @@ -778,7 +1126,7 @@ "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", "@opam/dune-configurator@opam:3.7.0@4fa6f76e", - "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/logs@opam:0.7.0@46a3dffc": { @@ -832,7 +1180,7 @@ "@opam/mew_vi@opam:0.5.0@cf66c299", "@opam/lwt_react@opam:1.2.0@4253a145", "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", - "@opam/dune@opam:3.6.2@e55a9c34", "@esy-ocaml/substs@0.0.1@d41d8cd9" + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.2.1@276736c0", @@ -840,7 +1188,7 @@ "@opam/mew_vi@opam:0.5.0@cf66c299", "@opam/lwt_react@opam:1.2.0@4253a145", "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/logs@opam:0.7.0@46a3dffc", - "@opam/dune@opam:3.6.2@e55a9c34" + "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/fpath@opam:0.7.3@674d8125": { @@ -916,11 +1264,96 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/fiber@opam:3.6.2@349136be": { + "id": "@opam/fiber@opam:3.6.2@349136be", + "name": "@opam/fiber", + "version": "opam:3.6.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", + "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + ], + "opam": { + "name": "fiber", + "version": "3.6.2", + "path": "esy.lock/opam/fiber.3.6.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/stdune@opam:3.6.2@47d75c4b", + "@opam/dyn@opam:3.6.2@38120dfc", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/stdune@opam:3.6.2@47d75c4b", + "@opam/dyn@opam:3.6.2@38120dfc", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/dyn@opam:3.6.2@38120dfc": { + "id": "@opam/dyn@opam:3.6.2@38120dfc", + "name": "@opam/dyn", + "version": "opam:3.6.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", + "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + ], + "opam": { + "name": "dyn", + "version": "3.6.2", + "path": "esy.lock/opam/dyn.3.6.2" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/pp@opam:1.1.2@89ad03b5", + "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/pp@opam:1.1.2@89ad03b5", + "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/dune-rpc@opam:3.6.2@d874b9d2": { + "id": "@opam/dune-rpc@opam:3.6.2@d874b9d2", + "name": "@opam/dune-rpc", + "version": "opam:3.6.2", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", + "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + ], + "opam": { + "name": "dune-rpc", + "version": "3.6.2", + "path": "esy.lock/opam/dune-rpc.3.6.2" + } + }, + "overrides": [], + "dependencies": [ + "@opam/xdg@opam:3.7.0@449d6490", "@opam/stdune@opam:3.6.2@47d75c4b", + "@opam/pp@opam:1.1.2@89ad03b5", "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/dyn@opam:3.6.2@38120dfc", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "@opam/xdg@opam:3.7.0@449d6490", "@opam/stdune@opam:3.6.2@47d75c4b", + "@opam/pp@opam:1.1.2@89ad03b5", "@opam/ordering@opam:3.6.2@37bc3093", + "@opam/dyn@opam:3.6.2@38120dfc", "@opam/dune@opam:3.7.0@95218dc4", + "@opam/csexp@opam:1.5.1@8a8fb3a7" ] }, "@opam/dune-configurator@opam:3.7.0@4fa6f76e": { @@ -941,31 +1374,56 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@opam/csexp@opam:1.5.1@8a8fb3a7", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@opam/csexp@opam:1.5.1@8a8fb3a7", "@opam/base-unix@opam:base@87d0b2eb" ] }, - "@opam/dune@opam:3.6.2@e55a9c34": { - "id": "@opam/dune@opam:3.6.2@e55a9c34", + "@opam/dune-build-info@opam:3.7.0@ce68449d": { + "id": "@opam/dune-build-info@opam:3.7.0@ce68449d", + "name": "@opam/dune-build-info", + "version": "opam:3.7.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/e2/e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8", + "archive:https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + ], + "opam": { + "name": "dune-build-info", + "version": "3.7.0", + "path": "esy.lock/opam/dune-build-info.3.7.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, + "@opam/dune@opam:3.7.0@95218dc4": { + "id": "@opam/dune@opam:3.7.0@95218dc4", "name": "@opam/dune", - "version": "opam:3.6.2", + "version": "opam:3.7.0", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/b6/b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c", - "archive:https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz#sha256:b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "archive:https://opam.ocaml.org/cache/sha256/e2/e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8", + "archive:https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" ], "opam": { "name": "dune", - "version": "3.6.2", - "path": "esy.lock/opam/dune.3.6.2" + "version": "3.7.0", + "path": "esy.lock/opam/dune.3.7.0" } }, "overrides": [], @@ -997,11 +1455,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/cppo@opam:1.6.9@db929a12": { @@ -1022,12 +1480,12 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@opam/base-unix@opam:base@87d0b2eb", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@opam/base-unix@opam:base@87d0b2eb" ] }, @@ -1053,6 +1511,31 @@ ], "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] }, + "@opam/chrome-trace@opam:3.7.0@6448e71e": { + "id": "@opam/chrome-trace@opam:3.7.0@6448e71e", + "name": "@opam/chrome-trace", + "version": "opam:3.7.0", + "source": { + "type": "install", + "source": [ + "archive:https://opam.ocaml.org/cache/sha256/e2/e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8", + "archive:https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz#sha256:e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + ], + "opam": { + "name": "chrome-trace", + "version": "3.7.0", + "path": "esy.lock/opam/chrome-trace.3.7.0" + } + }, + "overrides": [], + "dependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", + "@esy-ocaml/substs@0.0.1@d41d8cd9" + ], + "devDependencies": [ + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" + ] + }, "@opam/camlp-streams@opam:5.0.1@daaa0f94": { "id": "@opam/camlp-streams@opam:5.0.1@daaa0f94", "name": "@opam/camlp-streams", @@ -1071,11 +1554,11 @@ }, "overrides": [], "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34", + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4", "@esy-ocaml/substs@0.0.1@d41d8cd9" ], "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.6.2@e55a9c34" + "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:3.7.0@95218dc4" ] }, "@opam/base-unix@opam:base@87d0b2eb": { @@ -1134,6 +1617,23 @@ "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.5@e83abf74" ] }, + "@opam/base-bigarray@opam:base@b03491b0": { + "id": "@opam/base-bigarray@opam:base@b03491b0", + "name": "@opam/base-bigarray", + "version": "opam:base", + "source": { + "type": "install", + "source": [ "no-source:" ], + "opam": { + "name": "base-bigarray", + "version": "base", + "path": "esy.lock/opam/base-bigarray.base" + } + }, + "overrides": [], + "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], + "devDependencies": [] + }, "@opam/astring@opam:0.8.5@1300cee8": { "id": "@opam/astring@opam:0.8.5@1300cee8", "name": "@opam/astring", diff --git a/rtop.esy.lock/opam/base-unix.base/opam b/esy.lock/opam/base-bigarray.base/opam similarity index 66% rename from rtop.esy.lock/opam/base-unix.base/opam rename to esy.lock/opam/base-bigarray.base/opam index b973540bc..39e9af21a 100644 --- a/rtop.esy.lock/opam/base-unix.base/opam +++ b/esy.lock/opam/base-bigarray.base/opam @@ -1,6 +1,6 @@ opam-version: "2.0" maintainer: "https://github.com/ocaml/opam-repository/issues" description: """ -Unix library distributed with the OCaml compiler +Bigarray library distributed with the OCaml compiler """ diff --git a/esy.lock/opam/chrome-trace.3.7.0/opam b/esy.lock/opam/chrome-trace.3.7.0/opam new file mode 100644 index 000000000..46cf1c78d --- /dev/null +++ b/esy.lock/opam/chrome-trace.3.7.0/opam @@ -0,0 +1,39 @@ +opam-version: "2.0" +synopsis: "Chrome trace event generation library" +description: + "This library offers no backwards compatibility guarantees. Use at your own risk." +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08.0"} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz" + checksum: [ + "sha256=e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + "sha512=586e47ee45cd53a8c13095bde0b47de99aad9462d0a52199362140b5b654ca862597fa9f27f729a8cc594684ac46858848f9fa76f8f06dc8dc8ab8b1186a3295" + ] +} +x-commit-hash: "d3d628f2eda2278bd2df6e37452d8693f367fcfd" diff --git a/esy.lock/opam/dune-build-info.3.7.0/opam b/esy.lock/opam/dune-build-info.3.7.0/opam new file mode 100644 index 000000000..059e6e18a --- /dev/null +++ b/esy.lock/opam/dune-build-info.3.7.0/opam @@ -0,0 +1,45 @@ +opam-version: "2.0" +synopsis: "Embed build information inside executable" +description: """ +The build-info library allows to access information about how the +executable was built, such as the version of the project at which it +was built or the list of statically linked libraries with their +versions. It supports reporting the version from the version control +system during development to get an precise reference of when the +executable was built. +""" +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08"} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz" + checksum: [ + "sha256=e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + "sha512=586e47ee45cd53a8c13095bde0b47de99aad9462d0a52199362140b5b654ca862597fa9f27f729a8cc594684ac46858848f9fa76f8f06dc8dc8ab8b1186a3295" + ] +} +x-commit-hash: "d3d628f2eda2278bd2df6e37452d8693f367fcfd" diff --git a/esy.lock/opam/dune-rpc.3.6.2/opam b/esy.lock/opam/dune-rpc.3.6.2/opam new file mode 100644 index 000000000..6a6c7fe01 --- /dev/null +++ b/esy.lock/opam/dune-rpc.3.6.2/opam @@ -0,0 +1,43 @@ +opam-version: "2.0" +synopsis: "Communicate with dune using rpc" +description: "Library to connect and control a running dune instance" +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "csexp" + "ordering" + "dyn" + "xdg" + "stdune" {= version} + "pp" {>= "1.1.0"} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" + checksum: [ + "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" + ] +} +x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" diff --git a/esy.lock/opam/dune.3.6.2/opam b/esy.lock/opam/dune.3.7.0/opam similarity index 83% rename from esy.lock/opam/dune.3.6.2/opam rename to esy.lock/opam/dune.3.7.0/opam index b66dce86b..c9207f2cd 100644 --- a/esy.lock/opam/dune.3.6.2/opam +++ b/esy.lock/opam/dune.3.7.0/opam @@ -47,10 +47,10 @@ depends: [ "base-threads" ] url { - src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" + src: "https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz" checksum: [ - "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" - "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" + "sha256=e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + "sha512=586e47ee45cd53a8c13095bde0b47de99aad9462d0a52199362140b5b654ca862597fa9f27f729a8cc594684ac46858848f9fa76f8f06dc8dc8ab8b1186a3295" ] } -x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" +x-commit-hash: "d3d628f2eda2278bd2df6e37452d8693f367fcfd" diff --git a/esy.lock/opam/dyn.3.6.2/opam b/esy.lock/opam/dyn.3.6.2/opam new file mode 100644 index 000000000..ad73e2ffe --- /dev/null +++ b/esy.lock/opam/dyn.3.6.2/opam @@ -0,0 +1,40 @@ +opam-version: "2.0" +synopsis: "Dynamic type" +description: "Dynamic type" +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08.0"} + "ordering" {= version} + "pp" {>= "1.1.0"} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" + checksum: [ + "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" + ] +} +x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" diff --git a/esy.lock/opam/fiber.3.6.2/opam b/esy.lock/opam/fiber.3.6.2/opam new file mode 100644 index 000000000..304d921b8 --- /dev/null +++ b/esy.lock/opam/fiber.3.6.2/opam @@ -0,0 +1,41 @@ +opam-version: "2.0" +synopsis: "Structured concurrency library" +description: + "This library offers no backwards compatibility guarantees. Use at your own risk." +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08.0"} + "stdune" {= version} + "dyn" {= version} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" + checksum: [ + "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" + ] +} +x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" diff --git a/esy.lock/opam/ocaml-lsp-server.1.15.1-4.14/opam b/esy.lock/opam/ocaml-lsp-server.1.15.1-4.14/opam new file mode 100644 index 000000000..3594742f2 --- /dev/null +++ b/esy.lock/opam/ocaml-lsp-server.1.15.1-4.14/opam @@ -0,0 +1,66 @@ +opam-version: "2.0" +synopsis: "LSP Server for OCaml" +description: "An LSP server for OCaml." +maintainer: ["Rudi Grinberg "] +authors: [ + "Andrey Popp <8mayday@gmail.com>" + "Rusty Key " + "Louis Roché " + "Oleksiy Golovko " + "Rudi Grinberg " + "Sacha Ayoun " + "cannorin " + "Ulugbek Abdullaev " + "Thibaut Mattio " + "Max Lantas " +] +license: "ISC" +homepage: "https://github.com/ocaml/ocaml-lsp" +bug-reports: "https://github.com/ocaml/ocaml-lsp/issues" +depends: [ + "dune" {>= "3.0"} + "yojson" + "re" {>= "1.5.0"} + "ppx_yojson_conv_lib" {>= "v0.14"} + "dune-rpc" {>= "3.4.0"} + "chrome-trace" {>= "3.3.0"} + "dyn" + "stdune" + "fiber" {>= "3.1.1"} + "xdg" + "ordering" + "dune-build-info" + "spawn" + "ppx_expect" {>= "v0.15.0" & with-test} + "ocamlformat" {with-test & = "0.24.1"} + "ocamlc-loc" {>= "3.5.0" & < "3.7.0"} + "omd" {>= "1.3.2" & < "2.0.0~alpha1"} + "octavius" {>= "1.2.2"} + "uutf" {>= "1.0.2"} + "pp" {>= "1.1.2"} + "csexp" {>= "1.5"} + "ocamlformat-rpc-lib" {>= "0.21.0"} + "odoc" {with-doc} + "ocaml" {>= "4.14" & < "4.15"} +] +dev-repo: "git+https://github.com/ocaml/ocaml-lsp.git" +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-j" + jobs + "ocaml-lsp-server.install" + "--release" + ] +] +url { + src: + "https://github.com/ocaml/ocaml-lsp/releases/download/1.15.1-4.14/lsp-1.15.1-4.14.tbz" + checksum: [ + "sha256=9e8e1edb067b0b6edc9b8081f1c046427afc6d5d422fe88a9bf2f8076ab9826d" + "sha512=28e4511404e808c066b05cde1f047f82819f30ca689d9c906b716743c0a53002ab1993202204302455ae45ce591868cc80490c01ea4fe672e95ce46e62fd2a39" + ] +} +x-commit-hash: "38849b2a14355e97532e8866c29a88d966dd8b47" diff --git a/esy.lock/opam/ocamlc-loc.3.6.2/opam b/esy.lock/opam/ocamlc-loc.3.6.2/opam new file mode 100644 index 000000000..3a1e3f5c3 --- /dev/null +++ b/esy.lock/opam/ocamlc-loc.3.6.2/opam @@ -0,0 +1,40 @@ +opam-version: "2.0" +synopsis: "Parse ocaml compiler output into structured form" +description: + "This library offers no backwards compatibility guarantees. Use at your own risk." +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08.0"} + "dyn" {= version} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" + checksum: [ + "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" + ] +} +x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" diff --git a/esy.lock/opam/ocamlformat-rpc-lib.0.25.1/opam b/esy.lock/opam/ocamlformat-rpc-lib.0.25.1/opam new file mode 100644 index 000000000..e6e4ec197 --- /dev/null +++ b/esy.lock/opam/ocamlformat-rpc-lib.0.25.1/opam @@ -0,0 +1,39 @@ +opam-version: "2.0" +synopsis: "Auto-formatter for OCaml code (RPC mode)" +description: + "OCamlFormat is a tool to automatically format OCaml code in a uniform style. This package defines a RPC interface to OCamlFormat" +maintainer: ["OCamlFormat Team "] +authors: ["Josh Berdine "] +license: "MIT" +homepage: "https://github.com/ocaml-ppx/ocamlformat" +bug-reports: "https://github.com/ocaml-ppx/ocamlformat/issues" +depends: [ + "dune" {>= "2.8"} + "ocaml" {>= "4.08"} + "csexp" {>= "1.4.0"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocaml-ppx/ocamlformat.git" +url { + src: + "https://github.com/ocaml-ppx/ocamlformat/releases/download/0.25.1/ocamlformat-0.25.1.tbz" + checksum: [ + "sha256=dc8f2a330ca3930b36cacb2623bb360ed8bdf6e4a8acd293dbd9e2241a6fd33d" + "sha512=b28f545425fb5375447c90022d065dc7fd51ed2f66d8c1f65a71a6ad2465d039a8686e8f18249e5ad3a2362fee6149c855ef30eb45fb9d06d743a53d26b3e26f" + ] +} +x-commit-hash: "651f767b48e14ba6b24db9421306942d9e51adcc" diff --git a/esy.lock/opam/octavius.1.2.2/opam b/esy.lock/opam/octavius.1.2.2/opam new file mode 100644 index 000000000..0539c097d --- /dev/null +++ b/esy.lock/opam/octavius.1.2.2/opam @@ -0,0 +1,33 @@ +opam-version: "2.0" +maintainer: ["leo@lpw25.net"] +authors: ["Leo White "] +license: "ISC" +homepage: "https://github.com/ocaml-doc/octavius" +doc: "http://ocaml-doc.github.io/octavius/" +bug-reports: "https://github.com/ocaml-doc/octavius/issues" +depends: [ + "dune" {>= "1.11"} + "ocaml" {>= "4.03.0"} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocaml-doc/octavius.git" + +synopsis: "Ocamldoc comment syntax parser" +description: "Octavius is a library to parse the `ocamldoc` comment syntax." +url { + src: "https://github.com/ocaml-doc/octavius/archive/v1.2.2.tar.gz" + checksum: "md5=72f9e1d996e6c5089fc513cc9218607b" +} diff --git a/esy.lock/opam/omd.1.3.2/opam b/esy.lock/opam/omd.1.3.2/opam new file mode 100644 index 000000000..ad2e5014d --- /dev/null +++ b/esy.lock/opam/omd.1.3.2/opam @@ -0,0 +1,50 @@ +opam-version: "2.0" +synopsis: "A Markdown frontend in pure OCaml" +description: """ +This Markdown library is implemented using only pure OCaml (including +I/O operations provided by the standard OCaml compiler distribution). +OMD is meant to be as faithful as possible to the original Markdown. +Additionally, OMD implements a few Github markdown features, an +extension mechanism, and some other features. Note that the opam +package installs both the OMD library and the command line tool `omd`.""" +maintainer: [ + "Shon Feder " "Raphael Sousa Santos <@sonologico>" +] +authors: [ + "Philippe Wang " + "Nicolás Ojeda Bär " +] +license: "ISC" +tags: ["org:ocamllabs" "org:mirage"] +homepage: "https://github.com/ocaml/omd" +bug-reports: "https://github.com/ocaml/omd/issues" +depends: [ + "dune" {>= "2.7"} + "ocaml" {>= "4.04"} + "base-bigarray" + "base-bytes" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocaml/omd.git" +url { + src: "https://github.com/ocaml/omd/releases/download/1.3.2/omd-1.3.2.tbz" + checksum: [ + "sha256=6023e1642631f08f678eb5725820879ed7bb5a3ffee777cdedebc28c1f85fadb" + "sha512=fa2070a5f5d30b2cc422937ac4158bb087134a69d47fa15df403afb1c0c60a73dd436c949faa8d44e0b65bdee039779d86191b55085b717253f91ef20a69ef98" + ] +} +x-commit-hash: "bc6c0d568b90b61143e9863cb6ef7b3989b3313a" diff --git a/esy.lock/opam/ordering.3.6.2/opam b/esy.lock/opam/ordering.3.6.2/opam new file mode 100644 index 000000000..ea64f900e --- /dev/null +++ b/esy.lock/opam/ordering.3.6.2/opam @@ -0,0 +1,38 @@ +opam-version: "2.0" +synopsis: "Element ordering" +description: "Element ordering" +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08.0"} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" + checksum: [ + "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" + ] +} +x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" diff --git a/esy.lock/opam/pp.1.1.2/opam b/esy.lock/opam/pp.1.1.2/opam new file mode 100644 index 000000000..e09edbfd5 --- /dev/null +++ b/esy.lock/opam/pp.1.1.2/opam @@ -0,0 +1,58 @@ +opam-version: "2.0" +synopsis: "Pretty-printing library" +description: """ + +This library provides a lean alternative to the Format [1] module of +the OCaml standard library. It aims to make it easy for users to do +the right thing. If you have tried Format before but find its API +complicated and difficult to use, then Pp might be a good choice for +you. + +Pp uses the same concepts of boxes and break hints, and the final +rendering is done to formatter from the Format module. However it +defines its own algebra which some might find easier to work with and +reason about. No previous knowledge is required to start using this +library, however the various guides for the Format module such as this +one [2] should be applicable to Pp as well. + +[1]: https://caml.inria.fr/pub/docs/manual-ocaml/libref/Format.html +[2]: http://caml.inria.fr/resources/doc/guides/format.en.html +""" +maintainer: ["Jeremie Dimino "] +authors: [ + "Jane Street Group, LLC" + "Jeremie Dimino " +] +license: "MIT" +homepage: "https://github.com/ocaml-dune/pp" +doc: "https://ocaml-dune.github.io/pp/" +bug-reports: "https://github.com/ocaml-dune/pp/issues" +depends: [ + "dune" {>= "2.0"} + "ocaml" {>= "4.08.0"} + "ppx_expect" {with-test} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocaml-dune/pp.git" +x-commit-hash: "395b95c89cfe2c6d538dad9d56721b6a7278d46c" +url { + src: + "https://github.com/ocaml-dune/pp/releases/download/1.1.2/pp-1.1.2.tbz" + checksum: [ + "sha256=e4a4e98d96b1bb76950fcd6da4e938c86d989df4d7e48f02f7a44595f5af1d56" + "sha512=58f78b083483006b40814be9aac33c895349eb1c6427d2762b4d760192613401262478bd5deff909763517560b06af7bf013c6a6f87d549aafa77b26345303f2" + ] +} diff --git a/esy.lock/opam/ppx_yojson_conv_lib.v0.15.0/opam b/esy.lock/opam/ppx_yojson_conv_lib.v0.15.0/opam new file mode 100644 index 000000000..1b0664b2a --- /dev/null +++ b/esy.lock/opam/ppx_yojson_conv_lib.v0.15.0/opam @@ -0,0 +1,24 @@ +opam-version: "2.0" +maintainer: "Jane Street developers" +authors: ["Jane Street Group, LLC"] +homepage: "https://github.com/janestreet/ppx_yojson_conv_lib" +bug-reports: "https://github.com/janestreet/ppx_yojson_conv_lib/issues" +dev-repo: "git+https://github.com/janestreet/ppx_yojson_conv_lib.git" +doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/ppx_yojson_conv_lib/index.html" +license: "MIT" +build: [ + ["dune" "build" "-p" name "-j" jobs] +] +depends: [ + "ocaml" {>= "4.02.3"} + "dune" {>= "2.0.0"} + "yojson" {>= "1.7.0"} +] +synopsis: "Runtime lib for ppx_yojson_conv" +description: " +Part of the Jane Street's PPX rewriters collection. +" +url { +src: "https://ocaml.janestreet.com/ocaml-core/v0.15/files/ppx_yojson_conv_lib-v0.15.0.tar.gz" +checksum: "sha256=f9d2c5eff4566ec1f1f379b186ed22c8ddd6be0909a160bc5a9ac7abc6a6b684" +} diff --git a/esy.lock/opam/spawn.v0.15.1/opam b/esy.lock/opam/spawn.v0.15.1/opam new file mode 100644 index 000000000..5be3a9949 --- /dev/null +++ b/esy.lock/opam/spawn.v0.15.1/opam @@ -0,0 +1,56 @@ +opam-version: "2.0" +synopsis: "Spawning sub-processes" +description: """ +Spawn is a small library exposing only one functionality: spawning sub-process. + +It has three main goals: + +1. provide missing features of Unix.create_process such as providing a +working directory + +2. provide better errors when a system call fails in the +sub-process. For instance if a command is not found, you get a proper +[Unix.Unix_error] exception + +3. improve performance by using vfork when available. It is often +claimed that nowadays fork is as fast as vfork, however in practice +fork takes time proportional to the process memory while vfork is +constant time. In application using a lot of memory, vfork can be +thousands of times faster than fork. +""" +maintainer: ["Jane Street developers"] +authors: ["Jane Street Group, LLC"] +license: "MIT" +homepage: "https://github.com/janestreet/spawn" +doc: "https://janestreet.github.io/spawn/" +bug-reports: "https://github.com/janestreet/spawn/issues" +depends: [ + "dune" {>= "2.8"} + "ppx_expect" {with-test} + "ocaml" {>= "4.05"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/janestreet/spawn.git" +x-commit-hash: "13d279ebfa8c40d4bafe18cddfdff0de54b4eaff" +url { + src: + "https://github.com/janestreet/spawn/archive/v0.15.1.tar.gz" + checksum: [ + "sha256=9afdee314fab6c3fcd689ab6eb5608d6b78078e6dede3953a47debde06c19d50" + "sha512=efdb31d5ec5ea36d0bc80224d4ee04e46ce3428d1662870e6cebece92bc313d6eebee378802c0c059dd6e0cafea515308c31b7dfaf04a098eb4566583c1e9ed4" + ] +} diff --git a/esy.lock/opam/stdune.3.6.2/opam b/esy.lock/opam/stdune.3.6.2/opam new file mode 100644 index 000000000..446f26e1c --- /dev/null +++ b/esy.lock/opam/stdune.3.6.2/opam @@ -0,0 +1,44 @@ +opam-version: "2.0" +synopsis: "Dune's unstable standard library" +description: + "This library offers no backwards compatibility guarantees. Use at your own risk." +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08.0"} + "base-unix" + "dyn" {= version} + "ordering" {= version} + "pp" {>= "1.1.0"} + "csexp" {>= "1.5.0"} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz" + checksum: [ + "sha256=b6d4ab848efb04aa2a325d0015d32ed4414ed7130ec7aa12f98158eff445cf3c" + "sha512=d0dd69ada2f1583319a2d6f679b8d49998059117c3258805ee69ae3e71d47bfab7a9c646f19b5fc43a6ccdef934eb87de5bb81205fcd60968bed8bf1790cf0a3" + ] +} +x-commit-hash: "c939c2b0f7a470cedd189988c61cd307a3cedace" diff --git a/esy.lock/opam/xdg.3.7.0/opam b/esy.lock/opam/xdg.3.7.0/opam new file mode 100644 index 000000000..fe21970ac --- /dev/null +++ b/esy.lock/opam/xdg.3.7.0/opam @@ -0,0 +1,39 @@ +opam-version: "2.0" +synopsis: "XDG Base Directory Specification" +description: + "https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html" +maintainer: ["Jane Street Group, LLC "] +authors: ["Jane Street Group, LLC "] +license: "MIT" +homepage: "https://github.com/ocaml/dune" +doc: "https://dune.readthedocs.io/" +bug-reports: "https://github.com/ocaml/dune/issues" +depends: [ + "dune" {>= "3.5"} + "ocaml" {>= "4.08"} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/ocaml/dune.git" +build: [ + ["dune" "subst"] {dev} + ["rm" "-rf" "vendor/csexp"] + ["rm" "-rf" "vendor/pp"] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@doc" {with-doc} + ] +] +url { + src: "https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz" + checksum: [ + "sha256=e2d637c9d080318fedf5e71d2a29fb367624f82ac4a26e83df2b3a03550528b8" + "sha512=586e47ee45cd53a8c13095bde0b47de99aad9462d0a52199362140b5b654ca862597fa9f27f729a8cc594684ac46858848f9fa76f8f06dc8dc8ab8b1186a3295" + ] +} +x-commit-hash: "d3d628f2eda2278bd2df6e37452d8693f367fcfd" diff --git a/reason.esy.lock/opam/yojson.2.0.2/opam b/esy.lock/opam/yojson.2.0.2/opam similarity index 100% rename from reason.esy.lock/opam/yojson.2.0.2/opam rename to esy.lock/opam/yojson.2.0.2/opam diff --git a/reason.esy.lock/.gitattributes b/reason.esy.lock/.gitattributes deleted file mode 100644 index e0b4e26c5..000000000 --- a/reason.esy.lock/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ - -# Set eol to LF so files aren't converted to CRLF-eol on Windows. -* text eol=lf linguist-generated diff --git a/reason.esy.lock/.gitignore b/reason.esy.lock/.gitignore deleted file mode 100644 index a221be227..000000000 --- a/reason.esy.lock/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -# Reset any possible .gitignore, we want all esy.lock to be un-ignored. -!* diff --git a/reason.esy.lock/index.json b/reason.esy.lock/index.json deleted file mode 100644 index 3a04494e3..000000000 --- a/reason.esy.lock/index.json +++ /dev/null @@ -1,479 +0,0 @@ -{ - "checksum": "60b94a2449764224ad9320278e98a208", - "root": "@esy-ocaml/reason@link-dev:./reason.json", - "node": { - "ocaml@4.14.0@d41d8cd9": { - "id": "ocaml@4.14.0@d41d8cd9", - "name": "ocaml", - "version": "4.14.0", - "source": { - "type": "install", - "source": [ - "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.14.0.tgz#sha1:619afaeabcc8732cc1f4014a7251403927f44021" - ] - }, - "overrides": [], - "dependencies": [], - "devDependencies": [] - }, - "@opam/yojson@opam:2.0.2@eb65f292": { - "id": "@opam/yojson@opam:2.0.2@eb65f292", - "name": "@opam/yojson", - "version": "opam:2.0.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/87/876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b", - "archive:https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" - ], - "opam": { - "name": "yojson", - "version": "2.0.2", - "path": "reason.esy.lock/opam/yojson.2.0.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/seq@opam:base@d8d7de1d": { - "id": "@opam/seq@opam:base@d8d7de1d", - "name": "@opam/seq", - "version": "opam:base", - "source": { - "type": "install", - "source": [ "no-source:" ], - "opam": { - "name": "seq", - "version": "base", - "path": "reason.esy.lock/opam/seq.base" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] - }, - "@opam/ppx_derivers@opam:1.2.1@e2cbad12": { - "id": "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "name": "@opam/ppx_derivers", - "version": "opam:1.2.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/5d/5dc2bf130c1db3c731fe0fffc5648b41#md5:5dc2bf130c1db3c731fe0fffc5648b41", - "archive:https://github.com/ocaml-ppx/ppx_derivers/archive/1.2.1.tar.gz#md5:5dc2bf130c1db3c731fe0fffc5648b41" - ], - "opam": { - "name": "ppx_derivers", - "version": "1.2.1", - "path": "reason.esy.lock/opam/ppx_derivers.1.2.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/ocamlfind@opam:1.9.6@d090a512": { - "id": "@opam/ocamlfind@opam:1.9.6@d090a512", - "name": "@opam/ocamlfind", - "version": "opam:1.9.6", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/96/96c6ee50a32cca9ca277321262dbec57#md5:96c6ee50a32cca9ca277321262dbec57", - "archive:http://download.camlcity.org/download/findlib-1.9.6.tar.gz#md5:96c6ee50a32cca9ca277321262dbec57" - ], - "opam": { - "name": "ocamlfind", - "version": "1.9.6", - "path": "reason.esy.lock/opam/ocamlfind.1.9.6" - } - }, - "overrides": [ - { - "opamoverride": - "reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override" - } - ], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] - }, - "@opam/merlin-lib@opam:4.8-414@ece13977": { - "id": "@opam/merlin-lib@opam:4.8-414@ece13977", - "name": "@opam/merlin-lib", - "version": "opam:4.8-414", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", - "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - ], - "opam": { - "name": "merlin-lib", - "version": "4.8-414", - "path": "reason.esy.lock/opam/merlin-lib.4.8-414" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/csexp@opam:1.5.1@8a8fb3a7" - ] - }, - "@opam/merlin-extend@opam:0.6.1@7d979feb": { - "id": "@opam/merlin-extend@opam:0.6.1@7d979feb", - "name": "@opam/merlin-extend", - "version": "opam:0.6.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/5e/5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7", - "archive:https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" - ], - "opam": { - "name": "merlin-extend", - "version": "0.6.1", - "path": "reason.esy.lock/opam/merlin-extend.0.6.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/merlin@opam:4.8-414@bb3fbab2": { - "id": "@opam/merlin@opam:4.8-414@bb3fbab2", - "name": "@opam/merlin", - "version": "opam:4.8-414", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", - "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - ], - "opam": { - "name": "merlin", - "version": "4.8-414", - "path": "reason.esy.lock/opam/merlin.4.8-414" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/dot-merlin-reader@opam:4.6@85c88957", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/dot-merlin-reader@opam:4.6@85c88957" - ] - }, - "@opam/menhirSdk@opam:20220210@fe146ed3": { - "id": "@opam/menhirSdk@opam:20220210@fe146ed3", - "name": "@opam/menhirSdk", - "version": "opam:20220210", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e3/e3cef220f676c4b1c16cbccb174cefe3#md5:e3cef220f676c4b1c16cbccb174cefe3", - "archive:https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz#md5:e3cef220f676c4b1c16cbccb174cefe3" - ], - "opam": { - "name": "menhirSdk", - "version": "20220210", - "path": "reason.esy.lock/opam/menhirSdk.20220210" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/menhirLib@opam:20220210@9afeb270": { - "id": "@opam/menhirLib@opam:20220210@9afeb270", - "name": "@opam/menhirLib", - "version": "opam:20220210", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e3/e3cef220f676c4b1c16cbccb174cefe3#md5:e3cef220f676c4b1c16cbccb174cefe3", - "archive:https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz#md5:e3cef220f676c4b1c16cbccb174cefe3" - ], - "opam": { - "name": "menhirLib", - "version": "20220210", - "path": "reason.esy.lock/opam/menhirLib.20220210" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/menhir@opam:20220210@ff5ea9a7": { - "id": "@opam/menhir@opam:20220210@ff5ea9a7", - "name": "@opam/menhir", - "version": "opam:20220210", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e3/e3cef220f676c4b1c16cbccb174cefe3#md5:e3cef220f676c4b1c16cbccb174cefe3", - "archive:https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz#md5:e3cef220f676c4b1c16cbccb174cefe3" - ], - "opam": { - "name": "menhir", - "version": "20220210", - "path": "reason.esy.lock/opam/menhir.20220210" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", - "@opam/menhirLib@opam:20220210@9afeb270", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", - "@opam/menhirLib@opam:20220210@9afeb270", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/fix@opam:20220121@17b9a1a4": { - "id": "@opam/fix@opam:20220121@17b9a1a4", - "name": "@opam/fix", - "version": "opam:20220121", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/48/48d8a5bdff23cf7fbf9288877df2b6aa#md5:48d8a5bdff23cf7fbf9288877df2b6aa", - "archive:https://gitlab.inria.fr/fpottier/fix/-/archive/20220121/archive.tar.gz#md5:48d8a5bdff23cf7fbf9288877df2b6aa" - ], - "opam": { - "name": "fix", - "version": "20220121", - "path": "reason.esy.lock/opam/fix.20220121" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/dune@opam:2.9.3@4d52c673": { - "id": "@opam/dune@opam:2.9.3@4d52c673", - "name": "@opam/dune", - "version": "opam:2.9.3", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/3e/3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6", - "archive:https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - ], - "opam": { - "name": "dune", - "version": "2.9.3", - "path": "reason.esy.lock/opam/dune.2.9.3" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", - "@opam/base-threads@opam:base@36803084", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", - "@opam/base-threads@opam:base@36803084" - ] - }, - "@opam/dot-merlin-reader@opam:4.6@85c88957": { - "id": "@opam/dot-merlin-reader@opam:4.6@85c88957", - "name": "@opam/dot-merlin-reader", - "version": "opam:4.6", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/02/02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce", - "archive:https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" - ], - "opam": { - "name": "dot-merlin-reader", - "version": "4.6", - "path": "reason.esy.lock/opam/dot-merlin-reader.4.6" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/csexp@opam:1.5.1@8a8fb3a7": { - "id": "@opam/csexp@opam:1.5.1@8a8fb3a7", - "name": "@opam/csexp", - "version": "opam:1.5.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/d6/d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02#sha256:d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02", - "archive:https://github.com/ocaml-dune/csexp/releases/download/1.5.1/csexp-1.5.1.tbz#sha256:d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02" - ], - "opam": { - "name": "csexp", - "version": "1.5.1", - "path": "reason.esy.lock/opam/csexp.1.5.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/cppo@opam:1.6.9@db929a12": { - "id": "@opam/cppo@opam:1.6.9@db929a12", - "name": "@opam/cppo", - "version": "opam:1.6.9", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/d2/d23ffe85ac7dc8f0afd1ddf622770d09#md5:d23ffe85ac7dc8f0afd1ddf622770d09", - "archive:https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz#md5:d23ffe85ac7dc8f0afd1ddf622770d09" - ], - "opam": { - "name": "cppo", - "version": "1.6.9", - "path": "reason.esy.lock/opam/cppo.1.6.9" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/base-unix@opam:base@87d0b2eb", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/base-unix@opam:base@87d0b2eb" - ] - }, - "@opam/base-unix@opam:base@87d0b2eb": { - "id": "@opam/base-unix@opam:base@87d0b2eb", - "name": "@opam/base-unix", - "version": "opam:base", - "source": { - "type": "install", - "source": [ "no-source:" ], - "opam": { - "name": "base-unix", - "version": "base", - "path": "reason.esy.lock/opam/base-unix.base" - } - }, - "overrides": [], - "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [] - }, - "@opam/base-threads@opam:base@36803084": { - "id": "@opam/base-threads@opam:base@36803084", - "name": "@opam/base-threads", - "version": "opam:base", - "source": { - "type": "install", - "source": [ "no-source:" ], - "opam": { - "name": "base-threads", - "version": "base", - "path": "reason.esy.lock/opam/base-threads.base" - } - }, - "overrides": [], - "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [] - }, - "@esy-ocaml/substs@0.0.1@d41d8cd9": { - "id": "@esy-ocaml/substs@0.0.1@d41d8cd9", - "name": "@esy-ocaml/substs", - "version": "0.0.1", - "source": { - "type": "install", - "source": [ - "archive:https://registry.npmjs.org/@esy-ocaml/substs/-/substs-0.0.1.tgz#sha1:59ebdbbaedcda123fc7ed8fb2b302b7d819e9a46" - ] - }, - "overrides": [], - "dependencies": [], - "devDependencies": [] - }, - "@esy-ocaml/reason@link-dev:./reason.json": { - "id": "@esy-ocaml/reason@link-dev:./reason.json", - "name": "@esy-ocaml/reason", - "version": "link-dev:./reason.json", - "source": { - "type": "link-dev", - "path": ".", - "manifest": "reason.json" - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/merlin-extend@opam:0.6.1@7d979feb", - "@opam/menhir@opam:20220210@ff5ea9a7", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@4d52c673" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/merlin@opam:4.8-414@bb3fbab2" - ] - } - } -} \ No newline at end of file diff --git a/reason.esy.lock/opam/base-threads.base/opam b/reason.esy.lock/opam/base-threads.base/opam deleted file mode 100644 index 914ff50ce..000000000 --- a/reason.esy.lock/opam/base-threads.base/opam +++ /dev/null @@ -1,6 +0,0 @@ -opam-version: "2.0" -maintainer: "https://github.com/ocaml/opam-repository/issues" -description: """ -Threads library distributed with the OCaml compiler -""" - diff --git a/reason.esy.lock/opam/base-unix.base/opam b/reason.esy.lock/opam/base-unix.base/opam deleted file mode 100644 index b973540bc..000000000 --- a/reason.esy.lock/opam/base-unix.base/opam +++ /dev/null @@ -1,6 +0,0 @@ -opam-version: "2.0" -maintainer: "https://github.com/ocaml/opam-repository/issues" -description: """ -Unix library distributed with the OCaml compiler -""" - diff --git a/reason.esy.lock/opam/cppo.1.6.9/opam b/reason.esy.lock/opam/cppo.1.6.9/opam deleted file mode 100644 index 9c51ec6d8..000000000 --- a/reason.esy.lock/opam/cppo.1.6.9/opam +++ /dev/null @@ -1,39 +0,0 @@ -opam-version: "2.0" -synopsis: "Code preprocessor like cpp for OCaml" -description: """\ -Cppo is an equivalent of the C preprocessor for OCaml programs. -It allows the definition of simple macros and file inclusion. - -Cppo is: - -* more OCaml-friendly than cpp -* easy to learn without consulting a manual -* reasonably fast -* simple to install and to maintain""" -maintainer: [ - "Martin Jambon " "Yishuai Li " -] -authors: "Martin Jambon" -license: "BSD-3-Clause" -homepage: "https://github.com/ocaml-community/cppo" -doc: "https://ocaml-community.github.io/cppo" -bug-reports: "https://github.com/ocaml-community/cppo/issues" -depends: [ - "ocaml" {>= "4.02.3"} - "dune" {>= "1.10"} - "base-unix" -] -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} - ["dune" "build" "-p" name "@doc"] {with-doc} -] -dev-repo: "git+https://github.com/ocaml-community/cppo.git" -url { - src: "https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz" - checksum: [ - "md5=d23ffe85ac7dc8f0afd1ddf622770d09" - "sha512=26ff5a7b7f38c460661974b23ca190f0feae3a99f1974e0fd12ccf08745bd7d91b7bc168c70a5385b837bfff9530e0e4e41cf269f23dd8cf16ca658008244b44" - ] -} \ No newline at end of file diff --git a/reason.esy.lock/opam/csexp.1.5.1/opam b/reason.esy.lock/opam/csexp.1.5.1/opam deleted file mode 100644 index 59324f9e2..000000000 --- a/reason.esy.lock/opam/csexp.1.5.1/opam +++ /dev/null @@ -1,60 +0,0 @@ -opam-version: "2.0" -synopsis: "Parsing and printing of S-expressions in Canonical form" -description: """ - -This library provides minimal support for Canonical S-expressions -[1]. Canonical S-expressions are a binary encoding of S-expressions -that is super simple and well suited for communication between -programs. - -This library only provides a few helpers for simple applications. If -you need more advanced support, such as parsing from more fancy input -sources, you should consider copying the code of this library given -how simple parsing S-expressions in canonical form is. - -To avoid a dependency on a particular S-expression library, the only -module of this library is parameterised by the type of S-expressions. - -[1] https://en.wikipedia.org/wiki/Canonical_S-expressions -""" -maintainer: ["Jeremie Dimino "] -authors: [ - "Quentin Hocquet " - "Jane Street Group, LLC" - "Jeremie Dimino " -] -license: "MIT" -homepage: "https://github.com/ocaml-dune/csexp" -doc: "https://ocaml-dune.github.io/csexp/" -bug-reports: "https://github.com/ocaml-dune/csexp/issues" -depends: [ - "dune" {>= "1.11"} - "ocaml" {>= "4.03.0"} -# "ppx_expect" {with-test & >= "v0.14"} - "odoc" {with-doc} -] -dev-repo: "git+https://github.com/ocaml-dune/csexp.git" -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" -# Tests disabled because of a cyclic dependency with csexp, dune-configurator and ppx_expect -# "@runtest" {with-test} - "@doc" {with-doc} - ] -] -x-commit-hash: "7eeb86206819d2b1782d6cde1be9d6cf8b5fc851" -url { - src: - "https://github.com/ocaml-dune/csexp/releases/download/1.5.1/csexp-1.5.1.tbz" - checksum: [ - "sha256=d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02" - "sha512=d785bbabaff9f6bf601399149ef0a42e5e99647b54e27f97ef1625907793dda22a45bf83e0e8a1eba2c63634c5484b54739ff0904ef556f5fc592efa38af7505" - ] -} diff --git a/reason.esy.lock/opam/dot-merlin-reader.4.6/opam b/reason.esy.lock/opam/dot-merlin-reader.4.6/opam deleted file mode 100644 index 3943521de..000000000 --- a/reason.esy.lock/opam/dot-merlin-reader.4.6/opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -synopsis: "Reads config files for merlin" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -license: "MIT" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.08"} - "dune" {>= "2.9.0"} - "merlin-lib" {>= "4.6"} - "ocamlfind" {>= "1.6.0"} -] -description: - "Helper process: reads .merlin files and outputs the normalized content to - stdout." -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz" - checksum: [ - "sha256=02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" - "sha512=7373fadf05c692c9f054c7fe6a7d4bdfeefe237b9df432024ef9923782ee72e09021c0c3fba869da8347728105cb2d3ff0aa94b0c5eb09811bb25aa8da9fb520" - ] -} -x-commit-hash: "be753d9412387aedcf32aba88a1be9bcd33d97ba" diff --git a/reason.esy.lock/opam/dune.2.9.3/opam b/reason.esy.lock/opam/dune.2.9.3/opam deleted file mode 100644 index 056c52674..000000000 --- a/reason.esy.lock/opam/dune.2.9.3/opam +++ /dev/null @@ -1,57 +0,0 @@ -opam-version: "2.0" -synopsis: "Fast, portable, and opinionated build system" -description: """ - -dune is a build system that was designed to simplify the release of -Jane Street packages. It reads metadata from "dune" files following a -very simple s-expression syntax. - -dune is fast, has very low-overhead, and supports parallel builds on -all platforms. It has no system dependencies; all you need to build -dune or packages using dune is OCaml. You don't need make or bash -as long as the packages themselves don't use bash explicitly. - -dune supports multi-package development by simply dropping multiple -repositories into the same directory. - -It also supports multi-context builds, such as building against -several opam roots/switches simultaneously. This helps maintaining -packages across several versions of OCaml and gives cross-compilation -for free. -""" -maintainer: ["Jane Street Group, LLC "] -authors: ["Jane Street Group, LLC "] -license: "MIT" -homepage: "https://github.com/ocaml/dune" -doc: "https://dune.readthedocs.io/" -bug-reports: "https://github.com/ocaml/dune/issues" -conflicts: [ - "merlin" {< "3.4.0"} - "ocaml-lsp-server" {< "1.3.0"} - "dune-configurator" {< "2.3.0"} - "odoc" {< "1.3.0"} - "dune-release" {< "1.3.0"} - "js_of_ocaml-compiler" {< "3.6.0"} - "jbuilder" {= "transition"} -] -dev-repo: "git+https://github.com/ocaml/dune.git" -build: [ - ["ocaml" "bootstrap.ml" "-j" jobs] - ["./dune.exe" "build" "-p" name "--profile" "dune-bootstrap" "-j" jobs] -] -depends: [ - # Please keep the lower bound in sync with .github/workflows/workflow.yml, - # dune-project and min_ocaml_version in bootstrap.ml - ("ocaml" {>= "4.08" & < "5.0"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) - "base-unix" - "base-threads" -] -url { - src: - "https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz" - checksum: [ - "sha256=3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - "sha512=04b48501ac16c3608e3b6bfbdbabf810df0fb844ea3b7d25ba50f03b9d6cb1d2c933cf747d694029d82a9777a774e48e5c38ab010fe53ce1eae367da0ed04d6d" - ] -} -x-commit-hash: "dea03875affccc0620e902d28fed8d6b4351e112" diff --git a/reason.esy.lock/opam/fix.20220121/opam b/reason.esy.lock/opam/fix.20220121/opam deleted file mode 100644 index 877b44e66..000000000 --- a/reason.esy.lock/opam/fix.20220121/opam +++ /dev/null @@ -1,26 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " -] -homepage: "https://gitlab.inria.fr/fpottier/fix" -dev-repo: "git+https://gitlab.inria.fr/fpottier/fix.git" -bug-reports: "francois.pottier@inria.fr" -license: "LGPL-2.0-only" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" { >= "4.03" } - "dune" { >= "1.3" } -] -synopsis: "Algorithmic building blocks for memoization, recursion, and more" -url { - src: - "https://gitlab.inria.fr/fpottier/fix/-/archive/20220121/archive.tar.gz" - checksum: [ - "md5=48d8a5bdff23cf7fbf9288877df2b6aa" - "sha512=a851d8783c0c519c6e55359a5c471af433058872409c29a1a7bdfd0076813341ad2c0ebd1ce9e28bff4d4c729dfbc808c41c084fe12a42b45a2b5e391e77ccd2" - ] -} diff --git a/reason.esy.lock/opam/menhir.20220210/opam b/reason.esy.lock/opam/menhir.20220210/opam deleted file mode 100644 index 498658b42..000000000 --- a/reason.esy.lock/opam/menhir.20220210/opam +++ /dev/null @@ -1,29 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " - "Yann Régis-Gianas " -] -homepage: "http://gitlab.inria.fr/fpottier/menhir" -dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" -bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.03.0"} - "dune" {>= "2.8.0"} - "menhirLib" {= version} - "menhirSdk" {= version} -] -synopsis: "An LR(1) parser generator" -url { - src: - "https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz" - checksum: [ - "md5=e3cef220f676c4b1c16cbccb174cefe3" - "sha512=3063fec1d8b9fe092c8461b0689d426c7fe381a2bf3fd258dc42ceecca1719d32efbb8a18d94ada5555c38175ea352da3adbb239fdbcbcf52c3a5c85a4d9586f" - ] -} diff --git a/reason.esy.lock/opam/menhirLib.20220210/opam b/reason.esy.lock/opam/menhirLib.20220210/opam deleted file mode 100644 index d2097ae4f..000000000 --- a/reason.esy.lock/opam/menhirLib.20220210/opam +++ /dev/null @@ -1,30 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " - "Yann Régis-Gianas " -] -homepage: "http://gitlab.inria.fr/fpottier/menhir" -dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" -bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" { >= "4.03.0" } - "dune" { >= "2.8.0" } -] -conflicts: [ - "menhir" { != version } -] -synopsis: "Runtime support library for parsers generated by Menhir" -url { - src: - "https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz" - checksum: [ - "md5=e3cef220f676c4b1c16cbccb174cefe3" - "sha512=3063fec1d8b9fe092c8461b0689d426c7fe381a2bf3fd258dc42ceecca1719d32efbb8a18d94ada5555c38175ea352da3adbb239fdbcbcf52c3a5c85a4d9586f" - ] -} diff --git a/reason.esy.lock/opam/menhirSdk.20220210/opam b/reason.esy.lock/opam/menhirSdk.20220210/opam deleted file mode 100644 index 585d2ca33..000000000 --- a/reason.esy.lock/opam/menhirSdk.20220210/opam +++ /dev/null @@ -1,30 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " - "Yann Régis-Gianas " -] -homepage: "http://gitlab.inria.fr/fpottier/menhir" -dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" -bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" { >= "4.03.0" } - "dune" { >= "2.8.0" } -] -conflicts: [ - "menhir" { != version } -] -synopsis: "Compile-time library for auxiliary tools related to Menhir" -url { - src: - "https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz" - checksum: [ - "md5=e3cef220f676c4b1c16cbccb174cefe3" - "sha512=3063fec1d8b9fe092c8461b0689d426c7fe381a2bf3fd258dc42ceecca1719d32efbb8a18d94ada5555c38175ea352da3adbb239fdbcbcf52c3a5c85a4d9586f" - ] -} diff --git a/reason.esy.lock/opam/merlin-extend.0.6.1/opam b/reason.esy.lock/opam/merlin-extend.0.6.1/opam deleted file mode 100644 index 9f9936505..000000000 --- a/reason.esy.lock/opam/merlin-extend.0.6.1/opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "2.0" -maintainer: "Frederic Bour " -authors: "Frederic Bour " -homepage: "https://github.com/let-def/merlin-extend" -bug-reports: "https://github.com/let-def/merlin-extend" -license: "MIT" -dev-repo: "git+https://github.com/let-def/merlin-extend.git" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "dune" {>= "1.0"} - "cppo" {build & >= "1.1.0"} - "ocaml" {>= "4.02.3"} -] -synopsis: "A protocol to provide custom frontend to Merlin" -description: """ -This protocol allows to replace the OCaml frontend of Merlin. -It extends what used to be done with the `-pp' flag to handle a few more cases.""" -doc: "https://let-def.github.io/merlin-extend" -url { - src: - "https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz" - checksum: [ - "sha256=5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" - "sha512=631fc96aab2f35e12a078c9b4907ca7b0db9f1e3a4026040e6c23b82e0171c256a89fb5d4c887f1d156eb9e3152783cdf7a546b2496051007a1bcf5777417396" - ] -} -x-commit-hash: "cf2707bbe8e034c6ecf5d0fecd3fd889f6ab14bf" diff --git a/reason.esy.lock/opam/merlin-lib.4.8-414/opam b/reason.esy.lock/opam/merlin-lib.4.8-414/opam deleted file mode 100644 index 07698b02d..000000000 --- a/reason.esy.lock/opam/merlin-lib.4.8-414/opam +++ /dev/null @@ -1,34 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -license: "MIT" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.14" & < "4.15"} - "dune" {>= "2.9.0"} - "csexp" {>= "1.5.1"} - "menhir" {dev & >= "20201216"} - "menhirLib" {dev & >= "20201216"} - "menhirSdk" {dev & >= "20201216"} -] -synopsis: - "Merlin's libraries" -description: - "These libraries provides access to low-level compiler interfaces and the - standard higher-level merlin protocol. The library is provided as-is, is not - thoroughly documented, and its public API might break with any new release." -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" - checksum: [ - "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" - ] -} -x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/reason.esy.lock/opam/merlin.4.8-414/opam b/reason.esy.lock/opam/merlin.4.8-414/opam deleted file mode 100644 index b080c70cc..000000000 --- a/reason.esy.lock/opam/merlin.4.8-414/opam +++ /dev/null @@ -1,78 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -license: "MIT" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -depends: [ - "ocaml" {>= "4.14" & < "4.15"} - "dune" {>= "2.9.0"} - "merlin-lib" {= version} - "dot-merlin-reader" {>= "4.6"} - "yojson" {>= "2.0.0"} - "conf-jq" {with-test} - "ppxlib" {with-test} -] -conflicts: [ - "seq" {!= "base"} - "base-effects" -] -synopsis: - "Editor helper, provides completion, typing and source browsing in Vim and Emacs" -description: - "Merlin is an assistant for editing OCaml code. It aims to provide the features available in modern IDEs: error reporting, auto completion, source browsing and much more." -post-messages: [ - "merlin installed. - -Quick setup for VIM -------------------- -Append this to your .vimrc to add merlin to vim's runtime-path: - let g:opamshare = substitute(system('opam var share'),'\\n$','','''') - execute \"set rtp+=\" . g:opamshare . \"/merlin/vim\" - -Also run the following line in vim to index the documentation: - :execute \"helptags \" . g:opamshare . \"/merlin/vim/doc\" - -Quick setup for EMACS -------------------- -Add opam emacs directory to your load-path by appending this to your .emacs: - (let ((opam-share (ignore-errors (car (process-lines \"opam\" \"var\" \"share\"))))) - (when (and opam-share (file-directory-p opam-share)) - ;; Register Merlin - (add-to-list 'load-path (expand-file-name \"emacs/site-lisp\" opam-share)) - (autoload 'merlin-mode \"merlin\" nil t nil) - ;; Automatically start it in OCaml buffers - (add-hook 'tuareg-mode-hook 'merlin-mode t) - (add-hook 'caml-mode-hook 'merlin-mode t) - ;; Use opam switch to lookup ocamlmerlin binary - (setq merlin-command 'opam))) - -Take a look at https://github.com/ocaml/merlin for more information - -Quick setup with opam-user-setup --------------------------------- - -Opam-user-setup support Merlin. - - $ opam user-setup install - -should take care of basic setup. -See https://github.com/OCamlPro/opam-user-setup -" - {success & !user-setup:installed} -] -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" - checksum: [ - "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" - ] -} -x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch b/reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch deleted file mode 100644 index 8011238cd..000000000 --- a/reason.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff a/configure b/configure ---- a/configure -+++ b/configure -@@ -294,7 +294,7 @@ - # If findlib has been configured -sitelib $(ocamlc -where) then there's - # nothing to do, but otherwise we need to put OCaml's Standard Library - # into the path setting. -- if [ ! -e "${ocaml_sitelib}/stdlib/META" ]; then -+ if [ ! -e "${ocaml_sitelib}/stdlib.cmi" ]; then - ocamlpath="${ocaml_core_stdlib}${path_sep}${ocamlpath}" - fi - fi diff --git a/reason.esy.lock/opam/ocamlfind.1.9.6/opam b/reason.esy.lock/opam/ocamlfind.1.9.6/opam deleted file mode 100644 index a81f0c50e..000000000 --- a/reason.esy.lock/opam/ocamlfind.1.9.6/opam +++ /dev/null @@ -1,48 +0,0 @@ -opam-version: "2.0" -synopsis: "A library manager for OCaml" -description: """ -Findlib is a library manager for OCaml. It provides a convention how -to store libraries, and a file format ("META") to describe the -properties of libraries. There is also a tool (ocamlfind) for -interpreting the META files, so that it is very easy to use libraries -in programs and scripts. -""" -license: "MIT" -maintainer: "Thomas Gazagnaire " -authors: "Gerd Stolpmann " -homepage: "http://projects.camlcity.org/projects/findlib.html" -bug-reports: "https://github.com/ocaml/ocamlfind/issues" -depends: [ - "ocaml" {>= "3.08.0"} -] -depopts: ["graphics"] -build: [ - [ - "./configure" - "-bindir" bin - "-sitelib" lib - "-mandir" man - "-config" "%{lib}%/findlib.conf" - "-no-custom" - "-no-camlp4" {!ocaml:preinstalled & ocaml:version >= "4.02.0"} - "-no-topfind" {ocaml:preinstalled} - ] - [make "all"] - [make "opt"] {ocaml:native} -] -install: [ - [make "install"] - ["install" "-m" "0755" "ocaml-stub" "%{bin}%/ocaml"] {ocaml:preinstalled} -] -extra-files: ["0001-Harden-test-for-OCaml-5.patch" "md5=3cddbf72164c29d4e50e077a92a37c6c"] -# See https://github.com/ocaml/ocamlfind/pull/61 -patches: ["0001-Harden-test-for-OCaml-5.patch"] -dev-repo: "git+https://github.com/ocaml/ocamlfind.git" -url { - src: "http://download.camlcity.org/download/findlib-1.9.6.tar.gz" - checksum: [ - "md5=96c6ee50a32cca9ca277321262dbec57" - "sha512=cfaf1872d6ccda548f07d32cc6b90c3aafe136d2aa6539e03143702171ee0199add55269bba894c77115535dc46a5835901a5d7c75768999e72db503bfd83027" - ] -} -available: os != "win32" diff --git a/reason.esy.lock/opam/ppx_derivers.1.2.1/opam b/reason.esy.lock/opam/ppx_derivers.1.2.1/opam deleted file mode 100644 index 484b2654f..000000000 --- a/reason.esy.lock/opam/ppx_derivers.1.2.1/opam +++ /dev/null @@ -1,23 +0,0 @@ -opam-version: "2.0" -maintainer: "jeremie@dimino.org" -authors: ["Jérémie Dimino"] -license: "BSD-3-Clause" -homepage: "https://github.com/ocaml-ppx/ppx_derivers" -bug-reports: "https://github.com/ocaml-ppx/ppx_derivers/issues" -dev-repo: "git+https://github.com/ocaml-ppx/ppx_derivers.git" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" - "dune" -] -synopsis: "Shared [@@deriving] plugin registry" -description: """ -Ppx_derivers is a tiny package whose sole purpose is to allow -ppx_deriving and ppx_type_conv to inter-operate gracefully when linked -as part of the same ocaml-migrate-parsetree driver.""" -url { - src: "https://github.com/ocaml-ppx/ppx_derivers/archive/1.2.1.tar.gz" - checksum: "md5=5dc2bf130c1db3c731fe0fffc5648b41" -} diff --git a/reason.esy.lock/opam/seq.base/files/META.seq b/reason.esy.lock/opam/seq.base/files/META.seq deleted file mode 100644 index 06b95eff3..000000000 --- a/reason.esy.lock/opam/seq.base/files/META.seq +++ /dev/null @@ -1,4 +0,0 @@ -name="seq" -version="[distributed with OCaml 4.07 or above]" -description="dummy backward-compatibility package for iterators" -requires="" diff --git a/reason.esy.lock/opam/seq.base/files/seq.install b/reason.esy.lock/opam/seq.base/files/seq.install deleted file mode 100644 index c4d70206e..000000000 --- a/reason.esy.lock/opam/seq.base/files/seq.install +++ /dev/null @@ -1,3 +0,0 @@ -lib:[ - "META.seq" {"META"} -] diff --git a/reason.esy.lock/opam/seq.base/opam b/reason.esy.lock/opam/seq.base/opam deleted file mode 100644 index b33d8c7da..000000000 --- a/reason.esy.lock/opam/seq.base/opam +++ /dev/null @@ -1,15 +0,0 @@ -opam-version: "2.0" -maintainer: " " -authors: " " -homepage: " " -depends: [ - "ocaml" {>= "4.07.0"} -] -dev-repo: "git+https://github.com/ocaml/ocaml.git" -bug-reports: "https://caml.inria.fr/mantis/main_page.php" -synopsis: - "Compatibility package for OCaml's standard iterator type starting from 4.07." -extra-files: [ - ["seq.install" "md5=026b31e1df290373198373d5aaa26e42"] - ["META.seq" "md5=b33c8a1a6c7ed797816ce27df4855107"] -] diff --git a/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch b/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch deleted file mode 100644 index 3aa5aa696..000000000 --- a/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch +++ /dev/null @@ -1,485 +0,0 @@ ---- ./Makefile -+++ ./Makefile -@@ -57,16 +57,16 @@ - cat findlib.conf.in | \ - $(SH) tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf - if ./tools/cmd_from_same_dir ocamlc; then \ -- echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \ -+ echo 'ocamlc="ocamlc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - if ./tools/cmd_from_same_dir ocamlopt; then \ -- echo 'ocamlopt="ocamlopt.opt"' >>findlib.conf; \ -+ echo 'ocamlopt="ocamlopt.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - if ./tools/cmd_from_same_dir ocamldep; then \ -- echo 'ocamldep="ocamldep.opt"' >>findlib.conf; \ -+ echo 'ocamldep="ocamldep.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - if ./tools/cmd_from_same_dir ocamldoc; then \ -- echo 'ocamldoc="ocamldoc.opt"' >>findlib.conf; \ -+ echo 'ocamldoc="ocamldoc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - - .PHONY: install-doc ---- ./src/findlib/findlib_config.mlp -+++ ./src/findlib/findlib_config.mlp -@@ -24,3 +24,5 @@ - | "MacOS" -> "" (* don't know *) - | _ -> failwith "Unknown Sys.os_type" - ;; -+ -+let exec_suffix = "@EXEC_SUFFIX@";; ---- ./src/findlib/findlib.ml -+++ ./src/findlib/findlib.ml -@@ -28,15 +28,20 @@ - let conf_ldconf = ref "";; - let conf_ignore_dups_in = ref ([] : string list);; - --let ocamlc_default = "ocamlc";; --let ocamlopt_default = "ocamlopt";; --let ocamlcp_default = "ocamlcp";; --let ocamloptp_default = "ocamloptp";; --let ocamlmklib_default = "ocamlmklib";; --let ocamlmktop_default = "ocamlmktop";; --let ocamldep_default = "ocamldep";; --let ocamlbrowser_default = "ocamlbrowser";; --let ocamldoc_default = "ocamldoc";; -+let add_exec str = -+ match Findlib_config.exec_suffix with -+ | "" -> str -+ | a -> str ^ a ;; -+let ocamlc_default = add_exec "ocamlc";; -+let ocamlopt_default = add_exec "ocamlopt";; -+let ocamlcp_default = add_exec "ocamlcp";; -+let ocamloptp_default = add_exec "ocamloptp";; -+let ocamlmklib_default = add_exec "ocamlmklib";; -+let ocamlmktop_default = add_exec "ocamlmktop";; -+let ocamldep_default = add_exec "ocamldep";; -+let ocamlbrowser_default = add_exec "ocamlbrowser";; -+let ocamldoc_default = add_exec "ocamldoc";; -+ - - - let init_manually ---- ./src/findlib/fl_package_base.ml -+++ ./src/findlib/fl_package_base.ml -@@ -133,7 +133,15 @@ - List.find (fun def -> def.def_var = "exists_if") p.package_defs in - let files = Fl_split.in_words def.def_value in - List.exists -- (fun file -> Sys.file_exists (Filename.concat d' file)) -+ (fun file -> -+ let fln = Filename.concat d' file in -+ let e = Sys.file_exists fln in -+ (* necessary for ppx executables *) -+ if e || Sys.os_type <> "Win32" || Filename.check_suffix fln ".exe" then -+ e -+ else -+ Sys.file_exists (fln ^ ".exe") -+ ) - files - with Not_found -> true in - ---- ./src/findlib/fl_split.ml -+++ ./src/findlib/fl_split.ml -@@ -126,10 +126,17 @@ - | '/' | '\\' -> true - | _ -> false in - let norm_dir_win() = -- if l >= 1 && s.[0] = '/' then -- Buffer.add_char b '\\' else Buffer.add_char b s.[0]; -- if l >= 2 && s.[1] = '/' then -- Buffer.add_char b '\\' else Buffer.add_char b s.[1]; -+ if l >= 1 then ( -+ if s.[0] = '/' then -+ Buffer.add_char b '\\' -+ else -+ Buffer.add_char b s.[0] ; -+ if l >= 2 then -+ if s.[1] = '/' then -+ Buffer.add_char b '\\' -+ else -+ Buffer.add_char b s.[1]; -+ ); - for k = 2 to l - 1 do - let c = s.[k] in - if is_slash c then ( ---- ./src/findlib/frontend.ml -+++ ./src/findlib/frontend.ml -@@ -31,10 +31,18 @@ - else - Sys_error (arg ^ ": " ^ Unix.error_message code) - -+let is_win = Sys.os_type = "Win32" -+ -+let () = -+ match Findlib_config.system with -+ | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" -> -+ (try set_binary_mode_out stdout true with _ -> ()); -+ (try set_binary_mode_out stderr true with _ -> ()); -+ | _ -> () - - let slashify s = - match Findlib_config.system with -- | "mingw" | "mingw64" | "cygwin" -> -+ | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" -> - let b = Buffer.create 80 in - String.iter - (function -@@ -49,7 +57,7 @@ - - let out_path ?(prefix="") s = - match Findlib_config.system with -- | "mingw" | "mingw64" | "cygwin" -> -+ | "win32" | "win64" | "mingw" | "mingw64" | "cygwin" -> - let u = slashify s in - prefix ^ - (if String.contains u ' ' then -@@ -273,11 +281,9 @@ - - - let identify_dir d = -- match Sys.os_type with -- | "Win32" -> -- failwith "identify_dir" (* not available *) -- | _ -> -- let s = Unix.stat d in -+ if is_win then -+ failwith "identify_dir"; (* not available *) -+ let s = Unix.stat d in - (s.Unix.st_dev, s.Unix.st_ino) - ;; - -@@ -459,6 +465,96 @@ - ) - packages - -+let rewrite_cmd s = -+ if s = "" || not is_win then -+ s -+ else -+ let s = -+ let l = String.length s in -+ let b = Buffer.create l in -+ for i = 0 to pred l do -+ match s.[i] with -+ | '/' -> Buffer.add_char b '\\' -+ | x -> Buffer.add_char b x -+ done; -+ Buffer.contents b -+ in -+ if (Filename.is_implicit s && String.contains s '\\' = false) || -+ Filename.check_suffix (String.lowercase s) ".exe" then -+ s -+ else -+ let s' = s ^ ".exe" in -+ if Sys.file_exists s' then -+ s' -+ else -+ s -+ -+let rewrite_cmd s = -+ if s = "" || not is_win then s else -+ let s = -+ let l = String.length s in -+ let b = Buffer.create l in -+ for i = 0 to pred l do -+ match s.[i] with -+ | '/' -> Buffer.add_char b '\\' -+ | x -> Buffer.add_char b x -+ done; -+ Buffer.contents b -+ in -+ if (Filename.is_implicit s && String.contains s '\\' = false) || -+ Filename.check_suffix (String.lowercase s) ".exe" then -+ s -+ else -+ let s' = s ^ ".exe" in -+ if Sys.file_exists s' then -+ s' -+ else -+ s -+ -+let rewrite_pp cmd = -+ if not is_win then cmd else -+ let module T = struct exception Keep end in -+ let is_whitespace = function -+ | ' ' | '\011' | '\012' | '\n' | '\r' | '\t' -> true -+ | _ -> false in -+ (* characters that triggers special behaviour (cmd.exe, not unix shell) *) -+ let is_unsafe_char = function -+ | '(' | ')' | '%' | '!' | '^' | '<' | '>' | '&' -> true -+ | _ -> false in -+ let len = String.length cmd in -+ let buf = Buffer.create (len + 4) in -+ let buf_cmd = Buffer.create len in -+ let rec iter_ws i = -+ if i >= len then () else -+ let cur = cmd.[i] in -+ if is_whitespace cur then ( -+ Buffer.add_char buf cur; -+ iter_ws (succ i) -+ ) -+ else -+ iter_cmd i -+ and iter_cmd i = -+ if i >= len then add_buf_cmd () else -+ let cur = cmd.[i] in -+ if is_unsafe_char cur || cur = '"' || cur = '\'' then -+ raise T.Keep; -+ if is_whitespace cur then ( -+ add_buf_cmd (); -+ Buffer.add_substring buf cmd i (len - i) -+ ) -+ else ( -+ Buffer.add_char buf_cmd cur; -+ iter_cmd (succ i) -+ ) -+ and add_buf_cmd () = -+ if Buffer.length buf_cmd > 0 then -+ Buffer.add_string buf (rewrite_cmd (Buffer.contents buf_cmd)) -+ in -+ try -+ iter_ws 0; -+ Buffer.contents buf -+ with -+ | T.Keep -> cmd - - let process_pp_spec syntax_preds packages pp_opts = - (* Returns: pp_command *) -@@ -549,7 +645,7 @@ - None -> [] - | Some cmd -> - ["-pp"; -- cmd ^ " " ^ -+ (rewrite_cmd cmd) ^ " " ^ - String.concat " " (List.map Filename.quote pp_i_options) ^ " " ^ - String.concat " " (List.map Filename.quote pp_archives) ^ " " ^ - String.concat " " (List.map Filename.quote pp_opts)] -@@ -625,9 +721,11 @@ - in - try - let preprocessor = -+ rewrite_cmd ( - resolve_path - ~base ~explicit:true -- (package_property predicates pname "ppx") in -+ (package_property predicates pname "ppx") ) -+ in - ["-ppx"; String.concat " " (preprocessor :: options)] - with Not_found -> [] - ) -@@ -895,6 +993,14 @@ - switch (e.g. -L instead of -L ) - *) - -+(* We may need to remove files on which we do not have complete control. -+ On Windows, removing a read-only file fails so try to change the -+ mode of the file first. *) -+let remove_file fname = -+ try Sys.remove fname -+ with Sys_error _ when is_win -> -+ (try Unix.chmod fname 0o666 with Unix.Unix_error _ -> ()); -+ Sys.remove fname - - let ocamlc which () = - -@@ -1022,9 +1128,12 @@ - - "-intf", - Arg.String (fun s -> pass_files := !pass_files @ [ Intf(slashify s) ]); -- -+ - "-pp", -- Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" s); -+ Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" (rewrite_pp s)); -+ -+ "-ppx", -+ Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s)); - - "-thread", - Arg.Unit (fun _ -> threads := threads_default); -@@ -1237,7 +1346,7 @@ - with - any -> - close_out initl; -- Sys.remove initl_file_name; -+ remove_file initl_file_name; - raise any - end; - -@@ -1245,9 +1354,9 @@ - at_exit - (fun () -> - let tr f x = try f x with _ -> () in -- tr Sys.remove initl_file_name; -- tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmi"); -- tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmo"); -+ tr remove_file initl_file_name; -+ tr remove_file (Filename.chop_extension initl_file_name ^ ".cmi"); -+ tr remove_file (Filename.chop_extension initl_file_name ^ ".cmo"); - ); - - let exclude_list = [ stdlibdir; threads_dir; vmthreads_dir ] in -@@ -1493,7 +1602,9 @@ - [ "-v", Arg.Unit (fun () -> verbose := Verbose); - "-pp", Arg.String (fun s -> - pp_specified := true; -- options := !options @ ["-pp"; s]); -+ options := !options @ ["-pp"; rewrite_pp s]); -+ "-ppx", Arg.String (fun s -> -+ options := !options @ ["-ppx"; rewrite_pp s]); - ] - ) - ) -@@ -1672,7 +1783,9 @@ - Arg.String (fun s -> add_spec_fn "-I" (slashify (resolve_path s))); - - "-pp", Arg.String (fun s -> pp_specified := true; -- add_spec_fn "-pp" s); -+ add_spec_fn "-pp" (rewrite_pp s)); -+ "-ppx", Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s)); -+ - ] - ) - ) -@@ -1830,7 +1943,10 @@ - output_string ch_out append; - close_out ch_out; - close_in ch_in; -- Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime; -+ (try Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime -+ with Unix.Unix_error(e,_,_) -> -+ prerr_endline("Warning: setting utimes for " ^ outpath -+ ^ ": " ^ Unix.error_message e)); - - prerr_endline("Installed " ^ outpath); - with -@@ -1882,6 +1998,8 @@ - Unix.openfile (Filename.concat dir owner_file) [Unix.O_RDONLY] 0 in - let f = - Unix.in_channel_of_descr fd in -+ if is_win then -+ set_binary_mode_in f false; - try - let line = input_line f in - let is_my_file = (line = pkg) in -@@ -2208,7 +2326,7 @@ - let lines = read_ldconf !ldconf in - let dlldir_norm = Fl_split.norm_dir dlldir in - let dlldir_norm_lc = string_lowercase_ascii dlldir_norm in -- let ci_filesys = (Sys.os_type = "Win32") in -+ let ci_filesys = is_win in - let check_dir d = - let d' = Fl_split.norm_dir d in - (d' = dlldir_norm) || -@@ -2356,7 +2474,7 @@ - List.iter - (fun file -> - let absfile = Filename.concat dlldir file in -- Sys.remove absfile; -+ remove_file absfile; - prerr_endline ("Removed " ^ absfile) - ) - dll_files -@@ -2365,7 +2483,7 @@ - (* Remove the files from the package directory: *) - if Sys.file_exists pkgdir then begin - let files = Sys.readdir pkgdir in -- Array.iter (fun f -> Sys.remove (Filename.concat pkgdir f)) files; -+ Array.iter (fun f -> remove_file (Filename.concat pkgdir f)) files; - Unix.rmdir pkgdir; - prerr_endline ("Removed " ^ pkgdir) - end -@@ -2415,7 +2533,9 @@ - - - let print_configuration() = -+ let sl = slashify in - let dir s = -+ let s = sl s in - if Sys.file_exists s then - s - else -@@ -2453,27 +2573,27 @@ - if md = "" then "the corresponding package directories" else dir md - ); - Printf.printf "The standard library is assumed to reside in:\n %s\n" -- (Findlib.ocaml_stdlib()); -+ (sl (Findlib.ocaml_stdlib())); - Printf.printf "The ld.conf file can be found here:\n %s\n" -- (Findlib.ocaml_ldconf()); -+ (sl (Findlib.ocaml_ldconf())); - flush stdout - | Some "conf" -> -- print_endline (Findlib.config_file()) -+ print_endline (sl (Findlib.config_file())) - | Some "path" -> -- List.iter print_endline (Findlib.search_path()) -+ List.iter ( fun x -> print_endline (sl x)) (Findlib.search_path()) - | Some "destdir" -> -- print_endline (Findlib.default_location()) -+ print_endline ( sl (Findlib.default_location())) - | Some "metadir" -> -- print_endline (Findlib.meta_directory()) -+ print_endline ( sl (Findlib.meta_directory())) - | Some "metapath" -> - let mdir = Findlib.meta_directory() in - let ddir = Findlib.default_location() in -- print_endline -- (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META") -+ print_endline ( sl -+ (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META")) - | Some "stdlib" -> -- print_endline (Findlib.ocaml_stdlib()) -+ print_endline ( sl (Findlib.ocaml_stdlib())) - | Some "ldconf" -> -- print_endline (Findlib.ocaml_ldconf()) -+ print_endline ( sl (Findlib.ocaml_ldconf())) - | _ -> - assert false - ;; -@@ -2481,7 +2601,7 @@ - - let ocamlcall pkg cmd = - let dir = package_directory pkg in -- let path = Filename.concat dir cmd in -+ let path = rewrite_cmd (Filename.concat dir cmd) in - begin - try Unix.access path [ Unix.X_OK ] - with -@@ -2647,6 +2767,10 @@ - | Sys_error f -> - prerr_endline ("ocamlfind: " ^ f); - exit 2 -+ | Unix.Unix_error (e, fn, f) -> -+ prerr_endline ("ocamlfind: " ^ fn ^ " " ^ f -+ ^ ": " ^ Unix.error_message e); -+ exit 2 - | Findlib.No_such_package(pkg,info) -> - prerr_endline ("ocamlfind: Package `" ^ pkg ^ "' not found" ^ - (if info <> "" then " - " ^ info else "")); ---- ./src/findlib/Makefile -+++ ./src/findlib/Makefile -@@ -90,6 +90,7 @@ - cat findlib_config.mlp | \ - $(SH) $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ - $(SH) $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ -+ $(SH) $(TOP)/tools/patch '@EXEC_SUFFIX@' '$(EXEC_SUFFIX)' | \ - sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \ - -e 's;@SYSTEM@;$(SYSTEM);g' \ - >findlib_config.ml ---- ./src/findlib/frontend.ml -+++ ./src/findlib/frontend.ml -@@ -281,10 +281,8 @@ - - - let identify_dir d = -- if is_win then -- failwith "identify_dir"; (* not available *) - let s = Unix.stat d in -- (s.Unix.st_dev, s.Unix.st_ino) -+ (s.Unix.st_dev, s.Unix.st_ino) - ;; - - diff --git a/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json b/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json deleted file mode 100644 index bf169e50d..000000000 --- a/reason.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "build": [ - [ - "bash", - "-c", - "#{os == 'windows' ? 'patch -p1 < findlib.patch' : 'true'}" - ], - [ - "./configure", - "-bindir", - "#{self.bin}", - "-sitelib", - "#{self.lib}", - "-mandir", - "#{self.man}", - "-config", - "#{self.lib}/findlib.conf", - "-no-custom", - "-no-topfind" - ], - [ - "make", - "all" - ], - [ - "make", - "opt" - ] - ], - "install": [ - [ - "make", - "install" - ], - [ - "install", - "-m", - "0755", - "ocaml-stub", - "#{self.bin}/ocaml" - ], - [ - "mkdir", - "-p", - "#{self.toplevel}" - ], - [ - "install", - "-m", - "0644", - "src/findlib/topfind", - "#{self.toplevel}/topfind" - ] - ], - "exportedEnv": { - "OCAML_TOPLEVEL_PATH": { - "val": "#{self.toplevel}", - "scope": "global" - } - } -} diff --git a/reason.json b/reason.json index 2681801a7..3e027f07f 100644 --- a/reason.json +++ b/reason.json @@ -14,7 +14,8 @@ "@opam/menhir": " >= 20180523.0.0", "@opam/merlin-extend": " >= 0.6", "@opam/ppx_derivers": "< 2.0.0", - "@opam/dune": "2.9.3" + "@opam/dune": ">= 2.9.3", + "@opam/dune-build-info": ">= 2.9.3" }, "devDependencies": { "@opam/merlin": "*", diff --git a/reason.opam b/reason.opam index fb3770113..fbc24dafc 100644 --- a/reason.opam +++ b/reason.opam @@ -11,10 +11,11 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03" & < "5.1"} - "dune" {>= "2.3"} - "ocamlfind" {build} - "menhir" {>= "20180523"} + "ocaml" {>= "4.03" & < "5.1"} + "dune" {>= "2.9.3"} + "dune-build-info" {>= "2.9.3"} + "ocamlfind" {build} + "menhir" {>= "20180523"} "merlin-extend" {>= "0.6"} "fix" "result" diff --git a/rtop.esy.lock/.gitattributes b/rtop.esy.lock/.gitattributes deleted file mode 100644 index e0b4e26c5..000000000 --- a/rtop.esy.lock/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ - -# Set eol to LF so files aren't converted to CRLF-eol on Windows. -* text eol=lf linguist-generated diff --git a/rtop.esy.lock/.gitignore b/rtop.esy.lock/.gitignore deleted file mode 100644 index a221be227..000000000 --- a/rtop.esy.lock/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -# Reset any possible .gitignore, we want all esy.lock to be un-ignored. -!* diff --git a/rtop.esy.lock/index.json b/rtop.esy.lock/index.json deleted file mode 100644 index 308750a02..000000000 --- a/rtop.esy.lock/index.json +++ /dev/null @@ -1,1016 +0,0 @@ -{ - "checksum": "22d6e47f86c696df9abb797ecdf9ba66", - "root": "@esy-ocaml/rtop@link-dev:./rtop.json", - "node": { - "ocaml@4.14.0@d41d8cd9": { - "id": "ocaml@4.14.0@d41d8cd9", - "name": "ocaml", - "version": "4.14.0", - "source": { - "type": "install", - "source": [ - "archive:https://registry.npmjs.org/ocaml/-/ocaml-4.14.0.tgz#sha1:619afaeabcc8732cc1f4014a7251403927f44021" - ] - }, - "overrides": [], - "dependencies": [], - "devDependencies": [] - }, - "@opam/zed@opam:3.1.0@6e750e3e": { - "id": "@opam/zed@opam:3.1.0@6e750e3e", - "name": "@opam/zed", - "version": "opam:3.1.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/51/51e8676ba972e5ad727633c161e404b1#md5:51e8676ba972e5ad727633c161e404b1", - "archive:https://github.com/ocaml-community/zed/archive/3.1.0.tar.gz#md5:51e8676ba972e5ad727633c161e404b1" - ], - "opam": { - "name": "zed", - "version": "3.1.0", - "path": "rtop.esy.lock/opam/zed.3.1.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/charInfo_width@opam:1.1.0@2e6806d6", - "@opam/camomile@opam:1.0.2@27671317", - "@opam/base-bytes@opam:base@19d0c2ff", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/charInfo_width@opam:1.1.0@2e6806d6", - "@opam/camomile@opam:1.0.2@27671317", - "@opam/base-bytes@opam:base@19d0c2ff" - ] - }, - "@opam/yojson@opam:2.0.2@eb65f292": { - "id": "@opam/yojson@opam:2.0.2@eb65f292", - "name": "@opam/yojson", - "version": "opam:2.0.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/87/876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b", - "archive:https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz#sha256:876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" - ], - "opam": { - "name": "yojson", - "version": "2.0.2", - "path": "rtop.esy.lock/opam/yojson.2.0.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/seq@opam:base@d8d7de1d", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/utop@opam:2.9.2@a8a2b147": { - "id": "@opam/utop@opam:2.9.2@a8a2b147", - "name": "@opam/utop", - "version": "opam:2.9.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/ab/abd1c592464ce5f31b17009954040d7c#md5:abd1c592464ce5f31b17009954040d7c", - "archive:https://github.com/ocaml-community/utop/releases/download/2.9.2/utop-2.9.2.tbz#md5:abd1c592464ce5f31b17009954040d7c" - ], - "opam": { - "name": "utop", - "version": "2.9.2", - "path": "rtop.esy.lock/opam/utop.2.9.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/lambda-term@opam:3.2.0@781c5f03", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", - "@opam/camomile@opam:1.0.2@27671317", - "@opam/base-unix@opam:base@87d0b2eb", - "@opam/base-threads@opam:base@36803084", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/lambda-term@opam:3.2.0@781c5f03", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317", - "@opam/base-unix@opam:base@87d0b2eb", - "@opam/base-threads@opam:base@36803084" - ] - }, - "@opam/trie@opam:1.0.0@f4e510e2": { - "id": "@opam/trie@opam:1.0.0@f4e510e2", - "name": "@opam/trie", - "version": "opam:1.0.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/84/84519b5f8bd92490bfc68a52f706ba14#md5:84519b5f8bd92490bfc68a52f706ba14", - "archive:https://github.com/kandu/trie/archive/1.0.0.tar.gz#md5:84519b5f8bd92490bfc68a52f706ba14" - ], - "opam": { - "name": "trie", - "version": "1.0.0", - "path": "rtop.esy.lock/opam/trie.1.0.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/topkg@opam:1.0.7@7ee47d76": { - "id": "@opam/topkg@opam:1.0.7@7ee47d76", - "name": "@opam/topkg", - "version": "opam:1.0.7", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha512/09/09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535#sha512:09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535", - "archive:https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz#sha512:09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535" - ], - "opam": { - "name": "topkg", - "version": "1.0.7", - "path": "rtop.esy.lock/opam/topkg.1.0.7" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/ocamlbuild@opam:0.14.2@c6163b28", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlbuild@opam:0.14.2@c6163b28" - ] - }, - "@opam/seq@opam:base@d8d7de1d": { - "id": "@opam/seq@opam:base@d8d7de1d", - "name": "@opam/seq", - "version": "opam:base", - "source": { - "type": "install", - "source": [ "no-source:" ], - "opam": { - "name": "seq", - "version": "base", - "path": "rtop.esy.lock/opam/seq.base" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] - }, - "@opam/result@opam:1.5@1c6a6533": { - "id": "@opam/result@opam:1.5@1c6a6533", - "name": "@opam/result", - "version": "opam:1.5", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/1b/1b82dec78849680b49ae9a8a365b831b#md5:1b82dec78849680b49ae9a8a365b831b", - "archive:https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz#md5:1b82dec78849680b49ae9a8a365b831b" - ], - "opam": { - "name": "result", - "version": "1.5", - "path": "rtop.esy.lock/opam/result.1.5" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/reason@opam:3.8.2@19b5db6d": { - "id": "@opam/reason@opam:3.8.2@19b5db6d", - "name": "@opam/reason", - "version": "opam:3.8.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/7a/7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2#sha256:7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2", - "archive:https://github.com/reasonml/reason/releases/download/3.8.2/reason-3.8.2.tbz#sha256:7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2" - ], - "opam": { - "name": "reason", - "version": "3.8.2", - "path": "rtop.esy.lock/opam/reason.3.8.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/merlin-extend@opam:0.6.1@7d979feb", - "@opam/menhir@opam:20220210@ff5ea9a7", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "@opam/merlin-extend@opam:0.6.1@7d979feb", - "@opam/menhir@opam:20220210@ff5ea9a7", - "@opam/fix@opam:20220121@17b9a1a4", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/react@opam:1.2.2@e0f4480e": { - "id": "@opam/react@opam:1.2.2@e0f4480e", - "name": "@opam/react", - "version": "opam:1.2.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha512/18/18cdd544d484222ba02db6bd9351571516532e7a1c107b59bbe39193837298f5c745eab6754f8bc6ff125b387be7018c6d6e6ac99f91925a5e4f53af688522b1#sha512:18cdd544d484222ba02db6bd9351571516532e7a1c107b59bbe39193837298f5c745eab6754f8bc6ff125b387be7018c6d6e6ac99f91925a5e4f53af688522b1", - "archive:https://erratique.ch/software/react/releases/react-1.2.2.tbz#sha512:18cdd544d484222ba02db6bd9351571516532e7a1c107b59bbe39193837298f5c745eab6754f8bc6ff125b387be7018c6d6e6ac99f91925a5e4f53af688522b1" - ], - "opam": { - "name": "react", - "version": "1.2.2", - "path": "rtop.esy.lock/opam/react.1.2.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/topkg@opam:1.0.7@7ee47d76", - "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/ocamlbuild@opam:0.14.2@c6163b28", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] - }, - "@opam/ppx_derivers@opam:1.2.1@e2cbad12": { - "id": "@opam/ppx_derivers@opam:1.2.1@e2cbad12", - "name": "@opam/ppx_derivers", - "version": "opam:1.2.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/5d/5dc2bf130c1db3c731fe0fffc5648b41#md5:5dc2bf130c1db3c731fe0fffc5648b41", - "archive:https://github.com/ocaml-ppx/ppx_derivers/archive/1.2.1.tar.gz#md5:5dc2bf130c1db3c731fe0fffc5648b41" - ], - "opam": { - "name": "ppx_derivers", - "version": "1.2.1", - "path": "rtop.esy.lock/opam/ppx_derivers.1.2.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/ocplib-endian@opam:1.2@008dc942": { - "id": "@opam/ocplib-endian@opam:1.2@008dc942", - "name": "@opam/ocplib-endian", - "version": "opam:1.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/8d/8d5492eeb7c6815ade72a7415ea30949#md5:8d5492eeb7c6815ade72a7415ea30949", - "archive:https://github.com/OCamlPro/ocplib-endian/archive/refs/tags/1.2.tar.gz#md5:8d5492eeb7c6815ade72a7415ea30949" - ], - "opam": { - "name": "ocplib-endian", - "version": "1.2", - "path": "rtop.esy.lock/opam/ocplib-endian.1.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/cppo@opam:1.6.9@db929a12", - "@opam/base-bytes@opam:base@19d0c2ff", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/base-bytes@opam:base@19d0c2ff" - ] - }, - "@opam/ocamlfind@opam:1.9.6@d090a512": { - "id": "@opam/ocamlfind@opam:1.9.6@d090a512", - "name": "@opam/ocamlfind", - "version": "opam:1.9.6", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/96/96c6ee50a32cca9ca277321262dbec57#md5:96c6ee50a32cca9ca277321262dbec57", - "archive:http://download.camlcity.org/download/findlib-1.9.6.tar.gz#md5:96c6ee50a32cca9ca277321262dbec57" - ], - "opam": { - "name": "ocamlfind", - "version": "1.9.6", - "path": "rtop.esy.lock/opam/ocamlfind.1.9.6" - } - }, - "overrides": [ - { - "opamoverride": - "rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override" - } - ], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] - }, - "@opam/ocamlbuild@opam:0.14.2@c6163b28": { - "id": "@opam/ocamlbuild@opam:0.14.2@c6163b28", - "name": "@opam/ocamlbuild", - "version": "opam:0.14.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/2f/2f407fadd57b073155a6aead887d9676#md5:2f407fadd57b073155a6aead887d9676", - "archive:https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz#md5:2f407fadd57b073155a6aead887d9676" - ], - "opam": { - "name": "ocamlbuild", - "version": "0.14.2", - "path": "rtop.esy.lock/opam/ocamlbuild.0.14.2" - } - }, - "overrides": [ - { - "opamoverride": - "rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override" - } - ], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ "ocaml@4.14.0@d41d8cd9" ] - }, - "@opam/mew_vi@opam:0.5.0@cf66c299": { - "id": "@opam/mew_vi@opam:0.5.0@cf66c299", - "name": "@opam/mew_vi", - "version": "opam:0.5.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/34/341e9a9a20383641015bf503952906bc#md5:341e9a9a20383641015bf503952906bc", - "archive:https://github.com/kandu/mew_vi/archive/0.5.0.tar.gz#md5:341e9a9a20383641015bf503952906bc" - ], - "opam": { - "name": "mew_vi", - "version": "0.5.0", - "path": "rtop.esy.lock/opam/mew_vi.0.5.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew@opam:0.1.0@65011d4b", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/mew@opam:0.1.0@65011d4b": { - "id": "@opam/mew@opam:0.1.0@65011d4b", - "name": "@opam/mew", - "version": "opam:0.1.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/22/2298149d1415cd804ab4e01f01ea10a0#md5:2298149d1415cd804ab4e01f01ea10a0", - "archive:https://github.com/kandu/mew/archive/0.1.0.tar.gz#md5:2298149d1415cd804ab4e01f01ea10a0" - ], - "opam": { - "name": "mew", - "version": "0.1.0", - "path": "rtop.esy.lock/opam/mew.0.1.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/trie@opam:1.0.0@f4e510e2", - "@opam/result@opam:1.5@1c6a6533", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/merlin-lib@opam:4.8-414@ece13977": { - "id": "@opam/merlin-lib@opam:4.8-414@ece13977", - "name": "@opam/merlin-lib", - "version": "opam:4.8-414", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", - "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - ], - "opam": { - "name": "merlin-lib", - "version": "4.8-414", - "path": "rtop.esy.lock/opam/merlin-lib.4.8-414" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/csexp@opam:1.5.1@8a8fb3a7", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/csexp@opam:1.5.1@8a8fb3a7" - ] - }, - "@opam/merlin-extend@opam:0.6.1@7d979feb": { - "id": "@opam/merlin-extend@opam:0.6.1@7d979feb", - "name": "@opam/merlin-extend", - "version": "opam:0.6.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/5e/5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7", - "archive:https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz#sha256:5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" - ], - "opam": { - "name": "merlin-extend", - "version": "0.6.1", - "path": "rtop.esy.lock/opam/merlin-extend.0.6.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/merlin@opam:4.8-414@bb3fbab2": { - "id": "@opam/merlin@opam:4.8-414@bb3fbab2", - "name": "@opam/merlin", - "version": "opam:4.8-414", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/1c/1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf", - "archive:https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz#sha256:1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - ], - "opam": { - "name": "merlin", - "version": "4.8-414", - "path": "rtop.esy.lock/opam/merlin.4.8-414" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/dot-merlin-reader@opam:4.6@85c88957", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/yojson@opam:2.0.2@eb65f292", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/dot-merlin-reader@opam:4.6@85c88957" - ] - }, - "@opam/menhirSdk@opam:20220210@fe146ed3": { - "id": "@opam/menhirSdk@opam:20220210@fe146ed3", - "name": "@opam/menhirSdk", - "version": "opam:20220210", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e3/e3cef220f676c4b1c16cbccb174cefe3#md5:e3cef220f676c4b1c16cbccb174cefe3", - "archive:https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz#md5:e3cef220f676c4b1c16cbccb174cefe3" - ], - "opam": { - "name": "menhirSdk", - "version": "20220210", - "path": "rtop.esy.lock/opam/menhirSdk.20220210" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/menhirLib@opam:20220210@9afeb270": { - "id": "@opam/menhirLib@opam:20220210@9afeb270", - "name": "@opam/menhirLib", - "version": "opam:20220210", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e3/e3cef220f676c4b1c16cbccb174cefe3#md5:e3cef220f676c4b1c16cbccb174cefe3", - "archive:https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz#md5:e3cef220f676c4b1c16cbccb174cefe3" - ], - "opam": { - "name": "menhirLib", - "version": "20220210", - "path": "rtop.esy.lock/opam/menhirLib.20220210" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/menhir@opam:20220210@ff5ea9a7": { - "id": "@opam/menhir@opam:20220210@ff5ea9a7", - "name": "@opam/menhir", - "version": "opam:20220210", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e3/e3cef220f676c4b1c16cbccb174cefe3#md5:e3cef220f676c4b1c16cbccb174cefe3", - "archive:https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz#md5:e3cef220f676c4b1c16cbccb174cefe3" - ], - "opam": { - "name": "menhir", - "version": "20220210", - "path": "rtop.esy.lock/opam/menhir.20220210" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", - "@opam/menhirLib@opam:20220210@9afeb270", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/menhirSdk@opam:20220210@fe146ed3", - "@opam/menhirLib@opam:20220210@9afeb270", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/lwt_react@opam:1.2.0@4253a145": { - "id": "@opam/lwt_react@opam:1.2.0@4253a145", - "name": "@opam/lwt_react", - "version": "opam:1.2.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/e6/e63979ee40a80d5b9e9e5545f33323b4#md5:e63979ee40a80d5b9e9e5545f33323b4", - "archive:https://github.com/ocsigen/lwt/archive/5.6.0.tar.gz#md5:e63979ee40a80d5b9e9e5545f33323b4" - ], - "opam": { - "name": "lwt_react", - "version": "1.2.0", - "path": "rtop.esy.lock/opam/lwt_react.1.2.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/cppo@opam:1.6.9@db929a12", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/react@opam:1.2.2@e0f4480e", - "@opam/lwt@opam:5.6.1@2a9902ab", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/lwt_log@opam:1.1.2@35f097e3": { - "id": "@opam/lwt_log@opam:1.1.2@35f097e3", - "name": "@opam/lwt_log", - "version": "opam:1.1.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/f0/f060baea008b2563265dbcf0250f8912#md5:f060baea008b2563265dbcf0250f8912", - "archive:https://github.com/ocsigen/lwt_log/archive/1.1.2.tar.gz#md5:f060baea008b2563265dbcf0250f8912" - ], - "opam": { - "name": "lwt_log", - "version": "1.1.2", - "path": "rtop.esy.lock/opam/lwt_log.1.1.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/lwt@opam:5.6.1@2a9902ab": { - "id": "@opam/lwt@opam:5.6.1@2a9902ab", - "name": "@opam/lwt", - "version": "opam:5.6.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/27/279024789a0ec84a9d97d98bad847f97#md5:279024789a0ec84a9d97d98bad847f97", - "archive:https://github.com/ocsigen/lwt/archive/5.6.1.tar.gz#md5:279024789a0ec84a9d97d98bad847f97" - ], - "opam": { - "name": "lwt", - "version": "5.6.1", - "path": "rtop.esy.lock/opam/lwt.5.6.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", - "@opam/dune-configurator@opam:2.9.3@174e411b", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/cppo@opam:1.6.9@db929a12", - "@opam/base-unix@opam:base@87d0b2eb", - "@opam/base-threads@opam:base@36803084", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocplib-endian@opam:1.2@008dc942", - "@opam/dune-configurator@opam:2.9.3@174e411b", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/lambda-term@opam:3.2.0@781c5f03": { - "id": "@opam/lambda-term@opam:3.2.0@781c5f03", - "name": "@opam/lambda-term", - "version": "opam:3.2.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/68/68a44ac4a5c643cf48ea927c073b4428#md5:68a44ac4a5c643cf48ea927c073b4428", - "archive:https://github.com/ocaml-community/lambda-term/releases/download/3.2.0/lambda-term-3.2.0.tar.gz#md5:68a44ac4a5c643cf48ea927c073b4428" - ], - "opam": { - "name": "lambda-term", - "version": "3.2.0", - "path": "rtop.esy.lock/opam/lambda-term.3.2.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", - "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew_vi@opam:0.5.0@cf66c299", - "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt_log@opam:1.1.2@35f097e3", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/zed@opam:3.1.0@6e750e3e", - "@opam/react@opam:1.2.2@e0f4480e", - "@opam/mew_vi@opam:0.5.0@cf66c299", - "@opam/lwt_react@opam:1.2.0@4253a145", - "@opam/lwt_log@opam:1.1.2@35f097e3", "@opam/lwt@opam:5.6.1@2a9902ab", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317" - ] - }, - "@opam/fix@opam:20220121@17b9a1a4": { - "id": "@opam/fix@opam:20220121@17b9a1a4", - "name": "@opam/fix", - "version": "opam:20220121", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/48/48d8a5bdff23cf7fbf9288877df2b6aa#md5:48d8a5bdff23cf7fbf9288877df2b6aa", - "archive:https://gitlab.inria.fr/fpottier/fix/-/archive/20220121/archive.tar.gz#md5:48d8a5bdff23cf7fbf9288877df2b6aa" - ], - "opam": { - "name": "fix", - "version": "20220121", - "path": "rtop.esy.lock/opam/fix.20220121" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/dune-configurator@opam:2.9.3@174e411b": { - "id": "@opam/dune-configurator@opam:2.9.3@174e411b", - "name": "@opam/dune-configurator", - "version": "opam:2.9.3", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/3e/3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6", - "archive:https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - ], - "opam": { - "name": "dune-configurator", - "version": "2.9.3", - "path": "rtop.esy.lock/opam/dune-configurator.2.9.3" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/csexp@opam:1.5.1@8a8fb3a7", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", "@opam/csexp@opam:1.5.1@8a8fb3a7" - ] - }, - "@opam/dune@opam:2.9.3@4d52c673": { - "id": "@opam/dune@opam:2.9.3@4d52c673", - "name": "@opam/dune", - "version": "opam:2.9.3", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/3e/3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6", - "archive:https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz#sha256:3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - ], - "opam": { - "name": "dune", - "version": "2.9.3", - "path": "rtop.esy.lock/opam/dune.2.9.3" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", - "@opam/base-threads@opam:base@36803084", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/base-unix@opam:base@87d0b2eb", - "@opam/base-threads@opam:base@36803084" - ] - }, - "@opam/dot-merlin-reader@opam:4.6@85c88957": { - "id": "@opam/dot-merlin-reader@opam:4.6@85c88957", - "name": "@opam/dot-merlin-reader", - "version": "opam:4.6", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/02/02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce", - "archive:https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz#sha256:02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" - ], - "opam": { - "name": "dot-merlin-reader", - "version": "4.6", - "path": "rtop.esy.lock/opam/dot-merlin-reader.4.6" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/merlin-lib@opam:4.8-414@ece13977", - "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/csexp@opam:1.5.1@8a8fb3a7": { - "id": "@opam/csexp@opam:1.5.1@8a8fb3a7", - "name": "@opam/csexp", - "version": "opam:1.5.1", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/d6/d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02#sha256:d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02", - "archive:https://github.com/ocaml-dune/csexp/releases/download/1.5.1/csexp-1.5.1.tbz#sha256:d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02" - ], - "opam": { - "name": "csexp", - "version": "1.5.1", - "path": "rtop.esy.lock/opam/csexp.1.5.1" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/cppo@opam:1.6.9@db929a12": { - "id": "@opam/cppo@opam:1.6.9@db929a12", - "name": "@opam/cppo", - "version": "opam:1.6.9", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/d2/d23ffe85ac7dc8f0afd1ddf622770d09#md5:d23ffe85ac7dc8f0afd1ddf622770d09", - "archive:https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz#md5:d23ffe85ac7dc8f0afd1ddf622770d09" - ], - "opam": { - "name": "cppo", - "version": "1.6.9", - "path": "rtop.esy.lock/opam/cppo.1.6.9" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/base-unix@opam:base@87d0b2eb", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@opam/base-unix@opam:base@87d0b2eb" - ] - }, - "@opam/charInfo_width@opam:1.1.0@2e6806d6": { - "id": "@opam/charInfo_width@opam:1.1.0@2e6806d6", - "name": "@opam/charInfo_width", - "version": "opam:1.1.0", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/md5/a5/a539436d1da4aeb93711303f107bec7e#md5:a539436d1da4aeb93711303f107bec7e", - "archive:https://github.com/kandu/charInfo_width/archive/1.1.0.tar.gz#md5:a539436d1da4aeb93711303f107bec7e" - ], - "opam": { - "name": "charInfo_width", - "version": "1.1.0", - "path": "rtop.esy.lock/opam/charInfo_width.1.1.0" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/result@opam:1.5@1c6a6533", - "@opam/dune@opam:2.9.3@4d52c673", - "@opam/camomile@opam:1.0.2@27671317" - ] - }, - "@opam/camomile@opam:1.0.2@27671317": { - "id": "@opam/camomile@opam:1.0.2@27671317", - "name": "@opam/camomile", - "version": "opam:1.0.2", - "source": { - "type": "install", - "source": [ - "archive:https://opam.ocaml.org/cache/sha256/f0/f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632#sha256:f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632", - "archive:https://github.com/yoriyuki/Camomile/releases/download/1.0.2/camomile-1.0.2.tbz#sha256:f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632" - ], - "opam": { - "name": "camomile", - "version": "1.0.2", - "path": "rtop.esy.lock/opam/camomile.1.0.2" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/dune@opam:2.9.3@4d52c673" - ] - }, - "@opam/base-unix@opam:base@87d0b2eb": { - "id": "@opam/base-unix@opam:base@87d0b2eb", - "name": "@opam/base-unix", - "version": "opam:base", - "source": { - "type": "install", - "source": [ "no-source:" ], - "opam": { - "name": "base-unix", - "version": "base", - "path": "rtop.esy.lock/opam/base-unix.base" - } - }, - "overrides": [], - "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [] - }, - "@opam/base-threads@opam:base@36803084": { - "id": "@opam/base-threads@opam:base@36803084", - "name": "@opam/base-threads", - "version": "opam:base", - "source": { - "type": "install", - "source": [ "no-source:" ], - "opam": { - "name": "base-threads", - "version": "base", - "path": "rtop.esy.lock/opam/base-threads.base" - } - }, - "overrides": [], - "dependencies": [ "@esy-ocaml/substs@0.0.1@d41d8cd9" ], - "devDependencies": [] - }, - "@opam/base-bytes@opam:base@19d0c2ff": { - "id": "@opam/base-bytes@opam:base@19d0c2ff", - "name": "@opam/base-bytes", - "version": "opam:base", - "source": { - "type": "install", - "source": [ "no-source:" ], - "opam": { - "name": "base-bytes", - "version": "base", - "path": "rtop.esy.lock/opam/base-bytes.base" - } - }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512", - "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/ocamlfind@opam:1.9.6@d090a512" - ] - }, - "@esy-ocaml/substs@0.0.1@d41d8cd9": { - "id": "@esy-ocaml/substs@0.0.1@d41d8cd9", - "name": "@esy-ocaml/substs", - "version": "0.0.1", - "source": { - "type": "install", - "source": [ - "archive:https://registry.npmjs.org/@esy-ocaml/substs/-/substs-0.0.1.tgz#sha1:59ebdbbaedcda123fc7ed8fb2b302b7d819e9a46" - ] - }, - "overrides": [], - "dependencies": [], - "devDependencies": [] - }, - "@esy-ocaml/rtop@link-dev:./rtop.json": { - "id": "@esy-ocaml/rtop@link-dev:./rtop.json", - "name": "@esy-ocaml/rtop", - "version": "link-dev:./rtop.json", - "source": { "type": "link-dev", "path": ".", "manifest": "rtop.json" }, - "overrides": [], - "dependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/utop@opam:2.9.2@a8a2b147", - "@opam/reason@opam:3.8.2@19b5db6d", - "@opam/ocamlfind@opam:1.9.6@d090a512", - "@opam/dune@opam:2.9.3@4d52c673", "@esy-ocaml/substs@0.0.1@d41d8cd9" - ], - "devDependencies": [ - "ocaml@4.14.0@d41d8cd9", "@opam/merlin@opam:4.8-414@bb3fbab2" - ] - } - } -} \ No newline at end of file diff --git a/rtop.esy.lock/opam/base-bytes.base/opam b/rtop.esy.lock/opam/base-bytes.base/opam deleted file mode 100644 index f1cae506c..000000000 --- a/rtop.esy.lock/opam/base-bytes.base/opam +++ /dev/null @@ -1,9 +0,0 @@ -opam-version: "2.0" -maintainer: " " -authors: " " -homepage: " " -depends: [ - "ocaml" {>= "4.02.0"} - "ocamlfind" {>= "1.5.3"} -] -synopsis: "Bytes library distributed with the OCaml compiler" diff --git a/rtop.esy.lock/opam/base-threads.base/opam b/rtop.esy.lock/opam/base-threads.base/opam deleted file mode 100644 index 914ff50ce..000000000 --- a/rtop.esy.lock/opam/base-threads.base/opam +++ /dev/null @@ -1,6 +0,0 @@ -opam-version: "2.0" -maintainer: "https://github.com/ocaml/opam-repository/issues" -description: """ -Threads library distributed with the OCaml compiler -""" - diff --git a/rtop.esy.lock/opam/camomile.1.0.2/opam b/rtop.esy.lock/opam/camomile.1.0.2/opam deleted file mode 100644 index f8572c012..000000000 --- a/rtop.esy.lock/opam/camomile.1.0.2/opam +++ /dev/null @@ -1,35 +0,0 @@ -opam-version: "2.0" -synopsis: "A Unicode library" -description: """ -Camomile is a Unicode library for OCaml. Camomile provides Unicode character -type, UTF-8, UTF-16, UTF-32 strings, conversion to/from about 200 encodings, -collation and locale-sensitive case mappings, and more. The library is currently -designed for Unicode Standard 3.2.""" -maintainer: ["yoriyuki.y@gmail.com"] -authors: ["Yoriyuki Yamagata"] -license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" -homepage: "https://github.com/yoriyuki/Camomile" -doc: "https://yoriyuki.github.io/Camomile/" -bug-reports: "https://github.com/yoriyuki/Camomile/issues" -depends: [ - "dune" {>= "1.11"} - "ocaml" {>= "4.02.3" & < "5.0"} -] -dev-repo: "git+https://github.com/yoriyuki/Camomile.git" -build: [ - ["ocaml" "configure.ml" "--share" "%{share}%/camomile"] - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs - "@install" - "@doc" {with-doc} - ] -] -url { - src: - "https://github.com/yoriyuki/Camomile/releases/download/1.0.2/camomile-1.0.2.tbz" - checksum: [ - "sha256=f0a419b0affc36500f83b086ffaa36c545560cee5d57e84b729e8f851b3d1632" - "sha512=7586422e68779476206027c6ebbe19b677fbe459153221f7c952c7fae374c5c8232249cb76fdb1f482069707aa1580be827cd39693906142988268b7f0e7f6d0" - ] -} -available: arch != "ppc64" diff --git a/rtop.esy.lock/opam/charInfo_width.1.1.0/opam b/rtop.esy.lock/opam/charInfo_width.1.1.0/opam deleted file mode 100644 index e87929b0e..000000000 --- a/rtop.esy.lock/opam/charInfo_width.1.1.0/opam +++ /dev/null @@ -1,27 +0,0 @@ -opam-version: "2.0" -maintainer: "zandoye@gmail.com" -authors: [ "ZAN DoYe" ] -homepage: "https://github.com/kandu/charinfo_width/" -bug-reports: "https://github.com/kandu/charinfo_width/issues" -license: "MIT" -dev-repo: "git+https://github.com/kandu/charinfo_width.git" -build: [ - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test & (ocaml:version >= "4.04.0")} -] -depends: [ - "ocaml" {>= "4.02.3"} - "result" - "camomile" {>= "1.0.0" & < "2.0~"} - "dune" - "ppx_expect" {with-test} -] - -synopsis: "Determine column width for a character" -description: """ -This module is implemented purely in OCaml and the width function follows the prototype of POSIX's wcwidth.""" - -url { - src:"https://github.com/kandu/charInfo_width/archive/1.1.0.tar.gz" - checksum: "md5=a539436d1da4aeb93711303f107bec7e" -} diff --git a/rtop.esy.lock/opam/cppo.1.6.9/opam b/rtop.esy.lock/opam/cppo.1.6.9/opam deleted file mode 100644 index 9c51ec6d8..000000000 --- a/rtop.esy.lock/opam/cppo.1.6.9/opam +++ /dev/null @@ -1,39 +0,0 @@ -opam-version: "2.0" -synopsis: "Code preprocessor like cpp for OCaml" -description: """\ -Cppo is an equivalent of the C preprocessor for OCaml programs. -It allows the definition of simple macros and file inclusion. - -Cppo is: - -* more OCaml-friendly than cpp -* easy to learn without consulting a manual -* reasonably fast -* simple to install and to maintain""" -maintainer: [ - "Martin Jambon " "Yishuai Li " -] -authors: "Martin Jambon" -license: "BSD-3-Clause" -homepage: "https://github.com/ocaml-community/cppo" -doc: "https://ocaml-community.github.io/cppo" -bug-reports: "https://github.com/ocaml-community/cppo/issues" -depends: [ - "ocaml" {>= "4.02.3"} - "dune" {>= "1.10"} - "base-unix" -] -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} - ["dune" "build" "-p" name "@doc"] {with-doc} -] -dev-repo: "git+https://github.com/ocaml-community/cppo.git" -url { - src: "https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz" - checksum: [ - "md5=d23ffe85ac7dc8f0afd1ddf622770d09" - "sha512=26ff5a7b7f38c460661974b23ca190f0feae3a99f1974e0fd12ccf08745bd7d91b7bc168c70a5385b837bfff9530e0e4e41cf269f23dd8cf16ca658008244b44" - ] -} \ No newline at end of file diff --git a/rtop.esy.lock/opam/csexp.1.5.1/opam b/rtop.esy.lock/opam/csexp.1.5.1/opam deleted file mode 100644 index 59324f9e2..000000000 --- a/rtop.esy.lock/opam/csexp.1.5.1/opam +++ /dev/null @@ -1,60 +0,0 @@ -opam-version: "2.0" -synopsis: "Parsing and printing of S-expressions in Canonical form" -description: """ - -This library provides minimal support for Canonical S-expressions -[1]. Canonical S-expressions are a binary encoding of S-expressions -that is super simple and well suited for communication between -programs. - -This library only provides a few helpers for simple applications. If -you need more advanced support, such as parsing from more fancy input -sources, you should consider copying the code of this library given -how simple parsing S-expressions in canonical form is. - -To avoid a dependency on a particular S-expression library, the only -module of this library is parameterised by the type of S-expressions. - -[1] https://en.wikipedia.org/wiki/Canonical_S-expressions -""" -maintainer: ["Jeremie Dimino "] -authors: [ - "Quentin Hocquet " - "Jane Street Group, LLC" - "Jeremie Dimino " -] -license: "MIT" -homepage: "https://github.com/ocaml-dune/csexp" -doc: "https://ocaml-dune.github.io/csexp/" -bug-reports: "https://github.com/ocaml-dune/csexp/issues" -depends: [ - "dune" {>= "1.11"} - "ocaml" {>= "4.03.0"} -# "ppx_expect" {with-test & >= "v0.14"} - "odoc" {with-doc} -] -dev-repo: "git+https://github.com/ocaml-dune/csexp.git" -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" -# Tests disabled because of a cyclic dependency with csexp, dune-configurator and ppx_expect -# "@runtest" {with-test} - "@doc" {with-doc} - ] -] -x-commit-hash: "7eeb86206819d2b1782d6cde1be9d6cf8b5fc851" -url { - src: - "https://github.com/ocaml-dune/csexp/releases/download/1.5.1/csexp-1.5.1.tbz" - checksum: [ - "sha256=d605e4065fa90a58800440ef2f33a2d931398bf2c22061a8acb7df845c0aac02" - "sha512=d785bbabaff9f6bf601399149ef0a42e5e99647b54e27f97ef1625907793dda22a45bf83e0e8a1eba2c63634c5484b54739ff0904ef556f5fc592efa38af7505" - ] -} diff --git a/rtop.esy.lock/opam/dot-merlin-reader.4.6/opam b/rtop.esy.lock/opam/dot-merlin-reader.4.6/opam deleted file mode 100644 index 3943521de..000000000 --- a/rtop.esy.lock/opam/dot-merlin-reader.4.6/opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -synopsis: "Reads config files for merlin" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -license: "MIT" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.08"} - "dune" {>= "2.9.0"} - "merlin-lib" {>= "4.6"} - "ocamlfind" {>= "1.6.0"} -] -description: - "Helper process: reads .merlin files and outputs the normalized content to - stdout." -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz" - checksum: [ - "sha256=02ebd70a3c77d8940163dbe4c40774a448ed145ea84e0ad3d5ff5324410393ce" - "sha512=7373fadf05c692c9f054c7fe6a7d4bdfeefe237b9df432024ef9923782ee72e09021c0c3fba869da8347728105cb2d3ff0aa94b0c5eb09811bb25aa8da9fb520" - ] -} -x-commit-hash: "be753d9412387aedcf32aba88a1be9bcd33d97ba" diff --git a/rtop.esy.lock/opam/dune-configurator.2.9.3/opam b/rtop.esy.lock/opam/dune-configurator.2.9.3/opam deleted file mode 100644 index 60d8173a6..000000000 --- a/rtop.esy.lock/opam/dune-configurator.2.9.3/opam +++ /dev/null @@ -1,48 +0,0 @@ -opam-version: "2.0" -synopsis: "Helper library for gathering system configuration" -description: """ -dune-configurator is a small library that helps writing OCaml scripts that -test features available on the system, in order to generate config.h -files for instance. -Among other things, dune-configurator allows one to: -- test if a C program compiles -- query pkg-config -- import #define from OCaml header files -- generate config.h file -""" -maintainer: ["Jane Street Group, LLC "] -authors: ["Jane Street Group, LLC "] -license: "MIT" -homepage: "https://github.com/ocaml/dune" -doc: "https://dune.readthedocs.io/" -bug-reports: "https://github.com/ocaml/dune/issues" -depends: [ - "dune" {>= "2.9"} - "ocaml" {>= "4.03.0"} - "result" - "csexp" {>= "1.3.0"} - "odoc" {with-doc} -] -dev-repo: "git+https://github.com/ocaml/dune.git" -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@doc" {with-doc} - ] -] -url { - src: - "https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz" - checksum: [ - "sha256=3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - "sha512=04b48501ac16c3608e3b6bfbdbabf810df0fb844ea3b7d25ba50f03b9d6cb1d2c933cf747d694029d82a9777a774e48e5c38ab010fe53ce1eae367da0ed04d6d" - ] -} -x-commit-hash: "dea03875affccc0620e902d28fed8d6b4351e112" diff --git a/rtop.esy.lock/opam/dune.2.9.3/opam b/rtop.esy.lock/opam/dune.2.9.3/opam deleted file mode 100644 index 056c52674..000000000 --- a/rtop.esy.lock/opam/dune.2.9.3/opam +++ /dev/null @@ -1,57 +0,0 @@ -opam-version: "2.0" -synopsis: "Fast, portable, and opinionated build system" -description: """ - -dune is a build system that was designed to simplify the release of -Jane Street packages. It reads metadata from "dune" files following a -very simple s-expression syntax. - -dune is fast, has very low-overhead, and supports parallel builds on -all platforms. It has no system dependencies; all you need to build -dune or packages using dune is OCaml. You don't need make or bash -as long as the packages themselves don't use bash explicitly. - -dune supports multi-package development by simply dropping multiple -repositories into the same directory. - -It also supports multi-context builds, such as building against -several opam roots/switches simultaneously. This helps maintaining -packages across several versions of OCaml and gives cross-compilation -for free. -""" -maintainer: ["Jane Street Group, LLC "] -authors: ["Jane Street Group, LLC "] -license: "MIT" -homepage: "https://github.com/ocaml/dune" -doc: "https://dune.readthedocs.io/" -bug-reports: "https://github.com/ocaml/dune/issues" -conflicts: [ - "merlin" {< "3.4.0"} - "ocaml-lsp-server" {< "1.3.0"} - "dune-configurator" {< "2.3.0"} - "odoc" {< "1.3.0"} - "dune-release" {< "1.3.0"} - "js_of_ocaml-compiler" {< "3.6.0"} - "jbuilder" {= "transition"} -] -dev-repo: "git+https://github.com/ocaml/dune.git" -build: [ - ["ocaml" "bootstrap.ml" "-j" jobs] - ["./dune.exe" "build" "-p" name "--profile" "dune-bootstrap" "-j" jobs] -] -depends: [ - # Please keep the lower bound in sync with .github/workflows/workflow.yml, - # dune-project and min_ocaml_version in bootstrap.ml - ("ocaml" {>= "4.08" & < "5.0"} | ("ocaml" {< "4.08~~"} & "ocamlfind-secondary")) - "base-unix" - "base-threads" -] -url { - src: - "https://github.com/ocaml/dune/releases/download/2.9.3/dune-site-2.9.3.tbz" - checksum: [ - "sha256=3e65ec73ab2c80d50d4ffd6c46cbfb22eacd0e5587a4be8af8ae69547d5f88d6" - "sha512=04b48501ac16c3608e3b6bfbdbabf810df0fb844ea3b7d25ba50f03b9d6cb1d2c933cf747d694029d82a9777a774e48e5c38ab010fe53ce1eae367da0ed04d6d" - ] -} -x-commit-hash: "dea03875affccc0620e902d28fed8d6b4351e112" diff --git a/rtop.esy.lock/opam/fix.20220121/opam b/rtop.esy.lock/opam/fix.20220121/opam deleted file mode 100644 index 877b44e66..000000000 --- a/rtop.esy.lock/opam/fix.20220121/opam +++ /dev/null @@ -1,26 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " -] -homepage: "https://gitlab.inria.fr/fpottier/fix" -dev-repo: "git+https://gitlab.inria.fr/fpottier/fix.git" -bug-reports: "francois.pottier@inria.fr" -license: "LGPL-2.0-only" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" { >= "4.03" } - "dune" { >= "1.3" } -] -synopsis: "Algorithmic building blocks for memoization, recursion, and more" -url { - src: - "https://gitlab.inria.fr/fpottier/fix/-/archive/20220121/archive.tar.gz" - checksum: [ - "md5=48d8a5bdff23cf7fbf9288877df2b6aa" - "sha512=a851d8783c0c519c6e55359a5c471af433058872409c29a1a7bdfd0076813341ad2c0ebd1ce9e28bff4d4c729dfbc808c41c084fe12a42b45a2b5e391e77ccd2" - ] -} diff --git a/rtop.esy.lock/opam/lambda-term.3.2.0/opam b/rtop.esy.lock/opam/lambda-term.3.2.0/opam deleted file mode 100644 index b109ee019..000000000 --- a/rtop.esy.lock/opam/lambda-term.3.2.0/opam +++ /dev/null @@ -1,37 +0,0 @@ -opam-version: "2.0" -synopsis: "Terminal manipulation library for OCaml" -description: """\ -Lambda-term is a cross-platform library for manipulating the terminal. It -provides an abstraction for keys, mouse events, colors, as well as a set of -widgets to write curses-like applications. The main objective of lambda-term is -to provide a higher level functional interface to terminal manipulation than, -for example, ncurses, by providing a native OCaml interface instead of bindings -to a C library. Lambda-term integrates with zed to provide text edition -facilities in console applications.""" -maintainer: "jeremie@dimino.org" -authors: "Jérémie Dimino" -license: "BSD-3-Clause" -homepage: "https://github.com/ocaml-community/lambda-term" -bug-reports: "https://github.com/ocaml-community/lambda-term/issues" -depends: [ - "ocaml" {>= "4.08.0"} - "lwt" {>= "4.0.0"} - "lwt_log" - "react" - "zed" {>= "3.1.0" & < "3.2.0"} - "camomile" {>= "1.0.1" & < "2.0.0"} - "lwt_react" - "mew_vi" {>= "0.5.0" & < "0.6.0"} - "dune" {>= "1.1.0"} -] -build: ["dune" "build" "-p" name "-j" jobs] -run-test: ["dune" "runtest" "-p" name "-j" jobs] -dev-repo: "git+https://github.com/ocaml-community/lambda-term.git" -url { - src: - "https://github.com/ocaml-community/lambda-term/releases/download/3.2.0/lambda-term-3.2.0.tar.gz" - checksum: [ - "md5=68a44ac4a5c643cf48ea927c073b4428" - "sha512=46cd46f47c9f34c0a5e096b96e6eec59667b645bf5201140e498e6d4eb9baba8204a2b30b73c4b2f8140e5cf1972a56e3aa485b27bc5ace25b2c368f713ad7c4" - ] -} diff --git a/rtop.esy.lock/opam/lwt.5.6.1/opam b/rtop.esy.lock/opam/lwt.5.6.1/opam deleted file mode 100644 index fa437b76b..000000000 --- a/rtop.esy.lock/opam/lwt.5.6.1/opam +++ /dev/null @@ -1,57 +0,0 @@ -opam-version: "2.0" - -synopsis: "Promises and event-driven I/O" -license: "MIT" -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt" -bug-reports: "https://github.com/ocsigen/lwt/issues" - -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -maintainer: [ - "Raphaël Proust " - "Anton Bachin " -] -dev-repo: "git+https://github.com/ocsigen/lwt.git" - -depends: [ - "cppo" {build & >= "1.1.0"} - "dune" {>= "1.8.0"} - "dune-configurator" - "ocaml" {>= "4.08"} - "ocplib-endian" - - # Until https://github.com/aantron/bisect_ppx/pull/327. - # "bisect_ppx" {dev & >= "2.0.0"} - "ocamlfind" {dev & >= "1.7.3-1"} -] - -depopts: [ - "base-threads" - "base-unix" - "conf-libev" -] - -build: [ - ["dune" "exec" "-p" name "src/unix/config/discover.exe" "--" "--save" - "--use-libev" "%{conf-libev:installed}%"] - ["dune" "build" "-p" name "-j" jobs] -] - -description: "A promise is a value that may become determined in the future. - -Lwt provides typed, composable promises. Promises that are resolved by I/O are -resolved by Lwt in parallel. - -Meanwhile, OCaml code, including code creating and waiting on promises, runs in -a single thread by default. This reduces the need for locks or other -synchronization primitives. Code can be run in parallel on an opt-in basis." -url { - src: "https://github.com/ocsigen/lwt/archive/5.6.1.tar.gz" - checksum: [ - "md5=279024789a0ec84a9d97d98bad847f97" - "sha512=698875bd3bfcd5baa47eb48e412f442d289f9972421321541860ebe110b9af1949c3fbc253768495726ec547fe4ba25483cd97ff39bc668496fba95b2ed9edd8" - ] -} diff --git a/rtop.esy.lock/opam/lwt_log.1.1.2/opam b/rtop.esy.lock/opam/lwt_log.1.1.2/opam deleted file mode 100644 index f73df584b..000000000 --- a/rtop.esy.lock/opam/lwt_log.1.1.2/opam +++ /dev/null @@ -1,31 +0,0 @@ -opam-version: "2.0" - -synopsis: "Lwt logging library (deprecated)" -license: ["LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" "BSD-3-Clause"] -homepage: "https://github.com/ocsigen/lwt_log" -doc: "https://github.com/ocsigen/lwt_log/blob/master/src/core/lwt_log_core.mli" -bug-reports: "https://github.com/ocsigen/lwt_log/issues" - -authors: [ - "Shawn Wagner" - "Jérémie Dimino" -] -maintainer: "Raphaël Proust " -dev-repo: "git+https://github.com/ocsigen/lwt_log.git" - -depends: [ - "dune" {>= "1.0"} - "lwt" {>= "4.0.0"} - "ocaml" {>= "4.03"} -] - -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -url { - src: "https://github.com/ocsigen/lwt_log/archive/1.1.2.tar.gz" - checksum: [ - "md5=f060baea008b2563265dbcf0250f8912" - "sha512=fb976d89c0f868b57434a9e0907ffae0842fe48fc747ddb860954d20f36722faea315ebb0b4dac202f9bf7203b0a09681614e9619f3bbd0dd59f8dd7bbd50575" - ] -} diff --git a/rtop.esy.lock/opam/lwt_react.1.2.0/opam b/rtop.esy.lock/opam/lwt_react.1.2.0/opam deleted file mode 100644 index b3435cb1b..000000000 --- a/rtop.esy.lock/opam/lwt_react.1.2.0/opam +++ /dev/null @@ -1,34 +0,0 @@ -opam-version: "2.0" - -synopsis: "Helpers for using React with Lwt" -license: "MIT" -homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/dev/api/Lwt_react" -bug-reports: "https://github.com/ocsigen/lwt/issues" - -authors: [ - "Jérémie Dimino" -] -maintainer: [ - "Anton Bachin " -] -dev-repo: "git+https://github.com/ocsigen/lwt.git" - -depends: [ - "dune" {>= "1.8.0"} - "lwt" {>= "3.0.0"} - "ocaml" {>= "4.08"} - "react" {>= "1.0.0"} - "cppo" {build & >= "1.1.0"} -] - -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -url { - src: "https://github.com/ocsigen/lwt/archive/5.6.0.tar.gz" - checksum: [ - "md5=e63979ee40a80d5b9e9e5545f33323b4" - "sha512=d616389bc9e0da11f25843ab7541ac2d40c9543700a89455f14115b339bbe58cef2b8acf0ae97fd54e15a4cb93149cfe1ebfda301aa93933045f76b7d9344160" - ] -} diff --git a/rtop.esy.lock/opam/menhir.20220210/opam b/rtop.esy.lock/opam/menhir.20220210/opam deleted file mode 100644 index 498658b42..000000000 --- a/rtop.esy.lock/opam/menhir.20220210/opam +++ /dev/null @@ -1,29 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " - "Yann Régis-Gianas " -] -homepage: "http://gitlab.inria.fr/fpottier/menhir" -dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" -bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.03.0"} - "dune" {>= "2.8.0"} - "menhirLib" {= version} - "menhirSdk" {= version} -] -synopsis: "An LR(1) parser generator" -url { - src: - "https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz" - checksum: [ - "md5=e3cef220f676c4b1c16cbccb174cefe3" - "sha512=3063fec1d8b9fe092c8461b0689d426c7fe381a2bf3fd258dc42ceecca1719d32efbb8a18d94ada5555c38175ea352da3adbb239fdbcbcf52c3a5c85a4d9586f" - ] -} diff --git a/rtop.esy.lock/opam/menhirLib.20220210/opam b/rtop.esy.lock/opam/menhirLib.20220210/opam deleted file mode 100644 index d2097ae4f..000000000 --- a/rtop.esy.lock/opam/menhirLib.20220210/opam +++ /dev/null @@ -1,30 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " - "Yann Régis-Gianas " -] -homepage: "http://gitlab.inria.fr/fpottier/menhir" -dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" -bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" { >= "4.03.0" } - "dune" { >= "2.8.0" } -] -conflicts: [ - "menhir" { != version } -] -synopsis: "Runtime support library for parsers generated by Menhir" -url { - src: - "https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz" - checksum: [ - "md5=e3cef220f676c4b1c16cbccb174cefe3" - "sha512=3063fec1d8b9fe092c8461b0689d426c7fe381a2bf3fd258dc42ceecca1719d32efbb8a18d94ada5555c38175ea352da3adbb239fdbcbcf52c3a5c85a4d9586f" - ] -} diff --git a/rtop.esy.lock/opam/menhirSdk.20220210/opam b/rtop.esy.lock/opam/menhirSdk.20220210/opam deleted file mode 100644 index 585d2ca33..000000000 --- a/rtop.esy.lock/opam/menhirSdk.20220210/opam +++ /dev/null @@ -1,30 +0,0 @@ - -opam-version: "2.0" -maintainer: "francois.pottier@inria.fr" -authors: [ - "François Pottier " - "Yann Régis-Gianas " -] -homepage: "http://gitlab.inria.fr/fpottier/menhir" -dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git" -bug-reports: "https://gitlab.inria.fr/fpottier/menhir/-/issues" -license: "LGPL-2.0-only WITH OCaml-LGPL-linking-exception" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" { >= "4.03.0" } - "dune" { >= "2.8.0" } -] -conflicts: [ - "menhir" { != version } -] -synopsis: "Compile-time library for auxiliary tools related to Menhir" -url { - src: - "https://gitlab.inria.fr/fpottier/menhir/-/archive/20220210/archive.tar.gz" - checksum: [ - "md5=e3cef220f676c4b1c16cbccb174cefe3" - "sha512=3063fec1d8b9fe092c8461b0689d426c7fe381a2bf3fd258dc42ceecca1719d32efbb8a18d94ada5555c38175ea352da3adbb239fdbcbcf52c3a5c85a4d9586f" - ] -} diff --git a/rtop.esy.lock/opam/merlin-extend.0.6.1/opam b/rtop.esy.lock/opam/merlin-extend.0.6.1/opam deleted file mode 100644 index 9f9936505..000000000 --- a/rtop.esy.lock/opam/merlin-extend.0.6.1/opam +++ /dev/null @@ -1,30 +0,0 @@ -opam-version: "2.0" -maintainer: "Frederic Bour " -authors: "Frederic Bour " -homepage: "https://github.com/let-def/merlin-extend" -bug-reports: "https://github.com/let-def/merlin-extend" -license: "MIT" -dev-repo: "git+https://github.com/let-def/merlin-extend.git" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "dune" {>= "1.0"} - "cppo" {build & >= "1.1.0"} - "ocaml" {>= "4.02.3"} -] -synopsis: "A protocol to provide custom frontend to Merlin" -description: """ -This protocol allows to replace the OCaml frontend of Merlin. -It extends what used to be done with the `-pp' flag to handle a few more cases.""" -doc: "https://let-def.github.io/merlin-extend" -url { - src: - "https://github.com/let-def/merlin-extend/releases/download/v0.6.1/merlin-extend-0.6.1.tbz" - checksum: [ - "sha256=5ec84b355ddb2d129a5948b132bfacc93adcbde2158c7de695f7bfc3650bead7" - "sha512=631fc96aab2f35e12a078c9b4907ca7b0db9f1e3a4026040e6c23b82e0171c256a89fb5d4c887f1d156eb9e3152783cdf7a546b2496051007a1bcf5777417396" - ] -} -x-commit-hash: "cf2707bbe8e034c6ecf5d0fecd3fd889f6ab14bf" diff --git a/rtop.esy.lock/opam/merlin-lib.4.8-414/opam b/rtop.esy.lock/opam/merlin-lib.4.8-414/opam deleted file mode 100644 index 07698b02d..000000000 --- a/rtop.esy.lock/opam/merlin-lib.4.8-414/opam +++ /dev/null @@ -1,34 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -license: "MIT" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.14" & < "4.15"} - "dune" {>= "2.9.0"} - "csexp" {>= "1.5.1"} - "menhir" {dev & >= "20201216"} - "menhirLib" {dev & >= "20201216"} - "menhirSdk" {dev & >= "20201216"} -] -synopsis: - "Merlin's libraries" -description: - "These libraries provides access to low-level compiler interfaces and the - standard higher-level merlin protocol. The library is provided as-is, is not - thoroughly documented, and its public API might break with any new release." -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" - checksum: [ - "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" - ] -} -x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/rtop.esy.lock/opam/merlin.4.8-414/opam b/rtop.esy.lock/opam/merlin.4.8-414/opam deleted file mode 100644 index b080c70cc..000000000 --- a/rtop.esy.lock/opam/merlin.4.8-414/opam +++ /dev/null @@ -1,78 +0,0 @@ -opam-version: "2.0" -maintainer: "defree@gmail.com" -authors: "The Merlin team" -homepage: "https://github.com/ocaml/merlin" -bug-reports: "https://github.com/ocaml/merlin/issues" -dev-repo: "git+https://github.com/ocaml/merlin.git" -license: "MIT" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -depends: [ - "ocaml" {>= "4.14" & < "4.15"} - "dune" {>= "2.9.0"} - "merlin-lib" {= version} - "dot-merlin-reader" {>= "4.6"} - "yojson" {>= "2.0.0"} - "conf-jq" {with-test} - "ppxlib" {with-test} -] -conflicts: [ - "seq" {!= "base"} - "base-effects" -] -synopsis: - "Editor helper, provides completion, typing and source browsing in Vim and Emacs" -description: - "Merlin is an assistant for editing OCaml code. It aims to provide the features available in modern IDEs: error reporting, auto completion, source browsing and much more." -post-messages: [ - "merlin installed. - -Quick setup for VIM -------------------- -Append this to your .vimrc to add merlin to vim's runtime-path: - let g:opamshare = substitute(system('opam var share'),'\\n$','','''') - execute \"set rtp+=\" . g:opamshare . \"/merlin/vim\" - -Also run the following line in vim to index the documentation: - :execute \"helptags \" . g:opamshare . \"/merlin/vim/doc\" - -Quick setup for EMACS -------------------- -Add opam emacs directory to your load-path by appending this to your .emacs: - (let ((opam-share (ignore-errors (car (process-lines \"opam\" \"var\" \"share\"))))) - (when (and opam-share (file-directory-p opam-share)) - ;; Register Merlin - (add-to-list 'load-path (expand-file-name \"emacs/site-lisp\" opam-share)) - (autoload 'merlin-mode \"merlin\" nil t nil) - ;; Automatically start it in OCaml buffers - (add-hook 'tuareg-mode-hook 'merlin-mode t) - (add-hook 'caml-mode-hook 'merlin-mode t) - ;; Use opam switch to lookup ocamlmerlin binary - (setq merlin-command 'opam))) - -Take a look at https://github.com/ocaml/merlin for more information - -Quick setup with opam-user-setup --------------------------------- - -Opam-user-setup support Merlin. - - $ opam user-setup install - -should take care of basic setup. -See https://github.com/OCamlPro/opam-user-setup -" - {success & !user-setup:installed} -] -url { - src: - "https://github.com/ocaml/merlin/releases/download/v4.8-414/merlin-4.8-414.tbz" - checksum: [ - "sha256=1cc5d685c54e5d6d39f32d78deb34171f10e9a3b76b5925771728798a6798baf" - "sha512=49804812b9066a457ad15d4e11a8bdb0323beead43712b5f5f936f60aa2975753c2a62dc95c7a49f3bd07c210056a170fb5c71f269ca1890aa26c96b45541fc6" - ] -} -x-commit-hash: "85ad3a6b09edbf54685eb8e962e82c209f409951" diff --git a/rtop.esy.lock/opam/mew.0.1.0/opam b/rtop.esy.lock/opam/mew.0.1.0/opam deleted file mode 100644 index 20aee1ea9..000000000 --- a/rtop.esy.lock/opam/mew.0.1.0/opam +++ /dev/null @@ -1,25 +0,0 @@ -opam-version: "2.0" -maintainer: "zandoye@gmail.com" -authors: [ "ZAN DoYe" ] -homepage: "https://github.com/kandu/mew" -bug-reports: "https://github.com/kandu/mew/issues" -license: "MIT" -dev-repo: "git+https://github.com/kandu/mew.git" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.02.3"} - "result" - "trie" {>= "1.0.0"} - "dune" {>= "1.1.0"} -] - -synopsis: "Modal editing witch" -description: """ -This is the core module of mew, a general modal editing engine generator.""" - -url { - src: "https://github.com/kandu/mew/archive/0.1.0.tar.gz" - checksum: "md5=2298149d1415cd804ab4e01f01ea10a0" -} diff --git a/rtop.esy.lock/opam/mew_vi.0.5.0/opam b/rtop.esy.lock/opam/mew_vi.0.5.0/opam deleted file mode 100644 index 033b9fd71..000000000 --- a/rtop.esy.lock/opam/mew_vi.0.5.0/opam +++ /dev/null @@ -1,25 +0,0 @@ -opam-version: "2.0" -maintainer: "zandoye@gmail.com" -authors: [ "ZAN DoYe" ] -homepage: "https://github.com/kandu/mew_vi" -bug-reports: "https://github.com/kandu/mew_vi/issues" -license: "MIT" -dev-repo: "git+https://github.com/kandu/mew_vi.git" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.02.3"} - "mew" {>= "0.1.0" & < "0.2"} - "react" - "dune" {>= "1.1.0"} -] - -synopsis: "Modal editing witch, VI interpreter" -description: """ -A vi-like modal editing engine generator.""" - -url { - src: "https://github.com/kandu/mew_vi/archive/0.5.0.tar.gz" - checksum: "md5=341e9a9a20383641015bf503952906bc" -} diff --git a/rtop.esy.lock/opam/ocamlbuild.0.14.2/opam b/rtop.esy.lock/opam/ocamlbuild.0.14.2/opam deleted file mode 100644 index 74bfbb272..000000000 --- a/rtop.esy.lock/opam/ocamlbuild.0.14.2/opam +++ /dev/null @@ -1,39 +0,0 @@ -opam-version: "2.0" -synopsis: - "OCamlbuild is a build system with builtin rules to easily build most OCaml projects" -maintainer: "Gabriel Scherer " -authors: ["Nicolas Pouillard" "Berke Durak"] -license: "LGPL-2.0-or-later WITH OCaml-LGPL-linking-exception" -homepage: "https://github.com/ocaml/ocamlbuild/" -doc: "https://github.com/ocaml/ocamlbuild/blob/master/manual/manual.adoc" -bug-reports: "https://github.com/ocaml/ocamlbuild/issues" -depends: [ - "ocaml" {>= "4.03"} -] -conflicts: [ - "base-ocamlbuild" - "ocamlfind" {< "1.6.2"} -] -build: [ - [ - make - "-f" - "configure.make" - "all" - "OCAMLBUILD_PREFIX=%{prefix}%" - "OCAMLBUILD_BINDIR=%{bin}%" - "OCAMLBUILD_LIBDIR=%{lib}%" - "OCAMLBUILD_MANDIR=%{man}%" - "OCAML_NATIVE=%{ocaml:native}%" - "OCAML_NATIVE_TOOLS=%{ocaml:native}%" - ] - [make "check-if-preinstalled" "all" "opam-install"] -] -dev-repo: "git+https://github.com/ocaml/ocamlbuild.git" -url { - src: "https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz" - checksum: [ - "md5=2f407fadd57b073155a6aead887d9676" - "sha512=f568bf10431a1f701e8bd7554dc662400a0d978411038bbad93d44dceab02874490a8a5886a9b44e017347e7949997f13f5c3752f74e1eb5e273d2beb19a75fd" - ] -} \ No newline at end of file diff --git a/rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch b/rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch deleted file mode 100644 index 8011238cd..000000000 --- a/rtop.esy.lock/opam/ocamlfind.1.9.6/files/0001-Harden-test-for-OCaml-5.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff a/configure b/configure ---- a/configure -+++ b/configure -@@ -294,7 +294,7 @@ - # If findlib has been configured -sitelib $(ocamlc -where) then there's - # nothing to do, but otherwise we need to put OCaml's Standard Library - # into the path setting. -- if [ ! -e "${ocaml_sitelib}/stdlib/META" ]; then -+ if [ ! -e "${ocaml_sitelib}/stdlib.cmi" ]; then - ocamlpath="${ocaml_core_stdlib}${path_sep}${ocamlpath}" - fi - fi diff --git a/rtop.esy.lock/opam/ocamlfind.1.9.6/opam b/rtop.esy.lock/opam/ocamlfind.1.9.6/opam deleted file mode 100644 index a81f0c50e..000000000 --- a/rtop.esy.lock/opam/ocamlfind.1.9.6/opam +++ /dev/null @@ -1,48 +0,0 @@ -opam-version: "2.0" -synopsis: "A library manager for OCaml" -description: """ -Findlib is a library manager for OCaml. It provides a convention how -to store libraries, and a file format ("META") to describe the -properties of libraries. There is also a tool (ocamlfind) for -interpreting the META files, so that it is very easy to use libraries -in programs and scripts. -""" -license: "MIT" -maintainer: "Thomas Gazagnaire " -authors: "Gerd Stolpmann " -homepage: "http://projects.camlcity.org/projects/findlib.html" -bug-reports: "https://github.com/ocaml/ocamlfind/issues" -depends: [ - "ocaml" {>= "3.08.0"} -] -depopts: ["graphics"] -build: [ - [ - "./configure" - "-bindir" bin - "-sitelib" lib - "-mandir" man - "-config" "%{lib}%/findlib.conf" - "-no-custom" - "-no-camlp4" {!ocaml:preinstalled & ocaml:version >= "4.02.0"} - "-no-topfind" {ocaml:preinstalled} - ] - [make "all"] - [make "opt"] {ocaml:native} -] -install: [ - [make "install"] - ["install" "-m" "0755" "ocaml-stub" "%{bin}%/ocaml"] {ocaml:preinstalled} -] -extra-files: ["0001-Harden-test-for-OCaml-5.patch" "md5=3cddbf72164c29d4e50e077a92a37c6c"] -# See https://github.com/ocaml/ocamlfind/pull/61 -patches: ["0001-Harden-test-for-OCaml-5.patch"] -dev-repo: "git+https://github.com/ocaml/ocamlfind.git" -url { - src: "http://download.camlcity.org/download/findlib-1.9.6.tar.gz" - checksum: [ - "md5=96c6ee50a32cca9ca277321262dbec57" - "sha512=cfaf1872d6ccda548f07d32cc6b90c3aafe136d2aa6539e03143702171ee0199add55269bba894c77115535dc46a5835901a5d7c75768999e72db503bfd83027" - ] -} -available: os != "win32" diff --git a/rtop.esy.lock/opam/ocplib-endian.1.2/opam b/rtop.esy.lock/opam/ocplib-endian.1.2/opam deleted file mode 100644 index 05c0a38d4..000000000 --- a/rtop.esy.lock/opam/ocplib-endian.1.2/opam +++ /dev/null @@ -1,40 +0,0 @@ -opam-version: "2.0" -license: "LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception" -synopsis: - "Optimised functions to read and write int16/32/64 from strings and bigarrays" -description: """\ -The library implements three modules: -* [EndianString](https://github.com/OCamlPro/ocplib-endian/blob/master/src/endianString.mli) works directly on strings, and provides submodules BigEndian and LittleEndian, with their unsafe counter-parts; -* [EndianBytes](https://github.com/OCamlPro/ocplib-endian/blob/master/src/endianBytes.mli) works directly on bytes, and provides submodules BigEndian and LittleEndian, with their unsafe counter-parts; -* [EndianBigstring](https://github.com/OCamlPro/ocplib-endian/blob/master/src/endianBigstring.mli) works on bigstrings (Bigarrays of chars), and provides submodules BigEndian and LittleEndian, with their unsafe counter-parts.""" -maintainer: "pierre.chambart@ocamlpro.com" -authors: "Pierre Chambart" -homepage: "https://github.com/OCamlPro/ocplib-endian" -doc: "https://ocamlpro.github.io/ocplib-endian/ocplib-endian/" -bug-reports: "https://github.com/OCamlPro/ocplib-endian/issues" -depends: [ - "base-bytes" - "ocaml" {>= "4.03.0"} - "cppo" {>= "1.1.0" & build} - "dune" {>= "1.0"} -] -build: [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} -] -dev-repo: "git+https://github.com/OCamlPro/ocplib-endian.git" -url { - src: - "https://github.com/OCamlPro/ocplib-endian/archive/refs/tags/1.2.tar.gz" - checksum: [ - "md5=8d5492eeb7c6815ade72a7415ea30949" - "sha512=2e70be5f3d6e377485c60664a0e235c3b9b24a8d6b6a03895d092c6e40d53810bfe1f292ee69e5181ce6daa8a582bfe3d59f3af889f417134f658812be5b8b85" - ] -} diff --git a/rtop.esy.lock/opam/ppx_derivers.1.2.1/opam b/rtop.esy.lock/opam/ppx_derivers.1.2.1/opam deleted file mode 100644 index 484b2654f..000000000 --- a/rtop.esy.lock/opam/ppx_derivers.1.2.1/opam +++ /dev/null @@ -1,23 +0,0 @@ -opam-version: "2.0" -maintainer: "jeremie@dimino.org" -authors: ["Jérémie Dimino"] -license: "BSD-3-Clause" -homepage: "https://github.com/ocaml-ppx/ppx_derivers" -bug-reports: "https://github.com/ocaml-ppx/ppx_derivers/issues" -dev-repo: "git+https://github.com/ocaml-ppx/ppx_derivers.git" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" - "dune" -] -synopsis: "Shared [@@deriving] plugin registry" -description: """ -Ppx_derivers is a tiny package whose sole purpose is to allow -ppx_deriving and ppx_type_conv to inter-operate gracefully when linked -as part of the same ocaml-migrate-parsetree driver.""" -url { - src: "https://github.com/ocaml-ppx/ppx_derivers/archive/1.2.1.tar.gz" - checksum: "md5=5dc2bf130c1db3c731fe0fffc5648b41" -} diff --git a/rtop.esy.lock/opam/react.1.2.2/opam b/rtop.esy.lock/opam/react.1.2.2/opam deleted file mode 100644 index cbbdc8f3f..000000000 --- a/rtop.esy.lock/opam/react.1.2.2/opam +++ /dev/null @@ -1,34 +0,0 @@ -opam-version: "2.0" -synopsis: "Declarative events and signals for OCaml" -description: """\ -Release %%VERSION%% - -React is an OCaml module for functional reactive programming (FRP). It -provides support to program with time varying values : declarative -events and signals. React doesn't define any primitive event or -signal, it lets the client chooses the concrete timeline. - -React is made of a single, independent, module and distributed under -the ISC license. - -Homepage: """ -maintainer: "Daniel Bünzli " -authors: "The react programmers" -license: "ISC" -tags: ["reactive" "declarative" "signal" "event" "frp" "org:erratique"] -homepage: "https://erratique.ch/software/react" -doc: "https://erratique.ch/software/react/doc/" -bug-reports: "https://github.com/dbuenzli/react/issues" -depends: [ - "ocaml" {>= "4.08.0"} - "ocamlfind" {build} - "ocamlbuild" {build} - "topkg" {build & >= "1.0.3"} -] -build: ["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%"] -dev-repo: "git+https://erratique.ch/repos/react.git" -url { - src: "https://erratique.ch/software/react/releases/react-1.2.2.tbz" - checksum: - "sha512=18cdd544d484222ba02db6bd9351571516532e7a1c107b59bbe39193837298f5c745eab6754f8bc6ff125b387be7018c6d6e6ac99f91925a5e4f53af688522b1" -} \ No newline at end of file diff --git a/rtop.esy.lock/opam/reason.3.8.2/opam b/rtop.esy.lock/opam/reason.3.8.2/opam deleted file mode 100644 index 83b706feb..000000000 --- a/rtop.esy.lock/opam/reason.3.8.2/opam +++ /dev/null @@ -1,36 +0,0 @@ -opam-version: "2.0" -maintainer: "Jordan Walke " -authors: [ "Jordan Walke " ] -license: "MIT" -homepage: "https://github.com/reasonml/reason" -doc: "https://reasonml.github.io/" -bug-reports: "https://github.com/reasonml/reason/issues" -dev-repo: "git+https://github.com/reasonml/reason.git" -tags: [ "syntax" ] -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.03" & < "5.1"} - "dune" {>= "2.3"} - "ocamlfind" {build} - "menhir" {>= "20180523"} - "merlin-extend" {>= "0.6"} - "fix" - "result" - "ppx_derivers" -] -synopsis: "Reason: Syntax & Toolchain for OCaml" -description: """ -Reason gives OCaml a new syntax that is remniscient of languages like -JavaScript. It's also the umbrella project for a set of tools for the OCaml & -JavaScript ecosystem.""" -url { - src: - "https://github.com/reasonml/reason/releases/download/3.8.2/reason-3.8.2.tbz" - checksum: [ - "sha256=7adcc45db20b8def82adf2712211fb8ed844328489752e8edf74281bc1eb2ef2" - "sha512=45822ecf4b19b892e1d150fd7f7a80af18df576b204647d4bbb9a18ac591a690f9b5338789ecccacb2d6b6354dbc32ff4a3574cc8b82b777e21cb8729f502f95" - ] -} -x-commit-hash: "6e6c3a7c2714aeaee93b421b3ffc040874bd3b3a" diff --git a/rtop.esy.lock/opam/result.1.5/opam b/rtop.esy.lock/opam/result.1.5/opam deleted file mode 100644 index 6b7b68d72..000000000 --- a/rtop.esy.lock/opam/result.1.5/opam +++ /dev/null @@ -1,22 +0,0 @@ -opam-version: "2.0" -maintainer: "Jane Street developers" -authors: ["Jane Street Group, LLC"] -homepage: "https://github.com/janestreet/result" -dev-repo: "git+https://github.com/janestreet/result.git" -bug-reports: "https://github.com/janestreet/result/issues" -license: "BSD-3-Clause" -build: [["dune" "build" "-p" name "-j" jobs]] -depends: [ - "ocaml" - "dune" {>= "1.0"} -] -synopsis: "Compatibility Result module" -description: """ -Projects that want to use the new result type defined in OCaml >= 4.03 -while staying compatible with older version of OCaml should use the -Result module defined in this library.""" -url { - src: - "https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz" - checksum: "md5=1b82dec78849680b49ae9a8a365b831b" -} diff --git a/rtop.esy.lock/opam/seq.base/files/META.seq b/rtop.esy.lock/opam/seq.base/files/META.seq deleted file mode 100644 index 06b95eff3..000000000 --- a/rtop.esy.lock/opam/seq.base/files/META.seq +++ /dev/null @@ -1,4 +0,0 @@ -name="seq" -version="[distributed with OCaml 4.07 or above]" -description="dummy backward-compatibility package for iterators" -requires="" diff --git a/rtop.esy.lock/opam/seq.base/files/seq.install b/rtop.esy.lock/opam/seq.base/files/seq.install deleted file mode 100644 index c4d70206e..000000000 --- a/rtop.esy.lock/opam/seq.base/files/seq.install +++ /dev/null @@ -1,3 +0,0 @@ -lib:[ - "META.seq" {"META"} -] diff --git a/rtop.esy.lock/opam/seq.base/opam b/rtop.esy.lock/opam/seq.base/opam deleted file mode 100644 index b33d8c7da..000000000 --- a/rtop.esy.lock/opam/seq.base/opam +++ /dev/null @@ -1,15 +0,0 @@ -opam-version: "2.0" -maintainer: " " -authors: " " -homepage: " " -depends: [ - "ocaml" {>= "4.07.0"} -] -dev-repo: "git+https://github.com/ocaml/ocaml.git" -bug-reports: "https://caml.inria.fr/mantis/main_page.php" -synopsis: - "Compatibility package for OCaml's standard iterator type starting from 4.07." -extra-files: [ - ["seq.install" "md5=026b31e1df290373198373d5aaa26e42"] - ["META.seq" "md5=b33c8a1a6c7ed797816ce27df4855107"] -] diff --git a/rtop.esy.lock/opam/topkg.1.0.7/opam b/rtop.esy.lock/opam/topkg.1.0.7/opam deleted file mode 100644 index 83fc06f49..000000000 --- a/rtop.esy.lock/opam/topkg.1.0.7/opam +++ /dev/null @@ -1,47 +0,0 @@ -opam-version: "2.0" -synopsis: "The transitory OCaml software packager" -description: """\ -Topkg is a packager for distributing OCaml software. It provides an -API to describe the files a package installs in a given build -configuration and to specify information about the package's -distribution, creation and publication procedures. - -The optional topkg-care package provides the `topkg` command line tool -which helps with various aspects of a package's life cycle: creating -and linting a distribution, releasing it on the WWW, publish its -documentation, add it to the OCaml opam repository, etc. - -Topkg is distributed under the ISC license and has **no** -dependencies. This is what your packages will need as a *build* -dependency. - -Topkg-care is distributed under the ISC license it depends on -[fmt][fmt], [logs][logs], [bos][bos], [cmdliner][cmdliner], -[webbrowser][webbrowser] and `opam-format`. - -[fmt]: http://erratique.ch/software/fmt -[logs]: http://erratique.ch/software/logs -[bos]: http://erratique.ch/software/bos -[cmdliner]: http://erratique.ch/software/cmdliner -[webbrowser]: http://erratique.ch/software/webbrowser - -Home page: http://erratique.ch/software/topkg""" -maintainer: "Daniel Bünzli " -authors: "The topkg programmers" -license: "ISC" -tags: ["packaging" "ocamlbuild" "org:erratique"] -homepage: "https://erratique.ch/software/topkg" -doc: "https://erratique.ch/software/topkg/doc" -bug-reports: "https://github.com/dbuenzli/topkg/issues" -depends: [ - "ocaml" {>= "4.05.0"} - "ocamlfind" {build & >= "1.6.1"} - "ocamlbuild" -] -build: ["ocaml" "pkg/pkg.ml" "build" "--pkg-name" name "--dev-pkg" "%{dev}%"] -dev-repo: "git+https://erratique.ch/repos/topkg.git" -url { - src: "https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz" - checksum: - "sha512=09e59f1759bf4db8471f02d0aefd8db602b44932a291c05c312b1423796e7a15d1598d3c62a0cec7f083eff8e410fac09363533dc4bd2120914bb9664efea535" -} \ No newline at end of file diff --git a/rtop.esy.lock/opam/trie.1.0.0/opam b/rtop.esy.lock/opam/trie.1.0.0/opam deleted file mode 100644 index 29442d7dd..000000000 --- a/rtop.esy.lock/opam/trie.1.0.0/opam +++ /dev/null @@ -1,19 +0,0 @@ -opam-version: "2.0" -maintainer: "zandoye@gmail.com" -authors: [ "ZAN DoYe" ] -homepage: "https://github.com/kandu/trie/" -bug-reports: "https://github.com/kandu/trie/issues" -license: "MIT" -dev-repo: "git+https://github.com/kandu/trie.git" -build: [ - ["dune" "build" "-p" name "-j" jobs] -] -depends: [ - "ocaml" {>= "4.02"} - "dune" {>= "1.0"} -] -synopsis: "Strict impure trie tree" -url { - src: "https://github.com/kandu/trie/archive/1.0.0.tar.gz" - checksum: "md5=84519b5f8bd92490bfc68a52f706ba14" -} diff --git a/rtop.esy.lock/opam/utop.2.9.2/opam b/rtop.esy.lock/opam/utop.2.9.2/opam deleted file mode 100644 index e1f9248a7..000000000 --- a/rtop.esy.lock/opam/utop.2.9.2/opam +++ /dev/null @@ -1,40 +0,0 @@ -opam-version: "2.0" -synopsis: "Universal toplevel for OCaml" -description: """\ -utop is an improved toplevel (i.e., Read-Eval-Print Loop or REPL) for -OCaml. It can run in a terminal or in Emacs. It supports line -edition, history, real-time and context sensitive completion, colors, -and more. It integrates with the Tuareg mode in Emacs.""" -maintainer: "jeremie@dimino.org" -authors: "Jérémie Dimino" -license: "BSD-3-Clause" -homepage: "https://github.com/ocaml-community/utop" -doc: "https://ocaml-community.github.io/utop/" -bug-reports: "https://github.com/ocaml-community/utop/issues" -depends: [ - "ocaml" {>= "4.03.0"} - "base-unix" - "base-threads" - "ocamlfind" {>= "1.7.2"} - "lambda-term" {>= "3.1.0" & < "3.3.0"} - "lwt" - "lwt_react" - "camomile" {< "2.0.0"} - "react" {>= "1.0.0"} - "cppo" {build & >= "1.1.2"} - "dune" {>= "1.0"} -] -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -dev-repo: "git+https://github.com/ocaml-community/utop.git" -url { - src: - "https://github.com/ocaml-community/utop/releases/download/2.9.2/utop-2.9.2.tbz" - checksum: [ - "md5=abd1c592464ce5f31b17009954040d7c" - "sha512=db97275aa4bd7725a9eeec6d9155c239f3e48adf8d34b73f55caa2de32fde98862480db5e05dffc89e98efd12eb60e08d89ad34b9a92a8de0d37ccb32af07ddf" - ] -} diff --git a/rtop.esy.lock/opam/yojson.2.0.2/opam b/rtop.esy.lock/opam/yojson.2.0.2/opam deleted file mode 100644 index 3b22e3899..000000000 --- a/rtop.esy.lock/opam/yojson.2.0.2/opam +++ /dev/null @@ -1,38 +0,0 @@ -opam-version: "2.0" -maintainer: ["nathan@cryptosense.com" "marek@xivilization.net"] -authors: ["Martin Jambon"] -homepage: "https://github.com/ocaml-community/yojson" -bug-reports: "https://github.com/ocaml-community/yojson/issues" -dev-repo: "git+https://github.com/ocaml-community/yojson.git" -doc: "https://ocaml-community.github.io/yojson/" -license: "BSD-3-Clause" -build: [ - ["dune" "subst"] {dev} - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} - ["dune" "build" "@doc" "-p" name "-j" jobs] {with-doc} -] -depends: [ - "ocaml" {>= "4.02.3"} - "dune" {>= "2.0"} - "cppo" {build} - "alcotest" {with-test & >= "0.8.5"} - "odoc" {with-doc} - "seq" {>= "0.2.2"} -] -synopsis: - "Yojson is an optimized parsing and printing library for the JSON format" -description: """ -Yojson is an optimized parsing and printing library for the JSON format. - -ydump is a pretty-printing command-line program provided with the -yojson package.""" -url { - src: - "https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz" - checksum: [ - "sha256=876bb6f38af73a84a29438a3da35e4857c60a14556a606525b148c6fdbe5461b" - "sha512=9e150689a814a64e53e361e336fe826df5a3e3851d1367fda4a001392175c29348de55db0b7d7ba18539dec2cf78198efcb7f41b77a9861763f5aa97c05509ad" - ] -} -x-commit-hash: "17ca03c5877a4346f0691443f35ed9678f99962f" diff --git a/rtop.esy.lock/opam/zed.3.1.0/opam b/rtop.esy.lock/opam/zed.3.1.0/opam deleted file mode 100644 index d6d47cfe9..000000000 --- a/rtop.esy.lock/opam/zed.3.1.0/opam +++ /dev/null @@ -1,32 +0,0 @@ -opam-version: "2.0" -maintainer: "opam-devel@lists.ocaml.org" -authors: ["Jérémie Dimino"] -homepage: "https://github.com/ocaml-community/zed" -bug-reports: "https://github.com/ocaml-community/zed/issues" -dev-repo: "git+https://github.com/ocaml-community/zed.git" -license: "BSD-3-Clause" -depends: [ - "ocaml" {>= "4.02.3"} - "dune" {>= "1.1.0"} - "base-bytes" - "camomile" {>= "1.0.1"} - "react" - "charInfo_width" {>= "1.1.0" & < "2.0~"} -] -build: [ - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} -] -synopsis: "Abstract engine for text edition in OCaml" -description: """ -Zed is an abstract engine for text edition. It can be used to write text -editors, edition widgets, readlines, ... Zed uses Camomile to fully support the -Unicode specification, and implements an UTF-8 encoded string type with -validation, and a rope datastructure to achieve efficient operations on large -Unicode buffers. Zed also features a regular expression search on ropes. To -support efficient text edition capabilities, Zed provides macro recording and -cursor management facilities.""" -url { - src: "https://github.com/ocaml-community/zed/archive/3.1.0.tar.gz" - checksum: "md5=51e8676ba972e5ad727633c161e404b1" -} diff --git a/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch b/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch deleted file mode 100644 index bba9929fe..000000000 --- a/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/files/winpatch.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./Makefile -+++ ./Makefile -@@ -271,7 +271,7 @@ - echo ' "ocamlbuild.byte" {"ocamlbuild.byte"}' >> ocamlbuild.install - ifeq ($(OCAML_NATIVE), true) - echo ' "ocamlbuild.native" {"ocamlbuild.native"}' >> ocamlbuild.install -- echo ' "ocamlbuild.native" {"ocamlbuild"}' >> ocamlbuild.install -+ echo " \"ocamlbuild.native\" {\"ocamlbuild${EXE}\"}" >> ocamlbuild.install - else - echo ' "ocamlbuild.byte" {"ocamlbuild"}' >> ocamlbuild.install - endif diff --git a/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json b/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json deleted file mode 100644 index b57a42cc2..000000000 --- a/rtop.esy.lock/overrides/opam__s__ocamlbuild_opam__c__0.14.2_opam_override/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "build": [ - [ - "bash", - "-c", - "#{os == 'windows' ? 'patch -p1 < winpatch.patch' : 'true'}" - ], - [ - "make", - "-f", - "configure.make", - "all", - "OCAMLBUILD_PREFIX=#{self.install}", - "OCAMLBUILD_BINDIR=#{self.bin}", - "OCAMLBUILD_LIBDIR=#{self.lib}", - "OCAMLBUILD_MANDIR=#{self.man}", - "OCAMLBUILD_NATIVE=true", - "OCAMLBUILD_NATIVE_TOOLS=true", - "EXE=#{os == 'windows' ? '.exe': ''}" - ], - [ - "make", - "check-if-preinstalled", - "all", - "EXE=#{os == 'windows' ? '.exe': ''}", - "opam-install" - ] - ] -} diff --git a/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch b/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch deleted file mode 100644 index 3aa5aa696..000000000 --- a/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/files/findlib.patch +++ /dev/null @@ -1,485 +0,0 @@ ---- ./Makefile -+++ ./Makefile -@@ -57,16 +57,16 @@ - cat findlib.conf.in | \ - $(SH) tools/patch '@SITELIB@' '$(OCAML_SITELIB)' >findlib.conf - if ./tools/cmd_from_same_dir ocamlc; then \ -- echo 'ocamlc="ocamlc.opt"' >>findlib.conf; \ -+ echo 'ocamlc="ocamlc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - if ./tools/cmd_from_same_dir ocamlopt; then \ -- echo 'ocamlopt="ocamlopt.opt"' >>findlib.conf; \ -+ echo 'ocamlopt="ocamlopt.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - if ./tools/cmd_from_same_dir ocamldep; then \ -- echo 'ocamldep="ocamldep.opt"' >>findlib.conf; \ -+ echo 'ocamldep="ocamldep.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - if ./tools/cmd_from_same_dir ocamldoc; then \ -- echo 'ocamldoc="ocamldoc.opt"' >>findlib.conf; \ -+ echo 'ocamldoc="ocamldoc.opt$(EXEC_SUFFIX)"' >>findlib.conf; \ - fi - - .PHONY: install-doc ---- ./src/findlib/findlib_config.mlp -+++ ./src/findlib/findlib_config.mlp -@@ -24,3 +24,5 @@ - | "MacOS" -> "" (* don't know *) - | _ -> failwith "Unknown Sys.os_type" - ;; -+ -+let exec_suffix = "@EXEC_SUFFIX@";; ---- ./src/findlib/findlib.ml -+++ ./src/findlib/findlib.ml -@@ -28,15 +28,20 @@ - let conf_ldconf = ref "";; - let conf_ignore_dups_in = ref ([] : string list);; - --let ocamlc_default = "ocamlc";; --let ocamlopt_default = "ocamlopt";; --let ocamlcp_default = "ocamlcp";; --let ocamloptp_default = "ocamloptp";; --let ocamlmklib_default = "ocamlmklib";; --let ocamlmktop_default = "ocamlmktop";; --let ocamldep_default = "ocamldep";; --let ocamlbrowser_default = "ocamlbrowser";; --let ocamldoc_default = "ocamldoc";; -+let add_exec str = -+ match Findlib_config.exec_suffix with -+ | "" -> str -+ | a -> str ^ a ;; -+let ocamlc_default = add_exec "ocamlc";; -+let ocamlopt_default = add_exec "ocamlopt";; -+let ocamlcp_default = add_exec "ocamlcp";; -+let ocamloptp_default = add_exec "ocamloptp";; -+let ocamlmklib_default = add_exec "ocamlmklib";; -+let ocamlmktop_default = add_exec "ocamlmktop";; -+let ocamldep_default = add_exec "ocamldep";; -+let ocamlbrowser_default = add_exec "ocamlbrowser";; -+let ocamldoc_default = add_exec "ocamldoc";; -+ - - - let init_manually ---- ./src/findlib/fl_package_base.ml -+++ ./src/findlib/fl_package_base.ml -@@ -133,7 +133,15 @@ - List.find (fun def -> def.def_var = "exists_if") p.package_defs in - let files = Fl_split.in_words def.def_value in - List.exists -- (fun file -> Sys.file_exists (Filename.concat d' file)) -+ (fun file -> -+ let fln = Filename.concat d' file in -+ let e = Sys.file_exists fln in -+ (* necessary for ppx executables *) -+ if e || Sys.os_type <> "Win32" || Filename.check_suffix fln ".exe" then -+ e -+ else -+ Sys.file_exists (fln ^ ".exe") -+ ) - files - with Not_found -> true in - ---- ./src/findlib/fl_split.ml -+++ ./src/findlib/fl_split.ml -@@ -126,10 +126,17 @@ - | '/' | '\\' -> true - | _ -> false in - let norm_dir_win() = -- if l >= 1 && s.[0] = '/' then -- Buffer.add_char b '\\' else Buffer.add_char b s.[0]; -- if l >= 2 && s.[1] = '/' then -- Buffer.add_char b '\\' else Buffer.add_char b s.[1]; -+ if l >= 1 then ( -+ if s.[0] = '/' then -+ Buffer.add_char b '\\' -+ else -+ Buffer.add_char b s.[0] ; -+ if l >= 2 then -+ if s.[1] = '/' then -+ Buffer.add_char b '\\' -+ else -+ Buffer.add_char b s.[1]; -+ ); - for k = 2 to l - 1 do - let c = s.[k] in - if is_slash c then ( ---- ./src/findlib/frontend.ml -+++ ./src/findlib/frontend.ml -@@ -31,10 +31,18 @@ - else - Sys_error (arg ^ ": " ^ Unix.error_message code) - -+let is_win = Sys.os_type = "Win32" -+ -+let () = -+ match Findlib_config.system with -+ | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" -> -+ (try set_binary_mode_out stdout true with _ -> ()); -+ (try set_binary_mode_out stderr true with _ -> ()); -+ | _ -> () - - let slashify s = - match Findlib_config.system with -- | "mingw" | "mingw64" | "cygwin" -> -+ | "win32" | "win64" | "mingw" | "cygwin" | "mingw64" | "cygwin64" -> - let b = Buffer.create 80 in - String.iter - (function -@@ -49,7 +57,7 @@ - - let out_path ?(prefix="") s = - match Findlib_config.system with -- | "mingw" | "mingw64" | "cygwin" -> -+ | "win32" | "win64" | "mingw" | "mingw64" | "cygwin" -> - let u = slashify s in - prefix ^ - (if String.contains u ' ' then -@@ -273,11 +281,9 @@ - - - let identify_dir d = -- match Sys.os_type with -- | "Win32" -> -- failwith "identify_dir" (* not available *) -- | _ -> -- let s = Unix.stat d in -+ if is_win then -+ failwith "identify_dir"; (* not available *) -+ let s = Unix.stat d in - (s.Unix.st_dev, s.Unix.st_ino) - ;; - -@@ -459,6 +465,96 @@ - ) - packages - -+let rewrite_cmd s = -+ if s = "" || not is_win then -+ s -+ else -+ let s = -+ let l = String.length s in -+ let b = Buffer.create l in -+ for i = 0 to pred l do -+ match s.[i] with -+ | '/' -> Buffer.add_char b '\\' -+ | x -> Buffer.add_char b x -+ done; -+ Buffer.contents b -+ in -+ if (Filename.is_implicit s && String.contains s '\\' = false) || -+ Filename.check_suffix (String.lowercase s) ".exe" then -+ s -+ else -+ let s' = s ^ ".exe" in -+ if Sys.file_exists s' then -+ s' -+ else -+ s -+ -+let rewrite_cmd s = -+ if s = "" || not is_win then s else -+ let s = -+ let l = String.length s in -+ let b = Buffer.create l in -+ for i = 0 to pred l do -+ match s.[i] with -+ | '/' -> Buffer.add_char b '\\' -+ | x -> Buffer.add_char b x -+ done; -+ Buffer.contents b -+ in -+ if (Filename.is_implicit s && String.contains s '\\' = false) || -+ Filename.check_suffix (String.lowercase s) ".exe" then -+ s -+ else -+ let s' = s ^ ".exe" in -+ if Sys.file_exists s' then -+ s' -+ else -+ s -+ -+let rewrite_pp cmd = -+ if not is_win then cmd else -+ let module T = struct exception Keep end in -+ let is_whitespace = function -+ | ' ' | '\011' | '\012' | '\n' | '\r' | '\t' -> true -+ | _ -> false in -+ (* characters that triggers special behaviour (cmd.exe, not unix shell) *) -+ let is_unsafe_char = function -+ | '(' | ')' | '%' | '!' | '^' | '<' | '>' | '&' -> true -+ | _ -> false in -+ let len = String.length cmd in -+ let buf = Buffer.create (len + 4) in -+ let buf_cmd = Buffer.create len in -+ let rec iter_ws i = -+ if i >= len then () else -+ let cur = cmd.[i] in -+ if is_whitespace cur then ( -+ Buffer.add_char buf cur; -+ iter_ws (succ i) -+ ) -+ else -+ iter_cmd i -+ and iter_cmd i = -+ if i >= len then add_buf_cmd () else -+ let cur = cmd.[i] in -+ if is_unsafe_char cur || cur = '"' || cur = '\'' then -+ raise T.Keep; -+ if is_whitespace cur then ( -+ add_buf_cmd (); -+ Buffer.add_substring buf cmd i (len - i) -+ ) -+ else ( -+ Buffer.add_char buf_cmd cur; -+ iter_cmd (succ i) -+ ) -+ and add_buf_cmd () = -+ if Buffer.length buf_cmd > 0 then -+ Buffer.add_string buf (rewrite_cmd (Buffer.contents buf_cmd)) -+ in -+ try -+ iter_ws 0; -+ Buffer.contents buf -+ with -+ | T.Keep -> cmd - - let process_pp_spec syntax_preds packages pp_opts = - (* Returns: pp_command *) -@@ -549,7 +645,7 @@ - None -> [] - | Some cmd -> - ["-pp"; -- cmd ^ " " ^ -+ (rewrite_cmd cmd) ^ " " ^ - String.concat " " (List.map Filename.quote pp_i_options) ^ " " ^ - String.concat " " (List.map Filename.quote pp_archives) ^ " " ^ - String.concat " " (List.map Filename.quote pp_opts)] -@@ -625,9 +721,11 @@ - in - try - let preprocessor = -+ rewrite_cmd ( - resolve_path - ~base ~explicit:true -- (package_property predicates pname "ppx") in -+ (package_property predicates pname "ppx") ) -+ in - ["-ppx"; String.concat " " (preprocessor :: options)] - with Not_found -> [] - ) -@@ -895,6 +993,14 @@ - switch (e.g. -L instead of -L ) - *) - -+(* We may need to remove files on which we do not have complete control. -+ On Windows, removing a read-only file fails so try to change the -+ mode of the file first. *) -+let remove_file fname = -+ try Sys.remove fname -+ with Sys_error _ when is_win -> -+ (try Unix.chmod fname 0o666 with Unix.Unix_error _ -> ()); -+ Sys.remove fname - - let ocamlc which () = - -@@ -1022,9 +1128,12 @@ - - "-intf", - Arg.String (fun s -> pass_files := !pass_files @ [ Intf(slashify s) ]); -- -+ - "-pp", -- Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" s); -+ Arg.String (fun s -> pp_specified := true; add_spec_fn "-pp" (rewrite_pp s)); -+ -+ "-ppx", -+ Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s)); - - "-thread", - Arg.Unit (fun _ -> threads := threads_default); -@@ -1237,7 +1346,7 @@ - with - any -> - close_out initl; -- Sys.remove initl_file_name; -+ remove_file initl_file_name; - raise any - end; - -@@ -1245,9 +1354,9 @@ - at_exit - (fun () -> - let tr f x = try f x with _ -> () in -- tr Sys.remove initl_file_name; -- tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmi"); -- tr Sys.remove (Filename.chop_extension initl_file_name ^ ".cmo"); -+ tr remove_file initl_file_name; -+ tr remove_file (Filename.chop_extension initl_file_name ^ ".cmi"); -+ tr remove_file (Filename.chop_extension initl_file_name ^ ".cmo"); - ); - - let exclude_list = [ stdlibdir; threads_dir; vmthreads_dir ] in -@@ -1493,7 +1602,9 @@ - [ "-v", Arg.Unit (fun () -> verbose := Verbose); - "-pp", Arg.String (fun s -> - pp_specified := true; -- options := !options @ ["-pp"; s]); -+ options := !options @ ["-pp"; rewrite_pp s]); -+ "-ppx", Arg.String (fun s -> -+ options := !options @ ["-ppx"; rewrite_pp s]); - ] - ) - ) -@@ -1672,7 +1783,9 @@ - Arg.String (fun s -> add_spec_fn "-I" (slashify (resolve_path s))); - - "-pp", Arg.String (fun s -> pp_specified := true; -- add_spec_fn "-pp" s); -+ add_spec_fn "-pp" (rewrite_pp s)); -+ "-ppx", Arg.String (fun s -> add_spec_fn "-ppx" (rewrite_pp s)); -+ - ] - ) - ) -@@ -1830,7 +1943,10 @@ - output_string ch_out append; - close_out ch_out; - close_in ch_in; -- Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime; -+ (try Unix.utimes outpath s.Unix.st_mtime s.Unix.st_mtime -+ with Unix.Unix_error(e,_,_) -> -+ prerr_endline("Warning: setting utimes for " ^ outpath -+ ^ ": " ^ Unix.error_message e)); - - prerr_endline("Installed " ^ outpath); - with -@@ -1882,6 +1998,8 @@ - Unix.openfile (Filename.concat dir owner_file) [Unix.O_RDONLY] 0 in - let f = - Unix.in_channel_of_descr fd in -+ if is_win then -+ set_binary_mode_in f false; - try - let line = input_line f in - let is_my_file = (line = pkg) in -@@ -2208,7 +2326,7 @@ - let lines = read_ldconf !ldconf in - let dlldir_norm = Fl_split.norm_dir dlldir in - let dlldir_norm_lc = string_lowercase_ascii dlldir_norm in -- let ci_filesys = (Sys.os_type = "Win32") in -+ let ci_filesys = is_win in - let check_dir d = - let d' = Fl_split.norm_dir d in - (d' = dlldir_norm) || -@@ -2356,7 +2474,7 @@ - List.iter - (fun file -> - let absfile = Filename.concat dlldir file in -- Sys.remove absfile; -+ remove_file absfile; - prerr_endline ("Removed " ^ absfile) - ) - dll_files -@@ -2365,7 +2483,7 @@ - (* Remove the files from the package directory: *) - if Sys.file_exists pkgdir then begin - let files = Sys.readdir pkgdir in -- Array.iter (fun f -> Sys.remove (Filename.concat pkgdir f)) files; -+ Array.iter (fun f -> remove_file (Filename.concat pkgdir f)) files; - Unix.rmdir pkgdir; - prerr_endline ("Removed " ^ pkgdir) - end -@@ -2415,7 +2533,9 @@ - - - let print_configuration() = -+ let sl = slashify in - let dir s = -+ let s = sl s in - if Sys.file_exists s then - s - else -@@ -2453,27 +2573,27 @@ - if md = "" then "the corresponding package directories" else dir md - ); - Printf.printf "The standard library is assumed to reside in:\n %s\n" -- (Findlib.ocaml_stdlib()); -+ (sl (Findlib.ocaml_stdlib())); - Printf.printf "The ld.conf file can be found here:\n %s\n" -- (Findlib.ocaml_ldconf()); -+ (sl (Findlib.ocaml_ldconf())); - flush stdout - | Some "conf" -> -- print_endline (Findlib.config_file()) -+ print_endline (sl (Findlib.config_file())) - | Some "path" -> -- List.iter print_endline (Findlib.search_path()) -+ List.iter ( fun x -> print_endline (sl x)) (Findlib.search_path()) - | Some "destdir" -> -- print_endline (Findlib.default_location()) -+ print_endline ( sl (Findlib.default_location())) - | Some "metadir" -> -- print_endline (Findlib.meta_directory()) -+ print_endline ( sl (Findlib.meta_directory())) - | Some "metapath" -> - let mdir = Findlib.meta_directory() in - let ddir = Findlib.default_location() in -- print_endline -- (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META") -+ print_endline ( sl -+ (if mdir <> "" then mdir ^ "/META.%s" else ddir ^ "/%s/META")) - | Some "stdlib" -> -- print_endline (Findlib.ocaml_stdlib()) -+ print_endline ( sl (Findlib.ocaml_stdlib())) - | Some "ldconf" -> -- print_endline (Findlib.ocaml_ldconf()) -+ print_endline ( sl (Findlib.ocaml_ldconf())) - | _ -> - assert false - ;; -@@ -2481,7 +2601,7 @@ - - let ocamlcall pkg cmd = - let dir = package_directory pkg in -- let path = Filename.concat dir cmd in -+ let path = rewrite_cmd (Filename.concat dir cmd) in - begin - try Unix.access path [ Unix.X_OK ] - with -@@ -2647,6 +2767,10 @@ - | Sys_error f -> - prerr_endline ("ocamlfind: " ^ f); - exit 2 -+ | Unix.Unix_error (e, fn, f) -> -+ prerr_endline ("ocamlfind: " ^ fn ^ " " ^ f -+ ^ ": " ^ Unix.error_message e); -+ exit 2 - | Findlib.No_such_package(pkg,info) -> - prerr_endline ("ocamlfind: Package `" ^ pkg ^ "' not found" ^ - (if info <> "" then " - " ^ info else "")); ---- ./src/findlib/Makefile -+++ ./src/findlib/Makefile -@@ -90,6 +90,7 @@ - cat findlib_config.mlp | \ - $(SH) $(TOP)/tools/patch '@CONFIGFILE@' '$(OCAMLFIND_CONF)' | \ - $(SH) $(TOP)/tools/patch '@STDLIB@' '$(OCAML_CORE_STDLIB)' | \ -+ $(SH) $(TOP)/tools/patch '@EXEC_SUFFIX@' '$(EXEC_SUFFIX)' | \ - sed -e 's;@AUTOLINK@;$(OCAML_AUTOLINK);g' \ - -e 's;@SYSTEM@;$(SYSTEM);g' \ - >findlib_config.ml ---- ./src/findlib/frontend.ml -+++ ./src/findlib/frontend.ml -@@ -281,10 +281,8 @@ - - - let identify_dir d = -- if is_win then -- failwith "identify_dir"; (* not available *) - let s = Unix.stat d in -- (s.Unix.st_dev, s.Unix.st_ino) -+ (s.Unix.st_dev, s.Unix.st_ino) - ;; - - diff --git a/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json b/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json deleted file mode 100644 index bf169e50d..000000000 --- a/rtop.esy.lock/overrides/opam__s__ocamlfind_opam__c__1.9.6_opam_override/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "build": [ - [ - "bash", - "-c", - "#{os == 'windows' ? 'patch -p1 < findlib.patch' : 'true'}" - ], - [ - "./configure", - "-bindir", - "#{self.bin}", - "-sitelib", - "#{self.lib}", - "-mandir", - "#{self.man}", - "-config", - "#{self.lib}/findlib.conf", - "-no-custom", - "-no-topfind" - ], - [ - "make", - "all" - ], - [ - "make", - "opt" - ] - ], - "install": [ - [ - "make", - "install" - ], - [ - "install", - "-m", - "0755", - "ocaml-stub", - "#{self.bin}/ocaml" - ], - [ - "mkdir", - "-p", - "#{self.toplevel}" - ], - [ - "install", - "-m", - "0644", - "src/findlib/topfind", - "#{self.toplevel}/topfind" - ] - ], - "exportedEnv": { - "OCAML_TOPLEVEL_PATH": { - "val": "#{self.toplevel}", - "scope": "global" - } - } -} diff --git a/rtop.json b/rtop.json index ba93cfb59..402d4d04d 100644 --- a/rtop.json +++ b/rtop.json @@ -1,6 +1,6 @@ { "name": "@esy-ocaml/rtop", - "version": "3.8.1", + "version": "3.8.2", "license": "MIT", "repository": { "type": "git", @@ -9,7 +9,15 @@ "dependencies": { "@esy-ocaml/substs": "^0.0.1", "@opam/ocamlfind": "*", +<<<<<<< HEAD + "@opam/result": "*", + "@opam/dune": ">= 2.9.3", +||||||| e745752 + "@opam/result": "*", "@opam/dune": "2.9.3", +======= + "@opam/dune": "2.9.3", +>>>>>>> 0c763cd00440dada442c025c05cdd0e407827a8c "@opam/reason": "^3.8.0", "@opam/utop": " >= 1.17.0", "ocaml": ">= 4.3.0 < 5.1.0" diff --git a/rtop.opam b/rtop.opam index e7c83b706..865669bb0 100644 --- a/rtop.opam +++ b/rtop.opam @@ -11,10 +11,10 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.03" & < "5.1"} - "dune" {>= "2.3"} + "ocaml" {>= "4.03" & < "5.1"} + "dune" {>= "2.9.3"} "reason" {=version} - "utop" {>= "2.0"} + "utop" {>= "2.0"} ] synopsis: "Reason toplevel" description: diff --git a/src/refmt/.gitignore b/src/refmt/.gitignore new file mode 100644 index 000000000..294b4de00 --- /dev/null +++ b/src/refmt/.gitignore @@ -0,0 +1 @@ +git_version.ml diff --git a/src/refmt/dune b/src/refmt/dune index 1a532995b..70419f88c 100644 --- a/src/refmt/dune +++ b/src/refmt/dune @@ -2,4 +2,13 @@ (name refmt_impl) (public_name refmt) (package reason) - (libraries reason reason.cmdliner)) + (libraries reason reason.cmdliner dune-build-info)) + +(rule + (targets git_commit.ml) + (action + (with-stdout-to + %{targets} + (progn + (bash "echo let version = \\\"$(git rev-parse --verify HEAD)\\\"") + (bash "echo let short_version = \\\"$(git rev-parse --short HEAD)\\\""))))) diff --git a/src/refmt/git_commit.mli b/src/refmt/git_commit.mli new file mode 100644 index 000000000..d8801deb2 --- /dev/null +++ b/src/refmt/git_commit.mli @@ -0,0 +1,5 @@ +(* Interface file to ensure git_commit is generated properly with dune *) + +val version: string + +val short_version: string diff --git a/src/refmt/package.ml b/src/refmt/package.ml index 67b04a46e..01a51a762 100644 --- a/src/refmt/package.ml +++ b/src/refmt/package.ml @@ -1,4 +1,7 @@ +let version = (match Build_info.V1.version () with + | None -> "n/a" + | Some v -> Build_info.V1.Version.to_string v) -let version = "3.7.0" -let git_version = "b66ed1b87c2543ed950f619f0e1208e010968d12" -let git_short_version = "b66ed1b" +let git_version = Git_commit.version + +let git_short_version = Git_commit.short_version diff --git a/src/refmt/package.ml.in b/src/refmt/package.ml.in deleted file mode 100644 index 8541d2541..000000000 --- a/src/refmt/package.ml.in +++ /dev/null @@ -1,3 +0,0 @@ -let version = "@version@" -let git_version = "@git_version@" -let git_short_version = "@git_short_version@" diff --git a/test/version.t b/test/version.t index 80a42082e..444ddaf62 100644 --- a/test/version.t +++ b/test/version.t @@ -1,3 +1,3 @@ -Ensures refmt is in the right place - $ refmt --version - Reason 3.7.0 @ b66ed1b +Ensures refmt --version prints the right version + $ refmt --version | cut -d '@' -f 1 + Reason 3.8.2 From c6817db55aea126178ace6fdd6ee0d1588c2d2af Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Mon, 27 Mar 2023 23:49:29 -0700 Subject: [PATCH 16/20] generate opam files with dune (#2704) * generate opam files with dune * Use dune 2.9 * Specify utop in rtop and add dune-build-info * Rename formatTest to test in default.nix --------- Co-authored-by: David Sancho Moreno --- dune-project | 56 ++++++++++++++++++++++++++++++++++++++++++++++++- nix/default.nix | 2 +- reason.opam | 50 ++++++++++++++++++++++++++++--------------- rtop.json | 8 ------- rtop.opam | 46 +++++++++++++++++++++++++++------------- 5 files changed, 120 insertions(+), 42 deletions(-) diff --git a/dune-project b/dune-project index abcdda62c..6b1228397 100644 --- a/dune-project +++ b/dune-project @@ -1,7 +1,61 @@ -(lang dune 2.8) +(lang dune 2.9) + (name reason) (using menhir 2.0) + (cram enable) (version 3.8.2) + +(generate_opam_files true) + +(source + (github reasonml/reason)) + +(authors "Jordan Walke ") + +(maintainers + "Jordan Walke " + "Antonio Nuno Monteiro ") + +(homepage "https://reasonml.github.io/") + +(bug_reports "https://github.com/reasonml/reason/issues") + +(license "MIT") + +(package + (name reason) + (synopsis "Reason: Syntax & Toolchain for OCaml") + (description + "Reason gives OCaml a new syntax that is remniscient of languages like\nJavaScript. It's also the umbrella project for a set of tools for the OCaml &\nJavaScript ecosystem.") + (depends + (ocaml + (and + (>= "4.03") + (< "5.1"))) + (ocamlfind :build) + (dune-build-info + (>= 2.9.3)) + (menhir + (>= "20180523")) + (merlin-extend + (>= "0.6")) + fix + ppx_derivers)) + +(package + (name rtop) + (synopsis "Reason toplevel") + (description + "rtop is the toplevel (or REPL) for Reason, based on utop (https://github.com/diml/utop).") + (depends + (ocaml + (and + (>= "4.03") + (< "5.1"))) + (reason + (= :version)) + (utop + (>= "2.0")))) diff --git a/nix/default.nix b/nix/default.nix index a237890e2..1f57f67ed 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -11,7 +11,7 @@ ocamlPackages.buildDunePackage { src = nix-filter.filter { root = ./..; - include = [ "dune" "dune-project" "reason.opam" "rtop.opam" "scripts" "src" "formatTest" ]; + include = [ "dune" "dune-project" "reason.opam" "rtop.opam" "scripts" "src" "test" ]; }; useDune2 = true; diff --git a/reason.opam b/reason.opam index fbc24dafc..51eb29b52 100644 --- a/reason.opam +++ b/reason.opam @@ -1,28 +1,44 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -maintainer: "Jordan Walke " -authors: [ "Jordan Walke " ] +version: "3.8.2" +synopsis: "Reason: Syntax & Toolchain for OCaml" +description: """ +Reason gives OCaml a new syntax that is remniscient of languages like +JavaScript. It's also the umbrella project for a set of tools for the OCaml & +JavaScript ecosystem.""" +maintainer: [ + "Jordan Walke " + "Antonio Nuno Monteiro " +] +authors: ["Jordan Walke "] license: "MIT" -homepage: "https://github.com/reasonml/reason" -doc: "https://reasonml.github.io/" +homepage: "https://reasonml.github.io/" bug-reports: "https://github.com/reasonml/reason/issues" -dev-repo: "git+https://github.com/reasonml/reason.git" -tags: [ "syntax" ] -build: [ - ["dune" "build" "-p" name "-j" jobs] -] depends: [ + "dune" {>= "2.9"} "ocaml" {>= "4.03" & < "5.1"} - "dune" {>= "2.9.3"} - "dune-build-info" {>= "2.9.3"} "ocamlfind" {build} + "dune-build-info" {>= "2.9.3"} "menhir" {>= "20180523"} "merlin-extend" {>= "0.6"} "fix" - "result" "ppx_derivers" + "odoc" {with-doc} ] -synopsis: "Reason: Syntax & Toolchain for OCaml" -description: """ -Reason gives OCaml a new syntax that is remniscient of languages like -JavaScript. It's also the umbrella project for a set of tools for the OCaml & -JavaScript ecosystem.""" +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "--promote-install-files=false" + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] + ["dune" "install" "-p" name "--create-install-files" name] +] +dev-repo: "git+https://github.com/reasonml/reason.git" diff --git a/rtop.json b/rtop.json index 402d4d04d..447d3708b 100644 --- a/rtop.json +++ b/rtop.json @@ -9,15 +9,7 @@ "dependencies": { "@esy-ocaml/substs": "^0.0.1", "@opam/ocamlfind": "*", -<<<<<<< HEAD - "@opam/result": "*", "@opam/dune": ">= 2.9.3", -||||||| e745752 - "@opam/result": "*", - "@opam/dune": "2.9.3", -======= - "@opam/dune": "2.9.3", ->>>>>>> 0c763cd00440dada442c025c05cdd0e407827a8c "@opam/reason": "^3.8.0", "@opam/utop": " >= 1.17.0", "ocaml": ">= 4.3.0 < 5.1.0" diff --git a/rtop.opam b/rtop.opam index 865669bb0..79dd15be2 100644 --- a/rtop.opam +++ b/rtop.opam @@ -1,22 +1,38 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -maintainer: "Jordan Walke " -authors: [ "Jordan Walke " ] +version: "3.8.2" +synopsis: "Reason toplevel" +description: + "rtop is the toplevel (or REPL) for Reason, based on utop (https://github.com/diml/utop)." +maintainer: [ + "Jordan Walke " + "Antonio Nuno Monteiro " +] +authors: ["Jordan Walke "] license: "MIT" -homepage: "https://github.com/reasonml/reason" -doc: "https://reasonml.github.io/" +homepage: "https://reasonml.github.io/" bug-reports: "https://github.com/reasonml/reason/issues" -dev-repo: "git+https://github.com/reasonml/reason.git" -tags: [ "syntax" ] -build: [ - ["dune" "build" "-p" name "-j" jobs] -] depends: [ + "dune" {>= "2.9"} "ocaml" {>= "4.03" & < "5.1"} - "dune" {>= "2.9.3"} - "reason" {=version} + "reason" {= version} "utop" {>= "2.0"} + "odoc" {with-doc} ] -synopsis: "Reason toplevel" -description: - "rtop is the toplevel (or REPL) for Reason, based on utop (https://github.com/diml/utop)." - +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "--promote-install-files=false" + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] + ["dune" "install" "-p" name "--create-install-files" name] +] +dev-repo: "git+https://github.com/reasonml/reason.git" From 229ffdffa9a44983159b941fb59c158536b2a542 Mon Sep 17 00:00:00 2001 From: Sander Date: Tue, 18 Apr 2023 00:31:53 +0200 Subject: [PATCH 17/20] Improve printing of modules types with one line inside (#2709) * improve printing of modules with one line * add history entry --- HISTORY.md | 1 + src/reason-parser/reason_pprint_ast.ml | 2 +- test/modules.t/run.t | 28 +++++++++++++++++++------- test/modules_no_semi.t/run.t | 28 +++++++++++++++++++------- test/whitespace-rei.t/run.t | 12 ++++++++--- test/wrapping-re.t/run.t | 8 ++++++-- 6 files changed, 59 insertions(+), 20 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index b2ce46405..4e1bff80f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,6 @@ ## 3.9 (unreleased) +- Print module type body on separate line (@SanderSpies) [#2709](https://github.com/reasonml/reason/pull/2709) - Fix missing patterns around contraint pattern (a pattern with a type annotation). - Fix top level extension printing - Remove the dependency on the `result` package, which isn't needed for OCaml diff --git a/src/reason-parser/reason_pprint_ast.ml b/src/reason-parser/reason_pprint_ast.ml index 18b03f196..b0880d702 100644 --- a/src/reason-parser/reason_pprint_ast.ml +++ b/src/reason-parser/reason_pprint_ast.ml @@ -7419,7 +7419,7 @@ let printer = object(self:'self) ~comments:self#comments s in - let shouldBreakLabel = if List.length s > 1 then `Always else `Auto in + let shouldBreakLabel = if List.length s > 0 then `Always else `Auto in label ~indent:0 ~break:shouldBreakLabel diff --git a/test/modules.t/run.t b/test/modules.t/run.t index b28898cd2..27c94f76d 100644 --- a/test/modules.t/run.t +++ b/test/modules.t/run.t @@ -113,7 +113,9 @@ Format modules tmp + 30; }; - module type HasTT = {type tt;}; + module type HasTT = { + type tt; + }; module SubModule: HasTT = { type tt = int; @@ -123,7 +125,9 @@ Format modules module SubModuleThatHasTT = SubModule; }; - module type HasPolyType = {type t('a);}; + module type HasPolyType = { + type t('a); + }; module type HasDestructivelySubstitutedPolyType = HasPolyType with type t('a) := list('a); @@ -200,10 +204,16 @@ Format modules type tt = string; }); - module type SigResult = {let result: int;}; + module type SigResult = { + let result: int; + }; - module type ASig = {let a: int;}; - module type BSig = {let b: int;}; + module type ASig = { + let a: int; + }; + module type BSig = { + let b: int; + }; module AMod = { let a = 10; }; @@ -422,7 +432,9 @@ Format modules }; /* From http://stackoverflow.com/questions/1986374/higher-order-type-constructors-and-functors-in-ocaml */ - module type Type = {type t;}; + module type Type = { + type t; + }; module Char = { type t = char; }; @@ -483,7 +495,9 @@ Format modules let myValue = {recordField: "hello"}; }); - module type HasInt = {let x: int;}; + module type HasInt = { + let x: int; + }; module MyModule = { let x = 10; diff --git a/test/modules_no_semi.t/run.t b/test/modules_no_semi.t/run.t index 388d7f2ef..6f5887008 100644 --- a/test/modules_no_semi.t/run.t +++ b/test/modules_no_semi.t/run.t @@ -113,7 +113,9 @@ Format modules no semi tmp + 30; }; - module type HasTT = {type tt;}; + module type HasTT = { + type tt; + }; module SubModule: HasTT = { type tt = int; @@ -123,7 +125,9 @@ Format modules no semi module SubModuleThatHasTT = SubModule; }; - module type HasPolyType = {type t('a);}; + module type HasPolyType = { + type t('a); + }; module type HasDestructivelySubstitutedPolyType = HasPolyType with type t('a) := list('a); @@ -200,10 +204,16 @@ Format modules no semi type tt = string; }); - module type SigResult = {let result: int;}; + module type SigResult = { + let result: int; + }; - module type ASig = {let a: int;}; - module type BSig = {let b: int;}; + module type ASig = { + let a: int; + }; + module type BSig = { + let b: int; + }; module AMod = { let a = 10; }; @@ -422,7 +432,9 @@ Format modules no semi }; /* From http://stackoverflow.com/questions/1986374/higher-order-type-constructors-and-functors-in-ocaml */ - module type Type = {type t;}; + module type Type = { + type t; + }; module Char = { type t = char; }; @@ -483,7 +495,9 @@ Format modules no semi let myValue = {recordField: "hello"}; }); - module type HasInt = {let x: int;}; + module type HasInt = { + let x: int; + }; module MyModule = { let x = 10; diff --git a/test/whitespace-rei.t/run.t b/test/whitespace-rei.t/run.t index f35d5f832..e4b4b700d 100644 --- a/test/whitespace-rei.t/run.t +++ b/test/whitespace-rei.t/run.t @@ -142,16 +142,22 @@ Format whitespace in .rei files include Shared; /** doc attached */ - module type X = {let x: int;}; + module type X = { + let x: int; + }; /** doc attached with whitespace */ - module type X = {let x: int;}; + module type X = { + let x: int; + }; /** doc attached with whitespace and comment */ /* test */ - module type X = {let x: int;}; + module type X = { + let x: int; + }; /** doc attached */ module X: MX; diff --git a/test/wrapping-re.t/run.t b/test/wrapping-re.t/run.t index e0dff470e..c8823ac54 100644 --- a/test/wrapping-re.t/run.t +++ b/test/wrapping-re.t/run.t @@ -2568,8 +2568,12 @@ Format wrapping in .re files 1 + 2 + 3 + 3, ); - module type ASig = {let a: int;}; - module type BSig = {let b: int;}; + module type ASig = { + let a: int; + }; + module type BSig = { + let b: int; + }; module AMod = { let a = 10; }; From 2dd5bbbe6eddda89fefedf26ba282d0ff688ba48 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Mon, 17 Apr 2023 18:07:51 -0700 Subject: [PATCH 18/20] chore: remove old BS_NO_COMPILER_PATCH flag (#2710) --- src/reason-parser/dune | 34 ++----------------- ...reason_oprint.cppo.ml => reason_oprint.ml} | 12 ------- src/reason-parser/reason_syntax_util.cppo.ml | 6 ---- src/reason-parser/reason_syntax_util.cppo.mli | 3 -- 4 files changed, 2 insertions(+), 53 deletions(-) rename src/reason-parser/{reason_oprint.cppo.ml => reason_oprint.ml} (98%) diff --git a/src/reason-parser/dune b/src/reason-parser/dune index 288f79805..580775f1d 100644 --- a/src/reason-parser/dune +++ b/src/reason-parser/dune @@ -73,47 +73,17 @@ %{targets} (run ../menhir-recover/main.exe reason_parser.cmly)))) -(rule - (targets reason_oprint.ml) - (deps reason_oprint.cppo.ml) - (action - (run - %{bin:cppo} - -V - OCAML:%{ocaml_version} - -D - BS_NO_COMPILER_PATCH - %{deps} - -o - %{targets}))) - (rule (targets reason_syntax_util.ml) (deps reason_syntax_util.cppo.ml) (action - (run - %{bin:cppo} - -V - OCAML:%{ocaml_version} - -D - BS_NO_COMPILER_PATCH - %{deps} - -o - %{targets}))) + (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets}))) (rule (targets reason_syntax_util.mli) (deps reason_syntax_util.cppo.mli) (action - (run - %{bin:cppo} - -V - OCAML:%{ocaml_version} - -D - BS_NO_COMPILER_PATCH - %{deps} - -o - %{targets}))) + (run %{bin:cppo} -V OCAML:%{ocaml_version} %{deps} -o %{targets}))) (library (name reason) diff --git a/src/reason-parser/reason_oprint.cppo.ml b/src/reason-parser/reason_oprint.ml similarity index 98% rename from src/reason-parser/reason_oprint.cppo.ml rename to src/reason-parser/reason_oprint.ml index 87effa550..21cb27180 100644 --- a/src/reason-parser/reason_oprint.cppo.ml +++ b/src/reason-parser/reason_oprint.ml @@ -84,10 +84,8 @@ patching the right parts, through the power of types(tm) *) -#ifdef BS_NO_COMPILER_PATCH open Reason_omp open Ast_411 -#endif open Format open Outcometree @@ -98,7 +96,6 @@ let cautious f ppf arg = try f ppf arg with Ellipsis -> fprintf ppf "..." -#ifdef BS_NO_COMPILER_PATCH let rec print_ident ppf = function Oide_ident s -> pp_print_string ppf s.printed_name @@ -106,15 +103,6 @@ let rec print_ident ppf = print_ident ppf id; pp_print_char ppf '.'; pp_print_string ppf s | Oide_apply (id1, id2) -> fprintf ppf "%a(%a)" print_ident id1 print_ident id2 -#else -let rec print_ident ppf = - function - Oide_ident s -> !Oprint.out_ident ppf s - | Oide_dot (id, s) -> - print_ident ppf id; pp_print_char ppf '.'; !Oprint.out_ident ppf s - | Oide_apply (id1, id2) -> - fprintf ppf "%a(%a)" print_ident id1 print_ident id2 -#endif let parenthesized_ident name = (List.mem name ["or"; "mod"; "land"; "lor"; "lxor"; "lsl"; "lsr"; "asr"]) diff --git a/src/reason-parser/reason_syntax_util.cppo.ml b/src/reason-parser/reason_syntax_util.cppo.ml index 2fa35f62a..443ffe306 100644 --- a/src/reason-parser/reason_syntax_util.cppo.ml +++ b/src/reason-parser/reason_syntax_util.cppo.ml @@ -14,10 +14,8 @@ patching the right parts, through the power of types(tm) *) -#ifdef BS_NO_COMPILER_PATCH open Reason_omp open Ast_411 -#endif open Asttypes open Ast_mapper @@ -155,8 +153,6 @@ let escape_string str = (* the stuff below contains side-effects and are not used by BuckleScript's vendored version of reason_syntax_util.ml. So we can neglect it *) -#ifdef BS_NO_COMPILER_PATCH - (* UTF-8 characters are encoded like this (most editors are UTF-8) 0xxxxxxx (length 1) @@ -858,8 +854,6 @@ let explode_str str = if i < 0 then acc else loop (str.[i] :: acc) (i - 1) in loop [] (String.length str - 1) -#endif - module Clflags = struct include Clflags diff --git a/src/reason-parser/reason_syntax_util.cppo.mli b/src/reason-parser/reason_syntax_util.cppo.mli index 9abe8148a..155d685fb 100644 --- a/src/reason-parser/reason_syntax_util.cppo.mli +++ b/src/reason-parser/reason_syntax_util.cppo.mli @@ -21,8 +21,6 @@ val escape_string : string -> string (* Everything below is used by reason repo but not the BuckleScript repo *) -#ifdef BS_NO_COMPILER_PATCH - val reason_to_ml_swap : string -> string module TrailingCommaMarker : sig val char : char val string : string end @@ -95,7 +93,6 @@ val location_contains : Location.t -> Location.t -> bool val split_compiler_error : Location.error -> Location.t * string val explode_str : string -> char list -#endif module Clflags : sig include module type of Clflags From 82dd9aa90b06cecf8db6fe59a120653f483b1199 Mon Sep 17 00:00:00 2001 From: Sander Date: Wed, 19 Apr 2023 18:49:16 +0200 Subject: [PATCH 19/20] Improve functor printing. (#2683) * Improve empty functor printing. * Improve functor application without args printing * Improve printing * Remove parentheses around functor argument. * Add history entry * Trigger Build * add test results * move check to makeList * change history entry * Update src/reason-parser/reason_pprint_ast.ml --------- Co-authored-by: Antonio Nuno Monteiro --- HISTORY.md | 1 + src/reason-parser/reason_pprint_ast.ml | 15 ++++++++++----- test/extensions.t/run.t | 4 +--- test/modules.t/input.re | 14 +++++++++++++- test/modules.t/run.t | 25 +++++++++++++++---------- test/modules_no_semi.t/run.t | 9 ++------- 6 files changed, 42 insertions(+), 26 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 4e1bff80f..f3437477a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,6 @@ ## 3.9 (unreleased) +- Reduce the amount of parentheses around functor usage. [#2683](https://github.com/reasonml/reason/pull/2683) - Print module type body on separate line (@SanderSpies) [#2709](https://github.com/reasonml/reason/pull/2709) - Fix missing patterns around contraint pattern (a pattern with a type annotation). - Fix top level extension printing diff --git a/src/reason-parser/reason_pprint_ast.ml b/src/reason-parser/reason_pprint_ast.ml index b0880d702..5d7d005ef 100644 --- a/src/reason-parser/reason_pprint_ast.ml +++ b/src/reason-parser/reason_pprint_ast.ml @@ -1033,7 +1033,7 @@ let makeList let config = { Layout. listConfigIfCommentsInterleaved; listConfigIfEolCommentsInterleaved; - break; wrap; inline; sep; indent; sepLeft; preSpace; postSpace; pad; + break = if lst = [] then Layout.IfNeed else break; wrap; inline; sep; indent; sepLeft; preSpace; postSpace; pad; } in Layout.Sequence (config, lst) @@ -2942,7 +2942,7 @@ let printer = object(self:'self) | (Ptype_variant lst, scope, None) -> [ privatize scope [makeList - ~break:(if lst == [] then IfNeed else Always_rec) + ~break:Always_rec ~postSpace:true ~inline:(true, true) (self#type_variant_list lst)] @@ -5060,7 +5060,7 @@ let printer = object(self:'self) | { pmod_desc = Pmod_functor(fp, me2) } -> let firstOne = match fp with - | Unit -> atom "()" + | Unit -> atom "" | Named (s, mt') -> let s = moduleIdent s in self#module_type (makeList [atom s; atom ":"]) mt' @@ -7541,7 +7541,12 @@ let printer = object(self:'self) in formatPrecedence (self#module_type letPattern mt) | Pmod_structure s -> - let wrap = if hug then ("({", "})") else ("{", "}") in + let wrap = if hug then + if s = [] then + ("(", ")") + else + ("({", "})") + else ("{", "}") in let items = groupAndPrint ~xf:self#structure_item @@ -7558,7 +7563,7 @@ let printer = object(self:'self) items | _ -> (* For example, functor application will be wrapped. *) - formatPrecedence (self#module_expr x) + formatPrecedence ~wrap:("", "") (self#module_expr x) method module_expr x = match x.pmod_desc with diff --git a/test/extensions.t/run.t b/test/extensions.t/run.t index 2dc98766b..459bfe2e4 100644 --- a/test/extensions.t/run.t +++ b/test/extensions.t/run.t @@ -4,9 +4,7 @@ Format extensions [%extend open M]; - [%extend - module M = {} - ]; + [%extend module M = {}]; [%extend module type M = {}]; diff --git a/test/modules.t/input.re b/test/modules.t/input.re index 1786ababd..cf46b48f6 100644 --- a/test/modules.t/input.re +++ b/test/modules.t/input.re @@ -487,4 +487,16 @@ module type Event = (module type of { include (Version2: (module type of Version2)); /* https://github.com/facebook/reason/issues/2608 */ -module Functor = (()): (module type of {}) => {}; +module Functor = (): (module type of {}) => {}; + +module Lola1 = () => { + let a = 3; +} + +module Lola2 = (C: Cat, D: Dog, L: Lion) => { + let a = 33; +} + +module L = Lola1(); + +module L2 = Lola2(Cat, Dog, Foo); \ No newline at end of file diff --git a/test/modules.t/run.t b/test/modules.t/run.t index 27c94f76d..a23b89346 100644 --- a/test/modules.t/run.t +++ b/test/modules.t/run.t @@ -324,12 +324,7 @@ Format modules ); module ResultFromNonSimpleFunctorArg = - CurriedNoSugar( - ( - MakeAModule({}) - ), - BMod, - ); + CurriedNoSugar(MakeAModule(), BMod); /* TODO: Functor type signatures should more resemble value signatures */ let curriedFunc: (int, int) => int = @@ -451,7 +446,7 @@ Format modules G: (Type) => Type, X: Type, ) => - F((G(X))); + F(G(X)); let l: Compose(List)(Maybe)(Char).t = [ Some('a'), ]; @@ -657,7 +652,17 @@ Format modules include (Version2: (module type of Version2)); /* https://github.com/facebook/reason/issues/2608 */ - module Functor = - (()) - : (module type of {}) => {}; + module Functor = () : (module type of {}) => {}; + + module Lola1 = () => { + let a = 3; + }; + + module Lola2 = (C: Cat, D: Dog, L: Lion) => { + let a = 33; + }; + + module L = Lola1(); + + module L2 = Lola2(Cat, Dog, Foo); /* From http://stackoverflow.com/questions/1986374/ higher-order-type-constructors-and-functors-in-ocaml */ diff --git a/test/modules_no_semi.t/run.t b/test/modules_no_semi.t/run.t index 6f5887008..91dc96c67 100644 --- a/test/modules_no_semi.t/run.t +++ b/test/modules_no_semi.t/run.t @@ -324,12 +324,7 @@ Format modules no semi ); module ResultFromNonSimpleFunctorArg = - CurriedNoSugar( - ( - MakeAModule({}) - ), - BMod, - ); + CurriedNoSugar(MakeAModule(), BMod); /* TODO: Functor type signatures should more resemble value signatures */ let curriedFunc: (int, int) => int = @@ -451,7 +446,7 @@ Format modules no semi G: (Type) => Type, X: Type, ) => - F((G(X))); + F(G(X)); let l: Compose(List)(Maybe)(Char).t = [ Some('a'), ]; From e1f2626d9059b93bc5c4b5a2ded39210ed706024 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Thu, 20 Apr 2023 14:20:18 -0700 Subject: [PATCH 20/20] fix: binary parser (#2713) * fix: binary parser * [ci skip] changelog entry --- HISTORY.md | 4 +++- src/refmt/printer_maker.ml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index f3437477a..d5b055021 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,7 +5,9 @@ - Fix missing patterns around contraint pattern (a pattern with a type annotation). - Fix top level extension printing - Remove the dependency on the `result` package, which isn't needed for OCaml - 4.03 and above (@anmonteiro) [2703](https://github.com/reasonml/reason/pull/2703) + 4.03 and above (@anmonteiro) [#2703](https://github.com/reasonml/reason/pull/2703) +- Fix the binary parser by converting to the internal AST version used by + Reason (@anmonteiro) [#2713](https://github.com/reasonml/reason/pull/2713) ## 3.8.2 diff --git a/src/refmt/printer_maker.ml b/src/refmt/printer_maker.ml index aba0b359c..b7eb108f5 100644 --- a/src/refmt/printer_maker.ml +++ b/src/refmt/printer_maker.ml @@ -47,10 +47,10 @@ let ocamlBinaryParser use_stdin filename = match Ast_io.from_channel chan with | Error _ -> assert false | Ok (_, Ast_io.Impl ((module Version), ast)) -> - let module Convert = Convert(Version)(OCaml_408) in + let module Convert = Convert(Version)(OCaml_411) in ((Obj.magic (Convert.copy_structure ast), []), true, false) | Ok (_, Ast_io.Intf ((module Version), ast)) -> - let module Convert = Convert(Version)(OCaml_408) in + let module Convert = Convert(Version)(OCaml_411) in ((Obj.magic (Convert.copy_signature ast), []), true, true) let reasonBinaryParser use_stdin filename =