├── .drone.yml ├── .gitignore ├── LICENSE ├── README.md ├── packages ├── aeio │ ├── aeio.0.1.0 │ │ ├── findlib │ │ └── opam │ └── aeio.0.2.0 │ │ ├── findlib │ │ └── opam ├── base-effects │ └── base-effects.base │ │ └── opam ├── batteries │ └── batteries.3.3.0+multicore │ │ └── opam ├── camlpdf │ └── camlpdf.2.2.1+multicore │ │ ├── files │ │ └── unsafe_string.patch │ │ └── opam ├── core_kernel │ └── core_kernel.v0.14.1+multicore │ │ └── opam ├── dot-merlin-reader │ └── dot-merlin-reader.3.4.1+multicore │ │ ├── files │ │ ├── 0001-Local_store-change-API.patch │ │ ├── 0002-Destruct-reorganize-ans-add-more-tests-1189.patch │ │ ├── 0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch │ │ ├── 0004-Use-avsm-setup-ocaml-v1-instead-of-1.0.1-1190.patch │ │ ├── 0005-Fix-Destruct-ill-typed-completions-1194.patch │ │ ├── 0006-multicore-initial-merlin_specific-copy.patch │ │ ├── 0007-multicore-initial-merlin_specific-import.patch │ │ ├── 0008-multicore-initial-parsing-copy.patch │ │ ├── 0009-multicore-initial-parsing-import.patch │ │ ├── 0010-multicore-initial-preprocess-copy.patch │ │ ├── 0011-multicore-initial-typing-copy.patch │ │ ├── 0012-multicore-initial-typing-import.patch │ │ ├── 0013-multicore-initial-util-copy.patch │ │ ├── 0014-multicore-differentiate-multicore-with-dune.patch │ │ ├── 0015-multicore-add-upstream-multicore-files.patch │ │ └── 0016-add-effect-syntax.patch │ │ └── opam ├── kcas │ ├── kcas.0.1.1 │ │ ├── findlib │ │ └── opam │ ├── kcas.0.1.2 │ │ ├── findlib │ │ └── opam │ ├── kcas.0.1.3 │ │ ├── findlib │ │ └── opam │ ├── kcas.0.1.4 │ │ ├── findlib │ │ └── opam │ └── kcas.0.1 │ │ ├── findlib │ │ └── opam ├── lablgl │ └── lablgl.1.06+multicore │ │ ├── files │ │ ├── META │ │ └── lablgl.install │ │ └── opam ├── lockfree │ ├── lockfree.0.1.1 │ │ ├── findlib │ │ └── opam │ ├── lockfree.0.1.2 │ │ ├── findlib │ │ └── opam │ └── lockfree.0.1.3 │ │ └── opam ├── merlin │ └── merlin.3.4.1+effects │ │ ├── files │ │ ├── 0001-Local_store-change-API.patch │ │ ├── 0002-Destruct-reorganize-ans-add-more-tests-1189.patch │ │ ├── 0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch │ │ ├── 0004-Use-avsm-setup-ocaml-v1-instead-of-1.0.1-1190.patch │ │ ├── 0005-Fix-Destruct-ill-typed-completions-1194.patch │ │ ├── 0006-multicore-initial-merlin_specific-copy.patch │ │ ├── 0007-multicore-initial-merlin_specific-import.patch │ │ ├── 0008-multicore-initial-parsing-copy.patch │ │ ├── 0009-multicore-initial-parsing-import.patch │ │ ├── 0010-multicore-initial-preprocess-copy.patch │ │ ├── 0011-multicore-initial-typing-copy.patch │ │ ├── 0012-multicore-initial-typing-import.patch │ │ ├── 0013-multicore-initial-util-copy.patch │ │ ├── 0014-multicore-differentiate-multicore-with-dune.patch │ │ ├── 0015-multicore-add-upstream-multicore-files.patch │ │ └── 0016-add-effect-syntax.patch │ │ └── opam ├── ocaml-lsp-server │ └── ocaml-lsp-server.1.4.0+effects │ │ └── opam ├── ocaml-migrate-parsetree-ocamlbuild │ └── ocaml-migrate-parsetree-ocamlbuild.1.0.10+multicore-1 │ │ └── opam ├── ocaml-migrate-parsetree │ ├── ocaml-migrate-parsetree.1.0.10+multicore-1 │ │ └── opam │ └── ocaml-migrate-parsetree.2.1.0+effect-syntax │ │ ├── files │ │ └── 0001-works-with-multicore.patch │ │ └── opam ├── ocaml-variants │ ├── ocaml-variants.4.02.2+multicore │ │ └── opam │ ├── ocaml-variants.4.04.2+multicore │ │ └── opam │ ├── ocaml-variants.4.06.1+multicore+trunk │ │ └── opam │ ├── ocaml-variants.4.06.1+multicore │ │ └── opam │ ├── ocaml-variants.4.10.0+multicore+musl+no-effect-syntax │ │ └── opam │ ├── ocaml-variants.4.10.0+multicore+musl+static+no-effect-syntax │ │ └── opam │ ├── ocaml-variants.4.10.0+multicore+musl+static │ │ └── opam │ ├── ocaml-variants.4.10.0+multicore+musl │ │ └── opam │ ├── ocaml-variants.4.10.0+multicore+no-effect-syntax │ │ └── opam │ ├── ocaml-variants.4.10.0+multicore │ │ └── opam │ ├── ocaml-variants.4.12.0+domains+effects │ │ └── opam │ └── ocaml-variants.4.12.0+domains │ │ └── opam ├── ppx_tools │ ├── ppx_tools.5.0+4.02.3+effects │ │ ├── findlib │ │ └── opam │ └── ppx_tools.5.1+4.06.0+multicore-1 │ │ └── opam ├── ppxlib │ └── ppxlib.0.22.0+effect-syntax │ │ ├── files │ │ └── 0001-compiles-with-multicore.patch │ │ └── opam ├── reagents │ ├── reagents.0.1.0 │ │ ├── findlib │ │ └── opam │ ├── reagents.0.1.1 │ │ ├── findlib │ │ └── opam │ └── reagents.0.3.0 │ │ ├── findlib │ │ └── opam └── ssl │ └── ssl.0.5.3+multicore │ ├── findlib │ └── opam └── repo /.drone.yml: -------------------------------------------------------------------------------- 1 | kind: pipeline 2 | name: 4.12.0+domains 3 | 4 | platform: 5 | os: linux 6 | arch: amd64 7 | 8 | steps: 9 | - name: 4.12.0+domains 10 | image: ocaml/opam:debian-10-ocaml-4.12-domains 11 | commands: 12 | - opam repo add --set-default . 13 | - eval $(opam env) 14 | - opam install -y dune domainslib 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.annot 2 | *.cmo 3 | *.cma 4 | *.cmi 5 | *.a 6 | *.o 7 | *.cmx 8 | *.cmxs 9 | *.cmxa 10 | 11 | # ocamlbuild working directory 12 | _build/ 13 | 14 | # ocamlbuild targets 15 | *.byte 16 | *.native 17 | 18 | # oasis generated files 19 | setup.data 20 | setup.log 21 | 22 | *~ 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 OCaml Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # multicore-opam package repository 2 | 3 | opam repo for OCaml multicore development. This repository contains all of the 4 | _additional_ packages with multicore OCaml support. It is designed to be an 5 | opam overlay above the [stable ocaml/opam-repository](https://github.com/ocaml/opam-repository). 6 | 7 | ## Install Multicore OCaml 8 | 9 | **`4.12+domains+effects`** 10 | 11 | This version includes support for domains and effect handlers. 12 | 13 | ``` 14 | opam update 15 | opam switch create 4.12.0+domains+effects --repositories=multicore=git+https://github.com/ocaml-multicore/multicore-opam.git,default 16 | ``` 17 | 18 | **`4.12+domains`** 19 | 20 | This version includes support for domains, but does not have the syntax extensions for supporting effect handlers. This plays nicely with the wider OCaml ecosystem, but you cannot use effect handlers. This is the version that is being fed upstream with the aim of becoming OCaml 5.0 21 | 22 | ``` 23 | opam update 24 | opam switch create 4.12.0+domains --repositories=multicore=git+https://github.com/ocaml-multicore/multicore-opam.git,default 25 | ``` 26 | 27 | ## Installing domainslib 28 | 29 | ``` 30 | opam install dune domainslib 31 | ``` 32 | 33 | ## Install ocaml-lsp and merlin 34 | 35 | On Visual Studio Code, it is recommended to use `ocaml-lsp-server` with [VSCode OCaml Platform](https://marketplace.visualstudio.com/items?itemName=ocamllabs.ocaml-platform) 36 | 37 | **`4.10.0+multicore`** 38 | 39 | ``` 40 | opam install dune merlin.3.4.1 dot-merlin-reader.3.4.1 ocaml-lsp-server 41 | ``` 42 | 43 | **`4.10.0+multicore+no-effect-syntax`** 44 | 45 | ``` 46 | opam install dune merlin.3.4.1 dot-merlin-reader.3.4.1 47 | opam pin add ocaml-lsp-server --repositories=default 48 | ``` 49 | **`4.12+domains` and `4.12+domains+effects`** 50 | 51 | ``` 52 | opam install dune merlin ocaml-lsp-server 53 | ``` 54 | 55 | ## Adding New Packages 56 | 57 | This repository should be a clean overlay over the core ocaml/opam-repository, but also ensuring that _every package in this repository is never selected outside of a multicore-aware compiler_. This ensures that the multicore repository can safely be added to an existing opam setup and not "contaminate" it with custom multicore patches unless the user explicitly opts in. 58 | 59 | The mechanism for this is simple. There are two virtual packages in this repository that you can depend on to ensure that the package is uninstallable outside of multicore: 60 | 61 | - `base-domains`: this is a feature package that indicates the existence of the `Domains` module in the compiler. 62 | - `base-effects`: this is a feature package that indicates the existence of the `effect` keyword (and functionality) in the compiler. 63 | 64 | If you do port a package to be multicore-compatible (e.g. with patches), then add it to this repository with a dependency on one of the two base packages above, and also rename its version to indicate a `+domains` or `+multicore` to disambiguate it from the upstream version. 65 | 66 | -------------------------------------------------------------------------------- /packages/aeio/aeio.0.1.0/findlib: -------------------------------------------------------------------------------- 1 | aeio 2 | -------------------------------------------------------------------------------- /packages/aeio/aeio.0.1.0/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/ocaml-aeio" 5 | doc: "https://kayceesrk.github.io/ocaml-aeio/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/ocaml-aeio.git" 8 | bug-reports: "https://github.com/kayceesrk/ocaml-aeio/issues" 9 | depends: [ 10 | "ocaml" {>= "4.02.2"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | "lwt" {= "2.5.1"} 15 | "base-domains" 16 | ] 17 | build: [ 18 | "ocaml" "pkg/pkg.ml" "build" 19 | "--pinned" pinned ] 20 | synopsis: "Asynchronous effect-based IO" 21 | description: """ 22 | aeio is TODO 23 | 24 | aeio is distributed under the ISC license.""" 25 | url { 26 | src: 27 | "https://github.com/kayceesrk/ocaml-aeio/releases/download/0.1.0/aeio-0.1.0.tbz" 28 | checksum: "md5=ffe20b39ba5b7f8f66e961863a300aa0" 29 | } 30 | -------------------------------------------------------------------------------- /packages/aeio/aeio.0.2.0/findlib: -------------------------------------------------------------------------------- 1 | aeio 2 | -------------------------------------------------------------------------------- /packages/aeio/aeio.0.2.0/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/ocaml-aeio" 5 | doc: "https://kayceesrk.github.io/ocaml-aeio/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/ocaml-aeio.git" 8 | bug-reports: "https://github.com/kayceesrk/ocaml-aeio/issues" 9 | depends: [ 10 | "ocaml" {>= "4.02.2"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | "lwt" {= "2.5.1"} 15 | "base-domains" 16 | ] 17 | build: [ 18 | "ocaml" "pkg/pkg.ml" "build" 19 | "--pinned" pinned ] 20 | synopsis: "Asynchronous effect-based IO" 21 | description: """ 22 | aeio is TODO 23 | 24 | aeio is distributed under the ISC license.""" 25 | url { 26 | src: 27 | "https://github.com/kayceesrk/ocaml-aeio/releases/download/0.2.0/aeio-0.2.0.tbz" 28 | checksum: "md5=190c38611e064041241d073574cf063d" 29 | } 30 | -------------------------------------------------------------------------------- /packages/base-effects/base-effects.base/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "https://github.com/ocaml-multicore/multicore-opam/issues" 3 | description: """ 4 | Effects-based variant distributed with the Multicore OCaml compiler" 5 | """ 6 | depends: [ 7 | "ocaml" {>= "4.12.0"} 8 | "ocaml-variants" { 9 | = "4.12.0+domains+effects" | 10 | = "4.10.0+multicore" | 11 | = "4.06.1+multicore" | 12 | = "4.04.2+multicore" | 13 | = "4.02.2+multicore" 14 | } 15 | "base-domains" 16 | ] 17 | -------------------------------------------------------------------------------- /packages/batteries/batteries.3.3.0+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "A community-maintained standard library extension" 3 | maintainer: [ 4 | "Cedric Cellier " 5 | "Francois Berenger " 6 | "Gabriel Scherer " 7 | "Thibault Suzanne " 8 | ] 9 | authors: "OCaml batteries-included team" 10 | homepage: "http://batteries.forge.ocamlcore.org/" 11 | bug-reports: "https://github.com/ocaml-batteries-team/batteries-included/issues" 12 | dev-repo: "git://github.com/ocaml-batteries-team/batteries-included.git" 13 | license: "LGPL-2.1-or-later with OCaml-LGPL-linking-exception" 14 | doc: "http://ocaml-batteries-team.github.io/batteries-included/hdoc2/" 15 | build: [ 16 | ["ocaml" "setup.ml" "-configure" "--prefix" prefix] 17 | [make "all"] 18 | ] 19 | install: [make "install"] 20 | depends: [ 21 | "ocaml" {>= "4.00.0" & < "4.13.0"} 22 | "ocamlfind" {build & >= "1.5.3"} 23 | "ocamlbuild" {build} 24 | "qtest" {with-test & >= "2.5"} 25 | "qcheck" {with-test & >= "0.6" & < "0.14"} 26 | "num" 27 | "base-domains" 28 | ] 29 | url { 30 | src: "https://github.com/kit-ty-kate/batteries-included/archive/500.tar.gz" 31 | } 32 | -------------------------------------------------------------------------------- /packages/camlpdf/camlpdf.2.2.1+multicore/files/unsafe_string.patch: -------------------------------------------------------------------------------- 1 | --- ../Makefile.orig 2018-04-21 20:13:49.022952632 +0200 2 | +++ ../Makefile 2018-04-21 20:14:10.727065199 +0200 3 | @@ -15,8 +15,8 @@ 4 | dllcamlpdf_stubs.* $(foreach x,$(PDFMODS),$x.mli) \ 5 | $(foreach x,$(PDFMODS),$x.cmi) $(foreach x,$(PDFMODS),$x.cmx) 6 | 7 | -OCAMLNCFLAGS = -g -annot -w -3 8 | -OCAMLBCFLAGS = -g -annot -w -3 9 | +OCAMLNCFLAGS = -g -annot -w -3 -unsafe-string 10 | +OCAMLBCFLAGS = -g -annot -w -3 -unsafe-string 11 | OCAMLLDFLAGS = -g 12 | 13 | all : native-code-library byte-code-library htdoc 14 | -------------------------------------------------------------------------------- /packages/camlpdf/camlpdf.2.2.1+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "contact@coherentgraphics.co.uk" 3 | authors: ["John Whitington"] 4 | homepage: "http://github.com/johnwhitington/camlpdf" 5 | bug-reports: "http://github.com/johnwhitington/camlpdf/issues" 6 | dev-repo: "git://github.com/johnwhitington/camlpdf" 7 | build: [[make]] 8 | install: [[make "install"]] 9 | remove: [["ocamlfind" "remove" "camlpdf"]] 10 | depends: [ 11 | "ocaml" 12 | "ocamlfind" 13 | "base-domains" 14 | ] 15 | patches: "unsafe_string.patch" {ocaml:version >= "4.06"} 16 | synopsis: "Read, write and modify PDF files" 17 | flags: light-uninstall 18 | extra-files: ["unsafe_string.patch" "md5=8db2be9fbd23c06a96cffca03af741b0"] 19 | url { 20 | src: "https://github.com/kayceesrk/camlpdf/archive/v2.2.1+multicore.tar.gz" 21 | checksum: "md5=e220f712f471b875664dfe663027c7e0" 22 | } 23 | -------------------------------------------------------------------------------- /packages/core_kernel/core_kernel.v0.14.1+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "opensource@janestreet.com" 3 | authors: ["Jane Street Group, LLC "] 4 | homepage: "https://github.com/janestreet/core_kernel" 5 | bug-reports: "https://github.com/janestreet/core_kernel/issues" 6 | dev-repo: "git+https://github.com/janestreet/core_kernel.git" 7 | doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/core_kernel/index.html" 8 | license: "MIT" 9 | build: [ 10 | ["dune" "build" "-p" name "-j" jobs] 11 | ] 12 | depends: [ 13 | "ocaml" {>= "4.08"} 14 | "base-domains" 15 | "base" {>= "v0.14" & < "v0.15"} 16 | "base_bigstring" {>= "v0.14" & < "v0.15"} 17 | "base_quickcheck" {>= "v0.14" & < "v0.15"} 18 | "bin_prot" {>= "v0.14" & < "v0.15"} 19 | "fieldslib" {>= "v0.14" & < "v0.15"} 20 | "jane-street-headers" {>= "v0.14" & < "v0.15"} 21 | "jst-config" {>= "v0.14" & < "v0.15"} 22 | "ppx_assert" {>= "v0.14" & < "v0.15"} 23 | "ppx_base" {>= "v0.14" & < "v0.15"} 24 | "ppx_hash" {>= "v0.14" & < "v0.15"} 25 | "ppx_inline_test" {>= "v0.14" & < "v0.15"} 26 | "ppx_jane" {>= "v0.14" & < "v0.15"} 27 | "ppx_sexp_conv" {>= "v0.14" & < "v0.15"} 28 | "ppx_sexp_message" {>= "v0.14" & < "v0.15"} 29 | "sexplib" {>= "v0.14" & < "v0.15"} 30 | "splittable_random" {>= "v0.14" & < "v0.15"} 31 | "stdio" {>= "v0.14" & < "v0.15"} 32 | "time_now" {>= "v0.14" & < "v0.15"} 33 | "typerep" {>= "v0.14" & < "v0.15"} 34 | "variantslib" {>= "v0.14" & < "v0.15"} 35 | "dune" {>= "2.0.0"} 36 | ] 37 | synopsis: "Industrial strength alternative to OCaml's standard library" 38 | description: " 39 | The Core suite of libraries is an industrial strength alternative to 40 | OCaml's standard library that was developed by Jane Street, the 41 | largest industrial user of OCaml. 42 | 43 | Core_kernel is the system-independent part of Core. 44 | " 45 | url { 46 | src: "https://github.com/kit-ty-kate/core_kernel/archive/multicore.tar.gz" 47 | } 48 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/files/0001-Local_store-change-API.patch: -------------------------------------------------------------------------------- 1 | From afc15c13118444b0affb027855c21664266db946 Mon Sep 17 00:00:00 2001 2 | From: Thomas Refis 3 | Date: Tue, 6 Oct 2020 15:37:11 +0200 4 | Subject: [PATCH 01/16] Local_store: change API 5 | 6 | Two kinds of global state: 7 | - tables (which are mutable): they need an explicit reset function 8 | - immutable values: which are snapshoted when we freeze the bindings 9 | --- 10 | src/utils/local_store.ml | 66 +++++++++++++++++++++------------------ 11 | src/utils/local_store.mli | 7 +++-- 12 | 2 files changed, 40 insertions(+), 33 deletions(-) 13 | 14 | diff --git a/src/utils/local_store.ml b/src/utils/local_store.ml 15 | index 3004b96e..c0b6ced2 100644 16 | --- a/src/utils/local_store.ml 17 | +++ b/src/utils/local_store.ml 18 | @@ -1,6 +1,7 @@ 19 | -open Std 20 | +type ref_and_reset = 21 | + | Table : { ref: 'a ref; init: unit -> 'a } -> ref_and_reset 22 | + | Immutable : { ref: 'a ref; mutable snapshot: 'a } -> ref_and_reset 23 | 24 | -type ref_and_reset = F : 'a ref * (unit -> 'a) -> ref_and_reset 25 | type bindings = { 26 | mutable refs: ref_and_reset list; 27 | mutable frozen : bool; 28 | @@ -14,45 +15,50 @@ let is_bound t = !(t.is_bound) 29 | 30 | let reset t = 31 | assert (is_bound t); 32 | - List.iter ~f:(fun (F (ref, initializer_)) -> ref := initializer_ ()) t.refs 33 | + List.iter (function 34 | + | Table { ref; init } -> ref := init () 35 | + | Immutable { ref; snapshot } -> ref := snapshot 36 | + ) t.refs 37 | 38 | -let ref t f = 39 | - let result = ref (f ()) in 40 | +let table t create size = 41 | + let init () = create size in 42 | + let ref = ref (init ()) in 43 | assert (not t.frozen); 44 | - t.refs <- (F (result, f)) :: t.refs; 45 | - result 46 | + t.refs <- (Table { ref; init }) :: t.refs; 47 | + ref 48 | 49 | -type 'a slot = { ref : 'a ref; mutable value : 'a } 50 | -type a_slot = Slot : 'a slot -> a_slot 51 | -type scope = { slots: a_slot list; scope_bound : bool ref } 52 | +let ref t k = 53 | + let ref = ref k in 54 | + assert (not t.frozen); 55 | + t.refs <- (Immutable { ref; snapshot = k }) :: t.refs; 56 | + ref 57 | + 58 | +type slot = Slot : { ref : 'a ref; mutable value : 'a } -> slot 59 | +type scope = { slots: slot list; scope_bound : bool ref } 60 | 61 | let fresh t = 62 | + let slots = 63 | + List.map (function 64 | + | Table { ref; init } -> Slot {ref; value = init ()} 65 | + | Immutable r -> 66 | + if not t.frozen then r.snapshot <- !(r.ref); 67 | + Slot { ref = r.ref; value = r.snapshot } 68 | + ) t.refs 69 | + in 70 | t.frozen <- true; 71 | - { slots = List.map ~f:(fun (F(ref,f)) -> Slot {ref; value = f ()}) t.refs; 72 | - scope_bound = t.is_bound } 73 | - 74 | -type ref_and_value = V : 'a ref * 'a -> ref_and_value 75 | -let restore l = List.iter ~f:(fun (V(r,v)) -> r := v) l 76 | + { slots; scope_bound = t.is_bound } 77 | 78 | let with_scope { slots; scope_bound } f = 79 | assert (not !scope_bound); 80 | scope_bound := true; 81 | - let backup = List.rev_map ~f:(fun (Slot {ref;_}) -> V (ref,!ref)) slots in 82 | - List.iter ~f:(fun (Slot {ref;value}) -> ref := value) slots; 83 | - match f () with 84 | - | x -> 85 | - List.iter ~f:(fun (Slot s) -> s.value <- !(s.ref)) slots; 86 | - scope_bound := false; 87 | - restore backup; 88 | - x 89 | - | exception exn -> 90 | - List.iter ~f:(fun (Slot s) -> s.value <- !(s.ref)) slots; 91 | - scope_bound := false; 92 | - restore backup; 93 | - reraise exn 94 | + List.iter (fun (Slot {ref;value}) -> ref := value) slots; 95 | + Fun.protect f ~finally:(fun () -> 96 | + List.iter (fun (Slot s) -> s.value <- !(s.ref)) slots; 97 | + scope_bound := false 98 | + ) 99 | 100 | module Compiler = struct 101 | let compiler_state = new_bindings () 102 | - let sref f = ref compiler_state f 103 | - let srefk k = ref compiler_state (fun () -> k) 104 | + let s_table f n = table compiler_state f n 105 | + let s_ref k = ref compiler_state k 106 | end 107 | diff --git a/src/utils/local_store.mli b/src/utils/local_store.mli 108 | index 79a539e3..bed1ad31 100644 109 | --- a/src/utils/local_store.mli 110 | +++ b/src/utils/local_store.mli 111 | @@ -5,7 +5,8 @@ val new_bindings : unit -> bindings 112 | val is_bound : bindings -> bool 113 | val reset : bindings -> unit 114 | 115 | -val ref : bindings -> (unit -> 'a) -> 'a ref 116 | +val table : bindings -> ('a -> 'b) -> 'a -> 'b ref 117 | +val ref : bindings -> 'a -> 'a ref 118 | 119 | type scope 120 | val fresh : bindings -> scope 121 | @@ -15,6 +16,6 @@ val with_scope : scope -> (unit -> 'a) -> 'a 122 | 123 | module Compiler : sig 124 | val compiler_state : bindings 125 | - val sref : (unit -> 'a) -> 'a ref 126 | - val srefk : 'a -> 'a ref 127 | + val s_ref : 'a -> 'a ref 128 | + val s_table : ('a -> 'b) -> 'a -> 'b ref 129 | end 130 | -- 131 | 2.29.2 132 | 133 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/files/0002-Destruct-reorganize-ans-add-more-tests-1189.patch: -------------------------------------------------------------------------------- 1 | From df4cc8d7d903dd215eff4c7aa6f45e535693cf1d Mon Sep 17 00:00:00 2001 2 | From: Ulysse <5031221+voodoos@users.noreply.github.com> 3 | Date: Thu, 15 Oct 2020 15:39:08 +0200 4 | Subject: [PATCH 02/16] Destruct: reorganize ans add more tests (#1189) 5 | 6 | --- 7 | tests/dune.inc | 58 +++- 8 | tests/test-dirs/destruct/basic.t | 148 ---------- 9 | tests/test-dirs/destruct/complete.t | 212 +++++++++++---- 10 | tests/test-dirs/destruct/create.t | 253 ++++++++++++++++++ 11 | tests/test-dirs/destruct/errors.t | 18 ++ 12 | ...{exceptions_pre_408.t => errors_pre_408.t} | 0 13 | ...eptions_since_408.t => errors_since_408.t} | 0 14 | tests/test-dirs/destruct/refine.t | 246 +++++++++++++++++ 15 | 8 files changed, 723 insertions(+), 212 deletions(-) 16 | delete mode 100644 tests/test-dirs/destruct/basic.t 17 | create mode 100644 tests/test-dirs/destruct/create.t 18 | create mode 100644 tests/test-dirs/destruct/errors.t 19 | rename tests/test-dirs/destruct/{exceptions_pre_408.t => errors_pre_408.t} (100%) 20 | rename tests/test-dirs/destruct/{exceptions_since_408.t => errors_since_408.t} (100%) 21 | create mode 100644 tests/test-dirs/destruct/refine.t 22 | 23 | diff --git a/tests/dune.inc b/tests/dune.inc 24 | index 1ac3f4d5..ca06a932 100644 25 | --- a/tests/dune.inc 26 | +++ b/tests/dune.inc 27 | @@ -221,9 +221,9 @@ 28 | (alias (name runtest) (deps (alias deprecation-run))) 29 | 30 | (alias 31 | - (name destruct-basic) 32 | + (name destruct-complete) 33 | (package merlin) 34 | - (deps (:t ./test-dirs/destruct/basic.t) 35 | + (deps (:t ./test-dirs/destruct/complete.t) 36 | (source_tree ./test-dirs/destruct) 37 | %{bin:ocamlmerlin} 38 | %{bin:ocamlmerlin-server} 39 | @@ -235,12 +235,12 @@ 40 | (progn 41 | (run %{bin:mdx} test --syntax=cram %{t}) 42 | (diff? %{t} %{t}.corrected))))))) 43 | -(alias (name runtest) (deps (alias destruct-basic))) 44 | +(alias (name runtest) (deps (alias destruct-complete))) 45 | 46 | (alias 47 | - (name destruct-complete) 48 | + (name destruct-create) 49 | (package merlin) 50 | - (deps (:t ./test-dirs/destruct/complete.t) 51 | + (deps (:t ./test-dirs/destruct/create.t) 52 | (source_tree ./test-dirs/destruct) 53 | %{bin:ocamlmerlin} 54 | %{bin:ocamlmerlin-server} 55 | @@ -252,12 +252,29 @@ 56 | (progn 57 | (run %{bin:mdx} test --syntax=cram %{t}) 58 | (diff? %{t} %{t}.corrected))))))) 59 | -(alias (name runtest) (deps (alias destruct-complete))) 60 | +(alias (name runtest) (deps (alias destruct-create))) 61 | + 62 | +(alias 63 | + (name destruct-errors) 64 | + (package merlin) 65 | + (deps (:t ./test-dirs/destruct/errors.t) 66 | + (source_tree ./test-dirs/destruct) 67 | + %{bin:ocamlmerlin} 68 | + %{bin:ocamlmerlin-server} 69 | + %{bin:dot-merlin-reader}) 70 | + (action 71 | + (chdir ./test-dirs/destruct 72 | + (setenv MERLIN %{exe:merlin-wrapper} 73 | + (setenv OCAMLC %{ocamlc} 74 | + (progn 75 | + (run %{bin:mdx} test --syntax=cram %{t}) 76 | + (diff? %{t} %{t}.corrected))))))) 77 | +(alias (name runtest) (deps (alias destruct-errors))) 78 | 79 | (alias 80 | - (name destruct-exceptions_pre_408)(enabled_if (< %{ocaml_version} 4.08.0)) 81 | + (name destruct-errors_pre_408)(enabled_if (< %{ocaml_version} 4.08.0)) 82 | (package merlin) 83 | - (deps (:t ./test-dirs/destruct/exceptions_pre_408.t) 84 | + (deps (:t ./test-dirs/destruct/errors_pre_408.t) 85 | (source_tree ./test-dirs/destruct) 86 | %{bin:ocamlmerlin} 87 | %{bin:ocamlmerlin-server} 88 | @@ -269,12 +286,12 @@ 89 | (progn 90 | (run %{bin:mdx} test --syntax=cram %{t}) 91 | (diff? %{t} %{t}.corrected))))))) 92 | -(alias (name runtest) (deps (alias destruct-exceptions_pre_408))) 93 | +(alias (name runtest) (deps (alias destruct-errors_pre_408))) 94 | 95 | (alias 96 | - (name destruct-exceptions_since_408)(enabled_if (>= %{ocaml_version} 4.08.0)) 97 | + (name destruct-errors_since_408)(enabled_if (>= %{ocaml_version} 4.08.0)) 98 | (package merlin) 99 | - (deps (:t ./test-dirs/destruct/exceptions_since_408.t) 100 | + (deps (:t ./test-dirs/destruct/errors_since_408.t) 101 | (source_tree ./test-dirs/destruct) 102 | %{bin:ocamlmerlin} 103 | %{bin:ocamlmerlin-server} 104 | @@ -286,7 +303,7 @@ 105 | (progn 106 | (run %{bin:mdx} test --syntax=cram %{t}) 107 | (diff? %{t} %{t}.corrected))))))) 108 | -(alias (name runtest) (deps (alias destruct-exceptions_since_408))) 109 | +(alias (name runtest) (deps (alias destruct-errors_since_408))) 110 | 111 | (alias 112 | (name destruct-from_val) 113 | @@ -322,6 +339,23 @@ 114 | (diff? %{t} %{t}.corrected))))))) 115 | (alias (name runtest) (deps (alias destruct-issue596))) 116 | 117 | +(alias 118 | + (name destruct-refine) 119 | + (package merlin) 120 | + (deps (:t ./test-dirs/destruct/refine.t) 121 | + (source_tree ./test-dirs/destruct) 122 | + %{bin:ocamlmerlin} 123 | + %{bin:ocamlmerlin-server} 124 | + %{bin:dot-merlin-reader}) 125 | + (action 126 | + (chdir ./test-dirs/destruct 127 | + (setenv MERLIN %{exe:merlin-wrapper} 128 | + (setenv OCAMLC %{ocamlc} 129 | + (progn 130 | + (run %{bin:mdx} test --syntax=cram %{t}) 131 | + (diff? %{t} %{t}.corrected))))))) 132 | +(alias (name runtest) (deps (alias destruct-refine))) 133 | + 134 | (alias 135 | (name errors-alerts-test-pre-408)(enabled_if (< %{ocaml_version} 4.08.0)) 136 | (package merlin) 137 | diff --git a/tests/test-dirs/destruct/basic.t b/tests/test-dirs/destruct/basic.t 138 | deleted file mode 100644 139 | index 8e2d2ad7..00000000 140 | --- a/tests/test-dirs/destruct/basic.t 141 | +++ /dev/null 142 | @@ -1,148 +0,0 @@ 143 | -TODO: test all error cases 144 | - 145 | - $ $MERLIN single case-analysis -start 4:9 -end 4:11 -filename nothing_to_do.ml < let _ = \ 147 | - > match (None : unit option) with \ 148 | - > | None -> () \ 149 | - > | Some () -> () \ 150 | - > EOF 151 | - { 152 | - "class": "error", 153 | - "value": "Nothing to do", 154 | - "notifications": [] 155 | - } 156 | - 157 | - 158 | - $ $MERLIN single case-analysis -start 3:4 -end 3:8 -filename make_exhaustive.ml < let _ = \ 160 | - > match (None : unit option) with \ 161 | - > | None -> () \ 162 | - > EOF 163 | - { 164 | - "class": "return", 165 | - "value": [ 166 | - { 167 | - "start": { 168 | - "line": 3, 169 | - "col": 14 170 | - }, 171 | - "end": { 172 | - "line": 3, 173 | - "col": 14 174 | - } 175 | - }, 176 | - " 177 | - | Some _ -> (??)" 178 | - ], 179 | - "notifications": [] 180 | - } 181 | - 182 | - $ $MERLIN single case-analysis -start 4:9 -end 4:10 -filename refine_pattern.ml < let _ = \ 184 | - > match (None : unit option) with \ 185 | - > | None -> () \ 186 | - > | Some _ -> () \ 187 | - > EOF 188 | - { 189 | - "class": "return", 190 | - "value": [ 191 | - { 192 | - "start": { 193 | - "line": 4, 194 | - "col": 9 195 | - }, 196 | - "end": { 197 | - "line": 4, 198 | - "col": 10 199 | - } 200 | - }, 201 | - "()" 202 | - ], 203 | - "notifications": [] 204 | - } 205 | - 206 | - $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename unpack_module.ml < module type S = sig end \ 208 | - > \ 209 | - > let g (x : (module S)) = \ 210 | - > x \ 211 | - > EOF 212 | - { 213 | - "class": "return", 214 | - "value": [ 215 | - { 216 | - "start": { 217 | - "line": 4, 218 | - "col": 2 219 | - }, 220 | - "end": { 221 | - "line": 4, 222 | - "col": 3 223 | - } 224 | - }, 225 | - "let module M = (val x) in (??)" 226 | - ], 227 | - "notifications": [] 228 | - } 229 | - 230 | - $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename record_exp.ml < let f (x : int ref) = \ 232 | - > x \ 233 | - > EOF 234 | - { 235 | - "class": "return", 236 | - "value": [ 237 | - { 238 | - "start": { 239 | - "line": 2, 240 | - "col": 2 241 | - }, 242 | - "end": { 243 | - "line": 2, 244 | - "col": 3 245 | - } 246 | - }, 247 | - "match x with | { contents } -> (??)" 248 | - ], 249 | - "notifications": [] 250 | - } 251 | - 252 | -FIXME: put each case on a different line (if it doesn't require updating 253 | -pprintast). 254 | - 255 | - $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename variant_exp.ml < let f (x : int option) = \ 257 | - > x \ 258 | - > EOF 259 | - { 260 | - "class": "return", 261 | - "value": [ 262 | - { 263 | - "start": { 264 | - "line": 2, 265 | - "col": 2 266 | - }, 267 | - "end": { 268 | - "line": 2, 269 | - "col": 3 270 | - } 271 | - }, 272 | - "match x with | None -> (??) | Some _ -> (??)" 273 | - ], 274 | - "notifications": [] 275 | - } 276 | - 277 | - $ echo "let () = ()" | $MERLIN single case-analysis -start 1:4 -end 1:4 -filename stacktrace.ml | grep -E -v "Raised|Called|Re-raised" 278 | - { 279 | - "class": "error", 280 | - "value": "Destruct not allowed on value_binding", 281 | - "notifications": [] 282 | - } 283 | - 284 | - $ $MERLIN single case-analysis -start 4:2 -end 4:1 -filename nonode.ml < let f (x : int option) = \ 286 | - > match w with \ 287 | - > | _ -> () \ 288 | - > EOF 289 | - "class": "exception", 290 | - "value": "Query_commands.No_nodes 291 | diff --git a/tests/test-dirs/destruct/complete.t b/tests/test-dirs/destruct/complete.t 292 | index ab78f375..e3e211c9 100644 293 | --- a/tests/test-dirs/destruct/complete.t 294 | +++ b/tests/test-dirs/destruct/complete.t 295 | @@ -1,3 +1,95 @@ 296 | +############### 297 | +## SUM TYPES ## 298 | +############### 299 | + 300 | +Test 1.1 : FIXME (void type no Some) 301 | + 302 | + $ cat >typ5.ml < type void = | \ 304 | + > let f (x : void option) = \ 305 | + > match x with \ 306 | + > | None -> () \ 307 | + > EOF 308 | + 309 | + $ $MERLIN single case-analysis -start 4:4 -end 4:4 -filename typ5.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 311 | + { 312 | + "class": "return", 313 | + "value": [ 314 | + { 315 | + "start": { 316 | + "line": 4, 317 | + "col": 14 318 | + }, 319 | + "end": { 320 | + "line": 4, 321 | + "col": 14 322 | + } 323 | + }, 324 | + "|Some _ -> (??)" 325 | + ], 326 | + "notifications": [] 327 | + } 328 | + 329 | +Test 1.2 : FIXME ? 330 | + 331 | + $ cat >typ12.ml < let _ = \ 333 | + > match (None : int option option) with \ 334 | + > | Some (Some 3) -> () \ 335 | + > EOF 336 | + 337 | + $ $MERLIN single case-analysis -start 3:4 -end 3:8 -filename typ12.ml < typ12.ml \ 338 | + > sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 339 | + { 340 | + "class": "return", 341 | + "value": [ 342 | + { 343 | + "start": { 344 | + "line": 3, 345 | + "col": 23 346 | + }, 347 | + "end": { 348 | + "line": 3, 349 | + "col": 23 350 | + } 351 | + }, 352 | + "|Some (Some 0)|Some (None)|None -> (??)" 353 | + ], 354 | + "notifications": [] 355 | + } 356 | + 357 | +Test 1.3 : with type constructor 358 | + 359 | + $ $MERLIN single case-analysis -start 3:5 -end 3:5 -filename funny.ml < type funny = int option -> unit \ 361 | + > let v : funny = function \ 362 | + > | None -> () \ 363 | + > EOF 364 | + { 365 | + "class": "return", 366 | + "value": [ 367 | + { 368 | + "start": { 369 | + "line": 3, 370 | + "col": 14 371 | + }, 372 | + "end": { 373 | + "line": 3, 374 | + "col": 14 375 | + } 376 | + }, 377 | + " 378 | + | Some _ -> (??)" 379 | + ], 380 | + "notifications": [] 381 | + } 382 | + 383 | +############# 384 | +## RECORDS ## 385 | +############# 386 | + 387 | +Test 2.1 388 | 389 | $ cat >typ.ml < type a = A | B of string \ 391 | @@ -27,95 +119,106 @@ 392 | "notifications": [] 393 | } 394 | 395 | - $ cat >typ2.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 397 | - > let f (x : basic_color) = \ 398 | - > match x with \ 399 | - > | \`Blue -> () \ 400 | +Test 2.2 : FIXME ? 401 | + 402 | + $ cat >typ3.ml < type a = A | B of string \ 404 | + > type recd = { a : a } \ 405 | + > let f (x : recd) = \ 406 | + > match x with \ 407 | + > | { a = A } -> () \ 408 | + > | { a = B _ } -> () \ 409 | > EOF 410 | 411 | - $ $MERLIN single case-analysis -start 4:5 -end 4:5 -filename typ2.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 414 | { 415 | "class": "return", 416 | "value": [ 417 | { 418 | "start": { 419 | - "line": 4, 420 | - "col": 15 421 | + "line": 6, 422 | + "col": 4 423 | }, 424 | "end": { 425 | - "line": 4, 426 | + "line": 6, 427 | "col": 15 428 | } 429 | }, 430 | - "|`Yellow|`Red -> (??)" 431 | + "{ a = B \"\" }|{ a = B _ }" 432 | ], 433 | "notifications": [] 434 | } 435 | 436 | -FIXME ? 437 | +########################## 438 | +## POLYMORPHIC VARIANTS ## 439 | +########################## 440 | 441 | +Test 3.1 442 | 443 | - $ cat >typ3.ml < type a = A | B of string \ 445 | - > type recd = { a : a } \ 446 | - > let f (x : recd) = \ 447 | - > match x with \ 448 | - > | { a = A } -> () \ 449 | - > | { a = B _ } -> () \ 450 | + $ cat >typ2.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 452 | + > let f (x : basic_color) = \ 453 | + > match x with \ 454 | + > | \`Blue -> () \ 455 | > EOF 456 | 457 | - $ $MERLIN single case-analysis -start 6:12 -end 6:12 -filename typ3.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 460 | { 461 | "class": "return", 462 | "value": [ 463 | { 464 | "start": { 465 | - "line": 6, 466 | - "col": 4 467 | + "line": 4, 468 | + "col": 15 469 | }, 470 | "end": { 471 | - "line": 6, 472 | + "line": 4, 473 | "col": 15 474 | } 475 | }, 476 | - "{ a = B \"\" }|{ a = B _ }" 477 | + "|`Yellow|`Red -> (??)" 478 | ], 479 | "notifications": [] 480 | } 481 | 482 | - $ cat >typ4.ml < type b = C | D of string \ 484 | - > type a = A | B of b \ 485 | - > type recd = { a : a } \ 486 | - > let f (x : recd) = \ 487 | - > match x with \ 488 | - > | { a = A } -> () \ 489 | - > | { a = B _ } -> () \ 490 | +Test 3.1 491 | + 492 | + $ cat >typv3.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 494 | + > type better_color = [ basic_color | \`Gold ] \ 495 | + > let f (x : better_color) = \ 496 | + > match x with \ 497 | + > | #basic_color -> () \ 498 | > EOF 499 | 500 | - $ $MERLIN single case-analysis -start 7:12 -end 7:12 -filename typ4.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 503 | { 504 | "class": "return", 505 | "value": [ 506 | { 507 | "start": { 508 | - "line": 7, 509 | - "col": 4 510 | + "line": 5, 511 | + "col": 22 512 | }, 513 | "end": { 514 | - "line": 7, 515 | - "col": 15 516 | + "line": 5, 517 | + "col": 22 518 | } 519 | }, 520 | - "{ a = B (C) }|{ a = B (D _) }" 521 | + "|`Gold -> (??)" 522 | ], 523 | "notifications": [] 524 | } 525 | 526 | +########## 527 | +## GADT ## 528 | +########## 529 | + 530 | +Test 4.1 531 | + 532 | $ cat >typ3.ml < type _ term = \ 534 | > | Int : int -> int term \ 535 | @@ -147,6 +250,8 @@ FIXME ? 536 | "notifications": [] 537 | } 538 | 539 | +Test 4.2 540 | + 541 | $ cat >typ4.ml < type _ term = \ 543 | > | Int : int -> int term \ 544 | @@ -178,7 +283,7 @@ FIXME ? 545 | "notifications": [] 546 | } 547 | 548 | -FIXME 549 | +Test 4.3 : FIXME this match IS exhaustive 550 | 551 | $ cat >typ4b.ml < type _ t = \ 553 | @@ -209,31 +314,34 @@ FIXME 554 | "notifications": [] 555 | } 556 | 557 | -FIXME 558 | +############ 559 | +## MODULE ## 560 | +############ 561 | 562 | - $ cat >typ5.ml < type void = | \ 564 | - > let f (x : void option) = \ 565 | - > match x with \ 566 | - > | None -> () \ 567 | - > EOF 568 | +Test 5.1 : Module path 569 | 570 | - $ $MERLIN single case-analysis -start 4:4 -end 4:4 -filename typ5.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 572 | + $ $MERLIN single case-analysis -start 5:4 -end 5:4 -filename module_path.ml < module T = struct type t = A | B of int end \ 574 | + > \ 575 | + > let g x = \ 576 | + > match x with \ 577 | + > | T.A -> () \ 578 | + > EOF 579 | { 580 | "class": "return", 581 | "value": [ 582 | { 583 | "start": { 584 | - "line": 4, 585 | - "col": 14 586 | + "line": 5, 587 | + "col": 13 588 | }, 589 | "end": { 590 | - "line": 4, 591 | - "col": 14 592 | + "line": 5, 593 | + "col": 13 594 | } 595 | }, 596 | - "|Some _ -> (??)" 597 | + " 598 | + | T.B _ -> (??)" 599 | ], 600 | "notifications": [] 601 | } 602 | diff --git a/tests/test-dirs/destruct/create.t b/tests/test-dirs/destruct/create.t 603 | new file mode 100644 604 | index 00000000..62091cd7 605 | --- /dev/null 606 | +++ b/tests/test-dirs/destruct/create.t 607 | @@ -0,0 +1,253 @@ 608 | +############### 609 | +## SUM TYPES ## 610 | +############### 611 | + 612 | +Test 1.1 : FIXME: put each case on a different line (if it doesn't require updating 613 | +pprintast). 614 | + 615 | + $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename variant_exp.ml < let f (x : int option) = \ 617 | + > x \ 618 | + > EOF 619 | + { 620 | + "class": "return", 621 | + "value": [ 622 | + { 623 | + "start": { 624 | + "line": 2, 625 | + "col": 2 626 | + }, 627 | + "end": { 628 | + "line": 2, 629 | + "col": 3 630 | + } 631 | + }, 632 | + "match x with | None -> (??) | Some _ -> (??)" 633 | + ], 634 | + "notifications": [] 635 | + } 636 | + 637 | +############# 638 | +## RECORDS ## 639 | +############# 640 | + 641 | +Test 2.1 642 | + 643 | + $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename record_exp.ml < let f (x : int ref) = \ 645 | + > x \ 646 | + > EOF 647 | + { 648 | + "class": "return", 649 | + "value": [ 650 | + { 651 | + "start": { 652 | + "line": 2, 653 | + "col": 2 654 | + }, 655 | + "end": { 656 | + "line": 2, 657 | + "col": 3 658 | + } 659 | + }, 660 | + "match x with | { contents } -> (??)" 661 | + ], 662 | + "notifications": [] 663 | + } 664 | + 665 | +########################## 666 | +## POLYMORPHIC VARIANTS ## 667 | +########################## 668 | + 669 | +Test 3.1 670 | + 671 | + $ cat >typv2.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 673 | + > let f (x : basic_color) = \ 674 | + > x \ 675 | + > EOF 676 | + 677 | + $ $MERLIN single case-analysis -start 3:2 -end 3:2 -filename typv2.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 679 | + { 680 | + "class": "return", 681 | + "value": [ 682 | + { 683 | + "start": { 684 | + "line": 3, 685 | + "col": 2 686 | + }, 687 | + "end": { 688 | + "line": 3, 689 | + "col": 3 690 | + } 691 | + }, 692 | + "match x with|`Blue -> (??)|`Yellow -> (??)|`Red -> (??)" 693 | + ], 694 | + "notifications": [] 695 | + } 696 | + 697 | +Test 3.1 698 | + 699 | + $ cat >typv3.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 701 | + > type better_color = [ basic_color | \`Gold ] \ 702 | + > let f (x : better_color) = \ 703 | + > x \ 704 | + > EOF 705 | + 706 | + $ $MERLIN single case-analysis -start 4:2 -end 4:2 -filename typv3.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 708 | + { 709 | + "class": "return", 710 | + "value": [ 711 | + { 712 | + "start": { 713 | + "line": 4, 714 | + "col": 2 715 | + }, 716 | + "end": { 717 | + "line": 4, 718 | + "col": 3 719 | + } 720 | + }, 721 | + "match x with|`Blue -> (??)|`Yellow -> (??)|`Red -> (??)|`Gold -> (??)" 722 | + ], 723 | + "notifications": [] 724 | + } 725 | + 726 | +########## 727 | +## GADT ## 728 | +########## 729 | + 730 | +Test 4.1 731 | + 732 | + $ cat >typ4b.ml < type _ t = \ 734 | + > | I : int -> int t \ 735 | + > | B : bool t \ 736 | + > let f (x : int t) : unit = \ 737 | + > x \ 738 | + > EOF 739 | + 740 | + $ $MERLIN single case-analysis -start 5:2 -end 5:2 -filename typ4b.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 742 | + { 743 | + "class": "return", 744 | + "value": [ 745 | + { 746 | + "start": { 747 | + "line": 5, 748 | + "col": 2 749 | + }, 750 | + "end": { 751 | + "line": 5, 752 | + "col": 3 753 | + } 754 | + }, 755 | + "(match x with|I _ -> (??))" 756 | + ], 757 | + "notifications": [] 758 | + } 759 | + 760 | +Test 4.2 761 | + 762 | + $ cat >typ4.ml < type _ term = \ 764 | + > | Int : int -> int term \ 765 | + > | Add : (int -> int -> int) term \ 766 | + > | App : ('b -> 'a) term * 'b term -> 'a term \ 767 | + > let eval : type a. a term -> a term = fun x -> \ 768 | + > x \ 769 | + > EOF 770 | + 771 | + $ $MERLIN single case-analysis -start 6:2 -end 6:2 -filename typ4.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 773 | + { 774 | + "class": "return", 775 | + "value": [ 776 | + { 777 | + "start": { 778 | + "line": 6, 779 | + "col": 2 780 | + }, 781 | + "end": { 782 | + "line": 6, 783 | + "col": 3 784 | + } 785 | + }, 786 | + "match x with|Int _ -> (??)|Add -> (??)|App (_,_) -> (??)" 787 | + ], 788 | + "notifications": [] 789 | + } 790 | + 791 | +############ 792 | +## MODULE ## 793 | +############ 794 | + 795 | +Test 5.1 796 | + 797 | + $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename unpack_module.ml < module type S = sig end \ 799 | + > \ 800 | + > let g (x : (module S)) = \ 801 | + > x \ 802 | + > EOF 803 | + { 804 | + "class": "return", 805 | + "value": [ 806 | + { 807 | + "start": { 808 | + "line": 4, 809 | + "col": 2 810 | + }, 811 | + "end": { 812 | + "line": 4, 813 | + "col": 3 814 | + } 815 | + }, 816 | + "let module M = (val x) in (??)" 817 | + ], 818 | + "notifications": [] 819 | + } 820 | + 821 | +Test 5.2 : Module path 822 | + 823 | + $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename module_path.ml < module T = struct type t = A | B of int end \ 825 | + > \ 826 | + > let g (x : T.t) = \ 827 | + > x \ 828 | + > EOF 829 | + { 830 | + "class": "return", 831 | + "value": [ 832 | + { 833 | + "start": { 834 | + "line": 4, 835 | + "col": 2 836 | + }, 837 | + "end": { 838 | + "line": 4, 839 | + "col": 3 840 | + } 841 | + }, 842 | + "match x with | T.A -> (??) | T.B _ -> (??)" 843 | + ], 844 | + "notifications": [] 845 | + } 846 | + 847 | +test 5.3 : Abstract type 848 | + 849 | + 850 | + $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename module_path.ml < module T : sig type t end = struct type t = A | B of int end \ 852 | + > \ 853 | + > let g (x : T.t) = \ 854 | + > x \ 855 | + > EOF 856 | + { 857 | + "class": "error", 858 | + "value": "Destruct not allowed on non-destructible type: t", 859 | + "notifications": [] 860 | + } 861 | diff --git a/tests/test-dirs/destruct/errors.t b/tests/test-dirs/destruct/errors.t 862 | new file mode 100644 863 | index 00000000..5aabc544 864 | --- /dev/null 865 | +++ b/tests/test-dirs/destruct/errors.t 866 | @@ -0,0 +1,18 @@ 867 | +Test 1 868 | + 869 | + $ echo "let () = ()" | $MERLIN single case-analysis -start 1:4 -end 1:4 -filename stacktrace.ml | grep -E -v "Raised|Called|Re-raised" 870 | + { 871 | + "class": "error", 872 | + "value": "Destruct not allowed on value_binding", 873 | + "notifications": [] 874 | + } 875 | + 876 | +Test 2 877 | + 878 | + $ $MERLIN single case-analysis -start 4:2 -end 4:1 -filename nonode.ml < let f (x : int option) = \ 880 | + > match w with \ 881 | + > | _ -> () \ 882 | + > EOF 883 | + "class": "exception", 884 | + "value": "Query_commands.No_nodes 885 | diff --git a/tests/test-dirs/destruct/exceptions_pre_408.t b/tests/test-dirs/destruct/errors_pre_408.t 886 | similarity index 100% 887 | rename from tests/test-dirs/destruct/exceptions_pre_408.t 888 | rename to tests/test-dirs/destruct/errors_pre_408.t 889 | diff --git a/tests/test-dirs/destruct/exceptions_since_408.t b/tests/test-dirs/destruct/errors_since_408.t 890 | similarity index 100% 891 | rename from tests/test-dirs/destruct/exceptions_since_408.t 892 | rename to tests/test-dirs/destruct/errors_since_408.t 893 | diff --git a/tests/test-dirs/destruct/refine.t b/tests/test-dirs/destruct/refine.t 894 | new file mode 100644 895 | index 00000000..a1dcfdfd 896 | --- /dev/null 897 | +++ b/tests/test-dirs/destruct/refine.t 898 | @@ -0,0 +1,246 @@ 899 | +############### 900 | +## SUM TYPES ## 901 | +############### 902 | + 903 | +Test 1.1 : option refine 904 | + 905 | + $ $MERLIN single case-analysis -start 4:9 -end 4:10 -filename refine_pattern.ml < let _ = \ 907 | + > match (None : unit option) with \ 908 | + > | None -> () \ 909 | + > | Some _ -> () \ 910 | + > EOF 911 | + { 912 | + "class": "return", 913 | + "value": [ 914 | + { 915 | + "start": { 916 | + "line": 4, 917 | + "col": 9 918 | + }, 919 | + "end": { 920 | + "line": 4, 921 | + "col": 10 922 | + } 923 | + }, 924 | + "()" 925 | + ], 926 | + "notifications": [] 927 | + } 928 | + 929 | +Test 1.2 : option refine 930 | + 931 | + $ cat >typ12.ml < type t = A | B of int \ 933 | + > let _ = \ 934 | + > match (None : t option) with \ 935 | + > | None -> () \ 936 | + > | Some _ -> () \ 937 | + > EOF 938 | + 939 | + $ $MERLIN single case-analysis -start 5:9 -end 5:10 -filename typ12.ml < typ12.ml \ 940 | + > sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 941 | + { 942 | + "class": "return", 943 | + "value": [ 944 | + { 945 | + "start": { 946 | + "line": 5, 947 | + "col": 4 948 | + }, 949 | + "end": { 950 | + "line": 5, 951 | + "col": 10 952 | + } 953 | + }, 954 | + "Some (A)|Some (B _)" 955 | + ], 956 | + "notifications": [] 957 | + } 958 | + 959 | +Test 1.3 : FIXME ? int option 960 | + 961 | + $ cat >typ13.ml < let _ = \ 963 | + > match (None : int option) with \ 964 | + > | None -> () \ 965 | + > | Some _ -> () \ 966 | + > EOF 967 | + 968 | + $ $MERLIN single case-analysis -start 4:9 -end 4:10 -filename typ13.ml < typ13.ml \ 969 | + > sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 970 | + { 971 | + "class": "return", 972 | + "value": [ 973 | + { 974 | + "start": { 975 | + "line": 4, 976 | + "col": 4 977 | + }, 978 | + "end": { 979 | + "line": 4, 980 | + "col": 10 981 | + } 982 | + }, 983 | + "Some 0|Some _" 984 | + ], 985 | + "notifications": [] 986 | + } 987 | + 988 | +############# 989 | +## RECORDS ## 990 | +############# 991 | + 992 | +Test 2.1 993 | + 994 | + $ cat >typ4.ml < type b = C | D of string \ 996 | + > type a = A | B of b \ 997 | + > type recd = { a : a } \ 998 | + > let f (x : recd) = \ 999 | + > match x with \ 1000 | + > | { a = A } -> () \ 1001 | + > | { a = B _ } -> () \ 1002 | + > EOF 1003 | + 1004 | + $ $MERLIN single case-analysis -start 7:12 -end 7:12 -filename typ4.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1006 | + { 1007 | + "class": "return", 1008 | + "value": [ 1009 | + { 1010 | + "start": { 1011 | + "line": 7, 1012 | + "col": 4 1013 | + }, 1014 | + "end": { 1015 | + "line": 7, 1016 | + "col": 15 1017 | + } 1018 | + }, 1019 | + "{ a = B (C) }|{ a = B (D _) }" 1020 | + ], 1021 | + "notifications": [] 1022 | + } 1023 | + 1024 | +########################## 1025 | +## POLYMORPHIC VARIANTS ## 1026 | +########################## 1027 | + 1028 | +Test 3.1 1029 | + 1030 | + $ cat >typ2.ml < type blues = [ \`Cyan | \`Methyl ] \ 1032 | + > type basic_color = [ \`Blue of blues ] \ 1033 | + > let f (x : basic_color) = \ 1034 | + > match x with \ 1035 | + > | \`Blue _ -> () \ 1036 | + > EOF 1037 | + 1038 | + $ $MERLIN single case-analysis -start 5:11 -end 5:11 -filename typ2.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1040 | + { 1041 | + "class": "return", 1042 | + "value": [ 1043 | + { 1044 | + "start": { 1045 | + "line": 5, 1046 | + "col": 4 1047 | + }, 1048 | + "end": { 1049 | + "line": 5, 1050 | + "col": 11 1051 | + } 1052 | + }, 1053 | + "`Blue `Methyl|`Blue `Cyan" 1054 | + ], 1055 | + "notifications": [] 1056 | + } 1057 | + 1058 | +########## 1059 | +## GADT ## 1060 | +########## 1061 | + 1062 | +Test 4.1 : Fixme: missing space and () 1063 | + 1064 | + $ cat >typ3.ml < type _ sub_t = \ 1066 | + > | A : int -> int sub_t \ 1067 | + > | B : int -> float sub_t \ 1068 | + > type _ term = \ 1069 | + > | Int : int sub_t -> int term \ 1070 | + > let eval : type a. a term -> a term = \ 1071 | + > fun x : a term -> match x with \ 1072 | + > | Int _ -> () \ 1073 | + > EOF 1074 | + 1075 | + $ $MERLIN single case-analysis -start 8:8 -end 8:8 -filename typ3.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1077 | + { 1078 | + "class": "return", 1079 | + "value": [ 1080 | + { 1081 | + "start": { 1082 | + "line": 8, 1083 | + "col": 8 1084 | + }, 1085 | + "end": { 1086 | + "line": 8, 1087 | + "col": 9 1088 | + } 1089 | + }, 1090 | + "A_" 1091 | + ], 1092 | + "notifications": [] 1093 | + } 1094 | + 1095 | +Test 4.2 1096 | + 1097 | + $ cat >typ3b.ml < type _ sub_t = \ 1099 | + > | A : int -> int sub_t \ 1100 | + > | B : int -> int sub_t \ 1101 | + > type _ term = \ 1102 | + > | Int : int sub_t -> int term \ 1103 | + > let eval : type a. a term -> a term = \ 1104 | + > fun x : a term -> match x with \ 1105 | + > | Int _ -> () \ 1106 | + > EOF 1107 | + 1108 | + $ $MERLIN single case-analysis -start 8:8 -end 8:8 -filename typ3b.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1110 | + { 1111 | + "class": "return", 1112 | + "value": [ 1113 | + { 1114 | + "start": { 1115 | + "line": 8, 1116 | + "col": 4 1117 | + }, 1118 | + "end": { 1119 | + "line": 8, 1120 | + "col": 9 1121 | + } 1122 | + }, 1123 | + "Int (A _)|Int (B _)" 1124 | + ], 1125 | + "notifications": [] 1126 | + } 1127 | + 1128 | +############ 1129 | +## ERRORS ## 1130 | +############ 1131 | + 1132 | +Test 5.1 : Nothing to do 1133 | + 1134 | + $ $MERLIN single case-analysis -start 4:9 -end 4:11 -filename nothing_to_do.ml < let _ = \ 1136 | + > match (None : unit option) with \ 1137 | + > | None -> () \ 1138 | + > | Some () -> () \ 1139 | + > EOF 1140 | + { 1141 | + "class": "error", 1142 | + "value": "Nothing to do", 1143 | + "notifications": [] 1144 | + } 1145 | -- 1146 | 2.29.2 1147 | 1148 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/files/0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch: -------------------------------------------------------------------------------- 1 | From 5b905e686dc9c47cd1c4d101e60909e64781cbd1 Mon Sep 17 00:00:00 2001 2 | From: Kate 3 | Date: Wed, 21 Oct 2020 09:00:27 +0100 4 | Subject: [PATCH 03/16] The dot-merlin-reader package is always only valid for 5 | a limited set of OCaml compilers (#1186) 6 | 7 | --- 8 | dot-merlin-reader.opam | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/dot-merlin-reader.opam b/dot-merlin-reader.opam 12 | index 8f115254..0437151b 100644 13 | --- a/dot-merlin-reader.opam 14 | +++ b/dot-merlin-reader.opam 15 | @@ -10,7 +10,7 @@ build: [ 16 | ["dune" "build" "-p" name "-j" jobs] 17 | ] 18 | depends: [ 19 | - "ocaml" {>= "4.02.1"} 20 | + "ocaml" {>= "4.02.1" & < "4.12"} 21 | "dune" {>= "1.8.0"} 22 | "yojson" {>= "1.6.0"} 23 | "ocamlfind" {>= "1.6.0"} 24 | -- 25 | 2.29.2 26 | 27 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/files/0004-Use-avsm-setup-ocaml-v1-instead-of-1.0.1-1190.patch: -------------------------------------------------------------------------------- 1 | From 0d0840036cfbba63c80e52c2c84412b18b36b816 Mon Sep 17 00:00:00 2001 2 | From: Sora Morimoto 3 | Date: Tue, 10 Nov 2020 20:23:55 +0900 4 | Subject: [PATCH 04/16] Use avsm/setup-ocaml@v1 instead of 1.0.1 (#1190) 5 | 6 | Signed-off-by: Sora Morimoto 7 | --- 8 | .github/workflows/main.yml | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml 12 | index 8d963bdd..bae93692 100644 13 | --- a/.github/workflows/main.yml 14 | +++ b/.github/workflows/main.yml 15 | @@ -10,7 +10,7 @@ on: 16 | pull_request: 17 | branches: [ master ] 18 | schedule: 19 | - - cron: '0 12 */6 * *' 20 | + - cron: '0 12 */6 * *' 21 | 22 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 23 | jobs: 24 | @@ -51,7 +51,7 @@ jobs: 25 | # An explicit key for restoring and saving the cache 26 | key: ${{ matrix.os }}-${{ matrix.ocaml-version }}-${{ hashFiles('*.opam') }}-build 27 | - name: Set up OCaml ${{ matrix.ocaml-version }} 28 | - uses: avsm/setup-ocaml@v1.0.1 29 | + uses: avsm/setup-ocaml@v1 30 | with: 31 | # Version of the OCaml compiler to initialise 32 | ocaml-version: ${{ matrix.ocaml-version }} 33 | -- 34 | 2.29.2 35 | 36 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/files/0007-multicore-initial-merlin_specific-import.patch: -------------------------------------------------------------------------------- 1 | From e23de59e77f6b3a524f28dd69f6a78c5cddfe97f Mon Sep 17 00:00:00 2001 2 | From: "matt@pallissard.net" 3 | Date: Tue, 17 Nov 2020 21:44:16 -0800 4 | Subject: [PATCH 07/16] multicore: initial merlin_specific import 5 | 6 | --- 7 | src/ocaml/merlin_specific/410+multicore/browse_raw.ml | 8 ++++++-- 8 | src/ocaml/merlin_specific/410+multicore/raw_compat.ml | 2 +- 9 | .../merlin_specific/410+multicore/tail_analysis.ml | 4 ++-- 10 | src/ocaml/merlin_specific/410+multicore/typer_raw.ml | 10 ++++++++++ 11 | 4 files changed, 19 insertions(+), 5 deletions(-) 12 | 13 | diff --git a/src/ocaml/merlin_specific/410+multicore/browse_raw.ml b/src/ocaml/merlin_specific/410+multicore/browse_raw.ml 14 | index c451de40..2c4d23d0 100644 15 | --- a/src/ocaml/merlin_specific/410+multicore/browse_raw.ml 16 | +++ b/src/ocaml/merlin_specific/410+multicore/browse_raw.ml 17 | @@ -317,8 +317,8 @@ let of_expression_desc loc = function 18 | | (_,None) -> id_fold 19 | | (_,Some e) -> of_expression e) 20 | ls 21 | - | Texp_match (e,cs,_) 22 | - | Texp_try (e,cs) -> 23 | + | Texp_match (e,cs,_,_) 24 | + | Texp_try (e,cs,_) -> 25 | of_expression e ** 26 | list_fold of_case cs 27 | | Texp_tuple es | Texp_construct (_,_,es) | Texp_array es -> 28 | @@ -442,6 +442,8 @@ and of_structure_item_desc = function 29 | list_fold (fun x -> app (Module_binding x)) mbs 30 | | Tstr_modtype mtd -> 31 | app (Module_type_declaration mtd) 32 | + | Tstr_effect eff -> 33 | + app (Extension_constructor eff) 34 | | Tstr_class cds -> 35 | list_fold (fun (cd,_) -> app (Class_declaration cd)) cds 36 | | Tstr_class_type ctds -> 37 | @@ -485,6 +487,8 @@ and of_signature_item_desc = function 38 | list_fold (fun md -> app (Module_declaration md)) mds 39 | | Tsig_modtype mtd -> 40 | app (Module_type_declaration mtd) 41 | + | Tsig_effect eff -> 42 | + app (Extension_constructor eff) 43 | | Tsig_include i -> 44 | app (Include_description i) 45 | | Tsig_class cds -> 46 | diff --git a/src/ocaml/merlin_specific/410+multicore/raw_compat.ml b/src/ocaml/merlin_specific/410+multicore/raw_compat.ml 47 | index 9b6012b2..e441124a 100644 48 | --- a/src/ocaml/merlin_specific/410+multicore/raw_compat.ml 49 | +++ b/src/ocaml/merlin_specific/410+multicore/raw_compat.ml 50 | @@ -160,7 +160,7 @@ let texp_function_cases = function 51 | | _ -> assert false 52 | 53 | let tmatch_scrutinee = function 54 | - | Typedtree.Texp_match (e, _, _) -> e 55 | + | Typedtree.Texp_match (e, _, _, _) -> e 56 | | _ -> assert false 57 | 58 | let const_string (s, o) = Asttypes.Const_string (s, o) 59 | diff --git a/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml b/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml 60 | index 0c9680d6..58e52105 100644 61 | --- a/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml 62 | +++ b/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml 63 | @@ -55,8 +55,8 @@ let expr_tail_positions = function 64 | | Texp_while _ | Texp_for _ | Texp_send _ | Texp_new _ 65 | | Texp_unreachable | Texp_extension_constructor _ | Texp_letop _ 66 | -> [] 67 | - | Texp_match (_,cs,_) 68 | - | Texp_try (_,cs) 69 | + | Texp_match (_,cs,_,_) 70 | + | Texp_try (_,cs,_) 71 | -> List.map cs ~f:(fun c -> Case c) 72 | | Texp_letmodule (_,_,_,_,e) | Texp_letexception (_,e) | Texp_let (_,_,e) 73 | | Texp_sequence (_,e) | Texp_ifthenelse (_,e,None) | Texp_open (_, e) 74 | diff --git a/src/ocaml/merlin_specific/410+multicore/typer_raw.ml b/src/ocaml/merlin_specific/410+multicore/typer_raw.ml 75 | index 759875c4..7e314a4f 100644 76 | --- a/src/ocaml/merlin_specific/410+multicore/typer_raw.ml 77 | +++ b/src/ocaml/merlin_specific/410+multicore/typer_raw.ml 78 | @@ -84,6 +84,13 @@ module Rewrite_loc = struct 79 | let loc = if Location_aux.is_relaxed_location loc then loc else u_loc loc in 80 | (loc, u_payload payload) 81 | 82 | + and u_effect { peff_name = loc ; peff_kind; peff_loc; peff_attributes} = 83 | + let loc = if Location_aux.is_relaxed_location loc then loc else u_loc loc in 84 | + { peff_name = loc 85 | + ; peff_kind 86 | + ; peff_loc 87 | + ; peff_attributes} 88 | + 89 | and u_attributes l = List.map ~f:u_attribute l 90 | 91 | and u_payload = function 92 | @@ -152,6 +159,7 @@ module Rewrite_loc = struct 93 | | Ppat_record (fields, flag) -> Ppat_record (List.map ~f:(fun (l,p) -> (u_loc l, u_pattern p)) fields, flag) 94 | | Ppat_array ps -> Ppat_array (List.map ~f:u_pattern ps) 95 | | Ppat_or (p1, p2) -> Ppat_or (u_pattern p1, u_pattern p2) 96 | + | Ppat_effect (p1, p2) -> Ppat_effect (u_pattern p1, u_pattern p2) 97 | | Ppat_constraint (p, ct) -> Ppat_constraint (u_pattern p, u_core_type ct) 98 | | Ppat_type loc -> Ppat_type (u_loc loc) 99 | | Ppat_lazy p -> Ppat_lazy (u_pattern p) 100 | @@ -449,6 +457,7 @@ module Rewrite_loc = struct 101 | | Psig_class_type cts -> Psig_class_type (List.map ~f:u_class_type_declaration cts) 102 | | Psig_attribute attr -> Psig_attribute (u_attribute attr) 103 | | Psig_extension (ext, attrs) -> Psig_extension (u_extension ext, u_attributes attrs) 104 | + | Psig_effect ef -> Psig_effect(u_effect ef) 105 | | Psig_typesubst tds -> Psig_typesubst (List.map ~f:u_type_declaration tds) 106 | | Psig_modsubst ms -> Psig_modsubst (u_module_substitution ms) 107 | 108 | @@ -552,6 +561,7 @@ module Rewrite_loc = struct 109 | | Pstr_class_type ctds -> Pstr_class_type (List.map ~f:u_class_type_declaration ctds) 110 | | Pstr_include id -> Pstr_include (u_include_declaration id) 111 | | Pstr_attribute attr -> Pstr_attribute (u_attribute attr) 112 | + | Pstr_effect ef -> Pstr_effect (u_effect ef) 113 | | Pstr_extension (ext, attrs) -> Pstr_extension (u_extension ext, u_attributes attrs) 114 | 115 | and u_value_binding {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} = 116 | -- 117 | 2.29.2 118 | 119 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/files/0009-multicore-initial-parsing-import.patch: -------------------------------------------------------------------------------- 1 | From 37623df572e9abda4619256dbfe739539f74a450 Mon Sep 17 00:00:00 2001 2 | From: "matt@pallissard.net" 3 | Date: Tue, 17 Nov 2020 21:49:57 -0800 4 | Subject: [PATCH 09/16] multicore: initial parsing import 5 | 6 | --- 7 | src/ocaml/parsing/410+multicore/ast_helper.ml | 27 ++++++++++++++++++ 8 | .../parsing/410+multicore/ast_helper.mli | 7 +++++ 9 | .../parsing/410+multicore/ast_iterator.ml | 20 +++++++++++++ 10 | .../parsing/410+multicore/ast_iterator.mli | 1 + 11 | src/ocaml/parsing/410+multicore/ast_mapper.ml | 23 +++++++++++++++ 12 | .../parsing/410+multicore/ast_mapper.mli | 2 ++ 13 | src/ocaml/parsing/410+multicore/parsetree.mli | 27 ++++++++++++++++++ 14 | src/ocaml/parsing/410+multicore/pprintast.ml | 22 +++++++++++++++ 15 | src/ocaml/parsing/410+multicore/printast.ml | 28 +++++++++++++++++++ 16 | 9 files changed, 157 insertions(+) 17 | 18 | diff --git a/src/ocaml/parsing/410+multicore/ast_helper.ml b/src/ocaml/parsing/410+multicore/ast_helper.ml 19 | index 5c3a22f9..78075d4a 100644 20 | --- a/src/ocaml/parsing/410+multicore/ast_helper.ml 21 | +++ b/src/ocaml/parsing/410+multicore/ast_helper.ml 22 | @@ -167,6 +167,7 @@ module Pat = struct 23 | let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a) 24 | let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b)) 25 | let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a) 26 | + let effect_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_effect(a, b)) 27 | let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a) 28 | end 29 | 30 | @@ -273,6 +274,7 @@ module Sig = struct 31 | let type_subst ?loc a = mk ?loc (Psig_typesubst a) 32 | let type_extension ?loc a = mk ?loc (Psig_typext a) 33 | let exception_ ?loc a = mk ?loc (Psig_exception a) 34 | + let effect_ ?loc a = mk ?loc (Psig_effect a) 35 | let module_ ?loc a = mk ?loc (Psig_module a) 36 | let mod_subst ?loc a = mk ?loc (Psig_modsubst a) 37 | let rec_module ?loc a = mk ?loc (Psig_recmodule a) 38 | @@ -299,6 +301,7 @@ module Str = struct 39 | let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a)) 40 | let type_extension ?loc a = mk ?loc (Pstr_typext a) 41 | let exception_ ?loc a = mk ?loc (Pstr_exception a) 42 | + let effect_ ?loc a = mk ?loc (Pstr_effect a) 43 | let module_ ?loc a = mk ?loc (Pstr_module a) 44 | let rec_module ?loc a = mk ?loc (Pstr_recmodule a) 45 | let modtype ?loc a = mk ?loc (Pstr_modtype a) 46 | @@ -603,6 +606,30 @@ module Te = struct 47 | pext_attributes = add_docs_attrs docs (add_info_attrs info attrs); 48 | } 49 | 50 | + let effect_constructor ?(loc = !default_loc) ?(attrs = []) name kind = 51 | + { 52 | + peff_name = name; 53 | + peff_kind = kind; 54 | + peff_loc = loc; 55 | + peff_attributes = attrs; 56 | + } 57 | + 58 | + let effect_decl ?(loc = !default_loc) ?(attrs = []) ?(args = []) name res = 59 | + { 60 | + peff_name = name; 61 | + peff_kind = Peff_decl(args, res); 62 | + peff_loc = loc; 63 | + peff_attributes = attrs; 64 | + } 65 | + 66 | + let effect_rebind ?(loc = !default_loc) ?(attrs = []) name lid = 67 | + { 68 | + peff_name = name; 69 | + peff_kind = Peff_rebind lid; 70 | + peff_loc = loc; 71 | + peff_attributes = attrs; 72 | + } 73 | + 74 | end 75 | 76 | module Csig = struct 77 | diff --git a/src/ocaml/parsing/410+multicore/ast_helper.mli b/src/ocaml/parsing/410+multicore/ast_helper.mli 78 | index ccd1c20b..d8521825 100644 79 | --- a/src/ocaml/parsing/410+multicore/ast_helper.mli 80 | +++ b/src/ocaml/parsing/410+multicore/ast_helper.mli 81 | @@ -124,6 +124,7 @@ module Pat: 82 | val unpack: ?loc:loc -> ?attrs:attrs -> str_opt -> pattern 83 | val open_: ?loc:loc -> ?attrs:attrs -> lid -> pattern -> pattern 84 | val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern 85 | + val effect_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern 86 | val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern 87 | end 88 | 89 | @@ -239,6 +240,10 @@ module Te: 90 | extension_constructor 91 | val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info -> 92 | str -> lid -> extension_constructor 93 | + 94 | + val effect_constructor: ?loc:loc -> ?attrs:attrs -> str -> effect_constructor_kind -> effect_constructor 95 | + val effect_decl: ?loc:loc -> ?attrs:attrs -> ?args:core_type list -> str -> core_type -> effect_constructor 96 | + val effect_rebind: ?loc:loc -> ?attrs:attrs -> str -> lid -> effect_constructor 97 | end 98 | 99 | (** {1 Module language} *) 100 | @@ -287,6 +292,7 @@ module Sig: 101 | val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item 102 | val type_subst: ?loc:loc -> type_declaration list -> signature_item 103 | val type_extension: ?loc:loc -> type_extension -> signature_item 104 | + val effect_: ?loc:loc -> effect_constructor -> signature_item 105 | val exception_: ?loc:loc -> type_exception -> signature_item 106 | val module_: ?loc:loc -> module_declaration -> signature_item 107 | val mod_subst: ?loc:loc -> module_substitution -> signature_item 108 | @@ -311,6 +317,7 @@ module Str: 109 | val primitive: ?loc:loc -> value_description -> structure_item 110 | val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item 111 | val type_extension: ?loc:loc -> type_extension -> structure_item 112 | + val effect_: ?loc:loc -> effect_constructor -> structure_item 113 | val exception_: ?loc:loc -> type_exception -> structure_item 114 | val module_: ?loc:loc -> module_binding -> structure_item 115 | val rec_module: ?loc:loc -> module_binding list -> structure_item 116 | diff --git a/src/ocaml/parsing/410+multicore/ast_iterator.ml b/src/ocaml/parsing/410+multicore/ast_iterator.ml 117 | index 5f016c00..c6a99b26 100755 118 | --- a/src/ocaml/parsing/410+multicore/ast_iterator.ml 119 | +++ b/src/ocaml/parsing/410+multicore/ast_iterator.ml 120 | @@ -43,6 +43,7 @@ type iterator = { 121 | expr: iterator -> expression -> unit; 122 | extension: iterator -> extension -> unit; 123 | extension_constructor: iterator -> extension_constructor -> unit; 124 | + effect_constructor: iterator -> effect_constructor -> unit; 125 | include_declaration: iterator -> include_declaration -> unit; 126 | include_description: iterator -> include_description -> unit; 127 | label_declaration: iterator -> label_declaration -> unit; 128 | @@ -197,6 +198,21 @@ module T = struct 129 | sub.location sub pext_loc; 130 | sub.attributes sub pext_attributes 131 | 132 | + let iter_effect_constructor_kind sub = function 133 | + Peff_decl(ctl, cto) -> 134 | + List.iter (sub.typ sub) ctl; sub.typ sub cto 135 | + | Peff_rebind li -> 136 | + iter_loc sub li 137 | + 138 | + let iter_effect_constructor sub 139 | + {peff_name; 140 | + peff_kind; 141 | + peff_loc; 142 | + peff_attributes} = 143 | + iter_loc sub peff_name; 144 | + iter_effect_constructor_kind sub peff_kind; 145 | + sub.location sub peff_loc; 146 | + sub.attributes sub peff_attributes 147 | end 148 | 149 | module CT = struct 150 | @@ -276,6 +292,7 @@ module MT = struct 151 | | Psig_typesubst l -> 152 | List.iter (sub.type_declaration sub) l 153 | | Psig_typext te -> sub.type_extension sub te 154 | + | Psig_effect ed -> sub.effect_constructor sub ed 155 | | Psig_exception ed -> sub.type_exception sub ed 156 | | Psig_module x -> sub.module_declaration sub x 157 | | Psig_modsubst x -> sub.module_substitution sub x 158 | @@ -322,6 +339,7 @@ module M = struct 159 | | Pstr_primitive vd -> sub.value_description sub vd 160 | | Pstr_type (_rf, l) -> List.iter (sub.type_declaration sub) l 161 | | Pstr_typext te -> sub.type_extension sub te 162 | + | Pstr_effect ed -> sub.effect_constructor sub ed 163 | | Pstr_exception ed -> sub.type_exception sub ed 164 | | Pstr_module x -> sub.module_binding sub x 165 | | Pstr_recmodule l -> List.iter (sub.module_binding sub) l 166 | @@ -449,6 +467,7 @@ module P = struct 167 | | Ppat_lazy p -> sub.pat sub p 168 | | Ppat_unpack s -> iter_loc sub s 169 | | Ppat_exception p -> sub.pat sub p 170 | + | Ppat_effect (p1,p2) -> sub.pat sub p1; sub.pat sub p2 171 | | Ppat_extension x -> sub.extension sub x 172 | | Ppat_open (lid, p) -> 173 | iter_loc sub lid; sub.pat sub p 174 | @@ -546,6 +565,7 @@ let default_iterator = 175 | type_extension = T.iter_type_extension; 176 | type_exception = T.iter_type_exception; 177 | extension_constructor = T.iter_extension_constructor; 178 | + effect_constructor = T.iter_effect_constructor; 179 | value_description = 180 | (fun this {pval_name; pval_type; pval_prim = _; pval_loc; 181 | pval_attributes} -> 182 | diff --git a/src/ocaml/parsing/410+multicore/ast_iterator.mli b/src/ocaml/parsing/410+multicore/ast_iterator.mli 183 | index 26308d20..4e9f1d43 100755 184 | --- a/src/ocaml/parsing/410+multicore/ast_iterator.mli 185 | +++ b/src/ocaml/parsing/410+multicore/ast_iterator.mli 186 | @@ -45,6 +45,7 @@ type iterator = { 187 | expr: iterator -> expression -> unit; 188 | extension: iterator -> extension -> unit; 189 | extension_constructor: iterator -> extension_constructor -> unit; 190 | + effect_constructor: iterator -> effect_constructor -> unit; 191 | include_declaration: iterator -> include_declaration -> unit; 192 | include_description: iterator -> include_description -> unit; 193 | label_declaration: iterator -> label_declaration -> unit; 194 | diff --git a/src/ocaml/parsing/410+multicore/ast_mapper.ml b/src/ocaml/parsing/410+multicore/ast_mapper.ml 195 | index f8ff4276..56761c27 100644 196 | --- a/src/ocaml/parsing/410+multicore/ast_mapper.ml 197 | +++ b/src/ocaml/parsing/410+multicore/ast_mapper.ml 198 | @@ -44,6 +44,8 @@ type mapper = { 199 | class_type_field: mapper -> class_type_field -> class_type_field; 200 | constructor_declaration: mapper -> constructor_declaration 201 | -> constructor_declaration; 202 | + effect_constructor: mapper -> effect_constructor 203 | + -> effect_constructor; 204 | expr: mapper -> expression -> expression; 205 | extension: mapper -> extension -> extension; 206 | extension_constructor: mapper -> extension_constructor 207 | @@ -208,6 +210,23 @@ module T = struct 208 | (map_loc sub pext_name) 209 | (map_extension_constructor_kind sub pext_kind) 210 | 211 | + let map_effect_constructor_kind sub = function 212 | + Peff_decl(ctl, cto) -> 213 | + Peff_decl(List.map (sub.typ sub) ctl, sub.typ sub cto) 214 | + | Peff_rebind li -> 215 | + Peff_rebind (map_loc sub li) 216 | + 217 | + let map_effect_constructor sub 218 | + {peff_name; 219 | + peff_kind; 220 | + peff_loc; 221 | + peff_attributes} = 222 | + Te.effect_constructor 223 | + (map_loc sub peff_name) 224 | + (map_effect_constructor_kind sub peff_kind) 225 | + ~loc:(sub.location sub peff_loc) 226 | + ~attrs:(sub.attributes sub peff_attributes) 227 | + 228 | end 229 | 230 | module CT = struct 231 | @@ -294,6 +313,7 @@ module MT = struct 232 | | Psig_typesubst l -> 233 | type_subst ~loc (List.map (sub.type_declaration sub) l) 234 | | Psig_typext te -> type_extension ~loc (sub.type_extension sub te) 235 | + | Psig_effect ed -> effect_ ~loc (sub.effect_constructor sub ed) 236 | | Psig_exception ed -> exception_ ~loc (sub.type_exception sub ed) 237 | | Psig_module x -> module_ ~loc (sub.module_declaration sub x) 238 | | Psig_modsubst x -> mod_subst ~loc (sub.module_substitution sub x) 239 | @@ -345,6 +365,7 @@ module M = struct 240 | | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd) 241 | | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l) 242 | | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te) 243 | + | Pstr_effect ed -> effect_ ~loc (sub.effect_constructor sub ed) 244 | | Pstr_exception ed -> exception_ ~loc (sub.type_exception sub ed) 245 | | Pstr_module x -> module_ ~loc (sub.module_binding sub x) 246 | | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l) 247 | @@ -481,6 +502,7 @@ module P = struct 248 | | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s) 249 | | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p) 250 | | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p) 251 | + | Ppat_effect(p1, p2) -> effect_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2) 252 | | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x) 253 | end 254 | 255 | @@ -582,6 +604,7 @@ let default_mapper = 256 | type_extension = T.map_type_extension; 257 | type_exception = T.map_type_exception; 258 | extension_constructor = T.map_extension_constructor; 259 | + effect_constructor = T.map_effect_constructor; 260 | value_description = 261 | (fun this {pval_name; pval_type; pval_prim; pval_loc; 262 | pval_attributes} -> 263 | diff --git a/src/ocaml/parsing/410+multicore/ast_mapper.mli b/src/ocaml/parsing/410+multicore/ast_mapper.mli 264 | index 80d70fcc..48df2398 100644 265 | --- a/src/ocaml/parsing/410+multicore/ast_mapper.mli 266 | +++ b/src/ocaml/parsing/410+multicore/ast_mapper.mli 267 | @@ -73,6 +73,8 @@ type mapper = { 268 | class_type_field: mapper -> class_type_field -> class_type_field; 269 | constructor_declaration: mapper -> constructor_declaration 270 | -> constructor_declaration; 271 | + effect_constructor: mapper -> effect_constructor 272 | + -> effect_constructor; 273 | expr: mapper -> expression -> expression; 274 | extension: mapper -> extension -> extension; 275 | extension_constructor: mapper -> extension_constructor 276 | diff --git a/src/ocaml/parsing/410+multicore/parsetree.mli b/src/ocaml/parsing/410+multicore/parsetree.mli 277 | index 3f943210..77b4e415 100644 278 | --- a/src/ocaml/parsing/410+multicore/parsetree.mli 279 | +++ b/src/ocaml/parsing/410+multicore/parsetree.mli 280 | @@ -247,6 +247,8 @@ and pattern_desc = 281 | *) 282 | | Ppat_exception of pattern 283 | (* exception P *) 284 | + | Ppat_effect of pattern * pattern 285 | + (* effect P P *) 286 | | Ppat_extension of extension 287 | (* [%id] *) 288 | | Ppat_open of Longident.t loc * pattern 289 | @@ -533,6 +535,26 @@ and extension_constructor_kind = 290 | | C = D 291 | *) 292 | 293 | +and effect_constructor = 294 | + { 295 | + peff_name: string loc; 296 | + peff_kind : effect_constructor_kind; 297 | + peff_loc : Location.t; 298 | + peff_attributes: attributes; (* C [@id1] [@id2] of ... *) 299 | + } 300 | + 301 | +and effect_constructor_kind = 302 | + Peff_decl of core_type list * core_type 303 | + (* 304 | + | C of T1 * ... * Tn ([T1; ...; Tn], None) 305 | + | C: T0 ([], Some T0) 306 | + | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0) 307 | + *) 308 | + | Peff_rebind of Longident.t loc 309 | + (* 310 | + | C = D 311 | + *) 312 | + 313 | (** {1 Class language} *) 314 | 315 | (* Type expressions for the class language *) 316 | @@ -755,6 +777,8 @@ and signature_item_desc = 317 | (* type t1 += ... *) 318 | | Psig_exception of type_exception 319 | (* exception C of T *) 320 | + | Psig_effect of effect_constructor 321 | + (* effect C : T -> T *) 322 | | Psig_module of module_declaration 323 | (* module X = M 324 | module X : MT *) 325 | @@ -903,6 +927,9 @@ and structure_item_desc = 326 | | Pstr_exception of type_exception 327 | (* exception C of T 328 | exception C = M.X *) 329 | + | Pstr_effect of effect_constructor 330 | + (* effect C : T -> T 331 | + effect C = M.X *) 332 | | Pstr_module of module_binding 333 | (* module X = ME *) 334 | | Pstr_recmodule of module_binding list 335 | diff --git a/src/ocaml/parsing/410+multicore/pprintast.ml b/src/ocaml/parsing/410+multicore/pprintast.ml 336 | index 2e289027..ace1381b 100644 337 | --- a/src/ocaml/parsing/410+multicore/pprintast.ml 338 | +++ b/src/ocaml/parsing/410+multicore/pprintast.ml 339 | @@ -476,6 +476,8 @@ and simple_pattern ctxt (f:Format.formatter) (x:pattern) : unit = 340 | pp f "@[<2>(lazy@;%a)@]" (simple_pattern ctxt) p 341 | | Ppat_exception p -> 342 | pp f "@[<2>exception@;%a@]" (pattern1 ctxt) p 343 | + | Ppat_effect(p1, p2) -> 344 | + pp f "@[<2>effect@;%a@;%a@]" (pattern1 ctxt) p1 (pattern1 ctxt) p2 345 | | Ppat_extension e -> extension ctxt f e 346 | | Ppat_open (lid, p) -> 347 | let with_paren = 348 | @@ -845,6 +847,9 @@ and exception_declaration ctxt f x = 349 | (extension_constructor ctxt) x.ptyexn_constructor 350 | (item_attributes ctxt) x.ptyexn_attributes 351 | 352 | +and effect_declaration ctxt f ext = 353 | + pp f "@[effect@ %a@]" (effect_constructor ctxt) ext 354 | + 355 | and class_signature ctxt f { pcsig_self = ct; pcsig_fields = l ;_} = 356 | let class_type_field f x = 357 | match x.pctf_desc with 358 | @@ -1094,6 +1099,8 @@ and signature_item ctxt f x : unit = 359 | type_extension ctxt f te 360 | | Psig_exception ed -> 361 | exception_declaration ctxt f ed 362 | + | Psig_effect ed -> 363 | + effect_declaration ctxt f ed 364 | | Psig_class l -> 365 | let class_description kwd f ({pci_params=ls;pci_name={txt;_};_} as x) = 366 | pp f "@[<2>%s %a%a%s@;:@;%a@]%a" kwd 367 | @@ -1310,6 +1317,7 @@ and structure_item ctxt f x = 368 | pp f "@[<2>%a@]" (bindings ctxt) (rf,l) 369 | | Pstr_typext te -> type_extension ctxt f te 370 | | Pstr_exception ed -> exception_declaration ctxt f ed 371 | + | Pstr_effect ed -> effect_declaration ctxt f ed 372 | | Pstr_module x -> 373 | let rec module_helper = function 374 | | {pmod_desc=Pmod_functor(arg_opt,me'); pmod_attributes = []} -> 375 | @@ -1575,6 +1583,20 @@ and extension_constructor ctxt f x = 376 | (attributes ctxt) x.pext_attributes 377 | longident_loc li 378 | 379 | +and effect_constructor ctxt f x = 380 | + match x.peff_kind with 381 | + | Peff_decl(l, r) -> 382 | + pp f "%s%a:@;%a" x.peff_name.txt (attributes ctxt) x.peff_attributes 383 | + (fun f -> function 384 | + | [] -> (core_type1 ctxt) f r 385 | + | l -> pp f "%a@;->@;%a" (list (core_type1 ctxt) ~sep:"*@;") l 386 | + (core_type1 ctxt) r) 387 | + l 388 | + | Peff_rebind li -> 389 | + pp f "%s%a@;=@;%a" x.peff_name.txt (attributes ctxt) 390 | + x.peff_attributes longident_loc li 391 | + 392 | + 393 | and case_list ctxt f l : unit = 394 | let aux f {pc_lhs; pc_guard; pc_rhs} = 395 | pp f "@;| @[<2>%a%a@;->@;%a@]" 396 | diff --git a/src/ocaml/parsing/410+multicore/printast.ml b/src/ocaml/parsing/410+multicore/printast.ml 397 | index 30a0eeb3..aec21529 100644 398 | --- a/src/ocaml/parsing/410+multicore/printast.ml 399 | +++ b/src/ocaml/parsing/410+multicore/printast.ml 400 | @@ -249,6 +249,10 @@ and pattern i ppf x = 401 | | Ppat_exception p -> 402 | line i ppf "Ppat_exception\n"; 403 | pattern i ppf p 404 | + | Ppat_effect(p1, p2) -> 405 | + line i ppf "Ppat_effect\n"; 406 | + pattern i ppf p1; 407 | + pattern i ppf p2 408 | | Ppat_open (m,p) -> 409 | line i ppf "Ppat_open \"%a\"\n" fmt_longident_loc m; 410 | pattern i ppf p 411 | @@ -489,6 +493,24 @@ and extension_constructor_kind i ppf x = 412 | line i ppf "Pext_rebind\n"; 413 | line (i+1) ppf "%a\n" fmt_longident_loc li; 414 | 415 | +and effect_constructor i ppf x = 416 | + line i ppf "effect_constructor %a\n" fmt_location x.peff_loc; 417 | + attributes i ppf x.peff_attributes; 418 | + let i = i + 1 in 419 | + line i ppf "peff_name = \"%s\"\n" x.peff_name.txt; 420 | + line i ppf "peff_kind =\n"; 421 | + effect_constructor_kind (i + 1) ppf x.peff_kind; 422 | + 423 | +and effect_constructor_kind i ppf x = 424 | + match x with 425 | + Peff_decl(a, r) -> 426 | + line i ppf "Peff_decl\n"; 427 | + list (i+1) core_type ppf a; 428 | + core_type (i + 1) ppf r; 429 | + | Peff_rebind li -> 430 | + line i ppf "Peff_rebind\n"; 431 | + line (i+1) ppf "%a\n" fmt_longident_loc li; 432 | + 433 | and class_type i ppf x = 434 | line i ppf "class_type %a\n" fmt_location x.pcty_loc; 435 | attributes i ppf x.pcty_attributes; 436 | @@ -703,6 +725,9 @@ and signature_item i ppf x = 437 | | Psig_typext te -> 438 | line i ppf "Psig_typext\n"; 439 | type_extension i ppf te 440 | + | Psig_effect ext -> 441 | + line i ppf "Psig_effect\n"; 442 | + effect_constructor i ppf ext; 443 | | Psig_exception te -> 444 | line i ppf "Psig_exception\n"; 445 | type_exception i ppf te 446 | @@ -817,6 +842,9 @@ and structure_item i ppf x = 447 | | Pstr_typext te -> 448 | line i ppf "Pstr_typext\n"; 449 | type_extension i ppf te 450 | + | Pstr_effect ext -> 451 | + line i ppf "Pstr_effect\n"; 452 | + effect_constructor i ppf ext; 453 | | Pstr_exception te -> 454 | line i ppf "Pstr_exception\n"; 455 | type_exception i ppf te 456 | -- 457 | 2.29.2 458 | 459 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/files/0014-multicore-differentiate-multicore-with-dune.patch: -------------------------------------------------------------------------------- 1 | From 6af1ecd62343b69410d8c1d9e23b4bbc945dff8e Mon Sep 17 00:00:00 2001 2 | From: "matt@pallissard.net" 3 | Date: Tue, 17 Nov 2020 21:59:55 -0800 4 | Subject: [PATCH 14/16] multicore: differentiate multicore with dune 5 | 6 | --- 7 | src/ocaml/merlin_specific/dune | 11 ++++++++++- 8 | src/ocaml/parsing/dune | 11 ++++++++++- 9 | src/ocaml/preprocess/dune | 11 ++++++++++- 10 | src/ocaml/typing/dune | 6 +++++- 11 | src/ocaml/utils/dune | 6 +++++- 12 | 5 files changed, 40 insertions(+), 5 deletions(-) 13 | 14 | diff --git a/src/ocaml/merlin_specific/dune b/src/ocaml/merlin_specific/dune 15 | index 2803959a..05b9627e 100644 16 | --- a/src/ocaml/merlin_specific/dune 17 | +++ b/src/ocaml/merlin_specific/dune 18 | @@ -4,7 +4,16 @@ module J = Jbuild_plugin.V1 19 | ;; 20 | 21 | let ver = 22 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 23 | + try 24 | + match List.assoc "cmi_magic_number" J.ocamlc_config with 25 | + | "Caml1999I023" -> "407_0" 26 | + | _ -> raise Not_found 27 | + with Not_found -> 28 | + match 29 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 30 | + with 31 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 32 | + | maj, min, _ -> maj ^ min 33 | ;; 34 | 35 | Printf.ksprintf J.send {| 36 | diff --git a/src/ocaml/parsing/dune b/src/ocaml/parsing/dune 37 | index 5fa11506..b8126263 100644 38 | --- a/src/ocaml/parsing/dune 39 | +++ b/src/ocaml/parsing/dune 40 | @@ -4,7 +4,16 @@ module J = Jbuild_plugin.V1 41 | ;; 42 | 43 | let ver = 44 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 45 | + try 46 | + match List.assoc "cmi_magic_number" J.ocamlc_config with 47 | + | "Caml1999I023" -> "407_0" 48 | + | _ -> raise Not_found 49 | + with Not_found -> 50 | + match 51 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 52 | + with 53 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 54 | + | maj, min, _ -> maj ^ min 55 | ;; 56 | 57 | Printf.ksprintf J.send {| 58 | diff --git a/src/ocaml/preprocess/dune b/src/ocaml/preprocess/dune 59 | index 5d471f37..af040ce8 100644 60 | --- a/src/ocaml/preprocess/dune 61 | +++ b/src/ocaml/preprocess/dune 62 | @@ -3,7 +3,16 @@ 63 | module J = Jbuild_plugin.V1 64 | 65 | let ver = 66 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 67 | + try 68 | + match List.assoc "cmi_magic_number" J.ocamlc_config with 69 | + | "Caml1999I023" -> "407_0" 70 | + | _ -> raise Not_found 71 | + with Not_found -> 72 | + match 73 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 74 | + with 75 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 76 | + | maj, min, _ -> maj ^ min 77 | ;; 78 | 79 | Printf.ksprintf J.send {| 80 | diff --git a/src/ocaml/typing/dune b/src/ocaml/typing/dune 81 | index b639e538..3e209ccd 100644 82 | --- a/src/ocaml/typing/dune 83 | +++ b/src/ocaml/typing/dune 84 | @@ -9,7 +9,11 @@ let ver = 85 | | "Caml1999I023" -> "407_0" 86 | | _ -> raise Not_found 87 | with Not_found -> 88 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 89 | + match 90 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 91 | + with 92 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 93 | + | maj, min, _ -> maj ^ min 94 | ;; 95 | 96 | Printf.ksprintf J.send {| 97 | diff --git a/src/ocaml/utils/dune b/src/ocaml/utils/dune 98 | index 0f57f503..64157d1c 100644 99 | --- a/src/ocaml/utils/dune 100 | +++ b/src/ocaml/utils/dune 101 | @@ -9,7 +9,11 @@ let ver = 102 | | "Caml1999I023" -> "407_0" 103 | | _ -> raise Not_found 104 | with Not_found -> 105 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 106 | + match 107 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 108 | + with 109 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 110 | + | maj, min, _ -> maj ^ min 111 | 112 | let load_path = 113 | let version = Scanf.sscanf J.ocaml_version "%d.%d." (fun ma mi -> ma, mi) in 114 | -- 115 | 2.29.2 116 | 117 | -------------------------------------------------------------------------------- /packages/dot-merlin-reader/dot-merlin-reader.3.4.1+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "defree@gmail.com" 3 | authors: "The Merlin team" 4 | synopsis: "Reads config files for merlin" 5 | homepage: "https://github.com/ocaml/merlin" 6 | bug-reports: "https://github.com/ocaml/merlin/issues" 7 | dev-repo: "git+https://github.com/ocaml/merlin.git" 8 | build: [ 9 | ["dune" "subst"] {pinned} 10 | ["dune" "build" "-p" name "-j" jobs] 11 | ] 12 | depends: [ 13 | "ocaml" {>= "4.02.1" & < "4.12"} 14 | "base-effects" # this makes this package uninstallable due to needing ocaml 4.12, needs to shift to latest version 15 | "dune" {>= "1.8.0"} 16 | "yojson" {>= "1.6.0"} 17 | "ocamlfind" {>= "1.6.0"} 18 | "csexp" {>= "1.2.3"} 19 | "result" {>= "1.5"} 20 | ] 21 | 22 | url { 23 | src: 24 | "https://github.com/ocaml/merlin/releases/download/v3.4.1/merlin-v3.4.1.tbz" 25 | checksum: [ 26 | "sha256=e7f28ca520d1ab4a58e8ba876b665b1ecf9917cee7e5b3e3330afbd1d12a9e2a" 27 | "sha512=40ae93397aea031c1b4450998b448fc1df9671d612be0a02986688e5dd1390ced1c31bb2cdde9c6b52f8be841ca9fd1931fc302b26ef19cb2e88925d3b360c37" 28 | ] 29 | } 30 | 31 | patches: [ 32 | "0001-Local_store-change-API.patch" 33 | "0002-Destruct-reorganize-ans-add-more-tests-1189.patch" 34 | "0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch" 35 | "0005-Fix-Destruct-ill-typed-completions-1194.patch" 36 | "0006-multicore-initial-merlin_specific-copy.patch" 37 | "0007-multicore-initial-merlin_specific-import.patch" 38 | "0008-multicore-initial-parsing-copy.patch" 39 | "0009-multicore-initial-parsing-import.patch" 40 | "0010-multicore-initial-preprocess-copy.patch" 41 | "0011-multicore-initial-typing-copy.patch" 42 | "0012-multicore-initial-typing-import.patch" 43 | "0013-multicore-initial-util-copy.patch" 44 | "0014-multicore-differentiate-multicore-with-dune.patch" 45 | "0015-multicore-add-upstream-multicore-files.patch" 46 | "0016-add-effect-syntax.patch" 47 | ] 48 | 49 | 50 | extra-files: [ 51 | ["0001-Local_store-change-API.patch" "md5=483940da139a810b305fb699d7f78907"] 52 | ["0002-Destruct-reorganize-ans-add-more-tests-1189.patch" "md5=b85d2bb8467578987e513ab5f3e463f2"] 53 | ["0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch" "md5=9d507cda053708a354afd45b939b5362"] 54 | ["0004-Use-avsm-setup-ocaml-v1-instead-of-1.0.1-1190.patch" "md5=941715dc3abd0f4f29fabf210f6edd4b"] 55 | ["0005-Fix-Destruct-ill-typed-completions-1194.patch" "md5=484da034e74f4696a5d8c3ec09bd520a"] 56 | ["0006-multicore-initial-merlin_specific-copy.patch" "md5=054faf3a3131b9e859a12d3510ebfa82"] 57 | ["0007-multicore-initial-merlin_specific-import.patch" "md5=5e3f5aa92e16dcc17d0626bbbb8af226"] 58 | ["0008-multicore-initial-parsing-copy.patch" "md5=d96c2e407b07886ed94f9cd0dbd6aad5"] 59 | ["0009-multicore-initial-parsing-import.patch" "md5=3ac5cb916b8adaed4b587e6eaccc1283"] 60 | ["0010-multicore-initial-preprocess-copy.patch" "md5=4b50048759c102cf1f8675afdb7e73f5"] 61 | ["0011-multicore-initial-typing-copy.patch" "md5=70687532d17036d5fed3103a4bdb2dbc"] 62 | ["0012-multicore-initial-typing-import.patch" "md5=1be20cf8f0edb6e329a24cc24da03486"] 63 | ["0013-multicore-initial-util-copy.patch" "md5=84e368bfbd78d3d7ea1ee670593d36c1"] 64 | ["0014-multicore-differentiate-multicore-with-dune.patch" "md5=101713b2c6f5b3416fe09dbb5a6cf935"] 65 | ["0015-multicore-add-upstream-multicore-files.patch" "md5=0b02637b5ae8e9dd0b4ade9d5031ede4"] 66 | ["0016-add-effect-syntax.patch" "md5=93bf6e26507936dbcfb01da6d0881c53"] 67 | ] 68 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.1/findlib: -------------------------------------------------------------------------------- 1 | kcas 2 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.1/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/kcas" 5 | doc: "https://kayceesrk.github.io/kcas/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/kcas.git" 8 | bug-reports: "https://github.com/kayceesrk/kcas/issues" 9 | depends: [ 10 | "ocaml" {>= "4.01.0" & < "4.07.0"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | ] 15 | build: [ 16 | "ocaml" "pkg/pkg.ml" "build" 17 | "--pinned" pinned ] 18 | synopsis: "Multi-word compare-and-swap library" 19 | description: "kcas is distributed under the ISC license." 20 | url { 21 | src: 22 | "https://github.com/kayceesrk/kcas/releases/download/0.1.1/kcas-0.1.1.tbz" 23 | checksum: "md5=396b8990517de6529c2a79bad0761ff2" 24 | } 25 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.2/findlib: -------------------------------------------------------------------------------- 1 | kcas 2 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.2/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/kcas" 5 | doc: "https://kayceesrk.github.io/kcas/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/kcas.git" 8 | bug-reports: "https://github.com/kayceesrk/kcas/issues" 9 | depends: [ 10 | "ocaml" {>= "4.01.0" & < "4.07.0"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | ] 15 | build: [ 16 | "ocaml" "pkg/pkg.ml" "build" 17 | "--pinned" pinned ] 18 | synopsis: "Multi-word compare-and-swap library" 19 | description: """ 20 | kcas is TODO 21 | 22 | kcas is distributed under the ISC license.""" 23 | url { 24 | src: 25 | "https://github.com/kayceesrk/kcas/releases/download/0.1.2/kcas-0.1.2.tbz" 26 | checksum: "md5=d9c691544d53f409a243a307806b505d" 27 | } 28 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.3/findlib: -------------------------------------------------------------------------------- 1 | kcas 2 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.3/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/kcas" 5 | doc: "https://kayceesrk.github.io/kcas/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/kcas.git" 8 | bug-reports: "https://github.com/kayceesrk/kcas/issues" 9 | depends: [ 10 | "ocaml" {>= "4.01.0" & < "4.07.0"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | ] 15 | build: [ 16 | "ocaml" "pkg/pkg.ml" "build" 17 | "--pinned" pinned ] 18 | synopsis: "Multi-word compare-and-swap library" 19 | description: """ 20 | kcas is TODO 21 | 22 | kcas is distributed under the ISC license.""" 23 | url { 24 | src: 25 | "https://github.com/kayceesrk/kcas/releases/download/0.1.3/kcas-0.1.3.tbz" 26 | checksum: "md5=7725714213121417062c2ce5ff635f2b" 27 | } 28 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.4/findlib: -------------------------------------------------------------------------------- 1 | kcas 2 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1.4/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | name: "kcas" 3 | maintainer: "KC Sivaramakrishnan " 4 | authors: ["KC Sivaramakrishnan "] 5 | homepage: "https://github.com/kayceesrk/kcas" 6 | synopsis: "Multi-word compare-and-swap library" 7 | doc: "https://kayceesrk.github.io/kcas/doc" 8 | license: "ISC" 9 | dev-repo: "git+https://github.com/kayceesrk/kcas.git" 10 | bug-reports: "https://github.com/kayceesrk/kcas/issues" 11 | depends: [ 12 | "ocaml" 13 | "dune" 14 | "base-domains" 15 | ] 16 | build: [ 17 | ["dune" "build" "-p" name] 18 | ] 19 | url { 20 | src: "https://github.com/ocaml-multicore/kcas/archive/0.1.4.zip" 21 | checksum: "md5=d619b0b67b93c6b8601a2263e26e6225" 22 | } 23 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1/findlib: -------------------------------------------------------------------------------- 1 | kcas 2 | -------------------------------------------------------------------------------- /packages/kcas/kcas.0.1/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/kcas" 5 | doc: "https://kayceesrk.github.io/kcas/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/kcas.git" 8 | bug-reports: "https://github.com/kayceesrk/kcas/issues" 9 | depends: [ 10 | "ocaml" {>= "4.01.0" & < "4.07.0"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | ] 15 | build: [ 16 | "ocaml" "pkg/pkg.ml" "build" 17 | "--pinned" pinned ] 18 | synopsis: "Multi-word compare-and-swap library" 19 | description: "kcas is distributed under the ISC license." 20 | url { 21 | src: "https://github.com/kayceesrk/kcas/releases/download/0.1/kcas-0.1.tbz" 22 | checksum: "md5=2c5cad1146d6d948e9b0f7eec54dd6f6" 23 | } 24 | -------------------------------------------------------------------------------- /packages/lablgl/lablgl.1.06+multicore/files/META: -------------------------------------------------------------------------------- 1 | description = "Bindings for OpenGL graphics engines" 2 | version = "1.06" 3 | archive(byte) = "lablgl.cma" 4 | archive(native) = "lablgl.cmxa" 5 | 6 | package "togl" ( 7 | description = "OpenGL widget for labltk" 8 | version = "1.06" 9 | requires = "lablgl, labltk" 10 | archive(byte) = "togl.cma" 11 | archive(native) = "togl.cmxa" 12 | ) 13 | 14 | package "glut" ( 15 | description = "Platform-independent OpenGL window" 16 | version = "1.06" 17 | requires = "lablgl" 18 | archive(byte) = "lablglut.cma" 19 | archive(native) = "lablglut.cmxa" 20 | ) 21 | -------------------------------------------------------------------------------- /packages/lablgl/lablgl.1.06+multicore/files/lablgl.install: -------------------------------------------------------------------------------- 1 | lib: ["META"] 2 | -------------------------------------------------------------------------------- /packages/lablgl/lablgl.1.06+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "garrigue@math.nagoya-u.ac.jp" 3 | authors: ["Jacques Garrigue et al., Nagoya University"] 4 | homepage: "https://github.com/garrigue/lablgl" 5 | bug-reports: "https://github.com/garrigue/lablgl/issues" 6 | dev-repo: "git+https://github.com/garrigue/lablgl.git" 7 | license: "BSD-3-Clause" 8 | build: [ 9 | ["cp" "Makefile.config.ex" "Makefile.config"] 10 | ["cp" "Makefile.config.osx" "Makefile.config"] {os = "macos"} 11 | ["mkdir" "-p" bin] 12 | [make "INSTALLDIR=%{lib}%/lablgl" "glut"] 13 | [make "glutopt"] 14 | ] 15 | install: [ 16 | [make "install" "-C" "src" "BINDIR=%{bin}%" "INSTALLDIR=%{lib}%/lablgl" "DLLDIR=%{lib}%/stublibs"] 17 | [make "install" "-C" "LablGlut/src" "BINDIR=%{bin}%" "INSTALLDIR=%{lib}%/lablgl" "DLLDIR=%{lib}%/stublibs"] 18 | ] 19 | remove: [ 20 | ["rm" "-rf" "%{lib}%/lablgl"] 21 | ["rm" "-f" "%{bin}%/lablglut"] 22 | ] 23 | depends: [ 24 | "ocaml" {>= "4.03"} 25 | "base-domains" 26 | ] 27 | depexts: [ 28 | ["freeglut3-dev" "libglu1-mesa-dev" "mesa-common-dev"] 29 | {os-family = "debian"} 30 | ["freeglut-dev"] {os-distribution = "alpine"} 31 | ["freeglut-devel"] {os-distribution = "centos"} 32 | ["freeglut-devel"] {os-distribution = "fedora"} 33 | ["freeglut-devel"] {os-family = "suse"} 34 | ] 35 | synopsis: "Interface to OpenGL" 36 | description: """ 37 | Interface between OCaml and OpenGL, including Togl wrapper for use 38 | with LablTk, and LablGlut wrapper for direct use using the glut 39 | library.""" 40 | flags: light-uninstall 41 | extra-files: [ 42 | ["lablgl.install" "md5=a03d20fcd54d7277982caf03b05354fa"] 43 | ["META" "md5=49c6f4d534802c35d0faa722dedcea76"] 44 | ] 45 | url { 46 | src: "https://github.com/kit-ty-kate/lablgl/archive/caml_namespace.tar.gz" 47 | } 48 | -------------------------------------------------------------------------------- /packages/lockfree/lockfree.0.1.1/findlib: -------------------------------------------------------------------------------- 1 | lockfree 2 | -------------------------------------------------------------------------------- /packages/lockfree/lockfree.0.1.1/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/lockfree" 5 | doc: "https://kayceesrk.github.io/lockfree/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/lockfree.git" 8 | bug-reports: "https://github.com/kayceesrk/lockfree/issues" 9 | depends: [ 10 | "ocaml" {>= "4.01.0" & < "4.07.0"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | "kcas" {>= "0.1.2"} 15 | ] 16 | build: [ 17 | "ocaml" "pkg/pkg.ml" "build" 18 | "--pinned" pinned ] 19 | synopsis: "Lock-free data structures for Multicore OCaml" 20 | description: """ 21 | lockfree is TODO 22 | 23 | lockfree is distributed under the ISC license.""" 24 | url { 25 | src: 26 | "https://github.com/kayceesrk/lockfree/releases/download/0.1.1/lockfree-0.1.1.tbz" 27 | checksum: "md5=b0b8deda85171294a36a88f023fcb51b" 28 | } 29 | -------------------------------------------------------------------------------- /packages/lockfree/lockfree.0.1.2/findlib: -------------------------------------------------------------------------------- 1 | lockfree 2 | -------------------------------------------------------------------------------- /packages/lockfree/lockfree.0.1.2/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/kayceesrk/lockfree" 5 | doc: "https://kayceesrk.github.io/lockfree/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/kayceesrk/lockfree.git" 8 | bug-reports: "https://github.com/kayceesrk/lockfree/issues" 9 | depends: [ 10 | "ocaml" {>= "4.01.0" & < "4.07.0"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | "kcas" {>= "0.1.3"} 15 | ] 16 | build: [ 17 | "ocaml" "pkg/pkg.ml" "build" 18 | "--pinned" pinned ] 19 | synopsis: "Lock-free data structures for Multicore OCaml" 20 | description: """ 21 | lockfree is TODO 22 | 23 | lockfree is distributed under the ISC license.""" 24 | url { 25 | src: 26 | "https://github.com/kayceesrk/lockfree/releases/download/0.1.2/lockfree-0.1.2.tbz" 27 | checksum: "md5=725b518e9b5422f16e8420af8a767eba" 28 | } 29 | -------------------------------------------------------------------------------- /packages/lockfree/lockfree.0.1.3/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/ocaml-multicore/lockfree" 5 | doc: "https://kayceesrk.github.io/lockfree/doc" 6 | synopsis: "Lock-free data structures for multicore OCaml" 7 | license: "ISC" 8 | dev-repo: "git+https://github.com/ocaml-multicore/lockfree.git" 9 | bug-reports: "https://github.com/ocaml-multicore/lockfree/issues" 10 | depends: [ 11 | "ocaml" {>= "4.06.1"} 12 | "dune" 13 | "base-domains" 14 | "kcas" {>= "0.1.3"} 15 | ] 16 | build: [ 17 | "dune" "build" "-p" name ] 18 | url { 19 | src: "https://github.com/ocaml-multicore/lockfree/archive/0.1.3.zip" 20 | checksum: "md5=d52cb8bf33deb87c13087f7ad1a2787c" 21 | } 22 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/files/0001-Local_store-change-API.patch: -------------------------------------------------------------------------------- 1 | From afc15c13118444b0affb027855c21664266db946 Mon Sep 17 00:00:00 2001 2 | From: Thomas Refis 3 | Date: Tue, 6 Oct 2020 15:37:11 +0200 4 | Subject: [PATCH 01/16] Local_store: change API 5 | 6 | Two kinds of global state: 7 | - tables (which are mutable): they need an explicit reset function 8 | - immutable values: which are snapshoted when we freeze the bindings 9 | --- 10 | src/utils/local_store.ml | 66 +++++++++++++++++++++------------------ 11 | src/utils/local_store.mli | 7 +++-- 12 | 2 files changed, 40 insertions(+), 33 deletions(-) 13 | 14 | diff --git a/src/utils/local_store.ml b/src/utils/local_store.ml 15 | index 3004b96e..c0b6ced2 100644 16 | --- a/src/utils/local_store.ml 17 | +++ b/src/utils/local_store.ml 18 | @@ -1,6 +1,7 @@ 19 | -open Std 20 | +type ref_and_reset = 21 | + | Table : { ref: 'a ref; init: unit -> 'a } -> ref_and_reset 22 | + | Immutable : { ref: 'a ref; mutable snapshot: 'a } -> ref_and_reset 23 | 24 | -type ref_and_reset = F : 'a ref * (unit -> 'a) -> ref_and_reset 25 | type bindings = { 26 | mutable refs: ref_and_reset list; 27 | mutable frozen : bool; 28 | @@ -14,45 +15,50 @@ let is_bound t = !(t.is_bound) 29 | 30 | let reset t = 31 | assert (is_bound t); 32 | - List.iter ~f:(fun (F (ref, initializer_)) -> ref := initializer_ ()) t.refs 33 | + List.iter (function 34 | + | Table { ref; init } -> ref := init () 35 | + | Immutable { ref; snapshot } -> ref := snapshot 36 | + ) t.refs 37 | 38 | -let ref t f = 39 | - let result = ref (f ()) in 40 | +let table t create size = 41 | + let init () = create size in 42 | + let ref = ref (init ()) in 43 | assert (not t.frozen); 44 | - t.refs <- (F (result, f)) :: t.refs; 45 | - result 46 | + t.refs <- (Table { ref; init }) :: t.refs; 47 | + ref 48 | 49 | -type 'a slot = { ref : 'a ref; mutable value : 'a } 50 | -type a_slot = Slot : 'a slot -> a_slot 51 | -type scope = { slots: a_slot list; scope_bound : bool ref } 52 | +let ref t k = 53 | + let ref = ref k in 54 | + assert (not t.frozen); 55 | + t.refs <- (Immutable { ref; snapshot = k }) :: t.refs; 56 | + ref 57 | + 58 | +type slot = Slot : { ref : 'a ref; mutable value : 'a } -> slot 59 | +type scope = { slots: slot list; scope_bound : bool ref } 60 | 61 | let fresh t = 62 | + let slots = 63 | + List.map (function 64 | + | Table { ref; init } -> Slot {ref; value = init ()} 65 | + | Immutable r -> 66 | + if not t.frozen then r.snapshot <- !(r.ref); 67 | + Slot { ref = r.ref; value = r.snapshot } 68 | + ) t.refs 69 | + in 70 | t.frozen <- true; 71 | - { slots = List.map ~f:(fun (F(ref,f)) -> Slot {ref; value = f ()}) t.refs; 72 | - scope_bound = t.is_bound } 73 | - 74 | -type ref_and_value = V : 'a ref * 'a -> ref_and_value 75 | -let restore l = List.iter ~f:(fun (V(r,v)) -> r := v) l 76 | + { slots; scope_bound = t.is_bound } 77 | 78 | let with_scope { slots; scope_bound } f = 79 | assert (not !scope_bound); 80 | scope_bound := true; 81 | - let backup = List.rev_map ~f:(fun (Slot {ref;_}) -> V (ref,!ref)) slots in 82 | - List.iter ~f:(fun (Slot {ref;value}) -> ref := value) slots; 83 | - match f () with 84 | - | x -> 85 | - List.iter ~f:(fun (Slot s) -> s.value <- !(s.ref)) slots; 86 | - scope_bound := false; 87 | - restore backup; 88 | - x 89 | - | exception exn -> 90 | - List.iter ~f:(fun (Slot s) -> s.value <- !(s.ref)) slots; 91 | - scope_bound := false; 92 | - restore backup; 93 | - reraise exn 94 | + List.iter (fun (Slot {ref;value}) -> ref := value) slots; 95 | + Fun.protect f ~finally:(fun () -> 96 | + List.iter (fun (Slot s) -> s.value <- !(s.ref)) slots; 97 | + scope_bound := false 98 | + ) 99 | 100 | module Compiler = struct 101 | let compiler_state = new_bindings () 102 | - let sref f = ref compiler_state f 103 | - let srefk k = ref compiler_state (fun () -> k) 104 | + let s_table f n = table compiler_state f n 105 | + let s_ref k = ref compiler_state k 106 | end 107 | diff --git a/src/utils/local_store.mli b/src/utils/local_store.mli 108 | index 79a539e3..bed1ad31 100644 109 | --- a/src/utils/local_store.mli 110 | +++ b/src/utils/local_store.mli 111 | @@ -5,7 +5,8 @@ val new_bindings : unit -> bindings 112 | val is_bound : bindings -> bool 113 | val reset : bindings -> unit 114 | 115 | -val ref : bindings -> (unit -> 'a) -> 'a ref 116 | +val table : bindings -> ('a -> 'b) -> 'a -> 'b ref 117 | +val ref : bindings -> 'a -> 'a ref 118 | 119 | type scope 120 | val fresh : bindings -> scope 121 | @@ -15,6 +16,6 @@ val with_scope : scope -> (unit -> 'a) -> 'a 122 | 123 | module Compiler : sig 124 | val compiler_state : bindings 125 | - val sref : (unit -> 'a) -> 'a ref 126 | - val srefk : 'a -> 'a ref 127 | + val s_ref : 'a -> 'a ref 128 | + val s_table : ('a -> 'b) -> 'a -> 'b ref 129 | end 130 | -- 131 | 2.29.2 132 | 133 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/files/0002-Destruct-reorganize-ans-add-more-tests-1189.patch: -------------------------------------------------------------------------------- 1 | From df4cc8d7d903dd215eff4c7aa6f45e535693cf1d Mon Sep 17 00:00:00 2001 2 | From: Ulysse <5031221+voodoos@users.noreply.github.com> 3 | Date: Thu, 15 Oct 2020 15:39:08 +0200 4 | Subject: [PATCH 02/16] Destruct: reorganize ans add more tests (#1189) 5 | 6 | --- 7 | tests/dune.inc | 58 +++- 8 | tests/test-dirs/destruct/basic.t | 148 ---------- 9 | tests/test-dirs/destruct/complete.t | 212 +++++++++++---- 10 | tests/test-dirs/destruct/create.t | 253 ++++++++++++++++++ 11 | tests/test-dirs/destruct/errors.t | 18 ++ 12 | ...{exceptions_pre_408.t => errors_pre_408.t} | 0 13 | ...eptions_since_408.t => errors_since_408.t} | 0 14 | tests/test-dirs/destruct/refine.t | 246 +++++++++++++++++ 15 | 8 files changed, 723 insertions(+), 212 deletions(-) 16 | delete mode 100644 tests/test-dirs/destruct/basic.t 17 | create mode 100644 tests/test-dirs/destruct/create.t 18 | create mode 100644 tests/test-dirs/destruct/errors.t 19 | rename tests/test-dirs/destruct/{exceptions_pre_408.t => errors_pre_408.t} (100%) 20 | rename tests/test-dirs/destruct/{exceptions_since_408.t => errors_since_408.t} (100%) 21 | create mode 100644 tests/test-dirs/destruct/refine.t 22 | 23 | diff --git a/tests/dune.inc b/tests/dune.inc 24 | index 1ac3f4d5..ca06a932 100644 25 | --- a/tests/dune.inc 26 | +++ b/tests/dune.inc 27 | @@ -221,9 +221,9 @@ 28 | (alias (name runtest) (deps (alias deprecation-run))) 29 | 30 | (alias 31 | - (name destruct-basic) 32 | + (name destruct-complete) 33 | (package merlin) 34 | - (deps (:t ./test-dirs/destruct/basic.t) 35 | + (deps (:t ./test-dirs/destruct/complete.t) 36 | (source_tree ./test-dirs/destruct) 37 | %{bin:ocamlmerlin} 38 | %{bin:ocamlmerlin-server} 39 | @@ -235,12 +235,12 @@ 40 | (progn 41 | (run %{bin:mdx} test --syntax=cram %{t}) 42 | (diff? %{t} %{t}.corrected))))))) 43 | -(alias (name runtest) (deps (alias destruct-basic))) 44 | +(alias (name runtest) (deps (alias destruct-complete))) 45 | 46 | (alias 47 | - (name destruct-complete) 48 | + (name destruct-create) 49 | (package merlin) 50 | - (deps (:t ./test-dirs/destruct/complete.t) 51 | + (deps (:t ./test-dirs/destruct/create.t) 52 | (source_tree ./test-dirs/destruct) 53 | %{bin:ocamlmerlin} 54 | %{bin:ocamlmerlin-server} 55 | @@ -252,12 +252,29 @@ 56 | (progn 57 | (run %{bin:mdx} test --syntax=cram %{t}) 58 | (diff? %{t} %{t}.corrected))))))) 59 | -(alias (name runtest) (deps (alias destruct-complete))) 60 | +(alias (name runtest) (deps (alias destruct-create))) 61 | + 62 | +(alias 63 | + (name destruct-errors) 64 | + (package merlin) 65 | + (deps (:t ./test-dirs/destruct/errors.t) 66 | + (source_tree ./test-dirs/destruct) 67 | + %{bin:ocamlmerlin} 68 | + %{bin:ocamlmerlin-server} 69 | + %{bin:dot-merlin-reader}) 70 | + (action 71 | + (chdir ./test-dirs/destruct 72 | + (setenv MERLIN %{exe:merlin-wrapper} 73 | + (setenv OCAMLC %{ocamlc} 74 | + (progn 75 | + (run %{bin:mdx} test --syntax=cram %{t}) 76 | + (diff? %{t} %{t}.corrected))))))) 77 | +(alias (name runtest) (deps (alias destruct-errors))) 78 | 79 | (alias 80 | - (name destruct-exceptions_pre_408)(enabled_if (< %{ocaml_version} 4.08.0)) 81 | + (name destruct-errors_pre_408)(enabled_if (< %{ocaml_version} 4.08.0)) 82 | (package merlin) 83 | - (deps (:t ./test-dirs/destruct/exceptions_pre_408.t) 84 | + (deps (:t ./test-dirs/destruct/errors_pre_408.t) 85 | (source_tree ./test-dirs/destruct) 86 | %{bin:ocamlmerlin} 87 | %{bin:ocamlmerlin-server} 88 | @@ -269,12 +286,12 @@ 89 | (progn 90 | (run %{bin:mdx} test --syntax=cram %{t}) 91 | (diff? %{t} %{t}.corrected))))))) 92 | -(alias (name runtest) (deps (alias destruct-exceptions_pre_408))) 93 | +(alias (name runtest) (deps (alias destruct-errors_pre_408))) 94 | 95 | (alias 96 | - (name destruct-exceptions_since_408)(enabled_if (>= %{ocaml_version} 4.08.0)) 97 | + (name destruct-errors_since_408)(enabled_if (>= %{ocaml_version} 4.08.0)) 98 | (package merlin) 99 | - (deps (:t ./test-dirs/destruct/exceptions_since_408.t) 100 | + (deps (:t ./test-dirs/destruct/errors_since_408.t) 101 | (source_tree ./test-dirs/destruct) 102 | %{bin:ocamlmerlin} 103 | %{bin:ocamlmerlin-server} 104 | @@ -286,7 +303,7 @@ 105 | (progn 106 | (run %{bin:mdx} test --syntax=cram %{t}) 107 | (diff? %{t} %{t}.corrected))))))) 108 | -(alias (name runtest) (deps (alias destruct-exceptions_since_408))) 109 | +(alias (name runtest) (deps (alias destruct-errors_since_408))) 110 | 111 | (alias 112 | (name destruct-from_val) 113 | @@ -322,6 +339,23 @@ 114 | (diff? %{t} %{t}.corrected))))))) 115 | (alias (name runtest) (deps (alias destruct-issue596))) 116 | 117 | +(alias 118 | + (name destruct-refine) 119 | + (package merlin) 120 | + (deps (:t ./test-dirs/destruct/refine.t) 121 | + (source_tree ./test-dirs/destruct) 122 | + %{bin:ocamlmerlin} 123 | + %{bin:ocamlmerlin-server} 124 | + %{bin:dot-merlin-reader}) 125 | + (action 126 | + (chdir ./test-dirs/destruct 127 | + (setenv MERLIN %{exe:merlin-wrapper} 128 | + (setenv OCAMLC %{ocamlc} 129 | + (progn 130 | + (run %{bin:mdx} test --syntax=cram %{t}) 131 | + (diff? %{t} %{t}.corrected))))))) 132 | +(alias (name runtest) (deps (alias destruct-refine))) 133 | + 134 | (alias 135 | (name errors-alerts-test-pre-408)(enabled_if (< %{ocaml_version} 4.08.0)) 136 | (package merlin) 137 | diff --git a/tests/test-dirs/destruct/basic.t b/tests/test-dirs/destruct/basic.t 138 | deleted file mode 100644 139 | index 8e2d2ad7..00000000 140 | --- a/tests/test-dirs/destruct/basic.t 141 | +++ /dev/null 142 | @@ -1,148 +0,0 @@ 143 | -TODO: test all error cases 144 | - 145 | - $ $MERLIN single case-analysis -start 4:9 -end 4:11 -filename nothing_to_do.ml < let _ = \ 147 | - > match (None : unit option) with \ 148 | - > | None -> () \ 149 | - > | Some () -> () \ 150 | - > EOF 151 | - { 152 | - "class": "error", 153 | - "value": "Nothing to do", 154 | - "notifications": [] 155 | - } 156 | - 157 | - 158 | - $ $MERLIN single case-analysis -start 3:4 -end 3:8 -filename make_exhaustive.ml < let _ = \ 160 | - > match (None : unit option) with \ 161 | - > | None -> () \ 162 | - > EOF 163 | - { 164 | - "class": "return", 165 | - "value": [ 166 | - { 167 | - "start": { 168 | - "line": 3, 169 | - "col": 14 170 | - }, 171 | - "end": { 172 | - "line": 3, 173 | - "col": 14 174 | - } 175 | - }, 176 | - " 177 | - | Some _ -> (??)" 178 | - ], 179 | - "notifications": [] 180 | - } 181 | - 182 | - $ $MERLIN single case-analysis -start 4:9 -end 4:10 -filename refine_pattern.ml < let _ = \ 184 | - > match (None : unit option) with \ 185 | - > | None -> () \ 186 | - > | Some _ -> () \ 187 | - > EOF 188 | - { 189 | - "class": "return", 190 | - "value": [ 191 | - { 192 | - "start": { 193 | - "line": 4, 194 | - "col": 9 195 | - }, 196 | - "end": { 197 | - "line": 4, 198 | - "col": 10 199 | - } 200 | - }, 201 | - "()" 202 | - ], 203 | - "notifications": [] 204 | - } 205 | - 206 | - $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename unpack_module.ml < module type S = sig end \ 208 | - > \ 209 | - > let g (x : (module S)) = \ 210 | - > x \ 211 | - > EOF 212 | - { 213 | - "class": "return", 214 | - "value": [ 215 | - { 216 | - "start": { 217 | - "line": 4, 218 | - "col": 2 219 | - }, 220 | - "end": { 221 | - "line": 4, 222 | - "col": 3 223 | - } 224 | - }, 225 | - "let module M = (val x) in (??)" 226 | - ], 227 | - "notifications": [] 228 | - } 229 | - 230 | - $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename record_exp.ml < let f (x : int ref) = \ 232 | - > x \ 233 | - > EOF 234 | - { 235 | - "class": "return", 236 | - "value": [ 237 | - { 238 | - "start": { 239 | - "line": 2, 240 | - "col": 2 241 | - }, 242 | - "end": { 243 | - "line": 2, 244 | - "col": 3 245 | - } 246 | - }, 247 | - "match x with | { contents } -> (??)" 248 | - ], 249 | - "notifications": [] 250 | - } 251 | - 252 | -FIXME: put each case on a different line (if it doesn't require updating 253 | -pprintast). 254 | - 255 | - $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename variant_exp.ml < let f (x : int option) = \ 257 | - > x \ 258 | - > EOF 259 | - { 260 | - "class": "return", 261 | - "value": [ 262 | - { 263 | - "start": { 264 | - "line": 2, 265 | - "col": 2 266 | - }, 267 | - "end": { 268 | - "line": 2, 269 | - "col": 3 270 | - } 271 | - }, 272 | - "match x with | None -> (??) | Some _ -> (??)" 273 | - ], 274 | - "notifications": [] 275 | - } 276 | - 277 | - $ echo "let () = ()" | $MERLIN single case-analysis -start 1:4 -end 1:4 -filename stacktrace.ml | grep -E -v "Raised|Called|Re-raised" 278 | - { 279 | - "class": "error", 280 | - "value": "Destruct not allowed on value_binding", 281 | - "notifications": [] 282 | - } 283 | - 284 | - $ $MERLIN single case-analysis -start 4:2 -end 4:1 -filename nonode.ml < let f (x : int option) = \ 286 | - > match w with \ 287 | - > | _ -> () \ 288 | - > EOF 289 | - "class": "exception", 290 | - "value": "Query_commands.No_nodes 291 | diff --git a/tests/test-dirs/destruct/complete.t b/tests/test-dirs/destruct/complete.t 292 | index ab78f375..e3e211c9 100644 293 | --- a/tests/test-dirs/destruct/complete.t 294 | +++ b/tests/test-dirs/destruct/complete.t 295 | @@ -1,3 +1,95 @@ 296 | +############### 297 | +## SUM TYPES ## 298 | +############### 299 | + 300 | +Test 1.1 : FIXME (void type no Some) 301 | + 302 | + $ cat >typ5.ml < type void = | \ 304 | + > let f (x : void option) = \ 305 | + > match x with \ 306 | + > | None -> () \ 307 | + > EOF 308 | + 309 | + $ $MERLIN single case-analysis -start 4:4 -end 4:4 -filename typ5.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 311 | + { 312 | + "class": "return", 313 | + "value": [ 314 | + { 315 | + "start": { 316 | + "line": 4, 317 | + "col": 14 318 | + }, 319 | + "end": { 320 | + "line": 4, 321 | + "col": 14 322 | + } 323 | + }, 324 | + "|Some _ -> (??)" 325 | + ], 326 | + "notifications": [] 327 | + } 328 | + 329 | +Test 1.2 : FIXME ? 330 | + 331 | + $ cat >typ12.ml < let _ = \ 333 | + > match (None : int option option) with \ 334 | + > | Some (Some 3) -> () \ 335 | + > EOF 336 | + 337 | + $ $MERLIN single case-analysis -start 3:4 -end 3:8 -filename typ12.ml < typ12.ml \ 338 | + > sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 339 | + { 340 | + "class": "return", 341 | + "value": [ 342 | + { 343 | + "start": { 344 | + "line": 3, 345 | + "col": 23 346 | + }, 347 | + "end": { 348 | + "line": 3, 349 | + "col": 23 350 | + } 351 | + }, 352 | + "|Some (Some 0)|Some (None)|None -> (??)" 353 | + ], 354 | + "notifications": [] 355 | + } 356 | + 357 | +Test 1.3 : with type constructor 358 | + 359 | + $ $MERLIN single case-analysis -start 3:5 -end 3:5 -filename funny.ml < type funny = int option -> unit \ 361 | + > let v : funny = function \ 362 | + > | None -> () \ 363 | + > EOF 364 | + { 365 | + "class": "return", 366 | + "value": [ 367 | + { 368 | + "start": { 369 | + "line": 3, 370 | + "col": 14 371 | + }, 372 | + "end": { 373 | + "line": 3, 374 | + "col": 14 375 | + } 376 | + }, 377 | + " 378 | + | Some _ -> (??)" 379 | + ], 380 | + "notifications": [] 381 | + } 382 | + 383 | +############# 384 | +## RECORDS ## 385 | +############# 386 | + 387 | +Test 2.1 388 | 389 | $ cat >typ.ml < type a = A | B of string \ 391 | @@ -27,95 +119,106 @@ 392 | "notifications": [] 393 | } 394 | 395 | - $ cat >typ2.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 397 | - > let f (x : basic_color) = \ 398 | - > match x with \ 399 | - > | \`Blue -> () \ 400 | +Test 2.2 : FIXME ? 401 | + 402 | + $ cat >typ3.ml < type a = A | B of string \ 404 | + > type recd = { a : a } \ 405 | + > let f (x : recd) = \ 406 | + > match x with \ 407 | + > | { a = A } -> () \ 408 | + > | { a = B _ } -> () \ 409 | > EOF 410 | 411 | - $ $MERLIN single case-analysis -start 4:5 -end 4:5 -filename typ2.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 414 | { 415 | "class": "return", 416 | "value": [ 417 | { 418 | "start": { 419 | - "line": 4, 420 | - "col": 15 421 | + "line": 6, 422 | + "col": 4 423 | }, 424 | "end": { 425 | - "line": 4, 426 | + "line": 6, 427 | "col": 15 428 | } 429 | }, 430 | - "|`Yellow|`Red -> (??)" 431 | + "{ a = B \"\" }|{ a = B _ }" 432 | ], 433 | "notifications": [] 434 | } 435 | 436 | -FIXME ? 437 | +########################## 438 | +## POLYMORPHIC VARIANTS ## 439 | +########################## 440 | 441 | +Test 3.1 442 | 443 | - $ cat >typ3.ml < type a = A | B of string \ 445 | - > type recd = { a : a } \ 446 | - > let f (x : recd) = \ 447 | - > match x with \ 448 | - > | { a = A } -> () \ 449 | - > | { a = B _ } -> () \ 450 | + $ cat >typ2.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 452 | + > let f (x : basic_color) = \ 453 | + > match x with \ 454 | + > | \`Blue -> () \ 455 | > EOF 456 | 457 | - $ $MERLIN single case-analysis -start 6:12 -end 6:12 -filename typ3.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 460 | { 461 | "class": "return", 462 | "value": [ 463 | { 464 | "start": { 465 | - "line": 6, 466 | - "col": 4 467 | + "line": 4, 468 | + "col": 15 469 | }, 470 | "end": { 471 | - "line": 6, 472 | + "line": 4, 473 | "col": 15 474 | } 475 | }, 476 | - "{ a = B \"\" }|{ a = B _ }" 477 | + "|`Yellow|`Red -> (??)" 478 | ], 479 | "notifications": [] 480 | } 481 | 482 | - $ cat >typ4.ml < type b = C | D of string \ 484 | - > type a = A | B of b \ 485 | - > type recd = { a : a } \ 486 | - > let f (x : recd) = \ 487 | - > match x with \ 488 | - > | { a = A } -> () \ 489 | - > | { a = B _ } -> () \ 490 | +Test 3.1 491 | + 492 | + $ cat >typv3.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 494 | + > type better_color = [ basic_color | \`Gold ] \ 495 | + > let f (x : better_color) = \ 496 | + > match x with \ 497 | + > | #basic_color -> () \ 498 | > EOF 499 | 500 | - $ $MERLIN single case-analysis -start 7:12 -end 7:12 -filename typ4.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 503 | { 504 | "class": "return", 505 | "value": [ 506 | { 507 | "start": { 508 | - "line": 7, 509 | - "col": 4 510 | + "line": 5, 511 | + "col": 22 512 | }, 513 | "end": { 514 | - "line": 7, 515 | - "col": 15 516 | + "line": 5, 517 | + "col": 22 518 | } 519 | }, 520 | - "{ a = B (C) }|{ a = B (D _) }" 521 | + "|`Gold -> (??)" 522 | ], 523 | "notifications": [] 524 | } 525 | 526 | +########## 527 | +## GADT ## 528 | +########## 529 | + 530 | +Test 4.1 531 | + 532 | $ cat >typ3.ml < type _ term = \ 534 | > | Int : int -> int term \ 535 | @@ -147,6 +250,8 @@ FIXME ? 536 | "notifications": [] 537 | } 538 | 539 | +Test 4.2 540 | + 541 | $ cat >typ4.ml < type _ term = \ 543 | > | Int : int -> int term \ 544 | @@ -178,7 +283,7 @@ FIXME ? 545 | "notifications": [] 546 | } 547 | 548 | -FIXME 549 | +Test 4.3 : FIXME this match IS exhaustive 550 | 551 | $ cat >typ4b.ml < type _ t = \ 553 | @@ -209,31 +314,34 @@ FIXME 554 | "notifications": [] 555 | } 556 | 557 | -FIXME 558 | +############ 559 | +## MODULE ## 560 | +############ 561 | 562 | - $ cat >typ5.ml < type void = | \ 564 | - > let f (x : void option) = \ 565 | - > match x with \ 566 | - > | None -> () \ 567 | - > EOF 568 | +Test 5.1 : Module path 569 | 570 | - $ $MERLIN single case-analysis -start 4:4 -end 4:4 -filename typ5.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 572 | + $ $MERLIN single case-analysis -start 5:4 -end 5:4 -filename module_path.ml < module T = struct type t = A | B of int end \ 574 | + > \ 575 | + > let g x = \ 576 | + > match x with \ 577 | + > | T.A -> () \ 578 | + > EOF 579 | { 580 | "class": "return", 581 | "value": [ 582 | { 583 | "start": { 584 | - "line": 4, 585 | - "col": 14 586 | + "line": 5, 587 | + "col": 13 588 | }, 589 | "end": { 590 | - "line": 4, 591 | - "col": 14 592 | + "line": 5, 593 | + "col": 13 594 | } 595 | }, 596 | - "|Some _ -> (??)" 597 | + " 598 | + | T.B _ -> (??)" 599 | ], 600 | "notifications": [] 601 | } 602 | diff --git a/tests/test-dirs/destruct/create.t b/tests/test-dirs/destruct/create.t 603 | new file mode 100644 604 | index 00000000..62091cd7 605 | --- /dev/null 606 | +++ b/tests/test-dirs/destruct/create.t 607 | @@ -0,0 +1,253 @@ 608 | +############### 609 | +## SUM TYPES ## 610 | +############### 611 | + 612 | +Test 1.1 : FIXME: put each case on a different line (if it doesn't require updating 613 | +pprintast). 614 | + 615 | + $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename variant_exp.ml < let f (x : int option) = \ 617 | + > x \ 618 | + > EOF 619 | + { 620 | + "class": "return", 621 | + "value": [ 622 | + { 623 | + "start": { 624 | + "line": 2, 625 | + "col": 2 626 | + }, 627 | + "end": { 628 | + "line": 2, 629 | + "col": 3 630 | + } 631 | + }, 632 | + "match x with | None -> (??) | Some _ -> (??)" 633 | + ], 634 | + "notifications": [] 635 | + } 636 | + 637 | +############# 638 | +## RECORDS ## 639 | +############# 640 | + 641 | +Test 2.1 642 | + 643 | + $ $MERLIN single case-analysis -start 2:2 -end 2:3 -filename record_exp.ml < let f (x : int ref) = \ 645 | + > x \ 646 | + > EOF 647 | + { 648 | + "class": "return", 649 | + "value": [ 650 | + { 651 | + "start": { 652 | + "line": 2, 653 | + "col": 2 654 | + }, 655 | + "end": { 656 | + "line": 2, 657 | + "col": 3 658 | + } 659 | + }, 660 | + "match x with | { contents } -> (??)" 661 | + ], 662 | + "notifications": [] 663 | + } 664 | + 665 | +########################## 666 | +## POLYMORPHIC VARIANTS ## 667 | +########################## 668 | + 669 | +Test 3.1 670 | + 671 | + $ cat >typv2.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 673 | + > let f (x : basic_color) = \ 674 | + > x \ 675 | + > EOF 676 | + 677 | + $ $MERLIN single case-analysis -start 3:2 -end 3:2 -filename typv2.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 679 | + { 680 | + "class": "return", 681 | + "value": [ 682 | + { 683 | + "start": { 684 | + "line": 3, 685 | + "col": 2 686 | + }, 687 | + "end": { 688 | + "line": 3, 689 | + "col": 3 690 | + } 691 | + }, 692 | + "match x with|`Blue -> (??)|`Yellow -> (??)|`Red -> (??)" 693 | + ], 694 | + "notifications": [] 695 | + } 696 | + 697 | +Test 3.1 698 | + 699 | + $ cat >typv3.ml < type basic_color = [ \`Blue | \`Red | \`Yellow ] \ 701 | + > type better_color = [ basic_color | \`Gold ] \ 702 | + > let f (x : better_color) = \ 703 | + > x \ 704 | + > EOF 705 | + 706 | + $ $MERLIN single case-analysis -start 4:2 -end 4:2 -filename typv3.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 708 | + { 709 | + "class": "return", 710 | + "value": [ 711 | + { 712 | + "start": { 713 | + "line": 4, 714 | + "col": 2 715 | + }, 716 | + "end": { 717 | + "line": 4, 718 | + "col": 3 719 | + } 720 | + }, 721 | + "match x with|`Blue -> (??)|`Yellow -> (??)|`Red -> (??)|`Gold -> (??)" 722 | + ], 723 | + "notifications": [] 724 | + } 725 | + 726 | +########## 727 | +## GADT ## 728 | +########## 729 | + 730 | +Test 4.1 731 | + 732 | + $ cat >typ4b.ml < type _ t = \ 734 | + > | I : int -> int t \ 735 | + > | B : bool t \ 736 | + > let f (x : int t) : unit = \ 737 | + > x \ 738 | + > EOF 739 | + 740 | + $ $MERLIN single case-analysis -start 5:2 -end 5:2 -filename typ4b.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 742 | + { 743 | + "class": "return", 744 | + "value": [ 745 | + { 746 | + "start": { 747 | + "line": 5, 748 | + "col": 2 749 | + }, 750 | + "end": { 751 | + "line": 5, 752 | + "col": 3 753 | + } 754 | + }, 755 | + "(match x with|I _ -> (??))" 756 | + ], 757 | + "notifications": [] 758 | + } 759 | + 760 | +Test 4.2 761 | + 762 | + $ cat >typ4.ml < type _ term = \ 764 | + > | Int : int -> int term \ 765 | + > | Add : (int -> int -> int) term \ 766 | + > | App : ('b -> 'a) term * 'b term -> 'a term \ 767 | + > let eval : type a. a term -> a term = fun x -> \ 768 | + > x \ 769 | + > EOF 770 | + 771 | + $ $MERLIN single case-analysis -start 6:2 -end 6:2 -filename typ4.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 773 | + { 774 | + "class": "return", 775 | + "value": [ 776 | + { 777 | + "start": { 778 | + "line": 6, 779 | + "col": 2 780 | + }, 781 | + "end": { 782 | + "line": 6, 783 | + "col": 3 784 | + } 785 | + }, 786 | + "match x with|Int _ -> (??)|Add -> (??)|App (_,_) -> (??)" 787 | + ], 788 | + "notifications": [] 789 | + } 790 | + 791 | +############ 792 | +## MODULE ## 793 | +############ 794 | + 795 | +Test 5.1 796 | + 797 | + $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename unpack_module.ml < module type S = sig end \ 799 | + > \ 800 | + > let g (x : (module S)) = \ 801 | + > x \ 802 | + > EOF 803 | + { 804 | + "class": "return", 805 | + "value": [ 806 | + { 807 | + "start": { 808 | + "line": 4, 809 | + "col": 2 810 | + }, 811 | + "end": { 812 | + "line": 4, 813 | + "col": 3 814 | + } 815 | + }, 816 | + "let module M = (val x) in (??)" 817 | + ], 818 | + "notifications": [] 819 | + } 820 | + 821 | +Test 5.2 : Module path 822 | + 823 | + $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename module_path.ml < module T = struct type t = A | B of int end \ 825 | + > \ 826 | + > let g (x : T.t) = \ 827 | + > x \ 828 | + > EOF 829 | + { 830 | + "class": "return", 831 | + "value": [ 832 | + { 833 | + "start": { 834 | + "line": 4, 835 | + "col": 2 836 | + }, 837 | + "end": { 838 | + "line": 4, 839 | + "col": 3 840 | + } 841 | + }, 842 | + "match x with | T.A -> (??) | T.B _ -> (??)" 843 | + ], 844 | + "notifications": [] 845 | + } 846 | + 847 | +test 5.3 : Abstract type 848 | + 849 | + 850 | + $ $MERLIN single case-analysis -start 4:2 -end 4:3 -filename module_path.ml < module T : sig type t end = struct type t = A | B of int end \ 852 | + > \ 853 | + > let g (x : T.t) = \ 854 | + > x \ 855 | + > EOF 856 | + { 857 | + "class": "error", 858 | + "value": "Destruct not allowed on non-destructible type: t", 859 | + "notifications": [] 860 | + } 861 | diff --git a/tests/test-dirs/destruct/errors.t b/tests/test-dirs/destruct/errors.t 862 | new file mode 100644 863 | index 00000000..5aabc544 864 | --- /dev/null 865 | +++ b/tests/test-dirs/destruct/errors.t 866 | @@ -0,0 +1,18 @@ 867 | +Test 1 868 | + 869 | + $ echo "let () = ()" | $MERLIN single case-analysis -start 1:4 -end 1:4 -filename stacktrace.ml | grep -E -v "Raised|Called|Re-raised" 870 | + { 871 | + "class": "error", 872 | + "value": "Destruct not allowed on value_binding", 873 | + "notifications": [] 874 | + } 875 | + 876 | +Test 2 877 | + 878 | + $ $MERLIN single case-analysis -start 4:2 -end 4:1 -filename nonode.ml < let f (x : int option) = \ 880 | + > match w with \ 881 | + > | _ -> () \ 882 | + > EOF 883 | + "class": "exception", 884 | + "value": "Query_commands.No_nodes 885 | diff --git a/tests/test-dirs/destruct/exceptions_pre_408.t b/tests/test-dirs/destruct/errors_pre_408.t 886 | similarity index 100% 887 | rename from tests/test-dirs/destruct/exceptions_pre_408.t 888 | rename to tests/test-dirs/destruct/errors_pre_408.t 889 | diff --git a/tests/test-dirs/destruct/exceptions_since_408.t b/tests/test-dirs/destruct/errors_since_408.t 890 | similarity index 100% 891 | rename from tests/test-dirs/destruct/exceptions_since_408.t 892 | rename to tests/test-dirs/destruct/errors_since_408.t 893 | diff --git a/tests/test-dirs/destruct/refine.t b/tests/test-dirs/destruct/refine.t 894 | new file mode 100644 895 | index 00000000..a1dcfdfd 896 | --- /dev/null 897 | +++ b/tests/test-dirs/destruct/refine.t 898 | @@ -0,0 +1,246 @@ 899 | +############### 900 | +## SUM TYPES ## 901 | +############### 902 | + 903 | +Test 1.1 : option refine 904 | + 905 | + $ $MERLIN single case-analysis -start 4:9 -end 4:10 -filename refine_pattern.ml < let _ = \ 907 | + > match (None : unit option) with \ 908 | + > | None -> () \ 909 | + > | Some _ -> () \ 910 | + > EOF 911 | + { 912 | + "class": "return", 913 | + "value": [ 914 | + { 915 | + "start": { 916 | + "line": 4, 917 | + "col": 9 918 | + }, 919 | + "end": { 920 | + "line": 4, 921 | + "col": 10 922 | + } 923 | + }, 924 | + "()" 925 | + ], 926 | + "notifications": [] 927 | + } 928 | + 929 | +Test 1.2 : option refine 930 | + 931 | + $ cat >typ12.ml < type t = A | B of int \ 933 | + > let _ = \ 934 | + > match (None : t option) with \ 935 | + > | None -> () \ 936 | + > | Some _ -> () \ 937 | + > EOF 938 | + 939 | + $ $MERLIN single case-analysis -start 5:9 -end 5:10 -filename typ12.ml < typ12.ml \ 940 | + > sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 941 | + { 942 | + "class": "return", 943 | + "value": [ 944 | + { 945 | + "start": { 946 | + "line": 5, 947 | + "col": 4 948 | + }, 949 | + "end": { 950 | + "line": 5, 951 | + "col": 10 952 | + } 953 | + }, 954 | + "Some (A)|Some (B _)" 955 | + ], 956 | + "notifications": [] 957 | + } 958 | + 959 | +Test 1.3 : FIXME ? int option 960 | + 961 | + $ cat >typ13.ml < let _ = \ 963 | + > match (None : int option) with \ 964 | + > | None -> () \ 965 | + > | Some _ -> () \ 966 | + > EOF 967 | + 968 | + $ $MERLIN single case-analysis -start 4:9 -end 4:10 -filename typ13.ml < typ13.ml \ 969 | + > sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 970 | + { 971 | + "class": "return", 972 | + "value": [ 973 | + { 974 | + "start": { 975 | + "line": 4, 976 | + "col": 4 977 | + }, 978 | + "end": { 979 | + "line": 4, 980 | + "col": 10 981 | + } 982 | + }, 983 | + "Some 0|Some _" 984 | + ], 985 | + "notifications": [] 986 | + } 987 | + 988 | +############# 989 | +## RECORDS ## 990 | +############# 991 | + 992 | +Test 2.1 993 | + 994 | + $ cat >typ4.ml < type b = C | D of string \ 996 | + > type a = A | B of b \ 997 | + > type recd = { a : a } \ 998 | + > let f (x : recd) = \ 999 | + > match x with \ 1000 | + > | { a = A } -> () \ 1001 | + > | { a = B _ } -> () \ 1002 | + > EOF 1003 | + 1004 | + $ $MERLIN single case-analysis -start 7:12 -end 7:12 -filename typ4.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1006 | + { 1007 | + "class": "return", 1008 | + "value": [ 1009 | + { 1010 | + "start": { 1011 | + "line": 7, 1012 | + "col": 4 1013 | + }, 1014 | + "end": { 1015 | + "line": 7, 1016 | + "col": 15 1017 | + } 1018 | + }, 1019 | + "{ a = B (C) }|{ a = B (D _) }" 1020 | + ], 1021 | + "notifications": [] 1022 | + } 1023 | + 1024 | +########################## 1025 | +## POLYMORPHIC VARIANTS ## 1026 | +########################## 1027 | + 1028 | +Test 3.1 1029 | + 1030 | + $ cat >typ2.ml < type blues = [ \`Cyan | \`Methyl ] \ 1032 | + > type basic_color = [ \`Blue of blues ] \ 1033 | + > let f (x : basic_color) = \ 1034 | + > match x with \ 1035 | + > | \`Blue _ -> () \ 1036 | + > EOF 1037 | + 1038 | + $ $MERLIN single case-analysis -start 5:11 -end 5:11 -filename typ2.ml sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1040 | + { 1041 | + "class": "return", 1042 | + "value": [ 1043 | + { 1044 | + "start": { 1045 | + "line": 5, 1046 | + "col": 4 1047 | + }, 1048 | + "end": { 1049 | + "line": 5, 1050 | + "col": 11 1051 | + } 1052 | + }, 1053 | + "`Blue `Methyl|`Blue `Cyan" 1054 | + ], 1055 | + "notifications": [] 1056 | + } 1057 | + 1058 | +########## 1059 | +## GADT ## 1060 | +########## 1061 | + 1062 | +Test 4.1 : Fixme: missing space and () 1063 | + 1064 | + $ cat >typ3.ml < type _ sub_t = \ 1066 | + > | A : int -> int sub_t \ 1067 | + > | B : int -> float sub_t \ 1068 | + > type _ term = \ 1069 | + > | Int : int sub_t -> int term \ 1070 | + > let eval : type a. a term -> a term = \ 1071 | + > fun x : a term -> match x with \ 1072 | + > | Int _ -> () \ 1073 | + > EOF 1074 | + 1075 | + $ $MERLIN single case-analysis -start 8:8 -end 8:8 -filename typ3.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1077 | + { 1078 | + "class": "return", 1079 | + "value": [ 1080 | + { 1081 | + "start": { 1082 | + "line": 8, 1083 | + "col": 8 1084 | + }, 1085 | + "end": { 1086 | + "line": 8, 1087 | + "col": 9 1088 | + } 1089 | + }, 1090 | + "A_" 1091 | + ], 1092 | + "notifications": [] 1093 | + } 1094 | + 1095 | +Test 4.2 1096 | + 1097 | + $ cat >typ3b.ml < type _ sub_t = \ 1099 | + > | A : int -> int sub_t \ 1100 | + > | B : int -> int sub_t \ 1101 | + > type _ term = \ 1102 | + > | Int : int sub_t -> int term \ 1103 | + > let eval : type a. a term -> a term = \ 1104 | + > fun x : a term -> match x with \ 1105 | + > | Int _ -> () \ 1106 | + > EOF 1107 | + 1108 | + $ $MERLIN single case-analysis -start 8:8 -end 8:8 -filename typ3b.ml sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.' 1110 | + { 1111 | + "class": "return", 1112 | + "value": [ 1113 | + { 1114 | + "start": { 1115 | + "line": 8, 1116 | + "col": 4 1117 | + }, 1118 | + "end": { 1119 | + "line": 8, 1120 | + "col": 9 1121 | + } 1122 | + }, 1123 | + "Int (A _)|Int (B _)" 1124 | + ], 1125 | + "notifications": [] 1126 | + } 1127 | + 1128 | +############ 1129 | +## ERRORS ## 1130 | +############ 1131 | + 1132 | +Test 5.1 : Nothing to do 1133 | + 1134 | + $ $MERLIN single case-analysis -start 4:9 -end 4:11 -filename nothing_to_do.ml < let _ = \ 1136 | + > match (None : unit option) with \ 1137 | + > | None -> () \ 1138 | + > | Some () -> () \ 1139 | + > EOF 1140 | + { 1141 | + "class": "error", 1142 | + "value": "Nothing to do", 1143 | + "notifications": [] 1144 | + } 1145 | -- 1146 | 2.29.2 1147 | 1148 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/files/0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch: -------------------------------------------------------------------------------- 1 | From 5b905e686dc9c47cd1c4d101e60909e64781cbd1 Mon Sep 17 00:00:00 2001 2 | From: Kate 3 | Date: Wed, 21 Oct 2020 09:00:27 +0100 4 | Subject: [PATCH 03/16] The dot-merlin-reader package is always only valid for 5 | a limited set of OCaml compilers (#1186) 6 | 7 | --- 8 | dot-merlin-reader.opam | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/dot-merlin-reader.opam b/dot-merlin-reader.opam 12 | index 8f115254..0437151b 100644 13 | --- a/dot-merlin-reader.opam 14 | +++ b/dot-merlin-reader.opam 15 | @@ -10,7 +10,7 @@ build: [ 16 | ["dune" "build" "-p" name "-j" jobs] 17 | ] 18 | depends: [ 19 | - "ocaml" {>= "4.02.1"} 20 | + "ocaml" {>= "4.02.1" & < "4.12"} 21 | "dune" {>= "1.8.0"} 22 | "yojson" {>= "1.6.0"} 23 | "ocamlfind" {>= "1.6.0"} 24 | -- 25 | 2.29.2 26 | 27 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/files/0004-Use-avsm-setup-ocaml-v1-instead-of-1.0.1-1190.patch: -------------------------------------------------------------------------------- 1 | From 0d0840036cfbba63c80e52c2c84412b18b36b816 Mon Sep 17 00:00:00 2001 2 | From: Sora Morimoto 3 | Date: Tue, 10 Nov 2020 20:23:55 +0900 4 | Subject: [PATCH 04/16] Use avsm/setup-ocaml@v1 instead of 1.0.1 (#1190) 5 | 6 | Signed-off-by: Sora Morimoto 7 | --- 8 | .github/workflows/main.yml | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml 12 | index 8d963bdd..bae93692 100644 13 | --- a/.github/workflows/main.yml 14 | +++ b/.github/workflows/main.yml 15 | @@ -10,7 +10,7 @@ on: 16 | pull_request: 17 | branches: [ master ] 18 | schedule: 19 | - - cron: '0 12 */6 * *' 20 | + - cron: '0 12 */6 * *' 21 | 22 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 23 | jobs: 24 | @@ -51,7 +51,7 @@ jobs: 25 | # An explicit key for restoring and saving the cache 26 | key: ${{ matrix.os }}-${{ matrix.ocaml-version }}-${{ hashFiles('*.opam') }}-build 27 | - name: Set up OCaml ${{ matrix.ocaml-version }} 28 | - uses: avsm/setup-ocaml@v1.0.1 29 | + uses: avsm/setup-ocaml@v1 30 | with: 31 | # Version of the OCaml compiler to initialise 32 | ocaml-version: ${{ matrix.ocaml-version }} 33 | -- 34 | 2.29.2 35 | 36 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/files/0007-multicore-initial-merlin_specific-import.patch: -------------------------------------------------------------------------------- 1 | From e23de59e77f6b3a524f28dd69f6a78c5cddfe97f Mon Sep 17 00:00:00 2001 2 | From: "matt@pallissard.net" 3 | Date: Tue, 17 Nov 2020 21:44:16 -0800 4 | Subject: [PATCH 07/16] multicore: initial merlin_specific import 5 | 6 | --- 7 | src/ocaml/merlin_specific/410+multicore/browse_raw.ml | 8 ++++++-- 8 | src/ocaml/merlin_specific/410+multicore/raw_compat.ml | 2 +- 9 | .../merlin_specific/410+multicore/tail_analysis.ml | 4 ++-- 10 | src/ocaml/merlin_specific/410+multicore/typer_raw.ml | 10 ++++++++++ 11 | 4 files changed, 19 insertions(+), 5 deletions(-) 12 | 13 | diff --git a/src/ocaml/merlin_specific/410+multicore/browse_raw.ml b/src/ocaml/merlin_specific/410+multicore/browse_raw.ml 14 | index c451de40..2c4d23d0 100644 15 | --- a/src/ocaml/merlin_specific/410+multicore/browse_raw.ml 16 | +++ b/src/ocaml/merlin_specific/410+multicore/browse_raw.ml 17 | @@ -317,8 +317,8 @@ let of_expression_desc loc = function 18 | | (_,None) -> id_fold 19 | | (_,Some e) -> of_expression e) 20 | ls 21 | - | Texp_match (e,cs,_) 22 | - | Texp_try (e,cs) -> 23 | + | Texp_match (e,cs,_,_) 24 | + | Texp_try (e,cs,_) -> 25 | of_expression e ** 26 | list_fold of_case cs 27 | | Texp_tuple es | Texp_construct (_,_,es) | Texp_array es -> 28 | @@ -442,6 +442,8 @@ and of_structure_item_desc = function 29 | list_fold (fun x -> app (Module_binding x)) mbs 30 | | Tstr_modtype mtd -> 31 | app (Module_type_declaration mtd) 32 | + | Tstr_effect eff -> 33 | + app (Extension_constructor eff) 34 | | Tstr_class cds -> 35 | list_fold (fun (cd,_) -> app (Class_declaration cd)) cds 36 | | Tstr_class_type ctds -> 37 | @@ -485,6 +487,8 @@ and of_signature_item_desc = function 38 | list_fold (fun md -> app (Module_declaration md)) mds 39 | | Tsig_modtype mtd -> 40 | app (Module_type_declaration mtd) 41 | + | Tsig_effect eff -> 42 | + app (Extension_constructor eff) 43 | | Tsig_include i -> 44 | app (Include_description i) 45 | | Tsig_class cds -> 46 | diff --git a/src/ocaml/merlin_specific/410+multicore/raw_compat.ml b/src/ocaml/merlin_specific/410+multicore/raw_compat.ml 47 | index 9b6012b2..e441124a 100644 48 | --- a/src/ocaml/merlin_specific/410+multicore/raw_compat.ml 49 | +++ b/src/ocaml/merlin_specific/410+multicore/raw_compat.ml 50 | @@ -160,7 +160,7 @@ let texp_function_cases = function 51 | | _ -> assert false 52 | 53 | let tmatch_scrutinee = function 54 | - | Typedtree.Texp_match (e, _, _) -> e 55 | + | Typedtree.Texp_match (e, _, _, _) -> e 56 | | _ -> assert false 57 | 58 | let const_string (s, o) = Asttypes.Const_string (s, o) 59 | diff --git a/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml b/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml 60 | index 0c9680d6..58e52105 100644 61 | --- a/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml 62 | +++ b/src/ocaml/merlin_specific/410+multicore/tail_analysis.ml 63 | @@ -55,8 +55,8 @@ let expr_tail_positions = function 64 | | Texp_while _ | Texp_for _ | Texp_send _ | Texp_new _ 65 | | Texp_unreachable | Texp_extension_constructor _ | Texp_letop _ 66 | -> [] 67 | - | Texp_match (_,cs,_) 68 | - | Texp_try (_,cs) 69 | + | Texp_match (_,cs,_,_) 70 | + | Texp_try (_,cs,_) 71 | -> List.map cs ~f:(fun c -> Case c) 72 | | Texp_letmodule (_,_,_,_,e) | Texp_letexception (_,e) | Texp_let (_,_,e) 73 | | Texp_sequence (_,e) | Texp_ifthenelse (_,e,None) | Texp_open (_, e) 74 | diff --git a/src/ocaml/merlin_specific/410+multicore/typer_raw.ml b/src/ocaml/merlin_specific/410+multicore/typer_raw.ml 75 | index 759875c4..7e314a4f 100644 76 | --- a/src/ocaml/merlin_specific/410+multicore/typer_raw.ml 77 | +++ b/src/ocaml/merlin_specific/410+multicore/typer_raw.ml 78 | @@ -84,6 +84,13 @@ module Rewrite_loc = struct 79 | let loc = if Location_aux.is_relaxed_location loc then loc else u_loc loc in 80 | (loc, u_payload payload) 81 | 82 | + and u_effect { peff_name = loc ; peff_kind; peff_loc; peff_attributes} = 83 | + let loc = if Location_aux.is_relaxed_location loc then loc else u_loc loc in 84 | + { peff_name = loc 85 | + ; peff_kind 86 | + ; peff_loc 87 | + ; peff_attributes} 88 | + 89 | and u_attributes l = List.map ~f:u_attribute l 90 | 91 | and u_payload = function 92 | @@ -152,6 +159,7 @@ module Rewrite_loc = struct 93 | | Ppat_record (fields, flag) -> Ppat_record (List.map ~f:(fun (l,p) -> (u_loc l, u_pattern p)) fields, flag) 94 | | Ppat_array ps -> Ppat_array (List.map ~f:u_pattern ps) 95 | | Ppat_or (p1, p2) -> Ppat_or (u_pattern p1, u_pattern p2) 96 | + | Ppat_effect (p1, p2) -> Ppat_effect (u_pattern p1, u_pattern p2) 97 | | Ppat_constraint (p, ct) -> Ppat_constraint (u_pattern p, u_core_type ct) 98 | | Ppat_type loc -> Ppat_type (u_loc loc) 99 | | Ppat_lazy p -> Ppat_lazy (u_pattern p) 100 | @@ -449,6 +457,7 @@ module Rewrite_loc = struct 101 | | Psig_class_type cts -> Psig_class_type (List.map ~f:u_class_type_declaration cts) 102 | | Psig_attribute attr -> Psig_attribute (u_attribute attr) 103 | | Psig_extension (ext, attrs) -> Psig_extension (u_extension ext, u_attributes attrs) 104 | + | Psig_effect ef -> Psig_effect(u_effect ef) 105 | | Psig_typesubst tds -> Psig_typesubst (List.map ~f:u_type_declaration tds) 106 | | Psig_modsubst ms -> Psig_modsubst (u_module_substitution ms) 107 | 108 | @@ -552,6 +561,7 @@ module Rewrite_loc = struct 109 | | Pstr_class_type ctds -> Pstr_class_type (List.map ~f:u_class_type_declaration ctds) 110 | | Pstr_include id -> Pstr_include (u_include_declaration id) 111 | | Pstr_attribute attr -> Pstr_attribute (u_attribute attr) 112 | + | Pstr_effect ef -> Pstr_effect (u_effect ef) 113 | | Pstr_extension (ext, attrs) -> Pstr_extension (u_extension ext, u_attributes attrs) 114 | 115 | and u_value_binding {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} = 116 | -- 117 | 2.29.2 118 | 119 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/files/0009-multicore-initial-parsing-import.patch: -------------------------------------------------------------------------------- 1 | From 37623df572e9abda4619256dbfe739539f74a450 Mon Sep 17 00:00:00 2001 2 | From: "matt@pallissard.net" 3 | Date: Tue, 17 Nov 2020 21:49:57 -0800 4 | Subject: [PATCH 09/16] multicore: initial parsing import 5 | 6 | --- 7 | src/ocaml/parsing/410+multicore/ast_helper.ml | 27 ++++++++++++++++++ 8 | .../parsing/410+multicore/ast_helper.mli | 7 +++++ 9 | .../parsing/410+multicore/ast_iterator.ml | 20 +++++++++++++ 10 | .../parsing/410+multicore/ast_iterator.mli | 1 + 11 | src/ocaml/parsing/410+multicore/ast_mapper.ml | 23 +++++++++++++++ 12 | .../parsing/410+multicore/ast_mapper.mli | 2 ++ 13 | src/ocaml/parsing/410+multicore/parsetree.mli | 27 ++++++++++++++++++ 14 | src/ocaml/parsing/410+multicore/pprintast.ml | 22 +++++++++++++++ 15 | src/ocaml/parsing/410+multicore/printast.ml | 28 +++++++++++++++++++ 16 | 9 files changed, 157 insertions(+) 17 | 18 | diff --git a/src/ocaml/parsing/410+multicore/ast_helper.ml b/src/ocaml/parsing/410+multicore/ast_helper.ml 19 | index 5c3a22f9..78075d4a 100644 20 | --- a/src/ocaml/parsing/410+multicore/ast_helper.ml 21 | +++ b/src/ocaml/parsing/410+multicore/ast_helper.ml 22 | @@ -167,6 +167,7 @@ module Pat = struct 23 | let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a) 24 | let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b)) 25 | let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a) 26 | + let effect_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_effect(a, b)) 27 | let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a) 28 | end 29 | 30 | @@ -273,6 +274,7 @@ module Sig = struct 31 | let type_subst ?loc a = mk ?loc (Psig_typesubst a) 32 | let type_extension ?loc a = mk ?loc (Psig_typext a) 33 | let exception_ ?loc a = mk ?loc (Psig_exception a) 34 | + let effect_ ?loc a = mk ?loc (Psig_effect a) 35 | let module_ ?loc a = mk ?loc (Psig_module a) 36 | let mod_subst ?loc a = mk ?loc (Psig_modsubst a) 37 | let rec_module ?loc a = mk ?loc (Psig_recmodule a) 38 | @@ -299,6 +301,7 @@ module Str = struct 39 | let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a)) 40 | let type_extension ?loc a = mk ?loc (Pstr_typext a) 41 | let exception_ ?loc a = mk ?loc (Pstr_exception a) 42 | + let effect_ ?loc a = mk ?loc (Pstr_effect a) 43 | let module_ ?loc a = mk ?loc (Pstr_module a) 44 | let rec_module ?loc a = mk ?loc (Pstr_recmodule a) 45 | let modtype ?loc a = mk ?loc (Pstr_modtype a) 46 | @@ -603,6 +606,30 @@ module Te = struct 47 | pext_attributes = add_docs_attrs docs (add_info_attrs info attrs); 48 | } 49 | 50 | + let effect_constructor ?(loc = !default_loc) ?(attrs = []) name kind = 51 | + { 52 | + peff_name = name; 53 | + peff_kind = kind; 54 | + peff_loc = loc; 55 | + peff_attributes = attrs; 56 | + } 57 | + 58 | + let effect_decl ?(loc = !default_loc) ?(attrs = []) ?(args = []) name res = 59 | + { 60 | + peff_name = name; 61 | + peff_kind = Peff_decl(args, res); 62 | + peff_loc = loc; 63 | + peff_attributes = attrs; 64 | + } 65 | + 66 | + let effect_rebind ?(loc = !default_loc) ?(attrs = []) name lid = 67 | + { 68 | + peff_name = name; 69 | + peff_kind = Peff_rebind lid; 70 | + peff_loc = loc; 71 | + peff_attributes = attrs; 72 | + } 73 | + 74 | end 75 | 76 | module Csig = struct 77 | diff --git a/src/ocaml/parsing/410+multicore/ast_helper.mli b/src/ocaml/parsing/410+multicore/ast_helper.mli 78 | index ccd1c20b..d8521825 100644 79 | --- a/src/ocaml/parsing/410+multicore/ast_helper.mli 80 | +++ b/src/ocaml/parsing/410+multicore/ast_helper.mli 81 | @@ -124,6 +124,7 @@ module Pat: 82 | val unpack: ?loc:loc -> ?attrs:attrs -> str_opt -> pattern 83 | val open_: ?loc:loc -> ?attrs:attrs -> lid -> pattern -> pattern 84 | val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern 85 | + val effect_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern 86 | val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern 87 | end 88 | 89 | @@ -239,6 +240,10 @@ module Te: 90 | extension_constructor 91 | val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info -> 92 | str -> lid -> extension_constructor 93 | + 94 | + val effect_constructor: ?loc:loc -> ?attrs:attrs -> str -> effect_constructor_kind -> effect_constructor 95 | + val effect_decl: ?loc:loc -> ?attrs:attrs -> ?args:core_type list -> str -> core_type -> effect_constructor 96 | + val effect_rebind: ?loc:loc -> ?attrs:attrs -> str -> lid -> effect_constructor 97 | end 98 | 99 | (** {1 Module language} *) 100 | @@ -287,6 +292,7 @@ module Sig: 101 | val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item 102 | val type_subst: ?loc:loc -> type_declaration list -> signature_item 103 | val type_extension: ?loc:loc -> type_extension -> signature_item 104 | + val effect_: ?loc:loc -> effect_constructor -> signature_item 105 | val exception_: ?loc:loc -> type_exception -> signature_item 106 | val module_: ?loc:loc -> module_declaration -> signature_item 107 | val mod_subst: ?loc:loc -> module_substitution -> signature_item 108 | @@ -311,6 +317,7 @@ module Str: 109 | val primitive: ?loc:loc -> value_description -> structure_item 110 | val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item 111 | val type_extension: ?loc:loc -> type_extension -> structure_item 112 | + val effect_: ?loc:loc -> effect_constructor -> structure_item 113 | val exception_: ?loc:loc -> type_exception -> structure_item 114 | val module_: ?loc:loc -> module_binding -> structure_item 115 | val rec_module: ?loc:loc -> module_binding list -> structure_item 116 | diff --git a/src/ocaml/parsing/410+multicore/ast_iterator.ml b/src/ocaml/parsing/410+multicore/ast_iterator.ml 117 | index 5f016c00..c6a99b26 100755 118 | --- a/src/ocaml/parsing/410+multicore/ast_iterator.ml 119 | +++ b/src/ocaml/parsing/410+multicore/ast_iterator.ml 120 | @@ -43,6 +43,7 @@ type iterator = { 121 | expr: iterator -> expression -> unit; 122 | extension: iterator -> extension -> unit; 123 | extension_constructor: iterator -> extension_constructor -> unit; 124 | + effect_constructor: iterator -> effect_constructor -> unit; 125 | include_declaration: iterator -> include_declaration -> unit; 126 | include_description: iterator -> include_description -> unit; 127 | label_declaration: iterator -> label_declaration -> unit; 128 | @@ -197,6 +198,21 @@ module T = struct 129 | sub.location sub pext_loc; 130 | sub.attributes sub pext_attributes 131 | 132 | + let iter_effect_constructor_kind sub = function 133 | + Peff_decl(ctl, cto) -> 134 | + List.iter (sub.typ sub) ctl; sub.typ sub cto 135 | + | Peff_rebind li -> 136 | + iter_loc sub li 137 | + 138 | + let iter_effect_constructor sub 139 | + {peff_name; 140 | + peff_kind; 141 | + peff_loc; 142 | + peff_attributes} = 143 | + iter_loc sub peff_name; 144 | + iter_effect_constructor_kind sub peff_kind; 145 | + sub.location sub peff_loc; 146 | + sub.attributes sub peff_attributes 147 | end 148 | 149 | module CT = struct 150 | @@ -276,6 +292,7 @@ module MT = struct 151 | | Psig_typesubst l -> 152 | List.iter (sub.type_declaration sub) l 153 | | Psig_typext te -> sub.type_extension sub te 154 | + | Psig_effect ed -> sub.effect_constructor sub ed 155 | | Psig_exception ed -> sub.type_exception sub ed 156 | | Psig_module x -> sub.module_declaration sub x 157 | | Psig_modsubst x -> sub.module_substitution sub x 158 | @@ -322,6 +339,7 @@ module M = struct 159 | | Pstr_primitive vd -> sub.value_description sub vd 160 | | Pstr_type (_rf, l) -> List.iter (sub.type_declaration sub) l 161 | | Pstr_typext te -> sub.type_extension sub te 162 | + | Pstr_effect ed -> sub.effect_constructor sub ed 163 | | Pstr_exception ed -> sub.type_exception sub ed 164 | | Pstr_module x -> sub.module_binding sub x 165 | | Pstr_recmodule l -> List.iter (sub.module_binding sub) l 166 | @@ -449,6 +467,7 @@ module P = struct 167 | | Ppat_lazy p -> sub.pat sub p 168 | | Ppat_unpack s -> iter_loc sub s 169 | | Ppat_exception p -> sub.pat sub p 170 | + | Ppat_effect (p1,p2) -> sub.pat sub p1; sub.pat sub p2 171 | | Ppat_extension x -> sub.extension sub x 172 | | Ppat_open (lid, p) -> 173 | iter_loc sub lid; sub.pat sub p 174 | @@ -546,6 +565,7 @@ let default_iterator = 175 | type_extension = T.iter_type_extension; 176 | type_exception = T.iter_type_exception; 177 | extension_constructor = T.iter_extension_constructor; 178 | + effect_constructor = T.iter_effect_constructor; 179 | value_description = 180 | (fun this {pval_name; pval_type; pval_prim = _; pval_loc; 181 | pval_attributes} -> 182 | diff --git a/src/ocaml/parsing/410+multicore/ast_iterator.mli b/src/ocaml/parsing/410+multicore/ast_iterator.mli 183 | index 26308d20..4e9f1d43 100755 184 | --- a/src/ocaml/parsing/410+multicore/ast_iterator.mli 185 | +++ b/src/ocaml/parsing/410+multicore/ast_iterator.mli 186 | @@ -45,6 +45,7 @@ type iterator = { 187 | expr: iterator -> expression -> unit; 188 | extension: iterator -> extension -> unit; 189 | extension_constructor: iterator -> extension_constructor -> unit; 190 | + effect_constructor: iterator -> effect_constructor -> unit; 191 | include_declaration: iterator -> include_declaration -> unit; 192 | include_description: iterator -> include_description -> unit; 193 | label_declaration: iterator -> label_declaration -> unit; 194 | diff --git a/src/ocaml/parsing/410+multicore/ast_mapper.ml b/src/ocaml/parsing/410+multicore/ast_mapper.ml 195 | index f8ff4276..56761c27 100644 196 | --- a/src/ocaml/parsing/410+multicore/ast_mapper.ml 197 | +++ b/src/ocaml/parsing/410+multicore/ast_mapper.ml 198 | @@ -44,6 +44,8 @@ type mapper = { 199 | class_type_field: mapper -> class_type_field -> class_type_field; 200 | constructor_declaration: mapper -> constructor_declaration 201 | -> constructor_declaration; 202 | + effect_constructor: mapper -> effect_constructor 203 | + -> effect_constructor; 204 | expr: mapper -> expression -> expression; 205 | extension: mapper -> extension -> extension; 206 | extension_constructor: mapper -> extension_constructor 207 | @@ -208,6 +210,23 @@ module T = struct 208 | (map_loc sub pext_name) 209 | (map_extension_constructor_kind sub pext_kind) 210 | 211 | + let map_effect_constructor_kind sub = function 212 | + Peff_decl(ctl, cto) -> 213 | + Peff_decl(List.map (sub.typ sub) ctl, sub.typ sub cto) 214 | + | Peff_rebind li -> 215 | + Peff_rebind (map_loc sub li) 216 | + 217 | + let map_effect_constructor sub 218 | + {peff_name; 219 | + peff_kind; 220 | + peff_loc; 221 | + peff_attributes} = 222 | + Te.effect_constructor 223 | + (map_loc sub peff_name) 224 | + (map_effect_constructor_kind sub peff_kind) 225 | + ~loc:(sub.location sub peff_loc) 226 | + ~attrs:(sub.attributes sub peff_attributes) 227 | + 228 | end 229 | 230 | module CT = struct 231 | @@ -294,6 +313,7 @@ module MT = struct 232 | | Psig_typesubst l -> 233 | type_subst ~loc (List.map (sub.type_declaration sub) l) 234 | | Psig_typext te -> type_extension ~loc (sub.type_extension sub te) 235 | + | Psig_effect ed -> effect_ ~loc (sub.effect_constructor sub ed) 236 | | Psig_exception ed -> exception_ ~loc (sub.type_exception sub ed) 237 | | Psig_module x -> module_ ~loc (sub.module_declaration sub x) 238 | | Psig_modsubst x -> mod_subst ~loc (sub.module_substitution sub x) 239 | @@ -345,6 +365,7 @@ module M = struct 240 | | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd) 241 | | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l) 242 | | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te) 243 | + | Pstr_effect ed -> effect_ ~loc (sub.effect_constructor sub ed) 244 | | Pstr_exception ed -> exception_ ~loc (sub.type_exception sub ed) 245 | | Pstr_module x -> module_ ~loc (sub.module_binding sub x) 246 | | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l) 247 | @@ -481,6 +502,7 @@ module P = struct 248 | | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s) 249 | | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p) 250 | | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p) 251 | + | Ppat_effect(p1, p2) -> effect_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2) 252 | | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x) 253 | end 254 | 255 | @@ -582,6 +604,7 @@ let default_mapper = 256 | type_extension = T.map_type_extension; 257 | type_exception = T.map_type_exception; 258 | extension_constructor = T.map_extension_constructor; 259 | + effect_constructor = T.map_effect_constructor; 260 | value_description = 261 | (fun this {pval_name; pval_type; pval_prim; pval_loc; 262 | pval_attributes} -> 263 | diff --git a/src/ocaml/parsing/410+multicore/ast_mapper.mli b/src/ocaml/parsing/410+multicore/ast_mapper.mli 264 | index 80d70fcc..48df2398 100644 265 | --- a/src/ocaml/parsing/410+multicore/ast_mapper.mli 266 | +++ b/src/ocaml/parsing/410+multicore/ast_mapper.mli 267 | @@ -73,6 +73,8 @@ type mapper = { 268 | class_type_field: mapper -> class_type_field -> class_type_field; 269 | constructor_declaration: mapper -> constructor_declaration 270 | -> constructor_declaration; 271 | + effect_constructor: mapper -> effect_constructor 272 | + -> effect_constructor; 273 | expr: mapper -> expression -> expression; 274 | extension: mapper -> extension -> extension; 275 | extension_constructor: mapper -> extension_constructor 276 | diff --git a/src/ocaml/parsing/410+multicore/parsetree.mli b/src/ocaml/parsing/410+multicore/parsetree.mli 277 | index 3f943210..77b4e415 100644 278 | --- a/src/ocaml/parsing/410+multicore/parsetree.mli 279 | +++ b/src/ocaml/parsing/410+multicore/parsetree.mli 280 | @@ -247,6 +247,8 @@ and pattern_desc = 281 | *) 282 | | Ppat_exception of pattern 283 | (* exception P *) 284 | + | Ppat_effect of pattern * pattern 285 | + (* effect P P *) 286 | | Ppat_extension of extension 287 | (* [%id] *) 288 | | Ppat_open of Longident.t loc * pattern 289 | @@ -533,6 +535,26 @@ and extension_constructor_kind = 290 | | C = D 291 | *) 292 | 293 | +and effect_constructor = 294 | + { 295 | + peff_name: string loc; 296 | + peff_kind : effect_constructor_kind; 297 | + peff_loc : Location.t; 298 | + peff_attributes: attributes; (* C [@id1] [@id2] of ... *) 299 | + } 300 | + 301 | +and effect_constructor_kind = 302 | + Peff_decl of core_type list * core_type 303 | + (* 304 | + | C of T1 * ... * Tn ([T1; ...; Tn], None) 305 | + | C: T0 ([], Some T0) 306 | + | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0) 307 | + *) 308 | + | Peff_rebind of Longident.t loc 309 | + (* 310 | + | C = D 311 | + *) 312 | + 313 | (** {1 Class language} *) 314 | 315 | (* Type expressions for the class language *) 316 | @@ -755,6 +777,8 @@ and signature_item_desc = 317 | (* type t1 += ... *) 318 | | Psig_exception of type_exception 319 | (* exception C of T *) 320 | + | Psig_effect of effect_constructor 321 | + (* effect C : T -> T *) 322 | | Psig_module of module_declaration 323 | (* module X = M 324 | module X : MT *) 325 | @@ -903,6 +927,9 @@ and structure_item_desc = 326 | | Pstr_exception of type_exception 327 | (* exception C of T 328 | exception C = M.X *) 329 | + | Pstr_effect of effect_constructor 330 | + (* effect C : T -> T 331 | + effect C = M.X *) 332 | | Pstr_module of module_binding 333 | (* module X = ME *) 334 | | Pstr_recmodule of module_binding list 335 | diff --git a/src/ocaml/parsing/410+multicore/pprintast.ml b/src/ocaml/parsing/410+multicore/pprintast.ml 336 | index 2e289027..ace1381b 100644 337 | --- a/src/ocaml/parsing/410+multicore/pprintast.ml 338 | +++ b/src/ocaml/parsing/410+multicore/pprintast.ml 339 | @@ -476,6 +476,8 @@ and simple_pattern ctxt (f:Format.formatter) (x:pattern) : unit = 340 | pp f "@[<2>(lazy@;%a)@]" (simple_pattern ctxt) p 341 | | Ppat_exception p -> 342 | pp f "@[<2>exception@;%a@]" (pattern1 ctxt) p 343 | + | Ppat_effect(p1, p2) -> 344 | + pp f "@[<2>effect@;%a@;%a@]" (pattern1 ctxt) p1 (pattern1 ctxt) p2 345 | | Ppat_extension e -> extension ctxt f e 346 | | Ppat_open (lid, p) -> 347 | let with_paren = 348 | @@ -845,6 +847,9 @@ and exception_declaration ctxt f x = 349 | (extension_constructor ctxt) x.ptyexn_constructor 350 | (item_attributes ctxt) x.ptyexn_attributes 351 | 352 | +and effect_declaration ctxt f ext = 353 | + pp f "@[effect@ %a@]" (effect_constructor ctxt) ext 354 | + 355 | and class_signature ctxt f { pcsig_self = ct; pcsig_fields = l ;_} = 356 | let class_type_field f x = 357 | match x.pctf_desc with 358 | @@ -1094,6 +1099,8 @@ and signature_item ctxt f x : unit = 359 | type_extension ctxt f te 360 | | Psig_exception ed -> 361 | exception_declaration ctxt f ed 362 | + | Psig_effect ed -> 363 | + effect_declaration ctxt f ed 364 | | Psig_class l -> 365 | let class_description kwd f ({pci_params=ls;pci_name={txt;_};_} as x) = 366 | pp f "@[<2>%s %a%a%s@;:@;%a@]%a" kwd 367 | @@ -1310,6 +1317,7 @@ and structure_item ctxt f x = 368 | pp f "@[<2>%a@]" (bindings ctxt) (rf,l) 369 | | Pstr_typext te -> type_extension ctxt f te 370 | | Pstr_exception ed -> exception_declaration ctxt f ed 371 | + | Pstr_effect ed -> effect_declaration ctxt f ed 372 | | Pstr_module x -> 373 | let rec module_helper = function 374 | | {pmod_desc=Pmod_functor(arg_opt,me'); pmod_attributes = []} -> 375 | @@ -1575,6 +1583,20 @@ and extension_constructor ctxt f x = 376 | (attributes ctxt) x.pext_attributes 377 | longident_loc li 378 | 379 | +and effect_constructor ctxt f x = 380 | + match x.peff_kind with 381 | + | Peff_decl(l, r) -> 382 | + pp f "%s%a:@;%a" x.peff_name.txt (attributes ctxt) x.peff_attributes 383 | + (fun f -> function 384 | + | [] -> (core_type1 ctxt) f r 385 | + | l -> pp f "%a@;->@;%a" (list (core_type1 ctxt) ~sep:"*@;") l 386 | + (core_type1 ctxt) r) 387 | + l 388 | + | Peff_rebind li -> 389 | + pp f "%s%a@;=@;%a" x.peff_name.txt (attributes ctxt) 390 | + x.peff_attributes longident_loc li 391 | + 392 | + 393 | and case_list ctxt f l : unit = 394 | let aux f {pc_lhs; pc_guard; pc_rhs} = 395 | pp f "@;| @[<2>%a%a@;->@;%a@]" 396 | diff --git a/src/ocaml/parsing/410+multicore/printast.ml b/src/ocaml/parsing/410+multicore/printast.ml 397 | index 30a0eeb3..aec21529 100644 398 | --- a/src/ocaml/parsing/410+multicore/printast.ml 399 | +++ b/src/ocaml/parsing/410+multicore/printast.ml 400 | @@ -249,6 +249,10 @@ and pattern i ppf x = 401 | | Ppat_exception p -> 402 | line i ppf "Ppat_exception\n"; 403 | pattern i ppf p 404 | + | Ppat_effect(p1, p2) -> 405 | + line i ppf "Ppat_effect\n"; 406 | + pattern i ppf p1; 407 | + pattern i ppf p2 408 | | Ppat_open (m,p) -> 409 | line i ppf "Ppat_open \"%a\"\n" fmt_longident_loc m; 410 | pattern i ppf p 411 | @@ -489,6 +493,24 @@ and extension_constructor_kind i ppf x = 412 | line i ppf "Pext_rebind\n"; 413 | line (i+1) ppf "%a\n" fmt_longident_loc li; 414 | 415 | +and effect_constructor i ppf x = 416 | + line i ppf "effect_constructor %a\n" fmt_location x.peff_loc; 417 | + attributes i ppf x.peff_attributes; 418 | + let i = i + 1 in 419 | + line i ppf "peff_name = \"%s\"\n" x.peff_name.txt; 420 | + line i ppf "peff_kind =\n"; 421 | + effect_constructor_kind (i + 1) ppf x.peff_kind; 422 | + 423 | +and effect_constructor_kind i ppf x = 424 | + match x with 425 | + Peff_decl(a, r) -> 426 | + line i ppf "Peff_decl\n"; 427 | + list (i+1) core_type ppf a; 428 | + core_type (i + 1) ppf r; 429 | + | Peff_rebind li -> 430 | + line i ppf "Peff_rebind\n"; 431 | + line (i+1) ppf "%a\n" fmt_longident_loc li; 432 | + 433 | and class_type i ppf x = 434 | line i ppf "class_type %a\n" fmt_location x.pcty_loc; 435 | attributes i ppf x.pcty_attributes; 436 | @@ -703,6 +725,9 @@ and signature_item i ppf x = 437 | | Psig_typext te -> 438 | line i ppf "Psig_typext\n"; 439 | type_extension i ppf te 440 | + | Psig_effect ext -> 441 | + line i ppf "Psig_effect\n"; 442 | + effect_constructor i ppf ext; 443 | | Psig_exception te -> 444 | line i ppf "Psig_exception\n"; 445 | type_exception i ppf te 446 | @@ -817,6 +842,9 @@ and structure_item i ppf x = 447 | | Pstr_typext te -> 448 | line i ppf "Pstr_typext\n"; 449 | type_extension i ppf te 450 | + | Pstr_effect ext -> 451 | + line i ppf "Pstr_effect\n"; 452 | + effect_constructor i ppf ext; 453 | | Pstr_exception te -> 454 | line i ppf "Pstr_exception\n"; 455 | type_exception i ppf te 456 | -- 457 | 2.29.2 458 | 459 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/files/0014-multicore-differentiate-multicore-with-dune.patch: -------------------------------------------------------------------------------- 1 | From 6af1ecd62343b69410d8c1d9e23b4bbc945dff8e Mon Sep 17 00:00:00 2001 2 | From: "matt@pallissard.net" 3 | Date: Tue, 17 Nov 2020 21:59:55 -0800 4 | Subject: [PATCH 14/16] multicore: differentiate multicore with dune 5 | 6 | --- 7 | src/ocaml/merlin_specific/dune | 11 ++++++++++- 8 | src/ocaml/parsing/dune | 11 ++++++++++- 9 | src/ocaml/preprocess/dune | 11 ++++++++++- 10 | src/ocaml/typing/dune | 6 +++++- 11 | src/ocaml/utils/dune | 6 +++++- 12 | 5 files changed, 40 insertions(+), 5 deletions(-) 13 | 14 | diff --git a/src/ocaml/merlin_specific/dune b/src/ocaml/merlin_specific/dune 15 | index 2803959a..05b9627e 100644 16 | --- a/src/ocaml/merlin_specific/dune 17 | +++ b/src/ocaml/merlin_specific/dune 18 | @@ -4,7 +4,16 @@ module J = Jbuild_plugin.V1 19 | ;; 20 | 21 | let ver = 22 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 23 | + try 24 | + match List.assoc "cmi_magic_number" J.ocamlc_config with 25 | + | "Caml1999I023" -> "407_0" 26 | + | _ -> raise Not_found 27 | + with Not_found -> 28 | + match 29 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 30 | + with 31 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 32 | + | maj, min, _ -> maj ^ min 33 | ;; 34 | 35 | Printf.ksprintf J.send {| 36 | diff --git a/src/ocaml/parsing/dune b/src/ocaml/parsing/dune 37 | index 5fa11506..b8126263 100644 38 | --- a/src/ocaml/parsing/dune 39 | +++ b/src/ocaml/parsing/dune 40 | @@ -4,7 +4,16 @@ module J = Jbuild_plugin.V1 41 | ;; 42 | 43 | let ver = 44 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 45 | + try 46 | + match List.assoc "cmi_magic_number" J.ocamlc_config with 47 | + | "Caml1999I023" -> "407_0" 48 | + | _ -> raise Not_found 49 | + with Not_found -> 50 | + match 51 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 52 | + with 53 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 54 | + | maj, min, _ -> maj ^ min 55 | ;; 56 | 57 | Printf.ksprintf J.send {| 58 | diff --git a/src/ocaml/preprocess/dune b/src/ocaml/preprocess/dune 59 | index 5d471f37..af040ce8 100644 60 | --- a/src/ocaml/preprocess/dune 61 | +++ b/src/ocaml/preprocess/dune 62 | @@ -3,7 +3,16 @@ 63 | module J = Jbuild_plugin.V1 64 | 65 | let ver = 66 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 67 | + try 68 | + match List.assoc "cmi_magic_number" J.ocamlc_config with 69 | + | "Caml1999I023" -> "407_0" 70 | + | _ -> raise Not_found 71 | + with Not_found -> 72 | + match 73 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 74 | + with 75 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 76 | + | maj, min, _ -> maj ^ min 77 | ;; 78 | 79 | Printf.ksprintf J.send {| 80 | diff --git a/src/ocaml/typing/dune b/src/ocaml/typing/dune 81 | index b639e538..3e209ccd 100644 82 | --- a/src/ocaml/typing/dune 83 | +++ b/src/ocaml/typing/dune 84 | @@ -9,7 +9,11 @@ let ver = 85 | | "Caml1999I023" -> "407_0" 86 | | _ -> raise Not_found 87 | with Not_found -> 88 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 89 | + match 90 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 91 | + with 92 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 93 | + | maj, min, _ -> maj ^ min 94 | ;; 95 | 96 | Printf.ksprintf J.send {| 97 | diff --git a/src/ocaml/utils/dune b/src/ocaml/utils/dune 98 | index 0f57f503..64157d1c 100644 99 | --- a/src/ocaml/utils/dune 100 | +++ b/src/ocaml/utils/dune 101 | @@ -9,7 +9,11 @@ let ver = 102 | | "Caml1999I023" -> "407_0" 103 | | _ -> raise Not_found 104 | with Not_found -> 105 | - Scanf.sscanf J.ocaml_version "%s@.%s@." (fun maj min -> maj ^ min) 106 | + match 107 | + Scanf.sscanf J.ocaml_version "%s@.%s@.%d%s" (fun maj min _ var -> maj, min, var) 108 | + with 109 | + | maj, min, "+multicore" -> maj ^ min ^ "+multicore" 110 | + | maj, min, _ -> maj ^ min 111 | 112 | let load_path = 113 | let version = Scanf.sscanf J.ocaml_version "%d.%d." (fun ma mi -> ma, mi) in 114 | -- 115 | 2.29.2 116 | 117 | -------------------------------------------------------------------------------- /packages/merlin/merlin.3.4.1+effects/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "defree@gmail.com" 3 | authors: "The Merlin team" 4 | synopsis: "Reads config files for merlin" 5 | homepage: "https://github.com/ocaml/merlin" 6 | bug-reports: "https://github.com/ocaml/merlin/issues" 7 | dev-repo: "git+https://github.com/ocaml/merlin.git" 8 | build: [ 9 | ["dune" "subst"] {pinned} 10 | ["dune" "build" "-p" name "-j" jobs] 11 | ] 12 | depends: [ 13 | "ocaml" {>= "4.02.1" & < "4.12"} 14 | "base-effects" 15 | "dune" {>= "1.8.0"} 16 | "yojson" {>= "1.6.0"} 17 | "ocamlfind" {>= "1.6.0"} 18 | "csexp" {>= "1.2.3"} 19 | "result" {>= "1.5"} 20 | ] 21 | 22 | url { 23 | src: 24 | "https://github.com/ocaml/merlin/releases/download/v3.4.1/merlin-v3.4.1.tbz" 25 | checksum: [ 26 | "sha256=e7f28ca520d1ab4a58e8ba876b665b1ecf9917cee7e5b3e3330afbd1d12a9e2a" 27 | "sha512=40ae93397aea031c1b4450998b448fc1df9671d612be0a02986688e5dd1390ced1c31bb2cdde9c6b52f8be841ca9fd1931fc302b26ef19cb2e88925d3b360c37" 28 | ] 29 | } 30 | 31 | patches: [ 32 | "0001-Local_store-change-API.patch" 33 | "0002-Destruct-reorganize-ans-add-more-tests-1189.patch" 34 | "0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch" 35 | "0005-Fix-Destruct-ill-typed-completions-1194.patch" 36 | "0006-multicore-initial-merlin_specific-copy.patch" 37 | "0007-multicore-initial-merlin_specific-import.patch" 38 | "0008-multicore-initial-parsing-copy.patch" 39 | "0009-multicore-initial-parsing-import.patch" 40 | "0010-multicore-initial-preprocess-copy.patch" 41 | "0011-multicore-initial-typing-copy.patch" 42 | "0012-multicore-initial-typing-import.patch" 43 | "0013-multicore-initial-util-copy.patch" 44 | "0014-multicore-differentiate-multicore-with-dune.patch" 45 | "0015-multicore-add-upstream-multicore-files.patch" 46 | "0016-add-effect-syntax.patch" 47 | ] 48 | 49 | 50 | extra-files: [ 51 | ["0001-Local_store-change-API.patch" "md5=483940da139a810b305fb699d7f78907"] 52 | ["0002-Destruct-reorganize-ans-add-more-tests-1189.patch" "md5=b85d2bb8467578987e513ab5f3e463f2"] 53 | ["0003-The-dot-merlin-reader-package-is-always-only-valid-f.patch" "md5=9d507cda053708a354afd45b939b5362"] 54 | ["0004-Use-avsm-setup-ocaml-v1-instead-of-1.0.1-1190.patch" "md5=941715dc3abd0f4f29fabf210f6edd4b"] 55 | ["0005-Fix-Destruct-ill-typed-completions-1194.patch" "md5=484da034e74f4696a5d8c3ec09bd520a"] 56 | ["0006-multicore-initial-merlin_specific-copy.patch" "md5=054faf3a3131b9e859a12d3510ebfa82"] 57 | ["0007-multicore-initial-merlin_specific-import.patch" "md5=5e3f5aa92e16dcc17d0626bbbb8af226"] 58 | ["0008-multicore-initial-parsing-copy.patch" "md5=d96c2e407b07886ed94f9cd0dbd6aad5"] 59 | ["0009-multicore-initial-parsing-import.patch" "md5=3ac5cb916b8adaed4b587e6eaccc1283"] 60 | ["0010-multicore-initial-preprocess-copy.patch" "md5=4b50048759c102cf1f8675afdb7e73f5"] 61 | ["0011-multicore-initial-typing-copy.patch" "md5=70687532d17036d5fed3103a4bdb2dbc"] 62 | ["0012-multicore-initial-typing-import.patch" "md5=1be20cf8f0edb6e329a24cc24da03486"] 63 | ["0013-multicore-initial-util-copy.patch" "md5=84e368bfbd78d3d7ea1ee670593d36c1"] 64 | ["0014-multicore-differentiate-multicore-with-dune.patch" "md5=101713b2c6f5b3416fe09dbb5a6cf935"] 65 | ["0015-multicore-add-upstream-multicore-files.patch" "md5=0b02637b5ae8e9dd0b4ade9d5031ede4"] 66 | ["0016-add-effect-syntax.patch" "md5=93bf6e26507936dbcfb01da6d0881c53"] 67 | ] 68 | -------------------------------------------------------------------------------- /packages/ocaml-lsp-server/ocaml-lsp-server.1.4.0+effects/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "LSP Server for OCaml" 3 | description: "An LSP server for OCaml." 4 | maintainer: ["Rudi Grinberg "] 5 | authors: [ 6 | "Andrey Popp <8mayday@gmail.com>" 7 | "Rusty Key " 8 | "Louis Roché " 9 | "Oleksiy Golovko " 10 | "Rudi Grinberg " 11 | "Sacha Ayoun " 12 | "cannorin " 13 | ] 14 | license: "ISC" 15 | homepage: "https://github.com/mattpallissard/ocaml-lsp" 16 | bug-reports: "https://github.com/mattpallissard/ocaml-lsp/issues" 17 | depends: [ 18 | "dune" {>= "2.5"} 19 | "yojson" 20 | "stdlib-shims" 21 | "ppx_yojson_conv_lib" 22 | "dune-build-info" 23 | "dot-merlin-reader" {= "3.4.1"} 24 | "csexp" {>= "1.2.3"} 25 | "result" {>= "1.5"} 26 | "ocamlformat" {with-test} 27 | "ocamlfind" {>= "1.5.2"} 28 | "odoc" {with-doc} 29 | "ocaml" {>= "4.06" & < "4.12"} 30 | "base-effects" 31 | ] 32 | dev-repo: "git+https://github.com/mattpallissard/ocaml-lsp.git" 33 | build: [ 34 | ["dune" "subst"] {dev} 35 | [ 36 | "dune" 37 | "build" 38 | "-j" 39 | jobs 40 | "ocaml-lsp-server.install" 41 | "--release" 42 | ] 43 | ] 44 | x-commit-hash: "bd9e1c77277ab9b021e799107220b348b1cc6562" 45 | url { 46 | src: 47 | "https://github.com/mattpallissard/ocaml-lsp/releases/download/1.4.0-5-gbd9e1c77/jsonrpc-1.4.0-5-gbd9e1c77.tbz" 48 | checksum: [ 49 | "sha256=959f550976f6dfb83e1f962825dc07150bbb5923b0fb81aed9a90a3972e1e352" 50 | "sha512=6e14e1879e203802bbecc9432b5f2efe3317faeb65f418f5aeb7f4b91bf000f79c0ae72fa49a9fee22dc491203a703f22131babc35f559f8a8a2650d49dc65e6" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /packages/ocaml-migrate-parsetree-ocamlbuild/ocaml-migrate-parsetree-ocamlbuild.1.0.10+multicore-1/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "frederic.bour@lakaban.net" 3 | authors: [ 4 | "Jérémie Dimino " 5 | ] 6 | license: "LGPL-2.1" 7 | homepage: "https://github.com/let-def/ocaml-migrate-parsetree" 8 | bug-reports: "https://github.com/let-def/ocaml-migrate-parsetree/issues" 9 | dev-repo: "git://github.com/let-def/ocaml-migrate-parsetree.git" 10 | tags: [ "syntax" "org:ocamllabs" ] 11 | build: [ 12 | ["jbuilder" "build" "-p" name "-j" jobs] 13 | ] 14 | depends: [ 15 | "ocaml" {>= "4.06.1"} 16 | "jbuilder" {build & >= "1.0+beta7"} 17 | "ocaml-migrate-parsetree" 18 | "ocamlbuild" 19 | "base-domains" 20 | ] 21 | url { 22 | src: 23 | "https://github.com/jhwoodyatt/ocaml-migrate-parsetree/archive/v1.0.10+multicore-1.zip" 24 | checksum: "md5=e19e84e0f2b05e6a4c2823b0a585f906" 25 | } 26 | -------------------------------------------------------------------------------- /packages/ocaml-migrate-parsetree/ocaml-migrate-parsetree.1.0.10+multicore-1/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "frederic.bour@lakaban.net" 3 | authors: [ 4 | "Frédéric Bour " 5 | "Jérémie Dimino " 6 | ] 7 | license: "LGPL-2.1" 8 | homepage: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree" 9 | bug-reports: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree/issues" 10 | dev-repo: "git://github.com/ocaml-ppx/ocaml-migrate-parsetree.git" 11 | tags: [ "syntax" "org:ocamllabs" ] 12 | build: [ 13 | ["jbuilder" "build" "-p" name "-j" jobs] 14 | ] 15 | depends: [ 16 | "ocaml" {>= "4.06.1"} 17 | "result" 18 | "ocamlfind" {build} 19 | "jbuilder" {build & >= "1.0+beta18.1"} 20 | "base-effects" 21 | ] 22 | synopsis: "Convert OCaml parsetrees between different versions" 23 | description: """ 24 | This library converts parsetrees, outcometree and ast mappers between different OCaml versions. 25 | High-level functions help making PPX rewriters independent of a compiler version.""" 26 | url { 27 | src: 28 | "https://github.com/jhwoodyatt/ocaml-migrate-parsetree/archive/v1.0.10+multicore-1.zip" 29 | checksum: "md5=e19e84e0f2b05e6a4c2823b0a585f906" 30 | } 31 | -------------------------------------------------------------------------------- /packages/ocaml-migrate-parsetree/ocaml-migrate-parsetree.2.1.0+effect-syntax/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "frederic.bour@lakaban.net" 3 | authors: [ 4 | "Frédéric Bour " 5 | "Jérémie Dimino " 6 | ] 7 | license: "LGPL-2.1 with OCaml linking exception" 8 | homepage: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree" 9 | bug-reports: "https://github.com/ocaml-ppx/ocaml-migrate-parsetree/issues" 10 | dev-repo: "git+https://github.com/ocaml-ppx/ocaml-migrate-parsetree.git" 11 | doc: "https://ocaml-ppx.github.io/ocaml-migrate-parsetree/" 12 | tags: [ "syntax" "org:ocamllabs" ] 13 | build: [ 14 | ["dune" "build" "-p" name "-j" jobs] 15 | ] 16 | depends: [ 17 | "dune" {>= "1.11"} 18 | "ocaml" {>= "4.02.3" & < "4.13"} 19 | "base-effects" 20 | ] 21 | synopsis: "Convert OCaml parsetrees between different versions" 22 | description: """ 23 | Convert OCaml parsetrees between different versions 24 | 25 | This library converts parsetrees, outcometree and ast mappers between 26 | different OCaml versions. High-level functions help making PPX 27 | rewriters independent of a compiler version. 28 | """ 29 | x-commit-hash: "4a05cf7a00d84e5f827cc9ae9c75e5dc85126085" 30 | url { 31 | src: 32 | "https://github.com/ocaml-ppx/ocaml-migrate-parsetree/releases/download/v2.1.0/ocaml-migrate-parsetree-v2.1.0.tbz" 33 | checksum: [ 34 | "sha256=387b788ee4c0537f1fe02c25e05f0335af424828fc6fe940acc0db5948a5a71f" 35 | "sha512=6ac80face6b77531c8d89a77d7a246bd5d43da435c355f62c03c8b8e360e1d7e339c904709fd3dbc9aa340c86ada9a69d5ebcf97cbdb7bd51bec97f831741b99" 36 | ] 37 | } 38 | patches: "0001-works-with-multicore.patch" 39 | extra-files: ["0001-works-with-multicore.patch" "md5=037f10a805b60c0f2ab4f4f70eb2f7a6"] 40 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.02.2+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.02.2, with support for multicore" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.02.2" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | "base-effects" {post} 11 | ] 12 | conflict-class: "ocaml-core-compiler" 13 | flags: compiler 14 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 15 | build: [ 16 | ["./configure" "-prefix" "%{prefix}%" "-with-debug-runtime"] 17 | ["%{make}%" "world.opt"] 18 | ] 19 | install: ["%{make}%" "install"] 20 | url { 21 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/4.02.2.tar.gz" 22 | checksum: "md5=d3881e66b5ccb825dd0eb39b975cc841" 23 | } 24 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.04.2+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.04.2, with support for multicore" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.04.2" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | "base-effects" {post} 11 | ] 12 | conflict-class: "ocaml-core-compiler" 13 | flags: compiler 14 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 15 | build: [ 16 | ["./configure" "-prefix" "%{prefix}%" "-with-debug-runtime"] 17 | ["%{make}%" "world.opt"] 18 | ] 19 | install: ["%{make}%" "install"] 20 | url { 21 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/4.04.2.tar.gz" 22 | checksum: "md5=4764f56a8a59ae96ada53285fef90279" 23 | } 24 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.06.1+multicore+trunk/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "Multicore parallel_minor_gc_4_06" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.06.1" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | ] 10 | conflict-class: "ocaml-core-compiler" 11 | flags: compiler 12 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 13 | build: [ 14 | ["./configure" "-prefix" "%{prefix}%" "-with-debug-runtime"] 15 | ["%{make}%" "world.opt"] 16 | ] 17 | install: ["%{make}%" "install"] 18 | url { 19 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/parallel_minor_gc_4_06.tar.gz" 20 | } 21 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.06.1+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.06.1, with support for multicore" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.06.1" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | ] 10 | conflict-class: "ocaml-core-compiler" 11 | flags: compiler 12 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 13 | build: [ 14 | ["./configure" "-prefix" "%{prefix}%" "-with-debug-runtime"] 15 | ["%{make}%" "world.opt"] 16 | ] 17 | install: ["%{make}%" "install"] 18 | url { 19 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/parallel_minor_gc_4_06.tar.gz" 20 | } 21 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.10.0+multicore+musl+no-effect-syntax/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.10.0, with support for multicore on musl libc" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.10.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | ] 11 | depexts: [ 12 | ["musl-tools"] {os-family = "debian"} 13 | ["musl"] {os-distribution = "arch"} 14 | ["musl-dev" "libexecinfo-dev"] {os-distribution = "alpine"} 15 | ] 16 | conflict-class: "ocaml-core-compiler" 17 | flags: compiler 18 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 19 | build: [ 20 | ["./configure" "--prefix" "%{prefix}%" "--enable-debug-runtime" "--disable-warn-error"] 21 | {os != "openbsd" & os != "freebsd" & os != "macos" & os != "linux"} 22 | [ 23 | "./configure" 24 | "--prefix=%{prefix}%" 25 | "CC=musl-gcc" {os-distribution != "alpine"} 26 | "CFLAGS=-Os" 27 | "ASPP=musl-gcc -c" {os-distribution != "alpine"} 28 | "--enable-debug-runtime" 29 | "--disable-warn-error" 30 | ] {os = "openbsd" | os = "freebsd" | os = "macos" | os = "linux"} 31 | ["%{make}%" "-j%{jobs}%" "world"] 32 | ["%{make}%" "-j%{jobs}%" "world.opt"] 33 | ] 34 | install: ["%{make}%" "install"] 35 | url { 36 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/no-effect-syntax.tar.gz" 37 | } 38 | post-messages: [ 39 | "A failure in the middle of the build may be caused by build parallelism 40 | (enabled by default). 41 | Please file a bug report at https://github.com/ocaml/ocaml/issues" 42 | {failure & jobs > 1} 43 | "You can try installing again including --jobs=1 44 | to force a sequential build instead." 45 | {failure & jobs > 1 & opam-version >= "2.0.5"} 46 | ] 47 | available: !(os = "macos" & arch = "arm64") 48 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.10.0+multicore+musl+static+no-effect-syntax/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.10.0, with support for multicore on musl libc" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.10.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | ] 11 | depexts: [ 12 | ["musl-tools"] {os-family = "debian"} 13 | ["musl"] {os-distribution = "arch"} 14 | ["musl-dev" "libexecinfo-static"] {os-distribution = "alpine"} 15 | ] 16 | conflict-class: "ocaml-core-compiler" 17 | flags: compiler 18 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 19 | build: [ 20 | ["./configure" "--prefix" "%{prefix}%" "--enable-debug-runtime" "--disable-warn-error"] 21 | {os != "openbsd" & os != "freebsd" & os != "macos" & os != "linux"} 22 | [ 23 | "./configure" 24 | "--prefix=%{prefix}%" 25 | "CC=musl-gcc" {os-distribution != "alpine"} 26 | "CFLAGS=-Os" 27 | "ASPP=musl-gcc -c" {os-distribution != "alpine"} 28 | "LIBS=-static" 29 | "--enable-debug-runtime" 30 | "--disable-warn-error" 31 | ] {os = "openbsd" | os = "freebsd" | os = "macos" | os = "linux"} 32 | ["%{make}%" "-j%{jobs}%" "world"] 33 | ["%{make}%" "-j%{jobs}%" "world.opt"] 34 | ] 35 | install: ["%{make}%" "install"] 36 | url { 37 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/no-effect-syntax.tar.gz" 38 | } 39 | post-messages: [ 40 | "A failure in the middle of the build may be caused by build parallelism 41 | (enabled by default). 42 | Please file a bug report at https://github.com/ocaml/ocaml/issues" 43 | {failure & jobs > 1} 44 | "You can try installing again including --jobs=1 45 | to force a sequential build instead." 46 | {failure & jobs > 1 & opam-version >= "2.0.5"} 47 | ] 48 | available: !(os = "macos" & arch = "arm64") 49 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.10.0+multicore+musl+static/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.10.0, with support for multicore on musl libc" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.10.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | "base-effects" {post} 11 | ] 12 | depexts: [ 13 | ["musl-tools"] {os-family = "debian"} 14 | ["musl"] {os-distribution = "arch"} 15 | ["musl-dev" "libexecinfo-static"] {os-distribution = "alpine"} 16 | ] 17 | conflict-class: "ocaml-core-compiler" 18 | flags: compiler 19 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 20 | build: [ 21 | ["./configure" "--prefix" "%{prefix}%" "--enable-debug-runtime" "--disable-warn-error"] 22 | {os != "openbsd" & os != "freebsd" & os != "macos" & os != "linux"} 23 | [ 24 | "./configure" 25 | "--prefix=%{prefix}%" 26 | "CC=musl-gcc" {os-distribution != "alpine"} 27 | "CFLAGS=-Os" 28 | "ASPP=musl-gcc -c" {os-distribution != "alpine"} 29 | "LIBS=-static" 30 | "--enable-debug-runtime" 31 | "--disable-warn-error" 32 | ] {os = "openbsd" | os = "freebsd" | os = "macos" | os = "linux"} 33 | ["%{make}%" "-j%{jobs}%" "world"] 34 | ["%{make}%" "-j%{jobs}%" "world.opt"] 35 | ] 36 | install: ["%{make}%" "install"] 37 | url { 38 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/parallel_minor_gc.tar.gz" 39 | } 40 | post-messages: [ 41 | "A failure in the middle of the build may be caused by build parallelism 42 | (enabled by default). 43 | Please file a bug report at https://github.com/ocaml/ocaml/issues" 44 | {failure & jobs > 1} 45 | "You can try installing again including --jobs=1 46 | to force a sequential build instead." 47 | {failure & jobs > 1 & opam-version >= "2.0.5"} 48 | ] 49 | available: !(os = "macos" & arch = "arm64") 50 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.10.0+multicore+musl/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.10.0, with support for multicore on musl libc" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.10.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | "base-effects" {post} 11 | ] 12 | depexts: [ 13 | ["musl-tools"] {os-family = "debian"} 14 | ["musl"] {os-distribution = "arch"} 15 | ["musl-dev" "libexecinfo-dev"] {os-distribution = "alpine"} 16 | ] 17 | conflict-class: "ocaml-core-compiler" 18 | flags: compiler 19 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 20 | build: [ 21 | ["./configure" "--prefix" "%{prefix}%" "--enable-debug-runtime" "--disable-warn-error"] 22 | {os != "openbsd" & os != "freebsd" & os != "macos" & os != "linux"} 23 | [ 24 | "./configure" 25 | "--prefix=%{prefix}%" 26 | "CC=musl-gcc" {os-distribution != "alpine"} 27 | "CFLAGS=-Os" 28 | "ASPP=musl-gcc -c" {os-distribution != "alpine"} 29 | "--enable-debug-runtime" 30 | "--disable-warn-error" 31 | ] {os = "openbsd" | os = "freebsd" | os = "macos" | os = "linux"} 32 | ["%{make}%" "-j%{jobs}%" "world"] 33 | ["%{make}%" "-j%{jobs}%" "world.opt"] 34 | ] 35 | install: ["%{make}%" "install"] 36 | url { 37 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/parallel_minor_gc.tar.gz" 38 | } 39 | post-messages: [ 40 | "A failure in the middle of the build may be caused by build parallelism 41 | (enabled by default). 42 | Please file a bug report at https://github.com/ocaml/ocaml/issues" 43 | {failure & jobs > 1} 44 | "You can try installing again including --jobs=1 45 | to force a sequential build instead." 46 | {failure & jobs > 1 & opam-version >= "2.0.5"} 47 | ] 48 | available: !(os = "macos" & arch = "arm64") 49 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.10.0+multicore+no-effect-syntax/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.10.0, with support for multicore" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.10.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | ] 11 | conflict-class: "ocaml-core-compiler" 12 | flags: compiler 13 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 14 | build: [ 15 | ["./configure" "--prefix" "%{prefix}%" "--enable-debug-runtime" "--disable-warn-error"] 16 | ["%{make}%" "-j%{jobs}%" "world"] 17 | ["%{make}%" "-j%{jobs}%" "world.opt"] 18 | ] 19 | install: ["%{make}%" "install"] 20 | url { 21 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/no-effect-syntax.tar.gz" 22 | } 23 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.10.0+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.10.0, with support for multicore" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.10.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | "base-effects" {post} 11 | ] 12 | conflict-class: "ocaml-core-compiler" 13 | flags: compiler 14 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 15 | build: [ 16 | ["./configure" "--prefix" "%{prefix}%" "--enable-debug-runtime" "--disable-warn-error"] 17 | ["%{make}%" "-j%{jobs}%" "world"] 18 | ["%{make}%" "-j%{jobs}%" "world.opt"] 19 | ] 20 | install: ["%{make}%" "install"] 21 | url { 22 | src: "https://github.com/ocamllabs/ocaml-multicore/archive/parallel_minor_gc.tar.gz" 23 | } 24 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.12.0+domains+effects/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.12.0, with support for multicore domains and effects" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.12.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | "base-effects" {post} 11 | "ocaml-option-nnp" 12 | ] 13 | conflict-class: "ocaml-core-compiler" 14 | flags: compiler 15 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 16 | build: [ 17 | [ 18 | "./configure" 19 | "--prefix=%{prefix}%" 20 | "--with-afl" {ocaml-option-afl:installed} 21 | "--disable-native-compiler" {ocaml-option-bytecode-only:installed} 22 | "--disable-force-safe-string" {ocaml-option-default-unsafe-string:installed} 23 | "DEFAULT_STRING=unsafe" {ocaml-option-default-unsafe-string:installed} 24 | "--disable-flat-float-array" {ocaml-option-no-flat-float-array:installed} 25 | "--enable-flambda" {ocaml-option-flambda:installed} 26 | "--enable-frame-pointers" {ocaml-option-fp:installed} 27 | "CC=cc" {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & (os="openbsd"|os="macos")} 28 | "CC=musl-gcc" {ocaml-option-musl:installed & os-distribution!="alpine"} 29 | "CFLAGS=-Os" {ocaml-option-musl:installed} 30 | #"CC=gcc -m32" {ocaml-option-32bit:installed & os="linux"} 31 | #"CC=gcc -Wl,-read_only_relocs,suppress -arch i386 -m32" {ocaml-option-32bit:installed & os="macos"} 32 | "ASPP=cc -c" {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & (os="openbsd"|os="macos")} 33 | "ASPP=musl-gcc -c" {ocaml-option-musl:installed & os-distribution!="alpine"} 34 | #"ASPP=gcc -m32 -c" {ocaml-option-32bit:installed & os="linux"} 35 | #"ASPP=gcc -arch i386 -m32 -c" {ocaml-option-32bit:installed & os="macos"} 36 | #"AS=as --32" {ocaml-option-32bit:installed & os="linux"} 37 | #"AS=as -arch i386" {ocaml-option-32bit:installed & os="macos"} 38 | #"--host=i386-linux" {ocaml-option-32bit:installed & os="linux"} 39 | #"--host=i386-apple-darwin13.2.0" {ocaml-option-32bit:installed & os="macos"} 40 | #"PARTIALLD=ld -r -melf_i386" {ocaml-option-32bit:installed & os="linux"} 41 | # 32bit options above commented out just to reduce diff with ocaml-variants.4.12.0+options 42 | "LIBS=-static" {ocaml-option-static:installed} 43 | "--disable-warn-error" 44 | ] 45 | [make "-j%{jobs}%"] 46 | ] 47 | install: [make "install"] 48 | url { 49 | src: "git+https://github.com/ocaml-multicore/ocaml-multicore.git#4.12+domains+effects" 50 | } 51 | conflicts: [ 52 | "ocaml-options-vanilla" # This is not vanilla OCaml! 53 | "ocaml-option-32bit" # Not yet implemented 54 | "ocaml-option-nnpchecker" # Fundamentally not possible 55 | ] 56 | depopts: [ 57 | "ocaml-option-afl" 58 | "ocaml-option-bytecode-only" 59 | "ocaml-option-default-unsafe-string" 60 | "ocaml-option-no-flat-float-array" 61 | "ocaml-option-flambda" 62 | "ocaml-option-fp" 63 | "ocaml-option-musl" 64 | "ocaml-option-static" 65 | ] 66 | -------------------------------------------------------------------------------- /packages/ocaml-variants/ocaml-variants.4.12.0+domains/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "OCaml 4.12.0, with support for multicore domains" 3 | maintainer: "platform@lists.ocaml.org" 4 | depends: [ 5 | "ocaml" {= "4.12.0" & post} 6 | "base-unix" {post} 7 | "base-bigarray" {post} 8 | "base-threads" {post} 9 | "base-domains" {post} 10 | "ocaml-option-nnp" 11 | ] 12 | conflict-class: "ocaml-core-compiler" 13 | flags: compiler 14 | setenv: CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs" 15 | build: [ 16 | [ 17 | "./configure" 18 | "--prefix=%{prefix}%" 19 | "--with-afl" {ocaml-option-afl:installed} 20 | "--disable-native-compiler" {ocaml-option-bytecode-only:installed} 21 | "--disable-force-safe-string" {ocaml-option-default-unsafe-string:installed} 22 | "DEFAULT_STRING=unsafe" {ocaml-option-default-unsafe-string:installed} 23 | "--disable-flat-float-array" {ocaml-option-no-flat-float-array:installed} 24 | "--enable-flambda" {ocaml-option-flambda:installed} 25 | "--enable-frame-pointers" {ocaml-option-fp:installed} 26 | "CC=cc" {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & (os="openbsd"|os="macos")} 27 | "CC=musl-gcc" {ocaml-option-musl:installed & os-distribution!="alpine"} 28 | "CFLAGS=-Os" {ocaml-option-musl:installed} 29 | #"CC=gcc -m32" {ocaml-option-32bit:installed & os="linux"} 30 | #"CC=gcc -Wl,-read_only_relocs,suppress -arch i386 -m32" {ocaml-option-32bit:installed & os="macos"} 31 | "ASPP=cc -c" {!ocaml-option-32bit:installed & !ocaml-option-musl:installed & (os="openbsd"|os="macos")} 32 | "ASPP=musl-gcc -c" {ocaml-option-musl:installed & os-distribution!="alpine"} 33 | #"ASPP=gcc -m32 -c" {ocaml-option-32bit:installed & os="linux"} 34 | #"ASPP=gcc -arch i386 -m32 -c" {ocaml-option-32bit:installed & os="macos"} 35 | #"AS=as --32" {ocaml-option-32bit:installed & os="linux"} 36 | #"AS=as -arch i386" {ocaml-option-32bit:installed & os="macos"} 37 | #"--host=i386-linux" {ocaml-option-32bit:installed & os="linux"} 38 | #"--host=i386-apple-darwin13.2.0" {ocaml-option-32bit:installed & os="macos"} 39 | #"PARTIALLD=ld -r -melf_i386" {ocaml-option-32bit:installed & os="linux"} 40 | # 32bit options above commented out just to reduce diff with ocaml-variants.4.12.0+options 41 | "LIBS=-static" {ocaml-option-static:installed} 42 | "--disable-warn-error" 43 | ] 44 | [make "-j%{jobs}%"] 45 | ] 46 | install: [make "install"] 47 | url { 48 | src: "git+https://github.com/ocaml-multicore/ocaml-multicore.git#4.12+domains" 49 | } 50 | conflicts: [ 51 | "ocaml-options-vanilla" # This is not vanilla OCaml! 52 | "ocaml-option-32bit" # Not yet implemented 53 | "ocaml-option-nnpchecker" # Fundamentally not possible 54 | ] 55 | depopts: [ 56 | "ocaml-option-afl" 57 | "ocaml-option-bytecode-only" 58 | "ocaml-option-default-unsafe-string" 59 | "ocaml-option-no-flat-float-array" 60 | "ocaml-option-flambda" 61 | "ocaml-option-fp" 62 | "ocaml-option-musl" 63 | "ocaml-option-static" 64 | ] 65 | -------------------------------------------------------------------------------- /packages/ppx_tools/ppx_tools.5.0+4.02.3+effects/findlib: -------------------------------------------------------------------------------- 1 | ppx_tools 2 | -------------------------------------------------------------------------------- /packages/ppx_tools/ppx_tools.5.0+4.02.3+effects/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "alain.frisch@lexifi.com" 3 | authors: [ "Alain Frisch " ] 4 | license: "MIT" 5 | homepage: "https://github.com/alainfrisch/ppx_tools" 6 | bug-reports: "https://github.com/alainfrisch/ppx_tools/issues" 7 | dev-repo: "git://github.com/alainfrisch/ppx_tools.git#4.02" 8 | tags: [ "syntax" ] 9 | build: [[make "all"]] 10 | install: [[make "install"]] 11 | remove: [["ocamlfind" "remove" "ppx_tools"]] 12 | depends: [ 13 | "ocaml" {>= "4.02.0" & < "4.03.0"} 14 | "ocamlfind" {>= "1.5.0"} 15 | "base-domains" 16 | ] 17 | synopsis: "Tools for authors of ppx rewriters and other syntactic tools" 18 | flags: light-uninstall 19 | url { 20 | src: 21 | "https://github.com/kayceesrk/ppx_tools/archive/v4.02.3-effects.tar.gz" 22 | checksum: "md5=94b1b58ae78d195ed77965a4d6e47ae2" 23 | } 24 | -------------------------------------------------------------------------------- /packages/ppx_tools/ppx_tools.5.1+4.06.0+multicore-1/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | name: "ppx_tools" 3 | maintainer: "alain.frisch@lexifi.com" 4 | authors: [ "Alain Frisch " ] 5 | license: "MIT" 6 | homepage: "https://github.com/ocaml-ppx/ppx_tools" 7 | bug-reports: "https://github.com/ocaml-ppx/ppx_tools/issues" 8 | dev-repo: "git://github.com/ocaml-ppx/ppx_tools.git" 9 | tags: [ "syntax" ] 10 | build: [[make "all"]] 11 | install: [[make "install"]] 12 | remove: [["ocamlfind" "remove" "ppx_tools"]] 13 | depends: [ 14 | "ocaml" {>= "4.06.0"} 15 | "ocamlfind" {>= "1.5.0"} 16 | "base-effects" 17 | ] 18 | synopsis: "Tools for authors of ppx rewriters and other syntactic tools" 19 | flags: light-uninstall 20 | url { 21 | src: 22 | "https://github.com/jhwoodyatt/ppx_tools/archive/5.1+4.06.0+multicore-1.zip" 23 | checksum: "md5=4f036f24a88d86c79d89e00538cc371d" 24 | } 25 | -------------------------------------------------------------------------------- /packages/ppxlib/ppxlib.0.22.0+effect-syntax/files/0001-compiles-with-multicore.patch: -------------------------------------------------------------------------------- 1 | From d3f66b370ff37319eaa6e0068c99b3225ccdbd50 Mon Sep 17 00:00:00 2001 2 | From: Sudha Parimala 3 | Date: Wed, 10 Feb 2021 16:33:01 +0530 4 | Subject: [PATCH] compiles with multicore 5 | 6 | --- 7 | ast/ast.ml | 33 +++++++++++++++++++++++++++++++++ 8 | ast/pprintast.ml | 2 ++ 9 | 2 files changed, 35 insertions(+) 10 | 11 | diff --git a/ast/ast.ml b/ast/ast.ml 12 | index 7ecec02..e8e2b11 100644 13 | --- a/ast/ast.ml 14 | +++ b/ast/ast.ml 15 | @@ -353,6 +353,8 @@ and pattern_desc = Parsetree.pattern_desc = 16 | *) 17 | | Ppat_exception of pattern 18 | (* exception P *) 19 | + | Ppat_effect of pattern * pattern 20 | + (* effect P P *) 21 | | Ppat_extension of extension 22 | (* [%id] *) 23 | | Ppat_open of longident_loc * pattern 24 | @@ -857,6 +859,8 @@ and signature_item_desc = Parsetree.signature_item_desc = 25 | (* type t1 += ... *) 26 | | Psig_exception of type_exception 27 | (* exception C of T *) 28 | + | Psig_effect of Parsetree.effect_constructor 29 | + (* effect C : T -> T *) 30 | | Psig_module of module_declaration 31 | (* module X : MT *) 32 | | Psig_modsubst of module_substitution 33 | @@ -997,6 +1001,9 @@ and structure_item_desc = Parsetree.structure_item_desc = 34 | | Pstr_exception of type_exception 35 | (* exception C of T 36 | exception C = M.X *) 37 | + | Pstr_effect of Parsetree.effect_constructor 38 | + (* effect C : T -> T 39 | + effect C = M.X *) 40 | | Pstr_module of module_binding 41 | (* module X = ME *) 42 | | Pstr_recmodule of module_binding list 43 | @@ -1268,6 +1275,9 @@ class virtual map = 44 | | Ppat_unpack a -> 45 | let a = self#loc (self#option self#string) a in Ppat_unpack a 46 | | Ppat_exception a -> let a = self#pattern a in Ppat_exception a 47 | + | Ppat_effect (a, b) -> 48 | + let a = self#pattern a in 49 | + let b = self#pattern b in Ppat_effect (a, b) 50 | | Ppat_extension a -> let a = self#extension a in Ppat_extension a 51 | | Ppat_open (a, b) -> 52 | let a = self#longident_loc a in 53 | @@ -1760,6 +1770,7 @@ class virtual map = 54 | | Psig_typext a -> let a = self#type_extension a in Psig_typext a 55 | | Psig_exception a -> 56 | let a = self#type_exception a in Psig_exception a 57 | + | Psig_effect a -> failwith "unimplemented" 58 | | Psig_module a -> let a = self#module_declaration a in Psig_module a 59 | | Psig_modsubst a -> 60 | let a = self#module_substitution a in Psig_modsubst a 61 | @@ -1884,6 +1895,7 @@ class virtual map = 62 | | Pstr_typext a -> let a = self#type_extension a in Pstr_typext a 63 | | Pstr_exception a -> 64 | let a = self#type_exception a in Pstr_exception a 65 | + | Pstr_effect a -> failwith "unimplemented" 66 | | Pstr_module a -> let a = self#module_binding a in Pstr_module a 67 | | Pstr_recmodule a -> 68 | let a = self#list self#module_binding a in Pstr_recmodule a 69 | @@ -2090,6 +2102,7 @@ class virtual iter = 70 | | Ppat_lazy a -> self#pattern a 71 | | Ppat_unpack a -> self#loc (self#option self#string) a 72 | | Ppat_exception a -> self#pattern a 73 | + | Ppat_effect (a, b) -> failwith "unimplemented" 74 | | Ppat_extension a -> self#extension a 75 | | Ppat_open (a, b) -> (self#longident_loc a; self#pattern b) 76 | method expression : expression -> unit= 77 | @@ -2435,6 +2448,7 @@ class virtual iter = 78 | | Psig_typesubst a -> self#list self#type_declaration a 79 | | Psig_typext a -> self#type_extension a 80 | | Psig_exception a -> self#type_exception a 81 | + | Psig_effect a -> failwith "unimplemented" 82 | | Psig_module a -> self#module_declaration a 83 | | Psig_modsubst a -> self#module_substitution a 84 | | Psig_recmodule a -> self#list self#module_declaration a 85 | @@ -2525,6 +2539,7 @@ class virtual iter = 86 | (self#rec_flag a; self#list self#type_declaration b) 87 | | Pstr_typext a -> self#type_extension a 88 | | Pstr_exception a -> self#type_exception a 89 | + | Pstr_effect a -> failwith "unimplemented" 90 | | Pstr_module a -> self#module_binding a 91 | | Pstr_recmodule a -> self#list self#module_binding a 92 | | Pstr_modtype a -> self#module_type_declaration a 93 | @@ -2795,6 +2810,7 @@ class virtual ['acc] fold = 94 | | Ppat_lazy a -> self#pattern a acc 95 | | Ppat_unpack a -> self#loc (self#option self#string) a acc 96 | | Ppat_exception a -> self#pattern a acc 97 | + | Ppat_effect (a, b) -> failwith "unimplemented" 98 | | Ppat_extension a -> self#extension a acc 99 | | Ppat_open (a, b) -> 100 | let acc = self#longident_loc a acc in 101 | @@ -3273,6 +3289,7 @@ class virtual ['acc] fold = 102 | | Psig_typesubst a -> self#list self#type_declaration a acc 103 | | Psig_typext a -> self#type_extension a acc 104 | | Psig_exception a -> self#type_exception a acc 105 | + | Psig_effect a -> failwith "unimplemented" 106 | | Psig_module a -> self#module_declaration a acc 107 | | Psig_modsubst a -> self#module_substitution a acc 108 | | Psig_recmodule a -> self#list self#module_declaration a acc 109 | @@ -3393,6 +3410,7 @@ class virtual ['acc] fold = 110 | let acc = self#list self#type_declaration b acc in acc 111 | | Pstr_typext a -> self#type_extension a acc 112 | | Pstr_exception a -> self#type_exception a acc 113 | + | Pstr_effect a -> failwith "unimplemented" 114 | | Pstr_module a -> self#module_binding a acc 115 | | Pstr_recmodule a -> self#list self#module_binding a acc 116 | | Pstr_modtype a -> self#module_type_declaration a acc 117 | @@ -3738,6 +3756,7 @@ class virtual ['acc] fold_map = 118 | ((Ppat_unpack a), acc) 119 | | Ppat_exception a -> 120 | let (a, acc) = self#pattern a acc in ((Ppat_exception a), acc) 121 | + | Ppat_effect (a, b) -> failwith "unimplemented" 122 | | Ppat_extension a -> 123 | let (a, acc) = self#extension a acc in 124 | ((Ppat_extension a), acc) 125 | @@ -4419,6 +4438,7 @@ class virtual ['acc] fold_map = 126 | | Psig_exception a -> 127 | let (a, acc) = self#type_exception a acc in 128 | ((Psig_exception a), acc) 129 | + | Psig_effect a -> failwith "unimplemented" 130 | | Psig_module a -> 131 | let (a, acc) = self#module_declaration a acc in 132 | ((Psig_module a), acc) 133 | @@ -4607,6 +4627,7 @@ class virtual ['acc] fold_map = 134 | | Pstr_exception a -> 135 | let (a, acc) = self#type_exception a acc in 136 | ((Pstr_exception a), acc) 137 | + | Pstr_effect a -> failwith "unimplemented" 138 | | Pstr_module a -> 139 | let (a, acc) = self#module_binding a acc in 140 | ((Pstr_module a), acc) 141 | @@ -4945,6 +4966,7 @@ class virtual ['ctx] map_with_context = 142 | Ppat_unpack a 143 | | Ppat_exception a -> 144 | let a = self#pattern ctx a in Ppat_exception a 145 | + | Ppat_effect (a, b) -> failwith "unimplemented" 146 | | Ppat_extension a -> 147 | let a = self#extension ctx a in Ppat_extension a 148 | | Ppat_open (a, b) -> 149 | @@ -5526,6 +5548,7 @@ class virtual ['ctx] map_with_context = 150 | let a = self#type_extension ctx a in Psig_typext a 151 | | Psig_exception a -> 152 | let a = self#type_exception ctx a in Psig_exception a 153 | + | Psig_effect a -> failwith "unimplemented" 154 | | Psig_module a -> 155 | let a = self#module_declaration ctx a in Psig_module a 156 | | Psig_modsubst a -> 157 | @@ -5675,6 +5698,9 @@ class virtual ['ctx] map_with_context = 158 | let a = self#type_extension ctx a in Pstr_typext a 159 | | Pstr_exception a -> 160 | let a = self#type_exception ctx a in Pstr_exception a 161 | + | Pstr_effect a -> failwith "unimplemented" 162 | + (* let a = self#parsetree__effect_constructor ctx a in 163 | + Pstr_effect a *) 164 | | Pstr_module a -> 165 | let a = self#module_binding ctx a in Pstr_module a 166 | | Pstr_recmodule a -> 167 | @@ -6041,6 +6067,9 @@ class virtual ['res] lift = 168 | self#constr "Ppat_unpack" [a] 169 | | Ppat_exception a -> 170 | let a = self#pattern a in self#constr "Ppat_exception" [a] 171 | + | Ppat_effect (a, b) -> 172 | + let a = self#pattern a in 173 | + let b = self#pattern b in self#constr "Ppat_effect" [a; b] 174 | | Ppat_extension a -> 175 | let a = self#extension a in self#constr "Ppat_extension" [a] 176 | | Ppat_open (a, b) -> 177 | @@ -6631,6 +6660,9 @@ class virtual ['res] lift = 178 | let a = self#type_extension a in self#constr "Psig_typext" [a] 179 | | Psig_exception a -> 180 | let a = self#type_exception a in self#constr "Psig_exception" [a] 181 | + | Psig_effect a -> failwith "unimplemented" 182 | + (* let a = self#parsetree__effect_constructor a in 183 | + self#constr "Psig_effect" [a] *) 184 | | Psig_module a -> 185 | let a = self#module_declaration a in 186 | self#constr "Psig_module" [a] 187 | @@ -6797,6 +6829,7 @@ class virtual ['res] lift = 188 | let a = self#type_extension a in self#constr "Pstr_typext" [a] 189 | | Pstr_exception a -> 190 | let a = self#type_exception a in self#constr "Pstr_exception" [a] 191 | + | Pstr_effect a -> failwith "unimplemented" 192 | | Pstr_module a -> 193 | let a = self#module_binding a in self#constr "Pstr_module" [a] 194 | | Pstr_recmodule a -> 195 | diff --git a/ast/pprintast.ml b/ast/pprintast.ml 196 | index 91d771b..3c37771 100644 197 | --- a/ast/pprintast.ml 198 | +++ b/ast/pprintast.ml 199 | @@ -1094,6 +1094,7 @@ and signature_item ctxt f x : unit = 200 | type_extension ctxt f te 201 | | Psig_exception ed -> 202 | exception_declaration ctxt f ed 203 | + | Psig_effect ec -> failwith "unimplemented" 204 | | Psig_class l -> 205 | let class_description kwd f ({pci_params=ls;pci_name={txt;_};_} as x) = 206 | pp f "@[<2>%s %a%a%s@;:@;%a@]%a" kwd 207 | @@ -1319,6 +1320,7 @@ and structure_item ctxt f x = 208 | pp f "@[<2>%a@]" (bindings ctxt) (rf,l) 209 | | Pstr_typext te -> type_extension ctxt f te 210 | | Pstr_exception ed -> exception_declaration ctxt f ed 211 | + | Pstr_effect ec -> failwith "unimplemented" 212 | | Pstr_module x -> 213 | let rec module_helper = function 214 | | {pmod_desc=Pmod_functor(arg_opt,me'); pmod_attributes = []} -> 215 | -- 216 | 2.17.1 217 | 218 | -------------------------------------------------------------------------------- /packages/ppxlib/ppxlib.0.22.0+effect-syntax/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "Standard library for ppx rewriters" 3 | description: """ 4 | Ppxlib is the standard library for ppx rewriters and other programs 5 | that manipulate the in-memory reprensation of OCaml programs, a.k.a 6 | the "Parsetree". 7 | 8 | It also comes bundled with two ppx rewriters that are commonly used to 9 | write tools that manipulate and/or generate Parsetree values; 10 | `ppxlib.metaquot` which allows to construct Parsetree values using the 11 | OCaml syntax directly and `ppxlib.traverse` which provides various 12 | ways of automatically traversing values of a given type, in particular 13 | allowing to inject a complex structured value into generated code. 14 | """ 15 | maintainer: ["opensource@janestreet.com"] 16 | authors: ["Jane Street Group, LLC "] 17 | license: "MIT" 18 | homepage: "https://github.com/ocaml-ppx/ppxlib" 19 | doc: "https://ocaml-ppx.github.io/ppxlib/" 20 | bug-reports: "https://github.com/ocaml-ppx/ppxlib/issues" 21 | depends: [ 22 | "dune" {>= "2.7"} 23 | "ocaml" {>= "4.04.1" & < "4.13"} 24 | "base-effects" 25 | "ocaml-compiler-libs" {>= "v0.11.0"} 26 | "ocaml-migrate-parsetree" {>= "2.1.0"} 27 | "ppx_derivers" {>= "1.0"} 28 | "sexplib0" 29 | "stdlib-shims" 30 | "ocamlfind" {with-test} 31 | "re" {with-test & >= "1.9.0"} 32 | "cinaps" {with-test & >= "v0.12.1"} 33 | "base" {with-test} 34 | "stdio" {with-test} 35 | "odoc" {with-doc} 36 | ] 37 | build: [ 38 | ["dune" "subst"] {dev} 39 | [ 40 | "dune" 41 | "build" 42 | "-p" 43 | name 44 | "-j" 45 | jobs 46 | "@install" 47 | "@runtest" {with-test} 48 | "@doc" {with-doc} 49 | ] 50 | ] 51 | dev-repo: "git+https://github.com/ocaml-ppx/ppxlib.git" 52 | x-commit-hash: "06a2c9bdad8c1d3361a3d9430e9bf58476b08590" 53 | url { 54 | src: 55 | "https://github.com/ocaml-ppx/ppxlib/releases/download/0.22.0/ppxlib-0.22.0.tbz" 56 | checksum: [ 57 | "sha256=3eeb91e03966662284a3222e612dee7f4fa2b7637c53d9572d2a74134bb96d7a" 58 | "sha512=425051dff9df53579a6edd17369d66c10f87a78daeddf1691e50997990ed643e874fcc6a30112a4dacbfd2d0097a19445354e04cd920d9522f76c51cdbc7f1db" 59 | ] 60 | } 61 | patches: "0001-compiles-with-multicore.patch" 62 | extra-files: ["0001-compiles-with-multicore.patch" "md5=9912fb3291479ff179f12f83d0362bde"] 63 | -------------------------------------------------------------------------------- /packages/reagents/reagents.0.1.0/findlib: -------------------------------------------------------------------------------- 1 | reagents 2 | -------------------------------------------------------------------------------- /packages/reagents/reagents.0.1.0/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/ocamllabs/reagents" 5 | doc: "https://ocamllabs.github.io/reagents/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/ocamllabs/reagents.git" 8 | bug-reports: "https://github.com/ocamllabs/reagents/issues" 9 | depends: [ 10 | "ocaml" {>= "4.02.2"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | "lockfree" {>= "0.1.0"} 15 | "kcas" {>= "0.1.2"} 16 | "base-domains" 17 | ] 18 | build: [ 19 | "ocaml" "pkg/pkg.ml" "build" 20 | "--pinned" pinned ] 21 | synopsis: "Composable lock-free data and synchronization structures" 22 | description: """ 23 | reagents is TODO 24 | 25 | reagents is distributed under the ISC license.""" 26 | url { 27 | src: 28 | "https://github.com/ocamllabs/reagents/releases/download/0.1.0/reagents-0.1.0.tbz" 29 | checksum: "md5=dfd94555024a4b3e3d7f8ba0538034f8" 30 | } 31 | -------------------------------------------------------------------------------- /packages/reagents/reagents.0.1.1/findlib: -------------------------------------------------------------------------------- 1 | reagents 2 | -------------------------------------------------------------------------------- /packages/reagents/reagents.0.1.1/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/ocamllabs/reagents" 5 | doc: "https://ocamllabs.github.io/reagents/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/ocamllabs/reagents.git" 8 | bug-reports: "https://github.com/ocamllabs/reagents/issues" 9 | depends: [ 10 | "ocaml" {>= "4.02.2"} 11 | "ocamlfind" {build} 12 | "ocamlbuild" {build} 13 | "topkg" {build} 14 | "lockfree" {>= "0.1.0"} 15 | "kcas" {>= "0.1.2"} 16 | "base-domains" 17 | ] 18 | build: [ 19 | "ocaml" "pkg/pkg.ml" "build" 20 | "--pinned" pinned ] 21 | synopsis: "Composable lock-free data and synchronization structures" 22 | description: """ 23 | reagents is TODO 24 | 25 | reagents is distributed under the ISC license.""" 26 | url { 27 | src: 28 | "https://github.com/ocamllabs/reagents/releases/download/0.1.1/reagents-0.1.1.tbz" 29 | checksum: "md5=7fef33c0221caee3645cd87882049bac" 30 | } 31 | -------------------------------------------------------------------------------- /packages/reagents/reagents.0.3.0/findlib: -------------------------------------------------------------------------------- 1 | reagents 2 | -------------------------------------------------------------------------------- /packages/reagents/reagents.0.3.0/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "KC Sivaramakrishnan " 3 | authors: ["KC Sivaramakrishnan "] 4 | homepage: "https://github.com/ocamllabs/reagents" 5 | doc: "https://ocamllabs.github.io/reagents/doc" 6 | license: "ISC" 7 | dev-repo: "git+https://github.com/ocamllabs/reagents.git" 8 | bug-reports: "https://github.com/ocamllabs/reagents/issues" 9 | depends: [ 10 | "ocaml" {>= "4.02.2"} 11 | "lockfree" {>= "0.1.0"} 12 | "kcas" {>= "0.1.2"} 13 | "base-domains" 14 | ] 15 | build: [ 16 | ["jbuilder" "subst"] {pinned} 17 | ["jbuilder" "build" "-p" name "-j" jobs] 18 | ] 19 | synopsis: "Composable lock-free data and synchronization structures" 20 | description: """ 21 | reagents is TODO 22 | 23 | reagents is distributed under the ISC license.""" 24 | url { 25 | src: 26 | "https://github.com/ocamllabs/reagents/releases/download/0.3.0/reagents-0.3.0.tbz" 27 | checksum: "md5=c06f03c6e7fdd4a7527dcd4a5e73e6ad" 28 | } 29 | -------------------------------------------------------------------------------- /packages/ssl/ssl.0.5.3+multicore/findlib: -------------------------------------------------------------------------------- 1 | ssl 2 | -------------------------------------------------------------------------------- /packages/ssl/ssl.0.5.3+multicore/opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | maintainer: "Christopher Zimmermann " 3 | authors: "Samuel Mimram " 4 | homepage: "https://github.com/savonet/ocaml-ssl" 5 | bug-reports: "https://github.com/savonet/ocaml-ssl/issues" 6 | dev-repo: "git+https://github.com/savonet/ocaml-ssl.git" 7 | build: [ 8 | ["./configure" "--prefix" prefix] {os != "macos"} 9 | [ 10 | "sh" 11 | "-exc" 12 | "./configure --prefix %{prefix}% CPPFLAGS=\"$CPPFLAGS -I/opt/local/include -I/usr/local/opt/openssl/include\"" 13 | ] {os = "macos"} 14 | [make] 15 | ] 16 | install: [make "install"] 17 | remove: ["ocamlfind" "remove" name] 18 | depends: [ 19 | "ocaml" 20 | "ocamlfind" {build} 21 | "conf-which" {build} 22 | "conf-openssl" 23 | "base-domains" 24 | ] 25 | synopsis: "Bindings for OpenSSL" 26 | flags: light-uninstall 27 | url { 28 | src: "https://github.com/dhil/ocaml-ssl/archive/0.5.3+multicore.tar.gz" 29 | checksum: "md5=9d51fc25137114a20ebab7a5968006d7" 30 | } 31 | -------------------------------------------------------------------------------- /repo: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | upstream: "https://github.com/ocaml-multicore/multicore-opam/tree/master/" 3 | --------------------------------------------------------------------------------